From cadbde88ac2a1acecd20cfa13e65e738fa5765f3 Mon Sep 17 00:00:00 2001 From: voodoos <5031221+voodoos@users.noreply.github.com> Date: Sun, 1 Dec 2024 12:01:04 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20voodoos/?= =?UTF-8?q?ocamix@8c30d13c1b524f423716ee28129d72daa4cdb5fd=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_worker.bc.js | 6394 +++++++++++++++++++------------------ main.bc.js | 7668 ++++++++++++++++++++++----------------------- vtable/main.bc.js | 3094 +++++++++--------- yjs/bundle.js | 18 +- yjs/bundle.js.map | 6 +- 5 files changed, 8546 insertions(+), 8634 deletions(-) diff --git a/db_worker.bc.js b/db_worker.bc.js index ceb9872..4426d71 100644 --- a/db_worker.bc.js +++ b/db_worker.bc.js @@ -1,41 +1,43 @@ // Generated by js_of_ocaml -//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.8.2+5.8.2 +//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.9.0+5.9.0 (function(a){typeof globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:true,get:b}),_T_));function b(){var b=this||self;b.globalThis=b;delete -a.prototype._T_}}(Object));(function(N){"use strict";var -oq="SH",pC="Budget",op="console",cO="int_of_string",qD="member",on="ImageBlurHashes",oo=408,fp=427938126,jq="fields",cN=0xff,r3="%a",r4="%ni",ed=240,om=815,ol="tc",b_="J",r1="ThemeVideoIds",r2="SeasonUserData",fx=-211558048,pB="aa",r0="Out_of_memory",K=963043957,ok=";",cL=870828711,j9="Failure",ha="Unix.Unix_error",g$="\\b",pA="Program",rZ="src/core/CCString.pp.ml",pz="DateLastMediaAdded",fD="false",py=", characters ",g_=869834347,jp="ou",ek="SortName",oj="MusicArtist",px="MediaSources",hl="Map.bal",eq=-211555818,oi="ChannelFolderItem",qB=30214610,qC=143365725,aX="v",jG="recursive",cM="ae",jo=16620,a4="w",qA="ids",oh="ProviderIds",qz="closedir",rY="Match_failure",pw="%s",ef="illegal",qy="MusicAlbum",e="",rX="pathname",og="Year",jF="fut",ci=434236056,of=": ",hk="Id",rW="']')",qx="ChildCount",qw=851,fo="end",qv=0xe0,hu="object",jn="Jellyfin",rV="EEXIST",pv=826371656,pu="Studios",rU="Locations",pt="Height",qu="Undefined_recursive_module",rT="RecursiveItemCount",oe="AirTime",b8=2147483647,hj="\\t",rS="%.16g",ep=224,hi="array",rR="SpecialEpisodeNumbers",jE="surrogate",qt=204,ht=192,c8=0x3f,qr="Taglines",qs="CustomRating",qq="Settings",g9="'",hs=": No such file or directory",od="CanDelete",qp=" dst=",qo="enableUserData",rQ="av",bV="ts",cu=256,z="A",ps="PresentationUniqueKey",rP="[]",qn="SpecialFeatureCount",oc=832,ob=3456159,j8=":",aC="T",rO="Printexc.handle_uncaught_exception",pr="Type",jD=" : flags Open_rdonly and Open_wronly are not compatible",rN="BasicSyncInfo",ej=123,rM="item.Id",oa="6",jC="sorts",pq="@;",qm=822,rL="LiveTvChannel",pp="Genre",j7="{feng}",qk="PlayAccess",ql=">",po=239,ei="Name",cK=127,cn=0xffff,qj="Sys_blocked_io",pn="ExternalEtag",W="I",bX="Unexpected end of input",n$="People",pm="_",rK="AggregateFolder",g1="_bigarr02",jV=245,jm="not",n_=357,j6="compare: functional value",jU="mkdir",rJ="parentId",fC=1000,n9="@[",g8="\\\\",rI="Primary",n8="BoxSet",n7=225181919,ee=-826170817,pl="/static/",rH=14596,R="s",dG="lib/db/stores.ml",hr="4",qi="Assert_failure",rG="Movie",n6="start_index",rE="%X",rF="OCAMLRUNPARAM",n5=253,pk=122,g7="canon",jB="in",rD=".0",dE="genres",fw="src/uutf.ml",j5="views",pj="CommunityRating",pi=8232,jl=" ms",jk="items",aB=852405675,qh=429931233,rC="ThemeSongIds",rB="Recording",n4="lone",jA="2",rA=369,g0="Set.bal",rz="HomePageUrl",jT=120,ec=1024,qg=1027,B="U",n3="Season",aW="m",ry="includeItemTypes",dC=-752863768,ph="SyncInfo",n2="AlbumArtist",pg="tracks",n1="stream",pf="ScreenshotImageTags",da="or",g6=1017453041,qf="Album",jS="Fatal error: exception ",aP="camlinternalFormat.ml",rx=273,nZ="CriticRating",n0="ui",fB=708012133,pe="RefreshState",bq="j",aK="c",bD=24029,rw=144,jj="ItemId",rv=713199754,nY=827,ji="date_added",pd="ENOTEMPTY",b7="dz",jz=1255,ru=726711616,rt="sortBy",qe=508493173,a="@ ",rs="Bigarray.blit: dimension mismatch",pc="Overview",qd="Ascending",hq="JSON",nX="Book",qc="Stack_overflow",ak="G",rr="Random",x="a",jy="string",hh="Path",rq=211,fA=-48,aU="P",rp=732461442,ag="t",pb="TvProgram",eb="",ro="Folder",rn="limit",nW=-10,qb=65535,nV="UserView",pa="CumulativeRunTimeTicks",qa="LocalTrailerCount",gZ="ParentId",rm=814,jx="AV",cm="/",hg=605782321,p$="Tags",cS=3654863,rl="Episode",rk="Width",o$=297,rj="DZ",o_="includeExternalContent",p_="RemoteTrailers",s="O",nU="enableImages",nT="Fatal error: exception %s\n",p9=153884648,o8="sorts.views",o9="InheritedParentalRatingValue",p8="ChannelImage",bi="F",nS=818,nR="input",jh="jsError",fz="ng",p7=823,nQ="UserRootFolder",o7="AudioBook",ri="ue",nP="ManualPlaylistsFolder",bC="0",rh=197,o6="hv",ab="n",p6=679,nO="%u",jg=881518886,r="r",nN="Series",jR=8100,b0="Q",nL="LiveTvProgram",nM=0x7ff0,cj="|",c$=684370880,p5="End_of_file",rg="ProductionLocations",o4="AlbumId",o5="comment",o3="^",p4=819,rf=244,O="i",rd="Audio",re="Genres",ad="L",o2="DateLastRefreshed",jw="ENOTDIR",fv="null",rc="{}",dD=17732,eh=992790154,eo="+",fu=726928360,j4=8097,rb=65533,cv=3455931,nK="Chapters",ft=1023,en=125,o1="Pervasives.do_at_exit",fn=57343,p3="%c",eg=65536,nJ=",@ ",ju=-133,jv=0xf,aQ="k",nI=-588596599,jQ=3299808,aT="B",fs=659980059,b9="X",p2="SeriesStudio",ra="Photo",p1="infinity",o0=571,p0="CollectionFolder",q$="fd ",nH="Playlist",bb="M",oZ=290,pZ=233,q_="sortOrder",oY=0xf0,j3='\\"',pX="5",pY="Sys_error",b6=0x80,$="z",ao="N",q9="PhotoAlbum",pW=1073741823,oX="(','",aA="K",n="e",aa="d",q8="PremiereDate",jt="ENOENT",g5="item",ck=0x8000,pV=0x800,q7=257,oV="OE",oW="Division_by_zero",pU="@{",nG="(Program not linked with -g, cannot print stack backtrace)\n",oU="Channel",pT="MusicGenre",jf=55296,af=106380200,bj="V",bW="x",nF="total_record_count",jP=56320,aJ="Y",jO=" : file already exists",M=128,cQ="sh",c_=255,j2=56319,bp="id",g4=100,oT="OriginalTitle",h=848054398,pS="Revenue",q6="DisplayPreferencesId",f=-976970511,oS=1114111,fr="true",jN="src/jsonm.ml",gY=102,fl="Items",j1=-97,az="H",j0="album_id",q5="IsHD",q4=836,jM="TH",ah="D",je=2047,js="separator",hf=237,q3="([^/]+)",cP="sort_name",ap="Z",oR="CanDownload",q2=225,_="S",oQ="MusicVideo",pR="Etag",aV="W",oP=266,g3="\\n",nE="DateLastSaved",ae="R",bZ=" ",he=191,q1="to",nD=-67383738,jd="fs",pQ="ExternalSeriesId",oO="ExtraIds",hd="StartIndex",q0="%i",nC=65279,qZ="SeriesPresentationUniqueKey",oN="0x",fq=14610,oM=0xdfff,qY="PlayCount",ba=365180284,oL=": closedir failed",oK=17718,nB=160,bo="p",ay="C",oJ=223,pP="ServerId",ax="y",qX="Not_found",pO=397,oI="Studio",oH="EnableMediaSourceDisplay",oG="bytes.ml",qW="%Li",pN="Invalid_argument",cR="oe",dF=254,pM="GenreItems",ct=0xffffff,hp="DateCreated",nA=847,qV="MediaSourceCount",qU="ls",pL="Trailer",qT="{rams}",qS="Video",nz=850,hc=512,jZ=", ",qR="Descending",pJ="%li",pK=1026,jY=133,oF="BasePluginFolder",ho="tsh",aI="b",ny="Person",gX="\\r",jc="nan",qQ="%.17g",U="h",jL="rmdir",qP="Cstruct.blit_from_string src=",oE="startIndex",nx="'}')",oD="DatePlayed",oC=" ",pI=831,d="o",L=248,D="l",V="g",qN="ChannelInfo",qO="low",oB=837,qM="PrimaryImageAspectRatio",jK="by-id",gW="character",ea="value",oA=826,jX=" : flags Open_text and Open_binary are not compatible",qL=846,jW=": Not a directory",oz="ExternalUrls",oy="TS",t="u",nw=" : is a directory",hn="error",hb=1006505782,pH="userId",db=".",fk=-364210971,pG="ServiceName",nv=438511779,ox=363,pF="CollectionType",bY="name",qK="Artist",c9="q",bc=737456202,hm="server_id",pE=194,qJ="genres_by_canon_name",fy="th",nt="ItemCounts",nu=271,qI="ProductionYear",jJ=",",jI="index out of bounds",ns="{SUPERTRIANGULAR}",em=252,pD="Runtime",jb="%d",qH=292,qF="PlaylistsFolder",qG=": file descriptor already closed",cl="-",ja="EBADF",i$=" len=",bU=-633954146,ow=12520,fm="AE",nr="items_by_date_added",ov="AO",ou="3",jH=250,g2="TotalRecordCount",jr="ph",nq="MediaStreams",ot=654,gV=103,dc='"',b5="f",np="%.0f",qE=0xdc00,os="TvChannel",no=", line",or="SeriesPrimaryImage",F="E",el="lz";function -MZ(a,b,c,d,e){if(d<=b)for(var +a.prototype._T_}}(Object));(function(Q){"use strict";var +oJ="SH",pX="Budget",oI="console",cS="int_of_string",qY="member",oH="ImageBlurHashes",fs=427938126,j9="node:fs",jC="fields",cu=0xff,sm="%a",sn="%ni",ei=240,oG=815,oF="tc",bH="J",sk="ThemeVideoIds",sl="SeasonUserData",fB=-211558048,pW="aa",sj="Out_of_memory",E=963043957,oE=";",cQ=870828711,kk="Failure",hi="Unix.Unix_error",hh="\\b",pV="Program",si="src/core/CCString.pp.ml",pU="DateLastMediaAdded",fI="false",pT=", characters ",hg=869834347,jB="ou",oD=296,en="SortName",oC="MusicArtist",pR="IndexNumber",pS="MediaSources",ht="Map.bal",es=-211555818,oB="ChannelFolderItem",qW=30214610,qX=143365725,a2="v",jU="recursive",cR="ae",jA=16620,a9="w",qV="ids",oA="ProviderIds",qU="closedir",sh="Match_failure",pQ="%s",ek="illegal",qT="MusicAlbum",e="",sg="pathname",oz="Year",jT="fut",ch=434236056,jz=": ",hs="Id",sf="']')",qS="ChildCount",qR=851,fr="end",qQ=0xe0,hC="object",jy="Jellyfin",se="EEXIST",pP=203,pO=826371656,pN="Studios",sd="Locations",pM="Height",qP="Undefined_recursive_module",sc="RecursiveItemCount",oy="AirTime",b9=2147483647,hr="\\t",sb="%.16g",er=224,hq="array",sa="SpecialEpisodeNumbers",jS="surrogate",qO=204,hB=192,db=0x3f,ox=114,qM="Taglines",qN="CustomRating",qL="Settings",hf="'",fH=": No such file or directory",ow="CanDelete",qK=" dst=",qJ="enableUserData",r$="av",bT="ts",cw=256,z="A",pL="PresentationUniqueKey",r_="[]",qI="SpecialFeatureCount",ov=832,ou=3456159,r9=":",aF="T",r8="Printexc.handle_uncaught_exception",pK="Type",jR=" : flags Open_rdonly and Open_wronly are not compatible",dJ=123,r7="item.Id",ot="6",jQ="sorts",pJ="@;",qH=822,r6="LiveTvChannel",pI="Genre",kj="{feng}",qF="PlayAccess",qG=">",dG="mbid",pH=239,dh="Name",hA="IsFolder",cP=127,cl=0xffff,qE="Sys_blocked_io",pG="ExternalEtag",X="I",bV="Unexpected end of input",os="People",jP="_",r5="AggregateFolder",g_="_bigarr02",j8=245,jx="not",ki="compare: functional value",j7="mkdir",r4="parentId",fG=1000,or="@[",he="\\\\",r3="Primary",oq="BoxSet",op=225181919,ej=-826170817,pF="/static/",r2=14596,P="s",cW="lib/db/stores.ml",hz="4",qD="Assert_failure",r1="Movie",oo="start_index",rZ="%X",r0="OCAMLRUNPARAM",on=253,pE=122,dI="canon",jO="in",rY=".0",pD="by-idx",fA="src/uutf.ml",kh="views",pC="CommunityRating",pB=8232,jw=" ms",jv="items",aE=852405675,qC=429931233,rX="ThemeSongIds",rW="Recording",om="lone",jN="2",rV=369,g9="Set.bal",rU="HomePageUrl",j6=120,eh=1024,qB=1027,rT="Url",B="U",ol="Season",a1="m",rS="includeItemTypes",dF=-752863768,pA="SyncInfo",ok="AlbumArtist",pz="tracks",oj="stream",py="ScreenshotImageTags",df="or",hd=1017453041,qA="Album",j5="Fatal error: exception ",aS="camlinternalFormat.ml",oh="CriticRating",oi="ui",fF=708012133,px="RefreshState",bx="j",aO="c",b5=24029,rR=144,ju="ItemId",rQ=713199754,og=827,jt="date_added",pw="ENOTEMPTY",b8="dz",jM=1255,rP=726711616,rO="sortBy",qz=508493173,a="@ ",rN="Bigarray.blit: dimension mismatch",pv="Overview",qy="Ascending",hy="JSON",of="Book",qx="Stack_overflow",an="G",rM="Random",x="a",jL="string",hp="Path",rL=211,fE=-48,aZ="P",rK=732461442,aj="t",pu="TvProgram",eg="",rJ="Folder",rI="limit",oe=-10,qw=65535,od="UserView",pt="CumulativeRunTimeTicks",rH="Could not add album into the db: ",qv="LocalTrailerCount",g8="ParentId",rG=814,jK="AV",cy="/",ho=605782321,qu="Tags",cV=3654863,rF="Episode",rE="Width",ps=297,rD="DZ",pr="includeExternalContent",qt="RemoteTrailers",s="O",oc="enableImages",ob="Fatal error: exception %s\n",qs=153884648,pp="sorts.views",pq="InheritedParentalRatingValue",qr="ChannelImage",bo="F",oa=818,n$="input",js="jsError",fD="ng",qq=823,n_="UserRootFolder",po="AudioBook",rC="ue",n9="ManualPlaylistsFolder",bG="0",pn="hv",ad="n",qp=679,n8="%u",jr=881518886,p="r",n7="Series",j4=8100,bX="Q",n5="LiveTvProgram",n6=0x7ff0,ci="|",de=684370880,rB="Default",qo="End_of_file",rA="ProductionLocations",pl="AlbumId",pm="comment",g7="idx",pk="^",qn=819,rz=244,M="i",rx="Audio",ry="Genres",af="L",pj="DateLastRefreshed",jJ="ENOTDIR",fz="null",rw="{}",dH=17732,em=992790154,eq="+",fy=726928360,kg=8097,rv=65533,cx=3455931,n4="Chapters",fx=1023,dK=125,pi="Pervasives.do_at_exit",fq=57343,qm="%c",el=65536,n3=",@ ",jH=-133,jI=0xf,aT="k",n2=-588596599,j3=3299808,aY="B",fw=659980059,b_="X",ql="SeriesStudio",ru="Photo",qk="infinity",ph=571,qj="CollectionFolder",rt="fd ",n1="Playlist",be="M",jG=290,rs="sortOrder",pg=0xf0,kf='\\"',qh="5",qi="Sys_error",b7=0x80,ab="z",aq="N",rr="PhotoAlbum",qg=1073741823,pf="(','",aD="K",n="e",ac="d",rq="PremiereDate",jF="ENOENT",n0="J ",hc="item",cj=0x8000,qf=0x800,rp=257,pd="OE",pe="Division_by_zero",qe="@{",nZ="(Program not linked with -g, cannot print stack backtrace)\n",pc="Channel",qd="MusicGenre",jq=55296,ai=106380200,bp="V",bU="x",nY="total_record_count",j2=56320,aN="Y",j1=" : file already exists",K=128,cT="sh",dd=255,ke=56319,aX="id",fp=100,pb="OriginalTitle",h=848054398,qc="Revenue",ro="DisplayPreferencesId",f=-976970511,pa=1114111,fv="true",j0="src/jsonm.ml",fn=102,fm="Items",kd=-97,az="H",kc="album_id",rn="IsHD",rm=836,jZ="TH",ak="D",jp=2047,jE="separator",hn=237,rl="([^/]+)",b6="sort_name",ar="Z",o$="CanDownload",rk=225,aa="S",o_="MusicVideo",qb="Etag",a0="W",o9=266,hb="\\n",nX="DateLastSaved",ah="R",bW=" ",hm=191,nW=-67383738,qa="ExternalSeriesId",o8="ExtraIds",hl="StartIndex",o7="ParentIndexNumber",rj="%i",nV=65279,p$=259,ri="SeriesPresentationUniqueKey",o6="0x",fu=14610,o5=0xdfff,rh="PlayCount",bd=365180284,o4=": closedir failed",o3=17718,nU=160,bw="p",ay="C",o2=223,p_="ServerId",ax="y",rg="Not_found",p9=397,o1="Studio",o0="EnableMediaSourceDisplay",oZ="bytes.ml",rf="%Li",p8="Invalid_argument",cU="oe",dj=254,p7="GenreItems",cv=0xffffff,hx="DateCreated",nT=847,re="MediaSourceCount",rd="ls",p6="Trailer",rc="{rams}",rb="Video",nS=850,hk=512,kb=", ",ra="Descending",p4="%li",p5=1026,ka=133,oY="BasePluginFolder",hw="tsh",aM="b",nR="Person",g6="\\r",jo="nan",q$="%.17g",T="h",jY="rmdir",q_="Cstruct.blit_from_string src=",oX="startIndex",nQ="'}')",oW="DatePlayed",oV=" ",p3=831,d="o",J=248,D="l",W="g",q8="ChannelInfo",q9="low",oU=837,q7="PrimaryImageAspectRatio",ft="by-id",g5="character",oT="message",fl="value",oS=826,j$=" : flags Open_text and Open_binary are not compatible",q6=846,j_=": Not a directory",ha="ExternalUrls",oR="TS",t="u",nP=" : is a directory",hv="error",hj=1006505782,p2="userId",dg=".",fk=-364210971,p1="ServiceName",nO=438511779,oQ=363,p0="CollectionType",bg="name",q5="Artist",dc="q",bf=737456202,hu="server_id",pZ=194,q4="genres_by_canon_name",fC="th",nM="ItemCounts",nN=271,q3="ProductionYear",jX=",",jW="index out of bounds",nL="{SUPERTRIANGULAR}",ep=252,pY="Runtime",jn="%d",q2=292,q0="PlaylistsFolder",q1=": file descriptor already closed",ck="-",jm="EBADF",jl=" len=",bS=-633954146,oP=12520,fo="AE",nK="items_by_date_added",oO="AO",oN="3",jV=250,g$="TotalRecordCount",jD="ph",nJ="MediaStreams",oM=654,g4=103,di='"',b4="f",nI="%.0f",qZ=0xdc00,oL="TvChannel",nH=", line",oK="SeriesPrimaryImage",G="E",eo="lz";function +N8(a,b,c,d,e){if(d<=b)for(var f=1;f<=e;f++)c[d+f]=a[b+f];else for(var f=e;f>=1;f--)c[d+f]=a[b+f];return 0}function -j_(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function -M0(a,b){var +kl(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function +N_(a,b){var c=a[1];a[1]+=b;return c}function -j$(a){return a[1]}function -sI(a){var -b=N.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(N.jsoo_static_env&&N.jsoo_static_env[a])return N.jsoo_static_env[a]}var -ks=0;(function(){var -c=sI(rF);if(c!==undefined){var -b=c.split(jJ);for(var -a=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new @@ -67,69 +69,67 @@ b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new w(b,c,d)};w.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new w(b,c,d)};w.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*sm|0)+this.mi*a.lo+this.lo*a.mi,d=(c*sm|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -w(b,c,d)};w.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};w.prototype.isNeg=function(){return this.hi<<16<0};w.prototype.and=function(a){return new +b=this.lo*a.lo,c=(b*sH|0)+this.mi*a.lo+this.lo*a.mi,d=(c*sH|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +w(b,c,d)};w.prototype.isZero=function(){return(this.lo|this.mi|this.hi)===0};w.prototype.isNeg=function(){return this.hi<<16<0};w.prototype.and=function(a){return new w(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};w.prototype.or=function(a){return new w(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};w.prototype.xor=function(a){return new -w(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};w.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new +w(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};w.prototype.shift_left=function(a){a=a&63;if(a===0)return this;if(a<24)return new w(this.lo<>24-a,this.hi<>24-a);if(a<48)return new w(0,this.lo<>48-a);return new -w(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new w(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -w(this.hi>>a-48,0,0)};w.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +w(this.hi>>a-48,0,0)};w.prototype.shift_right=function(a){a=a&63;if(a===0)return this;var c=this.hi<<16>>16;if(a<24)return new w(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -w(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cn);return new -w(this.hi<<16>>a-32,b,b)};w.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&ct;this.lo=this.lo<<1&ct};w.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&ct;this.mi=(this.mi>>>1|this.hi<<23)&ct;this.hi=this.hi>>>1};w.prototype.udivmod=function(a){var +w(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cl);return new +w(this.hi<<16>>a-32,b,b)};w.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cv;this.lo=this.lo<<1&cv};w.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cv;this.mi=(this.mi>>>1|this.hi<<23)&cv;this.hi=this.hi>>>1};w.prototype.udivmod=function(a){var d=0,c=this.copy(),b=a.copy(),e=new w(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};w.prototype.div=function(a){var -b=this;if(a.isZero())sB();var -d=b.hi^a.hi;if(b.hi&ck)b=b.neg();if(a.hi&ck)a=a.neg();var -c=b.udivmod(a).quotient;if(d&ck)c=c.neg();return c};w.prototype.mod=function(a){var -b=this;if(a.isZero())sB();var -d=b.hi;if(b.hi&ck)b=b.neg();if(a.hi&ck)a=a.neg();var -c=b.udivmod(a).modulus;if(d&ck)c=c.neg();return c};w.prototype.toInt=function(){return this.lo|this.mi<<24};w.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};w.prototype.toArray=function(){return[this.hi>>8,this.hi&cN,this.mi>>16,this.mi>>8&cN,this.mi&cN,this.lo>>16,this.lo>>8&cN,this.lo&cN]};w.prototype.lo32=function(){return this.lo|(this.mi&cN)<<24};w.prototype.hi32=function(){return this.mi>>>8&cn|this.hi<<16};function -Nt(a,b){return new -w(a&ct,a>>>24&cN|(b&cn)<<8,b>>>16&cn)}function -kk(a){return a.hi32()}function -kl(a){return a.lo32()}function -dI(){aq(jI)}var -M3=g1;function -dd(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}dd.prototype.caml_custom=M3;dd.prototype.offset=function(a){var +b=this;if(a.isZero())sV();var +d=b.hi^a.hi;if(b.hi&cj)b=b.neg();if(a.hi&cj)a=a.neg();var +c=b.udivmod(a).quotient;if(d&cj)c=c.neg();return c};w.prototype.mod=function(a){var +b=this;if(a.isZero())sV();var +d=b.hi;if(b.hi&cj)b=b.neg();if(a.hi&cj)a=a.neg();var +c=b.udivmod(a).modulus;if(d&cj)c=c.neg();return c};w.prototype.toInt=function(){return this.lo|this.mi<<24};w.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};w.prototype.toArray=function(){return[this.hi>>8,this.hi&cu,this.mi>>16,this.mi>>8&cu,this.mi&cu,this.lo>>16,this.lo>>8&cu,this.lo&cu]};w.prototype.lo32=function(){return this.lo|(this.mi&cu)<<24};w.prototype.hi32=function(){return this.mi>>>8&cl|this.hi<<16};function +OD(a,b){return new +w(a&cv,a>>>24&cu|(b&cl)<<8,b>>>16&cl)}function +kx(a){return a.hi32()}function +ky(a){return a.lo32()}function +dM(){as(jW)}var +Ob=g_;function +dk(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}dk.prototype.caml_custom=Ob;dk.prototype.offset=function(a){var c=0;if(typeof -a==="number")a=[a];if(!(a -instanceof -Array))aq("bigarray.js: invalid offset");if(this.dims.length!=a.length)aq("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -b=0;b=this.dims[b])dI();c=c*this.dims[b]+a[b]}else +a==="number")a=[a];if(!Array.isArray(a))as("bigarray.js: invalid offset");if(this.dims.length!==a.length)as("Bigarray.get/set: bad number of dimensions");if(this.layout===0)for(var +b=0;b=this.dims[b])dM();c=c*this.dims[b]+a[b]}else for(var -b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])dI();c=c*this.dims[b]+(a[b]-1)}return c};dd.prototype.get=function(a){switch(this.kind){case +b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])dM();c=c*this.dims[b]+(a[b]-1)}return c};dk.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return Nt(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return OD(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[dF,e,c];default:return this.data[a]}};dd.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=kl(b);this.data[a*2+1]=kk(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[dj,e,c];default:return this.data[a]}};dk.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=ky(b);this.data[a*2+1]=kx(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};dd.prototype.fill=function(a){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};dk.prototype.fill=function(a){switch(this.kind){case 7:var -c=kl(a),e=kk(a);if(c==e)this.data.fill(c);else +c=ky(a),e=kx(a);if(c===e)this.data.fill(c);else for(var -b=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case +c=0;ce)return 1;if(d!==e){if(!b)return Number.NaN;if(!Number.isNaN(d))return 1;if(!Number.isNaN(e))return-1}}break;case 7:for(var c=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case 2:case @@ -141,90 +141,92 @@ c=0;ca.data[c])return 1}break}return 0};function -er(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}er.prototype=new -dd();er.prototype.offset=function(a){if(typeof -a!=="number")if(a -instanceof -Array&&a.length==1)a=a[0];else -aq("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dI();return a};er.prototype.get=function(a){return this.data[a]};er.prototype.set=function(a,b){this.data[a]=b;return 0};er.prototype.fill=function(a){this.data.fill(a);return 0};function -ka(a,b,c,d){var -e=r_(a);if(hw(c)*e!=d.length)aq("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new -er(a,b,c,d);return new -dd(a,b,c,d)}function -ew(a){return a.slice(1)}function -M2(a,b,c){var -d=ew(c),e=r7(a,hw(d));return ka(a,b,d,e)}function -M4(a,b){if(b<0||b>=a.dims.length)aq("Bigarray.dim");return a.dims[b]}function -M5(a){return M4(a,0)}function -r9(a,b){return a.get(a.offset(b))}function -fF(a,b,c){a.set(a.offset(b),c);return 0}function -fP(a,b,c){var -d=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var -f=e;for(;0=this.dims[0])dM();return a};et.prototype.get=function(a){return this.data[a]};et.prototype.set=function(a,b){this.data[a]=b;return 0};et.prototype.fill=function(a){this.data.fill(a);return 0};function +kn(a,b,c,d){var +e=st(a);if(hE(c)*e!==d.length)as("length doesn't match dims");if(b===0&&c.length===1&&e===1)return new +et(a,b,c,d);return new +dk(a,b,c,d)}function +ey(a){return a.slice(1)}function +Oa(a,b,c){var +d=ey(c),e=sq(a,hE(d));return kn(a,b,d,e)}function +Oc(a,b){if(b<0||b>=a.dims.length)as("Bigarray.dim");return a.dims[b]}function +Od(a){return Oc(a,0)}function +ss(a,b){return a.get(a.offset(b))}function +fK(a,b,c){a.set(a.offset(b),c);return 0}function +fS(a,b,c){var +d=String.fromCharCode;if(b===0&&c<=4096&&c===a.length)return d.apply(null,a);var +f=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?fP(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?fP(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)hz(c);var -g=a.c,h=c.c;if(a.t==4)if(d<=b)for(var +b$(a,b,c,d,e){if(e===0)return 0;if(d===0&&(e>=c.l||c.t===2&&e>=c.c.length)){c.c=a.t===4?fS(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else if(c.t===2&&d===c.c.length){c.c+=a.t===4?fS(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else{if(c.t!==4)hI(c);var +g=a.c,h=c.c;if(a.t===4)if(d<=b)for(var f=0;f=0;f--)h[d+f]=g[b+f];else{var i=Math.min(e,g.length-b);for(var f=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function -fH(a){if(a.t==2)a.c+=ey(a.l-a.c.length,"\0");else -a.c=fP(a.c,0,a.c.length);a.t=0}function -ku(a){if(a.length<24){for(var -b=0;bcK)return false;return true}else +eB(a,b){if(a===0)return e;if(b.repeat)return b.repeat(a);var +d=e,c=0;for(;;){if(a&1)d+=b;a>>=1;if(a===0)return d;b+=b;c++;if(c===9)b.slice(0,1)}}function +fM(a){if(a.t===2)a.c+=eB(a.l-a.c.length,"\0");else +a.c=fS(a.c,0,a.c.length);a.t=0}function +kG(a){if(a.length<24){for(var +b=0;bcP)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -sG(a){for(var -k=e,d=e,h,g,i,b,c=0,j=a.length;chc){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else -d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cn)d+=String.fromCharCode(0xd7c0+(b>>10),qE+(b&0x3FF));else -d+=String.fromCharCode(b);if(d.length>ec){d.substr(0,1);k+=d;d=e}}return k+d}function -cT(a,b,c){this.t=a;this.c=b;this.l=c}cT.prototype.toString=function(){switch(this.t){case -9:return this.c;default:fH(this);case -0:if(ku(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};cT.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return sG(a)};cT.prototype.slice=function(){var -a=this.t==4?this.c.slice():this.c;return new -cT(this.t,a,this.l)};function -sb(a){return new -cT(0,a,a.length)}function -cp(a){return a}function -df(a){return sb(cp(a))}function -de(a,b,c,d,e){b$(df(a),b,c,d,e);return 0}function +s0(a){for(var +k=e,d=e,h,g,i,b,c=0,j=a.length;chk){d.slice(0,1);k+=d;d=e;k+=a.slice(c,f)}else +d+=a.slice(c,f);if(f===j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cl)d+=String.fromCharCode(0xd7c0+(b>>10),qZ+(b&0x3ff));else +d+=String.fromCharCode(b);if(d.length>eh){d.slice(0,1);k+=d;d=e}}return k+d}function +cX(a,b,c){this.t=a;this.c=b;this.l=c}cX.prototype.toString=function(){switch(this.t){case +9:case +8:return this.c;case +4:case +2:fM(this);case +0:if(kG(this.c))this.t=9;else +this.t=8;return this.c}};cX.prototype.toUtf16=function(){var +a=this.toString();if(this.t===9)return a;return s0(a)};cX.prototype.slice=function(){var +a=this.t===4?this.c.slice():this.c;return new +cX(this.t,a,this.l)};function +sw(a){return new +cX(0,a,a.length)}function +cn(a){return a}function +dm(a){return sw(cn(a))}function +dl(a,b,c,d,e){b$(dm(a),b,c,d,e);return 0}function m(a){return a.length}function -a6(a,b){return a.charCodeAt(b)}function -sF(a){var +bs(a,b){return a.charCodeAt(b)}function +sZ(a){var d=m(a),c=new -Uint8Array(d),b=0;for(;bm(a))dI();if(f+e>c.data.length)dI();var -g=sF(a).slice(b,b+e);c.data.set(g,f);return 0}var -M7=M6;function -hx(){aq(jI)}function -cU(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +Uint8Array(d),b=0;for(;bm(a))dM();if(f+e>c.data.length)dM();var +g=sZ(a).slice(b,b+e);c.data.set(g,f);return 0}var +Of=Oe;function +hF(){as(jW)}function +cA(a,b){switch(a.t&6){case 0:return a.c.charCodeAt(b);case +2:if(b>=a.c.length)return 0;return a.c.charCodeAt(b);case 4:return a.c[b]}}function -fG(a,b){if(b>>>0>=a.l)hx();return cU(a,b)}function -eu(a){return new +fL(a,b){if(b>>>0>=a.l)hF();return cA(a,b)}function +ew(a){return new w(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function -M_(a,b){if(b>>>0>=a.l-7)hx();var +Oi(a,b){if(b>>>0>=a.l-7)hF();var d=new Array(8);for(var -c=0;c<8;c++)d[7-c]=cU(a,b+c);return eu(d)}function -al(a,b,c){c&=cN;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}hz(a)}a.c[b]=c;return 0}function -cw(a,b,c){if(b>>>0>=a.l)hx();return al(a,b,c)}function -ev(a){return a.toArray()}function -M$(a,b,c){if(b>>>0>=a.l-7)hx();var -e=ev(c);for(var -d=0;d<8;d++)al(a,b+7-d,e[d]);return 0}function -cV(d,c){var -f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var +c=0;c<8;c++)d[7-c]=cA(a,b+c);return ew(d)}function +ao(a,b,c){c&=cu;if(a.t!==4){if(b===a.c.length){a.c+=String.fromCharCode(c);if(b+1===a.l)a.t=0;return 0}hI(a)}a.c[b]=c;return 0}function +cz(a,b,c){if(b>>>0>=a.l)hF();return ao(a,b,c)}function +ex(a){return a.toArray()}function +Oj(a,b,c){if(b>>>0>=a.l-7)hF();var +e=ex(c);for(var +d=0;d<8;d++)ao(a,b+7-d,e[d]);return 0}function +cY(d,c){var +f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b===0)return d.apply(null,c);else if(b<0){var a=d.apply(null,c.slice(0,f));if(typeof -a!=="function")return a;return cV(a,c.slice(f))}else{switch(b){case +a!=="function")return a;return cY(a,c.slice(f))}else{switch(b){case 1:{var a=function(a){var f=new @@ -236,32 +238,32 @@ g=new Array(e+2);for(var f=0;f>>0>=a.length-1)dI();return a}function -kc(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -sp(a){return a==jV?1:0}var -N6=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -N5(a){if(N6)return Math.floor(Math.log2(a));var -b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else +a=0;a>>0>=a.length-1)dM();return a}function +kp(a){if(Number.isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!==0)return 1;return 2}return Number.isNaN(a)?4:3}function +sK(a){return a===j8?1:0}var +Ph=Math.log2&&Math.log2(1.1235582092889474e307)===1020;function +Pg(a){if(Ph)return Math.floor(Math.log2(a));var +b=0;if(a===0)return Number.NEGATIVE_INFINITY;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -ki(a){var +kv(a){var b=new Float32Array(1);b[0]=a;var c=new Int32Array(b.buffer);return c[0]|0}function -bl(a,b,c){return new +br(a,b,c){return new w(a,b,c)}function -hC(a){if(!isFinite(a)){if(isNaN(a))return bl(1,0,nM);return a>0?bl(0,0,nM):bl(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?ck:a>=0?0:ck;if(f)a=-a;var -b=N5(a)+ft;if(b<=0){b=0;a/=Math.pow(2,-pK)}else{a/=Math.pow(2,b-qg);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +hL(a){if(!Number.isFinite(a)){if(Number.isNaN(a))return br(1,0,n6);return a>0?br(0,0,n6):br(0,0,0xfff0)}var +f=a===0&&1/a===Number.NEGATIVE_INFINITY?cj:a>=0?0:cj;if(f)a=-a;var +b=Pg(a)+fx;if(b<=0){b=0;a/=Math.pow(2,-p5)}else{a/=Math.pow(2,b-qB);if(a<16){a*=2;b-=1}if(b===0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&jv|f|b<<4;return bl(g,e,c)}function -sa(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==g1)for(var -d=0;d>4;if(d==je)return(f|g|c&jv)==0?c&ck?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),b=(f*e+g)*e+(c&jv);if(d>0){b+=16;b*=Math.pow(2,d-qg)}else -b*=Math.pow(2,-pK);if(c&ck)b=-b;return b}function -aZ(a){if(!bd.Failure)bd.Failure=[L,bF(j9),-3];kr(bd.Failure,a)}function -r8(a,b,c){var -k=a.read32s();if(k<0||k>16)aZ("input_value: wrong number of bigarray dimensions");var -r=a.read32s(),l=r&cN,q=r>>8&1,j=[];if(c==g1)for(var +ev(a){var +f=a.lo,g=a.mi,c=a.hi,d=(c&0x7fff)>>4;if(d===jp)return(f|g|c&jI)===0?c&cj?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY:Number.NaN;var +e=Math.pow(2,-24),b=(f*e+g)*e+(c&jI);if(d>0){b+=16;b*=Math.pow(2,d-qB)}else +b*=Math.pow(2,-p5);if(c&cj)b=-b;return b}function +a_(a){if(!a5.Failure)a5.Failure=[J,bJ(kk),-3];kE(a5.Failure,a)}function +sr(a,b,c){var +k=a.read32s();if(k<0||k>16)a_("input_value: wrong number of bigarray dimensions");var +r=a.read32s(),l=r&cu,q=r>>8&1,j=[];if(c===g_)for(var d=0;d>>32-15;b=hG(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function -No(a,b){a=be(a,kl(b));a=be(a,kk(b));return a}function -kg(a,b){return No(a,hC(b))}function -r$(a){var -c=hw(a.dims),d=0;switch(a.kind){case +n=ev(ew(g));i.set(d,[dj,o,n])}break}b[0]=(4+k)*4;return kn(l,q,j,h)}function +sp(a,b,c){return a.compare(b,c)}function +hP(a,b){return Math.imul(a,b)}function +bh(a,b){b=hP(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=hP(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function +Oy(a,b){a=bh(a,ky(b));a=bh(a,kx(b));return a}function +kt(a,b){return Oy(a,hL(b))}function +su(a){var +c=hE(a.dims),d=0;switch(a.kind){case 2:case 3:case -12:if(c>cu)c=cu;var -e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=be(d,e)}e=0;switch(c&3){case +12:if(c>cw)c=cw;var +e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=bh(d,e)}e=0;switch(c&3){case 3:e=a.data[b+2]<<16;case 2:e|=a.data[b+1]<<8;case -1:e|=a.data[b+0];d=be(d,e)}break;case +1:e|=a.data[b+0];d=bh(d,e)}break;case 4:case -5:if(c>M)c=M;var -e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=be(d,e)}if((c&1)!=0)d=be(d,a.data[b]);break;case +5:if(c>K)c=K;var +e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=bh(d,e)}if((c&1)!==0)d=bh(d,a.data[b]);break;case 6:if(c>64)c=64;for(var -b=0;b64)c=64;for(var -b=0;b32)c=32;c*=2;for(var -b=0;b64)c=64;for(var -b=0;b32)c=32;for(var -b=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function -hE(a){return typeof +OC(a,b,c){return a.compare(b)}function +OF(a){return a.lo32()^a.hi32()}var +fO={_j:{deserialize:OL,serialize:OI,fixed_length:8,compare:OC,hash:OF},_i:{deserialize:OB,fixed_length:4},_n:{deserialize:O6,fixed_length:4},_bigarray:{deserialize:function(a,b){return sr(a,b,"_bigarray")},serialize:sv,compare:sp,hash:su},_bigarr02:{deserialize:function(a,b){return sr(a,b,g_)},serialize:sv,compare:sp,hash:su}};function +kq(a){return fO[a.caml_custom]&&fO[a.caml_custom].compare}function +sx(a,b,c,d){var +f=kq(b);if(f){var +e=c>0?f(b,a,d):f(a,b,d);if(d&&Number.isNaN(e))return c;if(Number.isNaN(+e))return+e;if((e|0)!==0)return e|0}return c}function +hN(a){return typeof a==="string"&&!/[^\x00-\xff]/.test(a)}function -hD(a){return a +hM(a){return a instanceof -cT}function -sd(a){if(typeof -a==="number")return fC;else if(hD(a))return em;else if(hE(a))return 1252;else if(a +cX}function +sy(a){if(typeof +a==="number")return fG;else if(hM(a))return ep;else if(hN(a))return 1252;else if(Array.isArray(a)&&a[0]===a[0]>>>0&&a[0]<=dd){var +b=a[0]|0;return b===dj?0:b}else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=c_){var -b=a[0]|0;return b==dF?0:b}else if(a +String)return oP;else if(typeof +a==="string")return oP;else if(a instanceof -String)return ow;else if(typeof -a=="string")return ow;else if(a -instanceof -Number)return fC;else if(a&&a.caml_custom)return jz;else if(a&&a.compare)return 1256;else if(typeof -a=="function")return 1247;else if(typeof -a=="symbol")return 1251;return 1001}function -kn(a,b){if(ab?1:0}function -M9(a,b){a.t&6&&fH(a);b.t&6&&fH(b);return a.cb.c?1:0}function -es(a,b,c){var +Number)return fG;else if(a&&a.caml_custom)return jM;else if(a&&a.compare)return 1256;else if(typeof +a==="function")return 1247;else if(typeof +a==="symbol")return 1251;return 1001}function +kA(a,b){if(ab?1:0}function +Oh(a,b){a.t&6&&fM(a);b.t&6&&fM(b);return a.cb.c?1:0}function +eu(a,b,c){var f=[];for(;;){if(!(c&&a===b)){var -e=sd(a);if(e==jH){a=a[1];continue}var -g=sd(b);if(g==jH){b=b[1];continue}if(e!==g){if(e==fC){if(g==jz)return sc(a,b,-1,c);return-1}if(g==fC){if(e==jz)return sc(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case -1001:if(ab)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case -1251:if(a!==b){if(!c)return NaN;return 1}break;case +d=a.compare(b,c);if(Number.isNaN(d))return c?-1:d;if(d!==(d|0))return-1;if(d!==0)return d|0;break;case +1000:a=+a;b=+b;if(ab)return 1;if(a!==b){if(!c)return Number.NaN;if(!Number.isNaN(a))return 1;if(!Number.isNaN(b))return-1}break;case +1001:if(ab)return 1;if(a!==b)return c?1:Number.NaN;break;case +1251:if(a!==b)return c?1:Number.NaN;break;case 1252:var -a=cp(a),b=cp(b);if(a!==b){if(ab)return 1}break;case +a=cn(a),b=cn(b);if(a!==b){if(ab)return 1}break;case 12520:var -a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case -246:case -254:default:if(sp(e)){aq("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var +a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;default:if(sK(e)){as("compare: continuation value");break}if(a.length!==b.length)return a.length1)f.push(a,b,1);break}}if(f.length===0)return 0;var h=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=ey(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)hz(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var -c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;aZ("float_of_string")}function -kq(a){a=cp(a);var -e=a.length;if(e>31)aq("format_int: format too long");var -b={justify:eo,signstyle:cl,filler:bZ,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:b5};for(var +hH(a,b){return eu(a,b,true)}function +Ok(){return[0]}function +ap(a){if(a<0)as("Bytes.create");return new +cX(a?2:9,e,a)}var +hJ=[0];function +Om(a,b){if(hJ!==a)return 0;hJ=b;return 1}function +sz(a){return hJ}function +On(a){hJ=a}function +Oo(a,b){return+(eu(a,b,false)===0)}function +Oq(a,b,c,d){if(c>0)if(b===0&&(c>=a.l||a.t===2&&c>=a.c.length))if(d===0){a.c=e;a.t=2}else{a.c=eB(c,String.fromCharCode(d));a.t=c===a.l?0:2}else{if(a.t!==4)hI(a);for(c+=b;b31)as("format_int: format too long");var +b={justify:eq,signstyle:ck,filler:bW,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:b4};for(var d=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function -ke(a,b){if(a.uppercase)b=b.toUpperCase();var -f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=cl))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var -c=e;if(a.justify==eo&&a.filler==bZ)for(var -d=f;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;break;case"d":case"i":b.signedconv=true;b.base=10;break;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function +kr(a,b){if(a.uppercase)b=b.toUpperCase();var +f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!==ck))f++;if(a.alternate){if(a.base===8)f+=1;if(a.base===16)f+=2}var +c=e;if(a.justify===eq&&a.filler===bW)for(var +d=f;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(bC);if(b>0)a=a+db+new -Array(b+1).join(bC);return a}else +c=Number.parseInt(a.toString().split(eq)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(bG);if(b>0)a=a+dg+new +Array(b+1).join(bG);return a}else return a.toFixed(b)}}var -c,f=kq(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=jc;f.filler=bZ}else if(!isFinite(b)){c="inf";f.filler=bZ}else +c,f=kD(a),e=f.prec<0?6:f.prec;if(b<0||b===0&&1/b===Number.NEGATIVE_INFINITY){f.sign=-1;b=-b}if(Number.isNaN(b)){c=jo;f.filler=bW}else if(!Number.isFinite(b)){c="inf";f.filler=bW}else switch(f.conv){case"e":var -c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==n)c=c.slice(0,d-1)+bC+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var +c=b.toExponential(e),d=c.length;if(c.charAt(d-3)===n)c=c.slice(0,d-1)+bG+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var i=c.indexOf(n),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var -d=i-1;while(c.charAt(d)==bC)d--;if(c.charAt(d)==db)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==n)c=c.slice(0,d-1)+bC+c.slice(d-1);break}else{var +d=i-1;while(c.charAt(d)===bG)d--;if(c.charAt(d)===dg)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)===n)c=c.slice(0,d-1)+bG+c.slice(d-1);break}else{var g=e;if(h<0){g-=h+1;c=b.toFixed(g)}else while(c=b.toFixed(g),c.length>e+1)g--;if(g){var -d=c.length-1;while(c.charAt(d)==bC)d--;if(c.charAt(d)==db)d--;c=c.slice(0,d+1)}}break}return ke(f,c)}function -fK(a,b){if(cp(a)==jb)return bF(e+b);var -c=kq(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else +d=c.length-1;while(c.charAt(d)===bG)d--;if(c.charAt(d)===dg)d--;c=c.slice(0,d+1)}}break}return kr(f,c)}function +fP(a,b){if(cn(a)===jn)return bJ(e+b);var +c=kD(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else b>>>=0;var -d=b.toString(c.base);if(c.prec>=0){c.filler=bZ;var -f=c.prec-d.length;if(f>0)d=ey(f,bC)+d}return ke(c,d)}var -NV=0;function -a5(){return NV++}function -b1(a){if(ku(a))return a;return sG(a)}function -fR(){return typeof -N.process!=="undefined"&&typeof -N.process.versions!=="undefined"&&typeof -N.process.versions.node!=="undefined"}function -N7(){function -a(a){if(a.charAt(0)===cm)return[e,a.substring(1)];return}function +d=b.toString(c.base);if(c.prec>=0){c.filler=bW;var +f=c.prec-d.length;if(f>0)d=eB(f,bG)+d}return kr(c,d)}var +O7=0;function +a4(){return O7++}function +ca(a){if(kG(a))return a;return s0(a)}function +fT(){return typeof +Q.process!=="undefined"&&typeof +Q.process.versions!=="undefined"&&typeof +Q.process.versions.node!=="undefined"}function +Pi(){function +a(a){if(a.charAt(0)===cy)return[e,a.slice(1)];return}function b(a){var -h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==j8);if(Boolean(b[2]||f)){var -d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return fR()&&N.process&&N.process.platform?N.process.platform==="win32"?b:a:a}var -kv=N7();function -sE(a){return a.slice(-1)!==cm?a+cm:a}if(fR()&&N.process&&N.process.cwd)var -fI=N.process.cwd().replace(/\\/g,cm);else +h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=c.length>0&&c.charAt(1)!==r9;if(b[2]||f){var +d=b[1]||e,g=b[2]||e;return[d,a.slice(d.length+g.length)]}return}return fT()&&Q.process&&Q.process.platform?Q.process.platform==="win32"?b:a:a}var +kH=Pi();function +sY(a){return a.slice(-1)!==cy?a+cy:a}if(fT()&&Q.process&&Q.process.cwd)var +fN=Q.process.cwd().replace(/\\/g,cy);else var -fI="/static";fI=sE(fI);function -NJ(a){a=b1(a);if(!kv(a))a=fI+a;var -e=kv(a),d=e[1].split(cm),b=[];for(var +fN="/static";fN=sY(fN);function +OV(a){a=ca(a);if(!kH(a))a=fN+a;var +e=kH(a),d=e[1].split(/[/\\]/),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -N4(a){for(var -g=e,c=g,b,i,d=0,h=a.length;dhc){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else -c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(b6|b&c8)}else if(b<0xd800||b>=oM)c+=String.fromCharCode(qv|b>>12,b6|b>>6&c8,b6|b&c8);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))oM)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(oY|b>>18,b6|b>>12&c8,b6|b>>6&c8,b6|b&c8)}if(c.length>ec){c.substr(0,1);g+=c;c=e}}return g+c}function -cb(a){return ku(a)?bF(a):bF(N4(a))}var -N8=["E2BIG","EACCES","EAGAIN",ja,"EBUSY","ECHILD","EDEADLK","EDOM",rV,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",jt,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",jw,pd,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function -cX(a,b,c,d){var -f=N8.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var -g=[f,cb(b||e),cb(c||e)];return g}var -sw={};function -di(a){return sw[a]}function -cW(a,b){throw i([0,a].concat(b))}function -kb(a){if(!(a +Pf(a){for(var +g=e,c=g,b,i,d=0,h=a.length;dhk){c.slice(0,1);g+=c;c=e;g+=a.slice(d,f)}else +c+=a.slice(d,f);if(f===h)break;d=f}if(b>6);c+=String.fromCharCode(b7|b&db)}else if(b<0xd800||b>=o5)c+=String.fromCharCode(qQ|b>>12,b7|b>>6&db,b7|b&db);else if(b>=0xdbff||d+1===h||(i=a.charCodeAt(d+1))o5)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(pg|b>>18,b7|b>>12&db,b7|b>>6&db,b7|b&db)}if(c.length>eh){c.slice(0,1);g+=c;c=e}}return g+c}function +bY(a){return kG(a)?bJ(a):bJ(Pf(a))}var +Pj=["E2BIG","EACCES","EAGAIN",jm,"EBUSY","ECHILD","EDEADLK","EDOM",se,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",jF,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",jJ,pw,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function +c0(a,b,c,d){var +f=Pj.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var +g=[f,bY(b||e),bY(c||e)];return g}var +sR={};function +dp(a){return sR[a]}function +cZ(a,b){throw i([0,a].concat(b))}function +ko(a){if(!(a instanceof Uint8Array))a=new Uint8Array(a);return new -cT(4,a,a.length)}function -I(a){kr(bd.Sys_error,a)}function -sA(a){I(a+hs)}function -fQ(a){if(a.t!=4)hz(a);return a.c}function -aR(a){return a.l}function -r5(){}function -bk(a){this.data=a}bk.prototype=new -r5();bk.prototype.constructor=bk;bk.prototype.truncate=function(a){var -b=this.data;this.data=am(a|0);b$(b,0,this.data,0,a)};bk.prototype.length=function(){return aR(this.data)};bk.prototype.write=function(a,b,c,d){var +cX(4,a,a.length)}function +H(a){kE(a5.Sys_error,a)}function +sU(a){H(a+fH)}function +hX(a){if(a.t!==4)hI(a);return a.c}function +aU(a){return a.l}function +so(){}function +bq(a){this.data=a}bq.prototype=new +so();bq.prototype.constructor=bq;bq.prototype.truncate=function(a){var +b=this.data;this.data=ap(a|0);b$(b,0,this.data,0,a)};bq.prototype.length=function(){return aU(this.data)};bq.prototype.write=function(a,b,c,d){var e=this.length();if(a+d>=e){var -f=am(a+d),g=this.data;this.data=f;b$(g,0,this.data,0,e)}b$(kb(b),c,this.data,a,d);return 0};bk.prototype.read=function(a,b,c,d){var +f=ap(a+d),g=this.data;this.data=f;b$(g,0,this.data,0,e)}b$(ko(b),c,this.data,a,d);return 0};bq.prototype.read=function(a,b,c,d){var e=this.length();if(a+d>=e)d=e-a;if(d){var -f=am(d|0);b$(this.data,a,f,0,d);b.set(fQ(f),c)}return d};function -dH(a,b,c){this.file=b;this.name=a;this.flags=c}dH.prototype.err_closed=function(){I(this.name+qG)};dH.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};dH.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};dH.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};dH.prototype.close=function(){this.file=undefined};function -aY(a,b){this.content={};this.root=a;this.lookupFun=b}aY.prototype.nm=function(a){return this.root+a};aY.prototype.create_dir_if_needed=function(a){var -d=a.split(cm),c=e;for(var -b=0;b=0)}function -kh(a,b){var -e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=be(a,d)}d=0;switch(e&3){case +aP(d)};eC.push(b);c={path:b.path,device:b.device,rest:a.slice(b.path.length,a.length)}}}if(c)return c;H("no device found for "+f)}function +Ol(a,b){var +c=s5(a);if(!c.device.register)a_("cannot register file");c.device.register(c.rest,b);return 0}function +s1(a,b){var +a=bJ(a),b=bJ(b);return Ol(a,b)}function +Os(){var +b=Q.jsoo_fs_tmp;if(b)for(var +a=0;a=0)}function +ku(a,b){var +e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=bh(a,d)}d=0;switch(e&3){case 3:d=b.charCodeAt(c+2)<<16;case 2:d|=b.charCodeAt(c+1)<<8;case -1:d|=b.charCodeAt(c);a=be(a,d)}a^=e;return a}function -Np(a,b){return kh(a,cp(b))}function -Nm(a,b){var -e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=be(a,d)}d=0;switch(e&3){case +1:d|=b.charCodeAt(c);a=bh(a,d)}a^=e;return a}function +Oz(a,b){return ku(a,cn(b))}function +Ow(a,b){var +e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=bh(a,d)}d=0;switch(e&3){case 3:d=b[c+2]<<16;case 2:d|=b[c+1]<<8;case -1:d|=b[c];a=be(a,d)}a^=e;return a}function -NM(a){switch(a.t&6){default:fH(a);case -0:return a.c;case -4:return a.c}}function -Nl(a,b){var -c=NM(b);return typeof -c==="string"?kh(a,c):Nm(a,c)}function -Nn(a){a^=a>>>16;a=hG(a,0x85ebca6b|0);a^=a>>>13;a=hG(a,0xc2b2ae35|0);a^=a>>>16;return a}function -sh(a,b,c,d){var -j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cu)h=cu;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(fJ[e.caml_custom]&&fJ[e.caml_custom].hash){var -n=fJ[e.caml_custom].hash(e);f=be(f,n);g--}}else if(e -instanceof -Array&&e[0]===(e[0]|0))switch(e[0]){case -248:f=be(f,e[2]);g--;break;case -250:j[--k]=e[1];break;default:if(sp(e[0]))break;var -o=e.length-1<<10|e[0];f=be(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(hD(e)){f=Nl(f,e);g--}else if(hE(e)){f=Np(f,e);g--}else if(typeof -e==="string"){f=kh(f,e);g--}else if(e===(e|0)){f=be(f,e+e+1);g--}else if(typeof -e==="number"){f=kg(f,e);g--}}f=Nn(f);return f&0x3FFFFFFF}function -Nq(a,b,c){if(!isFinite(a)){if(isNaN(a))return cb(jc);return cb(a>0?p1:"-infinity")}var -k=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var -f=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else +1:d|=b[c];a=bh(a,d)}a^=e;return a}function +OY(a){switch(a.t&6){case +2:fM(a);return a.c;default:return a.c}}function +Ov(a,b){var +c=OY(b);return typeof +c==="string"?ku(a,c):Ow(a,c)}function +Ox(a){a^=a>>>16;a=hP(a,0x85ebca6b|0);a^=a>>>13;a=hP(a,0xc2b2ae35|0);a^=a>>>16;return a}function +sC(a,b,c,d){var +j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cw)h=cw;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(fO[e.caml_custom]&&fO[e.caml_custom].hash){var +n=fO[e.caml_custom].hash(e);f=bh(f,n);g--}}else if(Array.isArray(e)&&e[0]===(e[0]|0))switch(e[0]){case +248:f=bh(f,e[2]);g--;break;case +250:j[--k]=e[1];break;default:if(sK(e[0]))break;var +o=e.length-1<<10|e[0];f=bh(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(hM(e)){f=Ov(f,e);g--}else if(hN(e)){f=Oz(f,e);g--}else if(typeof +e==="string"){f=ku(f,e);g--}else if(e===(e|0)){f=bh(f,e+e+1);g--}else if(typeof +e==="number"){f=kt(f,e);g--}}f=Ox(f);return f&0x3fffffff}function +OA(a,b,c){if(!Number.isFinite(a)){if(Number.isNaN(a))return bY(jo);return bY(a>0?qk:"-infinity")}var +k=a===0&&1/a===Number.NEGATIVE_INFINITY?1:a>=0?0:1;if(k)a=-a;var +f=0;if(a===0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else while(a>=2){a/=2;f++}var -l=f<0?e:eo,g=e;if(k)g=cl;else +l=f<0?e:eq,g=e;if(k)g=ck;else switch(c){case -43:g=eo;break;case -32:g=bZ;break;default:break}if(b>=0&&b<13){var +43:g=eq;break;case +32:g=bW;break;default:break}if(b>=0&&b<13){var i=Math.pow(2,b*4);a=Math.round(a*i)/i}var d=a.toString(16);if(b>=0){var -j=d.indexOf(db);if(j<0)d+=db+ey(b,bC);else{var -h=j+1+b;if(d.length>24&ct,a>>31&cn)}function -so(a){return a.toInt()}function -Nw(a){return+a.isNeg()}function -sk(a){return a.neg()}function -Nu(a,b){var -c=kq(a);if(c.signedconv&&Nw(b)){c.sign=-1;b=sk(b)}var -d=e,i=fL(c.base),h="0123456789abcdef";do{var -g=b.udivmod(i);b=g.quotient;d=h.charAt(so(g.modulus))+d}while(!Nx(b));if(c.prec>=0){c.filler=bZ;var -f=c.prec-d.length;if(f>0)d=ey(f,bC)+d}return ke(c,d)}function -sn(a,b){return a.or(b)}function -sy(a){var -b=0,e=m(a),c=10,d=1;if(e>0)switch(a6(a,b)){case -45:b++;d=-1;break;case -43:b++;d=1;break}if(b+1>24&cv,a>>31&cl)}function +sJ(a){return a.toInt()}function +OG(a){return+a.isNeg()}function +sF(a){return a.neg()}function +OE(a,b){var +c=kD(a);if(c.signedconv&&OG(b)){c.sign=-1;b=sF(b)}var +d=e,i=fQ(c.base),h="0123456789abcdef";do{var +g=b.udivmod(i);b=g.quotient;d=h.charAt(sJ(g.modulus))+d}while(!OH(b));if(c.prec>=0){c.filler=bW;var +f=c.prec-d.length;if(f>0)d=eB(f,bG)+d}return kr(c,d)}function +sI(a,b){return a.or(b)}function +sS(a){var +b=0,f=m(a),d=10,e=1,c=1;if(f>0)switch(bs(a,b)){case +45:b++;e=-1;break;case +43:b++;e=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=pk)return a-87;return-1}function -ND(a){var -h=sy(a),d=h[0],i=h[1],e=h[2],g=m(a),j=-1>>>0,f=d=e)aZ(cO);var -b=c;for(d++;d=e)break;b=e*b+c;if(b>j)aZ(cO)}if(d!=g)aZ(cO);b=i*b;if(e==10&&(b|0)!=b)aZ(cO);return b|0}function -dg(a,b,c){return a[b1(b)].apply(a,ew(c))}function -NF(a,b){switch(b.length){case +85:c=0;b+=2;break}return[b,e,d,c]}function +hR(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=pE)return a-87;return-1}function +ON(a){var +f=sS(a),d=f[0],i=f[1],g=f[2],j=f[3],h=m(a),k=-1>>>0,e=d=g)a_(cS);var +b=c;for(d++;d=g)break;b=g*b+c;if(b>k)a_(cS)}if(d!==h)a_(cS);b=i*b;if(j&&(b|0)!==b)a_(cS);return b|0}function +dN(a,b,c){return a[ca(b)].apply(a,ey(c))}function +OP(a,b){switch(b.length){case 1:return new -a;case +a();case 2:return new a(b[1]);case 3:return new @@ -733,131 +724,132 @@ a(b[1],b[2],b[3],b[4],b[5]);case a(b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function -c(){return a.apply(this,ew(b))}c.prototype=a.prototype;return new -c}function -sq(a){var +c(){return a.apply(this,ey(b))}c.prototype=a.prototype;return new +c()}function +sL(a){var c={};for(var b=1;b>16;return c}function -sr(a,b,c){var -o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=fN(a[n]);a.lex_backtrk=fN(a[m]);a.lex_check=fN(a[q]);a.lex_trans=fN(a[t]);a.lex_default=fN(a[r])}var -f,d=b,l=fQ(c[o]);if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else +sM(a,b,c){var +o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=fR(a[n]);a.lex_backtrk=fR(a[m]);a.lex_check=fR(a[q]);a.lex_trans=fR(a[t]);a.lex_default=fR(a[r])}var +f,d=b,l=c[o];if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else d=-d-1;for(;;){var g=a.lex_base[d];if(g<0)return-g-1;var -j=a.lex_backtrk[d];if(j>=0){c[i]=c[e];c[h]=j}if(c[e]>=c[p])if(c[k]==0)return-d-1;else -f=cu;else{f=l[c[e]];c[e]++}if(a.lex_check[g+f]==d)d=a.lex_trans[g+f];else -d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]==-1)aZ("lexing: empty token");else -return c[h]}else if(f==cu)c[k]=0}}function -hF(a){var +j=a.lex_backtrk[d];if(j>=0){c[i]=c[e];c[h]=j}if(c[e]>=c[p])if(c[k]===0)return-d-1;else +f=cw;else{f=cA(l,c[e]);c[e]++}if(a.lex_check[g+f]===d)d=a.lex_trans[g+f];else +d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]===-1)a_("lexing: empty token");else +return c[h]}else if(f===cw)c[k]=0}}function +hO(a){var c=0;for(var b=a.length-1;b>=0;b--){var d=a[b];c=[0,d,c]}return c}function -NI(a){var +OS(a){var b=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function -sx(a){return bF(a)}function -si(a,b){return a.add(b)}function -sj(a,b){return a.mul(b)}function -km(a,b){return a.ucompare(b)<0}function -sl(a){var -g=sy(a),f=g[0],i=g[1],d=g[2],h=fL(d),j=new -w(ct,0xfffffff,cn).udivmod(h).quotient,e=a6(a,f),b=hH(e);if(b<0||b>=d)aZ(cO);var -c=fL(b);for(;;){f++;e=a6(a,f);if(e==95)continue;b=hH(e);if(b<0||b>=d)break;if(km(j,c))aZ(cO);b=fL(b);c=si(sj(h,c),b);if(km(c,b))aZ(cO)}if(f!=m(a))aZ(cO);if(d==10&&km(new -w(0,0,ck),c))aZ(cO);if(i<0)c=sk(c);return c}function -NC(a,b){return a.xor(b)}function -NA(a,b){return a.shift_right_unsigned(b)}function -Nz(a,b){return a.shift_left(b)}function -ss(a){function -o(a,b){return Nz(a,b)}function -h(a,b){return NA(a,b)}function -s(a,b){return sn(a,b)}function -f(a,b){return NC(a,b)}function -k(a,b){return si(a,b)}function -i(a,b){return sj(a,b)}function +sD(a,b){return a.add(b)}function +sE(a,b){return a.mul(b)}function +kz(a,b){return a.ucompare(b)<0}function +sG(a){var +f=sS(a),e=f[0],i=f[1],g=f[2],j=f[3],h=fQ(g),k=new +w(cv,0xfffffff,cl).udivmod(h).quotient,d=bs(a,e),b=hR(d);if(b<0||b>=g)a_(cS);var +c=fQ(b);for(;;){e++;d=bs(a,e);if(d===95)continue;b=hR(d);if(b<0||b>=g)break;if(kz(k,c))a_(cS);b=fQ(b);c=sD(sE(h,c),b);if(kz(c,b))a_(cS)}if(e!==m(a))a_(cS);if(j&&kz(new +w(0,0,cj),c))a_(cS);if(i<0)c=sF(c);return c}var +OU=sG(bY("0xdaba0b6eb09322e3")),OT=sG(bY("0xd1342543de82ef95"));function +OM(a,b){return a.xor(b)}function +OK(a,b){return a.shift_right_unsigned(b)}function +OJ(a,b){return a.shift_left(b)}function +sN(a){function +o(a,b){return OJ(a,b)}function +h(a,b){return OK(a,b)}function +s(a,b){return sI(a,b)}function +f(a,b){return OM(a,b)}function +k(a,b){return sD(a,b)}function +i(a,b){return sE(a,b)}function m(a,b){return s(o(a,b),h(a,64-b))}function -g(a,b){return r9(a,b)}function -j(a,b,c){return fF(a,b,c)}var -q=sl(sx("0xd1342543de82ef95")),l=sl(sx("0xdaba0b6eb09322e3")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var +g(a,b){return ss(a,b)}function +j(a,b,c){return fK(a,b,c)}var +q=OT,l=OU,b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var d=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function -cx(a,b){if(a<0)dI();var +N9(a,b){if(a<0)dM();var a=a+1|0,c=new Array(a);c[0]=0;for(var d=1;d>>32-e,c)}function g(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function h(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function i(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function j(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var -c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function -MY(a,b,c){var -e=a.len&c8,d=0;a.len+=c;if(e){var -f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);hv(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function -MW(a){var -c=a.len&c8;a.b8[c]=b6;c++;if(c>56){for(var -b=c;b<64;b++)a.b8[b]=0;hv(a.w,a.b32);for(var +c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xd76aa478);f=g(f,c,d,e,b[1],12,0xe8c7b756);e=g(e,f,c,d,b[2],17,0x242070db);d=g(d,e,f,c,b[3],22,0xc1bdceee);c=g(c,d,e,f,b[4],7,0xf57c0faf);f=g(f,c,d,e,b[5],12,0x4787c62a);e=g(e,f,c,d,b[6],17,0xa8304613);d=g(d,e,f,c,b[7],22,0xfd469501);c=g(c,d,e,f,b[8],7,0x698098d8);f=g(f,c,d,e,b[9],12,0x8b44f7af);e=g(e,f,c,d,b[10],17,0xffff5bb1);d=g(d,e,f,c,b[11],22,0x895cd7be);c=g(c,d,e,f,b[12],7,0x6b901122);f=g(f,c,d,e,b[13],12,0xfd987193);e=g(e,f,c,d,b[14],17,0xa679438e);d=g(d,e,f,c,b[15],22,0x49b40821);c=h(c,d,e,f,b[1],5,0xf61e2562);f=h(f,c,d,e,b[6],9,0xc040b340);e=h(e,f,c,d,b[11],14,0x265e5a51);d=h(d,e,f,c,b[0],20,0xe9b6c7aa);c=h(c,d,e,f,b[5],5,0xd62f105d);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xd8a1e681);d=h(d,e,f,c,b[4],20,0xe7d3fbc8);c=h(c,d,e,f,b[9],5,0x21e1cde6);f=h(f,c,d,e,b[14],9,0xc33707d6);e=h(e,f,c,d,b[3],14,0xf4d50d87);d=h(d,e,f,c,b[8],20,0x455a14ed);c=h(c,d,e,f,b[13],5,0xa9e3e905);f=h(f,c,d,e,b[2],9,0xfcefa3f8);e=h(e,f,c,d,b[7],14,0x676f02d9);d=h(d,e,f,c,b[12],20,0x8d2a4c8a);c=i(c,d,e,f,b[5],4,0xfffa3942);f=i(f,c,d,e,b[8],11,0x8771f681);e=i(e,f,c,d,b[11],16,0x6d9d6122);d=i(d,e,f,c,b[14],23,0xfde5380c);c=i(c,d,e,f,b[1],4,0xa4beea44);f=i(f,c,d,e,b[4],11,0x4bdecfa9);e=i(e,f,c,d,b[7],16,0xf6bb4b60);d=i(d,e,f,c,b[10],23,0xbebfbc70);c=i(c,d,e,f,b[13],4,0x289b7ec6);f=i(f,c,d,e,b[0],11,0xeaa127fa);e=i(e,f,c,d,b[3],16,0xd4ef3085);d=i(d,e,f,c,b[6],23,0x04881d05);c=i(c,d,e,f,b[9],4,0xd9d4d039);f=i(f,c,d,e,b[12],11,0xe6db99e5);e=i(e,f,c,d,b[15],16,0x1fa27cf8);d=i(d,e,f,c,b[2],23,0xc4ac5665);c=j(c,d,e,f,b[0],6,0xf4292244);f=j(f,c,d,e,b[7],10,0x432aff97);e=j(e,f,c,d,b[14],15,0xab9423a7);d=j(d,e,f,c,b[5],21,0xfc93a039);c=j(c,d,e,f,b[12],6,0x655b59c3);f=j(f,c,d,e,b[3],10,0x8f0ccc92);e=j(e,f,c,d,b[10],15,0xffeff47d);d=j(d,e,f,c,b[1],21,0x85845dd1);c=j(c,d,e,f,b[8],6,0x6fa87e4f);f=j(f,c,d,e,b[15],10,0xfe2ce6e0);e=j(e,f,c,d,b[6],15,0xa3014314);d=j(d,e,f,c,b[13],21,0x4e0811a1);c=j(c,d,e,f,b[4],6,0xf7537e82);f=j(f,c,d,e,b[11],10,0xbd3af235);e=j(e,f,c,d,b[2],15,0x2ad7d2bb);d=j(d,e,f,c,b[9],21,0xeb86d391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function +N7(a,b,c){var +e=a.len&db,d=0;a.len+=c;if(e){var +f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);hD(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function +N5(a){var +c=a.len&db;a.b8[c]=b7;c++;if(c>56){for(var +b=c;b<64;b++)a.b8[b]=0;hD(a.w,a.b32);for(var b=0;b<56;b++)a.b8[b]=0}else for(var -b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;hv(a.w,a.b32);var +b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1fffffff;hD(a.w,a.b32);var e=new Uint8Array(16);for(var d=0;d<4;d++)for(var -b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function -N1(a){return bF(fP(a,0,a.length))}function -NK(a,b,c){var -d=MX(),e=fQ(a);MY(d,e.subarray(b,b+c),c);return N1(MW(d))}function -NL(a,b,c){return NK(df(a),b,c)}function -NN(){return 0}var -dh=new +b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&cu;return e}function +Pc(a){return bJ(fS(a,0,a.length))}function +OW(a,b,c){var +d=N6(),e=hX(a);N7(d,e.subarray(b,b+c),c);return Pc(N5(d))}function +OX(a,b,c){return OW(dm(a),b,c)}function +OZ(){return 0}var +dn=new Array();function -ko(a){return dh[a]}function -dK(a){var -b=ko(a);if(!b.opened)I("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(fP(b.buffer,0,b.buffer_curr));else +kB(a){return dn[a]}function +dO(a){var +b=kB(a);if(!b.opened)H("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr===0)return 0;if(b.output)b.output(fS(b.buffer,0,b.buffer_curr));else b.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function -NY(a){if(a.refill!=null){var -e=a.refill(),b=sF(e);if(b.length==0)a.refill=null;else{if(a.buffer.length0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;NY(e);var +O1(a,b,c,d){var +e=kB(a),g=d,f=e.buffer_max-e.buffer_curr;if(d<=f){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+d),c);e.buffer_curr+=d}else if(f>0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;O$(e);var f=e.buffer_max-e.buffer_curr;if(g>f)g=f;b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+g),c);e.buffer_curr+=g}return g|0}function -NO(a,b,c,d){var -e=fQ(b);return NP(a,e,c,d)}function -N3(a,b){if(b.name)try{var -d=require(jd),c=d.openSync(b.name,"rs");return new -co(c,b)}catch(f){}return new -co(a,b)}var -hK=new +O0(a,b,c,d){var +e=hX(b);return O1(a,e,c,d)}function +Pe(a,b){if(b.name)try{var +d=require(j9),c=d.openSync(b.name,"rs");return new +cm(c,b)}catch(f){}return new +cm(a,b)}var +hV=new Array(3);function -fE(a,b){bk.call(this,am(0));this.log=function(a){return 0};if(a==1&&typeof -console.log=="function")this.log=console.log;else if(a==2&&typeof -console.error=="function")this.log=console.error;else if(typeof -console.log=="function")this.log=console.log;this.flags=b}fE.prototype.length=function(){return 0};fE.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var -e=am(d);b$(kb(b),c,e,0,d);this.log(e.toUtf16());return 0}I(this.fd+qG)};fE.prototype.read=function(a,b,c,d){I(this.fd+": file descriptor is write only")};fE.prototype.close=function(){this.log=undefined};function -hL(a,b){if(b==undefined)b=hK.length;hK[b]=a;return b|0}function -N_(a,b,c){var +fJ(a,b){bq.call(this,ap(0));this.log=function(a){return 0};if(a===1&&typeof +console.log==="function")this.log=console.log;else if(a===2&&typeof +console.error==="function")this.log=console.error;else if(typeof +console.log==="function")this.log=console.log;this.flags=b}fJ.prototype.length=function(){return 0};fJ.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]===10)d--;var +e=ap(d);b$(ko(b),c,e,0,d);this.log(e.toUtf16());return 0}H(this.fd+q1)};fJ.prototype.read=function(a,b,c,d){H(this.fd+": file descriptor is write only")};fJ.prototype.close=function(){this.log=undefined};function +hW(a,b){if(b===undefined)b=hV.length;hV[b]=a;return b|0}function +Pl(a,b,c){var d={};while(b){switch(b[1]){case 0:d.rdonly=1;break;case 1:d.wronly=1;break;case @@ -867,342 +859,338 @@ d={};while(b){switch(b[1]){case 5:d.excl=1;break;case 6:d.binary=1;break;case 7:d.text=1;break;case -8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)I(cp(a)+jD);if(d.text&&d.binary)I(cp(a)+jX);var -e=sJ(a),f=e.device.open(e.rest,d);return hL(f,undefined)}(function(){function -a(a,b){return fR()?N3(a,b):new -fE(a,b)}hL(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);hL(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);hL(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function -NQ(a){var -b=hK[a];if(b.flags.wronly)I(q$+a+" is writeonly");var +8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)H(cn(a)+jR);if(d.text&&d.binary)H(cn(a)+j$);var +e=s5(a),f=e.device.open(e.rest,d);return hW(f,undefined)}(function(){function +a(a,b){return fT()?Pe(a,b):new +fJ(a,b)}hW(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);hW(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);hW(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function +O2(a){var +b=hV[a];if(b.flags.wronly)H(rt+a+" is writeonly");var d=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new -Uint8Array(eg),refill:d};dh[c.fd]=c;return c.fd}function -st(a){var -b=hK[a];if(b.flags.rdonly)I(q$+a+" is readonly");var +Uint8Array(el),refill:d};dn[c.fd]=c;return c.fd}function +sO(a){var +b=hV[a];if(b.flags.rdonly)H(rt+a+" is readonly");var d=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new -Uint8Array(eg),buffered:d};dh[c.fd]=c;return c.fd}function -NR(){var +Uint8Array(el),buffered:d};dn[c.fd]=c;return c.fd}function +O3(){var b=0;for(var -a=0;ae.buffer.length){var +a=0;ae.buffer.length){var g=new Uint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case -0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;dK(a);break;case -1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dK(a);break;case +0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;dO(a);break;case +1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dO(a);break;case 2:var -f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dK(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;dK(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function -NS(a,b,c,d){var -b=fQ(b);return NT(a,b,c,d)}function -kp(a,b,c,d){return NS(a,df(b),c,d)}function -su(a,b){var -c=bF(String.fromCharCode(b));kp(a,c,0,1);return 0}function -sv(a){if(isFinite(a)){var +f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dO(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;dO(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function +O4(a,b,c,d){var +b=hX(b);return O5(a,b,c,d)}function +kC(a,b,c,d){return O4(a,dm(b),c,d)}function +sP(a,b){var +c=bJ(String.fromCharCode(b));kC(a,c,0,1);return 0}function +sQ(a){if(Number.isFinite(a)){var d=1/a<0;a=Math.abs(a);var -b=Math.floor(a),c=a-b;if(d){b=-b;c=-c}return[0,c,b]}if(isNaN(a))return[0,NaN,NaN];return[0,1/a,a]}function -dL(a,b){return+(es(a,b,false)!=0)}function -fO(a){if(a -instanceof -Array&&a[0]==a[0]>>>0)return a[0];else if(hD(a))return em;else if(hE(a))return em;else if(a +b=Math.floor(a),c=a-b;if(d){b=-b;c=-c}return[0,c,b]}if(Number.isNaN(a))return[0,Number.NaN,Number.NaN];return[0,1/a,a]}function +dP(a,b){return+(eu(a,b,false)!==0)}function +hQ(a){if(Array.isArray(a)&&a[0]===a[0]>>>0)return a[0];else if(hM(a))return ep;else if(hN(a))return ep;else if(a instanceof Function||typeof -a=="function")return 247;else if(a&&a.caml_custom)return c_;else -return fC}function -M8(a){var -c={};if(a)for(var -b=1;b=0)a=e;else -aZ("caml_register_global: cannot locate "+d)}}bd[a+1]=b;if(c)bd[c]=b}function -kt(a,b){sw[cp(a)]=b;return 0}function -N0(){aq(jI)}function -ai(a,b){if(b>>>0>=m(a))N0();return a6(a,b)}function -hJ(a){a.t&6&&fH(a);return bF(a.c)}function -N2(){return 0x7FFFFFFF/4|0}function -NW(){sz(bd.Not_found)}function -sC(a){var -b=sI(b1(a));if(b===undefined)NW();return cb(b)}function -sD(){if(N.crypto)if(N.crypto.getRandomValues){var -a=N.crypto.getRandomValues(new -Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(N.crypto.randomBytes){var +a==="function")return 247;else if(a&&a.caml_custom)return dd;else +return fG}var +s4=undefined;function +Og(a){var +d={},c=-1;if(a)for(var +b=1;b=0)a=e;else{var +a=a5.symidx.next_idx++;a5.symidx[d]=a}}}a5[a+1]=b;if(c)a5[c]=b}function +kF(a,b){sR[cn(a)]=b;return 0}function +Pb(){as(jW)}function +ag(a,b){if(b>>>0>=m(a))Pb();return bs(a,b)}function +hU(a){a.t&6&&fM(a);return bJ(a.c)}function +Pd(){return 0x7fffffff/4|0}function +O8(){sT(a5.Not_found)}function +sW(a){var +b=s3(ca(a));if(b===undefined)O8();return bY(b)}function +sX(){if(Q.crypto)if(Q.crypto.getRandomValues){var +a=Q.crypto.getRandomValues(new +Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(Q.crypto.randomBytes){var a=new -Int32Array(N.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var +Int32Array(Q.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var b=new Date().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function -cq(a){var +co(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function v(a,b){return{joo_tramp:a,joo_args:b}}function -an(a){{if(a +al(a){{if(Array.isArray(a))return a;var +b;if(Q.RangeError&&a instanceof -Array)return a;var -b;if(N.RangeError&&a +Q.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=a5.Stack_overflow;else if(Q.InternalError&&a instanceof -N.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=bd.Stack_overflow;else if(N.InternalError&&a +Q.InternalError&&a.message&&a.message.match(/too much recursion/i))b=a5.Stack_overflow;else if(a instanceof -N.InternalError&&a.message&&a.message.match(/too much recursion/i))b=bd.Stack_overflow;else if(a +Q.Error&&dp(js))b=[0,dp(js),a];else +b=[0,a5.Failure,bY(String(a))];if(a instanceof -N.Error&&di(jh))b=[0,di(jh),a];else -b=[0,bd.Failure,cb(String(a))];if(a -instanceof -N.Error)b.js_error=a;return b}}function -NE(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function -Nh(a){var -b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&NE(a[1]))var +Q.Error)b.js_error=a;return b}}function +OO(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function +Or(a){var +b=e;if(a[0]===0){b+=a[1][1];if(a.length===3&&a[2][0]===0&&OO(a[1]))var f=a[2],g=1;else var g=2,f=a;b+="(";for(var -d=g;dg)b+=jZ;var +d=g;dg)b+=kb;var c=f[d];if(typeof -c=="number")b+=c.toString();else if(c -instanceof -cT)b+=dc+c.toString()+dc;else if(typeof -c=="string")b+=dc+c.toString()+dc;else -b+=pm}b+=")"}else if(a[0]==L)b+=a[1];return b}function -sf(a){if(a +c==="number")b+=c.toString();else if(c instanceof -Array&&(a[0]==0||a[0]==L)){var -c=di(rO);if(c)hy(c,[a,false]);else{var -d=Nh(a),b=di(o1);if(b)hy(b,[0]);console.error(jS+d);if(a.js_error)throw a.js_error}}else +cX)b+=di+c.toString()+di;else if(typeof +c==="string")b+=di+c.toString()+di;else +b+=jP}b+=")"}else if(a[0]===J)b+=a[1];return b}function +sA(a){if(Array.isArray(a)&&(a[0]===0||a[0]===J)){var +c=dp(r8);if(c)hG(c,[a,false]);else{var +d=Or(a),b=dp(pi);if(b)hG(b,[0]);console.error(j5+d);if(a.js_error)throw a.js_error}}else throw a}function -NZ(){var -c=N.process;if(c&&c.on)c.on("uncaughtException",function(a,b){sf(a);c.exit(2)});else if(N.addEventListener)N.addEventListener(hn,function(a){if(a.error)sf(a.error)})}NZ();function -g(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):cV(a,[b])}function -j(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):cV(a,[b,c])}function -bT(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):cV(a,[b,c,d])}function -fj(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)==4?a(b,c,d,e):cV(a,[b,c,d,e])}function -dB(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):cV(a,[b,c,d,e,f])}function -MV(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):cV(a,[b,c,d,e,f,g,h])}var -N9=undefined;Ni();var -hM=[L,r0,-1],kz=[L,pY,-2],eB=[L,j9,-3],fS=[L,pN,-4],bG=[L,qX,-7],kx=[L,rY,-8],ky=[L,qc,-9],u=[L,qi,-11],kA=[L,qu,-12],h1=[0,e,0,0,-1],kW=[0,e,1,0,0],MJ=[4,0,0,0,[12,45,[4,0,0,0,0]]],h$=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,py,[4,0,0,0,[12,45,[4,0,0,0,[11,of,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],MK=[17,[0,a,1,0],[11,n1,[17,0,0]]],ML=[17,[0,a,1,0],[12,40,0]],MM=[11,"('\"'",[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,nx,[17,0,0]]]]]],MN=[0,a,1,0],MO=[11,oX,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,nx,[17,0,0]]]]]],MP=[0,a,1,0],MQ=[11,da,[17,[0,a,1,0],[11,rW,[17,0,0]]]],MR=[0,a,1,0],MS=[11,oX,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,rW,[17,0,0]]]]]],MT=[0,a,1,0],MU=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],mD=[0,af,[0,ci,-991563951]],mE=[0,af,[0,ci,pv]],mR=hF([9,10,11,12,13,32,jY,nB,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,pi,8233,8239,8287,12288]),a$=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],fd="lib/data_source/jellyfin_api.ml.Types.order",a3="lib/data_source/jellyfin_api.ml.Types.sort",gA="lib/data_source/jellyfin_api.ml.Item.genre_item",i3="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",E="lib/data_source/jellyfin_api.ml.Item.type_",l="lib/data_source/jellyfin_api.ml.Item.field",gB="lib/data_source/jellyfin_api.ml.Item.t",gC="lib/data_source/jellyfin_api.ml.Items.params",gF="lib/data_source/jellyfin_api.ml.Items.response",gK="lib/data_source/jellyfin_api.ml.Views.params",gL="lib/data_source/jellyfin_api.ml.Views.response",gM="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",ff="lib/db/generic_schema.ml.Id.t",gN="lib/db/generic_schema.ml.Collection.t",gO="lib/db/generic_schema.ml.Genre.t",gP="lib/db/generic_schema.ml.Album.t",gQ="lib/db/generic_schema.ml.Track.t",gR="lib/db/stores.ml.Items.sorts",gS="lib/db/stores.ml.Items.t",nd=[0,17,[0,16,[0,1,[0,18,[0,11,0]]]]];ca(11,kA,qu);ca(10,u,qi);ca(9,[L,qj,nW],qj);ca(8,ky,qc);ca(7,kx,rY);ca(6,bG,qX);ca(5,[L,oW,-6],oW);ca(4,[L,p5,-5],p5);ca(3,fS,pN);ca(2,eB,j9);ca(1,kz,pY);ca(0,hM,r0);var -s2=nR,s0="output_substring",sX=db,sU=fr,sV=fD,sK="Stdlib.Exit",sN=bl(0,0,32752),sP=bl(0,0,65520),sR=bl(1,0,32760),s9=g8,s_="\\'",s$=g$,ta=hj,tb=g3,tc=gX,s7="Char.chr",th=" is not an Unicode scalar value",tt="List.init",tp="hd",tZ=[0,oG,ot,20],tY=[0,oG,p6,9],tJ="String.blit / Bytes.blit_string",tI="Bytes.blit",tH="String.sub / Bytes.sub",t$="String.contains_from / Bytes.contains_from",t9="String.index_from / Bytes.index_from",t4=e,t1="String.concat",uo=[0,"array.ml",rA,4],uj="Array.map2: arrays must have the same length",ug="Array.blit",ue="Array.init",um="Stdlib.Array.Bottom",uy=[0,"set.ml",o0,18],uu=g0,uv=g0,uw=g0,ux=g0,uE="Map.remove_min_elt",uF=[0,0,0,0],uG=[0,"map.ml",oo,10],uA=hl,uB=hl,uC=hl,uD=hl,uI="Stdlib.Queue.Empty",uQ="Buffer.add_substring/add_subbytes",uP="Buffer.add: cannot grow buffer",uN="Buffer.sub",uY="first domain already spawned",uV=[0,"domain.ml",184,13],u9=p3,u_=pw,u$=q0,va=pJ,vb=r4,vc=qW,vd="%f",ve="%B",vf="%{",vg="%}",vh="%(",vi="%)",vj=r3,vk="%t",vl="%?",vm="%r",vn="%_r",vo=[0,aP,nz,23],vz=[0,aP,rm,21],vr=[0,aP,om,21],vA=[0,aP,nS,21],vs=[0,aP,p4,21],vB=[0,aP,qm,19],vt=[0,aP,p7,19],vC=[0,aP,oA,22],vu=[0,aP,nY,22],vD=[0,aP,pI,30],vv=[0,aP,oc,30],vx=[0,aP,q4,26],vp=[0,aP,oB,26],vy=[0,aP,qL,28],vq=[0,aP,nA,28],vw=[0,aP,qw,23],wP=[0,aP,1558,4],wQ="Printf: bad conversion %[",wR=[0,aP,1626,39],wS=[0,aP,1649,31],wT=[0,aP,1650,31],wU="Printf: bad conversion %_",wV=pU,wW=n9,wX=pU,wY=n9,w1=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],w0=[0,0,4],wK=jc,wI="neg_infinity",wJ=p1,wH=db,wC=[0,gV],wq="%+nd",wr="% nd",wt="%+ni",wu="% ni",wv="%nx",ww="%#nx",wx="%nX",wy="%#nX",wz="%no",wA="%#no",wp="%nd",ws=r4,wB="%nu",wc="%+ld",wd="% ld",wf="%+li",wg="% li",wh="%lx",wi="%#lx",wj="%lX",wk="%#lX",wl="%lo",wm="%#lo",wb="%ld",we=pJ,wn="%lu",v0="%+Ld",v1="% Ld",v3="%+Li",v4="% Li",v5="%Lx",v6="%#Lx",v7="%LX",v8="%#LX",v9="%Lo",v_="%#Lo",vZ="%Ld",v2=qW,v$="%Lu",vM="%+d",vN="% d",vP="%+i",vQ="% i",vR="%x",vS="%#x",vT=rE,vU="%#X",vV="%o",vW="%#o",vL=jb,vO=q0,vX=nO,u1="@]",u2="@}",u3="@?",u4="@\n",u5="@.",u6="@@",u7="@%",u8="@",vE="CamlinternalFormat.Type_mismatch",w6=e,w7=[0,[11,jZ,[2,0,[2,0,0]]],", %s%s"],xH=[0,[11,jS,[2,0,[12,10,0]]],nT],xI=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],xG="Fatal error: out of memory in uncaught exception handler",xD=[0,[11,jS,[2,0,[12,10,0]]],nT],xx=[0,[2,0,[12,10,0]],"%s\n"],xy=[0,[11,nG,0],nG],xm="Raised at",xn="Re-raised at",xo="Raised by primitive operation at",xp="Called from",xq=[0,[12,32,[4,0,0,0,0]]," %d"],xu=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],xr=" (inlined)",xt=e,xs=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,no,[2,0,[11,py,MJ]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],xv=[0,[2,0,[11," unknown location",0]],"%s unknown location"],xf="Out of memory",xg="Stack overflow",xh="Pattern matching failed",xi="Assertion failed",xj="Undefined recursive module",w9=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],w_=e,w$=e,xa=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],w5=[0,[4,0,0,0,0],jb],w3=[0,[3,0,0],"%S"],w4=pm,xA=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],xM="Fun.Finally_raised: ",xK="Stdlib.Fun.Finally_raised",xN="Digest.BLAKE2: wrong hash size",x0=bl(14371852,15349651,22696),x1=bl(12230193,11438743,35013),x2=bl(1424933,15549263,2083),x3=bl(9492471,4696708,43520),xR=bl(1,0,0),xS=bl(0,0,0),xV=bl(1,0,0),xT=bl(0,0,0),xU=bl(2,0,0),yd="Hashtbl: unsupported hash table format",x8=e,yT=[3,0,3],yU=db,yO=ql,yP="<\/",yQ=e,yK=ql,yL="<",yM=e,yI="\n",yE=e,yF=e,yG=e,yH=e,yw=[0,e],yr=e,ys=e,yt=e,yu=e,yn=[0,e,0,e],yj="Stdlib.Format.String_tag",y2="Jsoo_runtime.Error.Exn",y3=jh,zj=[0,"src/fut.ml",34,25],zB="info",zA=hn,zz="log",zy="search",zs=[0,1],zq=rX,zC="isSecureContext",zH="cache",zI="credentials",zJ="headers",zK="integrity",zL="keepalive",zM="method",zN="mode",zO="redirect",zP="referrer",zQ="referrerPolicy",An="open",Aj="unique",Ad="autoIncrement",Ae="keyPath",Af="new object store with options:",z$="readonly",Aa="readwrite",Ab="readwriteflush",z5="next",z6="nextUnique",z7="prev",z8="prevUnique",At=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],AC="CCResult.Get_error",AP=[0,rZ,119,10],AM=[0,rZ,92,10],AI=e,A6=[0,[17,[0,pq,1,0],0],pq],A5=[0,[12,32,0],bZ],A4=[0,[11,oC,0],oC],A7=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],AZ=[0,[11,qP,[15,[11,qp,[15,[11," dst-off=",[4,0,0,0,[11,i$,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],AX=[0,[11,qP,[15,[11,qp,[15,[11," src-off=",[4,0,0,0,[11,i$,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],AV=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],AU=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],A8=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],A9=e,BF=[0,[8,[0,0,0],0,[0,0],0],np],Bo=[0,[12,44,0],jJ],Bv=[0,[15,[12,58,[15,0]]],"%a:%a"],Bu=[0,[12,44,0],jJ],Bn=[0,[11,fv,0],fv],Bq=[0,[11,fr,0],fr],Br=[0,[11,fD,0],fD],Bs=[0,[8,[0,0,0],0,[0,0],0],np],Bt=[0,[8,[0,0,3],0,0,0],"%g"],Bw=[0,[12,ej,[15,[12,en,0]]],"{%a}"],Bp=[0,[12,91,[15,[12,93,0]]],"[%a]"],Bx=[0,[12,44,[17,[0,a,1,0],0]],nJ],BB=[0,[18,[1,[0,[11,eb,0],eb]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],BA=[0,[12,44,[17,[0,a,1,0],0]],nJ],BC=[0,[18,[1,[0,[11,eb,0],eb]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],BD=[0,[11,rc,0],rc],By=[0,[18,[1,[0,[11,eb,0],eb]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],Bz=[0,[11,rP,0],rP],Bc=[0,[12,34,0],dc],Bg=[0,[0,0],p3],Bf=[0,[11,g8,0],g8],Bi=[0,[11,g$,0],g$],Bj=[0,[11,hj,0],hj],Bk=[0,[11,g3,0],g3],Bl=[0,[11,gX,0],gX],Be=[0,[11,j3,0],j3],Bh=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],Bd=[0,[12,34,0],dc],B3=[0,fw,ox,9],BW=[0,eq,jQ],BR=[0,fx,jQ],BX=[0,c$,jQ],BV=[0,c$,fp],BS=[0,fx,fp],BT=[0,fw,153,55],BU=[0,c$,fp],BY=[0,fw,152,55],BZ=[0,fw,154,55],B0=[0,c$,cv],BP=[0,fw,jT,9],BH=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],BO=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],Dg=[0,bU,[0,bc,1]],Dh=[0,bU,cL],Di=[0,bU,[0,bc,0]],Dk=[0,bU,fq],Dj=[0,bU,dD],Dv=[0,jN,pO,27],Dp=[0,bU,oK],Dm=[0,bU,rH],De=[0,jN,rq,8],Dd=[0,jN,qt,45],CL=[0,[18,[1,[0,0,e]],[11,ef,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,jB,[17,[0,a,1,0],[11,gW,MK]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],CM=[0,[18,[1,[0,0,e]],[11,ef,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],CO=[0,[15,[17,[0,a,1,0],[11,jm,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,gW,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],CP=[0,[15,[17,[0,a,1,0],[11,n4,[17,[0,a,1,0],[11,qO,[17,[0,a,1,0],[11,jE,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],CQ=[0,[15,[17,[0,a,1,0],[11,n4,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,jE,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],CR=[0,[15,[17,[0,a,1,0],[11,jm,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],CN=[0,[15,[17,[0,a,1,0],[11,jm,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,qO,[17,[0,a,1,0],[11,jE,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],CS=[0,[18,[1,[0,0,e]],[11,ef,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,jB,[17,[0,a,1,0],[11,gW,[17,[0,a,1,0],[11,n1,ML]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],CT=[0,[4,8,[0,2,2],0,0],"%02X"],CV=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],CU=[0,[12,41,[17,0,0]],")@]"],CW=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],CX=[0,[11,qD,[17,[0,a,1,0],[11,bY,[17,0,0]]]],"member@ name@]"],CY=[0,[11,hq,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],CZ=[0,[11,bY,[17,[0,a,1,0],[11,js,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],C0=[0,[11,fo,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,nR,[17,0,0]]]]]],"end@ of@ input@]"],C1=[0,[11,"JavaScript",[17,[0,a,1,0],[11,o5,[17,0,0]]]],"JavaScript@ comment@]"],C2=[0,[11,hq,[17,[0,a,1,0],[11,ea,[17,0,0]]]],"JSON@ value@]"],C3=[0,[11,qD,[17,[0,a,1,0],[11,bY,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,hu,[17,[0,a,1,0],[11,fo,[17,MN,MM]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],C4=[0,[11,ea,[17,[0,a,1,0],[11,js,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,hu,[17,[0,a,1,0],[11,fo,[17,MP,MO]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],C5=[0,[11,ea,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,hi,[17,[0,a,1,0],[11,fo,[17,[0,a,1,0],[11,"(value",[17,MR,MQ]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],C6=[0,[11,ea,[17,[0,a,1,0],[11,js,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,hi,[17,[0,a,1,0],[11,fo,[17,MT,MS]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],C7=[0,[18,[1,[0,0,e]],[11,ef,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],Db=[0,[18,[1,[0,0,e]],[11,ef,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],Dc=[0,[18,[1,[0,0,e]],[11,ef,[17,[0,a,1,0],[11,gW,[17,[0,a,1,0],[11,jB,[17,[0,a,1,0],[11,hq,[17,[0,a,1,0],[11,jy,MU]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],C8=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],C9=[0,[11,hu,[17,0,0]],"object@]"],C_=[0,[11,hi,[17,0,0]],"array@]"],C$=[0,[11,o5,[17,0,0]],"comment@]"],Da=[0,[11,jy,[17,0,0]],"string@]"],CJ=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],CI=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],Cn=[0,af,-543455433],Cu=[0,af,[0,fk,ee]],Cv=[0,af,[0,fk,f]],Cw=[0,af,[0,fk,fq]],Cx=[0,af,[0,fk,dD]],CA=[0,af,[0,ci,ee]],CB=[0,af,[0,ci,g_]],CC=[0,af,[0,ci,rv]],CD=[0,af,[0,ci,[0,ru,1]]],CE=[0,af,[0,ci,[0,ru,0]]],CF=[0,af,[0,ci,[0,jg,1]]],CG=[0,af,[0,ci,[0,jg,0]]],CH=[0,af,[0,ci,ob]],DP="not a valid JSON array/object",DM=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],DH=[0,[11,bX,0],bX],DI=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],DJ=[0,[15,0],r3],DG="We expected a well-formed JSON document (array or object)",DB=ea,DC="object fields",Dz=[0,"lib/ezjsonm.ml",61,19],DA=[0,g6,357123046],Dy="Abort",DD="Ezjsonm.Parse_error",DR=hF([[0,ht,z],[0,193,z],[0,pE,z],[0,195,z],[0,196,z],[0,rh,z],[0,198,fm],[0,199,ay],[0,200,F],[0,201,F],[0,202,F],[0,203,F],[0,qt,W],[0,205,W],[0,206,W],[0,207,W],[0,208,ah],[0,209,ao],[0,210,s],[0,rq,s],[0,212,s],[0,213,s],[0,214,s],[0,216,s],[0,217,B],[0,218,B],[0,219,B],[0,220,B],[0,221,aJ],[0,222,jM],[0,oJ,R],[0,ep,x],[0,q2,x],[0,226,x],[0,227,x],[0,228,x],[0,229,x],[0,230,cM],[0,231,aK],[0,232,n],[0,pZ,n],[0,234,n],[0,235,n],[0,236,O],[0,hf,O],[0,238,O],[0,po,O],[0,ed,aa],[0,241,ab],[0,242,d],[0,243,d],[0,rf,d],[0,jV,d],[0,246,d],[0,L,d],[0,249,t],[0,jH,t],[0,251,t],[0,em,t],[0,n5,ax],[0,dF,fy],[0,c_,ax],[0,cu,z],[0,q7,x],[0,258,z],[0,259,x],[0,260,z],[0,261,x],[0,262,ay],[0,263,aK],[0,264,ay],[0,265,aK],[0,oP,ay],[0,267,aK],[0,268,ay],[0,269,aK],[0,270,ah],[0,nu,aa],[0,272,ah],[0,rx,aa],[0,274,F],[0,275,n],[0,276,F],[0,277,n],[0,278,F],[0,279,n],[0,280,F],[0,281,n],[0,282,F],[0,283,n],[0,284,ak],[0,285,V],[0,286,ak],[0,287,V],[0,288,ak],[0,289,V],[0,oZ,ak],[0,291,V],[0,qH,az],[0,293,U],[0,294,az],[0,295,U],[0,296,W],[0,o$,O],[0,298,W],[0,299,O],[0,300,W],[0,301,O],[0,302,W],[0,303,O],[0,304,W],[0,305,O],[0,306,"IJ"],[0,307,"ij"],[0,308,b_],[0,309,bq],[0,310,aA],[0,311,aQ],[0,312,"kra"],[0,313,ad],[0,314,D],[0,315,ad],[0,316,D],[0,317,ad],[0,318,D],[0,319,ad],[0,320,D],[0,321,ad],[0,322,D],[0,323,ao],[0,324,ab],[0,325,ao],[0,326,ab],[0,327,ao],[0,328,ab],[0,329,ab],[0,330,"NG"],[0,331,fz],[0,332,s],[0,333,d],[0,334,s],[0,335,d],[0,336,s],[0,337,d],[0,338,oV],[0,339,cR],[0,340,ae],[0,341,r],[0,342,ae],[0,343,r],[0,344,ae],[0,345,r],[0,346,_],[0,347,R],[0,348,_],[0,349,R],[0,350,_],[0,351,R],[0,352,_],[0,353,R],[0,354,aC],[0,355,ag],[0,356,aC],[0,n_,ag],[0,358,aC],[0,359,ag],[0,360,B],[0,361,t],[0,362,B],[0,ox,t],[0,364,B],[0,365,t],[0,366,B],[0,367,t],[0,368,B],[0,rA,t],[0,370,B],[0,371,t],[0,372,aV],[0,373,a4],[0,374,aJ],[0,375,ax],[0,376,aJ],[0,377,ap],[0,378,$],[0,379,ap],[0,380,$],[0,381,ap],[0,382,$],[0,383,R],[0,384,aI],[0,385,aT],[0,386,aT],[0,387,aI],[0,388,oa],[0,389,oa],[0,390,s],[0,391,ay],[0,392,aK],[0,393,ah],[0,394,ah],[0,395,ah],[0,396,aa],[0,pO,aa],[0,398,F],[0,399,F],[0,400,F],[0,401,bi],[0,402,b5],[0,403,ak],[0,404,ak],[0,405,o6],[0,406,W],[0,407,W],[0,oo,aA],[0,409,aQ],[0,410,D],[0,411,D],[0,412,bb],[0,413,ao],[0,414,ab],[0,415,s],[0,416,s],[0,417,d],[0,418,"OI"],[0,419,"oi"],[0,420,aU],[0,421,bo],[0,422,"YR"],[0,423,jA],[0,424,jA],[0,425,oq],[0,426,cQ],[0,427,ag],[0,428,aC],[0,429,ag],[0,430,aC],[0,431,B],[0,432,t],[0,433,B],[0,434,bj],[0,435,aJ],[0,436,ax],[0,437,ap],[0,438,$],[0,439,ap],[0,440,ap],[0,441,$],[0,442,$],[0,443,jA],[0,444,pX],[0,445,pX],[0,446,bV],[0,447,a4],[0,448,cj],[0,449,cj],[0,450,cj],[0,451,cj],[0,452,rj],[0,453,ah],[0,454,b7],[0,455,"LJ"],[0,456,ad],[0,457,"lj"],[0,458,"NJ"],[0,459,ao],[0,460,"nj"],[0,461,z],[0,462,x],[0,463,W],[0,464,O],[0,465,s],[0,466,d],[0,467,B],[0,468,t],[0,469,B],[0,470,t],[0,471,B],[0,472,t],[0,473,B],[0,474,t],[0,475,B],[0,476,t],[0,477,n],[0,478,z],[0,479,x],[0,480,z],[0,481,x],[0,482,fm],[0,483,cM],[0,484,ak],[0,485,V],[0,486,ak],[0,487,V],[0,488,aA],[0,489,aQ],[0,490,s],[0,491,d],[0,492,s],[0,493,d],[0,494,ap],[0,495,$],[0,496,bq],[0,497,rj],[0,498,ah],[0,499,b7],[0,500,ak],[0,501,V],[0,502,"HW"],[0,503,aV],[0,504,ao],[0,505,ab],[0,506,z],[0,507,x],[0,508,fm],[0,509,cM],[0,510,s],[0,511,d],[0,hc,z],[0,513,x],[0,514,z],[0,515,x],[0,516,F],[0,517,n],[0,518,F],[0,519,n],[0,520,W],[0,521,O],[0,522,W],[0,523,O],[0,524,s],[0,525,d],[0,526,s],[0,527,d],[0,528,ae],[0,529,r],[0,530,ae],[0,531,r],[0,532,B],[0,533,t],[0,534,B],[0,535,t],[0,536,_],[0,537,R],[0,538,aC],[0,539,ag],[0,540,"GH"],[0,541,"gh"],[0,542,az],[0,543,U],[0,544,ao],[0,545,aa],[0,546,"OU"],[0,547,jp],[0,548,ap],[0,549,$],[0,550,z],[0,551,x],[0,552,F],[0,553,n],[0,554,s],[0,555,d],[0,556,s],[0,557,d],[0,558,s],[0,559,d],[0,560,s],[0,561,d],[0,562,aJ],[0,563,ax],[0,564,D],[0,565,ab],[0,566,ag],[0,567,bq],[0,568,"db"],[0,569,"qp"],[0,570,z],[0,o0,ay],[0,572,aK],[0,573,ad],[0,574,aC],[0,575,R],[0,576,$],[0,577,oy],[0,578,bV],[0,579,aT],[0,580,B],[0,581,bj],[0,582,F],[0,583,n],[0,584,b_],[0,585,bq],[0,586,b0],[0,587,c9],[0,588,ae],[0,589,r],[0,590,aJ],[0,591,ax],[0,592,x],[0,593,x],[0,594,x],[0,595,aI],[0,596,d],[0,597,aK],[0,598,aa],[0,599,aa],[0,600,n],[0,601,n],[0,602,n],[0,603,n],[0,604,n],[0,605,n],[0,606,n],[0,607,bq],[0,608,V],[0,609,V],[0,610,V],[0,611,V],[0,612,qT],[0,613,U],[0,614,U],[0,615,U],[0,616,O],[0,617,O],[0,618,O],[0,619,D],[0,620,D],[0,621,D],[0,622,el],[0,623,aW],[0,624,aW],[0,625,aW],[0,626,ab],[0,627,ab],[0,628,ab],[0,629,d],[0,630,cR],[0,631,d],[0,632,jr],[0,633,r],[0,634,r],[0,635,r],[0,636,r],[0,637,r],[0,638,r],[0,639,r],[0,640,r],[0,641,r],[0,642,R],[0,643,cQ],[0,644,bq],[0,645,"{squat}"],[0,646,cQ],[0,647,ag],[0,648,ag],[0,649,t],[0,650,t],[0,651,aX],[0,652,aX],[0,653,a4],[0,ot,ax],[0,655,ax],[0,656,$],[0,657,$],[0,658,$],[0,659,$],[0,660,oy],[0,661,"{voiced}"],[0,662,bV],[0,663,aK],[0,664,cj],[0,665,aI],[0,666,n],[0,667,V],[0,668,U],[0,669,bq],[0,670,aQ],[0,671,D],[0,672,c9],[0,673,bV],[0,674,bV],[0,675,b7],[0,676,b7],[0,677,b7],[0,678,bV],[0,p6,ho],[0,680,ol],[0,681,j7],[0,682,qU],[0,683,el],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,686,U],[0,687,U],[0,688,U],[0,689,U],[0,690,bq],[0,691,r],[0,692,r],[0,693,r],[0,694,r],[0,695,a4],[0,696,ax],[0,736,V],[0,737,D],[0,738,R],[0,739,bW],[0,740,bV],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,rm,e],[0,om,e],[0,816,e],[0,817,e],[0,nS,e],[0,p4,e],[0,820,e],[0,821,e],[0,qm,e],[0,p7,e],[0,824,e],[0,825,e],[0,oA,e],[0,nY,e],[0,828,e],[0,829,e],[0,830,e],[0,pI,e],[0,oc,e],[0,833,e],[0,834,e],[0,835,e],[0,q4,e],[0,oB,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,qL,e],[0,nA,e],[0,848,e],[0,849,e],[0,nz,e],[0,qw,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,x],[0,7425,cM],[0,7426,cM],[0,7427,aI],[0,7428,aK],[0,7429,aa],[0,7430,aa],[0,7431,n],[0,7432,n],[0,7433,O],[0,7434,bq],[0,7435,aQ],[0,7436,D],[0,7437,aW],[0,7438,ab],[0,7439,d],[0,7440,d],[0,7441,d],[0,7442,d],[0,7443,d],[0,7444,cR],[0,7445,jp],[0,7446,d],[0,7447,d],[0,7448,bo],[0,7449,r],[0,7450,r],[0,7451,ag],[0,7452,t],[0,7453,t],[0,7454,t],[0,7455,aW],[0,7456,aX],[0,7457,a4],[0,7458,$],[0,7459,$],[0,7460,"{spirant}"],[0,7461,d],[0,7468,x],[0,7469,cM],[0,7470,aI],[0,7471,aI],[0,7472,aa],[0,7473,n],[0,7474,n],[0,7475,V],[0,7476,U],[0,7477,O],[0,7478,bq],[0,7479,aQ],[0,7480,D],[0,7481,aW],[0,7482,ab],[0,7483,ab],[0,7484,d],[0,7485,jp],[0,7486,bo],[0,7487,r],[0,7488,ag],[0,7489,t],[0,7490,a4],[0,7491,x],[0,7492,x],[0,7493,x],[0,7494,cM],[0,7495,aI],[0,7496,aa],[0,7497,n],[0,7498,n],[0,7499,n],[0,7500,n],[0,7501,V],[0,7502,O],[0,7503,aQ],[0,7504,aW],[0,7505,fz],[0,7506,d],[0,7507,d],[0,7508,d],[0,7509,d],[0,7510,bo],[0,7511,ag],[0,7512,t],[0,7513,t],[0,7514,aW],[0,7515,aX],[0,7516,d],[0,7531,ri],[0,7532,aI],[0,7533,aa],[0,7534,b5],[0,7535,aW],[0,7536,ab],[0,7537,bo],[0,7538,r],[0,7539,r],[0,7540,R],[0,7541,ag],[0,7542,$],[0,7543,V],[0,7545,V],[0,7546,fy],[0,7547,O],[0,7548,O],[0,7549,bo],[0,7550,t],[0,7551,t],[0,7552,aI],[0,7553,aa],[0,7554,b5],[0,7555,V],[0,7556,aQ],[0,7557,D],[0,7558,aW],[0,7559,ab],[0,7560,bo],[0,7561,r],[0,7562,R],[0,7563,cQ],[0,7564,aX],[0,7565,bW],[0,7566,$],[0,7567,x],[0,7568,x],[0,7569,aa],[0,7570,n],[0,7571,n],[0,7572,n],[0,7573,n],[0,7574,O],[0,7575,d],[0,7576,cQ],[0,7577,t],[0,7578,$],[0,7579,x],[0,7580,aK],[0,7581,aK],[0,7582,aa],[0,7583,n],[0,7584,b5],[0,7585,bq],[0,7586,V],[0,7587,U],[0,7588,O],[0,7589,O],[0,7590,O],[0,7591,O],[0,7592,bq],[0,7593,D],[0,7594,D],[0,7595,D],[0,7596,aW],[0,7597,aW],[0,7598,ab],[0,7599,ab],[0,7600,ab],[0,7601,d],[0,7602,jr],[0,7603,R],[0,7604,cQ],[0,7605,ag],[0,7606,t],[0,7607,t],[0,7608,t],[0,7609,aX],[0,7610,aX],[0,7611,$],[0,7612,$],[0,7613,$],[0,7614,$],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,ae],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,z],[0,7636,fm],[0,7637,ov],[0,7638,jx],[0,7639,ay],[0,7640,ah],[0,7641,ah],[0,7642,ak],[0,7643,ak],[0,7644,aA],[0,7645,ad],[0,7646,ad],[0,7647,bb],[0,7648,ao],[0,7649,ao],[0,7650,ae],[0,7651,ae],[0,7652,_],[0,7653,_],[0,7654,ap],[0,7655,z],[0,7656,aT],[0,7657,aT],[0,7658,F],[0,7659,bi],[0,7660,ad],[0,7661,s],[0,7662,aU],[0,7663,oq],[0,7664,B],[0,7665,aV],[0,7666,z],[0,7667,s],[0,7668,B],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,z],[0,7681,x],[0,7682,aT],[0,7683,aI],[0,7684,aT],[0,7685,aI],[0,7686,aT],[0,7687,aI],[0,7688,ay],[0,7689,aK],[0,7690,ah],[0,7691,aa],[0,7692,ah],[0,7693,aa],[0,7694,ah],[0,7695,aa],[0,7696,ah],[0,7697,aa],[0,7698,ah],[0,7699,aa],[0,7700,F],[0,7701,n],[0,7702,F],[0,7703,n],[0,7704,F],[0,7705,n],[0,7706,F],[0,7707,n],[0,7708,F],[0,7709,n],[0,7710,bi],[0,7711,b5],[0,7712,ak],[0,7713,V],[0,7714,az],[0,7715,U],[0,7716,az],[0,7717,U],[0,7718,az],[0,7719,U],[0,7720,az],[0,7721,U],[0,7722,az],[0,7723,U],[0,7724,W],[0,7725,O],[0,7726,W],[0,7727,O],[0,7728,aA],[0,7729,aQ],[0,7730,aA],[0,7731,aQ],[0,7732,aA],[0,7733,aQ],[0,7734,ad],[0,7735,D],[0,7736,ad],[0,7737,D],[0,7738,ad],[0,7739,D],[0,7740,ad],[0,7741,D],[0,7742,bb],[0,7743,aW],[0,7744,bb],[0,7745,aW],[0,7746,bb],[0,7747,aW],[0,7748,ao],[0,7749,ab],[0,7750,ao],[0,7751,ab],[0,7752,ao],[0,7753,ab],[0,7754,ao],[0,7755,ab],[0,7756,s],[0,7757,d],[0,7758,s],[0,7759,d],[0,7760,s],[0,7761,d],[0,7762,s],[0,7763,d],[0,7764,aU],[0,7765,bo],[0,7766,aU],[0,7767,bo],[0,7768,ae],[0,7769,r],[0,7770,ae],[0,7771,r],[0,7772,ae],[0,7773,r],[0,7774,ae],[0,7775,r],[0,7776,_],[0,7777,R],[0,7778,_],[0,7779,R],[0,7780,_],[0,7781,R],[0,7782,_],[0,7783,R],[0,7784,_],[0,7785,R],[0,7786,aC],[0,7787,ag],[0,7788,aC],[0,7789,ag],[0,7790,aC],[0,7791,ag],[0,7792,aC],[0,7793,ag],[0,7794,B],[0,7795,t],[0,7796,B],[0,7797,t],[0,7798,B],[0,7799,t],[0,7800,B],[0,7801,t],[0,7802,B],[0,7803,t],[0,7804,bj],[0,7805,aX],[0,7806,bj],[0,7807,aX],[0,7808,aV],[0,7809,a4],[0,7810,aV],[0,7811,a4],[0,7812,aV],[0,7813,a4],[0,7814,aV],[0,7815,a4],[0,7816,aV],[0,7817,a4],[0,7818,b9],[0,7819,bW],[0,7820,b9],[0,7821,bW],[0,7822,aJ],[0,7823,ax],[0,7824,ap],[0,7825,$],[0,7826,ap],[0,7827,$],[0,7828,ap],[0,7829,$],[0,7830,U],[0,7831,ag],[0,7832,a4],[0,7833,ax],[0,7834,x],[0,7835,R],[0,7836,R],[0,7837,R],[0,7838,_],[0,7839,aa],[0,7840,z],[0,7841,x],[0,7842,z],[0,7843,x],[0,7844,z],[0,7845,x],[0,7846,z],[0,7847,x],[0,7848,z],[0,7849,x],[0,7850,z],[0,7851,x],[0,7852,z],[0,7853,x],[0,7854,z],[0,7855,x],[0,7856,z],[0,7857,x],[0,7858,z],[0,7859,x],[0,7860,z],[0,7861,x],[0,7862,z],[0,7863,x],[0,7864,F],[0,7865,n],[0,7866,F],[0,7867,n],[0,7868,F],[0,7869,n],[0,7870,F],[0,7871,n],[0,7872,F],[0,7873,n],[0,7874,F],[0,7875,n],[0,7876,F],[0,7877,n],[0,7878,F],[0,7879,n],[0,7880,W],[0,7881,O],[0,7882,W],[0,7883,O],[0,7884,s],[0,7885,d],[0,7886,s],[0,7887,d],[0,7888,s],[0,7889,d],[0,7890,s],[0,7891,d],[0,7892,s],[0,7893,d],[0,7894,s],[0,7895,d],[0,7896,s],[0,7897,d],[0,7898,s],[0,7899,d],[0,7900,s],[0,7901,d],[0,7902,s],[0,7903,d],[0,7904,s],[0,7905,d],[0,7906,s],[0,7907,d],[0,7908,B],[0,7909,t],[0,7910,B],[0,7911,t],[0,7912,B],[0,7913,t],[0,7914,B],[0,7915,t],[0,7916,B],[0,7917,t],[0,7918,B],[0,7919,t],[0,7920,B],[0,7921,t],[0,7922,aJ],[0,7923,ax],[0,7924,aJ],[0,7925,ax],[0,7926,aJ],[0,7927,ax],[0,7928,aJ],[0,7929,ax],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bj],[0,7933,aX],[0,7934,aJ],[0,7935,ax],[0,8305,O],[0,8319,ab],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aK],[0,9372,z],[0,9373,aT],[0,9374,ay],[0,9375,ah],[0,9376,F],[0,9377,bi],[0,9378,ak],[0,9379,az],[0,9380,W],[0,9381,b_],[0,9382,aA],[0,9383,ad],[0,9384,bb],[0,9385,ao],[0,9386,s],[0,9387,aU],[0,9388,b0],[0,9389,ae],[0,9390,_],[0,9391,aC],[0,9392,B],[0,9393,bj],[0,9394,aV],[0,9395,b9],[0,9396,aJ],[0,9397,ap],[0,9398,z],[0,9399,aT],[0,9400,ay],[0,9401,ah],[0,9402,F],[0,9403,bi],[0,9404,ak],[0,9405,az],[0,9406,W],[0,9407,b_],[0,9408,aA],[0,9409,ad],[0,9410,bb],[0,9411,ao],[0,9412,s],[0,9413,aU],[0,9414,b0],[0,9415,ae],[0,9416,_],[0,9417,aC],[0,9418,B],[0,9419,bj],[0,9420,aV],[0,9421,b9],[0,9422,aJ],[0,9423,ap],[0,9424,x],[0,9425,aI],[0,9426,aK],[0,9427,aa],[0,9428,n],[0,9429,b5],[0,9430,V],[0,9431,U],[0,9432,O],[0,9433,bq],[0,9434,aQ],[0,9435,D],[0,9436,aW],[0,9437,ab],[0,9438,d],[0,9439,bo],[0,9440,c9],[0,9441,r],[0,9442,R],[0,9443,ag],[0,9444,t],[0,9445,aX],[0,9446,a4],[0,9447,bW],[0,9448,ax],[0,9449,$],[0,11360,ad],[0,11361,D],[0,11362,ad],[0,11363,aU],[0,11364,ae],[0,11365,x],[0,11366,ag],[0,11367,az],[0,11368,U],[0,11369,aA],[0,11370,aQ],[0,11371,ap],[0,11372,$],[0,11373,z],[0,11374,bb],[0,11375,z],[0,11376,z],[0,11377,aX],[0,11378,aV],[0,11379,a4],[0,11380,aX],[0,11381,az],[0,11382,U],[0,11383,jr],[0,11384,n],[0,11385,r],[0,11386,d],[0,11387,n],[0,11389,aX],[0,11390,_],[0,11391,ap],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,s],[0,42789,d],[0,42790,az],[0,42791,U],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,ou],[0,42795,ou],[0,42796,hr],[0,42797,hr],[0,42798,hr],[0,42799,hr],[0,42800,b5],[0,42801,R],[0,42802,"AA"],[0,42803,pB],[0,42804,ov],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,jx],[0,42809,rQ],[0,42810,jx],[0,42811,rQ],[0,42812,"AY"],[0,42813,"ay"],[0,42814,ay],[0,42815,aK],[0,42816,aA],[0,42817,aQ],[0,42818,aA],[0,42819,aQ],[0,42820,aA],[0,42821,aQ],[0,42822,ad],[0,42823,D],[0,42824,ad],[0,42825,D],[0,42826,s],[0,42827,d],[0,42828,s],[0,42829,d],[0,42830,"OO"],[0,42831,"oo"],[0,42832,aU],[0,42833,bo],[0,42834,aU],[0,42835,bo],[0,42836,aU],[0,42837,bo],[0,42838,b0],[0,42839,c9],[0,42840,b0],[0,42841,c9],[0,42842,ae],[0,42843,r],[0,42844,ae],[0,42845,r],[0,42846,bj],[0,42847,aX],[0,42848,"VY"],[0,42849,"vy"],[0,42850,ap],[0,42851,$],[0,42852,jM],[0,42853,fy],[0,42854,jM],[0,42855,fy],[0,42856,bj],[0,42857,aX],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,r],[0,42870,r],[0,42871,"tum"],[0,42872,"um"],[0,42873,ah],[0,42874,aa],[0,42875,bi],[0,42876,b5],[0,42877,ak],[0,42878,ak],[0,42879,V],[0,42880,ad],[0,42881,D],[0,42882,ae],[0,42883,r],[0,42884,_],[0,42885,R],[0,42886,aC],[0,42887,ag],[0,42891,g9],[0,42892,g9],[0,42893,az],[0,42894,D],[0,42895,j8],[0,42896,ao],[0,42897,ab],[0,42898,ay],[0,42899,aK],[0,42900,aK],[0,42901,U],[0,42902,aT],[0,42903,aI],[0,42904,bi],[0,42905,b5],[0,42906,fm],[0,42907,cM],[0,42908,oV],[0,42909,cR],[0,42910,"UE"],[0,42911,ri],[0,42912,ak],[0,42913,V],[0,42914,aA],[0,42915,aQ],[0,42916,ao],[0,42917,ab],[0,42918,ae],[0,42919,r],[0,42920,_],[0,42921,R],[0,42922,az],[0,42923,F],[0,42924,ak],[0,42925,ad],[0,42926,W],[0,42927,c9],[0,42928,aA],[0,42929,aC],[0,42930,b_],[0,42931,b9],[0,42932,aT],[0,42933,aI],[0,42934,s],[0,42935,d],[0,42936,B],[0,42937,t],[0,42938,z],[0,42939,x],[0,42940,W],[0,42941,O],[0,42942,B],[0,42943,t],[0,42944,s],[0,42945,d],[0,42946,aV],[0,42947,a4],[0,42948,ay],[0,42949,_],[0,42950,ap],[0,42951,ah],[0,42952,aa],[0,42953,_],[0,42954,R],[0,42960,ak],[0,42961,V],[0,42963,fy],[0,42965,a4],[0,42966,_],[0,42967,R],[0,42968,_],[0,42969,R],[0,42994,ay],[0,42995,bi],[0,42996,b0],[0,42997,az],[0,42998,U],[0,42999,W],[0,43000,U],[0,43001,"{letter}"],[0,43002,aW],[0,43003,bi],[0,43004,aU],[0,43005,bb],[0,43006,W],[0,43007,bb],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,x],[0,43825,x],[0,43826,n],[0,43827,n],[0,43828,n],[0,43829,b5],[0,43830,V],[0,43831,D],[0,43832,D],[0,43833,D],[0,43834,aW],[0,43835,ab],[0,43836,fz],[0,43837,d],[0,43838,d],[0,43839,d],[0,43840,cR],[0,43841,cR],[0,43842,cR],[0,43843,d],[0,43844,d],[0,43845,r],[0,43846,r],[0,43847,r],[0,43848,r],[0,43849,r],[0,43850,r],[0,43851,r],[0,43852,r],[0,43853,cQ],[0,43854,t],[0,43855,t],[0,43856,n0],[0,43857,n0],[0,43858,t],[0,43859,bW],[0,43860,bW],[0,43861,bW],[0,43862,bW],[0,43863,bW],[0,43864,bW],[0,43865,bW],[0,43866,ax],[0,43868,U],[0,43869,D],[0,43870,D],[0,43871,t],[0,43872,"wa"],[0,43873,n],[0,43874,cR],[0,43875,"uo"],[0,43876,x],[0,43878,b7],[0,43879,bV],[0,43880,r],[0,43881,a4],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,R],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,z],[0,65314,aT],[0,65315,ay],[0,65316,ah],[0,65317,F],[0,65318,bi],[0,65319,ak],[0,65320,az],[0,65321,W],[0,65322,b_],[0,65323,aA],[0,65324,ad],[0,65325,bb],[0,65326,ao],[0,65327,s],[0,65328,aU],[0,65329,b0],[0,65330,ae],[0,65331,_],[0,65332,aC],[0,65333,B],[0,65334,bj],[0,65335,aV],[0,65336,b9],[0,65337,aJ],[0,65338,ap],[0,65345,x],[0,65346,aI],[0,65347,aK],[0,65348,aa],[0,65349,n],[0,65350,b5],[0,65351,V],[0,65352,U],[0,65353,O],[0,65354,bq],[0,65355,aQ],[0,65356,D],[0,65357,aW],[0,65358,ab],[0,65359,d],[0,65360,bo],[0,65361,c9],[0,65362,r],[0,65363,R],[0,65364,ag],[0,65365,t],[0,65366,aX],[0,65367,a4],[0,65368,bW],[0,65369,ax],[0,65370,$],[0,66045,e],[0,67456,pB],[0,67457,ns],[0,67458,ns],[0,67459,cM],[0,67460,aI],[0,67461,aI],[0,67463,b7],[0,67464,b7],[0,67465,b7],[0,67466,b7],[0,67467,aa],[0,67468,aa],[0,67469,aa],[0,67470,n],[0,67471,n],[0,67472,j7],[0,67473,qT],[0,67474,V],[0,67475,V],[0,67476,V],[0,67477,U],[0,67478,U],[0,67479,U],[0,67480,bq],[0,67481,qU],[0,67482,el],[0,67483,D],[0,67484,D],[0,67485,D],[0,67486,el],[0,67487,el],[0,67488,ax],[0,67489,ax],[0,67490,d],[0,67491,cR],[0,67492,d],[0,67493,c9],[0,67494,r],[0,67495,r],[0,67496,r],[0,67497,r],[0,67498,r],[0,67499,ol],[0,67500,bV],[0,67501,bV],[0,67502,ho],[0,67503,ag],[0,67504,aX],[0,67506,ax],[0,67507,bV],[0,67508,bV],[0,67509,cj],[0,67510,cj],[0,67511,cj],[0,67512,cj],[0,67513,cj],[0,67514,R],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,j7],[0,122625,V],[0,122626,V],[0,122627,aQ],[0,122628,D],[0,122629,el],[0,122630,ax],[0,122631,fz],[0,122632,r],[0,122633,ag],[0,122634,cj],[0,122635,cQ],[0,122636,cQ],[0,122637,ag],[0,122638,bV],[0,122639,aK],[0,122640,aQ],[0,122641,D],[0,122642,b7],[0,122643,D],[0,122644,fz],[0,122645,r],[0,122646,r],[0,122647,ho],[0,122648,$],[0,122649,b7],[0,122650,O],[0,122651,d],[0,122652,ho],[0,122653,aK],[0,122654,R],[0,122661,aa],[0,122662,D],[0,122663,ab],[0,122664,r],[0,122665,R],[0,122666,ag],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,z],[0,127249,aT],[0,127250,ay],[0,127251,ah],[0,127252,F],[0,127253,bi],[0,127254,ak],[0,127255,az],[0,127256,W],[0,127257,b_],[0,127258,aA],[0,127259,ad],[0,127260,bb],[0,127261,ao],[0,127262,s],[0,127263,aU],[0,127264,b0],[0,127265,ae],[0,127266,_],[0,127267,aC],[0,127268,B],[0,127269,bj],[0,127270,aV],[0,127271,b9],[0,127272,aJ],[0,127273,ap],[0,127274,_],[0,127275,ay],[0,127276,ae],[0,127280,z],[0,127281,aT],[0,127282,ay],[0,127283,ah],[0,127284,F],[0,127285,bi],[0,127286,ak],[0,127287,az],[0,127288,W],[0,127289,b_],[0,127290,aA],[0,127291,ad],[0,127292,bb],[0,127293,ao],[0,127294,s],[0,127295,aU],[0,127296,b0],[0,127297,ae],[0,127298,_],[0,127299,aC],[0,127300,B],[0,127301,bj],[0,127302,aV],[0,127303,b9],[0,127304,aJ],[0,127305,ap],[0,127312,z],[0,127313,aT],[0,127314,ay],[0,127315,ah],[0,127316,F],[0,127317,bi],[0,127318,ak],[0,127319,az],[0,127320,W],[0,127321,b_],[0,127322,aA],[0,127323,ad],[0,127324,bb],[0,127325,ao],[0,127326,s],[0,127327,aU],[0,127328,b0],[0,127329,ae],[0,127330,_],[0,127331,aC],[0,127332,B],[0,127333,bj],[0,127334,aV],[0,127335,b9],[0,127336,aJ],[0,127337,ap],[0,127344,z],[0,127345,aT],[0,127346,ay],[0,127347,ah],[0,127348,F],[0,127349,bi],[0,127350,ak],[0,127351,az],[0,127352,W],[0,127353,b_],[0,127354,aA],[0,127355,ad],[0,127356,bb],[0,127357,ao],[0,127358,s],[0,127359,aU],[0,127360,b0],[0,127361,ae],[0,127362,_],[0,127363,aC],[0,127364,B],[0,127365,bj],[0,127366,aV],[0,127367,b9],[0,127368,aJ],[0,127369,ap],[0,127370,aU],[0,127397,ah],[0,917569,z],[0,917570,aT],[0,917571,ay],[0,917572,ah],[0,917573,F],[0,917574,bi],[0,917575,ak],[0,917576,az],[0,917577,W],[0,917578,b_],[0,917579,aA],[0,917580,ad],[0,917581,bb],[0,917582,ao],[0,917583,s],[0,917584,aU],[0,917585,b0],[0,917586,ae],[0,917587,_],[0,917588,aC],[0,917589,B],[0,917590,bj],[0,917591,aV],[0,917592,b9],[0,917593,aJ],[0,917594,ap],[0,917601,z],[0,917602,aT],[0,917603,ay],[0,917604,ah],[0,917605,F],[0,917606,bi],[0,917607,ak],[0,917608,az],[0,917609,W],[0,917610,b_],[0,917611,aA],[0,917612,ad],[0,917613,bb],[0,917614,ao],[0,917615,s],[0,917616,aU],[0,917617,b0],[0,917618,ae],[0,917619,_],[0,917620,aC],[0,917621,B],[0,917622,bj],[0,917623,aV],[0,917624,b9],[0,917625,aJ],[0,917626,ap]]),DT=bZ,DS=hF([[0,170,x],[0,186,d],[0,oJ,"ss"],[0,8208,cl],[0,8211,cl],[0,8212,cl],[0,8216,g9],[0,8217,g9],[0,8220,dc],[0,8221,dc],[0,8230,"..."],[0,8722,cl]]),D0="?",D5=[0,e],D3=[1,[0,3854881,"Failed to unmarshal data"]],D1=[0,1],D6=[0,"lib/codec.ml",32,4],D9="Yojson__Common.Json_error",D$="Yojson__Common.End_of_array",Ea="Yojson__Common.End_of_object",Eb="Yojson__Common.End_of_tuple",Ec="Yojson__Common.End_of_input",Ee=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Fw=[0,bc,1],Fx=[0,bc,0],Fy=bX,Fz="Invalid token",FA=bX,FB="Invalid escape sequence",FC=bX,FD="Invalid low surrogate for code point beyond U+FFFF",FE="Missing escape sequence representing low surrogate for code point beyond U+FFFF",FF=bX,FG="Expected ':' or '>' but found",FH=bX,FI="Expected '>' but found",FJ=bX,FK="Unterminated comment",FL="Expected string or identifier but found",FM=bX,FN="Expected ',' or ']' but found",FO=bX,FP="Expected ',' or ')' but found",FQ=bX,FR="Expected ',' or '}' but found",FS=bX,FT="Expected ':' but found",FU=bX,Ge="Expected string, got ",Gd="Expected object, got ",F3=fv,F5=hu,F6="floatlit",F7=hi,F8="tuple",F4="bool",F_="variant",F$="float",Ga="int",Gb=jy,F9="intlit",FZ="Blank input data",FW="Junk after end of JSON value:",E4=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],EZ=[0,[11,"File ",[2,0,[11,no,0]]],"File %s, line"],E3="Line",E0=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],E2=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],E1=[0,[2,0,[12,32,[4,3,0,0,[11,jZ,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],EY=[0,"lib/read.mll",41,13],EX=e,EV=e,EH="NaN value not allowed in standard JSON",EI=[0,[8,[0,0,3],0,[0,16],0],rS],EK=[0,[8,[0,0,3],0,[0,17],0],qQ],EJ=rD,EF="Infinity value not allowed in standard JSON",EG="-Infinity value not allowed in standard JSON",EA="NaN",EB=[0,[8,[0,0,3],0,[0,16],0],rS],ED=[0,[8,[0,0,3],0,[0,17],0],qQ],EC=rD,Ey="Infinity",Ez="-Infinity",Eu=fr,Ev=fD,Et=fv,En=g$,Eo=hj,Ep=g3,Eq="\\f",Er=gX,Es=j3,Em=g8,Ek=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,i$,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],Ei="\\u00",E5="Yojson__Safe.Int_overflow",F0="Yojson__Safe.Util.Type_error",Gk="list_of_yojson: list needed",Gj="int_of_yojson: integer needed",Gi="string_of_yojson: string needed",Gh="bool_of_yojson: true/false needed",Gf="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",Gy=bZ,GA="_of_yojson: list instead of atom for record expected",Gz=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Gw="extra fields",Gv="duplicate fields",Gt=bZ,Gu=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,of,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Gs="_of_yojson: unexpected variant constructor",Gr="_of_yojson: expected a variant type, saw an empty list",Gq="_of_yojson: expected a variant type, saw a nested list",Gp="_of_yojson: this constructor requires arguments",Gn=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Gl="_of_yojson: this constructor does not take arguments",JS="An error occured while decoding response: ",JN=[0,[11,", Token=",[3,0,0]],", Token=%S"],JQ=e,JO=e,JP=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],JI=jj,JJ=rU,JK=ei,JE="item_id",JF="locations",JG=bY,JB=[0,"Views",0],JC="Users",Jw=hd,Jx=g2,Jy=fl,Js=n6,Jt=nF,Ju=jk,Jq=o_,Jo="include_external_content",Jm=[0,fl,0],Jj=hd,Jk=g2,Jl=fl,Jg=n6,Jh=nF,Ji=jk,I6=nU,I7=qo,I8=jG,I9=rt,I_=q_,I$=rn,Ja=oE,Jb=ry,Jc=jq,Jd=pH,Je=rJ,Jf=qA,IZ="enable_images",I0="enable_user_data",I1=jG,I2="sort_by",I3="include_item_types",I4=jq,I5="user_id",IY=pF,IO=pM,IP=pr,IQ=on,IR=pP,IS=gZ,IT=o4,IU=hh,IV=hk,IW=ek,IX=ei,IJ="type_",IK="image_blur_hashes",IL=hm,IM=bp,IN=bY,II=[0,"lib/data_source/jellyfin_api.ml",rh,64],HJ=[0,h,[0,[0,f,oe],0]],HK=[0,h,[0,[0,f,rN],0]],HL=[0,h,[0,[0,f,od],0]],HM=[0,h,[0,[0,f,oR],0]],HN=[0,h,[0,[0,f,p8],0]],HO=[0,h,[0,[0,f,qN],0]],HP=[0,h,[0,[0,f,nK],0]],HQ=[0,h,[0,[0,f,qx],0]],HR=[0,h,[0,[0,f,pa],0]],HS=[0,h,[0,[0,f,qs],0]],HT=[0,h,[0,[0,f,hp],0]],HU=[0,h,[0,[0,f,pz],0]],HV=[0,h,[0,[0,f,o2],0]],HW=[0,h,[0,[0,f,nE],0]],HX=[0,h,[0,[0,f,q6],0]],HY=[0,h,[0,[0,f,oH],0]],HZ=[0,h,[0,[0,f,pR],0]],H0=[0,h,[0,[0,f,pn],0]],H1=[0,h,[0,[0,f,pQ],0]],H2=[0,h,[0,[0,f,oz],0]],H3=[0,h,[0,[0,f,oO],0]],H4=[0,h,[0,[0,f,re],0]],H5=[0,h,[0,[0,f,pt],0]],H6=[0,h,[0,[0,f,rz],0]],H7=[0,h,[0,[0,f,o9],0]],H8=[0,h,[0,[0,f,q5],0]],H9=[0,h,[0,[0,f,nt],0]],H_=[0,h,[0,[0,f,qa],0]],H$=[0,h,[0,[0,f,qV],0]],Ia=[0,h,[0,[0,f,px],0]],Ib=[0,h,[0,[0,f,nq],0]],Ic=[0,h,[0,[0,f,oT],0]],Id=[0,h,[0,[0,f,pc],0]],Ie=[0,h,[0,[0,f,gZ],0]],If=[0,h,[0,[0,f,hh],0]],Ig=[0,h,[0,[0,f,n$],0]],Ih=[0,h,[0,[0,f,qk],0]],Ii=[0,h,[0,[0,f,ps],0]],Ij=[0,h,[0,[0,f,qM],0]],Ik=[0,h,[0,[0,f,rg],0]],Il=[0,h,[0,[0,f,oh],0]],Im=[0,h,[0,[0,f,rT],0]],In=[0,h,[0,[0,f,pe],0]],Io=[0,h,[0,[0,f,p_],0]],Ip=[0,h,[0,[0,f,pf],0]],Iq=[0,h,[0,[0,f,r2],0]],Ir=[0,h,[0,[0,f,qZ],0]],Is=[0,h,[0,[0,f,or],0]],It=[0,h,[0,[0,f,p2],0]],Iu=[0,h,[0,[0,f,pG],0]],Iv=[0,h,[0,[0,f,qq],0]],Iw=[0,h,[0,[0,f,ek],0]],Ix=[0,h,[0,[0,f,rR],0]],Iy=[0,h,[0,[0,f,qn],0]],Iz=[0,h,[0,[0,f,pu],0]],IA=[0,h,[0,[0,f,ph],0]],IB=[0,h,[0,[0,f,qr],0]],IC=[0,h,[0,[0,f,p$],0]],ID=[0,h,[0,[0,f,rC],0]],IE=[0,h,[0,[0,f,r1],0]],IF=[0,h,[0,[0,f,rk],0]],G8=[0,h,[0,[0,f,rK],0]],G9=[0,h,[0,[0,f,rd],0]],G_=[0,h,[0,[0,f,o7],0]],G$=[0,h,[0,[0,f,oF],0]],Ha=[0,h,[0,[0,f,nX],0]],Hb=[0,h,[0,[0,f,n8],0]],Hc=[0,h,[0,[0,f,oU],0]],Hd=[0,h,[0,[0,f,oi],0]],He=[0,h,[0,[0,f,p0],0]],Hf=[0,h,[0,[0,f,rl],0]],Hg=[0,h,[0,[0,f,ro],0]],Hh=[0,h,[0,[0,f,pp],0]],Hi=[0,h,[0,[0,f,rL],0]],Hj=[0,h,[0,[0,f,nL],0]],Hk=[0,h,[0,[0,f,nP],0]],Hl=[0,h,[0,[0,f,rG],0]],Hm=[0,h,[0,[0,f,qy],0]],Hn=[0,h,[0,[0,f,oj],0]],Ho=[0,h,[0,[0,f,pT],0]],Hp=[0,h,[0,[0,f,oQ],0]],Hq=[0,h,[0,[0,f,ny],0]],Hr=[0,h,[0,[0,f,ra],0]],Hs=[0,h,[0,[0,f,q9],0]],Ht=[0,h,[0,[0,f,nH],0]],Hu=[0,h,[0,[0,f,qF],0]],Hv=[0,h,[0,[0,f,pA],0]],Hw=[0,h,[0,[0,f,rB],0]],Hx=[0,h,[0,[0,f,n3],0]],Hy=[0,h,[0,[0,f,nN],0]],Hz=[0,h,[0,[0,f,oI],0]],HA=[0,h,[0,[0,f,pL],0]],HB=[0,h,[0,[0,f,os],0]],HC=[0,h,[0,[0,f,pb],0]],HD=[0,h,[0,[0,f,nQ],0]],HE=[0,h,[0,[0,f,nV],0]],HF=[0,h,[0,[0,f,qS],0]],HG=[0,h,[0,[0,f,og],0]],G7=rI,G3=hk,G4=ei,G0=bp,G1=bY,GI=[0,h,[0,[0,f,qf],0]],GJ=[0,h,[0,[0,f,n2],0]],GK=[0,h,[0,[0,f,qK],0]],GL=[0,h,[0,[0,f,pC],0]],GM=[0,h,[0,[0,f,pj],0]],GN=[0,h,[0,[0,f,nZ],0]],GO=[0,h,[0,[0,f,hp],0]],GP=[0,h,[0,[0,f,oD],0]],GQ=[0,h,[0,[0,f,qY],0]],GR=[0,h,[0,[0,f,q8],0]],GS=[0,h,[0,[0,f,qI],0]],GT=[0,h,[0,[0,f,ek],0]],GU=[0,h,[0,[0,f,rr],0]],GV=[0,h,[0,[0,f,pS],0]],GW=[0,h,[0,[0,f,pD],0]],GE=[0,h,[0,[0,f,qR],0]],GF=[0,h,[0,[0,f,qd],0]],JY="all",JZ="oneof",J0=ok,J1="noneof",J2=ok,Kt=hm,Ku=dE,Kv=cP,Kw=j0,Kx=bp,Kn=hm,Ko=dE,Kp=cP,Kq=j0,Kr=bp,Kj=dE,Kk=cP,Kl=bp,Kf=dE,Kg=cP,Kh=bp,Kc=g7,Kd=bY,J$=g7,Ka=bY,J8=bY,J9=bp,J5=bY,J6=bp,J3=[0,f,jn],Lg=[0,dG,rx,15],Lb=[0,dG,pZ,15],KU=[0,dG,141,11],KQ=[0,dG,96,13],KP=[0,dG,87,19],KO=[0,dG,81,13],KN=[0,dG,75,19],KL=g5,KM=jC,KI=g5,KJ=jC,KE=cP,KF=j5,KG=ji,KA=cP,KB=j5,KC=ji,Ky=nr,KR=jk,KS="virtual_folders",K6="collections",K9=dE,La="albums",Lf=pg,LS=[0,1,0],LH=[0,6,0],LI=[0,0],LJ=[0,33,[0,34,[0,21,0]]],LL=[0,1],LM=jK,LN=qJ,LO=e,LK="Successfully decoded query",LP=[0,"Before query",0],LQ=[0,"lib/db/sync.ml",n_,6],LE=[0,j8,0],LF=q1,LG="Fetching items",LD=[0,1],LA=[0,34,0],Lz=[0,33,0],Lu=[0,1],Lv=e,Lw="music",Lx=[0,0],Lo=[0,0],Lp=[0,2],Lk=[0,6,0],Ll=[0,0],Lm=[0,0],Lr=[0,0,0],LX=q1,LY="Upgrading indexed_db schema from version",LZ=[0,"Erasing existing stores",0],L0=[0,bp],L1=[0,0],L2=[0,"sorts.date_added"],L3=nr,L4=o8,L5="item.Name",L6=rM,L7=[0,0],L8=[0,rM],L9="items_by_id",L_=o8,L$="item.Type",Ma="items_by_view_and_kind",Mb="sorts.sort_name",Mc="item.CollectionType",Md="items_by_type_and_name",Me=[0,jj],Mf=[0,0],Mg=[0,1],Mh=[0,1],Mi=[0,bp],Mj=jK,Mk=[0,1],Ml=[0,1],Mm=[0,g7],Mn=qJ,Mo=[0,bp],Mp=jK,Mq="Stores created:",MG="An error occured while loading item",MF="Unknown genre",Mz=[0,[2,0,0],pw],Mx=[0,jl,0],My="Get all keys ",ME="not implemented",MA=[0,jl,0],MB="Filter took ",MC=[0,jl,0],MD="Sort took ",Mv=pg,Mw=[0,2];function -ar(a){if(typeof +Pa(){var +c=Q.process;if(c&&c.on)c.on("uncaughtException",function(a,b){sA(a);c.exit(2)});else if(Q.addEventListener)Q.addEventListener(hv,function(a){if(a.error)sA(a.error)})}Pa();function +g(a,b){return(a.l>=0?a.l:a.l=a.length)===1?a(b):cY(a,[b])}function +j(a,b,c){return(a.l>=0?a.l:a.l=a.length)===2?a(b,c):cY(a,[b,c])}function +ct(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)===3?a(b,c,d):cY(a,[b,c,d])}function +fj(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)===4?a(b,c,d,e):cY(a,[b,c,d,e])}function +dE(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)===5?a(b,c,d,e,f):cY(a,[b,c,d,e,f])}function +N4(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)===7?a(b,c,d,e,f,g,h):cY(a,[b,c,d,e,f,g,h])}var +Pk=0;Os();var +hY=[J,sj,-1],kL=[J,qi,-2],eE=[J,kk,-3],fU=[J,p8,-4],bZ=[J,rg,-7],kJ=[J,sh,-8],kK=[J,qx,-9],u=[J,qD,-11],kM=[J,qP,-12],ie=[0,e,0,0,-1],k4=[0,e,1,0,0],NS=[4,0,0,0,[12,45,[4,0,0,0,0]]],ir=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,pT,[4,0,0,0,[12,45,[4,0,0,0,[11,jz,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],NT=[17,[0,a,1,0],[11,oj,[17,0,0]]],NU=[17,[0,a,1,0],[12,40,0]],NV=[11,"('\"'",[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,nQ,[17,0,0]]]]]],NW=[0,a,1,0],NX=[11,pf,[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,nQ,[17,0,0]]]]]],NY=[0,a,1,0],NZ=[11,df,[17,[0,a,1,0],[11,sf,[17,0,0]]]],N0=[0,a,1,0],N1=[11,pf,[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,sf,[17,0,0]]]]]],N2=[0,a,1,0],N3=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],mH=[0,ai,[0,ch,-991563951]],mI=[0,ai,[0,ch,pO]],mV=hO([9,10,11,12,13,32,ka,nU,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,pB,8233,8239,8287,12288]),bc=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],fd="lib/data_source/jellyfin_api.ml.Types.order",aB="lib/data_source/jellyfin_api.ml.Types.sort",gJ="lib/data_source/jellyfin_api.ml.Item.genre_item",jc="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",F="lib/data_source/jellyfin_api.ml.Item.type_",l="lib/data_source/jellyfin_api.ml.Item.field",gK="lib/data_source/jellyfin_api.ml.Item.external_url",gL="lib/data_source/jellyfin_api.ml.Item.t",gM="lib/data_source/jellyfin_api.ml.Items.params",gN="lib/data_source/jellyfin_api.ml.Items.response",gO="lib/data_source/jellyfin_api.ml.Views.params",gP="lib/data_source/jellyfin_api.ml.Views.response",gQ="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",fe="lib/db/generic_schema.ml.Id.t",gR="lib/db/generic_schema.ml.Collection.t",gS="lib/db/generic_schema.ml.Artist.t",gT="lib/db/generic_schema.ml.Genre.t",gU="lib/db/generic_schema.ml.Album.t",gV="lib/db/generic_schema.ml.Track.t",gZ="lib/db/stores.ml.Items.sorts",g0="lib/db/stores.ml.Items.t";cb(11,kM,qP);cb(10,u,qD);cb(9,[J,qE,oe],qE);cb(8,kK,qx);cb(7,kJ,sh);cb(6,bZ,rg);cb(5,[J,pe,-6],pe);cb(4,[J,qo,-5],qo);cb(3,fU,p8);cb(2,eE,kk);cb(1,kL,qi);cb(0,hY,sj);var +tm=n$,tk="output_substring",th=dg,te=fv,tf=fI,s6="Stdlib.Exit",s9=br(0,0,32752),s$=br(0,0,65520),tb=br(1,0,32760),tu=he,tv="\\'",tw=hh,tx=hr,ty=hb,tz=g6,ts="Char.chr",tD=" is not an Unicode scalar value",tP="List.init",tL="hd",uk=[0,oZ,oM,20],uj=[0,oZ,qp,9],t6="String.blit / Bytes.blit_string",t5="Bytes.blit",t4="String.sub / Bytes.sub",uw="String.contains_from / Bytes.contains_from",uu="String.index_from / Bytes.index_from",up=e,um="String.concat",uK=[0,"array.ml",rV,4],uG="Array.map2: arrays must have the same length",uD="Array.blit",uB="Array.init",uI="Stdlib.Array.Bottom",uU=[0,"set.ml",ph,18],uQ=g9,uR=g9,uS=g9,uT=g9,u0="Map.remove_min_elt",uW=ht,uX=ht,uY=ht,uZ=ht,u2="Stdlib.Queue.Empty",u_="Buffer.add_substring/add_subbytes",u9="Buffer.add: cannot grow buffer",u7="Buffer.sub",vg="first domain already spawned",vd=[0,"domain.ml",184,13],vr=qm,vs=pQ,vt=rj,vu=p4,vv=sn,vw=rf,vx="%f",vy="%B",vz="%{",vA="%}",vB="%(",vC="%)",vD=sm,vE="%t",vF="%?",vG="%r",vH="%_r",vI=[0,aS,nS,23],vT=[0,aS,rG,21],vL=[0,aS,oG,21],vU=[0,aS,oa,21],vM=[0,aS,qn,21],vV=[0,aS,qH,19],vN=[0,aS,qq,19],vW=[0,aS,oS,22],vO=[0,aS,og,22],vX=[0,aS,p3,30],vP=[0,aS,ov,30],vR=[0,aS,rm,26],vJ=[0,aS,oU,26],vS=[0,aS,q6,28],vK=[0,aS,nT,28],vQ=[0,aS,qR,23],w9=[0,aS,1558,4],w_="Printf: bad conversion %[",w$=[0,aS,1626,39],xa=[0,aS,1649,31],xb=[0,aS,1650,31],xc="Printf: bad conversion %_",xd=qe,xe=or,xf=qe,xg=or,xj=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],xi=[0,0,4],w4=jo,w2="neg_infinity",w3=qk,w1=dg,wW=[0,g4],wK="%+nd",wL="% nd",wN="%+ni",wO="% ni",wP="%nx",wQ="%#nx",wR="%nX",wS="%#nX",wT="%no",wU="%#no",wJ="%nd",wM=sn,wV="%nu",ww="%+ld",wx="% ld",wz="%+li",wA="% li",wB="%lx",wC="%#lx",wD="%lX",wE="%#lX",wF="%lo",wG="%#lo",wv="%ld",wy=p4,wH="%lu",wi="%+Ld",wj="% Ld",wl="%+Li",wm="% Li",wn="%Lx",wo="%#Lx",wp="%LX",wq="%#LX",wr="%Lo",ws="%#Lo",wh="%Ld",wk=rf,wt="%Lu",v6="%+d",v7="% d",v9="%+i",v_="% i",v$="%x",wa="%#x",wb=rZ,wc="%#X",wd="%o",we="%#o",v5=jn,v8=rj,wf=n8,vj="@]",vk="@}",vl="@?",vm="@\n",vn="@.",vo="@@",vp="@%",vq="@",vY="CamlinternalFormat.Type_mismatch",xo=e,xp=[0,[11,kb,[2,0,[2,0,0]]],", %s%s"],x1=[0,[11,j5,[2,0,[12,10,0]]],ob],x2=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],x0="Fatal error: out of memory in uncaught exception handler",xX=[0,[11,j5,[2,0,[12,10,0]]],ob],xR=[0,[2,0,[12,10,0]],"%s\n"],xS=[0,[11,nZ,0],nZ],xG="Raised at",xH="Re-raised at",xI="Raised by primitive operation at",xJ="Called from",xK=[0,[12,32,[4,0,0,0,0]]," %d"],xO=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],xL=" (inlined)",xN=e,xM=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,nH,[2,0,[11,pT,NS]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],xP=[0,[2,0,[11," unknown location",0]],"%s unknown location"],xz="Out of memory",xA="Stack overflow",xB="Pattern matching failed",xC="Assertion failed",xD="Undefined recursive module",xr=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],xs=e,xt=e,xu=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],xn=[0,[4,0,0,0,0],jn],xl=[0,[3,0,0],"%S"],xm=jP,xU=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],x6="Fun.Finally_raised: ",x4="Stdlib.Fun.Finally_raised",x7="Digest.BLAKE2: wrong hash size",yi=br(14371852,15349651,22696),yj=br(12230193,11438743,35013),yk=br(1424933,15549263,2083),yl=br(9492471,4696708,43520),x$=br(1,0,0),ya=br(0,0,0),yd=br(1,0,0),yb=br(0,0,0),yc=br(2,0,0),yy="Hashtbl: unsupported hash table format",yq=e,za=[3,0,3],zb=dg,y7=qG,y8="<\/",y9=e,y3=qG,y4="<",y5=e,y1="\n",yX=e,yY=e,yZ=e,y0=e,yP=[0,e],yK=e,yL=e,yM=e,yN=e,yG=[0,e,0,e],yC="Stdlib.Format.String_tag",zj="Jsoo_runtime.Error.Exn",zk=js,zC=[0,"src/fut.ml",34,25],zW="info",zV="warn",zU=hv,zT="log",zS="search",zM=[0,1],zK=sg,zX="isSecureContext",z3="cache",z4="credentials",z5="headers",z6="integrity",z7="keepalive",z8="method",z9="mode",z_="redirect",z$="referrer",Aa="referrerPolicy",AK="open",AG="unique",AA="autoIncrement",AB="keyPath",AC="new object store with options:",Aw="readonly",Ax="readwrite",Ay="readwriteflush",Aq="next",Ar="nextUnique",As="prev",At="prevUnique",Ao="Request failed: ",AR=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],A0="CCResult.Get_error",Bg="CCString.iter2",Ba=[0,si,119,10],A9=[0,si,92,10],A5=e,Be="CCString.MyExit",Bv=[0,[17,[0,pJ,1,0],0],pJ],Bu=[0,[12,32,0],bW],Bt=[0,[11,oV,0],oV],Bw=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],Bo=[0,[11,q_,[15,[11,qK,[15,[11," dst-off=",[4,0,0,0,[11,jl,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],Bm=[0,[11,q_,[15,[11,qK,[15,[11," src-off=",[4,0,0,0,[11,jl,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],Bk=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],Bj=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],Bx=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],By=e,B6=[0,[8,[0,0,0],0,[0,0],0],nI],BP=[0,[12,44,0],jX],BW=[0,[15,[12,58,[15,0]]],"%a:%a"],BV=[0,[12,44,0],jX],BO=[0,[11,fz,0],fz],BR=[0,[11,fv,0],fv],BS=[0,[11,fI,0],fI],BT=[0,[8,[0,0,0],0,[0,0],0],nI],BU=[0,[8,[0,0,3],0,0,0],"%g"],BX=[0,[12,dJ,[15,[12,dK,0]]],"{%a}"],BQ=[0,[12,91,[15,[12,93,0]]],"[%a]"],BY=[0,[12,44,[17,[0,a,1,0],0]],n3],B2=[0,[18,[1,[0,[11,eg,0],eg]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],B1=[0,[12,44,[17,[0,a,1,0],0]],n3],B3=[0,[18,[1,[0,[11,eg,0],eg]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],B4=[0,[11,rw,0],rw],BZ=[0,[18,[1,[0,[11,eg,0],eg]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],B0=[0,[11,r_,0],r_],BD=[0,[12,34,0],di],BH=[0,[0,0],qm],BG=[0,[11,he,0],he],BJ=[0,[11,hh,0],hh],BK=[0,[11,hr,0],hr],BL=[0,[11,hb,0],hb],BM=[0,[11,g6,0],g6],BF=[0,[11,kf,0],kf],BI=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],BE=[0,[12,34,0],di],Cs=[0,fA,oQ,9],Cl=[0,es,j3],Cg=[0,fB,j3],Cm=[0,de,j3],Ck=[0,de,fs],Ch=[0,fB,fs],Ci=[0,fA,153,55],Cj=[0,de,fs],Cn=[0,fA,152,55],Co=[0,fA,154,55],Cp=[0,de,cx],Ce=[0,fA,j6,9],B8=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],Cd=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],DH=[0,bS,[0,bf,1]],DI=[0,bS,cQ],DJ=[0,bS,[0,bf,0]],DL=[0,bS,fu],DK=[0,bS,dH],DW=[0,j0,p9,27],DQ=[0,bS,o3],DN=[0,bS,r2],DF=[0,j0,rL,8],DE=[0,j0,qO,45],Da=[0,[18,[1,[0,0,e]],[11,ek,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,jO,[17,[0,a,1,0],[11,g5,NT]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],Db=[0,[18,[1,[0,0,e]],[11,ek,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],Dd=[0,[15,[17,[0,a,1,0],[11,jx,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,g5,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],De=[0,[15,[17,[0,a,1,0],[11,om,[17,[0,a,1,0],[11,q9,[17,[0,a,1,0],[11,jS,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],Df=[0,[15,[17,[0,a,1,0],[11,om,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,jS,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],Dg=[0,[15,[17,[0,a,1,0],[11,jx,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],Dc=[0,[15,[17,[0,a,1,0],[11,jx,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,q9,[17,[0,a,1,0],[11,jS,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],Dh=[0,[18,[1,[0,0,e]],[11,ek,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,jO,[17,[0,a,1,0],[11,g5,[17,[0,a,1,0],[11,oj,NU]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],Di=[0,[4,8,[0,2,2],0,0],"%02X"],Dk=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],Dj=[0,[12,41,[17,0,0]],")@]"],Dl=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],Dm=[0,[11,qY,[17,[0,a,1,0],[11,bg,[17,0,0]]]],"member@ name@]"],Dn=[0,[11,hy,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],Do=[0,[11,bg,[17,[0,a,1,0],[11,jE,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],Dp=[0,[11,fr,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,n$,[17,0,0]]]]]],"end@ of@ input@]"],Dq=[0,[11,"JavaScript",[17,[0,a,1,0],[11,pm,[17,0,0]]]],"JavaScript@ comment@]"],Dr=[0,[11,hy,[17,[0,a,1,0],[11,fl,[17,0,0]]]],"JSON@ value@]"],Ds=[0,[11,qY,[17,[0,a,1,0],[11,bg,[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,hC,[17,[0,a,1,0],[11,fr,[17,NW,NV]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],Dt=[0,[11,fl,[17,[0,a,1,0],[11,jE,[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,hC,[17,[0,a,1,0],[11,fr,[17,NY,NX]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],Du=[0,[11,fl,[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,hq,[17,[0,a,1,0],[11,fr,[17,[0,a,1,0],[11,"(value",[17,N0,NZ]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],Dv=[0,[11,fl,[17,[0,a,1,0],[11,jE,[17,[0,a,1,0],[11,df,[17,[0,a,1,0],[11,hq,[17,[0,a,1,0],[11,fr,[17,N2,N1]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],Dw=[0,[18,[1,[0,0,e]],[11,ek,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],DC=[0,[18,[1,[0,0,e]],[11,ek,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],DD=[0,[18,[1,[0,0,e]],[11,ek,[17,[0,a,1,0],[11,g5,[17,[0,a,1,0],[11,jO,[17,[0,a,1,0],[11,hy,[17,[0,a,1,0],[11,jL,N3]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],Dx=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],Dy=[0,[11,hC,[17,0,0]],"object@]"],Dz=[0,[11,hq,[17,0,0]],"array@]"],DA=[0,[11,pm,[17,0,0]],"comment@]"],DB=[0,[11,jL,[17,0,0]],"string@]"],C_=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],C9=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],CO=[0,ai,-543455433],CV=[0,ai,[0,fk,ej]],CW=[0,ai,[0,fk,f]],CX=[0,ai,[0,fk,fu]],CY=[0,ai,[0,fk,dH]],C1=[0,ai,[0,ch,ej]],C2=[0,ai,[0,ch,hg]],C3=[0,ai,[0,ch,rQ]],C4=[0,ai,[0,ch,[0,rP,1]]],C5=[0,ai,[0,ch,[0,rP,0]]],C6=[0,ai,[0,ch,[0,jr,1]]],C7=[0,ai,[0,ch,[0,jr,0]]],C8=[0,ai,[0,ch,ou]],Ee="not a valid JSON array/object",Eb=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],D8=[0,[11,bV,0],bV],D9=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],D_=[0,[15,0],sm],D7="We expected a well-formed JSON document (array or object)",D2=fl,D3="object fields",D0=[0,"lib/ezjsonm.ml",61,19],D1=[0,hd,357123046],DZ="Abort",D4="Ezjsonm.Parse_error",Eg=hO([[0,hB,z],[0,193,z],[0,pZ,z],[0,195,z],[0,196,z],[0,197,z],[0,198,fo],[0,199,ay],[0,200,G],[0,201,G],[0,202,G],[0,pP,G],[0,qO,X],[0,205,X],[0,206,X],[0,207,X],[0,208,ak],[0,209,aq],[0,210,s],[0,rL,s],[0,212,s],[0,213,s],[0,214,s],[0,216,s],[0,217,B],[0,218,B],[0,219,B],[0,220,B],[0,221,aN],[0,222,jZ],[0,o2,P],[0,er,x],[0,rk,x],[0,226,x],[0,227,x],[0,228,x],[0,229,x],[0,230,cR],[0,231,aO],[0,232,n],[0,233,n],[0,234,n],[0,235,n],[0,236,M],[0,hn,M],[0,238,M],[0,pH,M],[0,ei,ac],[0,241,ad],[0,242,d],[0,243,d],[0,rz,d],[0,j8,d],[0,246,d],[0,J,d],[0,249,t],[0,jV,t],[0,251,t],[0,ep,t],[0,on,ax],[0,dj,fC],[0,dd,ax],[0,cw,z],[0,rp,x],[0,258,z],[0,p$,x],[0,260,z],[0,261,x],[0,262,ay],[0,263,aO],[0,264,ay],[0,265,aO],[0,o9,ay],[0,267,aO],[0,268,ay],[0,269,aO],[0,270,ak],[0,nN,ac],[0,272,ak],[0,273,ac],[0,274,G],[0,275,n],[0,276,G],[0,277,n],[0,278,G],[0,279,n],[0,280,G],[0,281,n],[0,282,G],[0,283,n],[0,284,an],[0,285,W],[0,286,an],[0,287,W],[0,288,an],[0,289,W],[0,jG,an],[0,291,W],[0,q2,az],[0,293,T],[0,294,az],[0,295,T],[0,oD,X],[0,ps,M],[0,298,X],[0,299,M],[0,300,X],[0,301,M],[0,302,X],[0,303,M],[0,304,X],[0,305,M],[0,306,"IJ"],[0,307,"ij"],[0,308,bH],[0,309,bx],[0,310,aD],[0,311,aT],[0,312,"kra"],[0,313,af],[0,314,D],[0,315,af],[0,316,D],[0,317,af],[0,318,D],[0,319,af],[0,320,D],[0,321,af],[0,322,D],[0,323,aq],[0,324,ad],[0,325,aq],[0,326,ad],[0,327,aq],[0,328,ad],[0,329,ad],[0,330,"NG"],[0,331,fD],[0,332,s],[0,333,d],[0,334,s],[0,335,d],[0,336,s],[0,337,d],[0,338,pd],[0,339,cU],[0,340,ah],[0,341,p],[0,342,ah],[0,343,p],[0,344,ah],[0,345,p],[0,346,aa],[0,347,P],[0,348,aa],[0,349,P],[0,350,aa],[0,351,P],[0,352,aa],[0,353,P],[0,354,aF],[0,355,aj],[0,356,aF],[0,357,aj],[0,358,aF],[0,359,aj],[0,360,B],[0,361,t],[0,362,B],[0,oQ,t],[0,364,B],[0,365,t],[0,366,B],[0,367,t],[0,368,B],[0,rV,t],[0,370,B],[0,371,t],[0,372,a0],[0,373,a9],[0,374,aN],[0,375,ax],[0,376,aN],[0,377,ar],[0,378,ab],[0,379,ar],[0,380,ab],[0,381,ar],[0,382,ab],[0,383,P],[0,384,aM],[0,385,aY],[0,386,aY],[0,387,aM],[0,388,ot],[0,389,ot],[0,390,s],[0,391,ay],[0,392,aO],[0,393,ak],[0,394,ak],[0,395,ak],[0,396,ac],[0,p9,ac],[0,398,G],[0,399,G],[0,400,G],[0,401,bo],[0,402,b4],[0,403,an],[0,404,an],[0,405,pn],[0,406,X],[0,407,X],[0,408,aD],[0,409,aT],[0,410,D],[0,411,D],[0,412,be],[0,413,aq],[0,414,ad],[0,415,s],[0,416,s],[0,417,d],[0,418,"OI"],[0,419,"oi"],[0,420,aZ],[0,421,bw],[0,422,"YR"],[0,423,jN],[0,424,jN],[0,425,oJ],[0,426,cT],[0,427,aj],[0,428,aF],[0,429,aj],[0,430,aF],[0,431,B],[0,432,t],[0,433,B],[0,434,bp],[0,435,aN],[0,436,ax],[0,437,ar],[0,438,ab],[0,439,ar],[0,440,ar],[0,441,ab],[0,442,ab],[0,443,jN],[0,444,qh],[0,445,qh],[0,446,bT],[0,447,a9],[0,448,ci],[0,449,ci],[0,450,ci],[0,451,ci],[0,452,rD],[0,453,ak],[0,454,b8],[0,455,"LJ"],[0,456,af],[0,457,"lj"],[0,458,"NJ"],[0,459,aq],[0,460,"nj"],[0,461,z],[0,462,x],[0,463,X],[0,464,M],[0,465,s],[0,466,d],[0,467,B],[0,468,t],[0,469,B],[0,470,t],[0,471,B],[0,472,t],[0,473,B],[0,474,t],[0,475,B],[0,476,t],[0,477,n],[0,478,z],[0,479,x],[0,480,z],[0,481,x],[0,482,fo],[0,483,cR],[0,484,an],[0,485,W],[0,486,an],[0,487,W],[0,488,aD],[0,489,aT],[0,490,s],[0,491,d],[0,492,s],[0,493,d],[0,494,ar],[0,495,ab],[0,496,bx],[0,497,rD],[0,498,ak],[0,499,b8],[0,500,an],[0,501,W],[0,502,"HW"],[0,503,a0],[0,504,aq],[0,505,ad],[0,506,z],[0,507,x],[0,508,fo],[0,509,cR],[0,510,s],[0,511,d],[0,hk,z],[0,513,x],[0,514,z],[0,515,x],[0,516,G],[0,517,n],[0,518,G],[0,519,n],[0,520,X],[0,521,M],[0,522,X],[0,523,M],[0,524,s],[0,525,d],[0,526,s],[0,527,d],[0,528,ah],[0,529,p],[0,530,ah],[0,531,p],[0,532,B],[0,533,t],[0,534,B],[0,535,t],[0,536,aa],[0,537,P],[0,538,aF],[0,539,aj],[0,540,"GH"],[0,541,"gh"],[0,542,az],[0,543,T],[0,544,aq],[0,545,ac],[0,546,"OU"],[0,547,jB],[0,548,ar],[0,549,ab],[0,550,z],[0,551,x],[0,552,G],[0,553,n],[0,554,s],[0,555,d],[0,556,s],[0,557,d],[0,558,s],[0,559,d],[0,560,s],[0,561,d],[0,562,aN],[0,563,ax],[0,564,D],[0,565,ad],[0,566,aj],[0,567,bx],[0,568,"db"],[0,569,"qp"],[0,570,z],[0,ph,ay],[0,572,aO],[0,573,af],[0,574,aF],[0,575,P],[0,576,ab],[0,577,oR],[0,578,bT],[0,579,aY],[0,580,B],[0,581,bp],[0,582,G],[0,583,n],[0,584,bH],[0,585,bx],[0,586,bX],[0,587,dc],[0,588,ah],[0,589,p],[0,590,aN],[0,591,ax],[0,592,x],[0,593,x],[0,594,x],[0,595,aM],[0,596,d],[0,597,aO],[0,598,ac],[0,599,ac],[0,600,n],[0,601,n],[0,602,n],[0,603,n],[0,604,n],[0,605,n],[0,606,n],[0,607,bx],[0,608,W],[0,609,W],[0,610,W],[0,611,W],[0,612,rc],[0,613,T],[0,614,T],[0,615,T],[0,616,M],[0,617,M],[0,618,M],[0,619,D],[0,620,D],[0,621,D],[0,622,eo],[0,623,a1],[0,624,a1],[0,625,a1],[0,626,ad],[0,627,ad],[0,628,ad],[0,629,d],[0,630,cU],[0,631,d],[0,632,jD],[0,633,p],[0,634,p],[0,635,p],[0,636,p],[0,637,p],[0,638,p],[0,639,p],[0,640,p],[0,641,p],[0,642,P],[0,643,cT],[0,644,bx],[0,645,"{squat}"],[0,646,cT],[0,647,aj],[0,648,aj],[0,649,t],[0,650,t],[0,651,a2],[0,652,a2],[0,653,a9],[0,oM,ax],[0,655,ax],[0,656,ab],[0,657,ab],[0,658,ab],[0,659,ab],[0,660,oR],[0,661,"{voiced}"],[0,662,bT],[0,663,aO],[0,664,ci],[0,665,aM],[0,666,n],[0,667,W],[0,668,T],[0,669,bx],[0,670,aT],[0,671,D],[0,672,dc],[0,673,bT],[0,674,bT],[0,675,b8],[0,676,b8],[0,677,b8],[0,678,bT],[0,qp,hw],[0,680,oF],[0,681,kj],[0,682,rd],[0,683,eo],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,686,T],[0,687,T],[0,688,T],[0,689,T],[0,690,bx],[0,691,p],[0,692,p],[0,693,p],[0,694,p],[0,695,a9],[0,696,ax],[0,736,W],[0,737,D],[0,738,P],[0,739,bU],[0,740,bT],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,rG,e],[0,oG,e],[0,816,e],[0,817,e],[0,oa,e],[0,qn,e],[0,820,e],[0,821,e],[0,qH,e],[0,qq,e],[0,824,e],[0,825,e],[0,oS,e],[0,og,e],[0,828,e],[0,829,e],[0,830,e],[0,p3,e],[0,ov,e],[0,833,e],[0,834,e],[0,835,e],[0,rm,e],[0,oU,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,q6,e],[0,nT,e],[0,848,e],[0,849,e],[0,nS,e],[0,qR,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,x],[0,7425,cR],[0,7426,cR],[0,7427,aM],[0,7428,aO],[0,7429,ac],[0,7430,ac],[0,7431,n],[0,7432,n],[0,7433,M],[0,7434,bx],[0,7435,aT],[0,7436,D],[0,7437,a1],[0,7438,ad],[0,7439,d],[0,7440,d],[0,7441,d],[0,7442,d],[0,7443,d],[0,7444,cU],[0,7445,jB],[0,7446,d],[0,7447,d],[0,7448,bw],[0,7449,p],[0,7450,p],[0,7451,aj],[0,7452,t],[0,7453,t],[0,7454,t],[0,7455,a1],[0,7456,a2],[0,7457,a9],[0,7458,ab],[0,7459,ab],[0,7460,"{spirant}"],[0,7461,d],[0,7468,x],[0,7469,cR],[0,7470,aM],[0,7471,aM],[0,7472,ac],[0,7473,n],[0,7474,n],[0,7475,W],[0,7476,T],[0,7477,M],[0,7478,bx],[0,7479,aT],[0,7480,D],[0,7481,a1],[0,7482,ad],[0,7483,ad],[0,7484,d],[0,7485,jB],[0,7486,bw],[0,7487,p],[0,7488,aj],[0,7489,t],[0,7490,a9],[0,7491,x],[0,7492,x],[0,7493,x],[0,7494,cR],[0,7495,aM],[0,7496,ac],[0,7497,n],[0,7498,n],[0,7499,n],[0,7500,n],[0,7501,W],[0,7502,M],[0,7503,aT],[0,7504,a1],[0,7505,fD],[0,7506,d],[0,7507,d],[0,7508,d],[0,7509,d],[0,7510,bw],[0,7511,aj],[0,7512,t],[0,7513,t],[0,7514,a1],[0,7515,a2],[0,7516,d],[0,7531,rC],[0,7532,aM],[0,7533,ac],[0,7534,b4],[0,7535,a1],[0,7536,ad],[0,7537,bw],[0,7538,p],[0,7539,p],[0,7540,P],[0,7541,aj],[0,7542,ab],[0,7543,W],[0,7545,W],[0,7546,fC],[0,7547,M],[0,7548,M],[0,7549,bw],[0,7550,t],[0,7551,t],[0,7552,aM],[0,7553,ac],[0,7554,b4],[0,7555,W],[0,7556,aT],[0,7557,D],[0,7558,a1],[0,7559,ad],[0,7560,bw],[0,7561,p],[0,7562,P],[0,7563,cT],[0,7564,a2],[0,7565,bU],[0,7566,ab],[0,7567,x],[0,7568,x],[0,7569,ac],[0,7570,n],[0,7571,n],[0,7572,n],[0,7573,n],[0,7574,M],[0,7575,d],[0,7576,cT],[0,7577,t],[0,7578,ab],[0,7579,x],[0,7580,aO],[0,7581,aO],[0,7582,ac],[0,7583,n],[0,7584,b4],[0,7585,bx],[0,7586,W],[0,7587,T],[0,7588,M],[0,7589,M],[0,7590,M],[0,7591,M],[0,7592,bx],[0,7593,D],[0,7594,D],[0,7595,D],[0,7596,a1],[0,7597,a1],[0,7598,ad],[0,7599,ad],[0,7600,ad],[0,7601,d],[0,7602,jD],[0,7603,P],[0,7604,cT],[0,7605,aj],[0,7606,t],[0,7607,t],[0,7608,t],[0,7609,a2],[0,7610,a2],[0,7611,ab],[0,7612,ab],[0,7613,ab],[0,7614,ab],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,ah],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,z],[0,7636,fo],[0,7637,oO],[0,7638,jK],[0,7639,ay],[0,7640,ak],[0,7641,ak],[0,7642,an],[0,7643,an],[0,7644,aD],[0,7645,af],[0,7646,af],[0,7647,be],[0,7648,aq],[0,7649,aq],[0,7650,ah],[0,7651,ah],[0,7652,aa],[0,7653,aa],[0,7654,ar],[0,7655,z],[0,7656,aY],[0,7657,aY],[0,7658,G],[0,7659,bo],[0,7660,af],[0,7661,s],[0,7662,aZ],[0,7663,oJ],[0,7664,B],[0,7665,a0],[0,7666,z],[0,7667,s],[0,7668,B],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,z],[0,7681,x],[0,7682,aY],[0,7683,aM],[0,7684,aY],[0,7685,aM],[0,7686,aY],[0,7687,aM],[0,7688,ay],[0,7689,aO],[0,7690,ak],[0,7691,ac],[0,7692,ak],[0,7693,ac],[0,7694,ak],[0,7695,ac],[0,7696,ak],[0,7697,ac],[0,7698,ak],[0,7699,ac],[0,7700,G],[0,7701,n],[0,7702,G],[0,7703,n],[0,7704,G],[0,7705,n],[0,7706,G],[0,7707,n],[0,7708,G],[0,7709,n],[0,7710,bo],[0,7711,b4],[0,7712,an],[0,7713,W],[0,7714,az],[0,7715,T],[0,7716,az],[0,7717,T],[0,7718,az],[0,7719,T],[0,7720,az],[0,7721,T],[0,7722,az],[0,7723,T],[0,7724,X],[0,7725,M],[0,7726,X],[0,7727,M],[0,7728,aD],[0,7729,aT],[0,7730,aD],[0,7731,aT],[0,7732,aD],[0,7733,aT],[0,7734,af],[0,7735,D],[0,7736,af],[0,7737,D],[0,7738,af],[0,7739,D],[0,7740,af],[0,7741,D],[0,7742,be],[0,7743,a1],[0,7744,be],[0,7745,a1],[0,7746,be],[0,7747,a1],[0,7748,aq],[0,7749,ad],[0,7750,aq],[0,7751,ad],[0,7752,aq],[0,7753,ad],[0,7754,aq],[0,7755,ad],[0,7756,s],[0,7757,d],[0,7758,s],[0,7759,d],[0,7760,s],[0,7761,d],[0,7762,s],[0,7763,d],[0,7764,aZ],[0,7765,bw],[0,7766,aZ],[0,7767,bw],[0,7768,ah],[0,7769,p],[0,7770,ah],[0,7771,p],[0,7772,ah],[0,7773,p],[0,7774,ah],[0,7775,p],[0,7776,aa],[0,7777,P],[0,7778,aa],[0,7779,P],[0,7780,aa],[0,7781,P],[0,7782,aa],[0,7783,P],[0,7784,aa],[0,7785,P],[0,7786,aF],[0,7787,aj],[0,7788,aF],[0,7789,aj],[0,7790,aF],[0,7791,aj],[0,7792,aF],[0,7793,aj],[0,7794,B],[0,7795,t],[0,7796,B],[0,7797,t],[0,7798,B],[0,7799,t],[0,7800,B],[0,7801,t],[0,7802,B],[0,7803,t],[0,7804,bp],[0,7805,a2],[0,7806,bp],[0,7807,a2],[0,7808,a0],[0,7809,a9],[0,7810,a0],[0,7811,a9],[0,7812,a0],[0,7813,a9],[0,7814,a0],[0,7815,a9],[0,7816,a0],[0,7817,a9],[0,7818,b_],[0,7819,bU],[0,7820,b_],[0,7821,bU],[0,7822,aN],[0,7823,ax],[0,7824,ar],[0,7825,ab],[0,7826,ar],[0,7827,ab],[0,7828,ar],[0,7829,ab],[0,7830,T],[0,7831,aj],[0,7832,a9],[0,7833,ax],[0,7834,x],[0,7835,P],[0,7836,P],[0,7837,P],[0,7838,aa],[0,7839,ac],[0,7840,z],[0,7841,x],[0,7842,z],[0,7843,x],[0,7844,z],[0,7845,x],[0,7846,z],[0,7847,x],[0,7848,z],[0,7849,x],[0,7850,z],[0,7851,x],[0,7852,z],[0,7853,x],[0,7854,z],[0,7855,x],[0,7856,z],[0,7857,x],[0,7858,z],[0,7859,x],[0,7860,z],[0,7861,x],[0,7862,z],[0,7863,x],[0,7864,G],[0,7865,n],[0,7866,G],[0,7867,n],[0,7868,G],[0,7869,n],[0,7870,G],[0,7871,n],[0,7872,G],[0,7873,n],[0,7874,G],[0,7875,n],[0,7876,G],[0,7877,n],[0,7878,G],[0,7879,n],[0,7880,X],[0,7881,M],[0,7882,X],[0,7883,M],[0,7884,s],[0,7885,d],[0,7886,s],[0,7887,d],[0,7888,s],[0,7889,d],[0,7890,s],[0,7891,d],[0,7892,s],[0,7893,d],[0,7894,s],[0,7895,d],[0,7896,s],[0,7897,d],[0,7898,s],[0,7899,d],[0,7900,s],[0,7901,d],[0,7902,s],[0,7903,d],[0,7904,s],[0,7905,d],[0,7906,s],[0,7907,d],[0,7908,B],[0,7909,t],[0,7910,B],[0,7911,t],[0,7912,B],[0,7913,t],[0,7914,B],[0,7915,t],[0,7916,B],[0,7917,t],[0,7918,B],[0,7919,t],[0,7920,B],[0,7921,t],[0,7922,aN],[0,7923,ax],[0,7924,aN],[0,7925,ax],[0,7926,aN],[0,7927,ax],[0,7928,aN],[0,7929,ax],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bp],[0,7933,a2],[0,7934,aN],[0,7935,ax],[0,8305,M],[0,8319,ad],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aO],[0,9372,z],[0,9373,aY],[0,9374,ay],[0,9375,ak],[0,9376,G],[0,9377,bo],[0,9378,an],[0,9379,az],[0,9380,X],[0,9381,bH],[0,9382,aD],[0,9383,af],[0,9384,be],[0,9385,aq],[0,9386,s],[0,9387,aZ],[0,9388,bX],[0,9389,ah],[0,9390,aa],[0,9391,aF],[0,9392,B],[0,9393,bp],[0,9394,a0],[0,9395,b_],[0,9396,aN],[0,9397,ar],[0,9398,z],[0,9399,aY],[0,9400,ay],[0,9401,ak],[0,9402,G],[0,9403,bo],[0,9404,an],[0,9405,az],[0,9406,X],[0,9407,bH],[0,9408,aD],[0,9409,af],[0,9410,be],[0,9411,aq],[0,9412,s],[0,9413,aZ],[0,9414,bX],[0,9415,ah],[0,9416,aa],[0,9417,aF],[0,9418,B],[0,9419,bp],[0,9420,a0],[0,9421,b_],[0,9422,aN],[0,9423,ar],[0,9424,x],[0,9425,aM],[0,9426,aO],[0,9427,ac],[0,9428,n],[0,9429,b4],[0,9430,W],[0,9431,T],[0,9432,M],[0,9433,bx],[0,9434,aT],[0,9435,D],[0,9436,a1],[0,9437,ad],[0,9438,d],[0,9439,bw],[0,9440,dc],[0,9441,p],[0,9442,P],[0,9443,aj],[0,9444,t],[0,9445,a2],[0,9446,a9],[0,9447,bU],[0,9448,ax],[0,9449,ab],[0,11360,af],[0,11361,D],[0,11362,af],[0,11363,aZ],[0,11364,ah],[0,11365,x],[0,11366,aj],[0,11367,az],[0,11368,T],[0,11369,aD],[0,11370,aT],[0,11371,ar],[0,11372,ab],[0,11373,z],[0,11374,be],[0,11375,z],[0,11376,z],[0,11377,a2],[0,11378,a0],[0,11379,a9],[0,11380,a2],[0,11381,az],[0,11382,T],[0,11383,jD],[0,11384,n],[0,11385,p],[0,11386,d],[0,11387,n],[0,11389,a2],[0,11390,aa],[0,11391,ar],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,s],[0,42789,d],[0,42790,az],[0,42791,T],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,oN],[0,42795,oN],[0,42796,hz],[0,42797,hz],[0,42798,hz],[0,42799,hz],[0,42800,b4],[0,42801,P],[0,42802,"AA"],[0,42803,pW],[0,42804,oO],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,jK],[0,42809,r$],[0,42810,jK],[0,42811,r$],[0,42812,"AY"],[0,42813,"ay"],[0,42814,ay],[0,42815,aO],[0,42816,aD],[0,42817,aT],[0,42818,aD],[0,42819,aT],[0,42820,aD],[0,42821,aT],[0,42822,af],[0,42823,D],[0,42824,af],[0,42825,D],[0,42826,s],[0,42827,d],[0,42828,s],[0,42829,d],[0,42830,"OO"],[0,42831,"oo"],[0,42832,aZ],[0,42833,bw],[0,42834,aZ],[0,42835,bw],[0,42836,aZ],[0,42837,bw],[0,42838,bX],[0,42839,dc],[0,42840,bX],[0,42841,dc],[0,42842,ah],[0,42843,p],[0,42844,ah],[0,42845,p],[0,42846,bp],[0,42847,a2],[0,42848,"VY"],[0,42849,"vy"],[0,42850,ar],[0,42851,ab],[0,42852,jZ],[0,42853,fC],[0,42854,jZ],[0,42855,fC],[0,42856,bp],[0,42857,a2],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,p],[0,42870,p],[0,42871,"tum"],[0,42872,"um"],[0,42873,ak],[0,42874,ac],[0,42875,bo],[0,42876,b4],[0,42877,an],[0,42878,an],[0,42879,W],[0,42880,af],[0,42881,D],[0,42882,ah],[0,42883,p],[0,42884,aa],[0,42885,P],[0,42886,aF],[0,42887,aj],[0,42891,hf],[0,42892,hf],[0,42893,az],[0,42894,D],[0,42895,r9],[0,42896,aq],[0,42897,ad],[0,42898,ay],[0,42899,aO],[0,42900,aO],[0,42901,T],[0,42902,aY],[0,42903,aM],[0,42904,bo],[0,42905,b4],[0,42906,fo],[0,42907,cR],[0,42908,pd],[0,42909,cU],[0,42910,"UE"],[0,42911,rC],[0,42912,an],[0,42913,W],[0,42914,aD],[0,42915,aT],[0,42916,aq],[0,42917,ad],[0,42918,ah],[0,42919,p],[0,42920,aa],[0,42921,P],[0,42922,az],[0,42923,G],[0,42924,an],[0,42925,af],[0,42926,X],[0,42927,dc],[0,42928,aD],[0,42929,aF],[0,42930,bH],[0,42931,b_],[0,42932,aY],[0,42933,aM],[0,42934,s],[0,42935,d],[0,42936,B],[0,42937,t],[0,42938,z],[0,42939,x],[0,42940,X],[0,42941,M],[0,42942,B],[0,42943,t],[0,42944,s],[0,42945,d],[0,42946,a0],[0,42947,a9],[0,42948,ay],[0,42949,aa],[0,42950,ar],[0,42951,ak],[0,42952,ac],[0,42953,aa],[0,42954,P],[0,42960,an],[0,42961,W],[0,42963,fC],[0,42965,a9],[0,42966,aa],[0,42967,P],[0,42968,aa],[0,42969,P],[0,42994,ay],[0,42995,bo],[0,42996,bX],[0,42997,az],[0,42998,T],[0,42999,X],[0,43000,T],[0,43001,"{letter}"],[0,43002,a1],[0,43003,bo],[0,43004,aZ],[0,43005,be],[0,43006,X],[0,43007,be],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,x],[0,43825,x],[0,43826,n],[0,43827,n],[0,43828,n],[0,43829,b4],[0,43830,W],[0,43831,D],[0,43832,D],[0,43833,D],[0,43834,a1],[0,43835,ad],[0,43836,fD],[0,43837,d],[0,43838,d],[0,43839,d],[0,43840,cU],[0,43841,cU],[0,43842,cU],[0,43843,d],[0,43844,d],[0,43845,p],[0,43846,p],[0,43847,p],[0,43848,p],[0,43849,p],[0,43850,p],[0,43851,p],[0,43852,p],[0,43853,cT],[0,43854,t],[0,43855,t],[0,43856,oi],[0,43857,oi],[0,43858,t],[0,43859,bU],[0,43860,bU],[0,43861,bU],[0,43862,bU],[0,43863,bU],[0,43864,bU],[0,43865,bU],[0,43866,ax],[0,43868,T],[0,43869,D],[0,43870,D],[0,43871,t],[0,43872,"wa"],[0,43873,n],[0,43874,cU],[0,43875,"uo"],[0,43876,x],[0,43878,b8],[0,43879,bT],[0,43880,p],[0,43881,a9],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,P],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,z],[0,65314,aY],[0,65315,ay],[0,65316,ak],[0,65317,G],[0,65318,bo],[0,65319,an],[0,65320,az],[0,65321,X],[0,65322,bH],[0,65323,aD],[0,65324,af],[0,65325,be],[0,65326,aq],[0,65327,s],[0,65328,aZ],[0,65329,bX],[0,65330,ah],[0,65331,aa],[0,65332,aF],[0,65333,B],[0,65334,bp],[0,65335,a0],[0,65336,b_],[0,65337,aN],[0,65338,ar],[0,65345,x],[0,65346,aM],[0,65347,aO],[0,65348,ac],[0,65349,n],[0,65350,b4],[0,65351,W],[0,65352,T],[0,65353,M],[0,65354,bx],[0,65355,aT],[0,65356,D],[0,65357,a1],[0,65358,ad],[0,65359,d],[0,65360,bw],[0,65361,dc],[0,65362,p],[0,65363,P],[0,65364,aj],[0,65365,t],[0,65366,a2],[0,65367,a9],[0,65368,bU],[0,65369,ax],[0,65370,ab],[0,66045,e],[0,67456,pW],[0,67457,nL],[0,67458,nL],[0,67459,cR],[0,67460,aM],[0,67461,aM],[0,67463,b8],[0,67464,b8],[0,67465,b8],[0,67466,b8],[0,67467,ac],[0,67468,ac],[0,67469,ac],[0,67470,n],[0,67471,n],[0,67472,kj],[0,67473,rc],[0,67474,W],[0,67475,W],[0,67476,W],[0,67477,T],[0,67478,T],[0,67479,T],[0,67480,bx],[0,67481,rd],[0,67482,eo],[0,67483,D],[0,67484,D],[0,67485,D],[0,67486,eo],[0,67487,eo],[0,67488,ax],[0,67489,ax],[0,67490,d],[0,67491,cU],[0,67492,d],[0,67493,dc],[0,67494,p],[0,67495,p],[0,67496,p],[0,67497,p],[0,67498,p],[0,67499,oF],[0,67500,bT],[0,67501,bT],[0,67502,hw],[0,67503,aj],[0,67504,a2],[0,67506,ax],[0,67507,bT],[0,67508,bT],[0,67509,ci],[0,67510,ci],[0,67511,ci],[0,67512,ci],[0,67513,ci],[0,67514,P],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,kj],[0,122625,W],[0,122626,W],[0,122627,aT],[0,122628,D],[0,122629,eo],[0,122630,ax],[0,122631,fD],[0,122632,p],[0,122633,aj],[0,122634,ci],[0,122635,cT],[0,122636,cT],[0,122637,aj],[0,122638,bT],[0,122639,aO],[0,122640,aT],[0,122641,D],[0,122642,b8],[0,122643,D],[0,122644,fD],[0,122645,p],[0,122646,p],[0,122647,hw],[0,122648,ab],[0,122649,b8],[0,122650,M],[0,122651,d],[0,122652,hw],[0,122653,aO],[0,122654,P],[0,122661,ac],[0,122662,D],[0,122663,ad],[0,122664,p],[0,122665,P],[0,122666,aj],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,z],[0,127249,aY],[0,127250,ay],[0,127251,ak],[0,127252,G],[0,127253,bo],[0,127254,an],[0,127255,az],[0,127256,X],[0,127257,bH],[0,127258,aD],[0,127259,af],[0,127260,be],[0,127261,aq],[0,127262,s],[0,127263,aZ],[0,127264,bX],[0,127265,ah],[0,127266,aa],[0,127267,aF],[0,127268,B],[0,127269,bp],[0,127270,a0],[0,127271,b_],[0,127272,aN],[0,127273,ar],[0,127274,aa],[0,127275,ay],[0,127276,ah],[0,127280,z],[0,127281,aY],[0,127282,ay],[0,127283,ak],[0,127284,G],[0,127285,bo],[0,127286,an],[0,127287,az],[0,127288,X],[0,127289,bH],[0,127290,aD],[0,127291,af],[0,127292,be],[0,127293,aq],[0,127294,s],[0,127295,aZ],[0,127296,bX],[0,127297,ah],[0,127298,aa],[0,127299,aF],[0,127300,B],[0,127301,bp],[0,127302,a0],[0,127303,b_],[0,127304,aN],[0,127305,ar],[0,127312,z],[0,127313,aY],[0,127314,ay],[0,127315,ak],[0,127316,G],[0,127317,bo],[0,127318,an],[0,127319,az],[0,127320,X],[0,127321,bH],[0,127322,aD],[0,127323,af],[0,127324,be],[0,127325,aq],[0,127326,s],[0,127327,aZ],[0,127328,bX],[0,127329,ah],[0,127330,aa],[0,127331,aF],[0,127332,B],[0,127333,bp],[0,127334,a0],[0,127335,b_],[0,127336,aN],[0,127337,ar],[0,127344,z],[0,127345,aY],[0,127346,ay],[0,127347,ak],[0,127348,G],[0,127349,bo],[0,127350,an],[0,127351,az],[0,127352,X],[0,127353,bH],[0,127354,aD],[0,127355,af],[0,127356,be],[0,127357,aq],[0,127358,s],[0,127359,aZ],[0,127360,bX],[0,127361,ah],[0,127362,aa],[0,127363,aF],[0,127364,B],[0,127365,bp],[0,127366,a0],[0,127367,b_],[0,127368,aN],[0,127369,ar],[0,127370,aZ],[0,127397,ak],[0,917569,z],[0,917570,aY],[0,917571,ay],[0,917572,ak],[0,917573,G],[0,917574,bo],[0,917575,an],[0,917576,az],[0,917577,X],[0,917578,bH],[0,917579,aD],[0,917580,af],[0,917581,be],[0,917582,aq],[0,917583,s],[0,917584,aZ],[0,917585,bX],[0,917586,ah],[0,917587,aa],[0,917588,aF],[0,917589,B],[0,917590,bp],[0,917591,a0],[0,917592,b_],[0,917593,aN],[0,917594,ar],[0,917601,z],[0,917602,aY],[0,917603,ay],[0,917604,ak],[0,917605,G],[0,917606,bo],[0,917607,an],[0,917608,az],[0,917609,X],[0,917610,bH],[0,917611,aD],[0,917612,af],[0,917613,be],[0,917614,aq],[0,917615,s],[0,917616,aZ],[0,917617,bX],[0,917618,ah],[0,917619,aa],[0,917620,aF],[0,917621,B],[0,917622,bp],[0,917623,a0],[0,917624,b_],[0,917625,aN],[0,917626,ar]]),Ei=bW,Eh=hO([[0,170,x],[0,186,d],[0,o2,"ss"],[0,8208,ck],[0,8211,ck],[0,8212,ck],[0,8216,hf],[0,8217,hf],[0,8220,di],[0,8221,di],[0,8230,"..."],[0,8722,ck]]),Ep="?",Eu=[0,jP],Et=[1,[0,3854881,"Failed to unmarshal data"]],Eq=[0,1],Ev=[0,"lib/codec.ml",32,4],Ey="Yojson__Common.Json_error",EA="Yojson__Common.End_of_array",EB="Yojson__Common.End_of_object",EC="Yojson__Common.End_of_tuple",ED="Yojson__Common.End_of_input",EF=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],FX=[0,bf,1],FY=[0,bf,0],FZ=bV,F0="Invalid token",F1=bV,F2="Invalid escape sequence",F3=bV,F4="Invalid low surrogate for code point beyond U+FFFF",F5="Missing escape sequence representing low surrogate for code point beyond U+FFFF",F6=bV,F7="Expected ':' or '>' but found",F8=bV,F9="Expected '>' but found",F_=bV,F$="Unterminated comment",Ga="Expected string or identifier but found",Gb=bV,Gc="Expected ',' or ']' but found",Gd=bV,Ge="Expected ',' or ')' but found",Gf=bV,Gg="Expected ',' or '}' but found",Gh=bV,Gi="Expected ':' but found",Gj=bV,GF="Expected string, got ",GE="Expected object, got ",Gs=fz,Gu=hC,Gv="floatlit",Gw=hq,Gx="tuple",Gt="bool",Gz="variant",GA="float",GB="int",GC=jL,Gy="intlit",Go="Blank input data",Gl="Junk after end of JSON value:",Ft=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],Fo=[0,[11,"File ",[2,0,[11,nH,0]]],"File %s, line"],Fs="Line",Fp=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],Fr=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],Fq=[0,[2,0,[12,32,[4,3,0,0,[11,kb,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],Fn=[0,"lib/read.mll",41,13],Fm=e,Fk=e,E8="NaN value not allowed in standard JSON",E9=[0,[8,[0,0,3],0,[0,16],0],sb],E$=[0,[8,[0,0,3],0,[0,17],0],q$],E_=rY,E6="Infinity value not allowed in standard JSON",E7="-Infinity value not allowed in standard JSON",E1="NaN",E2=[0,[8,[0,0,3],0,[0,16],0],sb],E4=[0,[8,[0,0,3],0,[0,17],0],q$],E3=rY,EZ="Infinity",E0="-Infinity",EV=fv,EW=fI,EU=fz,EO=hh,EP=hr,EQ=hb,ER="\\f",ES=g6,ET=kf,EN=he,EL=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,jl,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],EJ="\\u00",Fu="Yojson__Safe.Int_overflow",Gp="Yojson__Safe.Util.Type_error",GL="list_of_yojson: list needed",GK="int_of_yojson: integer needed",GJ="string_of_yojson: string needed",GI="bool_of_yojson: true/false needed",GG="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",GZ=bW,G1="_of_yojson: list instead of atom for record expected",G0=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],GX="extra fields",GW="duplicate fields",GU=bW,GV=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,jz,[2,0,0]]]]],"%s_of_yojson: %s: %s"],GT="_of_yojson: unexpected variant constructor",GS="_of_yojson: expected a variant type, saw an empty list",GR="_of_yojson: expected a variant type, saw a nested list",GQ="_of_yojson: this constructor requires arguments",GO=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],GM="_of_yojson: this constructor does not take arguments",Kt="An error occured while decoding response: ",Ko=[0,[11,", Token=",[3,0,0]],", Token=%S"],Kr=e,Kp=e,Kq=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],Kj=ju,Kk=sd,Kl=dh,Kf="item_id",Kg="locations",Kh=bg,Kc=[0,"Views",0],Kd="Users",J9=hl,J_=g$,J$=fm,J5=oo,J6=nY,J7=jv,J3=pr,J1="include_external_content",JZ=[0,fm,0],JW=hl,JX=g$,JY=fm,JT=oo,JU=nY,JV=jv,JH=oc,JI=qJ,JJ=jU,JK=rO,JL=rs,JM=rI,JN=oX,JO=rS,JP=jC,JQ=p2,JR=r4,JS=qV,JA="enable_images",JB="enable_user_data",JC=jU,JD="sort_by",JE="include_item_types",JF=jC,JG="user_id",Jz=p0,Jn=p7,Jo=pK,Jp=oH,Jq=p_,Jr=g8,Js=pl,Jt=hA,Ju=hp,Jv=hs,Jw=ha,Jx=en,Jy=dh,Jh="type_",Ji="image_blur_hashes",Jj=hu,Jk="is_folder",Jl=aX,Jm=bg,Jg=[0,"lib/data_source/jellyfin_api.ml",pP,64],Jc=rT,Jd=dh,I$="url",Ja=bg,Ic=[0,h,[0,[0,f,oy],0]],Id=[0,h,[0,[0,f,ow],0]],Ie=[0,h,[0,[0,f,o$],0]],If=[0,h,[0,[0,f,qr],0]],Ig=[0,h,[0,[0,f,q8],0]],Ih=[0,h,[0,[0,f,n4],0]],Ii=[0,h,[0,[0,f,qS],0]],Ij=[0,h,[0,[0,f,pt],0]],Ik=[0,h,[0,[0,f,qN],0]],Il=[0,h,[0,[0,f,hx],0]],Im=[0,h,[0,[0,f,pU],0]],In=[0,h,[0,[0,f,pj],0]],Io=[0,h,[0,[0,f,nX],0]],Ip=[0,h,[0,[0,f,ro],0]],Iq=[0,h,[0,[0,f,o0],0]],Ir=[0,h,[0,[0,f,qb],0]],Is=[0,h,[0,[0,f,pG],0]],It=[0,h,[0,[0,f,qa],0]],Iu=[0,h,[0,[0,f,ha],0]],Iv=[0,h,[0,[0,f,o8],0]],Iw=[0,h,[0,[0,f,ry],0]],Ix=[0,h,[0,[0,f,pM],0]],Iy=[0,h,[0,[0,f,rU],0]],Iz=[0,h,[0,[0,f,pq],0]],IA=[0,h,[0,[0,f,rn],0]],IB=[0,h,[0,[0,f,nM],0]],IC=[0,h,[0,[0,f,qv],0]],ID=[0,h,[0,[0,f,re],0]],IE=[0,h,[0,[0,f,pS],0]],IF=[0,h,[0,[0,f,nJ],0]],IG=[0,h,[0,[0,f,pb],0]],IH=[0,h,[0,[0,f,pv],0]],II=[0,h,[0,[0,f,g8],0]],IJ=[0,h,[0,[0,f,hp],0]],IK=[0,h,[0,[0,f,os],0]],IL=[0,h,[0,[0,f,qF],0]],IM=[0,h,[0,[0,f,pL],0]],IN=[0,h,[0,[0,f,q7],0]],IO=[0,h,[0,[0,f,rA],0]],IP=[0,h,[0,[0,f,oA],0]],IQ=[0,h,[0,[0,f,sc],0]],IR=[0,h,[0,[0,f,px],0]],IS=[0,h,[0,[0,f,qt],0]],IT=[0,h,[0,[0,f,py],0]],IU=[0,h,[0,[0,f,sl],0]],IV=[0,h,[0,[0,f,ri],0]],IW=[0,h,[0,[0,f,oK],0]],IX=[0,h,[0,[0,f,ql],0]],IY=[0,h,[0,[0,f,p1],0]],IZ=[0,h,[0,[0,f,qL],0]],I0=[0,h,[0,[0,f,en],0]],I1=[0,h,[0,[0,f,sa],0]],I2=[0,h,[0,[0,f,qI],0]],I3=[0,h,[0,[0,f,pN],0]],I4=[0,h,[0,[0,f,pA],0]],I5=[0,h,[0,[0,f,qM],0]],I6=[0,h,[0,[0,f,qu],0]],I7=[0,h,[0,[0,f,rX],0]],I8=[0,h,[0,[0,f,sk],0]],I9=[0,h,[0,[0,f,rE],0]],HB=[0,h,[0,[0,f,r5],0]],HC=[0,h,[0,[0,f,rx],0]],HD=[0,h,[0,[0,f,po],0]],HE=[0,h,[0,[0,f,oY],0]],HF=[0,h,[0,[0,f,of],0]],HG=[0,h,[0,[0,f,oq],0]],HH=[0,h,[0,[0,f,pc],0]],HI=[0,h,[0,[0,f,oB],0]],HJ=[0,h,[0,[0,f,qj],0]],HK=[0,h,[0,[0,f,rF],0]],HL=[0,h,[0,[0,f,rJ],0]],HM=[0,h,[0,[0,f,pI],0]],HN=[0,h,[0,[0,f,r6],0]],HO=[0,h,[0,[0,f,n5],0]],HP=[0,h,[0,[0,f,n9],0]],HQ=[0,h,[0,[0,f,r1],0]],HR=[0,h,[0,[0,f,qT],0]],HS=[0,h,[0,[0,f,oC],0]],HT=[0,h,[0,[0,f,qd],0]],HU=[0,h,[0,[0,f,o_],0]],HV=[0,h,[0,[0,f,nR],0]],HW=[0,h,[0,[0,f,ru],0]],HX=[0,h,[0,[0,f,rr],0]],HY=[0,h,[0,[0,f,n1],0]],HZ=[0,h,[0,[0,f,q0],0]],H0=[0,h,[0,[0,f,pV],0]],H1=[0,h,[0,[0,f,rW],0]],H2=[0,h,[0,[0,f,ol],0]],H3=[0,h,[0,[0,f,n7],0]],H4=[0,h,[0,[0,f,o1],0]],H5=[0,h,[0,[0,f,p6],0]],H6=[0,h,[0,[0,f,oL],0]],H7=[0,h,[0,[0,f,pu],0]],H8=[0,h,[0,[0,f,n_],0]],H9=[0,h,[0,[0,f,od],0]],H_=[0,h,[0,[0,f,rb],0]],H$=[0,h,[0,[0,f,oz],0]],HA=r3,Hw=hs,Hx=dh,Ht=aX,Hu=bg,G9=[0,h,[0,[0,f,qA],0]],G_=[0,h,[0,[0,f,ok],0]],G$=[0,h,[0,[0,f,q5],0]],Ha=[0,h,[0,[0,f,pX],0]],Hb=[0,h,[0,[0,f,pC],0]],Hc=[0,h,[0,[0,f,oh],0]],Hd=[0,h,[0,[0,f,hx],0]],He=[0,h,[0,[0,f,oW],0]],Hf=[0,h,[0,[0,f,rB],0]],Hg=[0,h,[0,[0,f,pR],0]],Hh=[0,h,[0,[0,f,hA],0]],Hi=[0,h,[0,[0,f,o7],0]],Hj=[0,h,[0,[0,f,rh],0]],Hk=[0,h,[0,[0,f,rq],0]],Hl=[0,h,[0,[0,f,q3],0]],Hm=[0,h,[0,[0,f,en],0]],Hn=[0,h,[0,[0,f,rM],0]],Ho=[0,h,[0,[0,f,qc],0]],Hp=[0,h,[0,[0,f,pY],0]],G5=[0,h,[0,[0,f,ra],0]],G6=[0,h,[0,[0,f,qy],0]],Ky="all",Kz="oneof",KA=oE,KB="noneof",KC=oE,Ld=hu,Le=b6,Lf=kc,Lg=aX,K_=hu,K$=b6,La=kc,Lb=aX,K5=b6,K6=dG,K7=aX,K8=g7,K0=b6,K1=dG,K2=aX,K3=g7,KW=dI,KX=bg,KU=dI,KV=bg,KO=b6,KP=dI,KQ=bg,KR=dG,KS=aX,KJ=b6,KK=dI,KL=bg,KM=dG,KN=aX,KG=bg,KH=aX,KE=bg,KF=aX,KD=[0,f,jy],L$=[0,cW,oD,15],L_=[0,cW,jG,21],L9=n0,L4=[0,cW,p$,15],L3=[0,cW,dj,21],L2=n0,LT=ft,LD=[0,cW,168,11],Lz=[0,cW,dJ,13],Ly=[0,cW,ox,19],Lx=[0,cW,108,13],Lw=[0,cW,fn,19],Lu=hc,Lv=jQ,Lr=hc,Ls=jQ,Ln=b6,Lo=kh,Lp=jt,Lj=b6,Lk=kh,Ll=jt,Lh=nK,LA=jv,LB="virtual_folders",LP="collections",LU="genres",LX="artists",L1="albums",L8=pz,MS=[0,2,0],MN=[0," in db)",0],MO=" tracks (",MP=jz,MQ="Collection ",ML=[0," tracks",0],MM="Sync finished. Added ",MK=[0,0],MJ=[0,"Syncing database",0],MH=[0,0],ME=[0,0],MF=[0,1,0],Mz=[0,6,0],MA=[0,0],MB=[0,17,[0,16,[0,1,0]]],MC=[0,32,[0,33,[0,20,[0,9,[0,18,[0,56,0]]]]]],Mx="Could not add track into the db: ",Mv=rH,Mu=[0,1],Mw=ft,Ms=rH,Mp=[0,1],Mq=pD,Mr=[0,2],Mm=[0,1],Mn=q4,Ml="Could not add artist into the db: ",Mk=e,Mj=[0,1],Mh="MusicBrainz",Md=[0,1],Me=e,Mf="music",Mg=[0,0],Mb=[0,0,0],NC=pz,MX="to",MY="Upgrading indexed_db schema from version",MZ=[0,"Erasing existing stores",0],M0=[0,aX],M1=[0,0],M2=[0,"sorts.date_added"],M3=nK,M4=pp,M5="item.Name",M6=r7,M7=[0,0],M8=[0,r7],M9="items_by_id",M_=pp,M$="item.Type",Na="items_by_view_and_kind",Nb="sorts.sort_name",Nc="item.CollectionType",Nd="items_by_type_and_name",Ne=[0,ju],Nf=[0,0],Ng=[0,1],Nh=[0,1],Ni=[0,aX],Nj=ft,Nk=[0,1],Nl=[0,1],Nm=[0,dI],Nn=q4,No=[0,1],Np=[0,1],Nq=[0,aX],Nr=ft,Ns=[0,dG],Nt="by-mbid",Nu=[0,1],Nv=[0,aX],Nw=ft,Nx=[0,g7],Ny=pD,Nz="Stores created:",NP="An error occured while loading item",NO="Unknown genre",NI=[0,[2,0,0],pQ],NG=[0,jw,0],NH="Get all keys ",NN="not implemented",NJ=[0,jw,0],NK="Filter took ",NL=[0,jw,0],NM="Sort took ";function +at(a){if(typeof a==="number")return 0;switch(a[0]){case -0:return[0,ar(a[1])];case -1:return[1,ar(a[1])];case -2:return[2,ar(a[1])];case -3:return[3,ar(a[1])];case -4:return[4,ar(a[1])];case -5:return[5,ar(a[1])];case -6:return[6,ar(a[1])];case -7:return[7,ar(a[1])];case +0:return[0,at(a[1])];case +1:return[1,at(a[1])];case +2:return[2,at(a[1])];case +3:return[3,at(a[1])];case +4:return[4,at(a[1])];case +5:return[5,at(a[1])];case +6:return[6,at(a[1])];case +7:return[7,at(a[1])];case 8:var -c=a[1];return[8,c,ar(a[2])];case +c=a[1];return[8,c,at(a[2])];case 9:var -b=a[1];return[9,b,b,ar(a[3])];case -10:return[10,ar(a[1])];case -11:return[11,ar(a[1])];case -12:return[12,ar(a[1])];case -13:return[13,ar(a[1])];default:return[14,ar(a[1])]}}function -bf(a,b){if(typeof +b=a[1];return[9,b,b,at(a[3])];case +10:return[10,at(a[1])];case +11:return[11,at(a[1])];case +12:return[12,at(a[1])];case +13:return[13,at(a[1])];default:return[14,at(a[1])]}}function +bi(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,bf(a[1],b)];case -1:return[1,bf(a[1],b)];case -2:return[2,bf(a[1],b)];case -3:return[3,bf(a[1],b)];case -4:return[4,bf(a[1],b)];case -5:return[5,bf(a[1],b)];case -6:return[6,bf(a[1],b)];case -7:return[7,bf(a[1],b)];case +0:return[0,bi(a[1],b)];case +1:return[1,bi(a[1],b)];case +2:return[2,bi(a[1],b)];case +3:return[3,bi(a[1],b)];case +4:return[4,bi(a[1],b)];case +5:return[5,bi(a[1],b)];case +6:return[6,bi(a[1],b)];case +7:return[7,bi(a[1],b)];case 8:var -c=a[1];return[8,c,bf(a[2],b)];case +c=a[1];return[8,c,bi(a[2],b)];case 9:var -d=a[2],e=a[1];return[9,e,d,bf(a[3],b)];case -10:return[10,bf(a[1],b)];case -11:return[11,bf(a[1],b)];case -12:return[12,bf(a[1],b)];case -13:return[13,bf(a[1],b)];default:return[14,bf(a[1],b)]}}function -aj(a,b){if(typeof +d=a[2],e=a[1];return[9,e,d,bi(a[3],b)];case +10:return[10,bi(a[1],b)];case +11:return[11,bi(a[1],b)];case +12:return[12,bi(a[1],b)];case +13:return[13,bi(a[1],b)];default:return[14,bi(a[1],b)]}}function +am(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,aj(a[1],b)];case -1:return[1,aj(a[1],b)];case +0:return[0,am(a[1],b)];case +1:return[1,am(a[1],b)];case 2:var -c=a[1];return[2,c,aj(a[2],b)];case +c=a[1];return[2,c,am(a[2],b)];case 3:var -d=a[1];return[3,d,aj(a[2],b)];case +d=a[1];return[3,d,am(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,aj(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,am(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,aj(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,am(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,aj(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,am(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,aj(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,am(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,aj(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,am(a[4],b)];case 9:var -t=a[1];return[9,t,aj(a[2],b)];case -10:return[10,aj(a[1],b)];case +t=a[1];return[9,t,am(a[2],b)];case +10:return[10,am(a[1],b)];case 11:var -u=a[1];return[11,u,aj(a[2],b)];case +u=a[1];return[11,u,am(a[2],b)];case 12:var -v=a[1];return[12,v,aj(a[2],b)];case +v=a[1];return[12,v,am(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,aj(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,am(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,aj(a[3],b)];case -15:return[15,aj(a[1],b)];case -16:return[16,aj(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,am(a[3],b)];case +15:return[15,am(a[1],b)];case +16:return[16,am(a[1],b)];case 17:var -A=a[1];return[17,A,aj(a[2],b)];case +A=a[1];return[17,A,am(a[2],b)];case 18:var -B=a[1];return[18,B,aj(a[2],b)];case -19:return[19,aj(a[1],b)];case +B=a[1];return[18,B,am(a[2],b)];case +19:return[19,am(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,aj(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,am(a[3],b)];case 21:var -E=a[1];return[21,E,aj(a[2],b)];case -22:return[22,aj(a[1],b)];case +E=a[1];return[21,E,am(a[2],b)];case +22:return[22,am(a[1],b)];case 23:var -F=a[1];return[23,F,aj(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,aj(a[3],b)]}}function -eA(a){throw i([0,eB,a],1)}function -P(a){throw i([0,fS,a],1)}var -kw=[L,sK,a5(0)];function -kB(a,b){return NG(a,b)?a:b}function -eC(a){return 0<=a?a:-a|0}var -fT=b8;function -a7(a,b){return a+b}function -hN(a){return e+a}function -sW(b){var +F=a[1];return[23,F,am(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,am(a[3],b)]}}function +eD(a){throw i([0,eE,a],1)}function +L(a){throw i([0,fU,a],1)}var +kI=[J,s6,a4(0)];function +kN(a,b){return OQ(a,b)?a:b}function +eF(a){return 0<=a?a:-a|0}var +fV=b9;function +aV(a,b){return a+b}function +hZ(a){return e+a}function +tg(b){var e=m(b);return function(a){var -c=a;for(;;){if(e<=c)return a7(b,sX);var -d=ai(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function -kC(a,b){if(!a)return b;var +c=a;for(;;){if(e<=c)return aV(b,th);var +d=ag(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function +kO(a,b){if(!a)return b;var c=a[2],d=a[1];if(!c)return[0,d,b];var e=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var -g=[0,e[1],bD];sZ(g,1,e[2],b);return[0,d,[0,f,g]]}function -sZ(a,b,c,d){var +g=[0,e[1],b5];tj(g,1,e[2],b);return[0,d,[0,f,g]]}function +tj(a,b,c,d){var f=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var h=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var j=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var -l=[0,j[1],bD],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}NQ(0);var -hO=st(1),b2=st(2);function -eD(a,b){kp(a,b,0,m(b));return}function -kD(a,b,c,d){if(0<=c&&0<=d&&(m(b)-d|0)>=c)return kp(a,b,c,d);return P(s0)}function -kE(a){eD(b2,a);su(b2,10);return dK(b2)}var -hP=[0,function(a){return function(a){var +l=[0,j[1],b5],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}O2(0);var +h0=sO(1),b0=sO(2);function +eG(a,b){kC(a,b,0,m(b))}function +kP(a,b,c,d){if(0<=c&&0<=d&&(m(b)-d|0)>=c)return kC(a,b,c,d);return L(tk)}function +kQ(a){eG(b0,a);sP(b0,10);return dO(b0)}var +h1=[0,function(a){return function(a){var b=a;for(;;){if(!b)return 0;var -d=b[2],e=b[1];try{dK(e)}catch(f){var -c=an(f);if(c[1]!==kz)throw i(c,0)}b=d}}(NR(0))}],kF=[0,function(a){return}];function -hQ(a){g(kF[1],0);return g(j$(hP),0)}kt(o1,hQ);function -eE(a){return dK(a)}function -sL(a,b){return Nk(a,b)?a:b}var -sM=-2147483648,sO=et(sN),sQ=et(sP),sS=et(sR);function -sT(a){return a?sU:sV}function -sY(a){return sW(kf("%.12g",a))}function -s1(a,b,c,d){if(0<=c&&0<=d&&(aR(b)-d|0)>=c)return NO(a,b,c,d);return P(s2)}function -s3(c){for(;;){var -a=j$(hP);let +d=b[2],e=b[1];try{dO(e)}catch(f){var +c=al(f);if(c[1]!==kL)throw i(c,0)}b=d}}(O3(0))}],kR=[0,function(a){}];function +h2(a){g(kR[1],0);return g(km(h1),0)}kF(pi,h2);function +eH(a){return dO(a)}function +s7(a,b){return Ou(a,b)?a:b}var +s8=-2147483648,s_=ev(s9),ta=ev(s$),tc=ev(tb);function +td(a){return a?te:tf}function +ti(a){return tg(ks("%.12g",a))}function +tl(a,b,c,d){if(0<=c&&0<=d&&(aU(b)-d|0)>=c)return O0(a,b,c,d);return L(tm)}function +tn(c){for(;;){var +a=km(h1);let d=[0,1],e=a;var -b=1-j_(hP,a,function(a){if(j_(d,1,0))g(c,0);return g(e,0)});if(!b)return b}}function -s4(a,b){su(a,b);return}var -hR=N2(0),eF=(4*hR|0)-1|0;function -kG(a){return 1-(typeof +b=1-kl(h1,a,function(a){if(kl(d,1,0))g(c,0);return g(e,0)});if(!b)return b}}function +to(a,b){sP(a,b)}var +h3=Pd(0),eI=(4*h3|0)-1|0;function +tp(a){return 1-(typeof a==="number"?1:0)}function -kH(a,b,c){return j_(a,b,c)}function -eG(a){return j$(a)}function -eH(a){return[0,a]}function -s5(a,b){return M0(a,b)}function -hS(a,b){return b?[0,g(a,b[1])]:0}function -s6(a,b){return 0===b[0]?[0,g(a,b[1])]:b}function -au(a){if(0<=a&&c_>=a)return a;return P(s7)}function -tf(a,b){return a-b|0}function -kI(a,b){return 0===tf(a,b)?1:0}function -s8(a){a:{if(40<=a){if(92===a)return s9;if(cK>a)break a}else{if(32<=a){if(39<=a)return s_;break a}if(14>a)switch(a){case -8:return s$;case -9:return ta;case -10:return tb;case -13:return tc}}var -b=am(4);al(b,0,92);al(b,1,48+(a/g4|0)|0);al(b,2,48+((a/10|0)%10|0)|0);al(b,3,48+(a%10|0)|0);return hJ(b)}var -c=am(1);al(c,0,a);return hJ(c)}function -td(a){return 25>>0?a:a+32|0}function -te(a){return 25>>0?a:a-32|0}function -tg(a){return a7(fK(rE,a),th)}function -ti(a){var +kS(a,b,c){return kl(a,b,c)}function +eJ(a){return km(a)}function +eK(a){return[0,a]}function +tq(a,b){return N_(a,b)}function +h4(a,b){return b?[0,g(a,b[1])]:0}function +tr(a,b){return 0===b[0]?[0,g(a,b[1])]:b}function +av(a){if(0<=a&&dd>=a)return a;return L(ts)}function +h5(a){return 25>>0?a:a+32|0}function +tB(a,b){return a-b|0}function +h6(a,b){return 0===tB(a,b)?1:0}function +tt(a){a:{if(40<=a){if(92===a)return tu;if(cP>a)break a}else{if(32<=a){if(39<=a)return tv;break a}if(14>a)switch(a){case +8:return tw;case +9:return tx;case +10:return ty;case +13:return tz}}var +b=ap(4);ao(b,0,92);ao(b,1,48+(a/fp|0)|0);ao(b,2,48+((a/10|0)%10|0)|0);ao(b,3,48+(a%10|0)|0);return hU(b)}var +c=ap(1);ao(c,0,a);return hU(c)}function +tA(a){return 25>>0?a:a-32|0}function +tC(a){return aV(fP(rZ,a),tD)}function +tE(a){var b=0<=a?1:0,c=b?a<=55295?1:0:b;if(c)var d=c;else var -e=57344<=a?1:0,d=e?a<=oS?1:0:e;return d}function -hT(a){return ti(a)?a:P(tg(a))}function -Q(a){return a<<24|rb}function -br(a){return a}function -bH(a){return a}function -tj(a){return 1===(a>>>27|0)?1:0}function -tk(a){return(a>>>24|0)&7}function -tl(a){return a&16777215}function -tm(a,b){return(8|a)<<24|b}function -tn(a,b){var +e=57344<=a?1:0,d=e?a<=pa?1:0:e;return d}function +h7(a){return tE(a)?a:L(tC(a))}function +N(a){return a<<24|rv}function +by(a){return a}function +bK(a){return a}function +tF(a){return 1===(a>>>27|0)?1:0}function +tG(a){return(a>>>24|0)&7}function +tH(a){return a&16777215}function +tI(a,b){return(8|a)<<24|b}function +tJ(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -hU(a){return tn(0,a)}function -eI(a,b){var +kT(a){return tJ(0,a)}function +eL(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[1],d];c=c[2];d=e}}function -bI(a){return eI(a,0)}function -tq(a,b,c){if(b>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var -a=hU(b);return 2<=a?h(a,b)[1]:b}function -kN(a,b){return a<=b?a:b}function -tC(a,b){return kn(a,b)}function -tD(a,b){return b<=a?a:b}function -tE(a){return e+a}function -dj(a,b){var -c=am(a);Ng(c,0,a,b);return c}var -fU=am(0);function -tF(a){var -b=aR(a),c=am(b);b$(a,0,c,0,b);return c}function -fV(a,b,c){if(0<=b&&0<=c&&(aR(a)-c|0)>=b){var -d=am(c);b$(a,b,d,0,c);return d}return P(tH)}function -dM(a,b,c){return hJ(fV(a,b,c))}function -kO(a,b,c,d,e){if(0<=e&&0<=b&&(aR(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){b$(a,b,c,d,e);return}return P(tI)}function -cc(a,b,c,d,e){if(0<=e&&0<=b&&(m(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){de(a,b,c,d,e);return}return P(tJ)}function -kP(a){var +a=kT(b);return 2<=a?h(a,b)[1]:b}function +tY(a,b){return kA(a,b)}function +tZ(a,b){return a<=b?a:b}function +t0(a,b){return b<=a?a:b}function +t1(a){return e+a}function +dq(a,b){var +c=ap(a);Oq(c,0,a,b);return c}var +fX=ap(0);function +t2(a){var +b=aU(a),c=ap(b);b$(a,0,c,0,b);return c}function +fY(a,b,c){if(0<=b&&0<=c&&(aU(a)-c|0)>=b){var +d=ap(c);b$(a,b,d,0,c);return d}return L(t4)}function +dQ(a,b,c){return hU(fY(a,b,c))}function +kX(a,b,c,d,e){if(0<=e&&0<=b&&(aU(a)-e|0)>=b&&0<=d&&(aU(c)-e|0)>=d){b$(a,b,c,d,e);return}return L(t5)}function +cd(a,b,c,d,e){if(0<=e&&0<=b&&(m(a)-e|0)>=b&&0<=d&&(aU(c)-e|0)>=d){dl(a,b,c,d,e);return}return L(t6)}function +kY(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -kQ(a,b){var -d=aR(b);if(0===d)return b;var -e=am(d),f=d-1|0,h=0;if(f>=0){var -c=h;for(;;){al(e,c,g(a,cU(b,c)));var +kZ(a,b){var +d=aU(b);if(0===d)return b;var +e=ap(d),f=d-1|0,h=0;if(f>=0){var +c=h;for(;;){ao(e,c,g(a,cA(b,c)));var i=c+1|0;if(f===c)break;c=i}}return e}function -fW(a,b,c){cw(a,b,c);return}function -cY(a,b){return tm(a,bH(b))}function -b3(a){return 2!==(a>>>6|0)?1:0}function -tR(a){return 5!==(a>>>5|0)?1:0}function -tS(a){return 4!==(a>>>5|0)?1:0}function -tT(a){var -b=a>>4|0)?1:0}function -tV(a,b){return(a&31)<<6|b&63}function -hV(a,b,c){return(a&15)<<12|(b&63)<<6|c&63}function -hW(a,b,c,d){return(a&7)<<18|(b&63)<<12|(c&63)<<6|d&63}function -cZ(a){return df(a)}function -a8(a){return hJ(a)}function -tG(a){return tF(df(a))}function -tK(a,b){var -c=aR(a),e=aR(b),d=am(c+e|0);b$(a,0,d,0,c);b$(b,0,d,c,e);return d}function -tL(a){var -d=aR(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!kP(cU(a,b[1])))break;b[1]++}var -c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&kP(cU(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?fV(a,b[1],(c[1]-b[1]|0)+1|0):fU}}function -tM(a){var -b=[0,0],j=aR(a)-1|0,l=0;if(j>=0){var +fZ(a,b,c){cz(a,b,c)}function +c1(a,b){return tI(a,bK(b))}function +b1(a){return 2!==(a>>>6|0)?1:0}function +uc(a){return 5!==(a>>>5|0)?1:0}function +ud(a){return 4!==(a>>>5|0)?1:0}function +ue(a){var +b=a>>4|0)?1:0}function +ug(a,b){return(a&31)<<6|b&63}function +h9(a,b,c){return(a&15)<<12|(b&63)<<6|c&63}function +h_(a,b,c,d){return(a&7)<<18|(b&63)<<12|(c&63)<<6|d&63}function +c2(a){return dm(a)}function +a$(a){return hU(a)}function +t3(a){return t2(dm(a))}function +t7(a,b){var +c=aU(a),e=aU(b),d=ap(c+e|0);b$(a,0,d,0,c);b$(b,0,d,c,e);return d}function +t8(a){var +d=aU(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!kY(cA(a,b[1])))break;b[1]++}var +c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&kY(cA(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?fY(a,b[1],(c[1]-b[1]|0)+1|0):fX}}function +t9(a){var +b=[0,0],j=aU(a)-1|0,l=0;if(j>=0){var g=l;for(;;){var -e=cU(a,g);a:{b:{c:{if(32<=e){var +e=cA(a,g);a:{b:{c:{if(32<=e){var h=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var i=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var i=4;break a}var i=2}b[1]=b[1]+i|0;var -o=g+1|0;if(j===g)break;g=o}}if(b[1]===aR(a))return a;var -c=am(b[1]);b[1]=0;var -k=aR(a)-1|0,m=0;if(k>=0){var +o=g+1|0;if(j===g)break;g=o}}if(b[1]===aU(a))return a;var +c=ap(b[1]);b[1]=0;var +k=aU(a)-1|0,m=0;if(k>=0){var f=m;for(;;){var -d=cU(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(cK<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case -8:al(c,b[1],92);b[1]++;al(c,b[1],98);break a;case -9:al(c,b[1],92);b[1]++;al(c,b[1],116);break a;case -10:al(c,b[1],92);b[1]++;al(c,b[1],110);break a;case -13:al(c,b[1],92);b[1]++;al(c,b[1],114);break a;default:break c}}if(34>d)break b}al(c,b[1],92);b[1]++;al(c,b[1],d);break a}al(c,b[1],92);b[1]++;al(c,b[1],48+(d/g4|0)|0);b[1]++;al(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;al(c,b[1],48+(d%10|0)|0);break a}al(c,b[1],d)}b[1]++;var +d=cA(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(cP<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case +8:ao(c,b[1],92);b[1]++;ao(c,b[1],98);break a;case +9:ao(c,b[1],92);b[1]++;ao(c,b[1],116);break a;case +10:ao(c,b[1],92);b[1]++;ao(c,b[1],110);break a;case +13:ao(c,b[1],92);b[1]++;ao(c,b[1],ox);break a;default:break c}}if(34>d)break b}ao(c,b[1],92);b[1]++;ao(c,b[1],d);break a}ao(c,b[1],92);b[1]++;ao(c,b[1],48+(d/fp|0)|0);b[1]++;ao(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;ao(c,b[1],48+(d%10|0)|0);break a}ao(c,b[1],d)}b[1]++;var n=f+1|0;if(k===f)break;f=n}}return c}function -tN(a){return kQ(te,a)}function -tO(a){return kQ(td,a)}function -tP(a,b){return M_(a,b)}function -tQ(a,b,c){M$(a,b,c);return}function -tW(a,b){var -e=fG(a,b);function -c(a,b){return cU(a,b)}var -d=aR(a)-1|0;a:{if(ep<=e){if(hf<=e){if(jV<=e)break a;switch(e-237|0){case +t_(a){return kZ(tA,a)}function +t$(a){return kZ(h5,a)}function +ua(a,b){return Oi(a,b)}function +ub(a,b,c){Oj(a,b,c)}function +uh(a,b){var +e=fL(a,b);function +c(a,b){return cA(a,b)}var +d=aU(a)-1|0;a:{if(er<=e){if(hn<=e){if(j8<=e)break a;switch(e-237|0){case 0:var -f=b+1|0;if(de){var -n=b+1|0;if(de)return cY(1,e);if(pE<=e){var -J=b+1|0;if(dd)throw i([0,u,tZ],1);if(cK>=d){fW(a,b,d);return 1}if(je>=d){var -j=b+1|0;return f>>6|0),e(a,j,M|d&63),2)}if(qb>=d){var -h=b+2|0;return f>>12|0),e(a,b+1|0,M|(d>>>6|0)&63),e(a,h,M|d&63),3)}if(oS>>18|0),e(a,b+1|0,M|(d>>>12|0)&63),e(a,b+2|0,M|(d>>>6|0)&63),e(a,g,M|d&63),4)}function -eL(a,b){return a8(dj(a,b))}function -fX(a,b,c){return a8(fV(cZ(a),b,c))}function -t0(a,b){return b<=a?a:P(t1)}function -t2(a,b,c){var +j=b+1|0;if(de){var +n=b+1|0;if(de)return c1(1,e);if(pZ<=e){var +J=b+1|0;if(dd)throw i([0,u,uk],1);if(cP>=d){fZ(a,b,d);return 1}if(jp>=d){var +j=b+1|0;return f>>6|0),e(a,j,K|d&63),2)}if(qw>=d){var +h=b+2|0;return f>>12|0),e(a,b+1|0,K|(d>>>6|0)&63),e(a,h,K|d&63),3)}if(pa>>18|0),e(a,b+1|0,K|(d>>>12|0)&63),e(a,b+2|0,K|(d>>>6|0)&63),e(a,g,K|d&63),4)}function +eM(a,b){return a$(dq(a,b))}function +f0(a,b,c){return a$(fY(c2(a),b,c))}function +ul(a,b){return b<=a?a:L(um)}function +un(a,b,c){var e=a,d=c;for(;;){if(!d)return e;var f=d[1];if(!d[2])return m(f)+e|0;var -g=d[2];e=t0((m(f)+b|0)+e|0,e);d=g}}function -t3(a,b,c,d,e){var +g=d[2];e=ul((m(f)+b|0)+e|0,e);d=g}}function +uo(a,b,c,d,e){var h=b,g=e;for(;;){if(!g)return a;var -f=g[1];if(!g[2]){de(f,0,a,h,m(f));return a}var -i=g[2];de(f,0,a,h,m(f));de(c,0,a,h+m(f)|0,d);h=(h+m(f)|0)+d|0;g=i}}function -fY(a,b){if(!b)return t4;var -c=m(a);return a8(t3(am(t2(0,c,b)),0,a,c,b))}function -kR(a){var +f=g[1];if(!g[2]){dl(f,0,a,h,m(f));return a}var +i=g[2];dl(f,0,a,h,m(f));dl(c,0,a,h+m(f)|0,d);h=(h+m(f)|0)+d|0;g=i}}function +f1(a,b){if(!b)return up;var +c=m(a);return a$(uo(ap(un(0,c,b)),0,a,c,b))}function +k0(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -kS(a,b,c,d){var -e=c;for(;;){if(b<=e)throw i(bG,1);if(a6(a,e)===d)return e;e=e+1|0}}function -t_(a,b,c){var -d=m(a);if(0<=b&&d>=b)try{kS(a,d,b,c);var +k1(a,b,c,d){var +e=c;for(;;){if(b<=e)throw i(bZ,1);if(bs(a,e)===d)return e;e=e+1|0}}function +uv(a,b,c){var +d=m(a);if(0<=b&&d>=b)try{k1(a,d,b,c);var f=1;return f}catch(f){var -e=an(f);if(e===bG)return 0;throw i(e,0)}return P(t$)}function -hX(a){return a8(tO(cZ(a)))}function -kT(a,b){var +e=al(f);if(e===bZ)return 0;throw i(e,0)}return L(uw)}function +h$(a){return a$(t$(c2(a)))}function +eN(a,b){var d=[0,0],e=[0,m(b)],f=m(b)-1|0;if(f>=0){var -c=f;for(;;){if(a6(b,c)===a){var -h=d[1];d[1]=[0,fX(b,c+1|0,(e[1]-c|0)-1|0),h];e[1]=c}var +c=f;for(;;){if(bs(b,c)===a){var +h=d[1];d[1]=[0,f0(b,c+1|0,(e[1]-c|0)-1|0),h];e[1]=c}var i=c-1|0;if(0===c)break;c=i}}var -g=d[1];return[0,fX(b,0,e[1]),g]}function -hY(a,b){return bE(a,b)}function -fZ(a,b){return tP(cZ(a),b)}function -kU(a,b){return a==b?1:0}function -t5(a,b){var +g=d[1];return[0,f0(b,0,e[1]),g]}function +ia(a,b){return bI(a,b)}function +f2(a,b){return ua(c2(a),b)}function +ib(a,b){return a===b?1:0}function +uq(a,b){var d=m(b)-1|0,e=0;if(d>=0){var -c=e;for(;;){g(a,a6(b,c));var -f=c+1|0;if(d===c)break;c=f}}return}function -t6(a){if(a==e)return a;if(!kR(a6(a,0))&&!kR(a6(a,m(a)-1|0)))return a;return a8(tL(cZ(a)))}function -t7(a){return a8(tM(cZ(a)))}function -t8(a,b,c){var -d=m(a);if(0<=b&&d>=b)return kS(a,d,b,c);return P(t9)}function -ua(a,b){return t_(a,0,b)}function -ub(a){return a8(tN(cZ(a)))}function -uc(a,b){return tW(cZ(a),b)}function -kV(a,b){var +c=e;for(;;){g(a,bs(b,c));var +f=c+1|0;if(d===c)break;c=f}}}function +ur(a){if(a===e)return a;if(!k0(bs(a,0))&&!k0(bs(a,m(a)-1|0)))return a;return a$(t8(c2(a)))}function +us(a){return a$(t9(c2(a)))}function +ut(a,b,c){var +d=m(a);if(0<=b&&d>=b)return k1(a,d,b,c);return L(uu)}function +ux(a,b){return uv(a,0,b)}function +uy(a){return a$(t_(c2(a)))}function +uz(a,b){return uh(c2(a),b)}function +k2(a,b){var d=b.length-1;if(0===d)return[0];var -e=cx(d,g(a,b[1])),f=d-1|0,h=1;if(f>=1){var +e=cB(d,g(a,b[1])),f=d-1|0,h=1;if(f>=1){var c=h;for(;;){e[1+c]=g(a,b[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -uk(a,b){var +uH(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -hZ(a){if(!a)return[0];var -b=a[2],c=a[1],e=cx(uk(0,a),c);return function(a,b){var +ic(a){if(!a)return[0];var +b=a[2],c=a[1],e=cB(uH(0,a),c);return function(a,b){var d=a,c=b;for(;;){if(!c)return e;var -f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}var -h0=[L,um,a5(0)];function -ud(a,b){if(0===a)return[0];if(0>a)return P(ue);var -d=cx(a,g(b,0)),e=a-1|0,f=1;if(e>=1){var +f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function +k3(a,b,c){var +e=[0,b],f=c.length-2|0,g=0;if(f>=0){var +d=g;for(;;){e[1]=j(a,e[1],c[1+d]);var +h=d+1|0;if(f===d)break;d=h}}return e[1]}var +id=[J,uI,a4(0)];function +uA(a,b){if(0===a)return[0];if(0>a)return L(uB);var +d=cB(a,g(b,0)),e=a-1|0,f=1;if(e>=1){var c=f;for(;;){d[1+c]=g(b,c);var h=c+1|0;if(e===c)break;c=h}}return d}function -uf(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){MZ(a,b,c,d,e);return}return P(ug)}function -uh(a,b){var +uC(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){N8(a,b,c,d,e);return}return L(uD)}function +uE(a,b){var d=b.length-2|0,e=0;if(d>=0){var c=e;for(;;){g(a,b[1+c]);var -f=c+1|0;if(d===c)break;c=f}}return}function -ui(a,b,c){var -e=b.length-1;if(e!==c.length-1)return P(uj);if(0===e)return[0];var -f=cx(e,j(a,b[1],c[1])),g=e-1|0,h=1;if(g>=1){var +f=c+1|0;if(d===c)break;c=f}}}function +uF(a,b,c){var +e=b.length-1;if(e!==c.length-1)return L(uG);if(0===e)return[0];var +f=cB(e,j(a,b[1],c[1])),g=e-1|0,h=1;if(g>=1){var d=h;for(;;){f[1+d]=j(a,b[1+d],c[1+d]);var i=d+1|0;if(g===d)break;d=i}}return f}function -ul(a,b,c){var -e=[0,b],f=c.length-2|0,g=0;if(f>=0){var -d=g;for(;;){e[1]=j(a,e[1],c[1+d]);var -h=d+1|0;if(f===d)break;d=h}}return e[1]}function -un(f,d){function +uJ(f,d){function h(a,b){var c=((b+b|0)+b|0)+1|0,e=[0,c];if((c+2|0)j(f,p(d,c)[1+c],o))return c+1|0}if(cj(f,q(d,c)[1+c],o))return c+1|0}if(c=j(f,p(d,g)[1+g],c)){p(d,e)[1+e]=c;return}var -i=p(d,g)[1+g];p(d,e)[1+e]=i;e=g}}function +g=h(a,e);if(0>=j(f,q(d,g)[1+g],c)){q(d,e)[1+e]=c;return}var +i=q(d,g)[1+g];q(d,e)[1+e]=i;e=g}}function m(a,b){var c=b;for(;;){var -e=h(a,c),f=p(d,e)[1+e];p(d,c)[1+c]=f;c=e}}var +e=h(a,c),f=q(d,e)[1+e];q(d,c)[1+c]=f;c=e}}var c=d.length-1,e=((c+1|0)/3|0)-1|0;function l(a,b,c){try{k(a,b,c);return}catch(f){var -e=an(f);if(e[1]!==h0)throw i(e,0);var -g=e[2];p(d,g)[1+g]=c;return}}function +e=al(f);if(e[1]!==id)throw i(e,0);var +g=e[2];q(d,g)[1+g]=c;return}}function n(a,b){try{var d=m(a,b);return d}catch(f){var -c=an(f);if(c[1]===h0)return c[2];throw i(c,0)}}function +c=al(f);if(c[1]===id)return c[2];throw i(c,0)}}function o(a,b){var c=a;for(;;){var -e=(c-1|0)/3|0;if(c===e)throw i([0,u,uo],1);if(0<=j(f,p(d,e)[1+e],b)){p(d,c)[1+c]=b;return}var -g=p(d,e)[1+e];p(d,c)[1+c]=g;if(0>=e){p(d,0)[1]=b;return}c=e}}if(e>=0){var -b=e;for(;;){l(c,b,p(d,b)[1+b]);var +e=(c-1|0)/3|0;if(c===e)throw i([0,u,uK],1);if(0<=j(f,q(d,e)[1+e],b)){q(d,c)[1+c]=b;return}var +g=q(d,e)[1+e];q(d,c)[1+c]=g;if(0>=e){q(d,0)[1]=b;return}c=e}}if(e>=0){var +b=e;for(;;){l(c,b,q(d,b)[1+b]);var t=b-1|0;if(0===b)break;b=t}}var g=c-1|0;if(g>=2){var a=g;for(;;){var -r=p(d,a)[1+a];d[1+a]=p(d,0)[1];o(n(a,0),r);var +r=q(d,a)[1+a];d[1+a]=q(d,0)[1];o(n(a,0),r);var s=a-1|0;if(2===a)break;a=s}}if(1=i){var -v=i<=g?g+1|0:i+1|0;return[0,a,b,c,v]}if(!c)return P(ux);var -k=c[3],m=c[2],f=c[1],r=h(f);if(r<=h(k))return d(d(a,b,f),m,k);if(!f)return P(uw);var +h=a?a[4]:0,i=c?c[4]:0;if((i+2|0)=i){var +v=i<=h?h+1|0:i+1|0;return[0,a,b,c,v]}if(!c)return L(uT);var +k=c[3],m=c[2],f=c[1],r=g(f);if(r<=g(k))return d(d(a,b,f),m,k);if(!f)return L(uS);var s=f[2],t=f[1],u=d(f[3],m,k);return d(d(a,b,t),s,u)}function c(a,b){if(!b)return[0,0,a,0,1];var -d=b[3],e=b[2],g=b[1],h=j(l[1],a,e);if(0===h)return b;if(0<=h){var +d=b[3],e=b[2],g=b[1],h=j(k[1],a,e);if(0===h)return b;if(0<=h){var i=c(a,d);return d===i?b:f(g,e,i)}var -k=c(a,g);return g===k?b:f(k,e,d)}function +l=c(a,g);return g===l?b:f(l,e,d)}function e(a){return[0,0,a,0,1]}function +m(a,b){if(!b)return e(a);var +c=b[3],d=b[2];return f(m(a,b[1]),d,c)}function n(a,b){if(!b)return e(a);var -c=b[3],d=b[2];return f(n(a,b[1]),d,c)}function -o(a,b){if(!b)return e(a);var -c=b[2],d=b[1];return f(d,c,o(a,b[3]))}function -k(a,b,c){if(!a)return n(b,c);if(!c)return o(b,a);var -e=c[4],g=a[4],h=c[3],i=c[2],j=c[1],l=a[3],m=a[2],p=a[1];return(e+2|0)=a>>>0)switch(a){case 0:return[0,0,b];case 1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case @@ -1517,264 +1499,235 @@ c(a,b){if(3>=a>>>0)switch(a){case f=b[2];if(f)return[0,[0,[0,0,b[1],0,1],f[1],0,2],f[2]]}break;default:if(b){var g=b[2];if(g){var h=g[2];if(h)return[0,[0,[0,0,b[1],0,1],g[1],[0,0,h[1],0,1],2],h[2]]}}}var -j=a/2|0,k=c(j,b),e=k[2],m=k[1];if(!e)throw i([0,u,uy],1);var -n=e[1],l=c((a-j|0)-1|0,e[2]),o=l[2];return[0,d(m,n,l[1]),o]}return c(hU(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,p,function(a){return a?0:1},,,,,,q,,,,,,,r,,,,,,,,function(a){return s(0,a)},,,,,,,,,,,function(a,b){var -c=b;for(;;){if(!c)return;var -d=c[2],e=c[3],f=c[1];if(g(a,d))return t(d,a,e);c=f}},,,,,,,,function(a){if(!a)return p;var +j=a/2|0,k=c(j,b),e=k[2],m=k[1];if(!e)throw i([0,u,uU],1);var +n=e[1],l=c((a-j|0)-1|0,e[2]),o=l[2];return[0,d(m,n,l[1]),o]}return c(kT(a),a)[1]}return[0,,,,,,,,,,,,,,,,,,function(a){return a?0:1},,,,,,o,,,,,,,,,,,,,,,function(a){return p(0,a)},,,,,,,,,,,,,,,,,,,function(a){if(!a)return q;var f=a[2],b=a[1];if(!f)return e(b);var g=f[2],d=f[1];if(!g)return c(d,e(b));var h=g[2],i=g[1];if(!h)return c(i,c(d,e(b)));var -j=h[2],k=h[1];if(!j)return c(k,c(i,c(d,e(b))));if(j[2])return v(tB(l[1],a));var -m=j[1];return c(m,c(k,c(i,c(d,e(b)))))}]}function -kX(a){var -b=ut(a);return[0,b[17],b[4],,,,,b[24],,,b[39],,,,,,,,,,,,b[50],b[31],,,,,,,b[18],,,,,,,,b[58]]}function -uz(d){function +j=h[2],l=h[1];if(!j)return c(l,c(i,c(d,e(b))));if(j[2])return r(tX(k[1],a));var +m=j[1];return c(m,c(l,c(i,c(d,e(b)))))}]}function +k5(a){var +b=uP(a);return[0,,,,,,,b[24],,,b[39],,,,,,,,,,,,,,,,,,,,b[18],,,,,,,,b[58]]}function +uV(k){function h(a){return a?a[5]:0}function e(a,b,c,d){var e=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function -q(a,b){return[0,0,a,b,0,1]}function -f(a,b,c,d){var -i=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var -A=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,A]}if(!d)return P(uD);var -l=d[4],o=d[3],p=d[2],g=d[1],v=h(g);if(v<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return P(uC);var +A=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,A]}if(!d)return L(uZ);var +l=d[4],o=d[3],p=d[2],g=d[1],v=h(g);if(v<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return L(uY);var w=g[3],x=g[2],y=g[1],z=e(g[4],p,o,l);return e(e(a,b,c,y),x,w,z)}function -n(a,b,c){if(!c)return[0,0,a,b,0,1];var -e=c[4],h=c[3],i=c[2],g=c[1],o=c[5],k=j(d[1],a,i);if(0===k)return h===b?c:[0,g,a,b,e,o];if(0<=k){var -l=n(a,b,e);return e===l?c:f(g,i,h,l)}var -m=n(a,b,g);return g===m?c:f(m,i,h,e)}function -r(a){var -b=a;for(;;){if(!b)throw i(bG,1);var +l(a,b,c){if(!c)return[0,0,a,b,0,1];var +e=c[4],g=c[3],h=c[2],f=c[1],o=c[5],i=j(k[1],a,h);if(0===i)return g===b?c:[0,f,a,b,e,o];if(0<=i){var +m=l(a,b,e);return e===m?c:d(f,h,g,m)}var +n=l(a,b,f);return f===n?c:d(n,h,g,e)}function +n(a){var +b=a;for(;;){if(!b)throw i(bZ,1);var c=b[1];if(!c)return[0,b[2],b[3]];b=c}}function -c(a){if(!a)return P(uE);var +f(a){if(!a)return L(u0);var b=a[1];if(!b)return a[4];var -d=a[4],e=a[3],g=a[2];return f(c(b),g,e,d)}function -y(a,b){if(!a)return b;if(!b)return a;var -d=r(b),e=d[2],g=d[1];return f(a,g,e,c(b))}function -o(a,b,c){if(!c){var +c=a[4],e=a[3],g=a[2];return d(f(b),g,e,c)}function +s(a,b){if(!a)return b;if(!b)return a;var +c=n(b),e=c[2],g=c[1];return d(a,g,e,f(b))}function +m(a,b,c){if(!c){var r=g(b,0);return r?[0,0,a,r[1],0,1]:0}var -e=c[4],i=c[3],k=c[2],h=c[1],s=c[5],l=j(d[1],a,k);if(0===l){var -m=g(b,[0,i]);if(!m)return y(h,e);var -n=m[1];return i===n?c:[0,h,a,n,e,s]}if(0<=l){var -p=o(a,b,e);return e===p?c:f(h,k,i,p)}var -q=o(a,b,h);return h===q?c:f(q,k,i,e)}function -s(a,b){var -c=b;for(;;){if(!c)return;var -d=c[4],e=c[3],f=c[2];s(a,c[1]);j(a,f,e);c=d}}function -p(a,b){if(!b)return 0;var -c=b[2],d=b[5],e=b[4],f=b[3],g=p(a,b[1]),h=j(a,c,f);return[0,g,c,h,p(a,e),d]}function -t(a,b,c){var -d=b,e=c;for(;;){if(!d)return e;var -f=d[4],g=d[3],h=d[2],i=bT(a,h,g,t(a,d[1],e));d=f;e=i}}function -v(a,b,c){if(!c)return q(a,b);var -d=c[4],e=c[3],g=c[2];return f(v(a,b,c[1]),g,e,d)}function -w(a,b,c){if(!c)return q(a,b);var -d=c[3],e=c[2],g=c[1];return f(g,e,d,w(a,b,c[4]))}function -k(a,b,c,d){if(!a)return v(b,c,d);if(!d)return w(b,c,a);var -g=d[5],h=a[5],i=d[4],j=d[3],l=d[2],m=d[1],n=a[4],o=a[3],p=a[2],q=a[1];return(g+2|0)=(d+b|0))break;c[1]=2*c[1]|0}if(eF=(d+b|0))break;c[1]=2*c[1]|0}if(eI=b)return dM(a[1][1],b,c);return P(uN)}function -uO(a){a[2]=0;a[1]=[0,a[3],aR(a[3])];return}function -uR(a,b,c,d){return dQ(a,a8(b),c,d)}var -h4=[0,0];function -k5(a){return a}function -k6(a){return a!==h4?1:0}function -k7(a){return a}(function(a){Nd(cx(8,h4));return}(0));var -uS=eH(0),k8=eH(0);function -uT(a){for(;;){var -b=eG(k8),c=1-kH(k8,b,[0,a,b]);if(!c)return c}}function -cz(a,b){var -c=[0,s5(uS,1),b];if(a)uT([0,c,a[1]]);return c}function -k9(d){for(;;){var -a=se(0),b=a.length-1;if(d=b)return dQ(a[1][1],b,c);return L(u7)}function +u8(a){a[2]=0;a[1]=[0,a[3],aU(a[3])]}function +u$(a,b,c,d){return dV(a,a$(b),c,d)}var +ij=[0,0];function +k$(a){return a}function +la(a){return a!==ij?1:0}function +lb(a){return a}(function(a){On(cB(8,ij))}(0));var +va=eK(0),lc=eK(0);function +vb(a){for(;;){var +b=eJ(lc),c=1-kS(lc,b,[0,a,b]);if(!c)return c}}function +cE(a,b){var +c=[0,tq(va,1),b];if(a)vb([0,c,a[1]]);return c}function +ld(d){for(;;){var +a=sz(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e-43|0){case -5:c:if(c<(d+2|0)&&1e){if(32!==e){if(43>e)break a;switch(e-43|0){case +5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var -f=dj(d+1|0,48);cw(f,0,e);cc(b,1,f,(d-c|0)+2|0,c-1|0);return a8(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(c>>0)break a}else if(65>e)break a}if(ca)return b;var +14:return wM;default:return wV}}function +lj(a,b){var +d=eF(b),e=vh(wW,a),c=lf(16);dW(c,37);vi(c,a);dW(c,46);a6(c,t1(d));dW(c,e);return lh(c)}function +f5(a,b){if(13>a)return b;var h=[0,0],i=m(b)-1|0,o=0;if(i>=0){var -d=o;for(;;){if(9>=a6(b,d)+fA>>>0)h[1]++;var +d=o;for(;;){if(9>=bs(b,d)+fE>>>0)h[1]++;var r=d+1|0;if(i===d)break;d=r}}var -j=h[1],k=am(m(b)+((j-1|0)/3|0)|0),l=[0,0];function -e(a){cw(k,l[1],a);l[1]++;return}var +j=h[1],k=ap(m(b)+((j-1|0)/3|0)|0),l=[0,0];function +e(a){cz(k,l[1],a);l[1]++}var f=[0,((j-1|0)%3|0)+1|0],n=m(b)-1|0,p=0;if(n>=0){var c=p;for(;;){var -g=a6(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var -q=c+1|0;if(n===c)break;c=q}}return a8(k)}function -wD(a,b){return f2(a,fK(vK(a),b))}function -wE(a,b){return f2(a,fK(wa(a),b))}function -wF(a,b){return f2(a,fK(wo(a),b))}function -wG(a,b){return f2(a,Nu(vY(a),b))}function -cA(d,b,c){function +g=bs(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var +q=c+1|0;if(n===c)break;c=q}}return a$(k)}function +wX(a,b){return f5(a,fP(v4(a),b))}function +wY(a,b){return f5(a,fP(wu(a),b))}function +wZ(a,b){return f5(a,fP(wI(a),b))}function +w0(a,b){return f5(a,OE(wg(a),b))}function +cF(d,b,c){function a(a){switch(d[1]){case 0:var e=45;break;case 1:var e=43;break;default:var -e=32}return Nq(c,b,e)}function +e=32}return OA(c,b,e)}function e(a){var -b=kc(c);return 3===b?c<0.?wI:wJ:4<=b?wK:a}function +b=kp(c);return 3===b?c<0.?w2:w3:4<=b?w4:a}function f(b){var e=m(b);return function(a){var c=a;for(;;){if(c===e)return 0;var -d=ai(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:a7(b,wH)}switch(d[2]){case -5:return e(f(kf(ld(d,b),c)));case +d=ag(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:aV(b,w1)}switch(d[2]){case +5:return e(f(ks(lj(d,b),c)));case 6:return a(0);case -7:return ub(a(0));case -8:return e(a(0));default:return kf(ld(d,b),c)}}function -wL(a){var -b=s8(a),c=m(b),d=dj(c+2|0,39);de(b,0,d,1,c);return a8(d)}function -wM(a){var -b=k$(16);h7(b,a);return lb(b)}function +7:return uy(a(0));case +8:return e(a(0));default:return ks(lj(d,b),c)}}function +w5(a){var +b=tt(a),c=m(b),d=dq(c+2|0,39);dl(b,0,d,1,c);return a$(d)}function +w6(a){var +b=lf(16);im(b,a);return lh(b)}function fg(a,b,c,d){var h=b,f=c,e=d;for(;;){if(typeof e==="number")return g(h,f);switch(e[0]){case 0:var -q=e[1];return function(a){return G(h,[5,f,a],q)};case +q=e[1];return function(a){return I(h,[5,f,a],q)};case 1:var -r=e[1];return function(a){return G(h,[4,f,wL(a)],r)};case -2:return h8(h,f,e[2],e[1],function(a){return a});case -3:return h8(h,f,e[2],e[1],vJ);case -4:return f3(h,f,e[4],e[2],e[3],wD,e[1]);case -5:return f3(h,f,e[4],e[2],e[3],wE,e[1]);case -6:return f3(h,f,e[4],e[2],e[3],wF,e[1]);case -7:return f3(h,f,e[4],e[2],e[3],wG,e[1]);case -8:return wN(h,f,e[4],e[2],e[3],e[1]);case -9:return h8(h,f,e[2],e[1],sT);case +r=e[1];return function(a){return I(h,[4,f,w5(a)],r)};case +2:return io(h,f,e[2],e[1],function(a){return a});case +3:return io(h,f,e[2],e[1],v3);case +4:return f6(h,f,e[4],e[2],e[3],wX,e[1]);case +5:return f6(h,f,e[4],e[2],e[3],wY,e[1]);case +6:return f6(h,f,e[4],e[2],e[3],wZ,e[1]);case +7:return f6(h,f,e[4],e[2],e[3],w0,e[1]);case +8:return w7(h,f,e[4],e[2],e[3],e[1]);case +9:return io(h,f,e[2],e[1],td);case 10:f=[7,f];e=e[1];break;case 11:f=[2,f,e[1]];e=e[2];break;case 12:f=[3,f,e[1]];e=e[2];break;case 13:var -s=e[3],t=wM(e[2]);return function(a){return G(h,[4,f,t],s)};case +s=e[3],t=w6(e[2]);return function(a){return I(h,[4,f,t],s)};case 14:var -w=e[3],x=e[2];return function(a){return G(h,f,aj(vI(a[1],x),w))};case +w=e[3],x=e[2];return function(a){return I(h,f,am(v2(a[1],x),w))};case 15:var -y=e[1];return function(c,b){return G(h,[6,f,function(a){return j(c,a,b)}],y)};case +y=e[1];return function(c,b){return I(h,[6,f,function(a){return j(c,a,b)}],y)};case 16:var -z=e[1];return function(a){return G(h,[6,f,a],z)};case +z=e[1];return function(a){return I(h,[6,f,a],z)};case 17:f=[0,f,e[1]];e=e[2];break;case 18:var k=e[1];if(0===k[0]){let -b=f,c=h,d=e[2];h=function(a){return G(c,[1,b,[0,a]],d)};f=0;e=k[1][1]}else{let -b=f,c=h,d=e[2];h=function(a){return G(c,[1,b,[1,a]],d)};f=0;e=k[1][1]}break;case -19:throw i([0,u,wP],1);case +b=f,c=h,d=e[2];h=function(a){return I(c,[1,b,[0,a]],d)};f=0;e=k[1][1]}else{let +b=f,c=h,d=e[2];h=function(a){return I(c,[1,b,[1,a]],d)};f=0;e=k[1][1]}break;case +19:throw i([0,u,w9],1);case 20:var -A=e[3],B=[8,f,wQ];return function(a){return G(h,B,A)};case +A=e[3],B=[8,f,w_];return function(a){return I(h,B,A)};case 21:var -C=e[2];return function(a){return G(h,[4,f,fK(nO,a)],C)};case +C=e[2];return function(a){return I(h,[4,f,fP(n8,a)],C)};case 22:var -D=e[1];return function(a){return G(h,[5,f,a],D)};case +D=e[1];return function(a){return I(h,[5,f,a],D)};case 23:var -l=e[2],m=e[1];return a<50?ni(a+1|0,h,f,m,l):v(ni,[0,h,f,m,l]);default:var -n=e[3],o=e[1],p=g(e[2],0);return a<50?i8(a+1|0,h,f,n,o,p):v(i8,[0,h,f,n,o,p])}}}function -G(a,b,c){return cq(fg(0,a,b,c))}function -ni(a,b,c,d,e){if(typeof +l=e[2],m=e[1];return a<50?nB(a+1|0,h,f,m,l):v(nB,[0,h,f,m,l]);default:var +n=e[3],o=e[1],p=g(e[2],0);return a<50?ji(a+1|0,h,f,n,o,p):v(ji,[0,h,f,n,o,p])}}}function +I(a,b,c){return co(fg(0,a,b,c))}function +nB(a,b,c,d,e){if(typeof d==="number")switch(d){case -0:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -1:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -2:throw i([0,u,wR],1);default:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e])}switch(d[0]){case -0:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -1:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -2:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -3:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -4:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -5:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -6:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -7:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case -8:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +0:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +1:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +2:throw i([0,u,w$],1);default:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e])}switch(d[0]){case +0:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +1:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +2:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +3:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +4:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +5:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +6:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +7:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case +8:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);case 9:var -f=d[2];return a<50?i9(a+1|0,b,c,f,e):v(i9,[0,b,c,f,e]);case -10:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);default:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e])}}function -i9(a,f,c,d,e){if(typeof -d==="number")return a<50?Z(a+1|0,f,c,e):v(Z,[0,f,c,e]);switch(d[0]){case +f=d[2];return a<50?jj(a+1|0,b,c,f,e):v(jj,[0,b,c,f,e]);case +10:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e]);default:return a<50?$(a+1|0,b,c,e):v($,[0,b,c,e])}}function +jj(a,f,c,d,e){if(typeof +d==="number")return a<50?$(a+1|0,f,c,e):v($,[0,f,c,e]);switch(d[0]){case 0:var -b=d[1];return function(a){return bL(f,c,b,e)};case +b=d[1];return function(a){return bN(f,c,b,e)};case 1:var -g=d[1];return function(a){return bL(f,c,g,e)};case +g=d[1];return function(a){return bN(f,c,g,e)};case 2:var -h=d[1];return function(a){return bL(f,c,h,e)};case +h=d[1];return function(a){return bN(f,c,h,e)};case 3:var -j=d[1];return function(a){return bL(f,c,j,e)};case +j=d[1];return function(a){return bN(f,c,j,e)};case 4:var -k=d[1];return function(a){return bL(f,c,k,e)};case +k=d[1];return function(a){return bN(f,c,k,e)};case 5:var -l=d[1];return function(a){return bL(f,c,l,e)};case +l=d[1];return function(a){return bN(f,c,l,e)};case 6:var -m=d[1];return function(a){return bL(f,c,m,e)};case +m=d[1];return function(a){return bN(f,c,m,e)};case 7:var -n=d[1];return function(a){return bL(f,c,n,e)};case +n=d[1];return function(a){return bN(f,c,n,e)};case 8:var -o=d[2];return function(a){return bL(f,c,o,e)};case +o=d[2];return function(a){return bN(f,c,o,e)};case 9:var -p=d[3],q=d[2],r=aM(aE(d[1]),q);return function(a){return bL(f,c,bf(r,p),e)};case +p=d[3],q=d[2],r=aQ(aH(d[1]),q);return function(a){return bN(f,c,bi(r,p),e)};case 10:var -s=d[1];return function(a,b){return bL(f,c,s,e)};case +s=d[1];return function(a,b){return bN(f,c,s,e)};case 11:var -t=d[1];return function(a){return bL(f,c,t,e)};case +t=d[1];return function(a){return bN(f,c,t,e)};case 12:var -w=d[1];return function(a){return bL(f,c,w,e)};case -13:throw i([0,u,wS],1);default:throw i([0,u,wT],1)}}function -bL(a,b,c,d){return cq(i9(0,a,b,c,d))}function -Z(a,b,c,d){var -e=[8,c,wU];return a<50?fg(a+1|0,b,e,d):v(fg,[0,b,e,d])}function -h8(h,f,c,d,e){if(typeof -d==="number")return function(a){return G(h,[4,f,g(e,a)],c)};if(0===d[0]){var -b=d[2],i=d[1];return function(a){return G(h,[4,f,bu(i,b,g(e,a))],c)}}var -j=d[1];return function(a,b){return G(h,[4,f,bu(j,a,g(e,b))],c)}}function -f3(k,i,h,d,e,f,g){if(typeof +w=d[1];return function(a){return bN(f,c,w,e)};case +13:throw i([0,u,xa],1);default:throw i([0,u,xb],1)}}function +bN(a,b,c,d){return co(jj(0,a,b,c,d))}function +$(a,b,c,d){var +e=[8,c,xc];return a<50?fg(a+1|0,b,e,d):v(fg,[0,b,e,d])}function +io(h,f,c,d,e){if(typeof +d==="number")return function(a){return I(h,[4,f,g(e,a)],c)};if(0===d[0]){var +b=d[2],i=d[1];return function(a){return I(h,[4,f,bC(i,b,g(e,a))],c)}}var +j=d[1];return function(a,b){return I(h,[4,f,bC(j,a,g(e,b))],c)}}function +f6(k,i,h,d,e,f,g){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return G(k,[4,i,dS(a,j(f,g,b))],h)}:function(a){return G(k,[4,i,j(f,g,a)],h)};var -b=e[1];return function(a){return G(k,[4,i,dS(b,j(f,g,a))],h)}}if(0===d[0]){var +e==="number")return e?function(a,b){return I(k,[4,i,dX(a,j(f,g,b))],h)}:function(a){return I(k,[4,i,j(f,g,a)],h)};var +b=e[1];return function(a){return I(k,[4,i,dX(b,j(f,g,a))],h)}}if(0===d[0]){var c=d[2],l=d[1];if(typeof -e==="number")return e?function(a,b){return G(k,[4,i,bu(l,c,dS(a,j(f,g,b)))],h)}:function(a){return G(k,[4,i,bu(l,c,j(f,g,a))],h)};var -n=e[1];return function(a){return G(k,[4,i,bu(l,c,dS(n,j(f,g,a)))],h)}}var +e==="number")return e?function(a,b){return I(k,[4,i,bC(l,c,dX(a,j(f,g,b)))],h)}:function(a){return I(k,[4,i,bC(l,c,j(f,g,a))],h)};var +n=e[1];return function(a){return I(k,[4,i,bC(l,c,dX(n,j(f,g,a)))],h)}}var m=d[1];if(typeof -e==="number")return e?function(a,b,c){return G(k,[4,i,bu(m,a,dS(b,j(f,g,c)))],h)}:function(a,b){return G(k,[4,i,bu(m,a,j(f,g,b))],h)};var -o=e[1];return function(a,b){return G(k,[4,i,bu(m,a,dS(o,j(f,g,b)))],h)}}function -wN(i,h,g,d,e,f){if(typeof +e==="number")return e?function(a,b,c){return I(k,[4,i,bC(m,a,dX(b,j(f,g,c)))],h)}:function(a,b){return I(k,[4,i,bC(m,a,j(f,g,b))],h)};var +o=e[1];return function(a,b){return I(k,[4,i,bC(m,a,dX(o,j(f,g,b)))],h)}}function +w7(i,h,g,d,e,f){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return G(i,[4,h,cA(f,a,b)],g)}:function(a){return G(i,[4,h,cA(f,h6(f),a)],g)};var -b=e[1];return function(a){return G(i,[4,h,cA(f,b,a)],g)}}if(0===d[0]){var +e==="number")return e?function(a,b){return I(i,[4,h,cF(f,a,b)],g)}:function(a){return I(i,[4,h,cF(f,il(f),a)],g)};var +b=e[1];return function(a){return I(i,[4,h,cF(f,b,a)],g)}}if(0===d[0]){var c=d[2],j=d[1];if(typeof -e==="number")return e?function(a,b){return G(i,[4,h,bu(j,c,cA(f,a,b))],g)}:function(a){return G(i,[4,h,bu(j,c,cA(f,h6(f),a))],g)};var -l=e[1];return function(a){return G(i,[4,h,bu(j,c,cA(f,l,a))],g)}}var +e==="number")return e?function(a,b){return I(i,[4,h,bC(j,c,cF(f,a,b))],g)}:function(a){return I(i,[4,h,bC(j,c,cF(f,il(f),a))],g)};var +l=e[1];return function(a){return I(i,[4,h,bC(j,c,cF(f,l,a))],g)}}var k=d[1];if(typeof -e==="number")return e?function(a,b,c){return G(i,[4,h,bu(k,a,cA(f,b,c))],g)}:function(a,b){return G(i,[4,h,bu(k,a,cA(f,h6(f),b))],g)};var -m=e[1];return function(a,b){return G(i,[4,h,bu(k,a,cA(f,m,b))],g)}}function -i8(a,b,c,d,e,f){if(e){var -i=e[1];return function(a){return wO(b,c,d,i,g(f,a))}}var +e==="number")return e?function(a,b,c){return I(i,[4,h,bC(k,a,cF(f,b,c))],g)}:function(a,b){return I(i,[4,h,bC(k,a,cF(f,il(f),b))],g)};var +m=e[1];return function(a,b){return I(i,[4,h,bC(k,a,cF(f,m,b))],g)}}function +ji(a,b,c,d,e,f){if(e){var +i=e[1];return function(a){return w8(b,c,d,i,g(f,a))}}var h=[4,c,f];return a<50?fg(a+1|0,b,h,d):v(fg,[0,b,h,d])}function -wO(a,b,c,d,e){return cq(i8(0,a,b,c,d,e))}function -cB(a,b){var +w8(a,b,c,d,e){return co(ji(0,a,b,c,d,e))}function +cG(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],h=lc(c[2]);cB(a,f);return eD(a,h);case +f=c[1],h=li(c[2]);cG(a,f);return eG(a,h);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cB(a,e);eD(a,wV);c=i}else{var -j=d[1];cB(a,e);eD(a,wW);c=j}break;case +i=d[1];cG(a,e);eG(a,xd);c=i}else{var +j=d[1];cG(a,e);eG(a,xe);c=j}break;case 6:var -m=c[2];cB(a,c[1]);return g(m,a);case -7:cB(a,c[1]);return eE(a);case +m=c[2];cG(a,c[1]);return g(m,a);case +7:cG(a,c[1]);return eH(a);case 8:var -n=c[2];cB(a,c[1]);return P(n);case +n=c[2];cG(a,c[1]);return L(n);case 2:case 4:var -k=c[2];cB(a,c[1]);return eD(a,k);default:var -l=c[2];cB(a,c[1]);return s4(a,l)}}}function -cC(a,b){var +k=c[2];cG(a,c[1]);return eG(a,k);default:var +l=c[2];cG(a,c[1]);return to(a,l)}}}function +cH(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],h=lc(c[2]);cC(a,f);return aD(a,h);case +f=c[1],h=li(c[2]);cH(a,f);return aG(a,h);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cC(a,e);aD(a,wX);c=i}else{var -j=d[1];cC(a,e);aD(a,wY);c=j}break;case +i=d[1];cH(a,e);aG(a,xf);c=i}else{var +j=d[1];cH(a,e);aG(a,xg);c=j}break;case 6:var -m=c[2];cC(a,c[1]);return aD(a,g(m,0));case +m=c[2];cH(a,c[1]);return aG(a,g(m,0));case 7:c=c[1];break;case 8:var -n=c[2];cC(a,c[1]);return P(n);case +n=c[2];cH(a,c[1]);return L(n);case 2:case 4:var -k=c[2];cC(a,c[1]);return aD(a,k);default:var -l=c[2];cC(a,c[1]);return o(a,l)}}}function -wZ(a){var -c=a[1],b=bs(cu);return G(function(a){cC(b,a);return eA(bJ(b))},0,c)}function -le(c){if(c==e)return w0;var +k=c[2];cH(a,c[1]);return aG(a,k);default:var +l=c[2];cH(a,c[1]);return o(a,l)}}}function +xh(a){var +c=a[1],b=bA(cw);return I(function(a){cH(b,a);return eD(bL(b))},0,c)}function +lk(c){if(c===e)return xi;var f=m(c);function -j(a){return g(wZ(w1),c)}function +j(a){return g(xh(xj),c)}function k(a){var b=a;for(;;){if(b===f)return b;var -d=ai(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var +d=ag(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var h=k(0),o=function(a,b){var -d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(h,h),a=fX(c,h,o-h|0),d=k(o),l=function(a,b){var +d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(h,h),a=f0(c,h,o-h|0),d=k(o),l=function(a,b){var d=b;for(;;){if(d===f)return d;var -e=ai(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var +e=ag(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var n=0;else try{var -r=ND(fX(c,d,l-d|0)),n=r}catch(f){var -p=an(f);if(p[1]!==eB)throw i(p,0);var -q=j(0),n=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==aI){if(a===U){var +r=ON(f0(c,d,l-d|0)),n=r}catch(f){var +p=al(f);if(p[1]!==eE)throw i(p,0);var +q=j(0),n=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==aM){if(a===T){var b=0;break a}if(a==="hov"){var -b=3;break a}if(a===o6){var -b=2;break a}if(a!==aX){var +b=3;break a}if(a===pn){var +b=2;break a}if(a!==a2){var b=j(0);break a}var b=1;break a}var b=4}return[0,n,b]}function -w2(d,b,c){return G(function(a){cB(b,a);return g(d,b)},0,c[1])}function -h9(a,b){return w2(function(a){return 0},a,b)}function -f4(a){return h9(b2,a)}function -lf(c,b){return G(function(a){var -b=bs(64);cC(b,a);return g(c,bJ(b))},0,b[1])}function -X(a){return lf(function(a){return a},a)}var -h_=eH(0);function -ia(a,b){var -c=a[1+b];return kG(c)?fO(c)===em?g(X(w3),c):fO(c)===n5?sY(c):w4:g(X(w5),c)}function -lg(a,b){if(a.length-1<=b)return w6;var -c=lg(a,b+1|0),d=ia(a,b);return j(X(w7),d,c)}function -w8(a){var +xk(d,b,c){return I(function(a){cG(b,a);return g(d,b)},0,c[1])}function +ip(a,b){return xk(function(a){return 0},a,b)}function +f7(a){return ip(b0,a)}function +ll(c,b){return I(function(a){var +b=bA(64);cH(b,a);return g(c,bL(b))},0,b[1])}function +Y(a){return ll(function(a){return a},a)}var +iq=eK(0);function +is(a,b){var +c=a[1+b];return tp(c)?hQ(c)===ep?g(Y(xl),c):hQ(c)===on?ti(c):xm:g(Y(xn),c)}function +lm(a,b){if(a.length-1<=b)return xo;var +c=lm(a,b+1|0),d=is(a,b);return j(Y(xp),d,c)}function +xq(a){var b=a.length-1;if(2>=b>>>0)switch(b){case -0:return w_;case -1:return w$;default:var -e=ia(a,1);return g(X(xa),e)}var -c=lg(a,2),d=ia(a,1);return j(X(w9),d,c)}function -xb(d){return function(a){var +0:return xs;case +1:return xt;default:var +e=is(a,1);return g(Y(xu),e)}var +c=lm(a,2),d=is(a,1);return j(Y(xr),d,c)}function +xv(d){return function(a){var b=a;for(;;){if(!b)return 0;var e=b[2],f=b[1];a:{try{var -c=g(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(eG(h_))}function -xc(a){if(0!==fO(a))return[0,a[1],0];var -b=a[1][1];return[0,b,[0,w8(a)]]}function -xd(a){var -b=xc(a),c=b[2],d=b[1];return c?a7(d,c[1]):d}function -xe(a){if(a===hM)return xf;if(a===ky)return xg;if(a[1]===kx){var -b=a[2],e=b[3],h=b[2],i=b[1];return dB(X(h$),i,h,e,e+5|0,xh)}if(a[1]===u){var -c=a[2],f=c[3],j=c[2],k=c[1];return dB(X(h$),k,j,f,f+6|0,xi)}if(a[1]!==kA)return xd(a);var -d=a[2],g=d[3],l=d[2],m=d[1];return dB(X(h$),m,l,g,g+6|0,xj)}function -f5(a){var -b=xb(a);return b?b[1]:xe(a)}function -xk(a){var -b=[0,Na(a)];return b}function -xl(c,b){function -a(a){return a?0===c?xm:xn:0===c?xo:xp}if(0!==b[0]){if(b[1])return 0;var -p=a(0);return[0,g(X(xv),p)]}if(b[3]===b[6])var -e=b[3],d=g(X(xq),e);else +c=g(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(eJ(iq))}function +xw(a){if(0!==hQ(a))return[0,a[1],0];var +b=a[1][1];return[0,b,[0,xq(a)]]}function +xx(a){var +b=xw(a),c=b[2],d=b[1];return c?aV(d,c[1]):d}function +xy(a){if(a===hY)return xz;if(a===kK)return xA;if(a[1]===kJ){var +b=a[2],e=b[3],h=b[2],i=b[1];return dE(Y(ir),i,h,e,e+5|0,xB)}if(a[1]===u){var +c=a[2],f=c[3],j=c[2],k=c[1];return dE(Y(ir),k,j,f,f+6|0,xC)}if(a[1]!==kM)return xx(a);var +d=a[2],g=d[3],l=d[2],m=d[1];return dE(Y(ir),m,l,g,g+6|0,xD)}function +f8(a){var +b=xv(a);return b?b[1]:xy(a)}function +xE(a){var +b=[0,Ok(a)];return b}function +xF(c,b){function +a(a){return a?0===c?xG:xH:0===c?xI:xJ}if(0!==b[0]){if(b[1])return 0;var +p=a(0);return[0,g(Y(xP),p)]}if(b[3]===b[6])var +e=b[3],d=g(Y(xK),e);else var -n=b[6],o=b[3],d=j(X(xu),o,n);var -f=b[7],h=b[4],i=b[8]?xr:xt,k=b[2],l=b[9],m=a(b[1]);return[0,MV(X(xs),m,l,k,i,d,h,f)]}function -xw(a,b){if(!b)return h9(a,xy);var +n=b[6],o=b[3],d=j(Y(xO),o,n);var +f=b[7],h=b[4],i=b[8]?xL:xN,k=b[2],l=b[9],m=a(b[1]);return[0,N4(Y(xM),m,l,k,i,d,h,f)]}function +xQ(a,b){if(!b)return ip(a,xS);var d=b[1],e=d.length-2|0,h=0;if(e>=0){var c=h;for(;;){var -f=xl(c,p(d,c)[1+c]);if(f){var -i=f[1];g(h9(a,xx),i)}var -j=c+1|0;if(e===c)break;c=j}}return}function -ib(a,b){return xw(a,xk(b))}var -xB=xA.slice();function -xC(a,b){var -e=f5(a);g(f4(xD),e);ib(b2,b);var -c=NN(0);if(c<0){var -d=eC(c);kE(p(xB,d)[1+d])}return eE(b2)}var -xE=[0];function -lh(a){var -b=Nj(0);return b}function -xF(a,b){try{var -d=b?xE:lh(0);try{hQ(0)}catch(f){}try{var -f=xC(a,d),e=f}catch(f){var -h=an(f),j=lh(0),k=f5(a);g(f4(xH),k);ib(b2,d);var -l=f5(h);g(f4(xI),l);ib(b2,j);var -e=eE(b2)}return e}catch(f){var -c=an(f);if(c===hM)return kE(xG);throw i(c,0)}}kt(rO,function(a,b){try{var -c=xF(a,b);return c}catch(f){return 0}});function -xz(a){for(;;){var -b=eG(h_),c=1-kH(h_,b,[0,a,b]);if(!c)return c}}var -xL=[L,xK,a5(0)];xz(function(a){return a[1]===xL?[0,a7(xM,f5(a[2]))]:0});function -xJ(a,b,c){return j(a,c,b)}function -ic(a){var -b=a[1]<1?1:0,c=b||(64=0){var -c=i;for(;;){tQ(d,c*8|0,fL(p(b,c)[1+c]));var -m=c+1|0;if(f===c)break;c=m}}cw(d,e*8|0,1);var -g=li(d);cw(d,e*8|0,2);var -h=li(d),j=fZ(h,8),k=fZ(h,0),l=fZ(g,8);return lk(a,fZ(g,0),l,k,j)}function -xY(a){var -b=id(0);lm(b,a);return b}function -ln(a){return xY(sD(0))}function -f6(a){return ss(a)}function -xX(a){var -b=id(0);xW(b,a);return b}function -xZ(a){return so(ss(a))&pW}var -lo=cz([0,function(a){var -b=f6(a),c=f6(a),d=f6(a);return ll(b,c,d,f6(a))}],function(a){return ll(x3,x2,x1,x0)});function -x4(a){return lm(bK(lo),a)}function -x5(a){return x4(sD(0))}function -x6(a){return xX(bK(lo))}function -x7(a){var +f=xF(c,q(d,c)[1+c]);if(f){var +i=f[1];g(ip(a,xR),i)}var +j=c+1|0;if(e===c)break;c=j}}}function +it(a,b){return xQ(a,xE(b))}var +xV=xU.slice();function +xW(a,b){var +e=f8(a);g(f7(xX),e);it(b0,b);var +c=OZ(0);if(c<0){var +d=eF(c);kQ(q(xV,d)[1+d])}return eH(b0)}var +xY=[0];function +ln(a){var +b=Ot(0);return b}function +xZ(a,b){try{var +d=b?xY:ln(0);try{h2(0)}catch(f){}try{var +f=xW(a,d),e=f}catch(f){var +h=al(f),j=ln(0),k=f8(a);g(f7(x1),k);it(b0,d);var +l=f8(h);g(f7(x2),l);it(b0,j);var +e=eH(b0)}return e}catch(f){var +c=al(f);if(c===hY)return kQ(x0);throw i(c,0)}}kF(r8,function(a,b){try{var +c=xZ(a,b);return c}catch(f){return 0}});function +xT(a){for(;;){var +b=eJ(iq),c=1-kS(iq,b,[0,a,b]);if(!c)return c}}var +x5=[J,x4,a4(0)];xT(function(a){return a[1]===x5?[0,aV(x6,f8(a[2]))]:0});function +x3(a,b,c){return j(a,c,b)}function +iu(a){var +b=a[1]<1?1:0,c=b||(64=0){var +c=i;for(;;){ub(d,c*8|0,fQ(q(b,c)[1+c]));var +m=c+1|0;if(f===c)break;c=m}}cz(d,e*8|0,1);var +g=lo(d);cz(d,e*8|0,2);var +h=lo(d),j=f2(h,8),k=f2(h,0),l=f2(g,8);return lq(a,f2(g,0),l,k,j)}function +yg(a){var +b=iv(0);ls(b,a);return b}function +lt(a){return yg(sX(0))}function +f9(a){return sN(a)}function +yf(a){var +b=iv(0);ye(b,a);return b}function +yh(a){return sJ(sN(a))&qg}var +lu=cE([0,function(a){var +b=f9(a),c=f9(a),d=f9(a);return lr(b,c,d,f9(a))}],function(a){return lr(yl,yk,yj,yi)});function +ym(a){return ls(bM(lu),a)}function +yn(a){return ym(sX(0))}function +yo(a){return yf(bM(lu))}function +yp(a){var b=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var -MI=sC(rF),ls=MI}catch(f){var -lp=an(f);if(lp!==bG)throw i(lp,0);try{var -MH=sC("CAMLRUNPARAM"),lr=MH}catch(f){var -lq=an(f);if(lq!==bG)throw i(lq,0);var -lr=x8}var -ls=lr}var -x9=eH(ua(ls,82)),x_=cz(0,ln);function -x$(a,b){var -c=a;for(;;){if(b<=c)return c;if(hR<(c*2|0))return c;c=c*2|0}}function -ie(a,b){var -d=a?a[1]:eG(x9),c=x$(16,b),e=d?xZ(bK(x_)):0;return[0,0,cx(c,0),e,c]}function -ya(l,b,c,d){var -h=d.length-1,f=cx(h,0),i=c.length-2|0;function +NR=sW(r0),ly=NR}catch(f){var +lv=al(f);if(lv!==bZ)throw i(lv,0);try{var +NQ=sW("CAMLRUNPARAM"),lx=NQ}catch(f){var +lw=al(f);if(lw!==bZ)throw i(lw,0);var +lx=yq}var +ly=lx}var +yr=eK(ux(ly,82)),ys=cE(0,lt);function +yt(a,b){var +c=a;for(;;){if(b<=c)return c;if(h3<(c*2|0))return c;c=c*2|0}}function +yv(l,b,c,d){var +h=d.length-1,f=cB(h,0),i=c.length-2|0;function m(a){var c=a;for(;;){if(!c)return;var -i=c[1],k=c[2],m=c[3],h=b?c:[0,i,k,0],e=g(l,i),j=p(f,e)[1+e];if(j)j[3]=h;else -p(d,e)[1+e]=h;p(f,e)[1+e]=h;c=m}}var +i=c[1],k=c[2],m=c[3],h=b?c:[0,i,k,0],e=g(l,i),j=q(f,e)[1+e];if(j)j[3]=h;else +q(d,e)[1+e]=h;q(f,e)[1+e]=h;c=m}}var n=0;if(i>=0){var -e=n;for(;;){m(p(c,e)[1+e]);var +e=n;for(;;){m(q(c,e)[1+e]);var r=e+1|0;if(i===e)break;e=r}}if(b){var j=h-1|0,o=0;if(j>=0){var a=o;for(;;){var -k=p(f,a)[1+a];if(k)k[3]=0;var -q=a+1|0;if(j===a)break;a=q}}}return}function -yb(a,b){var -c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return ly(a,d)}function -yp(a){var -b=k0(a[28]);if(!b)return;var +k=q(f,a)[1+a];if(k)k[3]=0;var +p=a+1|0;if(j===a)break;a=p}}}}function +yw(a,b){var +c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return lD(a,d)}function +yI(a){var +b=ii(a[28]);if(!b)return;var c=b[1],d=c[1];a[12]=a[12]-c[3]|0;var -e=a9(d);a[9]=a[9]+e|0;return}function -yq(a,b,c){if(typeof +e=ba(d);a[9]=a[9]+e|0}function +yJ(a,b,c){if(typeof c==="number")switch(c){case 0:var -j=dO(a[3]);if(!j)return;var +j=dS(a[3]);if(!j)return;var k=j[1][1],l=function(a,b){if(!b)return[0,a,0];var -c=b[1],d=b[2];return NH(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case -1:dN(a[2]);return;case -2:dN(a[3]);return;case +c=b[1],d=b[2];return OR(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case +1:dR(a[2]);return;case +2:dR(a[3]);return;case 3:var -n=dO(a[2]);return n?ly(a,n[1][2]):f9(a);case +n=dS(a[2]);return n?lD(a,n[1][2]):ga(a);case 4:var -o=a[10]!==(a[6]-a[9]|0)?1:0;return o?yp(a):o;default:var -p=dN(a[5]);if(p)return ig(a,g(a[25],p[1]));return}switch(c[0]){case -0:return lx(a,b,c[1]);case +o=a[10]!==(a[6]-a[9]|0)?1:0;return o?yI(a):o;default:var +p=dR(a[5]);if(p)return ix(a,g(a[25],p[1]));return}switch(c[0]){case +0:return lC(a,b,c[1]);case 1:var -d=c[2],f=c[1],q=d[1],z=d[2],r=dO(a[2]);if(!r)return;var +d=c[2],f=c[1],q=d[1],z=d[2],r=dS(a[2]);if(!r)return;var s=r[1],e=s[2];switch(s[1]){case -0:return dT(a,f);case -1:return dl(a,d,e);case -2:return dl(a,d,e);case -3:return a[9]<(b+m(q)|0)?dl(a,d,e):dT(a,f);case -4:return a[11]?dT(a,f):a[9]<(b+m(q)|0)?dl(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=lw;lz(a);if(b)f9(a);return yy(a)}ij(a,0)}}function -dU(a,b,c){var -d=a[14]=a[14]){a[13]=lB;lE(a);if(b)ga(a);return yR(a)}iA(a,0)}}function +dZ(a,b,c){var +d=a[14]=c)return bT(a[17],lK,0,c);bT(a[17],lK,0,80);c=c-80|0}}function -yJ(a){return a[1]===f8?a7(yL,a7(a[2],yK)):yM}function -yN(a){return a[1]===f8?a7(yP,a7(a[2],yO)):yQ}function -yR(a){return 0}function -yS(a){return 0}function -io(a,b,c,d,e){var -g=kZ(0),h=[0,lu,yT,0];h3(h,g);var -f=eM(0);ih(f);dk([0,1,h],f);var -i=78,j=eM(0),k=eM(0),l=eM(0);return[0,f,eM(0),l,k,j,i,10,68,i,0,1,1,1,1,fT,yU,a,b,c,d,e,0,0,yJ,yN,yR,yS,g]}function -lL(a,b){var -c=io(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return im(c,a)};c[20]=function(a){return dW(c,a)};c[21]=function(a){return dW(c,a)};return c}function -lM(d){return lL(function(a,b,c){return kD(d,a,b,c)},function(a){return eE(d)})}function -dX(d){return lL(function(a,b,c){return dQ(d,a,b,c)},function(a){return 0})}var -ip=hc;function -ga(a){return bs(ip)}var -lN=ga(0),iq=lM(hO),ir=lM(b2),lO=dX(lN),is=cz(0,ga);eP(is,lN);var -lP=cz(0,function(a){return dX(bK(is))});eP(lP,lO);function -gb(a,b,c,d){return dQ(bK(a),b,c,d)}function -gc(a,b,c){var -d=bK(b),e=k2(d);kD(a,bJ(d),0,e);eE(a);return dP(d)}var -gd=cz(0,function(a){return bs(ip)}),ge=cz(0,function(a){return bs(ip)}),it=cz(0,function(a){var -b=io(function(a,b,c){return gb(gd,a,b,c)},function(a){return gc(hO,gd,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return im(b,a)};b[20]=function(a){return dW(b,a)};b[21]=function(a){return dW(b,a)};k_(function(a){return cD(b,a)});return b});eP(it,iq);var -lQ=cz(0,function(a){var -b=io(function(a,b,c){return gb(ge,a,b,c)},function(a){return gc(b2,ge,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return im(b,a)};b[20]=function(a){return dW(b,a)};b[21]=function(a){return dW(b,a)};k_(function(a){return cD(b,a)});return b});eP(lQ,ir);function -yB(a,b){ik(a,1);return g(a[18],0)}function -yC(a,b){var -c=a[14]=c)return ct(a[17],lP,0,c);ct(a[17],lP,0,80);c=c-80|0}}function +y2(a){return a[1]===f$?aV(y4,aV(a[2],y3)):y5}function +y6(a){return a[1]===f$?aV(y8,aV(a[2],y7)):y9}function +y_(a){return 0}function +y$(a){return 0}function +iE(a,b,c,d,e){var +g=ig(0),h=[0,lz,za,0];dT(h,g);var +f=eO(0);iy(f);dr([0,1,h],f);var +i=78,j=eO(0),k=eO(0),l=eO(0);return[0,f,eO(0),l,k,j,i,10,68,i,0,1,1,1,1,fV,zb,a,b,c,d,e,0,0,y2,y6,y_,y$,g]}function +lQ(a,b){var +c=iE(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return iD(c,a)};c[20]=function(a){return d1(c,a)};c[21]=function(a){return d1(c,a)};return c}function +lR(d){return lQ(function(a,b,c){return kP(d,a,b,c)},function(a){return eH(d)})}function +d2(d){return lQ(function(a,b,c){return dV(d,a,b,c)},function(a){return 0})}var +iF=hk;function +gd(a){return bA(iF)}var +lS=gd(0),iG=lR(h0),iH=lR(b0),lT=d2(lS),iI=cE(0,gd);eR(iI,lS);var +lU=cE(0,function(a){return d2(bM(iI))});eR(lU,lT);function +ge(a,b,c,d){return dV(bM(a),b,c,d)}function +gf(a,b,c){var +d=bM(b),e=k8(d);kP(a,bL(d),0,e);eH(a);return dU(d)}var +gg=cE(0,function(a){return bA(iF)}),gh=cE(0,function(a){return bA(iF)}),iJ=cE(0,function(a){var +b=iE(function(a,b,c){return ge(gg,a,b,c)},function(a){return gf(h0,gg,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return iD(b,a)};b[20]=function(a){return d1(b,a)};b[21]=function(a){return d1(b,a)};le(function(a){return cI(b,a)});return b});eR(iJ,iG);var +lV=cE(0,function(a){var +b=iE(function(a,b,c){return ge(gh,a,b,c)},function(a){return gf(b0,gh,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return iD(b,a)};b[20]=function(a){return d1(b,a)};b[21]=function(a){return d1(b,a)};le(function(a){return cI(b,a)});return b});eR(lV,iH);function +yU(a,b){iB(a,1);return g(a[18],0)}function +yV(a,b){var +c=a[14]=0){var -c=h;for(;;){e[c]=g(a,p(b,c)[1+c]);var +l3(a){return a["length"]}function +gl(c,b){return uA(l3(b),function(a){return g(c,b[a])})}function +l4(a,b){var +d=b.length-1,e=iN(d),f=d-1|0,h=0;if(f>=0){var +c=h;for(;;){e[c]=g(a,q(b,c)[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -dY(c,b){return ts(lY(b),function(a){return g(c,b[a])})}function -dZ(f,b){return function(a,b,c){var +d3(c,b){return tO(l3(b),function(a){return g(c,b[a])})}function +d4(f,b){return function(a,b,c){var e=a,d=c;for(;;){if(!d)return b;var -h=d[2];b[e]=g(f,d[1]);e=e+1|0;d=h}}(0,ix(0),b)}function -ze(a,b){var +h=d[2];b[e]=g(f,d[1]);e=e+1|0;d=h}}(0,iN(0),b)}function +zx(a,b){var c=new -C["Error"](b);return a?(c[bY]=a[1],c):c}var -iy=C["Promise"];function -d0(a){return iy.resolve(a)}function -eV(a,b){return a.then(fM(1,b))}function -l0(a){return iy.all(a)}function -bw(a){return cb(a)}function -aN(a){return b1(a)}function -y$(a,b,c){if(!c)return;a[b]=c[1];return}function -za(a,b){a[b];return}function -zc(a,b,c){if(c)return zb(a,b,c[1]);return}function -zd(a,b){return a[b]}function -zf(a,b){return g(function(a){throw a},ze(a,b))}function -zg(a){return new -iy(fM(2,function(c,b){return j(a,function(a){return c(a)},function(a){return b(a)})}))}function -zh(a,b,c){return a.then(fM(1,b),fM(1,c))}function -d1(a){return{fut:a}}function -gi(a){return a[jF]}function -zi(a){return a[jF]}function -iz(a){var -c=[0,function(a){throw i([0,u,zj],1)}];function -b(a){return zf(0,"The future is already set")}return[0,d1(zg(function(a,b){c[1]=a;return 0})),function(a){g(c[1],a);c[1]=b;return 0}]}function -eW(a){return d1(d0(a))}function -eX(a,b){return d1(eV(gi(a),function(a){return gi(g(b,a))}))}function -dn(c,b){return eX(b,function(a){return eW(g(c,a))})}function -l1(a,b){var -c=gi(a);return d1(function(a){return eV(c,a)}(function(c){var -d=gi(b);return function(a){return eV(d,a)}(function(a){return d0([0,c,a])})}))}function -gj(a){return d1(eV(l0(dZ(zi,a)),function(a){return d0(dY(function(a){return a},a))}))}function -eY(a){return eW([0,a])}function -zk(d,b,c){return d1(zh(c,function(a){return d0([0,g(d,a)])},function(a){return d0([1,g(b,a)])}))}function -l2(a,b){return zk(a,function(a){return a},b)}function -eZ(a,b){return dn(b,a)}function -bM(c,b){return function(a){return eX(c,a)}(function(a){return 0===a[0]?g(b,a[1]):eW(a)})}function -bx(a,b){return dn(function(a){return s6(b,a)},a)}C["Event"];function -e0(a,b,c,d){var -e=a?a[1]:{};d.addEventListener(b,fM(1,c),e);return}C["ArrayBuffer"];C["DataView"];function -zl(a){return a["currentTarget"]}C["Blob"];C["File"];var -l3=C[hq];function -l4(a){return l3.stringify(a)}function -iA(a){try{var -c=l3.parse(a)}catch(f){var -b=an(f);if(b[1]===eT)return[1,b[2]];throw i(b,0)}return[0,c]}C["encodeURI"];C["decodeURI"];var -zm=C["encodeURIComponent"],zn=C["decodeURIComponent"],gk=C["URL"],iB=cm;function -zp(a){return zd(a,zq)}var -zu=C["URLSearchParams"];function -zv(a){return a.toString()}function -l5(a){return a.toString()}var -l6=C["document"];function -zo(a,b){return a?new -gk(b,a[1]):new -gk(b)}function -zr(a){function -d(a){return zn(a)}try{var -c=zp(a),e=y8(iB,c)?y6(zs,0,c):c,f=[0,bg(d,y7(iB,e))];return f}catch(f){var -b=an(f);if(b[1]===eT)return[1,b[2]];throw i(b,0)}}function -zt(a,b){function -e(a){return y4(iB,zm(a))}try{var +C["Error"](b);return a?(c[bg]=a[1],c):c}function +iO(a){return a[oT]}var +iP=C["Promise"];function +d5(a){return iP.resolve(a)}function +eW(a,b){return a.then(eA(1,b))}function +l5(a){return iP.all(a)}function +bj(a){return bY(a)}function +aA(a){return ca(a)}function +zs(a,b,c){if(!c)return;a[b]=c[1]}function +zt(a,b){a[b]}function +zv(a,b,c){if(c)return zu(a,b,c[1])}function +zw(a,b){return a[b]}function +zy(a,b){return g(function(a){throw a},zx(a,b))}function +zz(a){return new +iP(eA(2,function(c,b){return j(a,function(a){return c(a)},function(a){return b(a)})}))}function +zA(a,b,c){return a.then(eA(1,b),eA(1,c))}function +d6(a){return{fut:a}}function +gm(a){return a[jT]}function +zB(a){return a[jT]}function +gn(a){var +c=[0,function(a){throw i([0,u,zC],1)}];function +b(a){return zy(0,"The future is already set")}return[0,d6(zz(function(a,b){c[1]=a;return 0})),function(a){g(c[1],a);c[1]=b;return 0}]}function +eX(a){return d6(d5(a))}function +dt(a,b){return d6(eW(gm(a),function(a){return gm(g(b,a))}))}function +d7(c,b){return dt(b,function(a){return eX(g(c,a))})}function +l6(a){return d6(eW(l5(d4(zB,a)),function(a){return d5(d3(function(a){return a},a))}))}function +b2(a){return eX([0,a])}function +zE(d,b,c){return d6(zA(c,function(a){return d5([0,g(d,a)])},function(a){return d5([1,g(b,a)])}))}function +l7(a,b){return zE(a,function(a){return a},b)}function +go(a,b){return d7(b,a)}function +au(c,b){return function(a){return dt(c,a)}(function(a){return 0===a[0]?g(b,a[1]):eX(a)})}function +aI(a,b){return d7(function(a){return tr(b,a)},a)}function +zD(a,b){var +c=gm(a);return d6(function(a){return eW(c,a)}(function(c){var +d=gm(b);return function(a){return eW(d,a)}(function(a){return d5([0,c,a])})}))}C["Event"];function +iQ(a){a.preventDefault();return 0}function +gp(a,b,c,d){var +e=a?a[1]:{};d.addEventListener(b,eA(1,c),e)}C["ArrayBuffer"];C["DataView"];function +zF(a){return a["currentTarget"]}C["Blob"];C["File"];var +l8=C[hy];function +l9(a){return l8.stringify(a)}function +iR(a){try{var +c=l8.parse(a)}catch(f){var +b=al(f);if(b[1]===eU)return[1,b[2]];throw i(b,0)}return[0,c]}C["encodeURI"];C["decodeURI"];var +zG=C["encodeURIComponent"],zH=C["decodeURIComponent"],gq=C["URL"],iS=cy;function +zJ(a){return zw(a,zK)}var +zO=C["URLSearchParams"];function +zP(a){return a.toString()}function +l_(a){return a.toString()}var +l$=C["document"];function +zI(a,b){return a?new +gq(b,a[1]):new +gq(b)}function +zL(a){function +d(a){return zH(a)}try{var +c=zJ(a),e=zp(iS,c)?zn(zM,0,c):c,f=[0,bz(d,zo(iS,e))];return f}catch(f){var +b=al(f);if(b[1]===eU)return[1,b[2]];throw i(b,0)}}function +zN(a,b){function +e(a){return zl(iS,zG(a))}try{var d=new -gk(a);d[rX]=y5(0,bg(e,b));var +gq(a);d[sg]=zm(0,bz(e,b));var f=[0,d];return f}catch(f){var -c=an(f);if(c[1]===eT)return[1,c[2]];throw i(c,0)}}function -zw(a){return new -zu(a)}function -zx(a,b){var +c=al(f);if(c[1]===eU)return[1,c[2]];throw i(c,0)}}function +zQ(a){return new +zO(a)}function +zR(a,b){var c=new -gk(a);lX(c,zy,zv(b));return c}if(!lW(l6))l6["documentElement"];function -iC(a,b,c){dg(a,b,c);return 0}var -iD=C[op];function -iE(a){return ex(function(a,b,c){var +gq(a);l2(c,zS,zP(b));return c}if(!l1(l$))l$["documentElement"];function +gr(a,b,c){dN(a,b,c);return 0}var +gs=C[oI];function +gt(a){return ez(function(a,b,c){var e=b,d=c;for(;;){if(!d)return a;var -f=d[2];a[e]=d[1];e=e+1|0;d=f}}(ix(0),0,a))}function -dp(a){return iC(iD,zz,iE(a))}function -l7(a){return iC(iD,zA,iE(a))}function -e1(a){return iC(iD,zB,iE(a))}function -d2(a){return a.now()}C[op];C["navigator"];var -d3=C["performance"];C["window"];za(C,zC);C["ClipboardItem"];C["FormData"];var -zF=C["Headers"];function -l8(a,b,c,d,e,f,g,h,i,j,k,l,m){var -n={};n["body"]=iw(eU,function(a){return a},a);c0(n,zH,b);c0(n,zI,c);y$(n,zJ,hS(function(a){return a},d));c0(n,zK,e);zc(n,zL,f);c0(n,zM,g);c0(n,zN,h);c0(n,zO,i);c0(n,zP,j);c0(n,zQ,k);n["signal"]=iw(eU,function(a){return a},l);return n}var -zR=C["Request"];C["Response"];var -zT=C["fetch"];C["MediaStream"];C["MediaRecorder"];C["MessageChannel"];C["BroadcastChannel"];var -l9="message";function -l_(a){return a["data"]}C["Notification"];C["WebSocket"];function -zD(a){return a}function -zE(a){return l2(function(a){return a},a.text())}function -zG(a,b){var -d=a?[0,a[1]]:[0],c=NF(zF,d);function -e(a,b){a.append(b[1],b[2]);return 0}eJ(function(a){return e(c,a)},b);return c}function -zS(a,b){var +f=d[2];a[e]=d[1];e=e+1|0;d=f}}(iN(0),0,a))}function +du(a){return gr(gs,zT,gt(a))}function +iT(a){return gr(gs,zU,gt(a))}function +dv(a){return gr(gs,zV,gt(a))}function +eY(a){return gr(gs,zW,gt(a))}function +d8(a){return a.now()}C[oI];C["navigator"];var +d9=C["performance"];C["window"];zt(C,zX);function +zY(a,b){C.setTimeout(eA(1,b),a)}C["ClipboardItem"];C["FormData"];var +z1=C["Headers"];function +ma(a,b,c,d,e,f,g,h,i,j,k,l,m){var +n={};n["body"]=iM(gk,function(a){return a},a);c3(n,z3,b);c3(n,z4,c);zs(n,z5,h4(function(a){return a},d));c3(n,z6,e);zv(n,z7,f);c3(n,z8,g);c3(n,z9,h);c3(n,z_,i);c3(n,z$,j);c3(n,Aa,k);n["signal"]=iM(gk,function(a){return a},l);return n}var +Ab=C["Request"];C["Response"];var +Ad=C["fetch"];C["MediaStream"];C["MediaRecorder"];C["MessageChannel"];C["BroadcastChannel"];C["Notification"];C["WebSocket"];function +zZ(a){return a}function +z0(a){return l7(function(a){return a},a.text())}function +z2(a,b){var +d=a?[0,a[1]]:[0],c=OP(z1,d);function +e(a,b){a.append(b[1],b[2]);return 0}fW(function(a){return e(c,a)},b);return c}function +Ac(a,b){var c=a?a[1]:{};return new -zR(b,c)}function -zU(a){function -b(a){return a}return function(a){return l2(b,a)}(zT(a))}var -zV=C["Worker"];C["SharedWorker"];function -l$(a,b){var -c=a?a[1]:eU;C.postMessage(b,c);return 0}C["clients"];C["registration"];C["serviceWorker"];function -zW(a,b){var -c=a?a[1]:eU;return new -zV(b,c)}function -ma(a){return 0===a[0]?aN(a[1]):lZ(aN,a[1])}C["IDBKeyRange"];var -z0="success",z1=hn;function -cd(a,b){return[0,b,a]}function -z2(a){return a[1][hn]}function -gl(a){var +Ab(b,c)}function +Ae(a){function +b(a){return a}return function(a){return l7(b,a)}(Ad(a))}var +Af=oT;function +Ag(a){return a["data"]}C["Worker"];C["SharedWorker"];function +mb(a,b){var +c=a?a[1]:gk;C.postMessage(b,c);return 0}C["clients"];C["registration"];C["serviceWorker"];function +mc(a){return 0===a[0]?aA(a[1]):l4(aA,a[1])}C["IDBKeyRange"];var +Ak="success",Al=hv;function +cJ(a,b){return[0,b,a]}function +Am(a){return a[1][hv]}function +iU(a){var b=a[1]["result"];return g(a[2],b)}function -iF(c,b){e0(0,z0,function(a){return j(c,a,b)},b[1]);return b}function -z3(c,b){e0(0,z1,function(a){return j(c,a,b)},b[1]);return b}function -dq(a){var -b=iz(0),c=b[2],d=b[1];iF(function(a,b){return c([0,gl(b)])},a);z3(function(a,b){return c([1,z2(b)])},a);return d}var -mb=[0,function(a){return a},function(a){return a}],zZ="upgradeneeded";function -z4(a){switch(a){case -0:return z5;case -1:return z6;case -2:return z7;default:return z8}}function -z9(a){return aN(z4(a))}function -mc(e,d,c){var -a=[0,function(a){var -b=a["key"],d=c[2];return function(a){return dm(d,a)}(b)},function(a){var -b=a["primaryKey"],c=d[2];return function(a){return dm(c,a)}(b)},function(a,b){b.advance(a);return b},function(a,b){var -c=a?[0,g(d[1],a[1])]:[0];dg(b,"continue",c);return 0}];return[0,e,d,,function(a,b){function -d(a){return dm(function(a){return g(e[3],a)},a)}return function(a){return cd(d,a)}(b.get(g(c[1],a)))},function(a,b){function -e(a){return dm(function(a){return g(d[2],a)},a)}return function(a){return cd(e,a)}(b.getKey(g(c[1],a)))},function(a){function -b(a){return gh(function(a){return g(e[3],a)},a)}return function(a){return cd(b,a)}(a.getAll())},function(a,b){var +md(c,b){gp(0,Ak,function(a){return j(c,a,b)},b[1]);return b}function +gu(c,b){gp(0,Al,function(a){return j(c,a,b)},b[1]);return b}function +bE(a){var +b=gn(0),c=b[2],d=b[1];md(function(a,b){return c([0,iU(b)])},a);gu(function(a,b){return c([1,Am(b)])},a);return d}var +iV=[0,function(a){return a},function(a){return a}],Aj="upgradeneeded";function +Ap(a){switch(a){case +0:return Aq;case +1:return Ar;case +2:return As;default:return At}}function +Au(a){return aA(Ap(a))}function +me(e,d,c){return[0,e,d,,function(a,b){function +d(a){return eV(function(a){return g(e[3],a)},a)}return function(a){return cJ(d,a)}(b.get(g(c[1],a)))},function(a,b){function +e(a){return eV(function(a){return g(d[2],a)},a)}return function(a){return cJ(e,a)}(b.getKey(g(c[1],a)))},function(a){function +b(a){return gl(function(a){return g(e[3],a)},a)}return function(a){return cJ(b,a)}(a.getAll())},function(a,b){var c=a?[0,a[1]]:[0];function -e(a){return gh(function(a){return g(d[2],a)},a)}return function(a){return cd(e,a)}(dg(b,"getAllKeys",c))},,[0,a[1],a[2],a[3],a[4],function(a){return dm(function(a){return g(e[3],a)},a[ea])},function(a){function -b(a){return 0}return function(a){return cd(b,a)}(a.delete())},function(a,b){var -c=b.update(g(e[2],a)),f=d[2];return function(a){return cd(f,a)}(c)}],function(a,b,c){var -d=hS(z9,b);if(a)var +e(a){return gl(function(a){return g(d[2],a)},a)}return function(a){return cJ(e,a)}(dN(b,"getAllKeys",c))},[0,function(a){var +b=a["key"],d=c[2];return function(a){return eV(d,a)}(b)}],,,function(a,b,c){var +d=h4(Au,b);if(a)var e=a[1],g=d?[0,e,d[1]]:[0,e],f=g;else var -f=d?[0,iv,d[1]]:[0];function -h(a){return dm(function(a){return a},a)}return function(a){return cd(h,a)}(dg(c,"openCursor",f))}]}function -z_(a){switch(a){case -0:return z$;case -1:return Aa;default:return Ab}}function -cr(a,b){var -c=b.objectStore(aN(a[2][1]));return g(a[1],c)}function -Ac(a,b,c,d){var -h=c?c[1]:0,e=[0,[0,Ad,!!h],0],i=b?[0,[0,Ae,ma(b[1])],e]:e,f=sq(hZ(i));e1([0,Af,[0,f,0]]);var -j=d.createObjectStore(aN(a[2][1]),f);return g(a[1],j)}function -e2(a,b,c){var -d=b?b[1]:0,e=aN(z_(d));return c.transaction(dZ(function(a){return aN(a[2][1])},a),e)}function -Ai(c,b){function -h(a,b){return mc(c,a,b)}var -a=function(a){return h(b,a)}(b),e=a[1],f=a[2],d=[0,e,f,,a[4],,a[6],a[7],,a[9],a[10],,,function(a,b,c){if(b)var +f=d?[0,iL,d[1]]:[0];function +h(a){return eV(function(a){return a},a)}return function(a){return cJ(h,a)}(dN(c,"openKeyCursor",f))}]}function +Av(a){switch(a){case +0:return Aw;case +1:return Ax;default:return Ay}}function +c4(a,b){var +c=b.objectStore(aA(a[2][1]));return g(a[1],c)}function +Az(a,b,c,d){var +h=c?c[1]:0,e=[0,[0,AA,!!h],0],i=b?[0,[0,AB,mc(b[1])],e]:e,f=sL(ic(i));eY([0,AC,[0,f,0]]);var +j=d.createObjectStore(aA(a[2][1]),f);return g(a[1],j)}function +dw(a,b,c){var +d=b?b[1]:0,e=aA(Av(d));return c.transaction(d4(function(a){return aA(a[2][1])},a),e)}function +AF(c,b){function +h(a,b){return me(c,a,b)}var +a=function(a){return h(b,a)}(b),e=a[1],f=a[2],d=[0,e,f,,a[4],,a[6],a[7],,,,,,function(a,b,c){if(b)var h=g(f[1],b[1]),d=[0,g(e[2],a),h];else var d=[0,g(e[2],a)];var -i=dg(c,"add",d),j=f[2];return function(a){return cd(j,a)}(i)},function(a,b,c,d,e){function +i=dN(c,"add",d),j=f[2];return function(a){return cJ(j,a)}(i)},function(a,b,c,d,e){function f(a){return a}var -h=sq(hZ(function(a){return ty(f,a)}([0,hS(function(a){return[0,Aj,!!a]},d),0]))),i=ma(c),j=e.createIndex(aN(b),i,h);return g(a[1],j)},function(a,b,c){var -d=c.index(aN(b));return g(a[1],d)},function(a,b,c){if(b)var +h=sL(ic(function(a){return tU(f,a)}([0,h4(function(a){return[0,AG,!!a]},d),0]))),i=mc(c),j=e.createIndex(aA(b),i,h);return g(a[1],j)},function(a,b,c){var +d=c.index(aA(b));return g(a[1],d)},function(a,b,c){if(b)var h=g(f[1],b[1]),d=[0,g(e[2],a),h];else var d=[0,g(e[2],a)];var -i=dg(c,"put",d),j=f[2];return function(a){return cd(j,a)}(i)}];return[0,,d[1],d[2],,d[4],,d[6],d[7],,d[9],d[10],,,d[13],d[14],d[15],d[16],function(a,b,c){return Ac([0,function(a){return a},d[1],d[2],d[13],d[14],d[15],d[16]],a,b,c)}]}function -Ak(e,b){var -c=e[3],d=e[2];function -g(a,b){return mc(d,a,b)}var -f=[0,,,,,function(a){return g(c,a)}(b)[5],,,,,,,,b];return[0,,,,,,f[5],,,,,,,,f[13],function(a,b,c,d){return dB(e[5],[0,function(a){return a},f[13]],a,b,c,d)}]}function -dr(a,b){var -c=Ak(a,b);return[0,c[14],function(a){return a},,,,,,,c[6],,,,,,c[15]]}function -ds(a,b){var -c=Ai(a,b);return[0,,c[10],,c[5],,c[7],c[8],,c[11],,function(a){return a},c[2],c[3],c[14],c[15],c[16],c[17],c[18]]}function -zX(a){return a["oldVersion"]}function -zY(a){return a["newVersion"]}function -Ag(a,b){a.deleteObjectStore(aN(b));return 0}function -Ah(a){return function(a){return gh(bw,a)}(a["objectStoreNames"])}function -Al(c,b){e0(0,zZ,function(a){function -b(a){return a}return j(c,a,function(a){return cd(b,a)}(zl(a)))},b[1]);return b}function -Am(a,b,c){var -d=b?[0,a,hN(b[1])]:[0,a];function -e(a,b,c){return dg(a,b,c)}function -f(a){return a}return function(a){return cd(f,a)}(function(a){return e(c,An,a)}(kV(aN,d)))}function -Ao(a,b){var +i=dN(c,"put",d),j=f[2];return function(a){return cJ(j,a)}(i)}];return[0,,d[1],d[2],,d[4],,d[6],d[7],,,,,,d[13],d[14],d[15],d[16],function(a,b,c){return Az([0,function(a){return a},d[1],d[2],d[13],d[14],d[15],d[16]],a,b,c)}]}function +AH(f,b){var +c=f[3],d=f[2];function +g(a,b){return me(d,a,b)}var +a=function(a){return g(c,a)}(b),e=[0,,,,a[4],a[5],,,a[8],,,a[11],,b];return[0,,,,,e[4],e[5],,,e[8],,,e[11],,e[13],function(a,b,c,d){return dE(f[5],[0,function(a){return a},e[13]],a,b,c,d)}]}function +cp(a,b){var +c=AH(a,b);return[0,c[14],function(a){return a},,,c[9],,,c[5],c[6],,,,,c[12],c[15]]}function +c5(a,b){var +c=AF(a,b);return[0,,,,c[5],,c[7],c[8],,,,function(a){return a},c[2],c[3],c[14],c[15],c[16],c[17],c[18]]}function +Ah(a){return a["oldVersion"]}function +Ai(a){return a["newVersion"]}function +An(a){return d7(function(a){if(0===a[0])return a[1];var +b=a[1];iT([0,Ao,[0,b,0]]);throw i([0,eU,b],1)},bE(a))}function +AD(a,b){a.deleteObjectStore(aA(b));return 0}function +AE(a){return function(a){return gl(bj,a)}(a["objectStoreNames"])}function +AI(c,b){gp(0,Aj,function(a){function +b(a){return a}return j(c,a,function(a){return cJ(b,a)}(zF(a)))},b[1]);return b}function +AJ(a,b,c){var +d=b?[0,a,hZ(b[1])]:[0,a];function +e(a,b,c){return dN(a,b,c)}function +f(a){return a}return function(a){return cJ(f,a)}(function(a){return e(c,AK,a)}(k2(aA,d)))}function +AL(a,b){var c=a?a[1]:C;return c["indexedDB"]}function -dt(a,b){return a===b?1:0}function -e3(a,b){return a=0){var b=g;for(;;){var -e=(c-1|0)-b|0,h=p(a,b)[1+b];a[1+b]=p(a,e)[1+e];var -f=(c-1|0)-b|0;p(a,f)[1+f]=h;var -i=b+1|0;if(d===b)break;b=i}}}return}function -Aq(i,e){return function(a,b){var -d=a,c=b;for(;;){if(dt(c,e.length-1)){var -f=hZ(d);Ap(f);return f}var -h=g(i,p(e,c)[1+c]);if(h){d=[0,h[1],d];c=c+1|0}else +e=(c-1|0)-b|0,h=q(a,b)[1+b];a[1+b]=q(a,e)[1+e];var +f=(c-1|0)-b|0;q(a,f)[1+f]=h;var +i=b+1|0;if(d===b)break;b=i}}}}function +AO(i,e){return function(a,b){var +d=a,c=b;for(;;){if(gv(c,e.length-1)){var +f=ic(d);AN(f);return f}var +h=g(i,q(e,c)[1+c]);if(h){d=[0,h[1],d];c=c+1|0}else c=c+1|0}}(0,0)}function -me(c,b){return Aq(function(a){return g(c,a)?[0,a]:0},b)}function -Ar(a){return a}function -iG(a,b){return Ne(a,b)}function -mf(a){return 82908052<=a?749039939<=a?756711075<=a?2:6:737308346<=a?4:3:nI<=a?4100401<=a?1:7:-605101559<=a?5:0}function -As(a){return typeof -a==="number"?737455525<=a?1:0:15681<=a[1]?30+mf(a[2])|0:40+mf(a[2])|0}(function(a){var -b=As(a);return g(X(At),b)}(-101336657));function -mg(a,b){return tC(a,b)}function -Au(a){return yc(a)}function -iH(f,b){return function(a,b){var -d=a,c=b;for(;;){if(!c)return bI(d);var -h=c[2],e=g(f,c[1]),i=e?[0,e[1],d]:d;d=i;c=h}}(0,b)}function -Av(a){return a?0:1}function -Aw(a,b){return function(a,b,c){var +mg(c,b){return AO(function(a){return g(c,a)?[0,a]:0},b)}function +AP(a){return a}function +gy(a,b){return Oo(a,b)}function +mh(a){return 82908052<=a?749039939<=a?756711075<=a?2:6:737308346<=a?4:3:n2<=a?4100401<=a?1:7:-605101559<=a?5:0}function +AQ(a){return typeof +a==="number"?737455525<=a?1:0:15681<=a[1]?30+mh(a[2])|0:40+mh(a[2])|0}(function(a){var +b=AQ(a);return g(Y(AR),b)}(-101336657));function +mi(a,b){return tY(a,b)}function +AS(a,b){return a===b?1:0}function +AT(a){return yx(a)}function +AV(a,b){return function(a,b,c){var e=b,d=c;for(;;){if(!d)return 0;var -f=d[2];j(a,e,d[1]);e=e+1|0;d=f}}(a,0,b)}function -Ax(a){var -b=kY(a),d=b[4];return[0,,,b[1],,,,,,,,,,,,,,,,,,,,,,,,,b[26],,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,b,c){function -f(a,b,c){return c?[0,bT(e,a,b,c[1])]:[0,b]}return eK(function(a,b){var +g=d[2],f=j(a,e,d[1]);if(f)return f;e=e+1|0;d=g}}(a,0,b)}function +AU(a){var +b=a;for(;;){if(!b)return 0;var +c=b[1];if(!b[2])return[0,c];b=b[2]}}function +AW(c,b){return AV(function(a){return c},b)}function +AX(a,b){return function(a,b,c){var +e=b,d=c;for(;;){if(!d)return cc(e);var +f=d[1],h=d[2];if(h8(g(a,f),h))d=h;else{e=[0,f,e];d=d[2]}}}(a,0,b)}function +AY(a){var +b=k6(a),d=b[4];return[0,,,b[1],,,,,,,,,,,,,,,,,,,,,,,,,b[26],,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,b,c){function +f(a,b,c){return c?[0,ct(e,a,b,c[1])]:[0,b]}return cC(function(a,b){var c=b[1],e=b[2];return d(c,function(a){return f(c,e,a)},a)},b,c)}]}function -mh(a){var -b=Ax(a);return[0,b[3],,,,,,,,,,,,,,,,,,b[28],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[57]]}function -iI(a,b){return b?[0,g(a,b[1])]:0}function -gn(a,b){return a?a[1]:b}function -Ay(a){return a?0:1}function -Az(a,b){return b?g(a,b[1]):0}function -AA(a,b){return b?b[1]:a}ln(0);function -mi(a,b){return 0===b[0]?b:[1,g(a,b[1])]}function -AB(a,b){if(0!==b[0])return;g(a,b[1]);return}var -AD=[L,AC,a5(0)];function -bN(a){if(0===a[0])return a[1];throw i(AD,1)}function -mj(a,b){return AB(b,a)}function -AE(a,b){return 0===a[0]?a[1]:b}function -AF(a){return function(a,b){var -d=a,c=b;for(;;){if(!c)return[0,bI(d)];var +mj(a){var +b=AY(a);return[0,b[3],,,,,,,,,,,,,,,,,,b[28],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[57]]}function +mk(a,b){return b?b[1]:a}function +iX(a,b){return a?a[1]:b}lt(0);function +ml(a,b){return 0===b[0]?b:[1,g(a,b[1])]}function +AZ(a,b){if(0!==b[0])return;g(a,b[1])}var +A1=[J,A0,a4(0)];function +c6(a){if(0===a[0])return a[1];throw i(A1,1)}function +mm(a){return function(a,b){var +d=a,c=b;for(;;){if(!c)return[0,cc(d)];var e=c[1];if(0!==e[0])return[1,e[1]];d=[0,e[1],d];c=c[2]}}(0,a)}function -AG(a){var -b=kX(a);return[0,,,,b[1],b[2],,,,,b[7],,,,,,,,,,,,,,,,,,,,,,,b[30],,,,,,,b[38],,,,,,,,,,,b[10]]}function -mk(a){var -b=AG(a);return[0,b[4],b[5],,,,,b[10],,,,,,,,,,,,,,,b[33],,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function -iJ(a){return m(a)}function -AJ(a){return m(a[2])}function -AK(a){return a?function(a,b){return ai(a,(m(a)-b|0)-1|0)}:function(a,b){return ai(a,b)}}function -AL(a,b){var -f=iJ(b),g=AK(a);if(0===f)return[0,[0],b];if(1===f)return[0,[0,-1],b];var -e=cx(f,0);p(e,0)[1]=-1;var -d=[0,2],c=[0,0];for(;;){if(!e3(d[1],f))return[0,e,b];var -l=c[1],m=g(b,c[1]);if(kI(g(b,d[1]-1|0),m)){c[1]++;var -h=d[1],n=c[1];p(e,h)[1+h]=n;d[1]++}else if(0===l){var -j=d[1];p(e,j)[1+j]=0;d[1]++}else{if(!d4(c[1],0))throw i([0,u,AM],1);var -k=c[1];c[1]=p(e,k)[1+k]}}}function -AN(a){return AL(0,a)}function -AO(a,b,c){var -e=[0,c],d=[0,0],j=iJ(b),g=AJ(a);for(;;){if(e3(d[1],g)&&e3(e[1]+d[1]|0,j)){var -k=ai(b,e[1]+d[1]|0);if(kI(k,ai(a[2],d[1])))d[1]++;else{var -h=d[1],f=p(a[1],h)[1+h];if(gm(f,0)){if(!e3(f,d[1]))throw i([0,u,AP],1);e[1]=(e[1]+d[1]|0)-f|0;d[1]=f}else{d[1]=0;e[1]++}}continue}return dt(d[1],g)?e[1]:-1}}function -AH(a){return kU(a,AI)}function -AQ(a){return dt(iJ(a),1)?[0,ai(a,0)]:[1,AN(a)]}function -AR(a,b,c){var -d=a?a[1]:0;if(0!==b[0])return AO(b[1],c,d);var -f=b[1];try{var -g=t8(c,d,f);return g}catch(f){var -e=an(f);if(e===bG)return-1;throw i(e,0)}}function -AS(d,b){var -e=m(d);return d4(e,m(b))?0:function(a){var -c=a;for(;;){if(dt(c,e))return 1;if(a6(b,c)!==a6(d,c))return 0;c=c+1|0}}(0)}function -AT(d,b){var -c=bs(m(b));t5(function(a){var -b=g(d,a);return b?o(c,a):b},b);return bJ(c)}function -ml(a,b){var -c=M5(b[1]),d=b[3],e=b[2];return bT(k(a)(AU),e,d,c)}function -mm(a,b){return g(k(a)(AV),m(b))}function +A2(a,b){return AZ(b,a)}function +A3(a){var +b=k5(a);return[0,,,,,,,,,,b[7],,,,,,,,,,,,,,,,,,,,,,,b[30],,,,,,,b[38],,,,,,,,,,,b[10]]}function mn(a){var -b=bs(20);return lS(function(a){cD(a,0);return P(bJ(b))},dX(b),a)}function -mo(a){return[0,lj(xP,xQ,a),0,a]}mo(0);function -AW(a,b){return fj(mn(AX),mm,a,ml,b)}function -AY(a,b){return fj(mn(AZ),mm,a,ml,b)}function -A0(a,b,c,d,e){if(0<=e&&0<=b&&0<=d&&(m(a)-b|0)>=e)return(c[3]-d|0)=0){var +d=g;for(;;){var +h=ag(c,d);j(a,ag(b,d),h);var +i=d+1|0;if(e===d)break;d=i}}}function +Bh(d,b,c){try{Bf(function(a,b){var +c=1-j(d,a,b);if(c)throw i(mo,1);return c},b,c);var +e=1;return e}catch(f){var +a=al(f);if(a===mo)return 0;throw i(a,0)}}function +A4(a){return ib(a,A5)}function +Bb(a){return gv(eZ(a),1)?[0,ag(a,0)]:[1,A_(a)]}function +Bc(a,b,c){var +d=a?a[1]:0;if(0!==b[0])return A$(b[1],c,d);var +f=b[1];try{var +g=ut(c,d,f);return g}catch(f){var +e=al(f);if(e===bZ)return-1;throw i(e,0)}}function +Bd(d,b){var +c=bA(m(b));uq(function(a){var +b=g(d,a);return b?o(c,a):b},b);return bL(c)}function +Bi(a,b){var +c=gv(m(a),m(b));return c?Bh(function(a,b){var +c=h5(b);return h6(h5(a),c)},a,b):c}function +mp(a,b){var +c=Od(b[1]),d=b[3],e=b[2];return ct(k(a)(Bj),e,d,c)}function +mq(a,b){return g(k(a)(Bk),m(b))}function +mr(a){var +b=bA(20);return lX(function(a){cI(a,0);return L(bL(b))},d2(b),a)}function +ms(a){return[0,lp(x9,x_,a),0,a]}ms(0);function +Bl(a,b){return fj(mr(Bm),mq,a,mp,b)}function +Bn(a,b){return fj(mr(Bo),mq,a,mp,b)}function +Bp(a,b,c,d,e){if(0<=e&&0<=b&&0<=d&&(m(a)-b|0)>=e)return(c[3]-d|0)=0){var c=h;for(;;){var -e=c%16|0,i=r9(b[1],b[2]+c|0);dB(k(a)(A7),f,e,i,g,e);var -j=c+1|0;if(d===c)break;c=j}}return ij(a,0)});function -A3(a,b,c,d){return A2(A0,function(a){return m(a)},a,b,c,d)}A3(0,0,0,A9);function -A_(a,b){return bg(b,a)}function -A$(a,c){function +e=c%16|0,i=ss(b[1],b[2]+c|0);dE(k(a)(Bw),f,e,i,g,e);var +j=c+1|0;if(d===c)break;c=j}}return iA(a,0)});function +Bs(a,b,c,d){return Br(Bp,function(a){return m(a)},a,b,c,d)}Bs(0,0,0,By);function +Bz(a,b){return bz(b,a)}function +BA(a,c){function o(a,b){var e=a,d=b;for(;;){if(!d)return e;var c=d[1];e=[0,c[1],[0,c[2],[0,c[3],[0,c[4],[0,c[5],[0,c[6],[0,c[7],[0,c[8],[0,c[9],e]]]]]]]]];d=d[2]}}return function(a,b){var @@ -3137,1338 +3084,1375 @@ k=j[2];if(k){var l=k[2];if(l){var m=l[2];if(m){var n=m[2];if(n){var -p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=h[1],x=f[1],y=g(c,d[1]),z=g(c,x),A=g(c,w),B=g(c,v),C=g(c,u),D=g(c,t),E=g(c,s),F=g(c,r);e=[0,[0,y,z,A,B,C,D,E,F,g(c,q)],e];d=p;continue}}}}}}}}}return o(A_(d,c),e)}}(0,a)}function -mp(a,b,c){if(!b)return 0;var +p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=h[1],x=f[1],y=g(c,d[1]),z=g(c,x),A=g(c,w),B=g(c,v),C=g(c,u),D=g(c,t),E=g(c,s),F=g(c,r);e=[0,[0,y,z,A,B,C,D,E,F,g(c,q)],e];d=p;continue}}}}}}}}}return o(Bz(d,c),e)}}(0,a)}function +mt(a,b,c){if(!b)return 0;var f=b[2],d=b[1];if(!f)return[0,g(a,d),0];var h=f[2],e=f[1];if(!h){var z=g(a,d);return[0,z,[0,g(a,e),0]]}var i=h[2],j=h[1];if(!i){var x=g(a,d),y=g(a,e);return[0,x,[0,y,[0,g(a,j),0]]]}var k=i[2],l=i[1];if(k){var -m=k[2],n=k[1],o=g(a,d),p=g(a,e),q=g(a,j),r=g(a,l),s=g(a,n),t=50=0){var d=f;for(;;){var -c=ai(b,d);a:if(34===c)k(a)(Be);else if(32<=c)if(92===c)k(a)(Bf);else -g(k(a)(Bg),c);else{if(14>c)switch(c){case -8:k(a)(Bi);break a;case -9:k(a)(Bj);break a;case -10:k(a)(Bk);break a;case -13:k(a)(Bl);break a}g(k(a)(Bh),c)}var -h=d+1|0;if(e===d)break;d=h}}return k(a)(Bd)}var -Ba=[0,function(a){if(typeof -a==="number")return cL;var -b=a[1];if(fB>b)return cS<=b?ba<=b?[0,ba,a[2]]:[0,ba,a[2]]:dC<=b?[0,f,a[2]]:[0,f,a[2]];if(fu===b)return[0,65,a[2]];if(h<=b)return K<=b?[0,79,a[2]]:[0,65,a[2]];if(bc<=b)return[0,bc,a[2]];var +c=ag(b,d);a:if(34===c)k(a)(BF);else if(32<=c)if(92===c)k(a)(BG);else +g(k(a)(BH),c);else{if(14>c)switch(c){case +8:k(a)(BJ);break a;case +9:k(a)(BK);break a;case +10:k(a)(BL);break a;case +13:k(a)(BM);break a}g(k(a)(BI),c)}var +h=d+1|0;if(e===d)break;d=h}}return k(a)(BE)}var +BB=[0,function(a){if(typeof +a==="number")return cQ;var +b=a[1];if(fF>b)return cV<=b?bd<=b?[0,bd,a[2]]:[0,bd,a[2]]:dF<=b?[0,f,a[2]]:[0,f,a[2]];if(fy===b)return[0,65,a[2]];if(h<=b)return E<=b?[0,79,a[2]]:[0,65,a[2]];if(bf<=b)return[0,bf,a[2]];var c=a[2],d=c[2],e=c[1];return d?[0,65,[0,[0,f,e],[0,d[1],0]]]:[0,f,e]},function(a){if(typeof -a==="number")return cL;var -b=a[1];return 65===b?[0,h,a[2]]:ba<=b?bc<=b?[0,bc,a[2]]:[0,ba,a[2]]:79<=b?[0,K,a[2]]:[0,f,a[2]]},function(a){return[0,0]}(0)];function -Bm(a,b,c,d,e){var -l=a?a[1]:0,h=b?b[1]:Bb;function +a==="number")return cQ;var +b=a[1];return 65===b?[0,h,a[2]]:bd<=b?bf<=b?[0,bf,a[2]]:[0,bd,a[2]]:79<=b?[0,E,a[2]]:[0,f,a[2]]},function(a){return[0,0]}(0)];function +BN(a,b,c,d,e){var +l=a?a[1]:0,h=b?b[1]:BC;function f(a,b){var d=g(c[1],b);if(typeof -d==="number")return k(a)(Bn);var +d==="number")return k(a)(BO);var e=d[1];if(65===e){var -n=[0,function(a,b){return k(a)(Bo)}],m=d[2];return j(k(a)(Bp),function(a,b){return gf(n,f,a,b)},m)}if(ba<=e){if(bc<=e)return d[2]?k(a)(Bq):k(a)(Br);var -i=d[2],l=sv(i),o=l[2];return l[1]==0.?g(k(a)(Bs),o):g(k(a)(Bt),i)}if(79>e)return j(h,a,d[2]);function +n=[0,function(a,b){return k(a)(BP)}],m=d[2];return j(k(a)(BQ),function(a,b){return gi(n,f,a,b)},m)}if(bd<=e){if(bf<=e)return d[2]?k(a)(BR):k(a)(BS);var +i=d[2],l=sQ(i),o=l[2];return l[1]===0.?g(k(a)(BT),o):g(k(a)(BU),i)}if(79>e)return j(h,a,d[2]);function q(a,b){var -c=b[2],d=b[1];return fj(k(a)(Bv),h,d,f,c)}var -r=[0,function(a,b){return k(a)(Bu)}],p=d[2];return j(k(a)(Bw),function(a,b){return gf(r,q,a,b)},p)}function +c=b[2],d=b[1];return fj(k(a)(BW),h,d,f,c)}var +r=[0,function(a,b){return k(a)(BV)}],p=d[2];return j(k(a)(BX),function(a,b){return gi(r,q,a,b)},p)}function i(a,b){var d=g(c[1],b);if(typeof d!=="number"){var e=d[1];if(65===e){var -l=d[2];if(!l)return k(a)(Bz);var -n=[0,function(a,b){return k(a)(Bx)}];return j(k(a)(By),function(a,b){return gf(n,i,a,b)},l)}if(79===e){var -m=d[2];if(!m)return k(a)(BD);var +l=d[2];if(!l)return k(a)(B0);var +n=[0,function(a,b){return k(a)(BY)}];return j(k(a)(BZ),function(a,b){return gi(n,i,a,b)},l)}if(79===e){var +m=d[2];if(!m)return k(a)(B4);var o=function(a,b){var -c=b[2],d=b[1];return fj(k(a)(BB),h,d,i,c)},p=[0,function(a,b){return k(a)(BA)}];return j(k(a)(BC),function(a,b){return gf(p,o,a,b)},m)}}return f(a,b)}return l?f(d,e):i(d,e)}function -BE(a){function +c=b[2],d=b[1];return fj(k(a)(B2),h,d,i,c)},p=[0,function(a,b){return k(a)(B1)}];return j(k(a)(B3),function(a,b){return gi(p,o,a,b)},m)}}return f(a,b)}return l?f(d,e):i(d,e)}function +B5(a){function d(a){if(typeof -a==="number")return cL;var -b=a[1];if(65===b)return[0,h,mq(d,a[2])];if(ba>b)return 79<=b?[0,K,mq(function(a){var -b=a[1];return[0,b,d(a[2])]},a[2])]:[0,f,a[2]];if(bc<=b)return[0,bc,a[2]];var -e=a[2],i=sv(e),c=i[2];if(i[1]!=0.)return[0,ba,e];if(-1073741824.<=c&&c<=pW)return[0,cS,c|0];return[0,dC,g(X(BF),c)]}return d(a)}function -av(a,b){return cU(a,b)}function -d5(a,b,c){al(a,b,c);return}var -mr=bH(nC);function -aF(a,b,c){return[0,fs,dM(a,b,c)]}function -go(a,b,c,d,e){var -f=am(2),i=fV(c,d,e);if(a)var +a==="number")return cQ;var +b=a[1];if(65===b)return[0,h,mu(d,a[2])];if(bd>b)return 79<=b?[0,E,mu(function(a){var +b=a[1];return[0,b,d(a[2])]},a[2])]:[0,f,a[2]];if(bf<=b)return[0,bf,a[2]];var +e=a[2],i=sQ(e),c=i[2];if(i[1]!==0.)return[0,bd,e];if(-1073741824.<=c&&c<=qg)return[0,cV,c|0];return[0,dF,g(Y(B6),c)]}return d(a)}function +aw(a,b){return cA(a,b)}function +d_(a,b,c){ao(a,b,c)}var +mv=bK(nV);function +aJ(a,b,c){return[0,fw,dQ(a,b,c)]}function +gz(a,b,c,d,e){var +f=ap(2),i=fY(c,d,e);if(a)var h=1,g=0;else var -h=0,g=1;d5(f,g,b>>>8|0);d5(f,h,b&c_);return[0,fs,a8(tK(f,i))]}var -BL=bH(rb),e4=BO.slice();function -BG(a,b){return P(j(X(BH),a,b))}function -BI(a){return a}function -BJ(a,b,c,d,e){b$(a,b,c,d,e);return}function -BK(a,b){return a[1+b]}function -BM(a,b){var -c=av(a,b);return cK>>0)throw i([0,u,BP],1);switch(l){case -0:return d(av(a,b));case +h=0,g=1;d_(f,g,b>>>8|0);d_(f,h,b&dd);return[0,fw,a$(t7(f,i))]}var +Ca=bK(rv),e0=Cd.slice();function +B7(a,b){return L(j(Y(B8),a,b))}function +B9(a){return a}function +B_(a,b,c,d,e){b$(a,b,c,d,e)}function +B$(a,b){return a[1+b]}function +Cb(a,b){var +c=aw(a,b);return cP>>0)throw i([0,u,Ce],1);switch(l){case +0:return d(aw(a,b));case 1:var -q=av(a,b),m=av(a,b+1|0);return 2===(m>>>6|0)?d((q&31)<<6|m&63):aF(a,b,c);case +q=aw(a,b),m=aw(a,b+1|0);return 2===(m>>>6|0)?d((q&31)<<6|m&63):aJ(a,b,c);case 2:var -g=av(a,b),e=av(a,b+1|0),n=av(a,b+2|0),h=(g&15)<<12|(e&63)<<6|n&63;if(2!==(n>>>6|0))return aF(a,b,c);if(ep===g){if(nB<=e&&he>=e)return d(h);return aF(a,b,c)}if(hf!==g)return 2===(e>>>6|0)?d(h):aF(a,b,c);if(M<=e&&159>=e)return d(h);return aF(a,b,c);default:var -j=av(a,b),f=av(a,b+1|0),o=av(a,b+2|0),p=av(a,b+3|0),k=(j&7)<<18|(f&63)<<12|(o&63)<<6|p&63;if(2===(p>>>6|0)&&2===(o>>>6|0)){if(ed===j){if(rw<=f&&he>=f)return d(k);return aF(a,b,c)}if(rf!==j)return 2===(f>>>6|0)?d(k):aF(a,b,c);if(M<=f&&143>=f)return d(k);return aF(a,b,c)}return aF(a,b,c)}}function -e5(a,b,c){var -e=av(a,b),d=e<<8|av(a,c);if(jf<=d&&fn>=d)return j2=e)return[0,aB,bH(((a&ft)<<10|e&ft)+eg|0)];return go(c=(c+d|0)){if(0===d)return ms(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return BG(c,d)}function -d6(a,b){var +g=aw(a,b),e=aw(a,b+1|0),n=aw(a,b+2|0),h=(g&15)<<12|(e&63)<<6|n&63;if(2!==(n>>>6|0))return aJ(a,b,c);if(er===g){if(nU<=e&&hm>=e)return d(h);return aJ(a,b,c)}if(hn!==g)return 2===(e>>>6|0)?d(h):aJ(a,b,c);if(K<=e&&159>=e)return d(h);return aJ(a,b,c);default:var +j=aw(a,b),f=aw(a,b+1|0),o=aw(a,b+2|0),p=aw(a,b+3|0),k=(j&7)<<18|(f&63)<<12|(o&63)<<6|p&63;if(2===(p>>>6|0)&&2===(o>>>6|0)){if(ei===j){if(rR<=f&&hm>=f)return d(k);return aJ(a,b,c)}if(rz!==j)return 2===(f>>>6|0)?d(k):aJ(a,b,c);if(K<=f&&143>=f)return d(k);return aJ(a,b,c)}return aJ(a,b,c)}}function +e1(a,b,c){var +e=aw(a,b),d=e<<8|aw(a,c);if(jq<=d&&fq>=d)return ke=e)return[0,aE,bK(((a&fx)<<10|e&fx)+el|0)];return gz(c=(c+d|0)){if(0===d)return mw(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return B7(c,d)}function +d$(a,b){var c=b[1];if(typeof -c==="number"){b[18]=a;return hb}if(nv<=c[1]){var -d=s1(c[2],b[5],0,aR(b[5]));B1(b,b[5],0,d);return g(a,b)}ms(b);return g(a,b)}function -d7(a,b){a[9]=0;a[10]=b;return}function +c==="number"){b[18]=a;return hj}if(nO<=c[1]){var +d=tl(c[2],b[5],0,aU(b[5]));Cq(b,b[5],0,d);return g(a,b)}mw(b);return g(a,b)}function +ea(a,b){a[9]=0;a[10]=b}function ce(c,b){function -d(a,b){BJ(a[5],a[6],a[8],a[9],b);a[6]=a[6]+b|0;a[9]=a[9]+b|0;return}var -a=c1(b);if(0>a)return g(c,b);var -e=b[10]-b[9]|0;return a=b)return 0<=b?d6(iK,a):cv;var -c=a[6];a[6]=a[6]+1|0;return S(iK,BM(a[5],c),1,a)}function -iL(a){var -b=c1(a);if(0>=b)return 0<=b?d6(iL,a):cv;var -c=a[6];a[6]=a[6]+1|0;return S(iL,BN(a[5],c),1,a)}function -gq(a){if(a[9]=c)return 0<=c?d6(bh,a):cv;var -b=BK(e4,av(a[5],a[6]));if(c=a[10])return mv(e5(a[8],0,1),a);var -b=a[9];return S(cf,aF(a[8],0,a[9]),b,a)}function -mv(a,b){if(fs<=a[1])return S(cf,a,2,b);var -c=a[2];if(2<=c1(b)){var -d=b[6];b[6]=b[6]+2|0;return S(cf,gp(c,b[5],d,d+1|0),4,b)}d7(b,2);return ce(function(a){return mt(c,a)},b)}function +d(a,b){B_(a[5],a[6],a[8],a[9],b);a[6]=a[6]+b|0;a[9]=a[9]+b|0}var +a=c7(b);if(0>a)return g(c,b);var +e=b[10]-b[9]|0;return a=b)return 0<=b?d$(iY,a):cx;var +c=a[6];a[6]=a[6]+1|0;return R(iY,Cb(a[5],c),1,a)}function +iZ(a){var +b=c7(a);if(0>=b)return 0<=b?d$(iZ,a):cx;var +c=a[6];a[6]=a[6]+1|0;return R(iZ,Cc(a[5],c),1,a)}function +gB(a){if(a[9]=c)return 0<=c?d$(bk,a):cx;var +b=B$(e0,aw(a[5],a[6]));if(c=a[10])return mz(e1(a[8],0,1),a);var +b=a[9];return R(cf,aJ(a[8],0,a[9]),b,a)}function +mz(a,b){if(fw<=a[1])return R(cf,a,2,b);var +c=a[2];if(2<=c7(b)){var +d=b[6];b[6]=b[6]+2|0;return R(cf,gA(c,b[5],d,d+1|0),4,b)}ea(b,2);return ce(function(a){return mx(c,a)},b)}function cf(a){var -b=c1(a);if(0>=b)return 0<=b?d6(cf,a):cv;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return mv(e5(a[5],c,c+1|0),a)}d7(a,2);return ce(mu,a)}function -mw(a,b){var -c=b[9]+2|0;return b[9]=a[10])return my(e5(a[8],1,0),a);var -b=a[9];return S(cs,aF(a[8],0,a[9]),b,a)}function -my(a,b){if(fs<=a[1])return S(cs,a,2,b);var -c=a[2];if(2<=c1(b)){var -d=b[6];b[6]=b[6]+2|0;return S(cs,gp(c,b[5],d+1|0,d),4,b)}d7(b,2);return ce(function(a){return mw(c,a)},b)}function -cs(a){var -b=c1(a);if(0>=b)return 0<=b?d6(cs,a):cv;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return my(e5(a[5],c+1|0,c),a)}d7(a,2);return ce(mx,a)}function -B2(a){function +b=c7(a);if(0>=b)return 0<=b?d$(cf,a):cx;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return mz(e1(a[5],c,c+1|0),a)}ea(a,2);return ce(my,a)}function +mA(a,b){var +c=b[9]+2|0;return b[9]=a[10])return mC(e1(a[8],1,0),a);var +b=a[9];return R(cq,aJ(a[8],0,a[9]),b,a)}function +mC(a,b){if(fw<=a[1])return R(cq,a,2,b);var +c=a[2];if(2<=c7(b)){var +d=b[6];b[6]=b[6]+2|0;return R(cq,gA(c,b[5],d+1|0,d),4,b)}ea(b,2);return ce(function(a){return mA(c,a)},b)}function +cq(a){var +b=c7(a);if(0>=b)return 0<=b?d$(cq,a):cx;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return mC(e1(a[5],c+1|0,c),a)}ea(a,2);return ce(mB,a)}function +Cr(a){function d(a){var -b=av(a[8],2),c=p(e4,b)[1+b];return 0===c?S(bh,aF(a[8],2,1),1,a):(a[10]=c,a[9]=1,d5(a[8],0,b),ce(gq,a))}var -b=av(a[8],0);function +b=aw(a[8],2),c=q(e0,b)[1+b];return 0===c?R(bk,aJ(a[8],2,1),1,a):(a[10]=c,a[9]=1,d_(a[8],0,b),ce(gB,a))}var +b=aw(a[8],0);function f(a){var -b=av(a[8],1),e=2>>0)throw i([0,u,B3],1);switch(e){case -0:return S(c,aF(a[8],0,1),1,a);case -1:return S(c,du(a[8],0,1),1,a);case -2:return 2<=a[9]?3<=a[9]?S(d,du(a[8],0,2),2,a):S(bh,du(a[8],0,2),2,a):S(bh,aF(a[8],0,1),1,a);case -3:if(3<=a[9])return S(bh,du(a[8],0,3),3,a);var -g=a[9];return S(bh,aF(a[8],0,a[9]),g,a);default:if(3<=a[9]){a[10]=4;return ce(gq,a)}var -h=a[9];return S(bh,aF(a[8],0,a[9]),h,a)}}function -mz(a,b,c){if(b)var -j=1,i=0,h=mt,d=mu,f=cf;else +b=aw(a[8],1),e=2>>0)throw i([0,u,Cs],1);switch(e){case +0:return R(c,aJ(a[8],0,1),1,a);case +1:return R(c,dx(a[8],0,1),1,a);case +2:return 2<=a[9]?3<=a[9]?R(d,dx(a[8],0,2),2,a):R(bk,dx(a[8],0,2),2,a):R(bk,aJ(a[8],0,1),1,a);case +3:if(3<=a[9])return R(bk,dx(a[8],0,3),3,a);var +g=a[9];return R(bk,aJ(a[8],0,a[9]),g,a);default:if(3<=a[9]){a[10]=4;return ce(gB,a)}var +h=a[9];return R(bk,aJ(a[8],0,a[9]),h,a)}}function +mD(a,b,c){if(b)var +j=1,i=0,h=mx,d=my,f=cf;else var -j=0,i=1,h=mw,d=mx,f=cs;function +j=0,i=1,h=mA,d=mB,f=cq;function e(a,b){if(3>b[9])return f(b);b[10]=2;b[9]=1;var -c=av(b[8],2);d5(b[8],0,c);return ce(a,b)}if(typeof -c!=="number")return S(function(a){return e(d,a)},[0,aB,bH(c[2])],2,a);if(fp>c)return S(function(a){return e(d,a)},[0,aB,mr],2,a);var -g=e5(a[8],i,j);if(fs<=g[1])return S(function(a){return e(d,a)},g,2,a);var +c=aw(b[8],2);d_(b[8],0,c);return ce(a,b)}if(typeof +c!=="number")return R(function(a){return e(d,a)},[0,aE,bK(c[2])],2,a);if(fs>c)return R(function(a){return e(d,a)},[0,aE,mv],2,a);var +g=e1(a[8],i,j);if(fw<=g[1])return R(function(a){return e(d,a)},g,2,a);var k=g[2];if(3<=a[9]){var l=function(a){return h(k,a)};return function(a){return e(l,a)}(a)}var -m=a[9];return S(f,go(b,k,fU,0,0),m,a)}function -B4(a){d7(a,3);return ce(function(a){var -b=BQ(a[8],0,a[9]),c=b[1];if(eq===c){var -e=b[2];a[2]=eq;a[18]=cs;return mz(a,0,e)}if(c$<=c){var -d=b[2];a[2]=c$;a[18]=bh;return cv===d?cv:fp<=d?B2(a):S(bh,[0,aB,mr],3,a)}var -f=b[2];a[2]=fx;a[18]=cf;return mz(a,1,f)},a)}function -bO(a){a[14]=0;a[13]=a[13]+1|0;return}function -c2(a){a[14]=a[14]+1|0;return}function -aG(a){a[16]=a[16]+1|0;return}function -aH(a,b){a[12]=b;return}function -B5(a,b,c,d){if(aB>d[1]){c[11]=0;c[17]=b;return j(c[17],c,d)}var -e=br(d[2]);if(nC===e){if(a){c[2]=fx;c[18]=cf}c[11]=1;c[17]=b;return g(c[18],c)}if(65534===e&&a){c[2]=eq;c[18]=cs;c[11]=1;c[17]=b;return g(c[18],c)}c[11]=0;c[17]=b;return j(c[17],c,d)}function -B6(a,b){if(aB>b[1]){aH(a,0);aG(a);c2(a);return b}var -c=br(b[2])+ju|0;a:{if(jR>>0){var -d=c+ej|0;if(3>>0)break a;switch(d){case +m=a[9];return R(f,gz(b,k,fX,0,0),m,a)}function +Ct(a){ea(a,3);return ce(function(a){var +b=Cf(a[8],0,a[9]),c=b[1];if(es===c){var +e=b[2];a[2]=es;a[18]=cq;return mD(a,0,e)}if(de<=c){var +d=b[2];a[2]=de;a[18]=bk;return cx===d?cx:fs<=d?Cr(a):R(bk,[0,aE,mv],3,a)}var +f=b[2];a[2]=fB;a[18]=cf;return mD(a,1,f)},a)}function +bO(a){a[14]=0;a[13]=a[13]+1|0}function +c8(a){a[14]=a[14]+1|0}function +aK(a){a[16]=a[16]+1|0}function +aL(a,b){a[12]=b}function +Cu(a,b,c,d){if(aE>d[1]){c[11]=0;c[17]=b;return j(c[17],c,d)}var +e=by(d[2]);if(nV===e){if(a){c[2]=fB;c[18]=cf}c[11]=1;c[17]=b;return g(c[18],c)}if(65534===e&&a){c[2]=es;c[18]=cq;c[11]=1;c[17]=b;return g(c[18],c)}c[11]=0;c[17]=b;return j(c[17],c,d)}function +Cv(a,b){if(aE>b[1]){aL(a,0);aK(a);c8(a);return b}var +c=by(b[2])+jH|0;a:{if(j4>>0){var +d=c+dJ|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aH(a,0);aG(a);return e?b:(bO(a),b);case +e=a[12];aL(a,0);aK(a);return e?b:(bO(a),b);case 1:break a;case -2:break;default:aH(a,1);aG(a);bO(a);return b}}else if(j4>=c-1>>>0)break a;aH(a,0);aG(a);bO(a);return b}aH(a,0);aG(a);c2(a);return b}function -B7(a,b){if(aB>b[1]){aH(a,0);aG(a);c2(a);return b}var -c=br(b[2])+ju|0;a:{if(jR>>0){var -d=c+ej|0;if(3>>0)break a;switch(d){case +2:break;default:aL(a,1);aK(a);bO(a);return b}}else if(kg>=c-1>>>0)break a;aL(a,0);aK(a);bO(a);return b}aL(a,0);aK(a);c8(a);return b}function +Cw(a,b){if(aE>b[1]){aL(a,0);aK(a);c8(a);return b}var +c=by(b[2])+jH|0;a:{if(j4>>0){var +d=c+dJ|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aH(a,0);return e?g(a[18],a):(aG(a),bO(a),[0,aB,a[4]]);case +e=a[12];aL(a,0);return e?g(a[18],a):(aK(a),bO(a),[0,aE,a[4]]);case 1:break a;case -2:break;default:aH(a,1);aG(a);bO(a);return[0,aB,a[4]]}}else if(j4>=c-1>>>0)break a;aH(a,0);aG(a);bO(a);return[0,aB,a[4]]}aH(a,0);aG(a);c2(a);return b}function -B8(a,b){if(aB>b[1]){aH(a,0);aG(a);c2(a);return b}var -c=br(b[2]);a:{if(14<=c){if(pi<=c){if(8234>c)break a}else if(jY===c){aH(a,0);aG(a);bO(a);return[0,aB,a[4]]}}else if(10<=c)switch(c+nW|0){case +2:break;default:aL(a,1);aK(a);bO(a);return[0,aE,a[4]]}}else if(kg>=c-1>>>0)break a;aL(a,0);aK(a);bO(a);return[0,aE,a[4]]}aL(a,0);aK(a);c8(a);return b}function +Cx(a,b){if(aE>b[1]){aL(a,0);aK(a);c8(a);return b}var +c=by(b[2]);a:{if(14<=c){if(pB<=c){if(8234>c)break a}else if(ka===c){aL(a,0);aK(a);bO(a);return[0,aE,a[4]]}}else if(10<=c)switch(c+oe|0){case 0:var -d=a[12];aH(a,0);return d?g(a[18],a):(aG(a),bO(a),[0,aB,a[4]]);case +d=a[12];aL(a,0);return d?g(a[18],a):(aK(a),bO(a),[0,aE,a[4]]);case 1:break;case -2:break a;default:aH(a,1);aG(a);bO(a);return[0,aB,a[4]]}aH(a,0);aG(a);c2(a);return b}aH(a,0);aG(a);bO(a);return b}function -B9(a,b){if(aB>b[1]){aH(a,0);aG(a);c2(a);return b}var -c=br(b[2])+ju|0;a:{if(jR>>0){var -d=c+ej|0;if(3>>0)break a;switch(d){case +2:break a;default:aL(a,1);aK(a);bO(a);return[0,aE,a[4]]}aL(a,0);aK(a);c8(a);return b}aL(a,0);aK(a);bO(a);return b}function +Cy(a,b){if(aE>b[1]){aL(a,0);aK(a);c8(a);return b}var +c=by(b[2])+jH|0;a:{if(j4>>0){var +d=c+dJ|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aH(a,0);return e?g(a[18],a):(aG(a),bO(a),[0,aB,a[4]]);case +e=a[12];aL(a,0);return e?g(a[18],a):(aK(a),bO(a),[0,aE,a[4]]);case 1:break a;case -2:break;default:aH(a,1);aG(a);bO(a);return[0,aB,a[4]]}}else if(j4>=c-1>>>0)break a;aH(a,0);aG(a);bO(a);return b}aH(a,0);aG(a);c2(a);return b}function -B_(a){return qC<=a?423112016<=a?c$<=a?bh:iK:338302576<=a?iL:cf:eq<=a?cs:cf}function -iM(a){return a[13]}function -iN(a){return a[14]}function -iO(d,b){var -a=br(b);function -c(a){return o(d,BI(a))}return cK>>18|0),c(M|(a>>>12|0)&63),c(M|(a>>>6|0)&63),c(M|a&63)):(c(ep|a>>>12|0),c(M|(a>>>6|0)&63),c(M|a&63)):(c(ht|a>>>6|0),c(M|a&63)):c(a)}function -B$(a,b,c){if(a){var +2:break;default:aL(a,1);aK(a);bO(a);return[0,aE,a[4]]}}else if(kg>=c-1>>>0)break a;aL(a,0);aK(a);bO(a);return b}aL(a,0);aK(a);c8(a);return b}function +Cz(a){return qX<=a?423112016<=a?de<=a?bk:iY:338302576<=a?iZ:cf:es<=a?cq:cf}function +i0(a){return a[13]}function +i1(a){return a[14]}function +i2(d,b){var +a=by(b);function +c(a){return o(d,B9(a))}return cP>>18|0),c(K|(a>>>12|0)&63),c(K|(a>>>6|0)&63),c(K|a&63)):(c(er|a>>>12|0),c(K|(a>>>6|0)&63),c(K|a&63)):(c(hB|a>>>6|0),c(K|a&63)):c(a)}function +CA(a,b,c){if(a){var d=a[1],k=d[1];if(3895880===k)var -f=d[2],e=B8;else if(hg<=k)var -f=d[2],e=B9;else +f=d[2],e=Cx;else if(ho<=k)var +f=d[2],e=Cy;else var -f=d[2],e=B7}else +f=d[2],e=Cw}else var -f=bH(10),e=B6;if(b)var -l=b[1],n=B_(l),g=l;else +f=bK(10),e=Cv;if(b)var +l=b[1],n=Cz(l),g=l;else var -n=B4,g=c$;if(typeof +n=Ct,g=de;if(typeof c==="number")var -j=0,i=1,h=fU;else if(nv<=c[1])var -j=0,i=1,h=am(eg);else +j=0,i=1,h=fX;else if(nO<=c[1])var +j=0,i=1,h=ap(el);else var -o=c[2],j=m(o)-1|0,i=0,h=cZ(o);var -p=qC===g?1:0;return[0,c,g,a,f,h,i,j,am(4),0,0,0,0,1,0,0,0,function(a,b){return B5(p,e,a,b)},n]}function -Ca(a){return g(a[18],a)}function -Cb(a){return a[11]}var -mA=44,gr=br(BL),Cd=10,Ce=34,Cf=93,Cg=en,Ch=47,Ci=92,Cj=42;function -Ck(a){var +o=c[2],j=m(o)-1|0,i=0,h=c2(o);var +p=qX===g?1:0;return[0,c,g,a,f,h,i,j,ap(4),0,0,0,0,1,0,0,0,function(a,b){return Cu(p,e,a,b)},n]}function +CB(a){return g(a[18],a)}function +CC(a){return a[11]}var +mE=44,gC=by(Ca),CE=10,CF=34,CG=93,CH=dK,CI=47,CJ=92,CK=42;function +CL(a){var b=a<=31?1:0;if(b)var c=b;else var d=34===a?1:0,c=d||(92===a?1:0);return c}function -Cl(a){var +CM(a){var b=48<=a?1:0,c=b?a<=57?1:0:b;return c}function -Cm(a){var +CN(a){var c=48<=a?1:0,d=c?a<=57?1:0:c;if(d)var b=d;else{var e=65<=a?1:0,f=e?a<=70?1:0:e;if(f)var b=f;else var -g=97<=a?1:0,b=g?a<=gY?1:0:g}return b}function -gs(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function -mB(a){a:{if(44<=a){var +g=97<=a?1:0,b=g?a<=fn?1:0:g}return b}function +gD(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function +mF(a){a:{if(44<=a){var b=a-45|0;if(79>>0){if(81<=b)break a}else if(48!==b)break a}else if(11<=a){if(32!==a)break a}else if(9>a)break a;return 1}return 0}function -Co(a){return[0,af,[0,eh,[0,-542918501,hT(a)]]]}function -Cp(a){return[0,af,[0,eh,[0,qe,hT(a)]]]}function -Cq(a){return[0,af,[0,eh,[0,p9,a]]]}function -Cr(a){return[0,af,[0,eh,[0,qh,a]]]}function -mC(a){return[0,af,[0,eh,[0,n7,a]]]}function -Cs(a){return[0,af,[0,-635137946,hT(a)]]}function -Ct(a){return[0,af,[0,rp,a]]}function -Cy(a){return[0,af,[0,qB,a]]}function -Cz(a){return[0,af,[0,nD,a]]}function -e6(a,b){return g(k(a)(CI),b)}function -iP(a,b){if(31>=br(b))return e6(a,br(b));var -c=bs(4);iO(c,b);var -d=br(b),e=bJ(c);return bT(k(a)(CJ),e,e6,d)}function -by(a,b){var -c=bH(b);return iO(a[2],c)}function -c3(a){var -b=bH(a[8]);return iO(a[2],b)}function -dv(a){var -b=bJ(a[2]);dP(a[2]);return b}function -mF(a){var -b=iN(a[1]);return[0,iM(a[1]),b]}function -bP(a){a[4]=iM(a[1]);a[5]=iN(a[1]);return}function -aO(a){a[6]=iM(a[1]);a[7]=iN(a[1]);return}function -mG(a){var -b=a[9];if(!b)throw i([0,u,Dd],1);var -c=b[1][2],d=c[2];a[4]=c[1];a[5]=d;return aO(a)}function -mH(a){bP(a);aO(a);var -c=a[9];if(!c)throw i([0,u,De],1);var -b=c[2];if(!b){a[10]=0;a[9]=0;return}if(dD<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b;return}function -d8(a){return cv}function -Y(a,b,c){c[12]=b;return a}function +CP(a){return[0,ai,[0,em,[0,-542918501,h7(a)]]]}function +CQ(a){return[0,ai,[0,em,[0,qz,h7(a)]]]}function +CR(a){return[0,ai,[0,em,[0,qs,a]]]}function +CS(a){return[0,ai,[0,em,[0,qC,a]]]}function +mG(a){return[0,ai,[0,em,[0,op,a]]]}function +CT(a){return[0,ai,[0,-635137946,h7(a)]]}function +CU(a){return[0,ai,[0,rK,a]]}function +CZ(a){return[0,ai,[0,qW,a]]}function +C0(a){return[0,ai,[0,nW,a]]}function +e2(a,b){return g(k(a)(C9),b)}function +i3(a,b){if(31>=by(b))return e2(a,by(b));var +c=bA(4);i2(c,b);var +d=by(b),e=bL(c);return ct(k(a)(C_),e,e2,d)}function +bF(a,b){var +c=bK(b);return i2(a[2],c)}function +c9(a){var +b=bK(a[8]);return i2(a[2],b)}function +dy(a){var +b=bL(a[2]);dU(a[2]);return b}function +mJ(a){var +b=i1(a[1]);return[0,i0(a[1]),b]}function +bP(a){a[4]=i0(a[1]);a[5]=i1(a[1])}function +aR(a){a[6]=i0(a[1]);a[7]=i1(a[1])}function +mK(a){var +b=a[9];if(!b)throw i([0,u,DE],1);var +c=b[1][2],d=c[2];a[4]=c[1];a[5]=d;return aR(a)}function +mL(a){bP(a);aR(a);var +c=a[9];if(!c)throw i([0,u,DF],1);var +b=c[2];if(!b){a[10]=0;a[9]=0;return}if(dH<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b}function +eb(a){return cx}function +Z(a,b,c){c[12]=b;return a}function A(c,b){var -a=Ca(b[1]);if(typeof -a==="number")return hb<=a?Y(hb,function(a){return A(c,a)},b):(b[8]=fT,g(c,b));if(aB<=a[1]){b[8]=br(a[2]);return g(c,b)}var -d=a[2];b[8]=gr;aO(b);return Y(Ct(d),c,b)}function -mI(c,b){if(b[8]!==10&&b[8]!==b8){c3(b);return A(function(a){return mI(c,a)},b)}aO(b);return Y([0,ee,[0,83,dv(b)]],function(a){return A(c,a)},b)}function -e7(a,b,c){if(c[8]===b8){aO(c);return Y(Cu,d8,c)}if(a){if(c[8]===47){aO(c);return Y([0,ee,[0,77,dv(c)]],function(a){return A(b,a)},c)}if(c[8]===42){c3(c);var -d=1;return A(function(a){return e7(d,b,a)},c)}by(c,Cj);c3(c);var -e=0;return A(function(a){return e7(e,b,a)},c)}if(c[8]===42){var -f=1;return A(function(a){return e7(f,b,a)},c)}c3(c);var -g=0;return A(function(a){return e7(g,b,a)},c)}function -Df(c,b){if(b[8]===47)return A(function(a){return mI(c,a)},b);if(b[8]===42){var -d=0;return A(function(a){return e7(d,c,a)},b)}aO(b);return Y(CA,c,b)}function -mJ(c,b){return gs(b[8])?(aO(b),c3(b),A(function(a){return mJ(c,a)},b)):Y([0,nI,dv(b)],c,b)}function -iQ(c,b){if(gs(b[8])){bP(b);return mJ(function(a){return iQ(c,a)},b)}if(b[8]!==47)return g(c,b);bP(b);function -d(a){return iQ(c,a)}return A(function(a){return Df(d,a)},b)}function -mK(c,b){return gs(b[8])?A(function(a){return mK(c,a)},b):g(c,b)}function -cE(a,b){return b[3]?iQ(a,b):mK(a,b)}function -iR(h,b,c,d,e){function -f(a,b,c){by(c,gr);return Y(a,b,c)}if(0=b)return j2=b){by(e,((k&ft)<<10|b&ft)+eg|0);return g(d,e)}return f(Cq(b),d,e)}function -mL(c,b){var -a=b[8];if(34===a){by(b,Ce);return A(c,b)}if(92<=a){if(118>a)switch(a-92|0){case -0:by(b,Ci);return A(c,b);case -6:by(b,8);return A(c,b);case -10:by(b,12);return A(c,b);case -18:by(b,Cd);return A(c,b);case -22:by(b,13);return A(c,b);case -24:by(b,9);return A(c,b);case +a=CB(b[1]);if(typeof +a==="number")return hj<=a?Z(hj,function(a){return A(c,a)},b):(b[8]=fV,g(c,b));if(aE<=a[1]){b[8]=by(a[2]);return g(c,b)}var +d=a[2];b[8]=gC;aR(b);return Z(CU(d),c,b)}function +mM(c,b){if(b[8]!==10&&b[8]!==b9){c9(b);return A(function(a){return mM(c,a)},b)}aR(b);return Z([0,ej,[0,83,dy(b)]],function(a){return A(c,a)},b)}function +e3(a,b,c){if(c[8]===b9){aR(c);return Z(CV,eb,c)}if(a){if(c[8]===47){aR(c);return Z([0,ej,[0,77,dy(c)]],function(a){return A(b,a)},c)}if(c[8]===42){c9(c);var +d=1;return A(function(a){return e3(d,b,a)},c)}bF(c,CK);c9(c);var +e=0;return A(function(a){return e3(e,b,a)},c)}if(c[8]===42){var +f=1;return A(function(a){return e3(f,b,a)},c)}c9(c);var +g=0;return A(function(a){return e3(g,b,a)},c)}function +DG(c,b){if(b[8]===47)return A(function(a){return mM(c,a)},b);if(b[8]===42){var +d=0;return A(function(a){return e3(d,c,a)},b)}aR(b);return Z(C1,c,b)}function +mN(c,b){return gD(b[8])?(aR(b),c9(b),A(function(a){return mN(c,a)},b)):Z([0,n2,dy(b)],c,b)}function +i4(c,b){if(gD(b[8])){bP(b);return mN(function(a){return i4(c,a)},b)}if(b[8]!==47)return g(c,b);bP(b);function +d(a){return i4(c,a)}return A(function(a){return DG(d,a)},b)}function +mO(c,b){return gD(b[8])?A(function(a){return mO(c,a)},b):g(c,b)}function +cK(a,b){return b[3]?i4(a,b):mO(a,b)}function +i5(h,b,c,d,e){function +f(a,b,c){bF(c,gC);return Z(a,b,c)}if(0=b)return ke=b){bF(e,((k&fx)<<10|b&fx)+el|0);return g(d,e)}return f(CR(b),d,e)}function +mP(c,b){var +a=b[8];if(34===a){bF(b,CF);return A(c,b)}if(92<=a){if(118>a)switch(a-92|0){case +0:bF(b,CJ);return A(c,b);case +6:bF(b,8);return A(c,b);case +10:bF(b,12);return A(c,b);case +18:bF(b,CE);return A(c,b);case +22:bF(b,13);return A(c,b);case +24:bF(b,9);return A(c,b);case 25:var -d=4,e=0,f=0;return A(function(a){return iR(f,e,d,c,a)},b)}}else if(47===a){by(b,Ch);return A(c,b)}aO(b);by(b,gr);return Y(Cp(a),function(a){return A(c,a)},b)}function -e8(c,b){if(b[8]===b8){aO(b);return Y(Cv,d8,b)}if(!Ck(b[8])){c3(b);return A(function(a){return e8(c,a)},b)}if(b[8]===34){aO(b);return A(c,b)}if(b[8]===92){var -d=function(a){return e8(c,a)};return A(function(a){return mL(d,a)},b)}aO(b);by(b,gr);function -e(a){return e8(c,a)}return Y(Cs(b[8]),function(a){return A(e,a)},b)}function -mM(c,b){if(!mB(b[8])&&b[8]!==b8){aO(b);c3(b);return A(function(a){return mM(c,a)},b)}var -a=dv(b);try{var -e=Y([0,bU,[0,ba,hB(a)]],c,b);return e}catch(f){var -d=an(f);if(d[1]===eB)return Y(Cy(a),c,b);throw i(d,0)}}function -mN(c,b){if(!mB(b[8])&&b[8]!==b8){aO(b);c3(b);return A(function(a){return mN(c,a)},b)}var -a=dv(b);return a!==fD?a!==fv?a!==fr?Y(Cz(a),c,b):Y(Dg,c,b):Y(Dh,c,b):Y(Di,c,b)}function -gt(a,b,c){var -d=c[8];a:{if(gV<=d){var -e=d-110|0;if(6>>0){if(13!==e)break a;bP(c);aO(c);c[11]=1;c[10]=1;var -g=c[9];c[9]=[0,[0,dD,mF(c)],g];return Y(Dj,function(a){return A(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bP(c);var -h=function(a,b){return Y([0,bU,[0,f,dv(b)]],a,b)},i=function(a){return h(b,a)};return A(function(a){return e8(i,a)},c)}if(91===d){bP(c);aO(c);c[11]=1;var -k=c[9];c[9]=[0,[0,fq,mF(c)],k];return Y(Dk,function(a){return A(b,a)},c)}if(gY>d)break a}bP(c);return mN(b,c)}if(!Cl(d)&&d!==45)return j(a,b,c);bP(c);return mM(b,c)}function -gu(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b8){aO(e);return A(function(a){return gu(f,b,c,d,a)},e)}return Y(c,d,e)}function -Dl(c,b){function -d(a,b,c){bP(c);return gu(mA,Cf,a,b,c)}var -a=b[11];b[11]=0;if(b[8]===b8){mG(b);return Y(Cw,d8,b)}if(b[8]===93){mH(b);return Y(Dm,function(a){return A(c,a)},b)}if(a)return gt(function(a,b){return d(CD,a,b)},c,b);if(b[8]!==44)return d(CE,c,b);function -e(a,b){return d(mD,a,b)}function -f(a){return gt(e,c,a)}return A(function(a){return cE(f,a)},b)}function -gv(a,b,c){bP(c);c[10]=1;return gu(mA,Cg,a,b,c)}function -Dn(c,b){b[10]=1;if(b[8]!==58)return gv(CC,c,b);function -d(a,b){return gv(mD,a,b)}function -e(a){return gt(d,c,a)}return A(function(a){return cE(e,a)},b)}function -Do(c,b){function +d=4,e=0,f=0;return A(function(a){return i5(f,e,d,c,a)},b)}}else if(47===a){bF(b,CI);return A(c,b)}aR(b);bF(b,gC);return Z(CQ(a),function(a){return A(c,a)},b)}function +e4(c,b){if(b[8]===b9){aR(b);return Z(CW,eb,b)}if(!CL(b[8])){c9(b);return A(function(a){return e4(c,a)},b)}if(b[8]===34){aR(b);return A(c,b)}if(b[8]===92){var +d=function(a){return e4(c,a)};return A(function(a){return mP(d,a)},b)}aR(b);bF(b,gC);function +e(a){return e4(c,a)}return Z(CT(b[8]),function(a){return A(e,a)},b)}function +mQ(c,b){if(!mF(b[8])&&b[8]!==b9){aR(b);c9(b);return A(function(a){return mQ(c,a)},b)}var +a=dy(b);try{var +e=Z([0,bS,[0,bd,hK(a)]],c,b);return e}catch(f){var +d=al(f);if(d[1]===eE)return Z(CZ(a),c,b);throw i(d,0)}}function +mR(c,b){if(!mF(b[8])&&b[8]!==b9){aR(b);c9(b);return A(function(a){return mR(c,a)},b)}var +a=dy(b);return a!==fI?a!==fz?a!==fv?Z(C0(a),c,b):Z(DH,c,b):Z(DI,c,b):Z(DJ,c,b)}function +gE(a,b,c){var +d=c[8];a:{if(g4<=d){var +e=d-110|0;if(6>>0){if(13!==e)break a;bP(c);aR(c);c[11]=1;c[10]=1;var +g=c[9];c[9]=[0,[0,dH,mJ(c)],g];return Z(DK,function(a){return A(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bP(c);var +h=function(a,b){return Z([0,bS,[0,f,dy(b)]],a,b)},i=function(a){return h(b,a)};return A(function(a){return e4(i,a)},c)}if(91===d){bP(c);aR(c);c[11]=1;var +k=c[9];c[9]=[0,[0,fu,mJ(c)],k];return Z(DL,function(a){return A(b,a)},c)}if(fn>d)break a}bP(c);return mR(b,c)}if(!CM(d)&&d!==45)return j(a,b,c);bP(c);return mQ(b,c)}function +gF(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b9){aR(e);return A(function(a){return gF(f,b,c,d,a)},e)}return Z(c,d,e)}function +DM(c,b){function +d(a,b,c){bP(c);return gF(mE,CG,a,b,c)}var +a=b[11];b[11]=0;if(b[8]===b9){mK(b);return Z(CX,eb,b)}if(b[8]===93){mL(b);return Z(DN,function(a){return A(c,a)},b)}if(a)return gE(function(a,b){return d(C4,a,b)},c,b);if(b[8]!==44)return d(C5,c,b);function +e(a,b){return d(mH,a,b)}function +f(a){return gE(e,c,a)}return A(function(a){return cK(f,a)},b)}function +gG(a,b,c){bP(c);c[10]=1;return gF(mE,CH,a,b,c)}function +DO(c,b){b[10]=1;if(b[8]!==58)return gG(C3,c,b);function +d(a,b){return gG(mH,a,b)}function +e(a){return gE(d,c,a)}return A(function(a){return cK(e,a)},b)}function +DP(c,b){function d(a,b,c){function -d(a,b){return Y([0,bU,[0,g_,dv(b)]],a,b)}if(c[8]!==34)return gv(a,b,c);bP(c);function -e(a){return d(b,a)}return A(function(a){return e8(e,a)},c)}var -a=b[11];b[11]=0;b[10]=0;if(b[8]===b8){mG(b);return Y(Cx,d8,b)}if(b[8]===en){mH(b);return Y(Dp,function(a){return A(c,a)},b)}if(a)return d(CF,c,b);if(b[8]!==44)return gv(CG,c,b);function -e(a){return d(CB,c,a)}return A(function(a){return cE(e,a)},b)}function -Dq(a,b){return b[8]===b8?Y(cv,d8,b):function(a,b){bP(b);return gu(fT,fT,CH,a,b)}(d8,b)}function -e9(a){var -b=a[9];return b?dD<=b[1][1]?a[10]?cE(function(a){return Do(e9,a)},a):cE(function(a){return Dn(e9,a)},a):cE(function(a){return Dl(e9,a)},a):cE(function(a){return Dq(e9,a)},a)}function -mO(d,b,c){if(!gs(c[8])&&c[8]!==b8){aO(c);return A(function(a){return mO(d,b,a)},c)}return Y(d,b,c)}function -mP(a,b){function +d(a,b){return Z([0,bS,[0,hg,dy(b)]],a,b)}if(c[8]!==34)return gG(a,b,c);bP(c);function +e(a){return d(b,a)}return A(function(a){return e4(e,a)},c)}var +a=b[11];b[11]=0;b[10]=0;if(b[8]===b9){mK(b);return Z(CY,eb,b)}if(b[8]===dK){mL(b);return Z(DQ,function(a){return A(c,a)},b)}if(a)return d(C6,c,b);if(b[8]!==44)return gG(C7,c,b);function +e(a){return d(C2,c,a)}return A(function(a){return cK(e,a)},b)}function +DR(a,b){return b[8]===b9?Z(cx,eb,b):function(a,b){bP(b);return gF(fV,fV,C8,a,b)}(eb,b)}function +e5(a){var +b=a[9];return b?dH<=b[1][1]?a[10]?cK(function(a){return DP(e5,a)},a):cK(function(a){return DO(e5,a)},a):cK(function(a){return DM(e5,a)},a):cK(function(a){return DR(e5,a)},a)}function +mS(d,b,c){if(!gD(c[8])&&c[8]!==b9){aR(c);return A(function(a){return mS(d,b,a)},c)}return Z(d,b,c)}function +mT(a,b){function c(c,b){bP(b);function -d(a){return mP(c,a)}return mO(mE,function(a){return cE(d,a)},b)}return b[8]!==b8?gt(c,a,b):Y(mE,a,b)}var -Cc=2147483646;function -Dr(a){function -b(a,b){return Cb(b[1])?Y(Cn,a,b):g(a,b)}function -c(a){return mP(e9,a)}function -d(a){return cE(c,a)}return A(function(a){return b(d,a)},a)}var -Ds=[0,hg,bH(10)];function -CK(a,b){if(typeof -b==="number")return k(a)(CL);var -d=b[1];if(qB>d){if(fk===d){var -l=b[2];k(a)(C8);return fq<=l?dD<=l?k(a)(C9):k(a)(C_):ee<=l?k(a)(C$):k(a)(Da)}if(nD<=d){var -z=b[2];return g(k(a)(Db),z)}var -A=b[2];return j(k(a)(Dc),iP,A)}if(rp>d){if(ci<=d){var -c=b[2];k(a)(CW);return typeof -c==="number"?ob<=c?pv<=c?g_<=c?k(a)(CX):k(a)(CY):rv<=c?k(a)(CZ):k(a)(C0):ee<=c?k(a)(C1):k(a)(C2):jg<=c[1]?c[2]?k(a)(C3):k(a)(C4):c[2]?k(a)(C5):k(a)(C6)}var -y=b[2];return g(k(a)(C7),y)}if(eh<=d){var -e=b[2];k(a)(CM);var -f=e[1];if(p9===f){var -p=e[2];return j(k(a)(CN),e6,p)}if(qh<=f){if(qe<=f){var -q=e[2];return j(k(a)(CO),iP,q)}var -r=e[2];return j(k(a)(CP),e6,r)}if(n7<=f){var -s=e[2];return j(k(a)(CQ),e6,s)}var -t=e[2];return j(k(a)(CR),iP,t)}var -i=b[2],n=m(i);k(a)(CS);if(0d){if(fk===d){var +l=b[2];k(a)(Dx);return fu<=l?dH<=l?k(a)(Dy):k(a)(Dz):ej<=l?k(a)(DA):k(a)(DB)}if(nW<=d){var +z=b[2];return g(k(a)(DC),z)}var +A=b[2];return j(k(a)(DD),i3,A)}if(rK>d){if(ch<=d){var +c=b[2];k(a)(Dl);return typeof +c==="number"?ou<=c?pO<=c?hg<=c?k(a)(Dm):k(a)(Dn):rQ<=c?k(a)(Do):k(a)(Dp):ej<=c?k(a)(Dq):k(a)(Dr):jr<=c[1]?c[2]?k(a)(Ds):k(a)(Dt):c[2]?k(a)(Du):k(a)(Dv)}var +y=b[2];return g(k(a)(Dw),y)}if(em<=d){var +e=b[2];k(a)(Db);var +f=e[1];if(qs===f){var +p=e[2];return j(k(a)(Dc),e2,p)}if(qC<=f){if(qz<=f){var +q=e[2];return j(k(a)(Dd),i3,q)}var +r=e[2];return j(k(a)(De),e2,r)}if(op<=f){var +s=e[2];return j(k(a)(Df),e2,s)}var +t=e[2];return j(k(a)(Dg),i3,t)}var +i=b[2],n=m(i);k(a)(Dh);if(0=1){var h=v;for(;;){var -w=ai(i,h);g(k(a)(CV),w);var -x=h+1|0;if(o===h)break;h=x}}return k(a)(CU)}function -Dt(a,b){var -c=B$([0,Ds],a,b);return[0,c,bs(ec),0,1,0,1,0,Cc,0,0,0,Dr]}function -Du(a){a[3]=0;var +w=ag(i,h);g(k(a)(Dk),w);var +x=h+1|0;if(o===h)break;h=x}}return k(a)(Dj)}function +DU(a,b){var +c=CA([0,DT],a,b);return[0,c,bA(eh),0,1,0,1,0,CD,0,0,0,DS]}function +DV(a){a[3]=0;var b=g(a[12],a);if(typeof b!=="number"){var -c=b[1];if(bU!==c&&af>c)throw i([0,u,Dv],1)}return b}function -Dw(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var -mQ=[L,DD,a5(0)];function -Dx(a){var -c=Dt(0,a),e=[L,Dy,a5(0)];function -l(a){return Dw(c)}function +c=b[1];if(bS!==c&&ai>c)throw i([0,u,DW],1)}return b}function +DX(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var +mU=[J,D4,a4(0)];function +DY(a){var +c=DU(0,a),e=[J,DZ,a4(0)];function +l(a){return DX(c)}function h(a){var -b=Du(c);if(typeof -b==="number"){if(hb<=b)throw i([0,u,Dz],1);throw i([0,e,DA],1)}if(af>b[1])return b[2];var -d=b[2];throw i([0,e,[0,af,[0,l(0),d]]],1)}function +b=DV(c);if(typeof +b==="number"){if(hj<=b)throw i([0,u,D0],1);throw i([0,e,D1],1)}if(ai>b[1])return b[2];var +d=b[2];throw i([0,e,[0,ai,[0,l(0),d]]],1)}function g(a,b,c){a:{if(typeof -b==="number"){if(fq===b){var -h=0;return a<50?k(a+1|0,h,c):v(k,[0,h,c])}if(dD===b){var -m=0;return a<50?j(a+1|0,m,c):v(j,[0,m,c])}if(cL===b)break a}else{var -g=b[1];if(f===g||ba===g||bc===g)break a}throw i([0,e,[0,g6,[0,bU,[0,l(0),b,DB]]]],1)}return a<50?d(a+1|0,b,c):v(d,[0,b,c])}function +b==="number"){if(fu===b){var +h=0;return a<50?k(a+1|0,h,c):v(k,[0,h,c])}if(dH===b){var +m=0;return a<50?j(a+1|0,m,c):v(j,[0,m,c])}if(cQ===b)break a}else{var +g=b[1];if(f===g||bd===g||bf===g)break a}throw i([0,e,[0,hd,[0,bS,[0,l(0),b,D2]]]],1)}return a<50?d(a+1|0,b,c):v(d,[0,b,c])}function k(a,b,c){var e=h(0);if(typeof -e==="number"&&rH===e){var -f=[0,65,bI(b)];return a<50?d(a+1|0,f,c):v(d,[0,f,c])}var +e==="number"&&r2===e){var +f=[0,65,cc(b)];return a<50?d(a+1|0,f,c):v(d,[0,f,c])}var i=[0,b,c];return a<50?g(a+1|0,e,i):v(g,[0,e,i])}function j(a,b,c){var f=h(0);if(typeof -f==="number"){if(oK===f){var -j=[0,79,bI(b)];return a<50?d(a+1|0,j,c):v(d,[0,j,c])}}else if(g_===f[1]){var -k=[1,f[2],b,c],m=h(0);return a<50?g(a+1|0,m,k):v(g,[0,m,k])}throw i([0,e,[0,g6,[0,bU,[0,l(0),f,DC]]]],1)}function +f==="number"){if(o3===f){var +j=[0,79,cc(b)];return a<50?d(a+1|0,j,c):v(d,[0,j,c])}}else if(hg===f[1]){var +k=[1,f[2],b,c],m=h(0);return a<50?g(a+1|0,m,k):v(g,[0,m,k])}throw i([0,e,[0,hd,[0,bS,[0,l(0),f,D3]]]],1)}function d(a,b,c){if(typeof c==="number")return b;if(0===c[0]){var d=c[2],e=[0,b,c[1]];return a<50?k(a+1|0,e,d):v(k,[0,e,d])}var f=c[3],g=[0,[0,c[1],b],c[2]];return a<50?j(a+1|0,g,f):v(j,[0,g,f])}function -m(a,b){return cq(g(0,a,b))}try{var +m(a,b){return co(g(0,a,b))}try{var n=[0,m(h(0),0)];return n}catch(f){var -b=an(f);if(b[1]===e)return[1,b[2]];throw i(b,0)}}function -DE(c,b){return lf(function(a){throw i([0,mQ,c,a],1)},b)}function -DF(a){var -b=a[1];if(381139274===b)return DG;if(g6>b){var -e=a[2][2];return j(y0(DJ),CK,e)}var +b=al(f);if(b[1]===e)return[1,b[2]];throw i(b,0)}}function +D5(c,b){return ll(function(a){throw i([0,mU,c,a],1)},b)}function +D6(a){var +b=a[1];if(381139274===b)return D7;if(hd>b){var +e=a[2][2];return j(zh(D_),C$,e)}var c=a[2];if(typeof -c==="number")return lT(DH);var -d=c[2][3];return g(lT(DI),d)}function -DK(a){return Dx(a)}function -DL(a){var -b=DK(a);if(0===b[0])return b[1];var -c=DF(b[1]);return g(DE(cL,DM),c)}function -DN(a){return DL([0,f,a])}function -DO(a){a:if(typeof +c==="number")return lY(D8);var +d=c[2][3];return g(lY(D9),d)}function +D$(a){return DY(a)}function +Ea(a){var +b=D$(a);if(0===b[0])return b[1];var +c=D6(b[1]);return g(D5(cQ,Eb),c)}function +Ec(a){return Ea([0,f,a])}function +Ed(a){a:if(typeof a!=="number"){var -b=a[1];if(65!==b&&79!==b)break a;return a}throw i([0,mQ,a,DP],1)}function -DQ(a){return DO(DN(a))}var -DU=bg(function(a){return[0,a,DT]},tw(function(a){return cK>>a|0)?1:0}if(c(7,b))return o(a,au(b));if(c(11,b)){o(a,au(ht|(b>>>6|0)&31));return o(a,au(M|b&63))}if(c(16,b)){o(a,au(ep|(b>>>12|0)&15));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}if(c(21,b)){o(a,au(ed|(b>>>18|0)&7));o(a,au(M|(b>>>12|0)&63));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}if(c(26,b)){o(a,au(L|(b>>>24|0)&3));o(a,au(M|(b>>>18|0)&63));o(a,au(M|(b>>>12|0)&63));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}if(!c(31,b))throw i([0,u,D6],1);o(a,au(em|(b>>>30|0)&1));o(a,au(M|(b>>>24|0)&63));o(a,au(M|(b>>>18|0)&63));o(a,au(M|(b>>>12|0)&63));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}function -D7(a,b){return eg+((a-55296|0)<<10|b-56320|0)|0}function -D8(a,b,c){return mW(a,D7(b,c))}var -D_=[L,D9,a5(0)];function -gw(a){throw i([0,D_,a],1)}var -iW=[L,D$,a5(0)],iX=[L,Ea,a5(0)],iY=[L,Eb,a5(0)],mX=[L,Ec,a5(0)];function -Ed(a,b,c,d){var -e=c?c[1]:1,f=a?a[1]:bs(cu);return[0,f,e,0,b]}function -i_(a,b,c,d){var -e=0;return a<50?nj(a+1|0,b,c,d,e):v(nj,[0,b,c,d,e])}function -Ef(a,b,c){return cq(i_(0,a,b,c))}function -nj(a,b,c,d,e){var +f=gx(b,48);if(f)return mf(b,57);var +e=f}return e}return function(a){return Bd(b,a)}(h$(Eo(0,Eu,a)))}function +Er(a){return B5(Ef(a))}function +Es(a){var +b=iR(a);return 0===b[0]?[0,b[1]]:(iT([0,b[1],0]),Et)}function +m0(a,b){function +c(a,b){return 0===(b>>>a|0)?1:0}if(c(7,b))return o(a,av(b));if(c(11,b)){o(a,av(hB|(b>>>6|0)&31));return o(a,av(K|b&63))}if(c(16,b)){o(a,av(er|(b>>>12|0)&15));o(a,av(K|(b>>>6|0)&63));return o(a,av(K|b&63))}if(c(21,b)){o(a,av(ei|(b>>>18|0)&7));o(a,av(K|(b>>>12|0)&63));o(a,av(K|(b>>>6|0)&63));return o(a,av(K|b&63))}if(c(26,b)){o(a,av(J|(b>>>24|0)&3));o(a,av(K|(b>>>18|0)&63));o(a,av(K|(b>>>12|0)&63));o(a,av(K|(b>>>6|0)&63));return o(a,av(K|b&63))}if(!c(31,b))throw i([0,u,Ev],1);o(a,av(ep|(b>>>30|0)&1));o(a,av(K|(b>>>24|0)&63));o(a,av(K|(b>>>18|0)&63));o(a,av(K|(b>>>12|0)&63));o(a,av(K|(b>>>6|0)&63));return o(a,av(K|b&63))}function +Ew(a,b){return el+((a-55296|0)<<10|b-56320|0)|0}function +Ex(a,b,c){return m0(a,Ew(b,c))}var +Ez=[J,Ey,a4(0)];function +gH(a){throw i([0,Ez,a],1)}var +i9=[J,EA,a4(0)],i_=[J,EB,a4(0)],i$=[J,EC,a4(0)],m1=[J,ED,a4(0)];function +EE(a,b,c,d){var +e=c?c[1]:1,f=a?a[1]:bA(cw);return[0,f,e,0,b]}function +jk(a,b,c,d){var +e=0;return a<50?nC(a+1|0,b,c,d,e):v(nC,[0,b,c,d,e])}function +EG(a,b,c){return co(jk(0,a,b,c))}function +nC(a,b,c,d,e){var h=e;for(;;){var -f=up(Ee,h,d);if(0===f)return;if(1===f){if(0>=c)return;o(b,us(d,0));var -i=c-1|0;return a<50?i_(a+1|0,b,i,d):v(i_,[0,b,i,d])}g(d[1],d);h=f}}function -Eg(a,b,c){var -d=c[4],e=c[5];Ef(a,b,c);c[5]=e+1|0;c[4]=d;return}function -mY(a){var -b=10<=a?a+87|0:a+48|0;return au(b)}function -dx(a,b,c,d,e){dQ(d,a,b[1],c-b[1]|0);aD(d,e);b[1]=c+1|0;return}function -Eh(a,b,c,d,e){dQ(d,a,b[1],c-b[1]|0);aD(d,Ei);o(d,mY(e>>>4|0));o(d,mY(e&15));b[1]=c+1|0;return}function -Ej(a,b,c){try{dQ(c,a,b[1],m(a)-b[1]|0);return}catch(f){var -d=an(f),e=m(a)-b[1]|0,g=b[1];bT(f4(Ek),a,g,e);throw i(d,0)}}function -El(a,b){var +f=uL(EF,h,d);if(0===f)return;if(1===f){if(0>=c)return;o(b,uO(d,0));var +i=c-1|0;return a<50?jk(a+1|0,b,i,d):v(jk,[0,b,i,d])}g(d[1],d);h=f}}function +EH(a,b,c){var +d=c[4],e=c[5];EG(a,b,c);c[5]=e+1|0;c[4]=d}function +m2(a){var +b=10<=a?a+87|0:a+48|0;return av(b)}function +dA(a,b,c,d,e){dV(d,a,b[1],c-b[1]|0);aG(d,e);b[1]=c+1|0}function +EI(a,b,c,d,e){dV(d,a,b[1],c-b[1]|0);aG(d,EJ);o(d,m2(e>>>4|0));o(d,m2(e&15));b[1]=c+1|0}function +EK(a,b,c){try{dV(c,a,b[1],m(a)-b[1]|0);return}catch(f){var +d=al(f),e=m(a)-b[1]|0,g=b[1];ct(f7(EL),a,g,e);throw i(d,0)}}function +EM(a,b){var d=[0,0],f=m(b)-1|0,g=0;if(f>=0){var c=g;for(;;){var -e=ai(b,c);a:if(92===e)dx(b,d,c,a,Em);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case -0:dx(b,d,c,a,En);break;case -1:dx(b,d,c,a,Eo);break;case -2:dx(b,d,c,a,Ep);break;case -4:dx(b,d,c,a,Eq);break;case -5:dx(b,d,c,a,Er);break;case -26:dx(b,d,c,a,Es);break;case +e=ag(b,c);a:if(92===e)dA(b,d,c,a,EN);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case +0:dA(b,d,c,a,EO);break;case +1:dA(b,d,c,a,EP);break;case +2:dA(b,d,c,a,EQ);break;case +4:dA(b,d,c,a,ER);break;case +5:dA(b,d,c,a,ES);break;case +26:dA(b,d,c,a,ET);break;case 24:case -25:break c;default:break b}break a}if(cK===e)break b}break a}Eh(b,d,c,a,e)}var -h=c+1|0;if(f===c)break;c=h}}return Ej(b,d,a)}function -dy(a,b){o(a,34);El(a,b);return o(a,34)}function -mZ(a,b){return aD(a,Et)}function -m0(a,b){var -c=b?Eu:Ev;return aD(a,c)}function -Ew(a){return au(a+48|0)}function -iZ(a,b){return 0===b?0:(iZ(a,b/10|0),o(a,Ew(eC(b%10|0))))}function -m1(a,b){return 0=0){var b=f;for(;;){var -c=ai(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw i(kw,1)}var +c=ag(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw i(kI,1)}var h=b+1|0;if(e===b)break;b=h}}var g=1;return g}catch(f){var -d=an(f);if(d===kw)return 0;throw i(d,0)}}function -Ex(a,b){var -c=kc(b);if(3===c){var -h=0.c)return cS<=c?ba<=c?Ex(a,b[2]):m1(a,b[2]):dC<=c?aD(a,b[2]):dy(a,b[2]);if(fu===c)return EO(a,b[2]);if(h<=c)return K<=c?EM(a,b[2]):EN(a,b[2]);if(bc<=c)return m0(a,b[2]);var -d=b[2];return EP(a,d[1],d[2])}function -EM(a,b){o(a,ej);d9(function(a,b){var -c=b[2];dy(a,b[1]);o(a,58);return e_(a,c)},d_,a,b);return o(a,en)}function -EN(a,b){o(a,91);d9(e_,d_,a,b);return o(a,93)}function -EO(a,b){o(a,40);d9(e_,d_,a,b);return o(a,41)}function -EP(a,b,c){o(a,60);dy(a,b);if(c){var -d=c[1];o(a,58);e_(a,d)}return o(a,62)}function -e$(a,b){if(typeof -b==="number")return mZ(a,0);var -c=b[1];if(fB>c)return cS<=c?ba<=c?EE(a,b[2]):m1(a,b[2]):dC<=c?aD(a,b[2]):dy(a,b[2]);if(fu===c)return ES(a,b[2]);if(h<=c)return K<=c?EQ(a,b[2]):ER(a,b[2]);if(bc<=c)return m0(a,b[2]);var -d=b[2];return ET(a,d[1],d[2])}function -EQ(a,b){o(a,ej);d9(function(a,b){var -c=b[2];dy(a,b[1]);o(a,58);return e$(a,c)},d_,a,b);return o(a,en)}function -ER(a,b){o(a,91);d9(e$,d_,a,b);return o(a,93)}function -ES(a,b){o(a,91);d9(e$,d_,a,b);return o(a,93)}function -ET(a,b,c){if(!c)return dy(a,b);var -d=c[1];o(a,91);dy(a,b);o(a,44);e$(a,d);return o(a,93)}function -EU(a,b,c,d){var -e=a?a[1]:EV,f=b?b[1]:0;if(f)e$(c,d);else -e_(c,d);return aD(c,e)}function -a_(a,b,c){return sr(a,b,c)}function -m3(a){return a+fA|0}function -c4(a){if(65<=a){if(97<=a){if(gV>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+fA>>>0)return a-48|0;throw i([0,u,EY],1)}function -b4(a,b,c){var -e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,h=sL(d,(e+c[6]|0)-f|0),i=b[4];if(i)var -l=i[1],k=g(X(EZ),l);else +ec(a,b,c,d){if(!d)return;var +e=d[2];j(a,c,d[1]);return Fa(a,b,c,e)}function +ed(a){return o(a,44)}function +e6(a,b){if(typeof +b==="number")return m3(a,0);var +c=b[1];if(fF>c)return cV<=c?bd<=c?EY(a,b[2]):m5(a,b[2]):dF<=c?aG(a,b[2]):dB(a,b[2]);if(fy===c)return Fd(a,b[2]);if(h<=c)return E<=c?Fb(a,b[2]):Fc(a,b[2]);if(bf<=c)return m4(a,b[2]);var +d=b[2];return Fe(a,d[1],d[2])}function +Fb(a,b){o(a,dJ);ec(function(a,b){var +c=b[2];dB(a,b[1]);o(a,58);return e6(a,c)},ed,a,b);return o(a,dK)}function +Fc(a,b){o(a,91);ec(e6,ed,a,b);return o(a,93)}function +Fd(a,b){o(a,40);ec(e6,ed,a,b);return o(a,41)}function +Fe(a,b,c){o(a,60);dB(a,b);if(c){var +d=c[1];o(a,58);e6(a,d)}return o(a,62)}function +e7(a,b){if(typeof +b==="number")return m3(a,0);var +c=b[1];if(fF>c)return cV<=c?bd<=c?E5(a,b[2]):m5(a,b[2]):dF<=c?aG(a,b[2]):dB(a,b[2]);if(fy===c)return Fh(a,b[2]);if(h<=c)return E<=c?Ff(a,b[2]):Fg(a,b[2]);if(bf<=c)return m4(a,b[2]);var +d=b[2];return Fi(a,d[1],d[2])}function +Ff(a,b){o(a,dJ);ec(function(a,b){var +c=b[2];dB(a,b[1]);o(a,58);return e7(a,c)},ed,a,b);return o(a,dK)}function +Fg(a,b){o(a,91);ec(e7,ed,a,b);return o(a,93)}function +Fh(a,b){o(a,91);ec(e7,ed,a,b);return o(a,93)}function +Fi(a,b,c){if(!c)return dB(a,b);var +d=c[1];o(a,91);dB(a,b);o(a,44);e7(a,d);return o(a,93)}function +Fj(a,b,c,d){var +e=a?a[1]:Fk,f=b?b[1]:0;if(f)e7(c,d);else +e6(c,d);return aG(c,e)}function +bb(a,b,c){return sM(a,b,c)}function +m7(a){return a+fE|0}function +c_(a){if(65<=a){if(97<=a){if(g4>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+fE>>>0)return a-48|0;throw i([0,u,Fn],1)}function +b3(a,b,c){var +e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,h=s7(d,(e+c[6]|0)-f|0),i=b[4];if(i)var +l=i[1],k=g(Y(Fo),l);else var -k=E3;var -m=d===h?g(X(E0),d+1|0):j(X(E2),d+1|0,h+1|0),n=b[2];return gw(fj(X(E1),k,n,m,a))}function +k=Fs;var +m=d===h?g(Y(Fp),d+1|0):j(Y(Fr),d+1|0,h+1|0),n=b[2];return gH(fj(Y(Fq),k,n,m,a))}function bQ(a,b,c){var -d=32,f=f0(c),e=bs(d);Eg(e,d,c);var -g=bJ(e);return b4(bT(X(E4),a,f,g),b,c)}function -EW(a,b,c,d,e){var -h=b?b[1]:cu,i=c?c[1]:EX;if(a){var -g=a[1];dP(g);var +d=32,f=f3(c),e=bA(d);EH(e,d,c);var +g=bL(e);return b3(ct(Y(Ft),a,f,g),b,c)}function +Fl(a,b,c,d,e){var +h=b?b[1]:cw,i=c?c[1]:Fm;if(a){var +g=a[1];dU(g);var f=g}else var -f=bs(h);EU([0,i],d,f,e);var -j=bJ(f);dP(f);return j}var -d$=[L,E5,a5(0)];function -E6(a){var +f=bA(h);Fj([0,i],d,f,e);var +j=bL(f);dU(f);return j}var +ee=[J,Fu,a4(0)];function +Fv(a){var d=a[5],b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(214748365<=b[1])throw i(d$,1);var -g=m3(fG(f,c));b[1]=(10*b[1]|0)+g|0;var -h=c+1|0;if(e===c)break;c=h}}if(0<=b[1])return b[1];throw i(d$,1)}function -E7(a,b){try{var -d=[0,cS,E6(b)];return d}catch(f){var -c=an(f);if(c===d$)return[0,dC,f0(b)];throw i(c,0)}}function -E8(a){var +c=d;for(;;){if(214748365<=b[1])throw i(ee,1);var +g=m7(fL(f,c));b[1]=(10*b[1]|0)+g|0;var +h=c+1|0;if(e===c)break;c=h}}if(0<=b[1])return b[1];throw i(ee,1)}function +Fw(a,b){try{var +d=[0,cV,Fv(b)];return d}catch(f){var +c=al(f);if(c===ee)return[0,dF,f3(b)];throw i(c,0)}}function +Fx(a){var d=a[5]+1|0,b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(b[1]<=-214748365)throw i(d$,1);var -g=m3(fG(f,c));b[1]=(10*b[1]|0)-g|0;var -h=c+1|0;if(e===c)break;c=h}}if(0>>0){g(c[1],c);m=l}else +l=bb(bc,m,c);if(19>>0){g(c[1],c);m=l}else switch(l){case -0:return Fw;case -1:return Fx;case -2:return cL;case -3:return[0,ba,sS];case -4:return[0,ba,sO];case -5:return[0,ba,sQ];case -6:dP(b[1]);return[0,f,m4(b,c)];case -7:return E7(b,c);case -8:return E9(b,c);case -9:return[0,ba,hB(f0(c))];case +0:return FX;case +1:return FY;case +2:return cQ;case +3:return[0,bd,tc];case +4:return[0,bd,s_];case +5:return[0,bd,ta];case +6:dU(b[1]);return[0,f,m8(b,c)];case +7:return Fw(b,c);case +8:return Fy(b,c);case +9:return[0,bd,hK(f3(c))];case 10:var -e=[0,0];try{a2(b,c);Fr(c);var -q=i0(b,c);a2(b,c);m7(b,c);a2(b,c);var -r=e[1];e[1]=[0,[0,q,c5(b,c)],r];for(;;){a2(b,c);Ft(b,c);a2(b,c);var -s=i0(b,c);a2(b,c);m7(b,c);a2(b,c);var -t=e[1];e[1]=[0,[0,s,c5(b,c)],t]}}catch(f){var -n=an(f);if(n===iX)return[0,K,bI(e[1])];throw i(n,0)}break;case +e=[0,0];try{a8(b,c);FS(c);var +q=jb(b,c);a8(b,c);m$(b,c);a8(b,c);var +r=e[1];e[1]=[0,[0,q,c$(b,c)],r];for(;;){a8(b,c);FU(b,c);a8(b,c);var +s=jb(b,c);a8(b,c);m$(b,c);a8(b,c);var +t=e[1];e[1]=[0,[0,s,c$(b,c)],t]}}catch(f){var +n=al(f);if(n===i_)return[0,E,cc(e[1])];throw i(n,0)}break;case 11:var -j=[0,0];try{a2(b,c);Fj(c);var -u=j[1];j[1]=[0,c5(b,c),u];for(;;){a2(b,c);Fl(b,c);a2(b,c);var -w=j[1];j[1]=[0,c5(b,c),w]}}catch(f){var -o=an(f);if(o===iW)return[0,h,bI(j[1])];throw i(o,0)}break;case +j=[0,0];try{a8(b,c);FK(c);var +u=j[1];j[1]=[0,c$(b,c),u];for(;;){a8(b,c);FM(b,c);a8(b,c);var +w=j[1];j[1]=[0,c$(b,c),w]}}catch(f){var +o=al(f);if(o===i9)return[0,h,cc(j[1])];throw i(o,0)}break;case 12:var -k=[0,0];try{a2(b,c);Fn(c);var -x=k[1];k[1]=[0,c5(b,c),x];for(;;){a2(b,c);Fp(b,c);a2(b,c);var -y=k[1];k[1]=[0,c5(b,c),y]}}catch(f){var -p=an(f);if(p===iY)return[0,fu,bI(k[1])];throw i(p,0)}break;case -13:a2(b,c);var -z=i0(b,c);a2(b,c);return[0,fB,[0,z,Fd(b,c)]];case -14:return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case -15:m5(b,c);return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case -16:gx(b,c);return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case -17:return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case -18:return b4(Fy,b,c);default:return bQ(Fz,b,c)}}}function +k=[0,0];try{a8(b,c);FO(c);var +x=k[1];k[1]=[0,c$(b,c),x];for(;;){a8(b,c);FQ(b,c);a8(b,c);var +y=k[1];k[1]=[0,c$(b,c),y]}}catch(f){var +p=al(f);if(p===i$)return[0,fy,cc(k[1])];throw i(p,0)}break;case +13:a8(b,c);var +z=jb(b,c);a8(b,c);return[0,fF,[0,z,FE(b,c)]];case +14:return a<50?cO(a+1|0,b,c):v(cO,[0,b,c]);case +15:m9(b,c);return a<50?cO(a+1|0,b,c):v(cO,[0,b,c]);case +16:gI(b,c);return a<50?cO(a+1|0,b,c):v(cO,[0,b,c]);case +17:return a<50?cO(a+1|0,b,c):v(cO,[0,b,c]);case +18:return b3(FZ,b,c);default:return bQ(F0,b,c)}}}function fi(a,b,c){var -d=58;return a<50?nm(a+1|0,b,c,d):v(nm,[0,b,c,d])}function -m4(a,b){return cq(fi(0,a,b))}function -nm(a,b,c,d){var +d=58;return a<50?nF(a+1|0,b,c,d):v(nF,[0,b,c,d])}function +m8(a,b){return co(fi(0,a,b))}function +nF(a,b,c,d){var f=d;for(;;){var -e=a_(a$,f,c);if(3>=e>>>0)switch(e){case -0:return bJ(b[1]);case -1:E$(b,c);return a<50?fi(a+1|0,b,c):v(fi,[0,b,c]);case -2:E_(b[1],c);return a<50?fi(a+1|0,b,c):v(fi,[0,b,c]);default:return b4(FA,b,c)}g(c[1],c);f=e}}function -E$(a,b){return Fa(a,b,68)}function -Fa(a,b,c){var +e=bb(bc,f,c);if(3>=e>>>0)switch(e){case +0:return bL(b[1]);case +1:FA(b,c);return a<50?fi(a+1|0,b,c):v(fi,[0,b,c]);case +2:Fz(b[1],c);return a<50?fi(a+1|0,b,c):v(fi,[0,b,c]);default:return b3(F1,b,c)}g(c[1],c);f=e}}function +FA(a,b){return FB(a,b,68)}function +FB(a,b,c){var f=c;for(;;){var -e=a_(a$,f,b);if(8>=e>>>0)switch(e){case +e=bb(bc,f,b);if(8>=e>>>0)switch(e){case 0:var -h=cy(b,b[5]);return o(a[1],h);case +h=cD(b,b[5]);return o(a[1],h);case 1:return o(a[1],8);case 2:return o(a[1],12);case 3:return o(a[1],10);case 4:return o(a[1],13);case 5:return o(a[1],9);case 6:var -i=cy(b,b[5]+1|0),j=cy(b,b[5]+2|0),k=cy(b,b[5]+3|0),l=c4(cy(b,b[5]+4|0)),m=c4(k)<<4,n=c4(j)<<8,d=c4(i)<<12|n|m|l;if(jf<=d&&j2>=d)return Fb(a,d,b);return mW(a[1],d);case -7:return bQ(FB,a,b);default:return b4(FC,a,b)}g(b[1],b);f=e}}function -Fb(a,b,c){return Fc(a,b,c,82)}function -Fc(a,b,c,d){var +i=cD(b,b[5]+1|0),j=cD(b,b[5]+2|0),k=cD(b,b[5]+3|0),l=c_(cD(b,b[5]+4|0)),m=c_(k)<<4,n=c_(j)<<8,d=c_(i)<<12|n|m|l;if(jq<=d&&ke>=d)return FC(a,d,b);return m0(a[1],d);case +7:return bQ(F2,a,b);default:return b3(F3,a,b)}g(b[1],b);f=e}}function +FC(a,b,c){return FD(a,b,c,82)}function +FD(a,b,c,d){var h=d;for(;;){var -e=a_(a$,h,c);if(2>=e>>>0)switch(e){case +e=bb(bc,h,c);if(2>=e>>>0)switch(e){case 0:var -i=cy(c,c[5]+2|0),j=cy(c,c[5]+3|0),k=cy(c,c[5]+4|0),l=c4(cy(c,c[5]+5|0)),m=c4(k)<<4,n=c4(j)<<8,f=c4(i)<<12|n|m|l;if(jP<=f&&fn>=f)return D8(a[1],b,f);return bQ(FD,a,c);case -1:return bQ(FE,a,c);default:return b4(FF,a,c)}g(c[1],c);h=e}}function -Fd(a,b){return Fe(a,b,gY)}function -Fe(a,b,c){var +i=cD(c,c[5]+2|0),j=cD(c,c[5]+3|0),k=cD(c,c[5]+4|0),l=c_(cD(c,c[5]+5|0)),m=c_(k)<<4,n=c_(j)<<8,f=c_(i)<<12|n|m|l;if(j2<=f&&fq>=f)return Ex(a[1],b,f);return bQ(F4,a,c);case +1:return bQ(F5,a,c);default:return b3(F6,a,c)}g(c[1],c);h=e}}function +FE(a,b){return FF(a,b,fn)}function +FF(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(3>=d>>>0)switch(d){case +d=bb(bc,e,b);if(3>=d>>>0)switch(d){case 0:var -f=c5(a,b);a2(a,b);Ff(a,b);return[0,f];case +f=c$(a,b);a8(a,b);FG(a,b);return[0,f];case 1:return 0;case -2:return bQ(FG,a,b);default:return b4(FH,a,b)}g(b[1],b);e=d}}function -Ff(a,b){return Fg(a,b,111)}function -Fg(a,b,c){var +2:return bQ(F7,a,b);default:return b3(F8,a,b)}g(b[1],b);e=d}}function +FG(a,b){return FH(a,b,111)}function +FH(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(2>=d>>>0)switch(d){case +d=bb(bc,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bQ(FI,a,b);default:return b4(FJ,a,b)}g(b[1],b);e=d}}function +1:return bQ(F9,a,b);default:return b3(F_,a,b)}g(b[1],b);e=d}}function fh(a,b,c){var -d=en;return a<50?nl(a+1|0,b,c,d):v(nl,[0,b,c,d])}function -m5(a,b){return cq(fh(0,a,b))}function -nl(a,b,c,d){var +d=dK;return a<50?nE(a+1|0,b,c,d):v(nE,[0,b,c,d])}function +m9(a,b){return co(fh(0,a,b))}function +nE(a,b,c,d){var f=d;for(;;){var -e=a_(a$,f,c);if(3>=e>>>0)switch(e){case +e=bb(bc,f,c);if(3>=e>>>0)switch(e){case 0:return;case -1:return bQ(FK,b,c);case -2:gx(b,c);return a<50?fh(a+1|0,b,c):v(fh,[0,b,c]);default:return a<50?fh(a+1|0,b,c):v(fh,[0,b,c])}g(c[1],c);f=e}}function -m6(a){return Fh(a,131)}function -Fh(a,b){var +1:return bQ(F$,b,c);case +2:gI(b,c);return a<50?fh(a+1|0,b,c):v(fh,[0,b,c]);default:return a<50?fh(a+1|0,b,c):v(fh,[0,b,c])}g(c[1],c);f=e}}function +m_(a){return FI(a,131)}function +FI(a,b){var d=b;for(;;){var -c=a_(a$,d,a);if(0===c)return 1;if(1===c)return 0;g(a[1],a);d=c}}function -cI(a,b,c){var -d=jY;return a<50?nk(a+1|0,b,c,d):v(nk,[0,b,c,d])}function -a2(a,b){return cq(cI(0,a,b))}function -nk(a,b,c,d){var +c=bb(bc,d,a);if(0===c)return 1;if(1===c)return 0;g(a[1],a);d=c}}function +cN(a,b,c){var +d=ka;return a<50?nD(a+1|0,b,c,d):v(nD,[0,b,c,d])}function +a8(a,b){return co(cN(0,a,b))}function +nD(a,b,c,d){var f=d;for(;;){var -e=a_(a$,f,c);if(4>=e>>>0)switch(e){case -0:gx(b,c);return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);case -1:m5(b,c);return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);case -2:gx(b,c);return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);case -3:return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);default:return}g(c[1],c);f=e}}function -i0(a,b){return Fi(a,b,hf)}function -Fi(a,b,c){var +e=bb(bc,f,c);if(4>=e>>>0)switch(e){case +0:gI(b,c);return a<50?cN(a+1|0,b,c):v(cN,[0,b,c]);case +1:m9(b,c);return a<50?cN(a+1|0,b,c):v(cN,[0,b,c]);case +2:gI(b,c);return a<50?cN(a+1|0,b,c):v(cN,[0,b,c]);case +3:return a<50?cN(a+1|0,b,c):v(cN,[0,b,c]);default:return}g(c[1],c);f=e}}function +jb(a,b){return FJ(a,b,hn)}function +FJ(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(3>=d>>>0)switch(d){case -0:dP(a[1]);return m4(a,b);case -1:return ur(b,b[5],b[6]);case -2:return bQ(FL,a,b);default:return b4(FM,a,b)}g(b[1],b);e=d}}function -Fj(a){return Fk(a,c_)}function -Fk(a,b){var +d=bb(bc,e,b);if(3>=d>>>0)switch(d){case +0:dU(a[1]);return m8(a,b);case +1:return uN(b,b[5],b[6]);case +2:return bQ(Ga,a,b);default:return b3(Gb,a,b)}g(b[1],b);e=d}}function +FK(a){return FL(a,dd)}function +FL(a,b){var d=b;for(;;){var -c=a_(a$,d,a);if(0===c)throw i(iW,1);if(1===c)return;g(a[1],a);d=c}}function -Fl(a,b){return Fm(a,b,q7)}function -Fm(a,b,c){var +c=bb(bc,d,a);if(0===c)throw i(i9,1);if(1===c)return;g(a[1],a);d=c}}function +FM(a,b){return FN(a,b,rp)}function +FN(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(3>=d>>>0)switch(d){case +d=bb(bc,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw i(iW,1);case -2:return bQ(FN,a,b);default:return b4(FO,a,b)}g(b[1],b);e=d}}function -Fn(a){return Fo(a,oP)}function -Fo(a,b){var +1:throw i(i9,1);case +2:return bQ(Gc,a,b);default:return b3(Gd,a,b)}g(b[1],b);e=d}}function +FO(a){return FP(a,o9)}function +FP(a,b){var d=b;for(;;){var -c=a_(a$,d,a);if(0===c)throw i(iY,1);if(1===c)return;g(a[1],a);d=c}}function -Fp(a,b){return Fq(a,b,nu)}function -Fq(a,b,c){var +c=bb(bc,d,a);if(0===c)throw i(i$,1);if(1===c)return;g(a[1],a);d=c}}function +FQ(a,b){return FR(a,b,nN)}function +FR(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(3>=d>>>0)switch(d){case +d=bb(bc,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw i(iY,1);case -2:return bQ(FP,a,b);default:return b4(FQ,a,b)}g(b[1],b);e=d}}function -Fr(a){return Fs(a,oZ)}function -Fs(a,b){var +1:throw i(i$,1);case +2:return bQ(Ge,a,b);default:return b3(Gf,a,b)}g(b[1],b);e=d}}function +FS(a){return FT(a,jG)}function +FT(a,b){var d=b;for(;;){var -c=a_(a$,d,a);if(0===c)throw i(iX,1);if(1===c)return;g(a[1],a);d=c}}function -Ft(a,b){return Fu(a,b,qH)}function -Fu(a,b,c){var +c=bb(bc,d,a);if(0===c)throw i(i_,1);if(1===c)return;g(a[1],a);d=c}}function +FU(a,b){return FV(a,b,q2)}function +FV(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(3>=d>>>0)switch(d){case +d=bb(bc,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw i(iX,1);case -2:return bQ(FR,a,b);default:return b4(FS,a,b)}g(b[1],b);e=d}}function -m7(a,b){return Fv(a,b,o$)}function -Fv(a,b,c){var +1:throw i(i_,1);case +2:return bQ(Gg,a,b);default:return b3(Gh,a,b)}g(b[1],b);e=d}}function +m$(a,b){return FW(a,b,ps)}function +FW(a,b,c){var e=c;for(;;){var -d=a_(a$,e,b);if(2>=d>>>0)switch(d){case +d=bb(bc,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bQ(FT,a,b);default:return b4(FU,a,b)}g(b[1],b);e=d}}function -FV(a,b){a2(a,b);var -c=1-m6(b);return c?bQ(FW,a,b):c}function -FX(a,b,c){var -d=b?b[1]:0;a2(a,c);if(m6(c))throw i(mX,1);var -e=c5(a,c);if(1-d)FV(a,c);return e}var -F1=[L,F0,a5(0)];function -F2(a){if(typeof -a==="number")return F3;var -b=a[1];return fu<=b?bc===b?F4:928231259<=b?K<=b?F5:F6:h<=b?F7:F8:dC===b?F9:ba<=b?fB<=b?F_:F$:cS<=b?Ga:Gb}function -m8(a,b){throw i([0,F1,a7(a,F2(b)),b],1)}function -m9(a){if(typeof -a!=="number"&&f===a[1])return a[2];return m8(Ge,a)}function -FY(a,b,c,d){try{var -f=uq(0,d),g=FX(Ed(a,b,c,0),0,f);return g}catch(f){var -e=an(f);if(e===mX)return gw(FZ);throw i(e,0)}}function -Gc(a){if(typeof -a!=="number"&&K===a[1])return a[2];return m8(Gd,a)}function -gy(a){return[0,bc,a]}function -as(a){return[0,f,a]}function -cF(a){return[0,cS,a]}function -i1(a,b){return b?g(a,b[1]):cL}function -cg(a,b){return[0,h,bI(kK(a,b))]}var -cG=[0,1],Gg=[L,Gf,a5(0)];function -bR(a,b){throw i([0,Gg,[0,eB,a],b],1)}function -gz(a){if(typeof -a!=="number"&&bc===a[1])return a[2];return bR(Gh,a)}function -at(a){if(typeof -a!=="number"&&f===a[1])return a[2];return bR(Gi,a)}function -cH(a){if(typeof -a!=="number"&&cS===a[1])return a[2];return bR(Gj,a)}function -i2(a,b){if(typeof -b==="number"&&cL===b)return 0;return[0,g(a,b)]}function -ch(a,b){if(typeof -b!=="number"&&h===b[1])return bI(kK(a,b[2]));return bR(Gk,b)}function -c(a,b){return bR(a7(a,Gl),b)}function -fa(a,b){return bR(a7(a,Gq),b)}function -fb(a,b){return bR(a7(a,Gr),b)}function -fc(a,b){return bR(a7(a,Gs),b)}function -m_(a,b,c,d){var -e=fY(Gt,bI(c));return bR(bT(X(Gu),b,a,e),d)}function -bz(a,b,c){return m_(Gv,a,b,c)}function -bA(a,b,c){return m_(Gw,a,b,c)}function -Gx(a,b){var -d=a,c=b;for(;;){if(!c)return fY(Gy,bI(d));var +1:return bQ(Gi,a,b);default:return b3(Gj,a,b)}g(b[1],b);e=d}}function +Gk(a,b){a8(a,b);var +c=1-m_(b);return c?bQ(Gl,a,b):c}function +Gm(a,b,c){var +d=b?b[1]:0;a8(a,c);if(m_(c))throw i(m1,1);var +e=c$(a,c);if(1-d)Gk(a,c);return e}var +Gq=[J,Gp,a4(0)];function +Gr(a){if(typeof +a==="number")return Gs;var +b=a[1];return fy<=b?bf===b?Gt:928231259<=b?E<=b?Gu:Gv:h<=b?Gw:Gx:dF===b?Gy:bd<=b?fF<=b?Gz:GA:cV<=b?GB:GC}function +na(a,b){throw i([0,Gq,aV(a,Gr(b)),b],1)}function +nb(a){if(typeof +a!=="number"&&f===a[1])return a[2];return na(GF,a)}function +Gn(a,b,c,d){try{var +f=uM(0,d),g=Gm(EE(a,b,c,0),0,f);return g}catch(f){var +e=al(f);if(e===m1)return gH(Go);throw i(e,0)}}function +GD(a){if(typeof +a!=="number"&&E===a[1])return a[2];return na(GE,a)}function +e8(a){return[0,bf,a]}function +U(a){return[0,f,a]}function +cL(a){return[0,cV,a]}function +e9(a,b){return b?g(a,b[1]):cQ}function +cr(a,b){return[0,h,cc(kV(a,b))]}var +cg=[0,1],GH=[J,GG,a4(0)];function +bR(a,b){throw i([0,GH,[0,eE,a],b],1)}function +e_(a){if(typeof +a!=="number"&&bf===a[1])return a[2];return bR(GI,a)}function +V(a){if(typeof +a!=="number"&&f===a[1])return a[2];return bR(GJ,a)}function +cM(a){if(typeof +a!=="number"&&cV===a[1])return a[2];return bR(GK,a)}function +e$(a,b){if(typeof +b==="number"&&cQ===b)return 0;return[0,g(a,b)]}function +cs(a,b){if(typeof +b!=="number"&&h===b[1])return cc(kV(a,b[2]));return bR(GL,b)}function +c(a,b){return bR(aV(a,GM),b)}function +fa(a,b){return bR(aV(a,GR),b)}function +fb(a,b){return bR(aV(a,GS),b)}function +fc(a,b){return bR(aV(a,GT),b)}function +nc(a,b,c,d){var +e=f1(GU,cc(c));return bR(ct(Y(GV),b,a,e),d)}function +bl(a,b,c){return nc(GW,a,b,c)}function +bm(a,b,c){return nc(GX,a,b,c)}function +GY(a,b){var +d=a,c=b;for(;;){if(!c)return f1(GZ,cc(d));var e=c[1];if(e[1]){d=[0,e[2],d];c=c[2]}else c=c[2]}}function -bS(a,b,c){var -d=Gx(0,c);return bR(j(X(Gz),a,d),b)}function -bB(a,b){return bR(a7(a,GA),b)}function -Gm(a,b,c){return bR(j(X(Gn),a,b),c)}function -Go(a,b){return bR(a7(a,Gp),b)}function +bv(a,b,c){var +d=GY(0,c);return bR(j(Y(G0),a,d),b)}function +bn(a,b){return bR(aV(a,G1),b)}function +GN(a,b,c){return bR(j(Y(GO),a,b),c)}function +GP(a,b){return bR(aV(a,GQ),b)}function b(a){return a[1]}function -GC(a){if(typeof +G3(a){if(typeof a!=="number"&&h===a[1]){var b=a[2];if(!b)return fb(fd,a);var d=b[1];if(typeof d!=="number"){var e=d[1];if(f===e){var -g=d[2];if(g===qd)return b[2]?c(fd,a):0;if(g===qR)return b[2]?c(fd,a):1}else if(h===e)return fa(fd,a)}}return fc(fd,a)}function -GD(a){return a?GE:GF}function -GG(a){if(typeof +g=d[2];if(g===qy)return b[2]?c(fd,a):0;if(g===ra)return b[2]?c(fd,a):1}else if(h===e)return fa(fd,a)}}return fc(fd,a)}function +G4(a){return a?G5:G6}function +G7(a){if(typeof a!=="number"&&h===a[1]){var -b=a[2];if(!b)return fb(a3,a);var +b=a[2];if(!b)return fb(aB,a);var e=b[1];if(typeof e!=="number"){var g=e[1];if(f===g){var -d=e[2],i=bE(d,oD);if(0<=i){if(0>=i)return b[2]?c(a3,a):7;if(d===qY)return b[2]?c(a3,a):8;if(d===q8)return b[2]?c(a3,a):9;if(d===qI)return b[2]?c(a3,a):10;if(d===rr)return b[2]?c(a3,a):12;if(d===pS)return b[2]?c(a3,a):13;if(d===pD)return b[2]?c(a3,a):14;if(d===ek)return b[2]?c(a3,a):11}else{if(d===qf)return b[2]?c(a3,a):0;if(d===n2)return b[2]?c(a3,a):1;if(d===qK)return b[2]?c(a3,a):2;if(d===pC)return b[2]?c(a3,a):3;if(d===pj)return b[2]?c(a3,a):4;if(d===nZ)return b[2]?c(a3,a):5;if(d===hp)return b[2]?c(a3,a):6}}else if(h===g)return fa(a3,a)}}return fc(a3,a)}function -GH(a){switch(a){case -0:return GI;case -1:return GJ;case -2:return GK;case -3:return GL;case -4:return GM;case -5:return GN;case -6:return GO;case -7:return GP;case -8:return GQ;case -9:return GR;case -10:return GS;case -11:return GT;case -12:return GU;case -13:return GV;default:return GW}}function -GX(a){return bg(function(a){var -b=a[1];return[0,b,m9(a[2])]},Gc(a))}function -GY(a){return[0,K,bg(function(a){return[0,a[1],[0,f,a[2]]]},a)]}function -GZ(a){if(typeof -a!=="number"&&K===a[1]){var +d=e[2],i=bI(d,pR);if(0<=i){if(0>=i)return b[2]?c(aB,a):9;if(d===hA)return b[2]?c(aB,a):10;if(d===o7)return b[2]?c(aB,a):11;if(d===rh)return b[2]?c(aB,a):12;if(d===rq)return b[2]?c(aB,a):13;if(d===q3)return b[2]?c(aB,a):14;if(d===rM)return b[2]?c(aB,a):16;if(d===qc)return b[2]?c(aB,a):17;if(d===pY)return b[2]?c(aB,a):18;if(d===en)return b[2]?c(aB,a):15}else{if(d===qA)return b[2]?c(aB,a):0;if(d===ok)return b[2]?c(aB,a):1;if(d===q5)return b[2]?c(aB,a):2;if(d===pX)return b[2]?c(aB,a):3;if(d===pC)return b[2]?c(aB,a):4;if(d===oh)return b[2]?c(aB,a):5;if(d===hx)return b[2]?c(aB,a):6;if(d===oW)return b[2]?c(aB,a):7;if(d===rB)return b[2]?c(aB,a):8}}else if(h===g)return fa(aB,a)}}return fc(aB,a)}function +G8(a){switch(a){case +0:return G9;case +1:return G_;case +2:return G$;case +3:return Ha;case +4:return Hb;case +5:return Hc;case +6:return Hd;case +7:return He;case +8:return Hf;case +9:return Hg;case +10:return Hh;case +11:return Hi;case +12:return Hj;case +13:return Hk;case +14:return Hl;case +15:return Hm;case +16:return Hn;case +17:return Ho;default:return Hp}}function +Hq(a){return bz(function(a){var +b=a[1];return[0,b,nb(a[2])]},GD(a))}function +Hr(a){return[0,E,bz(function(a){return[0,a[1],[0,f,a[2]]]},a)]}function +Hs(a){if(typeof +a!=="number"&&E===a[1]){var e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -i=h[1],j=i[2],d=i[1],k=h[2];if(d!==hk)if(d!==ei){if(b(cG))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,at(j)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,at(j)];h=k}}(a[2]));if(b(c))return bz(gA,b(c),a);if(b(g))return bA(gA,b(g),a);var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==hs)if(d!==dh){if(b(cg))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,V(j)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,V(j)];h=k}}(a[2]));if(b(c))return bl(gJ,b(c),a);if(b(g))return bm(gJ,b(g),a);var d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var -i=[0,[0,0===b(f)?1:0,G0],0];return bS(gA,a,[0,[0,0===b(e)?1:0,G1],i])}return bB(gA,a)}function -G2(a){var -b=a[1],c=[0,[0,G3,as(a[2])],0];return[0,K,[0,[0,G4,as(b)],c]]}function -G5(a){if(typeof -a!=="number"&&K===a[1]){var +i=[0,[0,0===b(f)?1:0,Ht],0];return bv(gJ,a,[0,[0,0===b(e)?1:0,Hu],i])}return bn(gJ,a)}function +Hv(a){var +b=a[1],c=[0,[0,Hw,U(a[2])],0];return[0,E,[0,[0,Hx,U(b)],c]]}function +Hy(a){if(typeof +a!=="number"&&E===a[1]){var e=[0,0],c=[0,0],d=[0,0];(function(a){var d=a;for(;;){if(!d)return;var -f=d[1],g=f[1],h=d[2],i=f[2];if(g===rI)if(b(e))c[1]=[0,g,b(c)];else -e[1]=[0,GX(i)];d=h}}(a[2]));return b(c)?bz(i3,b(c),a):b(d)?bA(i3,b(d),a):[0,b(e)]}return bB(i3,a)}function -G6(a){var -b=a[1],c=0,d=b?[0,[0,G7,GY(b[1])],c]:c;return[0,K,d]}function -m$(a){if(typeof +f=d[1],g=f[1],h=d[2],i=f[2];if(g===r3)if(b(e))c[1]=[0,g,b(c)];else +e[1]=[0,Hq(i)];d=h}}(a[2]));return b(c)?bl(jc,b(c),a):b(d)?bm(jc,b(d),a):[0,b(e)]}return bn(jc,a)}function +Hz(a){var +b=a[1],c=0,d=b?[0,[0,HA,Hr(b[1])],c]:c;return[0,E,d]}function +nd(a){if(typeof a!=="number"&&h===a[1]){var -b=a[2];if(!b)return fb(E,a);var +b=a[2];if(!b)return fb(F,a);var e=b[1];if(typeof e!=="number"){var g=e[1];if(f===g){var -d=e[2],i=bE(d,pT);if(0<=i){if(0>=i)return b[2]?c(E,a):18;var -j=bE(d,nN);if(0<=j){if(0>=j)return b[2]?c(E,a):28;if(d===oI)return b[2]?c(E,a):29;if(d===pL)return b[2]?c(E,a):30;if(d===os)return b[2]?c(E,a):31;if(d===pb)return b[2]?c(E,a):32;if(d===nQ)return b[2]?c(E,a):33;if(d===nV)return b[2]?c(E,a):34;if(d===qS)return b[2]?c(E,a):35;if(d===og)return b[2]?c(E,a):36}else{if(d===oQ)return b[2]?c(E,a):19;if(d===ny)return b[2]?c(E,a):20;if(d===ra)return b[2]?c(E,a):21;if(d===q9)return b[2]?c(E,a):22;if(d===nH)return b[2]?c(E,a):23;if(d===qF)return b[2]?c(E,a):24;if(d===pA)return b[2]?c(E,a):25;if(d===rB)return b[2]?c(E,a):26;if(d===n3)return b[2]?c(E,a):27}}else{var -k=bE(d,rl);if(0<=k){if(0>=k)return b[2]?c(E,a):9;if(d===ro)return b[2]?c(E,a):10;if(d===pp)return b[2]?c(E,a):11;if(d===rL)return b[2]?c(E,a):12;if(d===nL)return b[2]?c(E,a):13;if(d===nP)return b[2]?c(E,a):14;if(d===rG)return b[2]?c(E,a):15;if(d===qy)return b[2]?c(E,a):16;if(d===oj)return b[2]?c(E,a):17}else{if(d===rK)return b[2]?c(E,a):0;if(d===rd)return b[2]?c(E,a):1;if(d===o7)return b[2]?c(E,a):2;if(d===oF)return b[2]?c(E,a):3;if(d===nX)return b[2]?c(E,a):4;if(d===n8)return b[2]?c(E,a):5;if(d===oU)return b[2]?c(E,a):6;if(d===oi)return b[2]?c(E,a):7;if(d===p0)return b[2]?c(E,a):8}}}else if(h===g)return fa(E,a)}}return fc(E,a)}function -na(a){switch(a){case -0:return G8;case -1:return G9;case -2:return G_;case -3:return G$;case -4:return Ha;case -5:return Hb;case -6:return Hc;case -7:return Hd;case -8:return He;case -9:return Hf;case -10:return Hg;case -11:return Hh;case -12:return Hi;case -13:return Hj;case -14:return Hk;case -15:return Hl;case -16:return Hm;case -17:return Hn;case -18:return Ho;case -19:return Hp;case -20:return Hq;case -21:return Hr;case -22:return Hs;case -23:return Ht;case -24:return Hu;case -25:return Hv;case -26:return Hw;case -27:return Hx;case -28:return Hy;case -29:return Hz;case -30:return HA;case -31:return HB;case -32:return HC;case -33:return HD;case -34:return HE;case -35:return HF;default:return HG}}function -HH(a){if(typeof +d=e[2],i=bI(d,qd);if(0<=i){if(0>=i)return b[2]?c(F,a):18;var +j=bI(d,n7);if(0<=j){if(0>=j)return b[2]?c(F,a):28;if(d===o1)return b[2]?c(F,a):29;if(d===p6)return b[2]?c(F,a):30;if(d===oL)return b[2]?c(F,a):31;if(d===pu)return b[2]?c(F,a):32;if(d===n_)return b[2]?c(F,a):33;if(d===od)return b[2]?c(F,a):34;if(d===rb)return b[2]?c(F,a):35;if(d===oz)return b[2]?c(F,a):36}else{if(d===o_)return b[2]?c(F,a):19;if(d===nR)return b[2]?c(F,a):20;if(d===ru)return b[2]?c(F,a):21;if(d===rr)return b[2]?c(F,a):22;if(d===n1)return b[2]?c(F,a):23;if(d===q0)return b[2]?c(F,a):24;if(d===pV)return b[2]?c(F,a):25;if(d===rW)return b[2]?c(F,a):26;if(d===ol)return b[2]?c(F,a):27}}else{var +k=bI(d,rF);if(0<=k){if(0>=k)return b[2]?c(F,a):9;if(d===rJ)return b[2]?c(F,a):10;if(d===pI)return b[2]?c(F,a):11;if(d===r6)return b[2]?c(F,a):12;if(d===n5)return b[2]?c(F,a):13;if(d===n9)return b[2]?c(F,a):14;if(d===r1)return b[2]?c(F,a):15;if(d===qT)return b[2]?c(F,a):16;if(d===oC)return b[2]?c(F,a):17}else{if(d===r5)return b[2]?c(F,a):0;if(d===rx)return b[2]?c(F,a):1;if(d===po)return b[2]?c(F,a):2;if(d===oY)return b[2]?c(F,a):3;if(d===of)return b[2]?c(F,a):4;if(d===oq)return b[2]?c(F,a):5;if(d===pc)return b[2]?c(F,a):6;if(d===oB)return b[2]?c(F,a):7;if(d===qj)return b[2]?c(F,a):8}}}else if(h===g)return fa(F,a)}}return fc(F,a)}function +ne(a){switch(a){case +0:return HB;case +1:return HC;case +2:return HD;case +3:return HE;case +4:return HF;case +5:return HG;case +6:return HH;case +7:return HI;case +8:return HJ;case +9:return HK;case +10:return HL;case +11:return HM;case +12:return HN;case +13:return HO;case +14:return HP;case +15:return HQ;case +16:return HR;case +17:return HS;case +18:return HT;case +19:return HU;case +20:return HV;case +21:return HW;case +22:return HX;case +23:return HY;case +24:return HZ;case +25:return H0;case +26:return H1;case +27:return H2;case +28:return H3;case +29:return H4;case +30:return H5;case +31:return H6;case +32:return H7;case +33:return H8;case +34:return H9;case +35:return H_;default:return H$}}function +Ia(a){if(typeof a!=="number"&&h===a[1]){var b=a[2];if(!b)return fb(l,a);var e=b[1];if(typeof e!=="number"){var g=e[1];if(f===g){var -d=e[2],i=bE(d,nq);if(0<=i){if(0>=i)return b[2]?c(l,a):30;var -j=bE(d,qZ);if(0<=j){if(0>=j)return b[2]?c(l,a):46;var -k=bE(d,pu);if(0<=k){if(0>=k)return b[2]?c(l,a):54;if(d===ph)return b[2]?c(l,a):55;if(d===qr)return b[2]?c(l,a):56;if(d===p$)return b[2]?c(l,a):57;if(d===rC)return b[2]?c(l,a):58;if(d===r1)return b[2]?c(l,a):59;if(d===rk)return b[2]?c(l,a):60}else{if(d===or)return b[2]?c(l,a):47;if(d===p2)return b[2]?c(l,a):48;if(d===pG)return b[2]?c(l,a):49;if(d===qq)return b[2]?c(l,a):50;if(d===ek)return b[2]?c(l,a):51;if(d===rR)return b[2]?c(l,a):52;if(d===qn)return b[2]?c(l,a):53}}else{var -m=bE(d,qM);if(0<=m){if(0>=m)return b[2]?c(l,a):38;if(d===rg)return b[2]?c(l,a):39;if(d===oh)return b[2]?c(l,a):40;if(d===rT)return b[2]?c(l,a):41;if(d===pe)return b[2]?c(l,a):42;if(d===p_)return b[2]?c(l,a):43;if(d===pf)return b[2]?c(l,a):44;if(d===r2)return b[2]?c(l,a):45}else{if(d===oT)return b[2]?c(l,a):31;if(d===pc)return b[2]?c(l,a):32;if(d===gZ)return b[2]?c(l,a):33;if(d===hh)return b[2]?c(l,a):34;if(d===n$)return b[2]?c(l,a):35;if(d===qk)return b[2]?c(l,a):36;if(d===ps)return b[2]?c(l,a):37}}}else{var -n=bE(d,oH);if(0<=n){if(0>=n)return b[2]?c(l,a):15;var -o=bE(d,rz);if(0<=o){if(0>=o)return b[2]?c(l,a):23;if(d===o9)return b[2]?c(l,a):24;if(d===q5)return b[2]?c(l,a):25;if(d===nt)return b[2]?c(l,a):26;if(d===qa)return b[2]?c(l,a):27;if(d===qV)return b[2]?c(l,a):28;if(d===px)return b[2]?c(l,a):29}else{if(d===pR)return b[2]?c(l,a):16;if(d===pn)return b[2]?c(l,a):17;if(d===pQ)return b[2]?c(l,a):18;if(d===oz)return b[2]?c(l,a):19;if(d===oO)return b[2]?c(l,a):20;if(d===re)return b[2]?c(l,a):21;if(d===pt)return b[2]?c(l,a):22}}else{var -p=bE(d,qx);if(0<=p){if(0>=p)return b[2]?c(l,a):7;if(d===pa)return b[2]?c(l,a):8;if(d===qs)return b[2]?c(l,a):9;if(d===hp)return b[2]?c(l,a):10;if(d===pz)return b[2]?c(l,a):11;if(d===o2)return b[2]?c(l,a):12;if(d===nE)return b[2]?c(l,a):13;if(d===q6)return b[2]?c(l,a):14}else{if(d===oe)return b[2]?c(l,a):0;if(d===rN)return b[2]?c(l,a):1;if(d===od)return b[2]?c(l,a):2;if(d===oR)return b[2]?c(l,a):3;if(d===p8)return b[2]?c(l,a):4;if(d===qN)return b[2]?c(l,a):5;if(d===nK)return b[2]?c(l,a):6}}}}else if(h===g)return fa(l,a)}}return fc(l,a)}function -HI(a){var -b=a;if(31<=b)switch(b){case -31:return Ic;case -32:return Id;case -33:return Ie;case -34:return If;case -35:return Ig;case -36:return Ih;case -37:return Ii;case -38:return Ij;case -39:return Ik;case -40:return Il;case -41:return Im;case -42:return In;case -43:return Io;case -44:return Ip;case -45:return Iq;case -46:return Ir;case -47:return Is;case -48:return It;case -49:return Iu;case -50:return Iv;case -51:return Iw;case -52:return Ix;case -53:return Iy;case -54:return Iz;case -55:return IA;case -56:return IB;case -57:return IC;case -58:return ID;case -59:return IE;default:return IF}switch(b){case -0:return HJ;case -1:return HK;case -2:return HL;case -3:return HM;case -4:return HN;case -5:return HO;case -6:return HP;case -7:return HQ;case -8:return HR;case -9:return HS;case -10:return HT;case -11:return HU;case -12:return HV;case -13:return HW;case -14:return HX;case -15:return HY;case -16:return HZ;case -17:return H0;case -18:return H1;case -19:return H2;case -20:return H3;case -21:return H4;case -22:return H5;case -23:return H6;case -24:return H7;case -25:return H8;case -26:return H9;case -27:return H_;case -28:return H$;case -29:return Ia;default:return Ib}}function -IG(a){return m$([0,h,[0,[0,f,m9(a)],0]])}function -IH(a){var -b=na(a);if(typeof +d=e[2],i=bI(d,pb);if(0<=i){if(0>=i)return b[2]?c(l,a):30;var +j=bI(d,ri);if(0<=j){if(0>=j)return b[2]?c(l,a):45;var +k=bI(d,pN);if(0<=k){if(0>=k)return b[2]?c(l,a):53;if(d===pA)return b[2]?c(l,a):54;if(d===qM)return b[2]?c(l,a):55;if(d===qu)return b[2]?c(l,a):56;if(d===rX)return b[2]?c(l,a):57;if(d===sk)return b[2]?c(l,a):58;if(d===rE)return b[2]?c(l,a):59}else{if(d===oK)return b[2]?c(l,a):46;if(d===ql)return b[2]?c(l,a):47;if(d===p1)return b[2]?c(l,a):48;if(d===qL)return b[2]?c(l,a):49;if(d===en)return b[2]?c(l,a):50;if(d===sa)return b[2]?c(l,a):51;if(d===qI)return b[2]?c(l,a):52}}else{var +m=bI(d,rA);if(0<=m){if(0>=m)return b[2]?c(l,a):38;if(d===oA)return b[2]?c(l,a):39;if(d===sc)return b[2]?c(l,a):40;if(d===px)return b[2]?c(l,a):41;if(d===qt)return b[2]?c(l,a):42;if(d===py)return b[2]?c(l,a):43;if(d===sl)return b[2]?c(l,a):44}else{if(d===pv)return b[2]?c(l,a):31;if(d===g8)return b[2]?c(l,a):32;if(d===hp)return b[2]?c(l,a):33;if(d===os)return b[2]?c(l,a):34;if(d===qF)return b[2]?c(l,a):35;if(d===pL)return b[2]?c(l,a):36;if(d===q7)return b[2]?c(l,a):37}}}else{var +n=bI(d,qb);if(0<=n){if(0>=n)return b[2]?c(l,a):15;var +o=bI(d,pq);if(0<=o){if(0>=o)return b[2]?c(l,a):23;if(d===rn)return b[2]?c(l,a):24;if(d===nM)return b[2]?c(l,a):25;if(d===qv)return b[2]?c(l,a):26;if(d===re)return b[2]?c(l,a):27;if(d===pS)return b[2]?c(l,a):28;if(d===nJ)return b[2]?c(l,a):29}else{if(d===pG)return b[2]?c(l,a):16;if(d===qa)return b[2]?c(l,a):17;if(d===ha)return b[2]?c(l,a):18;if(d===o8)return b[2]?c(l,a):19;if(d===ry)return b[2]?c(l,a):20;if(d===pM)return b[2]?c(l,a):21;if(d===rU)return b[2]?c(l,a):22}}else{var +p=bI(d,pt);if(0<=p){if(0>=p)return b[2]?c(l,a):7;if(d===qN)return b[2]?c(l,a):8;if(d===hx)return b[2]?c(l,a):9;if(d===pU)return b[2]?c(l,a):10;if(d===pj)return b[2]?c(l,a):11;if(d===nX)return b[2]?c(l,a):12;if(d===ro)return b[2]?c(l,a):13;if(d===o0)return b[2]?c(l,a):14}else{if(d===oy)return b[2]?c(l,a):0;if(d===ow)return b[2]?c(l,a):1;if(d===o$)return b[2]?c(l,a):2;if(d===qr)return b[2]?c(l,a):3;if(d===q8)return b[2]?c(l,a):4;if(d===n4)return b[2]?c(l,a):5;if(d===qS)return b[2]?c(l,a):6}}}}else if(h===g)return fa(l,a)}}return fc(l,a)}function +Ib(a){switch(a){case +0:return Ic;case +1:return Id;case +2:return Ie;case +3:return If;case +4:return Ig;case +5:return Ih;case +6:return Ii;case +7:return Ij;case +8:return Ik;case +9:return Il;case +10:return Im;case +11:return In;case +12:return Io;case +13:return Ip;case +14:return Iq;case +15:return Ir;case +16:return Is;case +17:return It;case +18:return Iu;case +19:return Iv;case +20:return Iw;case +21:return Ix;case +22:return Iy;case +23:return Iz;case +24:return IA;case +25:return IB;case +26:return IC;case +27:return ID;case +28:return IE;case +29:return IF;case +30:return IG;case +31:return IH;case +32:return II;case +33:return IJ;case +34:return IK;case +35:return IL;case +36:return IM;case +37:return IN;case +38:return IO;case +39:return IP;case +40:return IQ;case +41:return IR;case +42:return IS;case +43:return IT;case +44:return IU;case +45:return IV;case +46:return IW;case +47:return IX;case +48:return IY;case +49:return IZ;case +50:return I0;case +51:return I1;case +52:return I2;case +53:return I3;case +54:return I4;case +55:return I5;case +56:return I6;case +57:return I7;case +58:return I8;default:return I9}}function +I_(a){if(typeof +a!=="number"&&E===a[1]){var +e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var +h=a;for(;;){if(!h)return;var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==dh)if(d!==rT){if(b(cg))g[1]=[0,d,b(g)]}else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,V(j)];else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,V(j)];h=k}}(a[2]));if(b(c))return bl(gK,b(c),a);if(b(g))return bm(gK,b(g),a);var +d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var +i=[0,[0,0===b(f)?1:0,I$],0];return bv(gK,a,[0,[0,0===b(e)?1:0,Ja],i])}return bn(gK,a)}function +Jb(a){var +b=a[1],c=[0,[0,Jc,U(a[2])],0];return[0,E,[0,[0,Jd,U(b)],c]]}function +Je(a){return nd([0,h,[0,[0,f,nb(a)],0]])}function +Jf(a){var +b=ne(a);if(typeof b!=="number"&&h===b[1]){var -c=b[2];if(c&&!c[2])return c[1]}throw i([0,u,II],1)}function -i4(a){if(typeof -a!=="number"&&K===a[1]){var -f=[0,0],l=[0,0],g=[0,0],m=[0,0],n=[0,0],o=[0,0],h=[0,0],i=[0,0],j=[0,0],p=[0,0],q=[0,0],c=[0,0],d=[0,0];(function(a){var -k=a;for(;;){if(!k)return;var -r=k[1],e=r[2],d=r[1],s=bE(d,ei);a:b:{var -t=k[2];if(0<=s)if(0=1){var +c=f;for(;;){dT(eX(c),h);var +j=c+1|0;if(a===c)break;c=j}}function +m(a){var +c=d[1];return k7(b)+c|0}function e(a){var -b=c[2][1][4],d=[0,iU[49].call(null,a),0,b,LA,0,0,0,0,0,0,0,0];return bx(fe(c)(0,[0,gE,gD,gH,gG,gI,gJ],d,0),function(a){return iH(function(a){var -b=a[3];return iI(function(a){return[0,b,a]},a[4])},a[1])})}return eZ(gj(bg(function(a){var -b=a[3];return bM(d(a),function(a){return bx(e(a),function(a){return[0,b,a]})})},b[1])),function(a){return AF(a)})}function -LB(a,b){return iH(function(a){var -c=a[1];return kL(function(a){return AS(a[2],b)},a[2])?[0,c]:0},a)}function -LC(a,d,c){var -j=a?a[1]:function(a){return};function -e(a,b){var -e=e2([0,[0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],0],LD,c),f=cr([0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],e);if(b>=a){var -d=a;for(;;){q[17].call(null,[0,d,0],0,f);var -g=d+1|0;if(b===d)break;d=g}}return}function -b(f,b){return bM(Lt(d,c),function(a){return bM(Ly(d,a),function(n){e1([0,LG,[0,f,[0,LF,[0,b,LE]]]]);var -e=kZ(0);(function(a,b){var -f=a,c=b;for(;;){var -h=d4(c,0);if(!h)return h;var -g=kN(c,Li);h3([0,0,0,d[2][1][4],LJ,nd,[0,f],[0,g],LI,LH,1,0,1],e);f=f+g|0;c=c-g|0}}(f,(b-f|0)+1|0));var -k=k1(e);function -h(a,f){var -b=a?a[1]:1;if(d4(b,0))return eX(gj(bg(function(a){dp(LP);return bx(fe(d)(0,[0,gE,gD,gH,gG,gI,gJ],a,0),function(a){var -b=a[1],d=a[3];dp([0,LK,[0,hU(b),0]]);g(j,[0,[0,k,k1(e)]]);return function(o,b){return Aw(function(a,b){var -h=b[9],e=b[3],f=b[1],p=b[7],r=b[5],s=b[4],d=e2([0,[0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],[0,[0,J[11],J[12],J[13],J[14],J[15],J[16],J[17]],[0,[0,y[11],y[12],y[13],y[14],y[15],y[16],y[17]],[0,[0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],[0,[0,aw[11],aw[12],aw[13],aw[14],aw[15],aw[16],aw[17]],[0,[0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0]]]]]],LL,c),t=cr([0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],d),u=cr([0,J[11],J[12],J[13],J[14],J[15],J[16],J[17]],d),v=cr([0,y[11],y[12],y[13],y[14],y[15],y[16],y[17]],d),w=y[16].call(null,[0,gT[2],gT[1]],LM,v),j=cr([0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],d),x=T[16].call(null,[0,gU[2],gU[1]],LN,j),z=cr([0,aw[11],aw[12],aw[13],aw[14],aw[15],aw[16],aw[17]],d);function -B(b){var -c=D4(b);function -d(a){if(0!==a[0])throw i([0,eT,a[1]],1);var -d=a[1];return d?eW(d[1]):function(a){return dn(bN,a)}(dq(T[14].call(null,[0,b,c],0,j)))}return function(a){return xJ(eX,d,a)}(dq(gU[9].call(null,c,x)))}function -k(a){return gj(kM(function(a){var -b=44;function -c(a){return kT(b,a)}return function(a){return bg(B,a)}(function(a){return bg(t6,a)}(function(a){return kM(c,a)}(kT(59,a[1]))))},a))}var -l=o+a|0,A=cr([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],d),m=LB(n,gn(s,LO)),g=gn(b[2],f);q[17].call(null,[0,l,[0,e]],0,t);if(1===h){var -C=function(a){return AE(a,0)},D=function(a){return iH(C,a)},E=function(a){return dn(D,a)}(gj(bg(function(a){return dq(gT[9].call(null,[0,a],w))},m))),F=function(a){var -b=a[2],c=[0,f,b,a[1]],d=[0,[0,e],iI(function(a){return[0,a]},r),g,b,[0,p]];return H[14].call(null,d,[0,c],A)};(function(a){return dn(F,a)}(function(a){return l1(E,a)}(k(b[10]))));return 0}if(16===h){var -G=function(a){return aw[14].call(null,[0,[0,e],g,a],[0,[0,f,a]],z)};(function(a){return dn(G,a)}(k(b[10])));return 0}J[17].call(null,[0,[0,l,m,g],b],0,u);return 0},b)}(d,b)})},function(a,b){var -c=a,d=b;for(;;){if(dt(d,0))return bI(c);var -e=k0(f);if(!e)return bI(c);c=[0,e[1],c];d=d-1|0}}(0,b))),function(a){return Av(a)?eY(0):h(0,f)});throw i([0,u,LQ],1)}return h(0,e)})})}return function(a){if(typeof -a==="number")return 2===a?eY(0):eY(0);if(0!==a[0])return b(a[1],a[2]);var -c=a[3],d=a[2];e(a[1],c);return b(d,c)}}var -ne=JW([0]);function -LR(d,b,c){return bM(Ls(b,c),function(a){var -e=[0,a,Lr[2]];return bx(LC(iI(function(b){g(b,e);return function(a){return g(b,[0,e[1],a])}},d),b,c)(a),function(a){return Az(function(a){return g(a,LS)},d)})})}var -LT=ne[2],LU=ne[3],LV=J[18];function -LW(a,b){var -f=zY(a);e1([0,LY,[0,zX(a),[0,LX,[0,f,0]]]]);var -c=gl(b),h=Ah(c);e1(LZ);uh(function(a){return Ag(c,a)},h);var -e=q[18].call(null,[0,L0],L1,c);KZ[15].call(null,L3,L2,0,e);var -d=LV([0,[1,[0,L6,L5,L4]]],L7,c);K3[15].call(null,L9,L8,0,d);K1[15].call(null,Ma,[1,[0,L$,L_]],0,d);K5[15].call(null,Md,[1,[0,Mc,Mb]],0,d);var -i=KX[18].call(null,[0,Me],Mf,c),k=y[18].call(null,0,Mg,c),l=gT[15];g(function(a){var -b=a;return l(Mj,Mi,Mh,b)},k);var -m=T[18].call(null,0,Mk,c),n=gU[15];g(function(a){var -b=a;return n(Mn,Mm,Ml,b)},m);var -o=aw[18].call(null,0,0,c),p=Le[15];j(function(a,b){var -d=b,c=a;return p(Mp,Mo,c,d)},0,o);H[18].call(null,0,0,c);return e1([0,Mq,[0,e,[0,d,[0,i,0]]]])}function -Mr(d,b,c){function -e(a,b){return g(c,gl(b))}(function(a){return iF(e,a)}(function(a){return Al(LW,a)}(function(a){return Am(b,d,a)}(Ao(0,0)))));return}x5(0);function -Ms(a){return eZ(a,function(a){return mi(function(a){return[0,jo,a]},a)})}function -nf(a){return Ms(dq(a))}function -Mt(a){return function(a){return{fut:a}}(eV(l0(lZ(function(a){return a[jF]},a)),function(a){return d0(gh(function(a){return a},a))}))}function -Mu(a){var -d=iz(0),e=d[1],f=d[2];(function(a){return Mr(Mw,Mv,a)}(function(a){f([0,a]);return 0}));function +c=gn(0),f=c[2],j=c[1];zY(dK,function(a){return f(MK)});return au(j,function(a){var +c=ii(h);if(!c)return b2(0);var +n=c[1],f=gn(0),j=f[2];dT(f[1],h);return function(a){return dt(n,a)}(function(a){var +c=ii(b);if(c){var +f=c[1],h=d[1],n=m(0);g(k,[0,[0,i[1],n,h]]);var +o=au(l(a,j,f),function(a){return e(0)});return au(e(0),function(a){return aI(o,function(a){return 0})})}j(a);return b2(0)})})}return e(0)}(fp),function(a){return du([0,MM,[0,nw[1],ML]])})})})}var +nx=Kw([0]);function +MR(a,b,c){var +d=a?a[1]:function(a){return 0};g(d,Mb);return aI(MI(function(a){return g(d,[0,1,a])},b,c),function(a){return g(d,MS)})}var +MT=nx[2],MU=nx[3],MV=aC[18];function +MW(a,b){var +i=Ai(a);eY([0,MY,[0,Ah(a),[0,MX,[0,i,0]]]]);var +c=iU(b),j=AE(c);eY(MZ);uE(function(a){return AD(c,a)},j);var +e=da[18].call(null,[0,M0],M1,c);LI[15].call(null,M3,M2,0,e);var +d=MV([0,[1,[0,M6,M5,M4]]],M7,c);LM[15].call(null,M9,M8,0,d);LK[15].call(null,Na,[1,[0,M$,M_]],0,d);LO[15].call(null,Nd,[1,[0,Nc,Nb]],0,d);var +k=LG[18].call(null,[0,Ne],Nf,c),l=O[18].call(null,0,Ng,c),m=g1[15];g(function(a){var +b=a;return m(Nj,Ni,Nh,b)},l);var +n=S[18].call(null,0,Nk,c),o=g2[15];g(function(a){var +b=a;return o(Nn,Nm,Nl,b)},n);var +f=_[18].call(null,0,No,c);ns[15].call(null,Nr,Nq,Np,f);ns[15].call(null,Nt,Ns,0,f);var +h=y[18].call(null,0,0,c);g3[15].call(null,Nw,Nv,Nu,h);ff[15].call(null,Ny,Nx,0,h);r[18].call(null,0,0,c);return eY([0,Nz,[0,e,[0,d,[0,k,0]]]])}var +NA=3;function +NB(a,b,c){var +d=a?a[1]:NA,e=b?b[1]:NC,h=[0,d];function +f(a,b){return g(c,iU(b))}(function(a){return md(f,a)}(function(a){return AI(MW,a)}(function(a){return AJ(e,h,a)}(AL(0,0)))))}yn(0);function +ND(a){return go(a,function(a){return ml(function(a){return[0,jA,a]},a)})}function +ny(a){return ND(bE(a))}function +NE(a){return function(a){return{fut:a}}(eW(l5(l4(function(a){return a[jT]},a)),function(a){return d5(gl(function(a){return a},a))}))}function +NF(a){var +d=gn(0),e=d[1],f=d[2];NB(0,0,function(a){f([0,a]);return 0});function b(d,b,c){var -f=b?b[1]:0;return bx(e,function(a){return function(a){return cr(d,a)}(e2([0,d,0],[0,f],a))})}var -h=ie(0,64);function +f=b?b[1]:0;return aI(e,function(a){return function(a){return c4(d,a)}(dw([0,d,0],[0,f],a))})}var +h=yu(0,64);function j(a,b){var -c=b[1];return LR([0,function(a){return LT(0,[0,c,a])}],b[2],a)}function +c=b[1];return MR([0,function(a){return MT(0,[0,c,a])}],b[2],a)}function c(a,b){var c=b[2],j=b[4],k=b[3];try{var -e=eY(function(a){return lt(h,a)}(nc(b)));return e}catch(f){var -d=an(f);if(d!==bG)throw i(d,0);var -l=d2(d3);return bx(nf(H[7].call(null,0,a)),function(a){dp([0,My,[0,d2(d3)-l,Mx]]);var -f=d2(d3);if(typeof +e=b2(function(a){return yB(h,a)}(nm(b)));return e}catch(f){var +d=al(f);if(d!==bZ)throw i(d,0);var +l=d8(d9);return aI(ny(r[7].call(null,0,a)),function(a){du([0,NH,[0,d8(d9)-l,NG]]);var +f=d8(d9);if(typeof c==="number")var d=a;else if(0===c[0])var -m=c[1],d=me(function(a){return kL(function(a){return tv(a,m)},a[3])},a);else +m=c[1],d=mg(function(a){return h8(function(a){return tR(a,m)},a[4])},a);else var -d=eA(ME);var -e=me(function(a){var -l=a[1],d=dw[29].call(null,a[2]);return eK(function(a,b){if(0===b[0]){var -e=b[1];if(!AH(e)){var -m=hX(e),n=AQ(g(X(Mz),m)),o=hX(l);return a?gm(AR(0,n,o),0):a}}else{var +d=eD(NN);var +e=mg(function(a){var +l=a[2],d=dz[29].call(null,a[3]);return cC(function(a,b){if(0===b[0]){var +e=b[1];if(!A4(e)){var +m=h$(e),n=Bb(g(Y(NI),m)),o=h$(l);return a?gx(Bc(0,n,o),0):a}}else{var c=b[1];if(typeof c!=="number"){if(0===c[0]){var f=c[1];if(a)var -p=dw[22].call(null,f),h=p||1-dw[7].call(null,d,f);else +p=dz[22].call(null,f),h=p||1-dz[7].call(null,d,f);else var h=a;return h}var i=c[1];if(a){var -j=dw[22].call(null,i);if(!j)return dw[7].call(null,d,i);var +j=dz[22].call(null,i);if(!j)return dz[7].call(null,d,i);var k=j}else var -k=a;return k}}return 1},1,j)},d);dp([0,MB,[0,d2(d3)-f,MA]]);var -i=d2(d3);if(k)un(function(a,b){return hY(a[1],b[1])},e);dp([0,MD,[0,d2(d3)-i,MC]]);ye(h,nc(b),e);return e})}}return[0,,,,,,,function(a){switch(a[0]){case -0:JL(a[1]);return eY(0);case +k=a;return k}}return 1},1,j)},d);du([0,NK,[0,d8(d9)-f,NJ]]);var +i=d8(d9);if(k)uJ(function(a,b){return ia(a[2],b[2])},e);du([0,NM,[0,d8(d9)-i,NL]]);yz(h,nm(b),e);return e})}}return[0,,,,,,,function(a){switch(a[0]){case +0:Km(a[1]);return b2(0);case 1:var -h=a[1];return bM(e,function(a){return eZ(j(a,to(h)),function(a){return mi(function(a){return[0,jo,a]},a)})});case -2:return bM(b([0,y[11],y[12],y[13],y[14],y[15],y[16],y[17]],0,0),function(a){var -b=dq(y[7].call(null,0,a));function +h=a[1];return au(e,function(a){return go(j(a,tK(h)),function(a){return ml(function(a){return[0,jA,a]},a)})});case +2:return au(b([0,O[11],O[12],O[13],O[14],O[15],O[16],O[17]],0,0),function(a){var +b=bE(O[7].call(null,0,a));function c(a){var b=a[1];a:{if(0===b[0]){var -c=a[2],e=b[1];if(0===c[0])return[0,ui(function(a,b){return[0,a,b]},e,c[1])]}else{var +c=a[2],e=b[1];if(0===c[0])return[0,uF(function(a,b){return[0,a,b]},e,c[1])]}else{var f=b[1];if(0===a[2][0]){var d=f;break a}}var -d=a[2][1]}return[1,[0,jo,d]]}return function(a){return dn(c,a)}(l1(b,dq(y[6].call(null,a))))});case +d=a[2][1]}return[1,[0,jA,d]]}return function(a){return d7(c,a)}(zD(b,bE(O[6].call(null,a))))});case 3:var -f=a[1];return bM(b([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0,0),function(a){return bx(c(a,f),function(a){return[0,f,0,a.length-1]})});case +f=a[1];return au(b([0,r[11],r[12],r[13],r[14],r[15],r[16],r[17]],0,0),function(a){return aI(c(a,f),function(a){return[0,f,0,a.length-1]})});case 4:var -k=a[1];return bM(b([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0,0),function(a){return bM(c(a,k[1]),function(c){return bM(b([0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],0,0),function(a){return bx(nf(T[6].call(null,a)),function(e){var -a=ul(function(a,b){var -c=bg(function(a){return[0,a,1]},b[2]);return iT[55].call(null,function(a){return function(a,b){return a+b|0}},a,c)},iT[1],c);function +k=a[1];return au(b([0,r[11],r[12],r[13],r[14],r[15],r[16],r[17]],0,0),function(a){return au(c(a,k[1]),function(c){return au(b([0,S[11],S[12],S[13],S[14],S[15],S[16],S[17]],0,0),function(a){return aI(ny(S[6].call(null,a)),function(e){var +a=k3(function(a,b){var +c=bz(function(a){return[0,a,1]},b[3]);return i7[55].call(null,function(a){return function(a,b){return a+b|0}},a,c)},i7[1],c);function b(a,b){try{var -d=a-1|0,f=[0,b,p(e,d)[1+d]];return f}catch(f){var -c=an(f);if(c[1]===fS)return eA(MF);throw i(c,0)}}var -d=iT[19];return g(function(a){var +d=a-1|0,f=[0,b,q(e,d)[1+d]];return f}catch(f){var +c=al(f);if(c[1]===fU)return eD(NO);throw i(c,0)}}var +d=i7[19];return g(function(a){var c=a;return d(b,c)},a)})})})});default:var -d=a[1],l=a[3],m=a[2];return bM(b([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0,0),function(e){return bM(c(e,d[1]),function(f){return eZ(Mt(kV(function(a){try{var -c=JX(m,d[3],a+d[2]|0),b=p(f,c)[1+c],g=eZ(dq(H[4].call(null,b,e)),function(a){if(0===a[0]){var -c=a[1];return c?[0,[0,b,c[1]]]:0}l7([0,MG,[0,b,[0,a[1],0]]]);return 0});return g}catch(f){return eW(0)}},l)),function(a){return[0,a]})})})}}]}LU(function(a){return[0,Mu(a)[7]]});hQ(0);return}(globalThis)); +d=a[1],l=a[3],m=a[2];return au(b([0,r[11],r[12],r[13],r[14],r[15],r[16],r[17]],0,0),function(e){return au(c(e,d[1]),function(f){return go(NE(k2(function(a){try{var +c=Kx(m,d[3],a+d[2]|0),b=q(f,c)[1+c],g=go(bE(r[4].call(null,b,e)),function(a){if(0===a[0]){var +c=a[1];return c?[0,[0,b,c[1]]]:0}iT([0,NP,[0,b,[0,a[1],0]]]);return 0});return g}catch(f){return eX(0)}},l)),function(a){return[0,a]})})})}}]}MU(function(a){return[0,NF(a)[7]]});h2(0);return}(globalThis)); diff --git a/main.bc.js b/main.bc.js index 7c33547..6999aa2 100644 --- a/main.bc.js +++ b/main.bc.js @@ -1,45 +1,47 @@ // Generated by js_of_ocaml -//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.8.2+5.8.2 +//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.9.0+5.9.0 (function(a){typeof globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:true,get:b}),_T_));function b(){var b=this||self;b.globalThis=b;delete -a.prototype._T_}}(Object));(function(L){"use strict";var -vA=317,rX="SH",rW="console",c3="int_of_string",um="member",rU="ImageBlurHashes",rV=408,f4=427938126,c2=0xff,vy="%a",vz="%ni",d_=240,rT=815,tf=362,rS="tc",ch="J",lu=218,vx=338,gb=-211558048,te="aa",tc=19067,td="Pw",vw="Out_of_memory",K=963043957,c0=870828711,l0="Failure",ih="Unix.Unix_error",ig="\\b",rR="length",tb="Program",vv="src/core/CCString.pp.ml",ta=321,rQ=375,gh="false",s$=", characters ",ul=238,ie=869834347,k$="ou",rP=296,uk="SortName",rO="MusicArtist",ir="Map.bal",e9=-211555818,rN="ChannelFolderItem",ui=30214610,uj=143365725,a3="v",c1="ae",rM=260,ba="w",uh="closedir",vu="Match_failure",s_="%s",eX="illegal",ug="MusicAlbum",e="",vt="pathname",rL="Year",cu=434236056,h9=": ",uf="append",e2="Id",vs="']')",vr=517,ue=851,rK=371,f3="end",ud=0xe0,iy="object",k_="Jellyfin",s9=346,vq="EEXIST",s8=826371656,uc="px",vp=459,vo="Locations",s7=546,ub="Undefined_recursive_module",b4=2147483647,iq="\\t",vn="%.16g",ee=224,ip="array",lt="surrogate",ua=204,t$="random",ix=192,dv=0x3f,t_=492,id="'",iw=": No such file or directory",t9=" dst=",vm="av",b1="ts",cK=256,y="A",vl="[]",rJ="height: ",t8=651,rI=832,s6=383,rH=3456159,vk=":",s5="grid-column:1/-1",aH="T",vj="Printexc.handle_uncaught_exception",s4="Type",ls=" : flags Open_rdonly and Open_wronly are not compatible",e1=123,rG=499,rF="6",s2="class",s3=386,k9=82908052,lr="sorts",s1="@;",t7=822,vi="LiveTvChannel",s0="Genre",lZ="{feng}",t6=">",sZ=239,c6="Name",cZ=127,cz=0xffff,t5="Sys_blocked_io",X="I",b3="Unexpected end of input",sX="ServerName",sY="_",t4=205,vh="AggregateFolder",h8="_bigarr02",sW=367,lL=245,k8="not",t3="Synchronized",lY="compare: functional value",lK="mkdir",gg=1000,bt="vendor/lwd/lib/lwd/lwd_seq.pp.ml",rE="@[",ic="\\\\",vf="window",vg="Primary",rD="BoxSet",rC=225181919,eW=-826170817,sV="/static/",ve=14596,R="s",ed="lib/db/stores.ml",iv="4",k7=749039939,t2="Assert_failure",vd="Movie",t1=152,vb="%X",vc="OCAMLRUNPARAM",k6=253,sU=122,t0=425,lq="canon",tZ=553,lp="in",h7=793793712,va=".0",ea="genres",ga="src/uutf.ml",lX="views",rB="src",sT=8232,rA="Lwd_seq.rank: node is marked",rz=391,aG=852405675,tY=429931233,u$="Recording",ry="lone",lo="2",h6="Set.bal",lJ=120,eV=1024,tX=1027,d9=246,A="U",rw="Season",rx="%s--id",sS=389604418,a2="m",sR=557,d8=-752863768,u_="AccessToken",tW="%s/Items/%s/Images/Primary?width=500&format=Jpg",u9=309,rv="stream",dz="or",ib=1017453041,lI="Fatal error: exception ",aV="camlinternalFormat.ml",u8=273,ru="ui",gf=708012133,bC="j",u7=305,tV=560,aP="c",cd=24029,u6=144,rt="ItemId",u5=713199754,rs=827,sQ=372,d7="date_added",sP="ENOTEMPTY",cf="dz",ln=1255,u4=726711616,tU=508493173,a="@ ",u3="Bigarray.blit: dimension mismatch",iu="JSON",rr="Book",tT="Stack_overflow",rq="Failed to unmarshal data",an="G",v="a",lm="string",tS="Path",u2=211,ge=-48,a0="P",u1=732461442,aj="t",sO="TvProgram",eU="",sN=480,uZ="Folder",u0=513,rp=-10,tR=65535,it="desc",ro="UserView",sM=193,rn="ParentId",uY=814,ll="AV",uX=-937474657,cy="/",io=605782321,sL="body",c8=3654863,uW="Episode",sK=297,uV="DZ",sJ="Title",tQ="--id",q="O",N="vendor/lwd/lib/lwd/lwd_table.ml",lk=756711075,rm="Fatal error: exception %s\n",tP=153884648,bs="F",tO=686,rl=818,h5="input",k5="jsError",gd="ng",lj=737308346,ar="vendor/lwd/lib/lwd/lwd.ml",tN=823,rk="UserRootFolder",sI="AudioBook",uU="ue",rj="ManualPlaylistsFolder",tM="rem",bJ="0",uT=197,sG="hv",sH=368,ab="n",tL=679,uS="duration",ri="%u",k4=881518886,p="r",uR=642125662,rh="Series",lH=8100,rg=423,cH=737455525,b5="Q",re="LiveTvProgram",rf=0x7ff0,cv="|",dy=684370880,tK="End_of_file",sE="AlbumId",sF="comment",sD="^",tJ=819,M="i",dC=244,lG="text",uQ="Audio",af="L",li="ENOTDIR",f$="null",uP="{}",d$=17732,e0=992790154,e8="+",f_=726928360,lW=8097,uO=65533,rd=858694086,tI=523,cL=3455931,sC=395,f9=1023,e7=125,sB="Pervasives.do_at_exit",f2=57343,tH="%c",eZ=65536,rb=",@ ",rc=186,lg=-133,lh=0xf,aW="k",h4=-588596599,lF=3299808,aZ="B",f8=659980059,tG="background-image: url(",cg="X",uN="Photo",tF="infinity",lf=571,tE="CollectionFolder",uM="fd ",q$="Playlist",ra=315,q_="em",bj="M",sA=290,lE=233,sz=0xf0,lV='\\"',tB="5rem",tC="5",tD="Sys_error",ce=0x80,$="z",aq="N",uL="PhotoAlbum",im=1073741823,sx=377,sy="(','",tA="asc",aF="K",d="e",aa="d",le="ENOENT",tz=358,bi=15681,lD=-605101559,sw=544,ia="item",cw=0x8000,sv="playbackRate",ty=0x800,uK=257,st="OE",su="Division_by_zero",tx="@{",q9="(Program not linked with -g, cannot print stack backtrace)\n",ld="track.png",ss="Channel",tw="MusicGenre",k3=55296,q8=462,ai=106380200,bu="V",b2="x",lC=56320,aO="Y",lB=" : file already exists",J=128,c5="sh",dx=255,tv="vendor/lwd/lib/brr-lwd/elwd.ml",lU=56319,bI="id",h$=100,r=848054398,o=-976970511,q7="background-image: url(%S)",sq=1114111,sr=3854881,eb="true",lA="src/jsonm.ml",tu=337,h3=102,sp="box",lT=-97,aA="H",lS="album_id",uJ=836,lc=4100401,lz="TH",tt=334,ak="D",ly=199,k2=2047,lb="separator",f7=237,uH=394,uI="([^/]+)",so=759637122,c4="sort_name",as="Z",q6="documentElement",uG=225,_="S",sn="MusicVideo",lR="Form submitted:",a1="W",sm=266,h_="\\n",sl=-101336657,e6=3850876,ag="R",bK=" ",f6=191,q5=-67383738,k1="fs",ts=550,uF="%i",q4=65279,sk="0x",f5=14610,sj=0xdfff,q3=435,bh=365180284,uE=201,si=": closedir failed",sh=17718,q2=160,bA="p",az="C",sg=384,sf=223,eY="ServerId",ay="y",uD="Not_found",tr=397,sd="style",se="Studio",uC="button",sb=" unfetched: ",sc="bytes.ml",uB="%Li",tq="Invalid_argument",c7="oe",ec=254,tp="GenreItems",cJ=0xffffff,q1=847,uz=-43,uA="ls",to="Trailer",uy="{rams}",ux="Video",q0="submit",qZ=850,il=512,lQ=", ",tm="%li",tn=1026,uw="Cover",lP=133,sa="BasePluginFolder",is="tsh",aN="b",ik="/Items/",qY="Person",h2="\\r",k0="nan",uv="%.17g",U="h",tl=531,lx="rmdir",uu="Cstruct.blit_from_string src=",qX="'}')",r$=" ",tk=831,c="o",tj=174,B=248,C="l",W="g",ti="User",ut="low",r_=837,h1="character",cY="value",r9=826,lO=" : flags Open_text and Open_binary are not compatible",us=846,lN=": Not a directory",r8="Nothing playing",r7="TS",s="u",qW=" : is a directory",lM="error",qV="classList",ij=1006505782,dA=".",f0=-364210971,ur="/Images/Primary?width=500&format=Jpg",qU=438511779,r6=363,th="CollectionType",bk="name",qT=457,dw="q",bB=737456202,e5="server_id",tg=194,gc="th",qS=271,ii="lwd-to-remove",lw=",",qR="checked",lv="index out of bounds",qQ=322,qP="{SUPERTRIANGULAR}",e4=252,kZ="%d",r5="lwdui-virtual-table-row",uq=292,uo="PlaylistsFolder",up=": file descriptor already closed",cx="-",kY="EBADF",kX=" len=",b0=-633954146,r4=12520,r3="Username",f1="AE",r2="AO",r1="3",cI=250,la="ph",r0=654,h0=103,dB='"',cc="f",qN="%.0f",qO=420,rZ=538,un=0xdc00,rY="TvChannel",qM=", line",E="E",e3="lz";function -Vg(a,b,c,d,e){if(d<=b)for(var +a.prototype._T_}}(Object));(function(U){"use strict";var +v2=317,sl="SH",sk="console",c9="int_of_string",uO="member",sj="ImageBlurHashes",gg=427938126,l3="node:fs",cM=0xff,v0="%a",v1="%ni",ef=240,si=815,tH=362,sh="tc",bT="J",lL=218,vZ=338,gp=-211558048,tG="aa",tE=19067,tF="Pw",vY="Out_of_memory",H=963043957,c7=870828711,mf="Failure",iz="Unix.Unix_error",iy="\\b",sg="length",tD="Program",vX="src/core/CCString.pp.ml",tC=321,sf=375,gx="false",tB=", characters ",uN=238,ix=869834347,lo="ou",lp=296,uM="SortName",se="MusicArtist",iH="Map.bal",ff=-211555818,sd="ChannelFolderItem",uK=30214610,uL=143365725,a9="v",c8="ae",sc=260,be="w",uJ="closedir",vW="Match_failure",tA="%s",e6="illegal",uI="MusicAlbum",e="",vV="pathname",sb="Year",cw=434236056,ln=": ",uH="append",e_="Id",vU="']')",vT=517,uG=851,sa=371,gf="end",uF=0xe0,iN="object",lm="Jellyfin",tz=346,vS="EEXIST",ty=203,tx=826371656,uE="px",vR=459,vQ="Locations",tw=546,uD="Undefined_recursive_module",b_=2147483647,iG="\\t",vP="%.16g",ek=224,iF="array",lK="surrogate",uC=204,uB="random",iM=192,dD=0x3f,r$=114,uA=492,iw="'",gw=": No such file or directory",uz=" dst=",vO="av",b7="ts",cP=256,y="A",vN="[]",r_="height: ",uy=651,r9=832,tv=383,r8=3456159,vM=":",tu="grid-column:1/-1",aJ="T",vL="Printexc.handle_uncaught_exception",tt="Type",lJ=" : flags Open_rdonly and Open_wronly are not compatible",ej=123,vK="item.Id",r7=499,r6="6",tr="class",ts=386,ll=82908052,lI="sorts",tq="@;",ux=822,vJ="LiveTvChannel",tp="Genre",me="{feng}",uw=">",ee="mbid",to=239,cz="Name",vI="IsFolder",c6=127,cB=0xffff,uv="Sys_blocked_io",Z="I",b9="Unexpected end of input",tn="ServerName",lH="_",uu=205,vH="AggregateFolder",iq="_bigarr02",tm=367,l2=245,lk="not",md="compare: functional value",l1="mkdir",gv=1000,bw="vendor/lwd/lib/lwd/lwd_seq.pp.ml",r5="@[",iv="\\\\",vF="window",vG="Primary",r4="BoxSet",r3=225181919,e5=-826170817,tl="/static/",vE=14596,R="s",db="lib/db/stores.ml",iL="4",lj=749039939,ut="Assert_failure",vD="Movie",us=152,vB="%X",vC="OCAMLRUNPARAM",li=253,tk=122,ur=425,eh="canon",uq=553,lG="in",ip=793793712,vA=".0",tj="by-idx",go="src/uutf.ml",mc="views",r2="src",ti=8232,r1="Lwd_seq.rank: node is marked",r0=391,aI=852405675,up=429931233,vz="Recording",rZ="lone",lF="2",io="Set.bal",l0=120,ed=1024,uo=1027,vy="Url",ec=246,A="U",rX="Season",rY="%s--id",th=389604418,a8="m",tg=557,eb=-752863768,vx="AccessToken",tf="tracks",vw=309,rW="stream",dH="or",iu=1017453041,lZ="Fatal error: exception ",a0="camlinternalFormat.ml",rV="ui",gu=708012133,bJ="j",vv=305,un=560,aT="c",ch=24029,vu=144,lh="ItemId",vt=713199754,rU=827,te=372,ea="date_added",td="ENOTEMPTY",ck="dz",lE=1255,vs=726711616,um=508493173,a="@ ",vr="Bigarray.blit: dimension mismatch",iK="JSON",rT="Book",ul="Stack_overflow",rS="Failed to unmarshal data",aq="G",u="a",lD="string",uk="Path",vq=211,gt=-48,a6="P",vp=732461442,al="t",tc="TvProgram",e4="",tb=480,vn="Folder",vo=513,rR=-10,uj=65535,iJ="desc",rQ="UserView",ta=193,rP="ParentId",vm=814,lC="AV",vl=-937474657,cR="/",iE=605782321,s$="body",da=3654863,vk="Episode",s_=297,vj="DZ",s9="Title",ui="--id",q="O",O="vendor/lwd/lib/lwd/lwd_table.ml",lB=756711075,rO="Fatal error: exception %s\n",uh=153884648,s8="sorts.views",bv="F",ug=686,rN=818,im="input",lg="jsError",gs="ng",lA=737308346,at="vendor/lwd/lib/lwd/lwd.ml",uf=823,rM="UserRootFolder",s7="AudioBook",vi="ue",rL="ManualPlaylistsFolder",ue="rem",bR="0",s5="hv",s6=368,af="n",ud=679,vh="duration",rK="%u",lf=881518886,p="r",vg=642125662,rJ="Series",lY=8100,rI=423,cL=737455525,b$="Q",rG="LiveTvProgram",rH=0x7ff0,cx="|",dG=684370880,uc="End_of_file",s3="AlbumId",s4="comment",il="idx",s2="^",ub=819,N="i",dL=244,lX="text",vf="Audio",ah="L",lz="ENOTDIR",gn="null",ve="{}",eg=17732,e9=992790154,fe="+",gm=726928360,mb=8097,vd=65533,rF=858694086,ua=523,cQ=3455931,s1=395,gl=1023,fd=125,s0="Pervasives.do_at_exit",ge=57343,t$="%c",e8=65536,rD=",@ ",rE=186,lx=-133,ly=0xf,a1="k",ik=-588596599,lW=3299808,a5="B",gk=659980059,t_="background-image: url(",cl="X",vc="Photo",t9="infinity",lw=571,t8="CollectionFolder",vb="fd ",rB="Playlist",rC=315,rA="em",bn="M",lv=290,t7=233,sZ=0xf0,ma='\\"',t4="5rem",t5="5",t6="Sys_error",cj=0x80,ad="z",as="N",va="PhotoAlbum",iD=1073741823,sX=377,sY="(','",t3="asc",aH="K",d="e",ae="d",lu="ENOENT",t2=358,rz="J ",bm=15681,lV=-605101559,sW=544,it="item",cy=0x8000,sV="playbackRate",t1=0x800,u$=257,sT="OE",sU="Division_by_zero",t0="@{",ry="(Program not linked with -g, cannot print stack backtrace)\n",gd="track.png",sS="Channel",tZ="MusicGenre",le=55296,rx=462,ak=106380200,bx="V",b8="x",lU=56320,aR="Y",lT=" : file already exists",M=128,c_="sh",dF=255,tY="vendor/lwd/lib/brr-lwd/elwd.ml",l$=56319,aQ="id",is=100,r=848054398,o=-976970511,rw="background-image: url(%S)",sQ=1114111,sR=3854881,ei="true",lS="src/jsonm.ml",tX=337,gb=102,sP="box",l_=-97,aF="H",l9="album_id",u_=836,lt=4100401,lR="TH",tW=334,am="D",lQ=199,ld=2047,ls="separator",gj=237,u8=394,u9="([^/]+)",sO=759637122,ci="sort_name",au="Z",rv="documentElement",u7=225,ac="S",sN="MusicVideo",l8="Form submitted:",a7="W",sM=266,ir="\\n",sL=-101336657,fc=3850876,aj="R",bS=" ",gi=191,ru=-67383738,tV=550,u6="%i",rt=65279,tU=259,sK="0x",gh=14610,sJ=0xdfff,rs=435,bl=365180284,u5=201,sI=": closedir failed",sH=17718,rr=160,bI="p",aE="C",sG=384,sF=223,e7="ServerId",aD="y",u4="Not_found",tT=397,sD="style",sE="Studio",u3="button",sC="bytes.ml",u2="%Li",tS="Invalid_argument",c$="oe",dK=254,tR="GenreItems",cO=0xffffff,rq=847,u0=-43,u1="ls",tQ="Trailer",uZ="{rams}",uY="Video",rp="submit",ro=850,iC=512,l7=", ",tO="%li",tP=1026,uX="Cover",l6=133,sB="BasePluginFolder",iI="tsh",aP="b",rn="Person",ij="\\r",lc="nan",uW="%.17g",W="h",tN=531,lP="rmdir",uV="Cstruct.blit_from_string src=",rm="'}')",sA=" ",tM=831,c="o",tL=174,B=248,C="l",Y="g",tK="User",uU="low",lr=500,sz=837,lO="by-id",ii="character",c5="value",sy=826,l5=" : flags Open_text and Open_binary are not compatible",uT=846,l4=": Not a directory",sx="Nothing playing",sw="ExternalUrls",sv="TS",s="u",rl=" : is a directory",gr="error",rk="classList",iB=1006505782,dI=".",ga=-364210971,rj=438511779,su=363,tJ="CollectionType",aS="name",ri=457,dE="q",bo=737456202,fb="server_id",tI=194,gq="th",rh=271,iA="lwd-to-remove",lN=",",rg="checked",lM="index out of bounds",rf=322,re="{SUPERTRIANGULAR}",fa=252,lb="%d",st="lwdui-virtual-table-row",uS=292,uQ="PlaylistsFolder",uR=": file descriptor already closed",cA="-",la="EBADF",k$=" len=",b6=-633954146,ss=12520,sr="Username",gc="AE",rd="items_by_date_added",sq="AO",sp="3",cN=250,lq="ph",so=654,ih=103,dJ='"',cg="f",rb="%.0f",rc=420,sn=538,uP=0xdc00,sm="TvChannel",ra=", line",E="E",e$="lz";function +Xj(a,b,c,d,e){if(d<=b)for(var f=1;f<=e;f++)c[d+f]=a[b+f];else for(var f=e;f>=1;f--)c[d+f]=a[b+f];return 0}function -Vh(a,b,c){var +Xl(a,b,c){var d=new Array(c+1);d[0]=0;for(var e=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function -l1(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function -Vi(a,b){var +mg(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function +Xm(a,b){var c=a[1];a[1]+=b;return c}function -l2(a){return a[1]}function -wf(a){var -b=L.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(L.jsoo_static_env&&L.jsoo_static_env[a])return L.jsoo_static_env[a]}var -mm=0;(function(){var -c=wf(vc);if(c!==undefined){var -b=c.split(lw);for(var -a=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.loa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new -u(a,b,c)};u.prototype.add=function(a){var +t(a,b,c)};t.prototype.add=function(a){var b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new -u(b,c,d)};u.prototype.sub=function(a){var +t(b,c,d)};t.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new -u(b,c,d)};u.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*vX|0)+this.mi*a.lo+this.lo*a.mi,d=(c*vX|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -u(b,c,d)};u.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};u.prototype.isNeg=function(){return this.hi<<16<0};u.prototype.and=function(a){return new -u(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};u.prototype.or=function(a){return new -u(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};u.prototype.xor=function(a){return new -u(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};u.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new -u(this.lo<>24-a,this.hi<>24-a);if(a<48)return new -u(0,this.lo<>48-a);return new -u(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new -u(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -u(this.hi>>a-48,0,0)};u.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +t(b,c,d)};t.prototype.mul=function(a){var +b=this.lo*a.lo,c=(b*wn|0)+this.mi*a.lo+this.lo*a.mi,d=(c*wn|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +t(b,c,d)};t.prototype.isZero=function(){return(this.lo|this.mi|this.hi)===0};t.prototype.isNeg=function(){return this.hi<<16<0};t.prototype.and=function(a){return new +t(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};t.prototype.or=function(a){return new +t(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};t.prototype.xor=function(a){return new +t(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};t.prototype.shift_left=function(a){a=a&63;if(a===0)return this;if(a<24)return new +t(this.lo<>24-a,this.hi<>24-a);if(a<48)return new +t(0,this.lo<>48-a);return new +t(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new +t(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new +t(this.hi>>a-48,0,0)};t.prototype.shift_right=function(a){a=a&63;if(a===0)return this;var c=this.hi<<16>>16;if(a<24)return new -u(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var +t(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -u(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cz);return new -u(this.hi<<16>>a-32,b,b)};u.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cJ;this.lo=this.lo<<1&cJ};u.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cJ;this.mi=(this.mi>>>1|this.hi<<23)&cJ;this.hi=this.hi>>>1};u.prototype.udivmod=function(a){var +t(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cB);return new +t(this.hi<<16>>a-32,b,b)};t.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cO;this.lo=this.lo<<1&cO};t.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cO;this.mi=(this.mi>>>1|this.hi<<23)&cO;this.hi=this.hi>>>1};t.prototype.udivmod=function(a){var d=0,c=this.copy(),b=a.copy(),e=new -u(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};u.prototype.div=function(a){var -b=this;if(a.isZero())ml();var -d=b.hi^a.hi;if(b.hi&cw)b=b.neg();if(a.hi&cw)a=a.neg();var -c=b.udivmod(a).quotient;if(d&cw)c=c.neg();return c};u.prototype.mod=function(a){var -b=this;if(a.isZero())ml();var -d=b.hi;if(b.hi&cw)b=b.neg();if(a.hi&cw)a=a.neg();var -c=b.udivmod(a).modulus;if(d&cw)c=c.neg();return c};u.prototype.toInt=function(){return this.lo|this.mi<<24};u.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};u.prototype.toArray=function(){return[this.hi>>8,this.hi&c2,this.mi>>16,this.mi>>8&c2,this.mi&c2,this.lo>>16,this.lo>>8&c2,this.lo&c2]};u.prototype.lo32=function(){return this.lo|(this.mi&c2)<<24};u.prototype.hi32=function(){return this.mi>>>8&cz|this.hi<<16};function -VM(a,b){return new -u(a&cJ,a>>>24&c2|(b&cz)<<8,b>>>16&cz)}function -ma(a){return a.hi32()}function -mb(a){return a.lo32()}function -eg(){au(lv)}var -Vl=h8;function -dD(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}dD.prototype.caml_custom=Vl;dD.prototype.offset=function(a){var +t(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};t.prototype.div=function(a){var +b=this;if(a.isZero())mD();var +d=b.hi^a.hi;if(b.hi&cy)b=b.neg();if(a.hi&cy)a=a.neg();var +c=b.udivmod(a).quotient;if(d&cy)c=c.neg();return c};t.prototype.mod=function(a){var +b=this;if(a.isZero())mD();var +d=b.hi;if(b.hi&cy)b=b.neg();if(a.hi&cy)a=a.neg();var +c=b.udivmod(a).modulus;if(d&cy)c=c.neg();return c};t.prototype.toInt=function(){return this.lo|this.mi<<24};t.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};t.prototype.toArray=function(){return[this.hi>>8,this.hi&cM,this.mi>>16,this.mi>>8&cM,this.mi&cM,this.lo>>16,this.lo>>8&cM,this.lo&cM]};t.prototype.lo32=function(){return this.lo|(this.mi&cM)<<24};t.prototype.hi32=function(){return this.mi>>>8&cB|this.hi<<16};function +XQ(a,b){return new +t(a&cO,a>>>24&cM|(b&cB)<<8,b>>>16&cB)}function +mr(a){return a.hi32()}function +ms(a){return a.lo32()}function +em(){aw(lM)}var +Xp=iq;function +dM(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}dM.prototype.caml_custom=Xp;dM.prototype.offset=function(a){var c=0;if(typeof -a==="number")a=[a];if(!(a -instanceof -Array))au("bigarray.js: invalid offset");if(this.dims.length!=a.length)au("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -b=0;b=this.dims[b])eg();c=c*this.dims[b]+a[b]}else +a==="number")a=[a];if(!Array.isArray(a))aw("bigarray.js: invalid offset");if(this.dims.length!==a.length)aw("Bigarray.get/set: bad number of dimensions");if(this.layout===0)for(var +b=0;b=this.dims[b])em();c=c*this.dims[b]+a[b]}else for(var -b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])eg();c=c*this.dims[b]+(a[b]-1)}return c};dD.prototype.get=function(a){switch(this.kind){case +b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])em();c=c*this.dims[b]+(a[b]-1)}return c};dM.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return VM(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return XQ(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[ec,e,c];default:return this.data[a]}};dD.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=mb(b);this.data[a*2+1]=ma(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[dK,e,c];default:return this.data[a]}};dM.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=ms(b);this.data[a*2+1]=mr(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};dD.prototype.fill=function(a){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};dM.prototype.fill=function(a){switch(this.kind){case 7:var -c=mb(a),e=ma(a);if(c==e)this.data.fill(c);else +c=ms(a),e=mr(a);if(c===e)this.data.fill(c);else for(var -b=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case +c=0;ce)return 1;if(d!==e){if(!b)return Number.NaN;if(!Number.isNaN(d))return 1;if(!Number.isNaN(e))return-1}}break;case 7:for(var c=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case 2:case @@ -145,90 +145,92 @@ c=0;ca.data[c])return 1}break}return 0};function -e_(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}e_.prototype=new -dD();e_.prototype.offset=function(a){if(typeof -a!=="number")if(a -instanceof -Array&&a.length==1)a=a[0];else -au("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])eg();return a};e_.prototype.get=function(a){return this.data[a]};e_.prototype.set=function(a,b){this.data[a]=b;return 0};e_.prototype.fill=function(a){this.data.fill(a);return 0};function -l3(a,b,c,d){var -e=vG(a);if(iA(c)*e!=d.length)au("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new -e_(a,b,c,d);return new -dD(a,b,c,d)}function -fc(a){return a.slice(1)}function -Vk(a,b,c){var -d=fc(c),e=vD(a,iA(d));return l3(a,b,d,e)}function -Vm(a,b){if(b<0||b>=a.dims.length)au("Bigarray.dim");return a.dims[b]}function -Vn(a){return Vm(a,0)}function -vF(a,b){return a.get(a.offset(b))}function -gj(a,b,c){a.set(a.offset(b),c);return 0}function -gs(a,b,c){var -d=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var -f=e;for(;0=this.dims[0])em();return a};fg.prototype.get=function(a){return this.data[a]};fg.prototype.set=function(a,b){this.data[a]=b;return 0};fg.prototype.fill=function(a){this.data.fill(a);return 0};function +mi(a,b,c,d){var +e=v8(a);if(iP(c)*e!==d.length)aw("length doesn't match dims");if(b===0&&c.length===1&&e===1)return new +fg(a,b,c,d);return new +dM(a,b,c,d)}function +fk(a){return a.slice(1)}function +Xo(a,b,c){var +d=fk(c),e=v5(a,iP(d));return mi(a,b,d,e)}function +Xq(a,b){if(b<0||b>=a.dims.length)aw("Bigarray.dim");return a.dims[b]}function +Xr(a){return Xq(a,0)}function +v7(a,b){return a.get(a.offset(b))}function +gz(a,b,c){a.set(a.offset(b),c);return 0}function +gI(a,b,c){var +d=String.fromCharCode;if(b===0&&c<=4096&&c===a.length)return d.apply(null,a);var +f=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?gs(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?gs(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)iE(c);var -g=a.c,h=c.c;if(a.t==4)if(d<=b)for(var +cm(a,b,c,d,e){if(e===0)return 0;if(d===0&&(e>=c.l||c.t===2&&e>=c.c.length)){c.c=a.t===4?gI(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else if(c.t===2&&d===c.c.length){c.c+=a.t===4?gI(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else{if(c.t!==4)iT(c);var +g=a.c,h=c.c;if(a.t===4)if(d<=b)for(var f=0;f=0;f--)h[d+f]=g[b+f];else{var i=Math.min(e,g.length-b);for(var f=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function -gk(a){if(a.t==2)a.c+=fe(a.l-a.c.length,"\0");else -a.c=gs(a.c,0,a.c.length);a.t=0}function -mo(a){if(a.length<24){for(var -b=0;bcZ)return false;return true}else +fm(a,b){if(a===0)return e;if(b.repeat)return b.repeat(a);var +d=e,c=0;for(;;){if(a&1)d+=b;a>>=1;if(a===0)return d;b+=b;c++;if(c===9)b.slice(0,1)}}function +gA(a){if(a.t===2)a.c+=fm(a.l-a.c.length,"\0");else +a.c=gI(a.c,0,a.c.length);a.t=0}function +mF(a){if(a.length<24){for(var +b=0;bc6)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -wd(a){for(var -k=e,d=e,h,g,i,b,c=0,j=a.length;cil){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else -d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cz)d+=String.fromCharCode(0xd7c0+(b>>10),un+(b&0x3FF));else -d+=String.fromCharCode(b);if(d.length>eV){d.substr(0,1);k+=d;d=e}}return k+d}function -c9(a,b,c){this.t=a;this.c=b;this.l=c}c9.prototype.toString=function(){switch(this.t){case -9:return this.c;default:gk(this);case -0:if(mo(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};c9.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return wd(a)};c9.prototype.slice=function(){var -a=this.t==4?this.c.slice():this.c;return new -c9(this.t,a,this.l)};function -vJ(a){return new -c9(0,a,a.length)}function -cB(a){return a}function -dF(a){return vJ(cB(a))}function -dE(a,b,c,d,e){ci(dF(a),b,c,d,e);return 0}function +wD(a){for(var +k=e,d=e,h,g,i,b,c=0,j=a.length;ciC){d.slice(0,1);k+=d;d=e;k+=a.slice(c,f)}else +d+=a.slice(c,f);if(f===j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cB)d+=String.fromCharCode(0xd7c0+(b>>10),uP+(b&0x3ff));else +d+=String.fromCharCode(b);if(d.length>ed){d.slice(0,1);k+=d;d=e}}return k+d}function +dc(a,b,c){this.t=a;this.c=b;this.l=c}dc.prototype.toString=function(){switch(this.t){case +9:case +8:return this.c;case +4:case +2:gA(this);case +0:if(mF(this.c))this.t=9;else +this.t=8;return this.c}};dc.prototype.toUtf16=function(){var +a=this.toString();if(this.t===9)return a;return wD(a)};dc.prototype.slice=function(){var +a=this.t===4?this.c.slice():this.c;return new +dc(this.t,a,this.l)};function +v$(a){return new +dc(0,a,a.length)}function +cE(a){return a}function +dO(a){return v$(cE(a))}function +dN(a,b,c,d,e){cm(dO(a),b,c,d,e);return 0}function l(a){return a.length}function -bn(a,b){return a.charCodeAt(b)}function -wc(a){var +bg(a,b){return a.charCodeAt(b)}function +wC(a){var d=l(a),c=new -Uint8Array(d),b=0;for(;bl(a))eg();if(f+e>c.data.length)eg();var -g=wc(a).slice(b,b+e);c.data.set(g,f);return 0}var -Vp=Vo;function -iB(){au(lv)}function -cM(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +Uint8Array(d),b=0;for(;bl(a))em();if(f+e>c.data.length)em();var +g=wC(a).slice(b,b+e);c.data.set(g,f);return 0}var +Xt=Xs;function +iQ(){aw(lM)}function +cD(a,b){switch(a.t&6){case 0:return a.c.charCodeAt(b);case +2:if(b>=a.c.length)return 0;return a.c.charCodeAt(b);case 4:return a.c[b]}}function -e$(a,b){if(b>>>0>=a.l)iB();return cM(a,b)}function -eh(a){return new -u(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function -Vs(a,b){if(b>>>0>=a.l-7)iB();var +fh(a,b){if(b>>>0>=a.l)iQ();return cD(a,b)}function +en(a){return new +t(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function +Xw(a,b){if(b>>>0>=a.l-7)iQ();var d=new Array(8);for(var -c=0;c<8;c++)d[7-c]=cM(a,b+c);return eh(d)}function -ao(a,b,c){c&=c2;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}iE(a)}a.c[b]=c;return 0}function -cj(a,b,c){if(b>>>0>=a.l)iB();return ao(a,b,c)}function -ei(a){return a.toArray()}function -vK(a,b,c){if(b>>>0>=a.l-7)iB();var -e=ei(c);for(var -d=0;d<8;d++)ao(a,b+7-d,e[d]);return 0}function -c_(d,c){var -f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var +c=0;c<8;c++)d[7-c]=cD(a,b+c);return en(d)}function +ar(a,b,c){c&=cM;if(a.t!==4){if(b===a.c.length){a.c+=String.fromCharCode(c);if(b+1===a.l)a.t=0;return 0}iT(a)}a.c[b]=c;return 0}function +cn(a,b,c){if(b>>>0>=a.l)iQ();return ar(a,b,c)}function +eo(a){return a.toArray()}function +wa(a,b,c){if(b>>>0>=a.l-7)iQ();var +e=eo(c);for(var +d=0;d<8;d++)ar(a,b+7-d,e[d]);return 0}function +dd(d,c){var +f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b===0)return d.apply(null,c);else if(b<0){var a=d.apply(null,c.slice(0,f));if(typeof -a!=="function")return a;return c_(a,c.slice(f))}else{switch(b){case +a!=="function")return a;return dd(a,c.slice(f))}else{switch(b){case 1:{var a=function(a){var f=new @@ -240,32 +242,32 @@ g=new Array(e+2);for(var f=0;f>>0>=a.length-1)eg();return a}function -iD(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -v0(a){return a==lL?1:0}var -Ws=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -Wr(a){if(Ws)return Math.floor(Math.log2(a));var -b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else +a=0;a>>0>=a.length-1)em();return a}function +iS(a){if(Number.isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!==0)return 1;return 2}return Number.isNaN(a)?4:3}function +wq(a){return a===l2?1:0}var +Yz=Math.log2&&Math.log2(1.1235582092889474e307)===1020;function +Yy(a){if(Yz)return Math.floor(Math.log2(a));var +b=0;if(a===0)return Number.NEGATIVE_INFINITY;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -l_(a){var +mp(a){var b=new Float32Array(1);b[0]=a;var c=new Int32Array(b.buffer);return c[0]|0}function -bw(a,b,c){return new -u(a,b,c)}function -iG(a){if(!isFinite(a)){if(isNaN(a))return bw(1,0,rf);return a>0?bw(0,0,rf):bw(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?cw:a>=0?0:cw;if(f)a=-a;var -b=Wr(a)+f9;if(b<=0){b=0;a/=Math.pow(2,-tn)}else{a/=Math.pow(2,b-tX);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +bz(a,b,c){return new +t(a,b,c)}function +iV(a){if(!Number.isFinite(a)){if(Number.isNaN(a))return bz(1,0,rH);return a>0?bz(0,0,rH):bz(0,0,0xfff0)}var +f=a===0&&1/a===Number.NEGATIVE_INFINITY?cy:a>=0?0:cy;if(f)a=-a;var +b=Yy(a)+gl;if(b<=0){b=0;a/=Math.pow(2,-tP)}else{a/=Math.pow(2,b-uo);if(a<16){a*=2;b-=1}if(b===0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&lh|f|b<<4;return bw(g,e,c)}function -vI(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==h8)for(var -d=0;d>4;if(d==k2)return(f|g|c&lh)==0?c&cw?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),b=(f*e+g)*e+(c&lh);if(d>0){b+=16;b*=Math.pow(2,d-tX)}else -b*=Math.pow(2,-tn);if(c&cw)b=-b;return b}function -a5(a){if(!bl.Failure)bl.Failure=[B,bL(l0),-3];mk(bl.Failure,a)}function -vE(a,b,c){var -k=a.read32s();if(k<0||k>16)a5("input_value: wrong number of bigarray dimensions");var -r=a.read32s(),l=r&c2,q=r>>8&1,j=[];if(c==h8)for(var +fj(a){var +f=a.lo,g=a.mi,c=a.hi,d=(c&0x7fff)>>4;if(d===ld)return(f|g|c&ly)===0?c&cy?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY:Number.NaN;var +e=Math.pow(2,-24),b=(f*e+g)*e+(c&ly);if(d>0){b+=16;b*=Math.pow(2,d-uo)}else +b*=Math.pow(2,-tP);if(c&cy)b=-b;return b}function +bf(a){if(!a$.Failure)a$.Failure=[B,bU(mf),-3];mC(a$.Failure,a)}function +v6(a,b,c){var +k=a.read32s();if(k<0||k>16)bf("input_value: wrong number of bigarray dimensions");var +r=a.read32s(),l=r&cM,q=r>>8&1,j=[];if(c===iq)for(var d=0;d>>32-15;b=gr(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function -VG(a,b){a=bm(a,mb(b));a=bm(a,ma(b));return a}function -l8(a,b){return VG(a,iG(b))}function -vH(a){var -c=iA(a.dims),d=0;switch(a.kind){case +n=fj(en(g));i.set(d,[dK,o,n])}break}b[0]=(4+k)*4;return mi(l,q,j,h)}function +v4(a,b,c){return a.compare(b,c)}function +gH(a,b){return Math.imul(a,b)}function +bp(a,b){b=gH(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=gH(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function +XK(a,b){a=bp(a,ms(b));a=bp(a,mr(b));return a}function +mn(a,b){return XK(a,iV(b))}function +v9(a){var +c=iP(a.dims),d=0;switch(a.kind){case 2:case 3:case -12:if(c>cK)c=cK;var -e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=bm(d,e)}e=0;switch(c&3){case +12:if(c>cP)c=cP;var +e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=bp(d,e)}e=0;switch(c&3){case 3:e=a.data[b+2]<<16;case 2:e|=a.data[b+1]<<8;case -1:e|=a.data[b+0];d=bm(d,e)}break;case +1:e|=a.data[b+0];d=bp(d,e)}break;case 4:case -5:if(c>J)c=J;var -e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=bm(d,e)}if((c&1)!=0)d=bm(d,a.data[b]);break;case +5:if(c>M)c=M;var +e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=bp(d,e)}if((c&1)!==0)d=bp(d,a.data[b]);break;case 6:if(c>64)c=64;for(var -b=0;b64)c=64;for(var -b=0;b32)c=32;c*=2;for(var -b=0;b64)c=64;for(var -b=0;b32)c=32;for(var -b=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function -iI(a){return typeof +XP(a,b,c){return a.compare(b)}function +XS(a){return a.lo32()^a.hi32()}var +gC={_j:{deserialize:XY,serialize:XV,fixed_length:8,compare:XP,hash:XS},_i:{deserialize:XN,fixed_length:4},_n:{deserialize:Yk,fixed_length:4},_bigarray:{deserialize:function(a,b){return v6(a,b,"_bigarray")},serialize:v_,compare:v4,hash:v9},_bigarr02:{deserialize:function(a,b){return v6(a,b,iq)},serialize:v_,compare:v4,hash:v9}};function +mk(a){return gC[a.caml_custom]&&gC[a.caml_custom].compare}function +wb(a,b,c,d){var +f=mk(b);if(f){var +e=c>0?f(b,a,d):f(a,b,d);if(d&&Number.isNaN(e))return c;if(Number.isNaN(+e))return+e;if((e|0)!==0)return e|0}return c}function +iX(a){return typeof a==="string"&&!/[^\x00-\xff]/.test(a)}function -iH(a){return a -instanceof -c9}function -vM(a){if(typeof -a==="number")return gg;else if(iH(a))return e4;else if(iI(a))return 1252;else if(a +iW(a){return a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=dx){var -b=a[0]|0;return b==ec?0:b}else if(a +dc}function +wc(a){if(typeof +a==="number")return gv;else if(iW(a))return fa;else if(iX(a))return 1252;else if(Array.isArray(a)&&a[0]===a[0]>>>0&&a[0]<=dF){var +b=a[0]|0;return b===dK?0:b}else if(a instanceof -String)return r4;else if(typeof -a=="string")return r4;else if(a +String)return ss;else if(typeof +a==="string")return ss;else if(a instanceof -Number)return gg;else if(a&&a.caml_custom)return ln;else if(a&&a.compare)return 1256;else if(typeof -a=="function")return 1247;else if(typeof -a=="symbol")return 1251;return 1001}function -me(a,b){if(ab?1:0}function -Vr(a,b){a.t&6&&gk(a);b.t&6&&gk(b);return a.cb.c?1:0}function -fa(a,b,c){var +Number)return gv;else if(a&&a.caml_custom)return lE;else if(a&&a.compare)return 1256;else if(typeof +a==="function")return 1247;else if(typeof +a==="symbol")return 1251;return 1001}function +mv(a,b){if(ab?1:0}function +Xv(a,b){a.t&6&&gA(a);b.t&6&&gA(b);return a.cb.c?1:0}function +fi(a,b,c){var f=[];for(;;){if(!(c&&a===b)){var -e=vM(a);if(e==cI){a=a[1];continue}var -g=vM(b);if(g==cI){b=b[1];continue}if(e!==g){if(e==gg){if(g==ln)return vL(a,b,-1,c);return-1}if(g==gg){if(e==ln)return vL(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case -1001:if(ab)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case -1251:if(a!==b){if(!c)return NaN;return 1}break;case +d=a.compare(b,c);if(Number.isNaN(d))return c?-1:d;if(d!==(d|0))return-1;if(d!==0)return d|0;break;case +1000:a=+a;b=+b;if(ab)return 1;if(a!==b){if(!c)return Number.NaN;if(!Number.isNaN(a))return 1;if(!Number.isNaN(b))return-1}break;case +1001:if(ab)return 1;if(a!==b)return c?1:Number.NaN;break;case +1251:if(a!==b)return c?1:Number.NaN;break;case 1252:var -a=cB(a),b=cB(b);if(a!==b){if(ab)return 1}break;case +a=cE(a),b=cE(b);if(a!==b){if(ab)return 1}break;case 12520:var -a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case -246:case -254:default:if(v0(e)){au("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var +a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;default:if(wq(e)){aw("compare: continuation value");break}if(a.length!==b.length)return a.length1)f.push(a,b,1);break}}if(f.length===0)return 0;var h=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=fe(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)iE(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var -c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;a5("float_of_string")}function -mj(a){a=cB(a);var -e=a.length;if(e>31)au("format_int: format too long");var -b={justify:e8,signstyle:cx,filler:bK,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:cc};for(var +dP(a,b){return fi(a,b,true)}function +Xx(){return[0]}function +an(a){if(a<0)aw("Bytes.create");return new +dc(a?2:9,e,a)}var +iU=[0];function +Xz(a,b){if(iU!==a)return 0;iU=b;return 1}function +wd(a){return iU}function +XA(a){iU=a}function +we(a,b){return+(fi(a,b,false)===0)}function +XC(a,b,c,d){if(c>0)if(b===0&&(c>=a.l||a.t===2&&c>=a.c.length))if(d===0){a.c=e;a.t=2}else{a.c=fm(c,String.fromCharCode(d));a.t=c===a.l?0:2}else{if(a.t!==4)iT(a);for(c+=b;b31)aw("format_int: format too long");var +b={justify:fe,signstyle:cA,filler:bS,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:cg};for(var d=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function -l6(a,b){if(a.uppercase)b=b.toUpperCase();var -f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=cx))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var -c=e;if(a.justify==e8&&a.filler==bK)for(var -d=f;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;break;case"d":case"i":b.signedconv=true;b.base=10;break;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function +ml(a,b){if(a.uppercase)b=b.toUpperCase();var +f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!==cA))f++;if(a.alternate){if(a.base===8)f+=1;if(a.base===16)f+=2}var +c=e;if(a.justify===fe&&a.filler===bS)for(var +d=f;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(bJ);if(b>0)a=a+dA+new -Array(b+1).join(bJ);return a}else +c=Number.parseInt(a.toString().split(fe)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(bR);if(b>0)a=a+dI+new +Array(b+1).join(bR);return a}else return a.toFixed(b)}}var -c,g=mj(a),f=g.prec<0?6:g.prec;if(b<0||b==0&&1/b==-Infinity){g.sign=-1;b=-b}if(isNaN(b)){c=k0;g.filler=bK}else if(!isFinite(b)){c="inf";g.filler=bK}else +c,g=mB(a),f=g.prec<0?6:g.prec;if(b<0||b===0&&1/b===Number.NEGATIVE_INFINITY){g.sign=-1;b=-b}if(Number.isNaN(b)){c=lc;g.filler=bS}else if(!Number.isFinite(b)){c="inf";g.filler=bS}else switch(g.conv){case"e":var -c=b.toExponential(f),e=c.length;if(c.charAt(e-3)==d)c=c.slice(0,e-1)+bJ+c.slice(e-1);break;case"f":c=k(b,f);break;case"g":f=f?f:1;c=b.toExponential(f-1);var +c=b.toExponential(f),e=c.length;if(c.charAt(e-3)===d)c=c.slice(0,e-1)+bR+c.slice(e-1);break;case"f":c=k(b,f);break;case"g":f=f?f:1;c=b.toExponential(f-1);var j=c.indexOf(d),i=+c.slice(j+1);if(i<-4||b>=1e21||b.toFixed(0).length>f){var -e=j-1;while(c.charAt(e)==bJ)e--;if(c.charAt(e)==dA)e--;c=c.slice(0,e+1)+c.slice(j);e=c.length;if(c.charAt(e-3)==d)c=c.slice(0,e-1)+bJ+c.slice(e-1);break}else{var +e=j-1;while(c.charAt(e)===bR)e--;if(c.charAt(e)===dI)e--;c=c.slice(0,e+1)+c.slice(j);e=c.length;if(c.charAt(e-3)===d)c=c.slice(0,e-1)+bR+c.slice(e-1);break}else{var h=f;if(i<0){h-=i+1;c=b.toFixed(h)}else while(c=b.toFixed(h),c.length>f+1)h--;if(h){var -e=c.length-1;while(c.charAt(e)==bJ)e--;if(c.charAt(e)==dA)e--;c=c.slice(0,e+1)}}break}return l6(g,c)}function -go(a,b){if(cB(a)==kZ)return bL(e+b);var -c=mj(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else +e=c.length-1;while(c.charAt(e)===bR)e--;if(c.charAt(e)===dI)e--;c=c.slice(0,e+1)}}break}return ml(g,c)}function +gE(a,b){if(cE(a)===lb)return bU(e+b);var +c=mB(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else b>>>=0;var -d=b.toString(c.base);if(c.prec>=0){c.filler=bK;var -f=c.prec-d.length;if(f>0)d=fe(f,bJ)+d}return l6(c,d)}var -Wf=0;function -at(){return Wf++}function -S(a){if(mo(a))return a;return wd(a)}function -gu(){return typeof -L.process!=="undefined"&&typeof -L.process.versions!=="undefined"&&typeof -L.process.versions.node!=="undefined"}function -Wt(){function -a(a){if(a.charAt(0)===cy)return[e,a.substring(1)];return}function +d=b.toString(c.base);if(c.prec>=0){c.filler=bS;var +f=c.prec-d.length;if(f>0)d=fm(f,bR)+d}return ml(c,d)}var +Yl=0;function +av(){return Yl++}function +S(a){if(mF(a))return a;return wD(a)}function +gJ(){return typeof +U.process!=="undefined"&&typeof +U.process.versions!=="undefined"&&typeof +U.process.versions.node!=="undefined"}function +YA(){function +a(a){if(a.charAt(0)===cR)return[e,a.slice(1)];return}function b(a){var -h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==vk);if(Boolean(b[2]||f)){var -d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return gu()&&L.process&&L.process.platform?L.process.platform==="win32"?b:a:a}var -mp=Wt();function -wb(a){return a.slice(-1)!==cy?a+cy:a}if(gu()&&L.process&&L.process.cwd)var -gl=L.process.cwd().replace(/\\/g,cy);else +h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=c.length>0&&c.charAt(1)!==vM;if(b[2]||f){var +d=b[1]||e,g=b[2]||e;return[d,a.slice(d.length+g.length)]}return}return gJ()&&U.process&&U.process.platform?U.process.platform==="win32"?b:a:a}var +mG=YA();function +wB(a){return a.slice(-1)!==cR?a+cR:a}if(gJ()&&U.process&&U.process.cwd)var +gB=U.process.cwd().replace(/\\/g,cR);else var -gl="/static";gl=wb(gl);function -V4(a){a=S(a);if(!mp(a))a=gl+a;var -e=mp(a),d=e[1].split(cy),b=[];for(var +gB="/static";gB=wB(gB);function +X_(a){a=S(a);if(!mG(a))a=gB+a;var +e=mG(a),d=e[1].split(/[/\\]/),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -Wq(a){for(var -g=e,c=g,b,i,d=0,h=a.length;dil){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else -c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(ce|b&dv)}else if(b<0xd800||b>=sj)c+=String.fromCharCode(ud|b>>12,ce|b>>6&dv,ce|b&dv);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))sj)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(sz|b>>18,ce|b>>12&dv,ce|b>>6&dv,ce|b&dv)}if(c.length>eV){c.substr(0,1);g+=c;c=e}}return g+c}function -bM(a){return mo(a)?bL(a):bL(Wq(a))}var -Wu=["E2BIG","EACCES","EAGAIN",kY,"EBUSY","ECHILD","EDEADLK","EDOM",vq,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",le,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",li,sP,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function -db(a,b,c,d){var -f=Wu.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var -g=[f,bM(b||e),bM(c||e)];return g}var -v7={};function -dJ(a){return v7[a]}function -da(a,b){throw g([0,a].concat(b))}function -l4(a){if(!(a +Yx(a){for(var +g=e,c=g,b,i,d=0,h=a.length;diC){c.slice(0,1);g+=c;c=e;g+=a.slice(d,f)}else +c+=a.slice(d,f);if(f===h)break;d=f}if(b>6);c+=String.fromCharCode(cj|b&dD)}else if(b<0xd800||b>=sJ)c+=String.fromCharCode(uF|b>>12,cj|b>>6&dD,cj|b&dD);else if(b>=0xdbff||d+1===h||(i=a.charCodeAt(d+1))sJ)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(sZ|b>>18,cj|b>>12&dD,cj|b>>6&dD,cj|b&dD)}if(c.length>ed){c.slice(0,1);g+=c;c=e}}return g+c}function +bK(a){return mF(a)?bU(a):bU(Yx(a))}var +YB=["E2BIG","EACCES","EAGAIN",la,"EBUSY","ECHILD","EDEADLK","EDOM",vS,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",lu,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",lz,td,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function +dh(a,b,c,d){var +f=YB.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var +g=[f,bK(b||e),bK(c||e)];return g}var +ww={};function +dR(a){return ww[a]}function +dg(a,b){throw g([0,a].concat(b))}function +mj(a){if(!(a instanceof Uint8Array))a=new Uint8Array(a);return new -c9(4,a,a.length)}function -H(a){mk(bl.Sys_error,a)}function -v$(a){H(a+iw)}function -gt(a){if(a.t!=4)iE(a);return a.c}function -aR(a){return a.l}function -vB(){}function -bv(a){this.data=a}bv.prototype=new -vB();bv.prototype.constructor=bv;bv.prototype.truncate=function(a){var -b=this.data;this.data=al(a|0);ci(b,0,this.data,0,a)};bv.prototype.length=function(){return aR(this.data)};bv.prototype.write=function(a,b,c,d){var +dc(4,a,a.length)}function +F(a){mC(a$.Sys_error,a)}function +wz(a){F(a+gw)}function +i5(a){if(a.t!==4)iT(a);return a.c}function +aV(a){return a.l}function +v3(){}function +by(a){this.data=a}by.prototype=new +v3();by.prototype.constructor=by;by.prototype.truncate=function(a){var +b=this.data;this.data=an(a|0);cm(b,0,this.data,0,a)};by.prototype.length=function(){return aV(this.data)};by.prototype.write=function(a,b,c,d){var e=this.length();if(a+d>=e){var -f=al(a+d),g=this.data;this.data=f;ci(g,0,this.data,0,e)}ci(l4(b),c,this.data,a,d);return 0};bv.prototype.read=function(a,b,c,d){var +f=an(a+d),g=this.data;this.data=f;cm(g,0,this.data,0,e)}cm(mj(b),c,this.data,a,d);return 0};by.prototype.read=function(a,b,c,d){var e=this.length();if(a+d>=e)d=e-a;if(d){var -f=al(d|0);ci(this.data,a,f,0,d);b.set(gt(f),c)}return d};function -ef(a,b,c){this.file=b;this.name=a;this.flags=c}ef.prototype.err_closed=function(){H(this.name+up)};ef.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};ef.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};ef.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};ef.prototype.close=function(){this.file=undefined};function -a4(a,b){this.content={};this.root=a;this.lookupFun=b}a4.prototype.nm=function(a){return this.root+a};a4.prototype.create_dir_if_needed=function(a){var -d=a.split(cy),c=e;for(var -b=0;b=0)}function -l9(a,b){var -e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=bm(a,d)}d=0;switch(e&3){case +aU(d)};fo.push(b);c={path:b.path,device:b.device,rest:a.slice(b.path.length,a.length)}}}if(c)return c;F("no device found for "+f)}function +Xy(a,b){var +c=wI(a);if(!c.device.register)bf("cannot register file");c.device.register(c.rest,b);return 0}function +wE(a,b){var +a=bU(a),b=bU(b);return Xy(a,b)}function +XE(){var +b=U.jsoo_fs_tmp;if(b)for(var +a=0;a=0)}function +mo(a,b){var +e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=bp(a,d)}d=0;switch(e&3){case 3:d=b.charCodeAt(c+2)<<16;case 2:d|=b.charCodeAt(c+1)<<8;case -1:d|=b.charCodeAt(c);a=bm(a,d)}a^=e;return a}function -VH(a,b){return l9(a,cB(b))}function -VE(a,b){var -e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=bm(a,d)}d=0;switch(e&3){case +1:d|=b.charCodeAt(c);a=bp(a,d)}a^=e;return a}function +XL(a,b){return mo(a,cE(b))}function +XI(a,b){var +e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=bp(a,d)}d=0;switch(e&3){case 3:d=b[c+2]<<16;case 2:d|=b[c+1]<<8;case -1:d|=b[c];a=bm(a,d)}a^=e;return a}function -V7(a){switch(a.t&6){default:gk(a);case -0:return a.c;case -4:return a.c}}function -VD(a,b){var -c=V7(b);return typeof -c==="string"?l9(a,c):VE(a,c)}function -VF(a){a^=a>>>16;a=gr(a,0x85ebca6b|0);a^=a>>>13;a=gr(a,0xc2b2ae35|0);a^=a>>>16;return a}function -vS(a,b,c,d){var -j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cK)h=cK;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(gm[e.caml_custom]&&gm[e.caml_custom].hash){var -n=gm[e.caml_custom].hash(e);f=bm(f,n);g--}}else if(e -instanceof -Array&&e[0]===(e[0]|0))switch(e[0]){case -248:f=bm(f,e[2]);g--;break;case -250:j[--k]=e[1];break;default:if(v0(e[0]))break;var -o=e.length-1<<10|e[0];f=bm(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(iH(e)){f=VD(f,e);g--}else if(iI(e)){f=VH(f,e);g--}else if(typeof -e==="string"){f=l9(f,e);g--}else if(e===(e|0)){f=bm(f,e+e+1);g--}else if(typeof -e==="number"){f=l8(f,e);g--}}f=VF(f);return f&0x3FFFFFFF}function -VI(a,b,c){if(!isFinite(a)){if(isNaN(a))return bM(k0);return bM(a>0?tF:"-infinity")}var -k=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var -f=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else +1:d|=b[c];a=bp(a,d)}a^=e;return a}function +Yb(a){switch(a.t&6){case +2:gA(a);return a.c;default:return a.c}}function +XH(a,b){var +c=Yb(b);return typeof +c==="string"?mo(a,c):XI(a,c)}function +XJ(a){a^=a>>>16;a=gH(a,0x85ebca6b|0);a^=a>>>13;a=gH(a,0xc2b2ae35|0);a^=a>>>16;return a}function +wi(a,b,c,d){var +j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cP)h=cP;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(gC[e.caml_custom]&&gC[e.caml_custom].hash){var +n=gC[e.caml_custom].hash(e);f=bp(f,n);g--}}else if(Array.isArray(e)&&e[0]===(e[0]|0))switch(e[0]){case +248:f=bp(f,e[2]);g--;break;case +250:j[--k]=e[1];break;default:if(wq(e[0]))break;var +o=e.length-1<<10|e[0];f=bp(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(iW(e)){f=XH(f,e);g--}else if(iX(e)){f=XL(f,e);g--}else if(typeof +e==="string"){f=mo(f,e);g--}else if(e===(e|0)){f=bp(f,e+e+1);g--}else if(typeof +e==="number"){f=mn(f,e);g--}}f=XJ(f);return f&0x3fffffff}function +XM(a,b,c){if(!Number.isFinite(a)){if(Number.isNaN(a))return bK(lc);return bK(a>0?t9:"-infinity")}var +k=a===0&&1/a===Number.NEGATIVE_INFINITY?1:a>=0?0:1;if(k)a=-a;var +f=0;if(a===0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else while(a>=2){a/=2;f++}var -l=f<0?e:e8,g=e;if(k)g=cx;else +l=f<0?e:fe,g=e;if(k)g=cA;else switch(c){case -43:g=e8;break;case -32:g=bK;break;default:break}if(b>=0&&b<13){var +43:g=fe;break;case +32:g=bS;break;default:break}if(b>=0&&b<13){var i=Math.pow(2,b*4);a=Math.round(a*i)/i}var d=a.toString(16);if(b>=0){var -j=d.indexOf(dA);if(j<0)d+=dA+fe(b,bJ);else{var -h=j+1+b;if(d.length>24&cJ,a>>31&cz)}function -mc(a){return a.toInt()}function -VP(a){return+a.isNeg()}function -vV(a){return a.neg()}function -VN(a,b){var -c=mj(a);if(c.signedconv&&VP(b)){c.sign=-1;b=vV(b)}var -d=e,i=gp(c.base),h="0123456789abcdef";do{var -g=b.udivmod(i);b=g.quotient;d=h.charAt(mc(g.modulus))+d}while(!VQ(b));if(c.prec>=0){c.filler=bK;var -f=c.prec-d.length;if(f>0)d=fe(f,bJ)+d}return l6(c,d)}function -vY(a,b){return a.or(b)}function -v9(a){var -b=0,e=l(a),c=10,d=1;if(e>0)switch(bn(a,b)){case -45:b++;d=-1;break;case -43:b++;d=1;break}if(b+1>24&cO,a>>31&cB)}function +mt(a){return a.toInt()}function +XT(a){return+a.isNeg()}function +wl(a){return a.neg()}function +XR(a,b){var +c=mB(a);if(c.signedconv&&XT(b)){c.sign=-1;b=wl(b)}var +d=e,i=gF(c.base),h="0123456789abcdef";do{var +g=b.udivmod(i);b=g.quotient;d=h.charAt(mt(g.modulus))+d}while(!XU(b));if(c.prec>=0){c.filler=bS;var +f=c.prec-d.length;if(f>0)d=fm(f,bR)+d}return ml(c,d)}function +wo(a,b){return a.or(b)}function +wx(a){var +b=0,f=l(a),d=10,e=1,c=1;if(f>0)switch(bg(a,b)){case +45:b++;e=-1;break;case +43:b++;e=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=sU)return a-87;return-1}function -vZ(a){var -h=v9(a),d=h[0],i=h[1],e=h[2],g=l(a),j=-1>>>0,f=d=e)a5(c3);var -b=c;for(d++;d=e)break;b=e*b+c;if(b>j)a5(c3)}if(d!=g)a5(c3);b=i*b;if(e==10&&(b|0)!=b)a5(c3);return b|0}function -dH(a,b,c){return a[S(b)].apply(a,fc(c))}function -VX(a,b){switch(b.length){case +85:c=0;b+=2;break}return[b,e,d,c]}function +iZ(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=tk)return a-87;return-1}function +wp(a){var +f=wx(a),d=f[0],i=f[1],g=f[2],j=f[3],h=l(a),k=-1>>>0,e=d=g)bf(c9);var +b=c;for(d++;d=g)break;b=g*b+c;if(b>k)bf(c9)}if(d!==h)bf(c9);b=i*b;if(j&&(b|0)!==b)bf(c9);return b|0}function +de(a,b,c){return a[S(b)].apply(a,fk(c))}function +X1(a,b){switch(b.length){case 1:return new -a;case +a();case 2:return new a(b[1]);case 3:return new @@ -740,138 +731,137 @@ a(b[1],b[2],b[3],b[4],b[5]);case a(b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function -c(){return a.apply(this,fc(b))}c.prototype=a.prototype;return new -c}function -v1(a){var +c(){return a.apply(this,fk(b))}c.prototype=a.prototype;return new +c()}function +mw(a){var c={};for(var b=1;b>>0&&mi(a,d9,dC)?0:1}function -v2(a){mi(a,dC,cI);return 0}function -V1(a,b){return+(fa(a,b,false)<=0)}function -V2(a,b){return+(fa(a,b,false)<0)}function -gq(a){a=cB(a);var +c=0;c>>0&&mA(a,ec,dL)?0:1}function +wr(a){mA(a,dL,cN);return 0}function +X5(a,b){return+(fi(a,b,false)<=0)}function +X6(a,b){return+(fi(a,b,false)<0)}function +gG(a){a=cE(a);var d=a.length/2,c=new Array(d);for(var b=0;b>16;return c}function -v3(a,b,c){var -o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=gq(a[n]);a.lex_backtrk=gq(a[m]);a.lex_check=gq(a[q]);a.lex_trans=gq(a[t]);a.lex_default=gq(a[r])}var -f,d=b,l=gt(c[o]);if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else +ws(a,b,c){var +o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=gG(a[n]);a.lex_backtrk=gG(a[m]);a.lex_check=gG(a[q]);a.lex_trans=gG(a[t]);a.lex_default=gG(a[r])}var +f,d=b,l=c[o];if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else d=-d-1;for(;;){var g=a.lex_base[d];if(g<0)return-g-1;var -j=a.lex_backtrk[d];if(j>=0){c[i]=c[e];c[h]=j}if(c[e]>=c[p])if(c[k]==0)return-d-1;else -f=cK;else{f=l[c[e]];c[e]++}if(a.lex_check[g+f]==d)d=a.lex_trans[g+f];else -d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]==-1)a5("lexing: empty token");else -return c[h]}else if(f==cK)c[k]=0}}function -iJ(a){var +j=a.lex_backtrk[d];if(j>=0){c[i]=c[e];c[h]=j}if(c[e]>=c[p])if(c[k]===0)return-d-1;else +f=cP;else{f=cD(l,c[e]);c[e]++}if(a.lex_check[g+f]===d)d=a.lex_trans[g+f];else +d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]===-1)bf("lexing: empty token");else +return c[h]}else if(f===cP)c[k]=0}}function +iY(a){var c=0;for(var b=a.length-1;b>=0;b--){var d=a[b];c=[0,d,c]}return c}function -V3(a){var +X7(a){var b=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function -v8(a){return bL(a)}function -vT(a,b){return a.add(b)}function -vU(a,b){return a.mul(b)}function -md(a,b){return a.ucompare(b)<0}function -vW(a){var -g=v9(a),f=g[0],i=g[1],d=g[2],h=gp(d),j=new -u(cJ,0xfffffff,cz).udivmod(h).quotient,e=bn(a,f),b=iK(e);if(b<0||b>=d)a5(c3);var -c=gp(b);for(;;){f++;e=bn(a,f);if(e==95)continue;b=iK(e);if(b<0||b>=d)break;if(md(j,c))a5(c3);b=gp(b);c=vT(vU(h,c),b);if(md(c,b))a5(c3)}if(f!=l(a))a5(c3);if(d==10&&md(new -u(0,0,cw),c))a5(c3);if(i<0)c=vV(c);return c}function -VV(a,b){return a.xor(b)}function -VT(a,b){return a.shift_right_unsigned(b)}function -VS(a,b){return a.shift_left(b)}function -mf(a){function -o(a,b){return VS(a,b)}function -h(a,b){return VT(a,b)}function -s(a,b){return vY(a,b)}function -f(a,b){return VV(a,b)}function -k(a,b){return vT(a,b)}function -i(a,b){return vU(a,b)}function +wj(a,b){return a.add(b)}function +wk(a,b){return a.mul(b)}function +mu(a,b){return a.ucompare(b)<0}function +wm(a){var +f=wx(a),e=f[0],i=f[1],g=f[2],j=f[3],h=gF(g),k=new +t(cO,0xfffffff,cB).udivmod(h).quotient,d=bg(a,e),b=iZ(d);if(b<0||b>=g)bf(c9);var +c=gF(b);for(;;){e++;d=bg(a,e);if(d===95)continue;b=iZ(d);if(b<0||b>=g)break;if(mu(k,c))bf(c9);b=gF(b);c=wj(wk(h,c),b);if(mu(c,b))bf(c9)}if(e!==l(a))bf(c9);if(j&&mu(new +t(0,0,cy),c))bf(c9);if(i<0)c=wl(c);return c}var +X9=wm(bK("0xdaba0b6eb09322e3")),X8=wm(bK("0xd1342543de82ef95"));function +XZ(a,b){return a.xor(b)}function +XX(a,b){return a.shift_right_unsigned(b)}function +XW(a,b){return a.shift_left(b)}function +mx(a){function +o(a,b){return XW(a,b)}function +h(a,b){return XX(a,b)}function +s(a,b){return wo(a,b)}function +f(a,b){return XZ(a,b)}function +k(a,b){return wj(a,b)}function +i(a,b){return wk(a,b)}function m(a,b){return s(o(a,b),h(a,64-b))}function -g(a,b){return vF(a,b)}function -j(a,b,c){return gj(a,b,c)}var -q=vW(v8("0xd1342543de82ef95")),l=vW(v8("0xdaba0b6eb09322e3")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var +g(a,b){return v7(a,b)}function +j(a,b,c){return gz(a,b,c)}var +q=X8,l=X9,b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var d=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function -ck(a,b){if(a<0)eg();var +Xk(a,b){if(a<0)em();var a=a+1|0,c=new Array(a);c[0]=0;for(var d=1;d>>32-e,c)}function g(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function h(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function i(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function j(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var -c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function -Vf(a,b,c){var -e=a.len&dv,d=0;a.len+=c;if(e){var -f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);iz(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function -Vd(a){var -c=a.len&dv;a.b8[c]=ce;c++;if(c>56){for(var -b=c;b<64;b++)a.b8[b]=0;iz(a.w,a.b32);for(var +c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xd76aa478);f=g(f,c,d,e,b[1],12,0xe8c7b756);e=g(e,f,c,d,b[2],17,0x242070db);d=g(d,e,f,c,b[3],22,0xc1bdceee);c=g(c,d,e,f,b[4],7,0xf57c0faf);f=g(f,c,d,e,b[5],12,0x4787c62a);e=g(e,f,c,d,b[6],17,0xa8304613);d=g(d,e,f,c,b[7],22,0xfd469501);c=g(c,d,e,f,b[8],7,0x698098d8);f=g(f,c,d,e,b[9],12,0x8b44f7af);e=g(e,f,c,d,b[10],17,0xffff5bb1);d=g(d,e,f,c,b[11],22,0x895cd7be);c=g(c,d,e,f,b[12],7,0x6b901122);f=g(f,c,d,e,b[13],12,0xfd987193);e=g(e,f,c,d,b[14],17,0xa679438e);d=g(d,e,f,c,b[15],22,0x49b40821);c=h(c,d,e,f,b[1],5,0xf61e2562);f=h(f,c,d,e,b[6],9,0xc040b340);e=h(e,f,c,d,b[11],14,0x265e5a51);d=h(d,e,f,c,b[0],20,0xe9b6c7aa);c=h(c,d,e,f,b[5],5,0xd62f105d);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xd8a1e681);d=h(d,e,f,c,b[4],20,0xe7d3fbc8);c=h(c,d,e,f,b[9],5,0x21e1cde6);f=h(f,c,d,e,b[14],9,0xc33707d6);e=h(e,f,c,d,b[3],14,0xf4d50d87);d=h(d,e,f,c,b[8],20,0x455a14ed);c=h(c,d,e,f,b[13],5,0xa9e3e905);f=h(f,c,d,e,b[2],9,0xfcefa3f8);e=h(e,f,c,d,b[7],14,0x676f02d9);d=h(d,e,f,c,b[12],20,0x8d2a4c8a);c=i(c,d,e,f,b[5],4,0xfffa3942);f=i(f,c,d,e,b[8],11,0x8771f681);e=i(e,f,c,d,b[11],16,0x6d9d6122);d=i(d,e,f,c,b[14],23,0xfde5380c);c=i(c,d,e,f,b[1],4,0xa4beea44);f=i(f,c,d,e,b[4],11,0x4bdecfa9);e=i(e,f,c,d,b[7],16,0xf6bb4b60);d=i(d,e,f,c,b[10],23,0xbebfbc70);c=i(c,d,e,f,b[13],4,0x289b7ec6);f=i(f,c,d,e,b[0],11,0xeaa127fa);e=i(e,f,c,d,b[3],16,0xd4ef3085);d=i(d,e,f,c,b[6],23,0x04881d05);c=i(c,d,e,f,b[9],4,0xd9d4d039);f=i(f,c,d,e,b[12],11,0xe6db99e5);e=i(e,f,c,d,b[15],16,0x1fa27cf8);d=i(d,e,f,c,b[2],23,0xc4ac5665);c=j(c,d,e,f,b[0],6,0xf4292244);f=j(f,c,d,e,b[7],10,0x432aff97);e=j(e,f,c,d,b[14],15,0xab9423a7);d=j(d,e,f,c,b[5],21,0xfc93a039);c=j(c,d,e,f,b[12],6,0x655b59c3);f=j(f,c,d,e,b[3],10,0x8f0ccc92);e=j(e,f,c,d,b[10],15,0xffeff47d);d=j(d,e,f,c,b[1],21,0x85845dd1);c=j(c,d,e,f,b[8],6,0x6fa87e4f);f=j(f,c,d,e,b[15],10,0xfe2ce6e0);e=j(e,f,c,d,b[6],15,0xa3014314);d=j(d,e,f,c,b[13],21,0x4e0811a1);c=j(c,d,e,f,b[4],6,0xf7537e82);f=j(f,c,d,e,b[11],10,0xbd3af235);e=j(e,f,c,d,b[2],15,0x2ad7d2bb);d=j(d,e,f,c,b[9],21,0xeb86d391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function +Xi(a,b,c){var +e=a.len&dD,d=0;a.len+=c;if(e){var +f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);iO(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function +Xg(a){var +c=a.len&dD;a.b8[c]=cj;c++;if(c>56){for(var +b=c;b<64;b++)a.b8[b]=0;iO(a.w,a.b32);for(var b=0;b<56;b++)a.b8[b]=0}else for(var -b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;iz(a.w,a.b32);var +b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1fffffff;iO(a.w,a.b32);var e=new Uint8Array(16);for(var d=0;d<4;d++)for(var -b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function -Wl(a){return bL(gs(a,0,a.length))}function -V5(a,b,c){var -d=Ve(),e=gt(a);Vf(d,e.subarray(b,b+c),c);return Wl(Vd(d))}function -V6(a,b,c){return V5(dF(a),b,c)}function -V8(){return 0}var -dI=new +b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&cM;return e}function +Ys(a){return bU(gI(a,0,a.length))}function +X$(a,b,c){var +d=Xh(),e=i5(a);Xi(d,e.subarray(b,b+c),c);return Ys(Xg(d))}function +Ya(a,b,c){return X$(dO(a),b,c)}function +Yc(){return 0}var +dQ=new Array();function -mg(a){return dI[a]}function -ej(a){var -b=mg(a);if(!b.opened)H("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(gs(b.buffer,0,b.buffer_curr));else +my(a){return dQ[a]}function +ep(a){var +b=my(a);if(!b.opened)F("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr===0)return 0;if(b.output)b.output(gI(b.buffer,0,b.buffer_curr));else b.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function -Wi(a){if(a.refill!=null){var -e=a.refill(),b=wc(e);if(b.length==0)a.refill=null;else{if(a.buffer.length0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;Wi(e);var +Ye(a,b,c,d){var +e=my(a),g=d,f=e.buffer_max-e.buffer_curr;if(d<=f){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+d),c);e.buffer_curr+=d}else if(f>0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;Yp(e);var f=e.buffer_max-e.buffer_curr;if(g>f)g=f;b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+g),c);e.buffer_curr+=g}return g|0}function -V9(a,b,c,d){var -e=gt(b);return V_(a,e,c,d)}function -Wn(a,b){if(b.name)try{var -d=require(k1),c=d.openSync(b.name,"rs");return new -cA(c,b)}catch(f){}return new -cA(a,b)}var -iN=new +Yd(a,b,c,d){var +e=i5(b);return Ye(a,e,c,d)}function +Yu(a,b){if(b.name)try{var +d=require(l3),c=d.openSync(b.name,"rs");return new +cC(c,b)}catch(f){}return new +cC(a,b)}var +i3=new Array(3);function -gi(a,b){bv.call(this,al(0));this.log=function(a){return 0};if(a==1&&typeof -console.log=="function")this.log=console.log;else if(a==2&&typeof -console.error=="function")this.log=console.error;else if(typeof -console.log=="function")this.log=console.log;this.flags=b}gi.prototype.length=function(){return 0};gi.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var -e=al(d);ci(l4(b),c,e,0,d);this.log(e.toUtf16());return 0}H(this.fd+up)};gi.prototype.read=function(a,b,c,d){H(this.fd+": file descriptor is write only")};gi.prototype.close=function(){this.log=undefined};function -iO(a,b){if(b==undefined)b=iN.length;iN[b]=a;return b|0}function -Ww(a,b,c){var +gy(a,b){by.call(this,an(0));this.log=function(a){return 0};if(a===1&&typeof +console.log==="function")this.log=console.log;else if(a===2&&typeof +console.error==="function")this.log=console.error;else if(typeof +console.log==="function")this.log=console.log;this.flags=b}gy.prototype.length=function(){return 0};gy.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]===10)d--;var +e=an(d);cm(mj(b),c,e,0,d);this.log(e.toUtf16());return 0}F(this.fd+uR)};gy.prototype.read=function(a,b,c,d){F(this.fd+": file descriptor is write only")};gy.prototype.close=function(){this.log=undefined};function +i4(a,b){if(b===undefined)b=i3.length;i3[b]=a;return b|0}function +YD(a,b,c){var d={};while(b){switch(b[1]){case 0:d.rdonly=1;break;case 1:d.wronly=1;break;case @@ -881,355 +871,351 @@ d={};while(b){switch(b[1]){case 5:d.excl=1;break;case 6:d.binary=1;break;case 7:d.text=1;break;case -8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)H(cB(a)+ls);if(d.text&&d.binary)H(cB(a)+lO);var -e=wg(a),f=e.device.open(e.rest,d);return iO(f,undefined)}(function(){function -a(a,b){return gu()?Wn(a,b):new -gi(a,b)}iO(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);iO(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);iO(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function -V$(a){var -b=iN[a];if(b.flags.wronly)H(uM+a+" is writeonly");var +8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)F(cE(a)+lJ);if(d.text&&d.binary)F(cE(a)+l5);var +e=wI(a),f=e.device.open(e.rest,d);return i4(f,undefined)}(function(){function +a(a,b){return gJ()?Yu(a,b):new +gy(a,b)}i4(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);i4(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);i4(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function +Yf(a){var +b=i3[a];if(b.flags.wronly)F(vb+a+" is writeonly");var d=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new -Uint8Array(eZ),refill:d};dI[c.fd]=c;return c.fd}function -v4(a){var -b=iN[a];if(b.flags.rdonly)H(uM+a+" is readonly");var +Uint8Array(e8),refill:d};dQ[c.fd]=c;return c.fd}function +wt(a){var +b=i3[a];if(b.flags.rdonly)F(vb+a+" is readonly");var d=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new -Uint8Array(eZ),buffered:d};dI[c.fd]=c;return c.fd}function -Wa(){var +Uint8Array(e8),buffered:d};dQ[c.fd]=c;return c.fd}function +Yg(){var b=0;for(var -a=0;ae.buffer.length){var +a=0;ae.buffer.length){var g=new Uint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case -0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;ej(a);break;case -1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)ej(a);break;case +0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;ep(a);break;case +1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)ep(a);break;case 2:var -f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)ej(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;ej(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function -Wb(a,b,c,d){var -b=gt(b);return Wc(a,b,c,d)}function -mh(a,b,c,d){return Wb(a,dF(b),c,d)}function -v5(a,b){var -c=bL(String.fromCharCode(b));mh(a,c,0,1);return 0}function -Wd(a,b){if(b==0)ml();return a%b}function -v6(a){if(isFinite(a)){var +f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)ep(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;ep(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function +Yh(a,b,c,d){var +b=i5(b);return Yi(a,b,c,d)}function +mz(a,b,c,d){return Yh(a,dO(b),c,d)}function +wu(a,b){var +c=bU(String.fromCharCode(b));mz(a,c,0,1);return 0}function +Yj(a,b){if(b===0)mD();return a%b}function +wv(a){if(Number.isFinite(a)){var d=1/a<0;a=Math.abs(a);var -b=Math.floor(a),c=a-b;if(d){b=-b;c=-c}return[0,c,b]}if(isNaN(a))return[0,NaN,NaN];return[0,1/a,a]}function -ek(a,b){return+(fa(a,b,false)!=0)}function -dK(a){if(a -instanceof -Array&&a[0]==a[0]>>>0)return a[0];else if(iH(a))return e4;else if(iI(a))return e4;else if(a +b=Math.floor(a),c=a-b;if(d){b=-b;c=-c}return[0,c,b]}if(Number.isNaN(a))return[0,Number.NaN,Number.NaN];return[0,1/a,a]}function +eq(a,b){return+(fi(a,b,false)!==0)}function +dS(a){if(Array.isArray(a)&&a[0]===a[0]>>>0)return a[0];else if(iW(a))return fa;else if(iX(a))return fa;else if(a instanceof Function||typeof -a=="function")return 247;else if(a&&a.caml_custom)return dx;else -return gg}function -Vq(a){var -c={};if(a)for(var -b=1;b=0)a=e;else -a5("caml_register_global: cannot locate "+d)}}bl[a+1]=b;if(c)bl[c]=b}function -mn(a,b){v7[cB(a)]=b;return 0}function -Wk(){au(lv)}function -V(a,b){if(b>>>0>=l(a))Wk();return bn(a,b)}function -iM(a){a.t&6&&gk(a);return bL(a.c)}function -Wm(){return 0x7FFFFFFF/4|0}function -Wg(){v_(bl.Not_found)}function -wa(a){var -b=wf(S(a));if(b===undefined)Wg();return bM(b)}function -Wo(){if(L.crypto)if(L.crypto.getRandomValues){var -a=L.crypto.getRandomValues(new -Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(L.crypto.randomBytes){var +a==="function")return 247;else if(a&&a.caml_custom)return dF;else +return gv}var +wH=undefined;function +Xu(a){var +d={},c=-1;if(a)for(var +b=1;b=0)a=e;else{var +a=a$.symidx.next_idx++;a$.symidx[d]=a}}}a$[a+1]=b;if(c)a$[c]=b}function +mE(a,b){ww[cE(a)]=b;return 0}function +Yr(){aw(lM)}function +X(a,b){if(b>>>0>=l(a))Yr();return bg(a,b)}function +i2(a){a.t&6&&gA(a);return bU(a.c)}function +Yt(){return 0x7fffffff/4|0}function +Ym(){wy(a$.Not_found)}function +wA(a){var +b=wG(S(a));if(b===undefined)Ym();return bK(b)}function +Yv(){if(U.crypto)if(U.crypto.getRandomValues){var +a=U.crypto.getRandomValues(new +Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(U.crypto.randomBytes){var a=new -Int32Array(L.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var +Int32Array(U.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var b=new Date().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function -bN(a){var +bV(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function n(a,b){return{joo_tramp:a,joo_args:b}}function -Wp(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof +Yw(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof b==="function"){a.fun=b;return 0}var c=b.length;while(c--)a[c]=b[c];return 0}function -O(a){{if(a +T(a){{if(Array.isArray(a))return a;var +b;if(U.RangeError&&a instanceof -Array)return a;var -b;if(L.RangeError&&a +U.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=a$.Stack_overflow;else if(U.InternalError&&a instanceof -L.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=bl.Stack_overflow;else if(L.InternalError&&a +U.InternalError&&a.message&&a.message.match(/too much recursion/i))b=a$.Stack_overflow;else if(a instanceof -L.InternalError&&a.message&&a.message.match(/too much recursion/i))b=bl.Stack_overflow;else if(a +U.Error&&dR(lg))b=[0,dR(lg),a];else +b=[0,a$.Failure,bK(String(a))];if(a instanceof -L.Error&&dJ(k5))b=[0,dJ(k5),a];else -b=[0,bl.Failure,bM(String(a))];if(a -instanceof -L.Error)b.js_error=a;return b}}function -VW(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function -Vz(a){var -b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&VW(a[1]))var +U.Error)b.js_error=a;return b}}function +X0(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function +XD(a){var +b=e;if(a[0]===0){b+=a[1][1];if(a.length===3&&a[2][0]===0&&X0(a[1]))var f=a[2],g=1;else var g=2,f=a;b+="(";for(var -d=g;dg)b+=lQ;var +d=g;dg)b+=l7;var c=f[d];if(typeof -c=="number")b+=c.toString();else if(c -instanceof -c9)b+=dB+c.toString()+dB;else if(typeof -c=="string")b+=dB+c.toString()+dB;else -b+=sY}b+=")"}else if(a[0]==B)b+=a[1];return b}function -vP(a){if(a +c==="number")b+=c.toString();else if(c instanceof -Array&&(a[0]==0||a[0]==B)){var -c=dJ(vj);if(c)iC(c,[a,false]);else{var -d=Vz(a),b=dJ(sB);if(b)iC(b,[0]);console.error(lI+d);if(a.js_error)throw a.js_error}}else +dc)b+=dJ+c.toString()+dJ;else if(typeof +c==="string")b+=dJ+c.toString()+dJ;else +b+=lH}b+=")"}else if(a[0]===B)b+=a[1];return b}function +wf(a){if(Array.isArray(a)&&(a[0]===0||a[0]===B)){var +c=dR(vL);if(c)iR(c,[a,false]);else{var +d=XD(a),b=dR(s0);if(b)iR(b,[0]);console.error(lZ+d);if(a.js_error)throw a.js_error}}else throw a}function -Wj(){var -c=L.process;if(c&&c.on)c.on("uncaughtException",function(a,b){vP(a);c.exit(2)});else if(L.addEventListener)L.addEventListener(lM,function(a){if(a.error)vP(a.error)})}Wj();function -h(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):c_(a,[b])}function -i(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):c_(a,[b,c])}function -a$(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):c_(a,[b,c,d])}function -fZ(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)==4?a(b,c,d,e):c_(a,[b,c,d,e])}function -eT(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):c_(a,[b,c,d,e,f])}function -Vc(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):c_(a,[b,c,d,e,f,g,h])}var -Wv=undefined;VA();var -iQ=[B,vw,-1],mt=[B,tD,-2],dL=[B,l0,-3],iP=[B,tq,-4],a6=[B,uD,-7],mr=[B,vu,-8],ms=[B,tT,-9],f=[B,t2,-11],mu=[B,ub,-12],i2=[0,e,0,0,-1],mT=[0,e,1,0,0],U2=[4,0,0,0,[12,45,[4,0,0,0,0]]],jd=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,s$,[4,0,0,0,[12,45,[4,0,0,0,[11,h9,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],o6=[0,0],U3=[17,[0,a,1,0],[11,rv,[17,0,0]]],U4=[17,[0,a,1,0],[12,40,0]],U5=[11,"('\"'",[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,qX,[17,0,0]]]]]],U6=[0,a,1,0],U7=[11,sy,[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,qX,[17,0,0]]]]]],U8=[0,a,1,0],U9=[11,dz,[17,[0,a,1,0],[11,vs,[17,0,0]]]],U_=[0,a,1,0],U$=[11,sy,[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,vs,[17,0,0]]]]]],Va=[0,a,1,0],Vb=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],pN=[0,ai,[0,cu,-991563951]],pO=[0,ai,[0,cu,s8]],p1=iJ([9,10,11,12,13,32,lP,q2,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,sT,8233,8239,8287,12288]),bg=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],hM="lib/data_source/jellyfin_api.ml.user",hN="lib/data_source/jellyfin_api.ml.Authenticate_by_name.params",hO="lib/data_source/jellyfin_api.ml.Authenticate_by_name.response",hP="lib/data_source/jellyfin_api.ml.Item.genre_item",kG="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",D="lib/data_source/jellyfin_api.ml.Item.type_",hQ="lib/data_source/jellyfin_api.ml.Item.t",hR="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",fU="lib/db/generic_schema.ml.Id.t",hS="lib/db/generic_schema.ml.Collection.t",hT="lib/db/generic_schema.ml.Genre.t",hU="lib/db/generic_schema.ml.Album.t",hV="lib/db/generic_schema.ml.Track.t",hW="lib/db/stores.ml.Items.sorts",hX="lib/db/stores.ml.Items.t",qn=[0,0,0];cl(11,mu,ub);cl(10,f,t2);cl(9,[B,t5,rp],t5);cl(8,ms,tT);cl(7,mr,vu);cl(6,a6,uD);cl(5,[B,su,-6],su);cl(4,[B,tK,-5],tK);cl(3,iP,tq);cl(2,dL,l0);cl(1,mt,tD);cl(0,iQ,vw);var -wB=h5,wz="output_substring",ww=dA,ws=eb,wt=gh,wh="Stdlib.Exit",wl=bw(0,0,32752),wn=bw(0,0,65520),wp=bw(1,0,32760),wF="CamlinternalLazy.Undefined",wM="option is None",wQ=ic,wR="\\'",wS=ig,wT=iq,wU=h_,wV=h2,wO="Char.chr",w0=" is not an Unicode scalar value",xa="List.init",w9="hd",xF=[0,sc,r0,20],xE=[0,sc,tL,9],xo="String.blit / Bytes.blit_string",xn="Bytes.blit",xm="String.sub / Bytes.sub",xS="String.contains_from / Bytes.contains_from",xQ="String.index_from / Bytes.index_from",xK=e,xH="String.concat",x3="Array.iter2: arrays must have the same length",x1="Array.blit",x0="Array.sub",xY="Array.init",yd="Set.remove_min_elt",ye=[0,0,0,0],yf=[0,"set.ml",lf,18],x$=h6,ya=h6,yb=h6,yc=h6,yl="Map.remove_min_elt",ym=[0,0,0,0],yn=[0,"map.ml",rV,10],yh=ir,yi=ir,yj=ir,yk=ir,yo="Stdlib.Stack.Empty",ys="Stdlib.Queue.Empty",yA="Buffer.add_substring/add_subbytes",yz="Buffer.add: cannot grow buffer",yx="Buffer.sub",yI="first domain already spawned",yF=[0,"domain.ml",184,13],yT=tH,yU=s_,yV=uF,yW=tm,yX=vz,yY=uB,yZ="%f",y0="%B",y1="%{",y2="%}",y3="%(",y4="%)",y5=vy,y6="%t",y7="%?",y8="%r",y9="%_r",y_=[0,aV,qZ,23],zj=[0,aV,uY,21],zb=[0,aV,rT,21],zk=[0,aV,rl,21],zc=[0,aV,tJ,21],zl=[0,aV,t7,19],zd=[0,aV,tN,19],zm=[0,aV,r9,22],ze=[0,aV,rs,22],zn=[0,aV,tk,30],zf=[0,aV,rI,30],zh=[0,aV,uJ,26],y$=[0,aV,r_,26],zi=[0,aV,us,28],za=[0,aV,q1,28],zg=[0,aV,ue,23],Az=[0,aV,1558,4],AA="Printf: bad conversion %[",AB=[0,aV,1626,39],AC=[0,aV,1649,31],AD=[0,aV,1650,31],AE="Printf: bad conversion %_",AF=tx,AG=rE,AH=tx,AI=rE,AL=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],AK=[0,0,4],Au=k0,As="neg_infinity",At=tF,Ar=dA,Am=[0,h0],Aa="%+nd",Ab="% nd",Ad="%+ni",Ae="% ni",Af="%nx",Ag="%#nx",Ah="%nX",Ai="%#nX",Aj="%no",Ak="%#no",z$="%nd",Ac=vz,Al="%nu",zY="%+ld",zZ="% ld",z1="%+li",z2="% li",z3="%lx",z4="%#lx",z5="%lX",z6="%#lX",z7="%lo",z8="%#lo",zX="%ld",z0=tm,z9="%lu",zK="%+Ld",zL="% Ld",zN="%+Li",zO="% Li",zP="%Lx",zQ="%#Lx",zR="%LX",zS="%#LX",zT="%Lo",zU="%#Lo",zJ="%Ld",zM=uB,zV="%Lu",zw="%+d",zx="% d",zz="%+i",zA="% i",zB="%x",zC="%#x",zD=vb,zE="%#X",zF="%o",zG="%#o",zv=kZ,zy=uF,zH=ri,yL="@]",yM="@}",yN="@?",yO="@\n",yP="@.",yQ="@@",yR="@%",yS="@",zo="CamlinternalFormat.Type_mismatch",AQ=e,AR=[0,[11,lQ,[2,0,[2,0,0]]],", %s%s"],Br=[0,[11,lI,[2,0,[12,10,0]]],rm],Bs=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],Bq="Fatal error: out of memory in uncaught exception handler",Bn=[0,[11,lI,[2,0,[12,10,0]]],rm],Bh=[0,[2,0,[12,10,0]],"%s\n"],Bi=[0,[11,q9,0],q9],A8="Raised at",A9="Re-raised at",A_="Raised by primitive operation at",A$="Called from",Ba=[0,[12,32,[4,0,0,0,0]]," %d"],Be=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],Bb=" (inlined)",Bd=e,Bc=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,qM,[2,0,[11,s$,U2]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],Bf=[0,[2,0,[11," unknown location",0]],"%s unknown location"],A1="Out of memory",A2="Stack overflow",A3="Pattern matching failed",A4="Assertion failed",A5="Undefined recursive module",AT=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],AU=e,AV=e,AW=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],AP=[0,[4,0,0,0,0],kZ],AN=[0,[3,0,0],"%S"],AO=sY,Bk=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],Bw="Fun.Finally_raised: ",Bu="Stdlib.Fun.Finally_raised",Bx="Digest.BLAKE2: wrong hash size",BP=bw(14371852,15349651,22696),BQ=bw(12230193,11438743,35013),BR=bw(1424933,15549263,2083),BS=bw(9492471,4696708,43520),BO="Random.int",BB=bw(1,0,0),BC=bw(0,0,0),BF=bw(1,0,0),BD=bw(0,0,0),BE=bw(2,0,0),B2="Hashtbl: unsupported hash table format",BW=e,CK=[3,0,3],CL=dA,CF=t6,CG="<\/",CH=e,CB=t6,CC="<",CD=e,Cz="\n",Cv=e,Cw=e,Cx=e,Cy=e,Ck=[0,e],Cf=e,Cg=e,Ch=e,Ci=e,Cb=[0,e,0,e],B9="Stdlib.Format.String_tag",CT="Jsoo_runtime.Error.Exn",CU=k5,CY=[0,ar,157,10],C0=[0,ar,179,10],C2=[0,ar,f6,10],C5=[0,ar,lu,17],Dd=[0,ar,sW,16],De=[0,ar,sH,18],Df=[0,ar,sQ,15],Dg=[0,ar,sx,15],Dh=[0,ar,s6,15],Di=[0,ar,s3,10],Dj=[0,ar,tf,16],Dk=[0,ar,vr,12],Dl=[0,ar,vp,14],Dw=[0,ar,tO,27],Dv=[0,ar,t8,27],Dp=[0,ar,tV,16],Dm=[0,ar,ts,23],Dn=[0,ar,sw,14],Dc=[0,ar,tt,9],C9=[0,ar,u9,9],C8=[0,ar,u7,9],C7=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],C4=[0,ar,ly,14],C1=[0,ar,rc,14],CZ=[0,ar,169,14],CX=[0,ar,t1,14],Dq="Lwd.Release_failure",DD=[0,N,64,12],DQ=[0,N,t4,18],DP=[0,N,lu,9],DS=[0,N,ee,18],DR=[0,N,f7,9],DT=[0,N,d_,21],DU=[0,N,cI,21],DV=[0,N,rM,21],DX=[0,N,rP,14],Ek=[0,N,tZ,18],El=[0,N,sR,12],Em=[0,N,s7,14],Ej=[0,N,rZ,21],Eh=[0,N,tl,14],Eg=[0,N,tI,14],Ee=[0,N,t_,29],Ed=[0,N,rG,29],Eb=[0,N,q8,21],D8=[0,N,qO,10],D9=[0,N,rg,15],D_=[0,N,q3,10],D$=[0,N,qT,2],D3=[0,N,rK,24],D4=[0,N,rz,16],D5=[0,N,uH,2],D0=[0,N,ra,18],DZ=[0,N,vA,9],DM=[0,N,sM,4],DL=[0,N,ly,21],DJ=[0,N,tj,4],DK=[0,N,177,14],DH=[0,N,113,14],DF=[0,N,82,21],DB=[0,N,32,14],EP=[0,bt,lf,12],EA=[0,bt,ta,37],EB=[0,bt,qQ,37],ED=[0,bt,s9,10],EE=[0,bt,tz,8],EC=[0,bt,tu,37],EG=[0,bt,rQ,10],EH=[0,bt,sg,8],EF=[0,bt,vx,37],EK=[0,bt,t0,16],EN=[0,bt,u0,50],EL=[0,bt,sN,6],EJ=[0,bt,sC,14],Es=[0,bt,tj,57],Et=[0,bt,182,57],Eu=[0,bt,ul,11],En=rA,Eo=rA,Ff=[0,"src/fut.ml",34,25],Gg="debug",Ge="warn",Gc=lM,Gb="log",FX="scrollTop",FE="search",Fy=[0,1],Fw=vt,Gk="isSecureContext",Gq="cache",Gr="credentials",Gs="headers",Gt="integrity",Gu="keepalive",Gv="method",Gw="mode",Gx="redirect",Gy="referrer",Gz="referrerPolicy",GV=[0,tv,lE,16],GT=[0,tv,uE,16],GO=[0,0,0],GM=[0,0,0],Hq=e,Hp=e,Hf=[0,[0,bi,uX],0],Hg=[0,[0,bi,k9],[0,cH,0]],Hh=[0,[0,bi,h4],[0,cH,0]],Hi=[0,[0,bi,lc],[0,cH,0]],Hj=[0,[0,bi,lD],[0,cH,0]],Hk=[0,[0,bi,lk],[0,cH,0]],Hl=[0,[0,bi,k7],[0,cH,0]],Hm=[0,[0,bi,lj],[0,cH,0]],Hn=[0,[0,bi,uX],[0,cH,0]],G8=[0,[0,bi,k9],0],G9=[0,[0,bi,h4],0],G_=[0,sl,0],G$=[0,[0,bi,lc],0],Ha=[0,[0,bi,lD],0],Hb=[0,[0,bi,lk],0],Hc=[0,[0,bi,k7],0],Hd=[0,cH,0],He=[0,[0,bi,lj],0],G6=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],G7="CCFormat.ANSI_codes.No_such_style",Hr="CCFormat.Style",HD="CCResult.Get_error",HQ=[0,vv,119,10],HN=[0,vv,92,10],HJ=e,HZ="CCFQueue.Empty",H0=[0,0],H9="content-box",H_="border-box",H$="device-pixel-content-box",Ii=uS,Ij=sv,Ik="position",Ie="Set metadata",Io="unique",IB="not implemented",Iy=[0,[8,[0,0,0],0,0,[11,uc,0]],"%fpx"],Iz=[0,[8,[0,0,0],0,0,[11,tM,0]],"%frem"],IA=[0,[8,[0,0,0],0,0,[11,q_,0]],"%fem"],Iv=uc,Iw=tM,Ix=q_,ID="Common.Utils.Forward_ref.Not_set",IF="Common.Utils.Forward_ref.Already_set",IJ=[1,[0,sr,rq]],IL=[1,-358247754],IQ=e,IP=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],IV="TODO not implemented",I0=[0,80,uC],I3=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],I4=[0,80,"lwdui-controlled-scroll-controls"],I5="Show playing",Jb=q0,I_=e,I$="password",I7=e,I8=lG,Jf=[0,80,lG],Jd=[0,[2,0,[11,tQ,0]],rx],Je=[0,[2,0,0],s_],Jh=[0,80,lG],Jg=[0,[2,0,[11,tQ,0]],rx],Jl=[0,[2,0,[11,"-id",0]],"%s-id"],Jm=[0,80,"checkbox"],Jj=[0,[2,0,[12,45,[4,3,0,0,[12,45,[4,3,0,0,0]]]]],"%s-%i-%i"],Jy=[0,[11,rJ,[2,0,0]],"height: %s"],Ju=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],Js="grid-template-columns",Jt=[0,[2,0,[11,h9,[2,0,[12,59,0]]]],"%s: %s;"],Jv=e,Jz=[1,4.],JH=[0,80,r5],JF="Row height",JG="Visible height:",JD=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],JE=[0,[11,rJ,[2,0,[11," !important;",0]]],"height: %s !important;"],JI=[0,80,[0,"lwdui-lazy-table-content"]],JJ=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],JK=[0,"lwdui-lazy-table",0],JA="virtual table",JO="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",J1=[0,[17,[0,s1,1,0],0],s1],J0=[0,[12,32,0],bK],JZ=[0,[11,r$,0],r$],J2=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],JU=[0,[11,uu,[15,[11,t9,[15,[11," dst-off=",[4,0,0,0,[11,kX,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],JS=[0,[11,uu,[15,[11,t9,[15,[11," src-off=",[4,0,0,0,[11,kX,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],JQ=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],JP=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],J3=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],J4=e,KA=[0,[8,[0,0,0],0,[0,0],0],qN],Kj=[0,[12,44,0],lw],Kq=[0,[15,[12,58,[15,0]]],"%a:%a"],Kp=[0,[12,44,0],lw],Ki=[0,[11,f$,0],f$],Kl=[0,[11,eb,0],eb],Km=[0,[11,gh,0],gh],Kn=[0,[8,[0,0,0],0,[0,0],0],qN],Ko=[0,[8,[0,0,3],0,0,0],"%g"],Kr=[0,[12,e1,[15,[12,e7,0]]],"{%a}"],Kk=[0,[12,91,[15,[12,93,0]]],"[%a]"],Ks=[0,[12,44,[17,[0,a,1,0],0]],rb],Kw=[0,[18,[1,[0,[11,eU,0],eU]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],Kv=[0,[12,44,[17,[0,a,1,0],0]],rb],Kx=[0,[18,[1,[0,[11,eU,0],eU]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],Ky=[0,[11,uP,0],uP],Kt=[0,[18,[1,[0,[11,eU,0],eU]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],Ku=[0,[11,vl,0],vl],J9=[0,[12,34,0],dB],Kb=[0,[0,0],tH],Ka=[0,[11,ic,0],ic],Kd=[0,[11,ig,0],ig],Ke=[0,[11,iq,0],iq],Kf=[0,[11,h_,0],h_],Kg=[0,[11,h2,0],h2],J$=[0,[11,lV,0],lV],Kc=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],J_=[0,[12,34,0],dB],KY=[0,ga,r6,9],KR=[0,e9,lF],KM=[0,gb,lF],KS=[0,dy,lF],KQ=[0,dy,f4],KN=[0,gb,f4],KO=[0,ga,153,55],KP=[0,dy,f4],KT=[0,ga,t1,55],KU=[0,ga,154,55],KV=[0,dy,cL],KK=[0,ga,lJ,9],KC=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],KJ=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],Mb=[0,b0,[0,bB,1]],Mc=[0,b0,c0],Md=[0,b0,[0,bB,0]],Mf=[0,b0,f5],Me=[0,b0,d$],Mq=[0,lA,tr,27],Mk=[0,b0,sh],Mh=[0,b0,ve],L$=[0,lA,u2,8],L_=[0,lA,ua,45],LG=[0,[18,[1,[0,0,e]],[11,eX,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,lp,[17,[0,a,1,0],[11,h1,U3]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],LH=[0,[18,[1,[0,0,e]],[11,eX,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],LJ=[0,[15,[17,[0,a,1,0],[11,k8,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,h1,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],LK=[0,[15,[17,[0,a,1,0],[11,ry,[17,[0,a,1,0],[11,ut,[17,[0,a,1,0],[11,lt,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],LL=[0,[15,[17,[0,a,1,0],[11,ry,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,lt,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],LM=[0,[15,[17,[0,a,1,0],[11,k8,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],LI=[0,[15,[17,[0,a,1,0],[11,k8,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,ut,[17,[0,a,1,0],[11,lt,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],LN=[0,[18,[1,[0,0,e]],[11,eX,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,lp,[17,[0,a,1,0],[11,h1,[17,[0,a,1,0],[11,rv,U4]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],LO=[0,[4,8,[0,2,2],0,0],"%02X"],LQ=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],LP=[0,[12,41,[17,0,0]],")@]"],LR=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],LS=[0,[11,um,[17,[0,a,1,0],[11,bk,[17,0,0]]]],"member@ name@]"],LT=[0,[11,iu,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],LU=[0,[11,bk,[17,[0,a,1,0],[11,lb,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],LV=[0,[11,f3,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,h5,[17,0,0]]]]]],"end@ of@ input@]"],LW=[0,[11,"JavaScript",[17,[0,a,1,0],[11,sF,[17,0,0]]]],"JavaScript@ comment@]"],LX=[0,[11,iu,[17,[0,a,1,0],[11,cY,[17,0,0]]]],"JSON@ value@]"],LY=[0,[11,um,[17,[0,a,1,0],[11,bk,[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,iy,[17,[0,a,1,0],[11,f3,[17,U6,U5]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],LZ=[0,[11,cY,[17,[0,a,1,0],[11,lb,[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,iy,[17,[0,a,1,0],[11,f3,[17,U8,U7]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],L0=[0,[11,cY,[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,ip,[17,[0,a,1,0],[11,f3,[17,[0,a,1,0],[11,"(value",[17,U_,U9]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],L1=[0,[11,cY,[17,[0,a,1,0],[11,lb,[17,[0,a,1,0],[11,dz,[17,[0,a,1,0],[11,ip,[17,[0,a,1,0],[11,f3,[17,Va,U$]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],L2=[0,[18,[1,[0,0,e]],[11,eX,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],L8=[0,[18,[1,[0,0,e]],[11,eX,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],L9=[0,[18,[1,[0,0,e]],[11,eX,[17,[0,a,1,0],[11,h1,[17,[0,a,1,0],[11,lp,[17,[0,a,1,0],[11,iu,[17,[0,a,1,0],[11,lm,Vb]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],L3=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],L4=[0,[11,iy,[17,0,0]],"object@]"],L5=[0,[11,ip,[17,0,0]],"array@]"],L6=[0,[11,sF,[17,0,0]],"comment@]"],L7=[0,[11,lm,[17,0,0]],"string@]"],LE=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],LD=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],Li=[0,ai,-543455433],Lp=[0,ai,[0,f0,eW]],Lq=[0,ai,[0,f0,o]],Lr=[0,ai,[0,f0,f5]],Ls=[0,ai,[0,f0,d$]],Lv=[0,ai,[0,cu,eW]],Lw=[0,ai,[0,cu,ie]],Lx=[0,ai,[0,cu,u5]],Ly=[0,ai,[0,cu,[0,u4,1]]],Lz=[0,ai,[0,cu,[0,u4,0]]],LA=[0,ai,[0,cu,[0,k4,1]]],LB=[0,ai,[0,cu,[0,k4,0]]],LC=[0,ai,[0,cu,rH]],MK="not a valid JSON array/object",MH=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],MC=[0,[11,b3,0],b3],MD=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],ME=[0,[15,0],vy],MB="We expected a well-formed JSON document (array or object)",Mw=cY,Mx="object fields",Mu=[0,"lib/ezjsonm.ml",61,19],Mv=[0,ib,357123046],Mt="Abort",My="Ezjsonm.Parse_error",MM=iJ([[0,ix,y],[0,sM,y],[0,tg,y],[0,195,y],[0,196,y],[0,uT,y],[0,198,f1],[0,ly,az],[0,200,E],[0,uE,E],[0,202,E],[0,203,E],[0,ua,X],[0,t4,X],[0,206,X],[0,207,X],[0,208,ak],[0,209,aq],[0,210,q],[0,u2,q],[0,212,q],[0,213,q],[0,214,q],[0,216,q],[0,217,A],[0,lu,A],[0,219,A],[0,220,A],[0,221,aO],[0,222,lz],[0,sf,R],[0,ee,v],[0,uG,v],[0,226,v],[0,227,v],[0,228,v],[0,229,v],[0,230,c1],[0,231,aP],[0,232,d],[0,lE,d],[0,234,d],[0,235,d],[0,236,M],[0,f7,M],[0,ul,M],[0,sZ,M],[0,d_,aa],[0,241,ab],[0,242,c],[0,243,c],[0,dC,c],[0,lL,c],[0,d9,c],[0,B,c],[0,249,s],[0,cI,s],[0,251,s],[0,e4,s],[0,k6,ay],[0,ec,gc],[0,dx,ay],[0,cK,y],[0,uK,v],[0,258,y],[0,259,v],[0,rM,y],[0,261,v],[0,262,az],[0,263,aP],[0,264,az],[0,265,aP],[0,sm,az],[0,267,aP],[0,268,az],[0,269,aP],[0,270,ak],[0,qS,aa],[0,272,ak],[0,u8,aa],[0,274,E],[0,275,d],[0,276,E],[0,277,d],[0,278,E],[0,279,d],[0,280,E],[0,281,d],[0,282,E],[0,283,d],[0,284,an],[0,285,W],[0,286,an],[0,287,W],[0,288,an],[0,289,W],[0,sA,an],[0,291,W],[0,uq,aA],[0,293,U],[0,294,aA],[0,295,U],[0,rP,X],[0,sK,M],[0,298,X],[0,299,M],[0,300,X],[0,301,M],[0,302,X],[0,303,M],[0,304,X],[0,u7,M],[0,306,"IJ"],[0,307,"ij"],[0,308,ch],[0,u9,bC],[0,310,aF],[0,311,aW],[0,312,"kra"],[0,313,af],[0,314,C],[0,ra,af],[0,316,C],[0,vA,af],[0,318,C],[0,319,af],[0,320,C],[0,ta,af],[0,qQ,C],[0,323,aq],[0,324,ab],[0,325,aq],[0,326,ab],[0,327,aq],[0,328,ab],[0,329,ab],[0,330,"NG"],[0,331,gd],[0,332,q],[0,333,c],[0,tt,q],[0,335,c],[0,336,q],[0,tu,c],[0,vx,st],[0,339,c7],[0,340,ag],[0,341,p],[0,342,ag],[0,343,p],[0,344,ag],[0,345,p],[0,s9,_],[0,347,R],[0,348,_],[0,349,R],[0,350,_],[0,351,R],[0,352,_],[0,353,R],[0,354,aH],[0,355,aj],[0,356,aH],[0,357,aj],[0,tz,aH],[0,359,aj],[0,360,A],[0,361,s],[0,tf,A],[0,r6,s],[0,364,A],[0,365,s],[0,366,A],[0,sW,s],[0,sH,A],[0,369,s],[0,370,A],[0,rK,s],[0,sQ,a1],[0,373,ba],[0,374,aO],[0,rQ,ay],[0,376,aO],[0,sx,as],[0,378,$],[0,379,as],[0,380,$],[0,381,as],[0,382,$],[0,s6,R],[0,sg,aN],[0,385,aZ],[0,s3,aZ],[0,387,aN],[0,388,rF],[0,389,rF],[0,390,q],[0,rz,az],[0,392,aP],[0,393,ak],[0,uH,ak],[0,sC,ak],[0,396,aa],[0,tr,aa],[0,398,E],[0,399,E],[0,400,E],[0,401,bs],[0,402,cc],[0,403,an],[0,404,an],[0,405,sG],[0,406,X],[0,407,X],[0,rV,aF],[0,409,aW],[0,410,C],[0,411,C],[0,412,bj],[0,413,aq],[0,414,ab],[0,415,q],[0,416,q],[0,417,c],[0,418,"OI"],[0,419,"oi"],[0,qO,a0],[0,421,bA],[0,422,"YR"],[0,rg,lo],[0,424,lo],[0,t0,rX],[0,426,c5],[0,427,aj],[0,428,aH],[0,429,aj],[0,430,aH],[0,431,A],[0,432,s],[0,433,A],[0,434,bu],[0,q3,aO],[0,436,ay],[0,437,as],[0,438,$],[0,439,as],[0,440,as],[0,441,$],[0,442,$],[0,443,lo],[0,444,tC],[0,445,tC],[0,446,b1],[0,447,ba],[0,448,cv],[0,449,cv],[0,450,cv],[0,451,cv],[0,452,uV],[0,453,ak],[0,454,cf],[0,455,"LJ"],[0,456,af],[0,qT,"lj"],[0,458,"NJ"],[0,vp,aq],[0,460,"nj"],[0,461,y],[0,q8,v],[0,463,X],[0,464,M],[0,465,q],[0,466,c],[0,467,A],[0,468,s],[0,469,A],[0,470,s],[0,471,A],[0,472,s],[0,473,A],[0,474,s],[0,475,A],[0,476,s],[0,477,d],[0,478,y],[0,479,v],[0,sN,y],[0,481,v],[0,482,f1],[0,483,c1],[0,484,an],[0,485,W],[0,486,an],[0,487,W],[0,488,aF],[0,489,aW],[0,490,q],[0,491,c],[0,t_,q],[0,493,c],[0,494,as],[0,495,$],[0,496,bC],[0,497,uV],[0,498,ak],[0,rG,cf],[0,500,an],[0,501,W],[0,502,"HW"],[0,503,a1],[0,504,aq],[0,505,ab],[0,506,y],[0,507,v],[0,508,f1],[0,509,c1],[0,510,q],[0,511,c],[0,il,y],[0,u0,v],[0,514,y],[0,515,v],[0,516,E],[0,vr,d],[0,518,E],[0,519,d],[0,520,X],[0,521,M],[0,522,X],[0,tI,M],[0,524,q],[0,525,c],[0,526,q],[0,527,c],[0,528,ag],[0,529,p],[0,530,ag],[0,tl,p],[0,532,A],[0,533,s],[0,534,A],[0,535,s],[0,536,_],[0,537,R],[0,rZ,aH],[0,539,aj],[0,540,"GH"],[0,541,"gh"],[0,542,aA],[0,543,U],[0,sw,aq],[0,545,aa],[0,s7,"OU"],[0,547,k$],[0,548,as],[0,549,$],[0,ts,y],[0,551,v],[0,552,E],[0,tZ,d],[0,554,q],[0,555,c],[0,556,q],[0,sR,c],[0,558,q],[0,559,c],[0,tV,q],[0,561,c],[0,562,aO],[0,563,ay],[0,564,C],[0,565,ab],[0,566,aj],[0,567,bC],[0,568,"db"],[0,569,"qp"],[0,570,y],[0,lf,az],[0,572,aP],[0,573,af],[0,574,aH],[0,575,R],[0,576,$],[0,577,r7],[0,578,b1],[0,579,aZ],[0,580,A],[0,581,bu],[0,582,E],[0,583,d],[0,584,ch],[0,585,bC],[0,586,b5],[0,587,dw],[0,588,ag],[0,589,p],[0,590,aO],[0,591,ay],[0,592,v],[0,593,v],[0,594,v],[0,595,aN],[0,596,c],[0,597,aP],[0,598,aa],[0,599,aa],[0,600,d],[0,601,d],[0,602,d],[0,603,d],[0,604,d],[0,605,d],[0,606,d],[0,607,bC],[0,608,W],[0,609,W],[0,610,W],[0,611,W],[0,612,uy],[0,613,U],[0,614,U],[0,615,U],[0,616,M],[0,617,M],[0,618,M],[0,619,C],[0,620,C],[0,621,C],[0,622,e3],[0,623,a2],[0,624,a2],[0,625,a2],[0,626,ab],[0,627,ab],[0,628,ab],[0,629,c],[0,630,c7],[0,631,c],[0,632,la],[0,633,p],[0,634,p],[0,635,p],[0,636,p],[0,637,p],[0,638,p],[0,639,p],[0,640,p],[0,641,p],[0,642,R],[0,643,c5],[0,644,bC],[0,645,"{squat}"],[0,646,c5],[0,647,aj],[0,648,aj],[0,649,s],[0,650,s],[0,t8,a3],[0,652,a3],[0,653,ba],[0,r0,ay],[0,655,ay],[0,656,$],[0,657,$],[0,658,$],[0,659,$],[0,660,r7],[0,661,"{voiced}"],[0,662,b1],[0,663,aP],[0,664,cv],[0,665,aN],[0,666,d],[0,667,W],[0,668,U],[0,669,bC],[0,670,aW],[0,671,C],[0,672,dw],[0,673,b1],[0,674,b1],[0,675,cf],[0,676,cf],[0,677,cf],[0,678,b1],[0,tL,is],[0,680,rS],[0,681,lZ],[0,682,uA],[0,683,e3],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,tO,U],[0,687,U],[0,688,U],[0,689,U],[0,690,bC],[0,691,p],[0,692,p],[0,693,p],[0,694,p],[0,695,ba],[0,696,ay],[0,736,W],[0,737,C],[0,738,R],[0,739,b2],[0,740,b1],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,uY,e],[0,rT,e],[0,816,e],[0,817,e],[0,rl,e],[0,tJ,e],[0,820,e],[0,821,e],[0,t7,e],[0,tN,e],[0,824,e],[0,825,e],[0,r9,e],[0,rs,e],[0,828,e],[0,829,e],[0,830,e],[0,tk,e],[0,rI,e],[0,833,e],[0,834,e],[0,835,e],[0,uJ,e],[0,r_,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,us,e],[0,q1,e],[0,848,e],[0,849,e],[0,qZ,e],[0,ue,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,v],[0,7425,c1],[0,7426,c1],[0,7427,aN],[0,7428,aP],[0,7429,aa],[0,7430,aa],[0,7431,d],[0,7432,d],[0,7433,M],[0,7434,bC],[0,7435,aW],[0,7436,C],[0,7437,a2],[0,7438,ab],[0,7439,c],[0,7440,c],[0,7441,c],[0,7442,c],[0,7443,c],[0,7444,c7],[0,7445,k$],[0,7446,c],[0,7447,c],[0,7448,bA],[0,7449,p],[0,7450,p],[0,7451,aj],[0,7452,s],[0,7453,s],[0,7454,s],[0,7455,a2],[0,7456,a3],[0,7457,ba],[0,7458,$],[0,7459,$],[0,7460,"{spirant}"],[0,7461,c],[0,7468,v],[0,7469,c1],[0,7470,aN],[0,7471,aN],[0,7472,aa],[0,7473,d],[0,7474,d],[0,7475,W],[0,7476,U],[0,7477,M],[0,7478,bC],[0,7479,aW],[0,7480,C],[0,7481,a2],[0,7482,ab],[0,7483,ab],[0,7484,c],[0,7485,k$],[0,7486,bA],[0,7487,p],[0,7488,aj],[0,7489,s],[0,7490,ba],[0,7491,v],[0,7492,v],[0,7493,v],[0,7494,c1],[0,7495,aN],[0,7496,aa],[0,7497,d],[0,7498,d],[0,7499,d],[0,7500,d],[0,7501,W],[0,7502,M],[0,7503,aW],[0,7504,a2],[0,7505,gd],[0,7506,c],[0,7507,c],[0,7508,c],[0,7509,c],[0,7510,bA],[0,7511,aj],[0,7512,s],[0,7513,s],[0,7514,a2],[0,7515,a3],[0,7516,c],[0,7531,uU],[0,7532,aN],[0,7533,aa],[0,7534,cc],[0,7535,a2],[0,7536,ab],[0,7537,bA],[0,7538,p],[0,7539,p],[0,7540,R],[0,7541,aj],[0,7542,$],[0,7543,W],[0,7545,W],[0,7546,gc],[0,7547,M],[0,7548,M],[0,7549,bA],[0,7550,s],[0,7551,s],[0,7552,aN],[0,7553,aa],[0,7554,cc],[0,7555,W],[0,7556,aW],[0,7557,C],[0,7558,a2],[0,7559,ab],[0,7560,bA],[0,7561,p],[0,7562,R],[0,7563,c5],[0,7564,a3],[0,7565,b2],[0,7566,$],[0,7567,v],[0,7568,v],[0,7569,aa],[0,7570,d],[0,7571,d],[0,7572,d],[0,7573,d],[0,7574,M],[0,7575,c],[0,7576,c5],[0,7577,s],[0,7578,$],[0,7579,v],[0,7580,aP],[0,7581,aP],[0,7582,aa],[0,7583,d],[0,7584,cc],[0,7585,bC],[0,7586,W],[0,7587,U],[0,7588,M],[0,7589,M],[0,7590,M],[0,7591,M],[0,7592,bC],[0,7593,C],[0,7594,C],[0,7595,C],[0,7596,a2],[0,7597,a2],[0,7598,ab],[0,7599,ab],[0,7600,ab],[0,7601,c],[0,7602,la],[0,7603,R],[0,7604,c5],[0,7605,aj],[0,7606,s],[0,7607,s],[0,7608,s],[0,7609,a3],[0,7610,a3],[0,7611,$],[0,7612,$],[0,7613,$],[0,7614,$],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,ag],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,y],[0,7636,f1],[0,7637,r2],[0,7638,ll],[0,7639,az],[0,7640,ak],[0,7641,ak],[0,7642,an],[0,7643,an],[0,7644,aF],[0,7645,af],[0,7646,af],[0,7647,bj],[0,7648,aq],[0,7649,aq],[0,7650,ag],[0,7651,ag],[0,7652,_],[0,7653,_],[0,7654,as],[0,7655,y],[0,7656,aZ],[0,7657,aZ],[0,7658,E],[0,7659,bs],[0,7660,af],[0,7661,q],[0,7662,a0],[0,7663,rX],[0,7664,A],[0,7665,a1],[0,7666,y],[0,7667,q],[0,7668,A],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,y],[0,7681,v],[0,7682,aZ],[0,7683,aN],[0,7684,aZ],[0,7685,aN],[0,7686,aZ],[0,7687,aN],[0,7688,az],[0,7689,aP],[0,7690,ak],[0,7691,aa],[0,7692,ak],[0,7693,aa],[0,7694,ak],[0,7695,aa],[0,7696,ak],[0,7697,aa],[0,7698,ak],[0,7699,aa],[0,7700,E],[0,7701,d],[0,7702,E],[0,7703,d],[0,7704,E],[0,7705,d],[0,7706,E],[0,7707,d],[0,7708,E],[0,7709,d],[0,7710,bs],[0,7711,cc],[0,7712,an],[0,7713,W],[0,7714,aA],[0,7715,U],[0,7716,aA],[0,7717,U],[0,7718,aA],[0,7719,U],[0,7720,aA],[0,7721,U],[0,7722,aA],[0,7723,U],[0,7724,X],[0,7725,M],[0,7726,X],[0,7727,M],[0,7728,aF],[0,7729,aW],[0,7730,aF],[0,7731,aW],[0,7732,aF],[0,7733,aW],[0,7734,af],[0,7735,C],[0,7736,af],[0,7737,C],[0,7738,af],[0,7739,C],[0,7740,af],[0,7741,C],[0,7742,bj],[0,7743,a2],[0,7744,bj],[0,7745,a2],[0,7746,bj],[0,7747,a2],[0,7748,aq],[0,7749,ab],[0,7750,aq],[0,7751,ab],[0,7752,aq],[0,7753,ab],[0,7754,aq],[0,7755,ab],[0,7756,q],[0,7757,c],[0,7758,q],[0,7759,c],[0,7760,q],[0,7761,c],[0,7762,q],[0,7763,c],[0,7764,a0],[0,7765,bA],[0,7766,a0],[0,7767,bA],[0,7768,ag],[0,7769,p],[0,7770,ag],[0,7771,p],[0,7772,ag],[0,7773,p],[0,7774,ag],[0,7775,p],[0,7776,_],[0,7777,R],[0,7778,_],[0,7779,R],[0,7780,_],[0,7781,R],[0,7782,_],[0,7783,R],[0,7784,_],[0,7785,R],[0,7786,aH],[0,7787,aj],[0,7788,aH],[0,7789,aj],[0,7790,aH],[0,7791,aj],[0,7792,aH],[0,7793,aj],[0,7794,A],[0,7795,s],[0,7796,A],[0,7797,s],[0,7798,A],[0,7799,s],[0,7800,A],[0,7801,s],[0,7802,A],[0,7803,s],[0,7804,bu],[0,7805,a3],[0,7806,bu],[0,7807,a3],[0,7808,a1],[0,7809,ba],[0,7810,a1],[0,7811,ba],[0,7812,a1],[0,7813,ba],[0,7814,a1],[0,7815,ba],[0,7816,a1],[0,7817,ba],[0,7818,cg],[0,7819,b2],[0,7820,cg],[0,7821,b2],[0,7822,aO],[0,7823,ay],[0,7824,as],[0,7825,$],[0,7826,as],[0,7827,$],[0,7828,as],[0,7829,$],[0,7830,U],[0,7831,aj],[0,7832,ba],[0,7833,ay],[0,7834,v],[0,7835,R],[0,7836,R],[0,7837,R],[0,7838,_],[0,7839,aa],[0,7840,y],[0,7841,v],[0,7842,y],[0,7843,v],[0,7844,y],[0,7845,v],[0,7846,y],[0,7847,v],[0,7848,y],[0,7849,v],[0,7850,y],[0,7851,v],[0,7852,y],[0,7853,v],[0,7854,y],[0,7855,v],[0,7856,y],[0,7857,v],[0,7858,y],[0,7859,v],[0,7860,y],[0,7861,v],[0,7862,y],[0,7863,v],[0,7864,E],[0,7865,d],[0,7866,E],[0,7867,d],[0,7868,E],[0,7869,d],[0,7870,E],[0,7871,d],[0,7872,E],[0,7873,d],[0,7874,E],[0,7875,d],[0,7876,E],[0,7877,d],[0,7878,E],[0,7879,d],[0,7880,X],[0,7881,M],[0,7882,X],[0,7883,M],[0,7884,q],[0,7885,c],[0,7886,q],[0,7887,c],[0,7888,q],[0,7889,c],[0,7890,q],[0,7891,c],[0,7892,q],[0,7893,c],[0,7894,q],[0,7895,c],[0,7896,q],[0,7897,c],[0,7898,q],[0,7899,c],[0,7900,q],[0,7901,c],[0,7902,q],[0,7903,c],[0,7904,q],[0,7905,c],[0,7906,q],[0,7907,c],[0,7908,A],[0,7909,s],[0,7910,A],[0,7911,s],[0,7912,A],[0,7913,s],[0,7914,A],[0,7915,s],[0,7916,A],[0,7917,s],[0,7918,A],[0,7919,s],[0,7920,A],[0,7921,s],[0,7922,aO],[0,7923,ay],[0,7924,aO],[0,7925,ay],[0,7926,aO],[0,7927,ay],[0,7928,aO],[0,7929,ay],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bu],[0,7933,a3],[0,7934,aO],[0,7935,ay],[0,8305,M],[0,8319,ab],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aP],[0,9372,y],[0,9373,aZ],[0,9374,az],[0,9375,ak],[0,9376,E],[0,9377,bs],[0,9378,an],[0,9379,aA],[0,9380,X],[0,9381,ch],[0,9382,aF],[0,9383,af],[0,9384,bj],[0,9385,aq],[0,9386,q],[0,9387,a0],[0,9388,b5],[0,9389,ag],[0,9390,_],[0,9391,aH],[0,9392,A],[0,9393,bu],[0,9394,a1],[0,9395,cg],[0,9396,aO],[0,9397,as],[0,9398,y],[0,9399,aZ],[0,9400,az],[0,9401,ak],[0,9402,E],[0,9403,bs],[0,9404,an],[0,9405,aA],[0,9406,X],[0,9407,ch],[0,9408,aF],[0,9409,af],[0,9410,bj],[0,9411,aq],[0,9412,q],[0,9413,a0],[0,9414,b5],[0,9415,ag],[0,9416,_],[0,9417,aH],[0,9418,A],[0,9419,bu],[0,9420,a1],[0,9421,cg],[0,9422,aO],[0,9423,as],[0,9424,v],[0,9425,aN],[0,9426,aP],[0,9427,aa],[0,9428,d],[0,9429,cc],[0,9430,W],[0,9431,U],[0,9432,M],[0,9433,bC],[0,9434,aW],[0,9435,C],[0,9436,a2],[0,9437,ab],[0,9438,c],[0,9439,bA],[0,9440,dw],[0,9441,p],[0,9442,R],[0,9443,aj],[0,9444,s],[0,9445,a3],[0,9446,ba],[0,9447,b2],[0,9448,ay],[0,9449,$],[0,11360,af],[0,11361,C],[0,11362,af],[0,11363,a0],[0,11364,ag],[0,11365,v],[0,11366,aj],[0,11367,aA],[0,11368,U],[0,11369,aF],[0,11370,aW],[0,11371,as],[0,11372,$],[0,11373,y],[0,11374,bj],[0,11375,y],[0,11376,y],[0,11377,a3],[0,11378,a1],[0,11379,ba],[0,11380,a3],[0,11381,aA],[0,11382,U],[0,11383,la],[0,11384,d],[0,11385,p],[0,11386,c],[0,11387,d],[0,11389,a3],[0,11390,_],[0,11391,as],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,q],[0,42789,c],[0,42790,aA],[0,42791,U],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,r1],[0,42795,r1],[0,42796,iv],[0,42797,iv],[0,42798,iv],[0,42799,iv],[0,42800,cc],[0,42801,R],[0,42802,"AA"],[0,42803,te],[0,42804,r2],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,ll],[0,42809,vm],[0,42810,ll],[0,42811,vm],[0,42812,"AY"],[0,42813,"ay"],[0,42814,az],[0,42815,aP],[0,42816,aF],[0,42817,aW],[0,42818,aF],[0,42819,aW],[0,42820,aF],[0,42821,aW],[0,42822,af],[0,42823,C],[0,42824,af],[0,42825,C],[0,42826,q],[0,42827,c],[0,42828,q],[0,42829,c],[0,42830,"OO"],[0,42831,"oo"],[0,42832,a0],[0,42833,bA],[0,42834,a0],[0,42835,bA],[0,42836,a0],[0,42837,bA],[0,42838,b5],[0,42839,dw],[0,42840,b5],[0,42841,dw],[0,42842,ag],[0,42843,p],[0,42844,ag],[0,42845,p],[0,42846,bu],[0,42847,a3],[0,42848,"VY"],[0,42849,"vy"],[0,42850,as],[0,42851,$],[0,42852,lz],[0,42853,gc],[0,42854,lz],[0,42855,gc],[0,42856,bu],[0,42857,a3],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,p],[0,42870,p],[0,42871,"tum"],[0,42872,"um"],[0,42873,ak],[0,42874,aa],[0,42875,bs],[0,42876,cc],[0,42877,an],[0,42878,an],[0,42879,W],[0,42880,af],[0,42881,C],[0,42882,ag],[0,42883,p],[0,42884,_],[0,42885,R],[0,42886,aH],[0,42887,aj],[0,42891,id],[0,42892,id],[0,42893,aA],[0,42894,C],[0,42895,vk],[0,42896,aq],[0,42897,ab],[0,42898,az],[0,42899,aP],[0,42900,aP],[0,42901,U],[0,42902,aZ],[0,42903,aN],[0,42904,bs],[0,42905,cc],[0,42906,f1],[0,42907,c1],[0,42908,st],[0,42909,c7],[0,42910,"UE"],[0,42911,uU],[0,42912,an],[0,42913,W],[0,42914,aF],[0,42915,aW],[0,42916,aq],[0,42917,ab],[0,42918,ag],[0,42919,p],[0,42920,_],[0,42921,R],[0,42922,aA],[0,42923,E],[0,42924,an],[0,42925,af],[0,42926,X],[0,42927,dw],[0,42928,aF],[0,42929,aH],[0,42930,ch],[0,42931,cg],[0,42932,aZ],[0,42933,aN],[0,42934,q],[0,42935,c],[0,42936,A],[0,42937,s],[0,42938,y],[0,42939,v],[0,42940,X],[0,42941,M],[0,42942,A],[0,42943,s],[0,42944,q],[0,42945,c],[0,42946,a1],[0,42947,ba],[0,42948,az],[0,42949,_],[0,42950,as],[0,42951,ak],[0,42952,aa],[0,42953,_],[0,42954,R],[0,42960,an],[0,42961,W],[0,42963,gc],[0,42965,ba],[0,42966,_],[0,42967,R],[0,42968,_],[0,42969,R],[0,42994,az],[0,42995,bs],[0,42996,b5],[0,42997,aA],[0,42998,U],[0,42999,X],[0,43000,U],[0,43001,"{letter}"],[0,43002,a2],[0,43003,bs],[0,43004,a0],[0,43005,bj],[0,43006,X],[0,43007,bj],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,v],[0,43825,v],[0,43826,d],[0,43827,d],[0,43828,d],[0,43829,cc],[0,43830,W],[0,43831,C],[0,43832,C],[0,43833,C],[0,43834,a2],[0,43835,ab],[0,43836,gd],[0,43837,c],[0,43838,c],[0,43839,c],[0,43840,c7],[0,43841,c7],[0,43842,c7],[0,43843,c],[0,43844,c],[0,43845,p],[0,43846,p],[0,43847,p],[0,43848,p],[0,43849,p],[0,43850,p],[0,43851,p],[0,43852,p],[0,43853,c5],[0,43854,s],[0,43855,s],[0,43856,ru],[0,43857,ru],[0,43858,s],[0,43859,b2],[0,43860,b2],[0,43861,b2],[0,43862,b2],[0,43863,b2],[0,43864,b2],[0,43865,b2],[0,43866,ay],[0,43868,U],[0,43869,C],[0,43870,C],[0,43871,s],[0,43872,"wa"],[0,43873,d],[0,43874,c7],[0,43875,"uo"],[0,43876,v],[0,43878,cf],[0,43879,b1],[0,43880,p],[0,43881,ba],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,R],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,y],[0,65314,aZ],[0,65315,az],[0,65316,ak],[0,65317,E],[0,65318,bs],[0,65319,an],[0,65320,aA],[0,65321,X],[0,65322,ch],[0,65323,aF],[0,65324,af],[0,65325,bj],[0,65326,aq],[0,65327,q],[0,65328,a0],[0,65329,b5],[0,65330,ag],[0,65331,_],[0,65332,aH],[0,65333,A],[0,65334,bu],[0,65335,a1],[0,65336,cg],[0,65337,aO],[0,65338,as],[0,65345,v],[0,65346,aN],[0,65347,aP],[0,65348,aa],[0,65349,d],[0,65350,cc],[0,65351,W],[0,65352,U],[0,65353,M],[0,65354,bC],[0,65355,aW],[0,65356,C],[0,65357,a2],[0,65358,ab],[0,65359,c],[0,65360,bA],[0,65361,dw],[0,65362,p],[0,65363,R],[0,65364,aj],[0,65365,s],[0,65366,a3],[0,65367,ba],[0,65368,b2],[0,65369,ay],[0,65370,$],[0,66045,e],[0,67456,te],[0,67457,qP],[0,67458,qP],[0,67459,c1],[0,67460,aN],[0,67461,aN],[0,67463,cf],[0,67464,cf],[0,67465,cf],[0,67466,cf],[0,67467,aa],[0,67468,aa],[0,67469,aa],[0,67470,d],[0,67471,d],[0,67472,lZ],[0,67473,uy],[0,67474,W],[0,67475,W],[0,67476,W],[0,67477,U],[0,67478,U],[0,67479,U],[0,67480,bC],[0,67481,uA],[0,67482,e3],[0,67483,C],[0,67484,C],[0,67485,C],[0,67486,e3],[0,67487,e3],[0,67488,ay],[0,67489,ay],[0,67490,c],[0,67491,c7],[0,67492,c],[0,67493,dw],[0,67494,p],[0,67495,p],[0,67496,p],[0,67497,p],[0,67498,p],[0,67499,rS],[0,67500,b1],[0,67501,b1],[0,67502,is],[0,67503,aj],[0,67504,a3],[0,67506,ay],[0,67507,b1],[0,67508,b1],[0,67509,cv],[0,67510,cv],[0,67511,cv],[0,67512,cv],[0,67513,cv],[0,67514,R],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,lZ],[0,122625,W],[0,122626,W],[0,122627,aW],[0,122628,C],[0,122629,e3],[0,122630,ay],[0,122631,gd],[0,122632,p],[0,122633,aj],[0,122634,cv],[0,122635,c5],[0,122636,c5],[0,122637,aj],[0,122638,b1],[0,122639,aP],[0,122640,aW],[0,122641,C],[0,122642,cf],[0,122643,C],[0,122644,gd],[0,122645,p],[0,122646,p],[0,122647,is],[0,122648,$],[0,122649,cf],[0,122650,M],[0,122651,c],[0,122652,is],[0,122653,aP],[0,122654,R],[0,122661,aa],[0,122662,C],[0,122663,ab],[0,122664,p],[0,122665,R],[0,122666,aj],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,y],[0,127249,aZ],[0,127250,az],[0,127251,ak],[0,127252,E],[0,127253,bs],[0,127254,an],[0,127255,aA],[0,127256,X],[0,127257,ch],[0,127258,aF],[0,127259,af],[0,127260,bj],[0,127261,aq],[0,127262,q],[0,127263,a0],[0,127264,b5],[0,127265,ag],[0,127266,_],[0,127267,aH],[0,127268,A],[0,127269,bu],[0,127270,a1],[0,127271,cg],[0,127272,aO],[0,127273,as],[0,127274,_],[0,127275,az],[0,127276,ag],[0,127280,y],[0,127281,aZ],[0,127282,az],[0,127283,ak],[0,127284,E],[0,127285,bs],[0,127286,an],[0,127287,aA],[0,127288,X],[0,127289,ch],[0,127290,aF],[0,127291,af],[0,127292,bj],[0,127293,aq],[0,127294,q],[0,127295,a0],[0,127296,b5],[0,127297,ag],[0,127298,_],[0,127299,aH],[0,127300,A],[0,127301,bu],[0,127302,a1],[0,127303,cg],[0,127304,aO],[0,127305,as],[0,127312,y],[0,127313,aZ],[0,127314,az],[0,127315,ak],[0,127316,E],[0,127317,bs],[0,127318,an],[0,127319,aA],[0,127320,X],[0,127321,ch],[0,127322,aF],[0,127323,af],[0,127324,bj],[0,127325,aq],[0,127326,q],[0,127327,a0],[0,127328,b5],[0,127329,ag],[0,127330,_],[0,127331,aH],[0,127332,A],[0,127333,bu],[0,127334,a1],[0,127335,cg],[0,127336,aO],[0,127337,as],[0,127344,y],[0,127345,aZ],[0,127346,az],[0,127347,ak],[0,127348,E],[0,127349,bs],[0,127350,an],[0,127351,aA],[0,127352,X],[0,127353,ch],[0,127354,aF],[0,127355,af],[0,127356,bj],[0,127357,aq],[0,127358,q],[0,127359,a0],[0,127360,b5],[0,127361,ag],[0,127362,_],[0,127363,aH],[0,127364,A],[0,127365,bu],[0,127366,a1],[0,127367,cg],[0,127368,aO],[0,127369,as],[0,127370,a0],[0,127397,ak],[0,917569,y],[0,917570,aZ],[0,917571,az],[0,917572,ak],[0,917573,E],[0,917574,bs],[0,917575,an],[0,917576,aA],[0,917577,X],[0,917578,ch],[0,917579,aF],[0,917580,af],[0,917581,bj],[0,917582,aq],[0,917583,q],[0,917584,a0],[0,917585,b5],[0,917586,ag],[0,917587,_],[0,917588,aH],[0,917589,A],[0,917590,bu],[0,917591,a1],[0,917592,cg],[0,917593,aO],[0,917594,as],[0,917601,y],[0,917602,aZ],[0,917603,az],[0,917604,ak],[0,917605,E],[0,917606,bs],[0,917607,an],[0,917608,aA],[0,917609,X],[0,917610,ch],[0,917611,aF],[0,917612,af],[0,917613,bj],[0,917614,aq],[0,917615,q],[0,917616,a0],[0,917617,b5],[0,917618,ag],[0,917619,_],[0,917620,aH],[0,917621,A],[0,917622,bu],[0,917623,a1],[0,917624,cg],[0,917625,aO],[0,917626,as]]),MO=bK,MN=iJ([[0,170,v],[0,rc,c],[0,sf,"ss"],[0,8208,cx],[0,8211,cx],[0,8212,cx],[0,8216,id],[0,8217,id],[0,8220,dB],[0,8221,dB],[0,8230,"..."],[0,8722,cx]]),MV="?",M4=[0,e],M0=[1,[0,sr,rq]],MY=[0,1],M5=[0,"lib/codec.ml",32,4],M8="Yojson__Common.Json_error",M_="Yojson__Common.End_of_array",M$="Yojson__Common.End_of_object",Na="Yojson__Common.End_of_tuple",Nb="Yojson__Common.End_of_input",Nd=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Ov=[0,bB,1],Ow=[0,bB,0],Ox=b3,Oy="Invalid token",Oz=b3,OA="Invalid escape sequence",OB=b3,OC="Invalid low surrogate for code point beyond U+FFFF",OD="Missing escape sequence representing low surrogate for code point beyond U+FFFF",OE=b3,OF="Expected ':' or '>' but found",OG=b3,OH="Expected '>' but found",OI=b3,OJ="Unterminated comment",OK="Expected string or identifier but found",OL=b3,OM="Expected ',' or ']' but found",ON=b3,OO="Expected ',' or ')' but found",OP=b3,OQ="Expected ',' or '}' but found",OR=b3,OS="Expected ':' but found",OT=b3,Pd="Expected string, got ",Pc="Expected object, got ",O2=f$,O4=iy,O5="floatlit",O6=ip,O7="tuple",O3="bool",O9="variant",O_="float",O$="int",Pa=lm,O8="intlit",OY="Blank input data",OV="Junk after end of JSON value:",N3=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],NY=[0,[11,"File ",[2,0,[11,qM,0]]],"File %s, line"],N2="Line",NZ=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],N1=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],N0=[0,[2,0,[12,32,[4,3,0,0,[11,lQ,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],NX=[0,"lib/read.mll",41,13],NW=e,NU=e,NG="NaN value not allowed in standard JSON",NH=[0,[8,[0,0,3],0,[0,16],0],vn],NJ=[0,[8,[0,0,3],0,[0,17],0],uv],NI=va,NE="Infinity value not allowed in standard JSON",NF="-Infinity value not allowed in standard JSON",Nz="NaN",NA=[0,[8,[0,0,3],0,[0,16],0],vn],NC=[0,[8,[0,0,3],0,[0,17],0],uv],NB=va,Nx="Infinity",Ny="-Infinity",Nt=eb,Nu=gh,Ns=f$,Nm=ig,Nn=iq,No=h_,Np="\\f",Nq=h2,Nr=lV,Nl=ic,Nj=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,kX,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],Nh="\\u00",N4="Yojson__Safe.Int_overflow",OZ="Yojson__Safe.Util.Type_error",Pi="list_of_yojson: list needed",Ph="int_of_yojson: integer needed",Pg="string_of_yojson: string needed",Pe="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",Pw=bK,Py="_of_yojson: list instead of atom for record expected",Px=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Pu="extra fields",Pt="duplicate fields",Pr=bK,Ps=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,h9,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Pq="_of_yojson: unexpected variant constructor",Pp="_of_yojson: expected a variant type, saw an empty list",Po="_of_yojson: expected a variant type, saw a nested list",Pn="_of_yojson: this constructor requires arguments",Pl=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Pj="_of_yojson: this constructor does not take arguments",Rk="An error occured while decoding response: ",Rf=[0,[11,", Token=",[3,0,0]],", Token=%S"],Ri=e,Rg=e,Rh=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],Ra=rt,Rb=vo,Rc=c6,Q8="item_id",Q9="locations",Q_=bk,Q6=th,QW=tp,QX=s4,QY=rU,QZ=eY,Q0=rn,Q1=sE,Q2=tS,Q3=e2,Q4=uk,Q5=c6,QQ="type_",QR="image_blur_hashes",QS=e5,QT=bI,QU=bk,QO=[0,"lib/data_source/jellyfin_api.ml",uT,64],Qb=[0,r,[0,[0,o,vh],0]],Qc=[0,r,[0,[0,o,uQ],0]],Qd=[0,r,[0,[0,o,sI],0]],Qe=[0,r,[0,[0,o,sa],0]],Qf=[0,r,[0,[0,o,rr],0]],Qg=[0,r,[0,[0,o,rD],0]],Qh=[0,r,[0,[0,o,ss],0]],Qi=[0,r,[0,[0,o,rN],0]],Qj=[0,r,[0,[0,o,tE],0]],Qk=[0,r,[0,[0,o,uW],0]],Ql=[0,r,[0,[0,o,uZ],0]],Qm=[0,r,[0,[0,o,s0],0]],Qn=[0,r,[0,[0,o,vi],0]],Qo=[0,r,[0,[0,o,re],0]],Qp=[0,r,[0,[0,o,rj],0]],Qq=[0,r,[0,[0,o,vd],0]],Qr=[0,r,[0,[0,o,ug],0]],Qs=[0,r,[0,[0,o,rO],0]],Qt=[0,r,[0,[0,o,tw],0]],Qu=[0,r,[0,[0,o,sn],0]],Qv=[0,r,[0,[0,o,qY],0]],Qw=[0,r,[0,[0,o,uN],0]],Qx=[0,r,[0,[0,o,uL],0]],Qy=[0,r,[0,[0,o,q$],0]],Qz=[0,r,[0,[0,o,uo],0]],QA=[0,r,[0,[0,o,tb],0]],QB=[0,r,[0,[0,o,u$],0]],QC=[0,r,[0,[0,o,rw],0]],QD=[0,r,[0,[0,o,rh],0]],QE=[0,r,[0,[0,o,se],0]],QF=[0,r,[0,[0,o,to],0]],QG=[0,r,[0,[0,o,rY],0]],QH=[0,r,[0,[0,o,sO],0]],QI=[0,r,[0,[0,o,rk],0]],QJ=[0,r,[0,[0,o,ro],0]],QK=[0,r,[0,[0,o,ux],0]],QL=[0,r,[0,[0,o,rL],0]],P_=vg,P6=e2,P7=c6,P3=bI,P4=bk,PZ=[0,"Users",[0,"AuthenticateByName",0]],PU=eY,PV=u_,PW=ti,PQ=e5,PR="access_token",PS="user",PN=td,PO=r3,PK="pw",PL="username",PF=e2,PG=sX,PH=eY,PI=c6,PB=bI,PC=e5,PD=bk,RT=e5,RU=ea,RV=c4,RW=lS,RX=bI,RN=e5,RO=ea,RP=c4,RQ=lS,RR=bI,RJ=ea,RK=c4,RL=bI,RF=ea,RG=c4,RH=bI,RC=lq,RD=bk,Rz=lq,RA=bk,Rw=bk,Rx=bI,Rt=bk,Ru=bI,Rr=[0,o,k_],SB=[0,ed,u8,15],Sx=[0,ed,lE,15],Sj=[0,ed,141,11],Sf=[0,ed,96,13],Se=[0,ed,87,19],Sd=[0,ed,81,13],Sc=[0,ed,75,19],R$=ia,Sa=lr,R8=ia,R9=lr,R4=c4,R5=lX,R6=d7,R0=c4,R1=lX,R2=d7,RY="items_by_date_added",Sg="items",Sh="virtual_folders",Sq="collections",St=ea,Sw="albums",SA="tracks",SM=[0,[2,0,[15,0]],"%s%a"],SK=[0,[12,40,[4,3,0,0,[12,47,[4,3,0,0,[12,41,0]]]]],"(%i/%i)"],SE="Unknown",SF=t3,SG="Inconsistent",SH=[0,[11,"New items: last: ",[4,3,0,0,[11," missing: ",[4,3,0,0,[11,sb,[4,3,0,0,0]]]]]],"New items: last: %i missing: %i unfetched: %i"],SI=[0,[11,"Partial: last: ",[4,3,0,0,[11,sb,[4,3,0,0,0]]]],"Partial: last: %i unfetched: %i"],ST=[0,[11,"Server ",[2,0,[11,h9,[15,0]]]],"Server %s: %a"],SQ="./db_worker.bc.js",SR=e,Tj="GOT L=",Ti=[2,0],Th=[0,"NEW REF",0],Td=t3,Tb=[0,[11,"Sync in progress: ",[4,3,0,0,[12,47,[4,3,0,0,0]]]],"Sync in progress: %i/%i"],Tc="Desynchronized",S8=lR,S$=lR,S9=lR,S_=e,SU="ui_servers",SW=[0,0,0,0],SX=[0,"https://demo.jellyfin.org/stable"],SY=[0,1],S0=[0,"demo"],S1=[0,1],S3=[0,0],S5=[0,80,"Connect"],TC=r8,Tx=[0,[2,0,[11,ik,[2,0,[11,ur,0]]]],tW],Tz=ld,Ty=[0,[11,tG,[3,0,[12,41,0]]],q7],Tv="A playback error happened. This is probably due to a codec unsupported by the browser.",Tw=[0,80,"NEXT"],TA=[0,80,"now-playing-cover"],TB=[0,80,"now-playing-details"],TD=[0,80,sp],TE=[0,80,"now-playing-display"],TF=[0,80,"player-wrapper"],TG=[0,80,sp],Tp="Now playing:",Tq=[0,[2,0,[11,ik,[2,0,[11,ur,0]]]],tW],Tr=e,Ts=e,Tt="image/jpeg",Tu="500x500",Tn=[0,[2,0,[11,"/Audio/",[2,0,[11,"/universal?api_key=",[2,0,[11,"&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls",0]]]]]],"%s/Audio/%s/universal?api_key=%s&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls"],T8=[0,[4,3,0,0,[11," results",0]],"%i results"],T5=[0,25],T1=[0,25],TO=[0,h7,0],TP=[0,uR,0],TI=e,TJ=d7,TK=it,TL=e,TM=[0,[0,0,0,0,0],0,0],TR="library-selection",TU="+classi -opera",TV=[0,"genre-formula",0,0],TY=[0,"pouet",0,0],T0=[0,[0,d7,"Date added"],[0,[0,bk,c6],0]],T2=[0,"view-sort",d7,0],T4=[0,[0,tA,"Asc"],[0,[0,it,"Desc"],[0,[0,t$,"Random"],0]]],T6=[0,"view-order",it,0],T$=[0,80,[0,"vertical-picker"]],Ub=[0,80,[0,"genres-picker"]],Ud="Filter by genre: ",Uf=[0,80,[0,"filters-row"]],Ui=[0,80,[0,"filters-container"]],Uw="|>",Uv=[0,[2,0,[11,ik,[2,0,[11,"/Images/Primary?width=50",0]]]],"%s/Items/%s/Images/Primary?width=50"],Uu="server-error.png",Ux=[2,4.],Ul=sJ,Um="1fr",Un=sJ,Uo=uw,Up=tB,Uq=uw,Ur="#",Us=tB,Ut="Order",UZ="Persist ?",UN=[0,[2,0,[11,ik,[2,0,[11,"/Images/Primary?width=800&format=Jpg",0]]]],"%s/Items/%s/Images/Primary?width=800&format=Jpg"],UP=ld,UO=[0,[11,tG,[3,0,[12,41,0]]],q7],UK=r8,Uz="session_uuid",UB="Welcome to OCAMIX",UW=[0,"main-layout"];function -av(a){if(typeof +Yq(){var +c=U.process;if(c&&c.on)c.on("uncaughtException",function(a,b){wf(a);c.exit(2)});else if(U.addEventListener)U.addEventListener(gr,function(a){if(a.error)wf(a.error)})}Yq();function +h(a,b){return(a.l>=0?a.l:a.l=a.length)===1?a(b):dd(a,[b])}function +i(a,b,c){return(a.l>=0?a.l:a.l=a.length)===2?a(b,c):dd(a,[b,c])}function +bH(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)===3?a(b,c,d):dd(a,[b,c,d])}function +f$(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)===4?a(b,c,d,e):dd(a,[b,c,d,e])}function +d$(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)===5?a(b,c,d,e,f):dd(a,[b,c,d,e,f])}function +Xf(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)===7?a(b,c,d,e,f,g,h):dd(a,[b,c,d,e,f,g,h])}var +YC=0;XE();var +i7=[B,vY,-1],mK=[B,t6,-2],dT=[B,mf,-3],i6=[B,tS,-4],br=[B,u4,-7],mI=[B,vW,-8],mJ=[B,ul,-9],f=[B,ut,-11],mL=[B,uD,-12],jg=[0,e,0,0,-1],nb=[0,e,1,0,0],W5=[4,0,0,0,[12,45,[4,0,0,0,0]]],jt=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,tB,[4,0,0,0,[12,45,[4,0,0,0,[11,ln,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],pj=[0,0],W6=[17,[0,a,1,0],[11,rW,[17,0,0]]],W7=[17,[0,a,1,0],[12,40,0]],W8=[11,"('\"'",[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,rm,[17,0,0]]]]]],W9=[0,a,1,0],W_=[11,sY,[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,rm,[17,0,0]]]]]],W$=[0,a,1,0],Xa=[11,dH,[17,[0,a,1,0],[11,vU,[17,0,0]]]],Xb=[0,a,1,0],Xc=[11,sY,[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,vU,[17,0,0]]]]]],Xd=[0,a,1,0],Xe=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],p3=[0,ak,[0,cw,-991563951]],p4=[0,ak,[0,cw,tx]],qf=iY([9,10,11,12,13,32,l6,rr,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,ti,8233,8239,8287,12288]),bk=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],hY="lib/data_source/jellyfin_api.ml.user",hZ="lib/data_source/jellyfin_api.ml.Authenticate_by_name.params",h0="lib/data_source/jellyfin_api.ml.Authenticate_by_name.response",h1="lib/data_source/jellyfin_api.ml.Item.genre_item",kX="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",D="lib/data_source/jellyfin_api.ml.Item.type_",h2="lib/data_source/jellyfin_api.ml.Item.external_url",h3="lib/data_source/jellyfin_api.ml.Item.t",h4="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",f6="lib/db/generic_schema.ml.Id.t",h5="lib/db/generic_schema.ml.Collection.t",h6="lib/db/generic_schema.ml.Artist.t",h7="lib/db/generic_schema.ml.Genre.t",h8="lib/db/generic_schema.ml.Album.t",h9="lib/db/generic_schema.ml.Track.t",ib="lib/db/stores.ml.Items.sorts",ic="lib/db/stores.ml.Items.t",qL=[0,0,0];co(11,mL,uD);co(10,f,ut);co(9,[B,uv,rR],uv);co(8,mJ,ul);co(7,mI,vW);co(6,br,u4);co(5,[B,sU,-6],sU);co(4,[B,uc,-5],uc);co(3,i6,tS);co(2,dT,mf);co(1,mK,t6);co(0,i7,vY);var +w2=im,w0="output_substring",wX=dI,wU=ei,wV=gx,wJ="Stdlib.Exit",wN=bz(0,0,32752),wP=bz(0,0,65520),wR=bz(1,0,32760),w6="CamlinternalLazy.Undefined",xb="option is None",xf=iv,xg="\\'",xh=iy,xi=iG,xj=ir,xk=ij,xd="Char.chr",xp=" is not an Unicode scalar value",xB="List.init",xy="hd",x6=[0,sC,so,20],x5=[0,sC,ud,9],xP="String.blit / Bytes.blit_string",xO="Bytes.blit",xN="String.sub / Bytes.sub",yh="String.contains_from / Bytes.contains_from",yf="String.index_from / Bytes.index_from",x$=e,x8="String.concat",ys="Array.iter2: arrays must have the same length",yp="Array.blit",yo="Array.sub",ym="Array.init",yF=[0,"set.ml",lw,18],yB=io,yC=io,yD=io,yE=io,yL="Map.remove_min_elt",yH=iH,yI=iH,yJ=iH,yK=iH,yM="Stdlib.Stack.Empty",yQ="Stdlib.Queue.Empty",yY="Buffer.add_substring/add_subbytes",yX="Buffer.add: cannot grow buffer",yV="Buffer.sub",y6="first domain already spawned",y3=[0,"domain.ml",184,13],zf=t$,zg=tA,zh=u6,zi=tO,zj=v1,zk=u2,zl="%f",zm="%B",zn="%{",zo="%}",zp="%(",zq="%)",zr=v0,zs="%t",zt="%?",zu="%r",zv="%_r",zw=[0,a0,ro,23],zH=[0,a0,vm,21],zz=[0,a0,si,21],zI=[0,a0,rN,21],zA=[0,a0,ub,21],zJ=[0,a0,ux,19],zB=[0,a0,uf,19],zK=[0,a0,sy,22],zC=[0,a0,rU,22],zL=[0,a0,tM,30],zD=[0,a0,r9,30],zF=[0,a0,u_,26],zx=[0,a0,sz,26],zG=[0,a0,uT,28],zy=[0,a0,rq,28],zE=[0,a0,uG,23],AX=[0,a0,1558,4],AY="Printf: bad conversion %[",AZ=[0,a0,1626,39],A0=[0,a0,1649,31],A1=[0,a0,1650,31],A2="Printf: bad conversion %_",A3=t0,A4=r5,A5=t0,A6=r5,A9=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],A8=[0,0,4],AS=lc,AQ="neg_infinity",AR=t9,AP=dI,AK=[0,ih],Ay="%+nd",Az="% nd",AB="%+ni",AC="% ni",AD="%nx",AE="%#nx",AF="%nX",AG="%#nX",AH="%no",AI="%#no",Ax="%nd",AA=v1,AJ="%nu",Ak="%+ld",Al="% ld",An="%+li",Ao="% li",Ap="%lx",Aq="%#lx",Ar="%lX",As="%#lX",At="%lo",Au="%#lo",Aj="%ld",Am=tO,Av="%lu",z8="%+Ld",z9="% Ld",z$="%+Li",Aa="% Li",Ab="%Lx",Ac="%#Lx",Ad="%LX",Ae="%#LX",Af="%Lo",Ag="%#Lo",z7="%Ld",z_=u2,Ah="%Lu",zU="%+d",zV="% d",zX="%+i",zY="% i",zZ="%x",z0="%#x",z1=vB,z2="%#X",z3="%o",z4="%#o",zT=lb,zW=u6,z5=rK,y9="@]",y_="@}",y$="@?",za="@\n",zb="@.",zc="@@",zd="@%",ze="@",zM="CamlinternalFormat.Type_mismatch",Bc=e,Bd=[0,[11,l7,[2,0,[2,0,0]]],", %s%s"],BP=[0,[11,lZ,[2,0,[12,10,0]]],rO],BQ=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],BO="Fatal error: out of memory in uncaught exception handler",BL=[0,[11,lZ,[2,0,[12,10,0]]],rO],BF=[0,[2,0,[12,10,0]],"%s\n"],BG=[0,[11,ry,0],ry],Bu="Raised at",Bv="Re-raised at",Bw="Raised by primitive operation at",Bx="Called from",By=[0,[12,32,[4,0,0,0,0]]," %d"],BC=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],Bz=" (inlined)",BB=e,BA=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,ra,[2,0,[11,tB,W5]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],BD=[0,[2,0,[11," unknown location",0]],"%s unknown location"],Bn="Out of memory",Bo="Stack overflow",Bp="Pattern matching failed",Bq="Assertion failed",Br="Undefined recursive module",Bf=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],Bg=e,Bh=e,Bi=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],Bb=[0,[4,0,0,0,0],lb],A$=[0,[3,0,0],"%S"],Ba=lH,BI=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],BU="Fun.Finally_raised: ",BS="Stdlib.Fun.Finally_raised",BV="Digest.BLAKE2: wrong hash size",Cb=bz(14371852,15349651,22696),Cc=bz(12230193,11438743,35013),Cd=bz(1424933,15549263,2083),Ce=bz(9492471,4696708,43520),Ca="Random.int",BZ=bz(1,0,0),B0=bz(0,0,0),B3=bz(1,0,0),B1=bz(0,0,0),B2=bz(2,0,0),Co="Hashtbl: unsupported hash table format",Ci=e,C8=[3,0,3],C9=dI,C3=uw,C4="<\/",C5=e,CZ=uw,C0="<",C1=e,CX="\n",CT=e,CU=e,CV=e,CW=e,CI=[0,e],CD=e,CE=e,CF=e,CG=e,Cz=[0,e,0,e],Cv="Stdlib.Format.String_tag",Df="Jsoo_runtime.Error.Exn",Dg=lg,Dk=[0,at,157,10],Dm=[0,at,179,10],Do=[0,at,gi,10],Dr=[0,at,lL,17],DB=[0,at,tm,16],DC=[0,at,s6,18],DD=[0,at,te,15],DE=[0,at,sX,15],DF=[0,at,tv,15],DG=[0,at,ts,10],DH=[0,at,tH,16],DI=[0,at,vT,12],DJ=[0,at,vR,14],DU=[0,at,ug,27],DT=[0,at,uy,27],DN=[0,at,un,16],DK=[0,at,tV,23],DL=[0,at,sW,14],DA=[0,at,tW,9],Dv=[0,at,vw,9],Du=[0,at,vv,9],Dt=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],Dq=[0,at,lQ,14],Dn=[0,at,rE,14],Dl=[0,at,169,14],Dj=[0,at,us,14],DO="Lwd.Release_failure",D0=[0,O,64,12],Eb=[0,O,uu,18],Ea=[0,O,lL,9],Ed=[0,O,ek,18],Ec=[0,O,gj,9],Ee=[0,O,ef,21],Ef=[0,O,cN,21],Eg=[0,O,sc,21],Ei=[0,O,lp,14],EH=[0,O,uq,18],EI=[0,O,tg,12],EJ=[0,O,tw,14],EG=[0,O,sn,21],EE=[0,O,tN,14],ED=[0,O,ua,14],EB=[0,O,uA,29],EA=[0,O,r7,29],Ey=[0,O,rx,21],Et=[0,O,rc,10],Eu=[0,O,rI,15],Ev=[0,O,rs,10],Ew=[0,O,ri,2],Eo=[0,O,sa,24],Ep=[0,O,r0,16],Eq=[0,O,u8,2],El=[0,O,rC,18],Ek=[0,O,v2,9],D9=[0,O,ta,4],D8=[0,O,lQ,21],D6=[0,O,tL,4],D7=[0,O,177,14],D4=[0,O,113,14],D2=[0,O,82,21],DY=[0,O,32,14],Fa=[0,bw,lw,12],EX=[0,bw,tC,37],EY=[0,bw,rf,37],E0=[0,bw,tz,10],E1=[0,bw,t2,8],EZ=[0,bw,tX,37],E3=[0,bw,sf,10],E4=[0,bw,sG,8],E2=[0,bw,vZ,37],E7=[0,bw,ur,16],E_=[0,bw,vo,50],E8=[0,bw,tb,6],E6=[0,bw,s1,14],EP=[0,bw,tL,57],EQ=[0,bw,182,57],ER=[0,bw,uN,11],EK=r1,EL=r1,FB=[0,"src/fut.ml",34,25],GF="debug",GD="info",GC="warn",GA=gr,Gz="log",Gj="scrollTop",F1="search",FV=[0,1],FT=vV,GJ="isSecureContext",GP="cache",GQ="credentials",GR="headers",GS="integrity",GT="keepalive",GU="method",GV="mode",GW="redirect",GX="referrer",GY="referrerPolicy",Hj=[0,tY,t7,16],Hh=[0,tY,u5,16],Hc=[0,0,0],Ha=[0,0,0],HR=e,HQ=e,HG=[0,[0,bm,vl],0],HH=[0,[0,bm,ll],[0,cL,0]],HI=[0,[0,bm,ik],[0,cL,0]],HJ=[0,[0,bm,lt],[0,cL,0]],HK=[0,[0,bm,lV],[0,cL,0]],HL=[0,[0,bm,lB],[0,cL,0]],HM=[0,[0,bm,lj],[0,cL,0]],HN=[0,[0,bm,lA],[0,cL,0]],HO=[0,[0,bm,vl],[0,cL,0]],Hx=[0,[0,bm,ll],0],Hy=[0,[0,bm,ik],0],Hz=[0,sL,0],HA=[0,[0,bm,lt],0],HB=[0,[0,bm,lV],0],HC=[0,[0,bm,lB],0],HD=[0,[0,bm,lj],0],HE=[0,cL,0],HF=[0,[0,bm,lA],0],Hv=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],Hw="CCFormat.ANSI_codes.No_such_style",HS="CCFormat.Style",H5="CCResult.Get_error",Ih=[0,vX,119,10],Ie=[0,vX,92,10],Ia=e,Iq="CCFQueue.Empty",Ir=[0,0],IA="content-box",IB="border-box",IC="device-pixel-content-box",IL=vh,IM=sV,IN="position",IH="Set metadata",Jd="open",I$="unique",I4="autoIncrement",I5="keyPath",I6="new object store with options:",IZ="readonly",I0="readwrite",I1="readwriteflush",IX="Request failed: ",Jr="not implemented",Jo=[0,[8,[0,0,0],0,0,[11,uE,0]],"%fpx"],Jp=[0,[8,[0,0,0],0,0,[11,ue,0]],"%frem"],Jq=[0,[8,[0,0,0],0,0,[11,rA,0]],"%fem"],Jl=uE,Jm=ue,Jn=rA,Jt="Common.Utils.Forward_ref.Not_set",Jv="Common.Utils.Forward_ref.Already_set",JA=[1,[0,sR,rS]],JC=[1,-358247754],JH=e,JG=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],JM="TODO not implemented",JR=[0,80,u3],JU=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],JV=[0,80,"lwdui-controlled-scroll-controls"],JW="Show playing",J4=rp,J1=e,J2="password",JY=e,JZ=lX,J8=[0,80,lX],J6=[0,[2,0,[11,ui,0]],rY],J7=[0,[2,0,0],tA],J_=[0,80,lX],J9=[0,[2,0,[11,ui,0]],rY],Kc=[0,[2,0,[11,"-id",0]],"%s-id"],Kd=[0,80,"checkbox"],Ka=[0,[2,0,[12,45,[4,3,0,0,[12,45,[4,3,0,0,0]]]]],"%s-%i-%i"],Kp=[0,[11,r_,[2,0,0]],"height: %s"],Kl=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],Kj="grid-template-columns",Kk=[0,[2,0,[11,ln,[2,0,[12,59,0]]]],"%s: %s;"],Km=e,Kq=[1,4.],Ky=[0,80,st],Kw="Row height",Kx="Visible height:",Ku=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],Kv=[0,[11,r_,[2,0,[11," !important;",0]]],"height: %s !important;"],Kz=[0,80,[0,"lwdui-lazy-table-content"]],KA=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],KB=[0,"lwdui-lazy-table",0],Kr="virtual table",KF="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",KS=[0,[17,[0,tq,1,0],0],tq],KR=[0,[12,32,0],bS],KQ=[0,[11,sA,0],sA],KT=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],KL=[0,[11,uV,[15,[11,uz,[15,[11," dst-off=",[4,0,0,0,[11,k$,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],KJ=[0,[11,uV,[15,[11,uz,[15,[11," src-off=",[4,0,0,0,[11,k$,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],KH=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],KG=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],KU=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],KV=e,Lr=[0,[8,[0,0,0],0,[0,0],0],rb],La=[0,[12,44,0],lN],Lh=[0,[15,[12,58,[15,0]]],"%a:%a"],Lg=[0,[12,44,0],lN],K$=[0,[11,gn,0],gn],Lc=[0,[11,ei,0],ei],Ld=[0,[11,gx,0],gx],Le=[0,[8,[0,0,0],0,[0,0],0],rb],Lf=[0,[8,[0,0,3],0,0,0],"%g"],Li=[0,[12,ej,[15,[12,fd,0]]],"{%a}"],Lb=[0,[12,91,[15,[12,93,0]]],"[%a]"],Lj=[0,[12,44,[17,[0,a,1,0],0]],rD],Ln=[0,[18,[1,[0,[11,e4,0],e4]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],Lm=[0,[12,44,[17,[0,a,1,0],0]],rD],Lo=[0,[18,[1,[0,[11,e4,0],e4]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],Lp=[0,[11,ve,0],ve],Lk=[0,[18,[1,[0,[11,e4,0],e4]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],Ll=[0,[11,vN,0],vN],K0=[0,[12,34,0],dJ],K4=[0,[0,0],t$],K3=[0,[11,iv,0],iv],K6=[0,[11,iy,0],iy],K7=[0,[11,iG,0],iG],K8=[0,[11,ir,0],ir],K9=[0,[11,ij,0],ij],K2=[0,[11,ma,0],ma],K5=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],K1=[0,[12,34,0],dJ],LP=[0,go,su,9],LI=[0,ff,lW],LD=[0,gp,lW],LJ=[0,dG,lW],LH=[0,dG,gg],LE=[0,gp,gg],LF=[0,go,153,55],LG=[0,dG,gg],LK=[0,go,us,55],LL=[0,go,154,55],LM=[0,dG,cQ],LB=[0,go,l0,9],Lt=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],LA=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],M4=[0,b6,[0,bo,1]],M5=[0,b6,c7],M6=[0,b6,[0,bo,0]],M8=[0,b6,gh],M7=[0,b6,eg],Nh=[0,lS,tT,27],Nb=[0,b6,sH],M_=[0,b6,vE],M2=[0,lS,vq,8],M1=[0,lS,uC,45],Mx=[0,[18,[1,[0,0,e]],[11,e6,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,lG,[17,[0,a,1,0],[11,ii,W6]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],My=[0,[18,[1,[0,0,e]],[11,e6,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],MA=[0,[15,[17,[0,a,1,0],[11,lk,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,ii,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],MB=[0,[15,[17,[0,a,1,0],[11,rZ,[17,[0,a,1,0],[11,uU,[17,[0,a,1,0],[11,lK,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],MC=[0,[15,[17,[0,a,1,0],[11,rZ,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,lK,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],MD=[0,[15,[17,[0,a,1,0],[11,lk,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],Mz=[0,[15,[17,[0,a,1,0],[11,lk,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,uU,[17,[0,a,1,0],[11,lK,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],ME=[0,[18,[1,[0,0,e]],[11,e6,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,lG,[17,[0,a,1,0],[11,ii,[17,[0,a,1,0],[11,rW,W7]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],MF=[0,[4,8,[0,2,2],0,0],"%02X"],MH=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],MG=[0,[12,41,[17,0,0]],")@]"],MI=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],MJ=[0,[11,uO,[17,[0,a,1,0],[11,aS,[17,0,0]]]],"member@ name@]"],MK=[0,[11,iK,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],ML=[0,[11,aS,[17,[0,a,1,0],[11,ls,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],MM=[0,[11,gf,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,im,[17,0,0]]]]]],"end@ of@ input@]"],MN=[0,[11,"JavaScript",[17,[0,a,1,0],[11,s4,[17,0,0]]]],"JavaScript@ comment@]"],MO=[0,[11,iK,[17,[0,a,1,0],[11,c5,[17,0,0]]]],"JSON@ value@]"],MP=[0,[11,uO,[17,[0,a,1,0],[11,aS,[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,iN,[17,[0,a,1,0],[11,gf,[17,W9,W8]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],MQ=[0,[11,c5,[17,[0,a,1,0],[11,ls,[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,iN,[17,[0,a,1,0],[11,gf,[17,W$,W_]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],MR=[0,[11,c5,[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,iF,[17,[0,a,1,0],[11,gf,[17,[0,a,1,0],[11,"(value",[17,Xb,Xa]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],MS=[0,[11,c5,[17,[0,a,1,0],[11,ls,[17,[0,a,1,0],[11,dH,[17,[0,a,1,0],[11,iF,[17,[0,a,1,0],[11,gf,[17,Xd,Xc]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],MT=[0,[18,[1,[0,0,e]],[11,e6,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],MZ=[0,[18,[1,[0,0,e]],[11,e6,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],M0=[0,[18,[1,[0,0,e]],[11,e6,[17,[0,a,1,0],[11,ii,[17,[0,a,1,0],[11,lG,[17,[0,a,1,0],[11,iK,[17,[0,a,1,0],[11,lD,Xe]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],MU=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],MV=[0,[11,iN,[17,0,0]],"object@]"],MW=[0,[11,iF,[17,0,0]],"array@]"],MX=[0,[11,s4,[17,0,0]],"comment@]"],MY=[0,[11,lD,[17,0,0]],"string@]"],Mv=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],Mu=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],L$=[0,ak,-543455433],Mg=[0,ak,[0,ga,e5]],Mh=[0,ak,[0,ga,o]],Mi=[0,ak,[0,ga,gh]],Mj=[0,ak,[0,ga,eg]],Mm=[0,ak,[0,cw,e5]],Mn=[0,ak,[0,cw,ix]],Mo=[0,ak,[0,cw,vt]],Mp=[0,ak,[0,cw,[0,vs,1]]],Mq=[0,ak,[0,cw,[0,vs,0]]],Mr=[0,ak,[0,cw,[0,lf,1]]],Ms=[0,ak,[0,cw,[0,lf,0]]],Mt=[0,ak,[0,cw,r8]],NB="not a valid JSON array/object",Ny=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],Nt=[0,[11,b9,0],b9],Nu=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],Nv=[0,[15,0],v0],Ns="We expected a well-formed JSON document (array or object)",Nn=c5,No="object fields",Nl=[0,"lib/ezjsonm.ml",61,19],Nm=[0,iu,357123046],Nk="Abort",Np="Ezjsonm.Parse_error",ND=iY([[0,iM,y],[0,ta,y],[0,tI,y],[0,195,y],[0,196,y],[0,197,y],[0,198,gc],[0,lQ,aE],[0,200,E],[0,u5,E],[0,202,E],[0,ty,E],[0,uC,Z],[0,uu,Z],[0,206,Z],[0,207,Z],[0,208,am],[0,209,as],[0,210,q],[0,vq,q],[0,212,q],[0,213,q],[0,214,q],[0,216,q],[0,217,A],[0,lL,A],[0,219,A],[0,220,A],[0,221,aR],[0,222,lR],[0,sF,R],[0,ek,u],[0,u7,u],[0,226,u],[0,227,u],[0,228,u],[0,229,u],[0,230,c8],[0,231,aT],[0,232,d],[0,t7,d],[0,234,d],[0,235,d],[0,236,N],[0,gj,N],[0,uN,N],[0,to,N],[0,ef,ae],[0,241,af],[0,242,c],[0,243,c],[0,dL,c],[0,l2,c],[0,ec,c],[0,B,c],[0,249,s],[0,cN,s],[0,251,s],[0,fa,s],[0,li,aD],[0,dK,gq],[0,dF,aD],[0,cP,y],[0,u$,u],[0,258,y],[0,tU,u],[0,sc,y],[0,261,u],[0,262,aE],[0,263,aT],[0,264,aE],[0,265,aT],[0,sM,aE],[0,267,aT],[0,268,aE],[0,269,aT],[0,270,am],[0,rh,ae],[0,272,am],[0,273,ae],[0,274,E],[0,275,d],[0,276,E],[0,277,d],[0,278,E],[0,279,d],[0,280,E],[0,281,d],[0,282,E],[0,283,d],[0,284,aq],[0,285,Y],[0,286,aq],[0,287,Y],[0,288,aq],[0,289,Y],[0,lv,aq],[0,291,Y],[0,uS,aF],[0,293,W],[0,294,aF],[0,295,W],[0,lp,Z],[0,s_,N],[0,298,Z],[0,299,N],[0,300,Z],[0,301,N],[0,302,Z],[0,303,N],[0,304,Z],[0,vv,N],[0,306,"IJ"],[0,307,"ij"],[0,308,bT],[0,vw,bJ],[0,310,aH],[0,311,a1],[0,312,"kra"],[0,313,ah],[0,314,C],[0,rC,ah],[0,316,C],[0,v2,ah],[0,318,C],[0,319,ah],[0,320,C],[0,tC,ah],[0,rf,C],[0,323,as],[0,324,af],[0,325,as],[0,326,af],[0,327,as],[0,328,af],[0,329,af],[0,330,"NG"],[0,331,gs],[0,332,q],[0,333,c],[0,tW,q],[0,335,c],[0,336,q],[0,tX,c],[0,vZ,sT],[0,339,c$],[0,340,aj],[0,341,p],[0,342,aj],[0,343,p],[0,344,aj],[0,345,p],[0,tz,ac],[0,347,R],[0,348,ac],[0,349,R],[0,350,ac],[0,351,R],[0,352,ac],[0,353,R],[0,354,aJ],[0,355,al],[0,356,aJ],[0,357,al],[0,t2,aJ],[0,359,al],[0,360,A],[0,361,s],[0,tH,A],[0,su,s],[0,364,A],[0,365,s],[0,366,A],[0,tm,s],[0,s6,A],[0,369,s],[0,370,A],[0,sa,s],[0,te,a7],[0,373,be],[0,374,aR],[0,sf,aD],[0,376,aR],[0,sX,au],[0,378,ad],[0,379,au],[0,380,ad],[0,381,au],[0,382,ad],[0,tv,R],[0,sG,aP],[0,385,a5],[0,ts,a5],[0,387,aP],[0,388,r6],[0,389,r6],[0,390,q],[0,r0,aE],[0,392,aT],[0,393,am],[0,u8,am],[0,s1,am],[0,396,ae],[0,tT,ae],[0,398,E],[0,399,E],[0,400,E],[0,401,bv],[0,402,cg],[0,403,aq],[0,404,aq],[0,405,s5],[0,406,Z],[0,407,Z],[0,408,aH],[0,409,a1],[0,410,C],[0,411,C],[0,412,bn],[0,413,as],[0,414,af],[0,415,q],[0,416,q],[0,417,c],[0,418,"OI"],[0,419,"oi"],[0,rc,a6],[0,421,bI],[0,422,"YR"],[0,rI,lF],[0,424,lF],[0,ur,sl],[0,426,c_],[0,427,al],[0,428,aJ],[0,429,al],[0,430,aJ],[0,431,A],[0,432,s],[0,433,A],[0,434,bx],[0,rs,aR],[0,436,aD],[0,437,au],[0,438,ad],[0,439,au],[0,440,au],[0,441,ad],[0,442,ad],[0,443,lF],[0,444,t5],[0,445,t5],[0,446,b7],[0,447,be],[0,448,cx],[0,449,cx],[0,450,cx],[0,451,cx],[0,452,vj],[0,453,am],[0,454,ck],[0,455,"LJ"],[0,456,ah],[0,ri,"lj"],[0,458,"NJ"],[0,vR,as],[0,460,"nj"],[0,461,y],[0,rx,u],[0,463,Z],[0,464,N],[0,465,q],[0,466,c],[0,467,A],[0,468,s],[0,469,A],[0,470,s],[0,471,A],[0,472,s],[0,473,A],[0,474,s],[0,475,A],[0,476,s],[0,477,d],[0,478,y],[0,479,u],[0,tb,y],[0,481,u],[0,482,gc],[0,483,c8],[0,484,aq],[0,485,Y],[0,486,aq],[0,487,Y],[0,488,aH],[0,489,a1],[0,490,q],[0,491,c],[0,uA,q],[0,493,c],[0,494,au],[0,495,ad],[0,496,bJ],[0,497,vj],[0,498,am],[0,r7,ck],[0,lr,aq],[0,501,Y],[0,502,"HW"],[0,503,a7],[0,504,as],[0,505,af],[0,506,y],[0,507,u],[0,508,gc],[0,509,c8],[0,510,q],[0,511,c],[0,iC,y],[0,vo,u],[0,514,y],[0,515,u],[0,516,E],[0,vT,d],[0,518,E],[0,519,d],[0,520,Z],[0,521,N],[0,522,Z],[0,ua,N],[0,524,q],[0,525,c],[0,526,q],[0,527,c],[0,528,aj],[0,529,p],[0,530,aj],[0,tN,p],[0,532,A],[0,533,s],[0,534,A],[0,535,s],[0,536,ac],[0,537,R],[0,sn,aJ],[0,539,al],[0,540,"GH"],[0,541,"gh"],[0,542,aF],[0,543,W],[0,sW,as],[0,545,ae],[0,tw,"OU"],[0,547,lo],[0,548,au],[0,549,ad],[0,tV,y],[0,551,u],[0,552,E],[0,uq,d],[0,554,q],[0,555,c],[0,556,q],[0,tg,c],[0,558,q],[0,559,c],[0,un,q],[0,561,c],[0,562,aR],[0,563,aD],[0,564,C],[0,565,af],[0,566,al],[0,567,bJ],[0,568,"db"],[0,569,"qp"],[0,570,y],[0,lw,aE],[0,572,aT],[0,573,ah],[0,574,aJ],[0,575,R],[0,576,ad],[0,577,sv],[0,578,b7],[0,579,a5],[0,580,A],[0,581,bx],[0,582,E],[0,583,d],[0,584,bT],[0,585,bJ],[0,586,b$],[0,587,dE],[0,588,aj],[0,589,p],[0,590,aR],[0,591,aD],[0,592,u],[0,593,u],[0,594,u],[0,595,aP],[0,596,c],[0,597,aT],[0,598,ae],[0,599,ae],[0,600,d],[0,601,d],[0,602,d],[0,603,d],[0,604,d],[0,605,d],[0,606,d],[0,607,bJ],[0,608,Y],[0,609,Y],[0,610,Y],[0,611,Y],[0,612,uZ],[0,613,W],[0,614,W],[0,615,W],[0,616,N],[0,617,N],[0,618,N],[0,619,C],[0,620,C],[0,621,C],[0,622,e$],[0,623,a8],[0,624,a8],[0,625,a8],[0,626,af],[0,627,af],[0,628,af],[0,629,c],[0,630,c$],[0,631,c],[0,632,lq],[0,633,p],[0,634,p],[0,635,p],[0,636,p],[0,637,p],[0,638,p],[0,639,p],[0,640,p],[0,641,p],[0,642,R],[0,643,c_],[0,644,bJ],[0,645,"{squat}"],[0,646,c_],[0,647,al],[0,648,al],[0,649,s],[0,650,s],[0,uy,a9],[0,652,a9],[0,653,be],[0,so,aD],[0,655,aD],[0,656,ad],[0,657,ad],[0,658,ad],[0,659,ad],[0,660,sv],[0,661,"{voiced}"],[0,662,b7],[0,663,aT],[0,664,cx],[0,665,aP],[0,666,d],[0,667,Y],[0,668,W],[0,669,bJ],[0,670,a1],[0,671,C],[0,672,dE],[0,673,b7],[0,674,b7],[0,675,ck],[0,676,ck],[0,677,ck],[0,678,b7],[0,ud,iI],[0,680,sh],[0,681,me],[0,682,u1],[0,683,e$],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,ug,W],[0,687,W],[0,688,W],[0,689,W],[0,690,bJ],[0,691,p],[0,692,p],[0,693,p],[0,694,p],[0,695,be],[0,696,aD],[0,736,Y],[0,737,C],[0,738,R],[0,739,b8],[0,740,b7],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,vm,e],[0,si,e],[0,816,e],[0,817,e],[0,rN,e],[0,ub,e],[0,820,e],[0,821,e],[0,ux,e],[0,uf,e],[0,824,e],[0,825,e],[0,sy,e],[0,rU,e],[0,828,e],[0,829,e],[0,830,e],[0,tM,e],[0,r9,e],[0,833,e],[0,834,e],[0,835,e],[0,u_,e],[0,sz,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,uT,e],[0,rq,e],[0,848,e],[0,849,e],[0,ro,e],[0,uG,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,u],[0,7425,c8],[0,7426,c8],[0,7427,aP],[0,7428,aT],[0,7429,ae],[0,7430,ae],[0,7431,d],[0,7432,d],[0,7433,N],[0,7434,bJ],[0,7435,a1],[0,7436,C],[0,7437,a8],[0,7438,af],[0,7439,c],[0,7440,c],[0,7441,c],[0,7442,c],[0,7443,c],[0,7444,c$],[0,7445,lo],[0,7446,c],[0,7447,c],[0,7448,bI],[0,7449,p],[0,7450,p],[0,7451,al],[0,7452,s],[0,7453,s],[0,7454,s],[0,7455,a8],[0,7456,a9],[0,7457,be],[0,7458,ad],[0,7459,ad],[0,7460,"{spirant}"],[0,7461,c],[0,7468,u],[0,7469,c8],[0,7470,aP],[0,7471,aP],[0,7472,ae],[0,7473,d],[0,7474,d],[0,7475,Y],[0,7476,W],[0,7477,N],[0,7478,bJ],[0,7479,a1],[0,7480,C],[0,7481,a8],[0,7482,af],[0,7483,af],[0,7484,c],[0,7485,lo],[0,7486,bI],[0,7487,p],[0,7488,al],[0,7489,s],[0,7490,be],[0,7491,u],[0,7492,u],[0,7493,u],[0,7494,c8],[0,7495,aP],[0,7496,ae],[0,7497,d],[0,7498,d],[0,7499,d],[0,7500,d],[0,7501,Y],[0,7502,N],[0,7503,a1],[0,7504,a8],[0,7505,gs],[0,7506,c],[0,7507,c],[0,7508,c],[0,7509,c],[0,7510,bI],[0,7511,al],[0,7512,s],[0,7513,s],[0,7514,a8],[0,7515,a9],[0,7516,c],[0,7531,vi],[0,7532,aP],[0,7533,ae],[0,7534,cg],[0,7535,a8],[0,7536,af],[0,7537,bI],[0,7538,p],[0,7539,p],[0,7540,R],[0,7541,al],[0,7542,ad],[0,7543,Y],[0,7545,Y],[0,7546,gq],[0,7547,N],[0,7548,N],[0,7549,bI],[0,7550,s],[0,7551,s],[0,7552,aP],[0,7553,ae],[0,7554,cg],[0,7555,Y],[0,7556,a1],[0,7557,C],[0,7558,a8],[0,7559,af],[0,7560,bI],[0,7561,p],[0,7562,R],[0,7563,c_],[0,7564,a9],[0,7565,b8],[0,7566,ad],[0,7567,u],[0,7568,u],[0,7569,ae],[0,7570,d],[0,7571,d],[0,7572,d],[0,7573,d],[0,7574,N],[0,7575,c],[0,7576,c_],[0,7577,s],[0,7578,ad],[0,7579,u],[0,7580,aT],[0,7581,aT],[0,7582,ae],[0,7583,d],[0,7584,cg],[0,7585,bJ],[0,7586,Y],[0,7587,W],[0,7588,N],[0,7589,N],[0,7590,N],[0,7591,N],[0,7592,bJ],[0,7593,C],[0,7594,C],[0,7595,C],[0,7596,a8],[0,7597,a8],[0,7598,af],[0,7599,af],[0,7600,af],[0,7601,c],[0,7602,lq],[0,7603,R],[0,7604,c_],[0,7605,al],[0,7606,s],[0,7607,s],[0,7608,s],[0,7609,a9],[0,7610,a9],[0,7611,ad],[0,7612,ad],[0,7613,ad],[0,7614,ad],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,aj],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,y],[0,7636,gc],[0,7637,sq],[0,7638,lC],[0,7639,aE],[0,7640,am],[0,7641,am],[0,7642,aq],[0,7643,aq],[0,7644,aH],[0,7645,ah],[0,7646,ah],[0,7647,bn],[0,7648,as],[0,7649,as],[0,7650,aj],[0,7651,aj],[0,7652,ac],[0,7653,ac],[0,7654,au],[0,7655,y],[0,7656,a5],[0,7657,a5],[0,7658,E],[0,7659,bv],[0,7660,ah],[0,7661,q],[0,7662,a6],[0,7663,sl],[0,7664,A],[0,7665,a7],[0,7666,y],[0,7667,q],[0,7668,A],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,y],[0,7681,u],[0,7682,a5],[0,7683,aP],[0,7684,a5],[0,7685,aP],[0,7686,a5],[0,7687,aP],[0,7688,aE],[0,7689,aT],[0,7690,am],[0,7691,ae],[0,7692,am],[0,7693,ae],[0,7694,am],[0,7695,ae],[0,7696,am],[0,7697,ae],[0,7698,am],[0,7699,ae],[0,7700,E],[0,7701,d],[0,7702,E],[0,7703,d],[0,7704,E],[0,7705,d],[0,7706,E],[0,7707,d],[0,7708,E],[0,7709,d],[0,7710,bv],[0,7711,cg],[0,7712,aq],[0,7713,Y],[0,7714,aF],[0,7715,W],[0,7716,aF],[0,7717,W],[0,7718,aF],[0,7719,W],[0,7720,aF],[0,7721,W],[0,7722,aF],[0,7723,W],[0,7724,Z],[0,7725,N],[0,7726,Z],[0,7727,N],[0,7728,aH],[0,7729,a1],[0,7730,aH],[0,7731,a1],[0,7732,aH],[0,7733,a1],[0,7734,ah],[0,7735,C],[0,7736,ah],[0,7737,C],[0,7738,ah],[0,7739,C],[0,7740,ah],[0,7741,C],[0,7742,bn],[0,7743,a8],[0,7744,bn],[0,7745,a8],[0,7746,bn],[0,7747,a8],[0,7748,as],[0,7749,af],[0,7750,as],[0,7751,af],[0,7752,as],[0,7753,af],[0,7754,as],[0,7755,af],[0,7756,q],[0,7757,c],[0,7758,q],[0,7759,c],[0,7760,q],[0,7761,c],[0,7762,q],[0,7763,c],[0,7764,a6],[0,7765,bI],[0,7766,a6],[0,7767,bI],[0,7768,aj],[0,7769,p],[0,7770,aj],[0,7771,p],[0,7772,aj],[0,7773,p],[0,7774,aj],[0,7775,p],[0,7776,ac],[0,7777,R],[0,7778,ac],[0,7779,R],[0,7780,ac],[0,7781,R],[0,7782,ac],[0,7783,R],[0,7784,ac],[0,7785,R],[0,7786,aJ],[0,7787,al],[0,7788,aJ],[0,7789,al],[0,7790,aJ],[0,7791,al],[0,7792,aJ],[0,7793,al],[0,7794,A],[0,7795,s],[0,7796,A],[0,7797,s],[0,7798,A],[0,7799,s],[0,7800,A],[0,7801,s],[0,7802,A],[0,7803,s],[0,7804,bx],[0,7805,a9],[0,7806,bx],[0,7807,a9],[0,7808,a7],[0,7809,be],[0,7810,a7],[0,7811,be],[0,7812,a7],[0,7813,be],[0,7814,a7],[0,7815,be],[0,7816,a7],[0,7817,be],[0,7818,cl],[0,7819,b8],[0,7820,cl],[0,7821,b8],[0,7822,aR],[0,7823,aD],[0,7824,au],[0,7825,ad],[0,7826,au],[0,7827,ad],[0,7828,au],[0,7829,ad],[0,7830,W],[0,7831,al],[0,7832,be],[0,7833,aD],[0,7834,u],[0,7835,R],[0,7836,R],[0,7837,R],[0,7838,ac],[0,7839,ae],[0,7840,y],[0,7841,u],[0,7842,y],[0,7843,u],[0,7844,y],[0,7845,u],[0,7846,y],[0,7847,u],[0,7848,y],[0,7849,u],[0,7850,y],[0,7851,u],[0,7852,y],[0,7853,u],[0,7854,y],[0,7855,u],[0,7856,y],[0,7857,u],[0,7858,y],[0,7859,u],[0,7860,y],[0,7861,u],[0,7862,y],[0,7863,u],[0,7864,E],[0,7865,d],[0,7866,E],[0,7867,d],[0,7868,E],[0,7869,d],[0,7870,E],[0,7871,d],[0,7872,E],[0,7873,d],[0,7874,E],[0,7875,d],[0,7876,E],[0,7877,d],[0,7878,E],[0,7879,d],[0,7880,Z],[0,7881,N],[0,7882,Z],[0,7883,N],[0,7884,q],[0,7885,c],[0,7886,q],[0,7887,c],[0,7888,q],[0,7889,c],[0,7890,q],[0,7891,c],[0,7892,q],[0,7893,c],[0,7894,q],[0,7895,c],[0,7896,q],[0,7897,c],[0,7898,q],[0,7899,c],[0,7900,q],[0,7901,c],[0,7902,q],[0,7903,c],[0,7904,q],[0,7905,c],[0,7906,q],[0,7907,c],[0,7908,A],[0,7909,s],[0,7910,A],[0,7911,s],[0,7912,A],[0,7913,s],[0,7914,A],[0,7915,s],[0,7916,A],[0,7917,s],[0,7918,A],[0,7919,s],[0,7920,A],[0,7921,s],[0,7922,aR],[0,7923,aD],[0,7924,aR],[0,7925,aD],[0,7926,aR],[0,7927,aD],[0,7928,aR],[0,7929,aD],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bx],[0,7933,a9],[0,7934,aR],[0,7935,aD],[0,8305,N],[0,8319,af],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aT],[0,9372,y],[0,9373,a5],[0,9374,aE],[0,9375,am],[0,9376,E],[0,9377,bv],[0,9378,aq],[0,9379,aF],[0,9380,Z],[0,9381,bT],[0,9382,aH],[0,9383,ah],[0,9384,bn],[0,9385,as],[0,9386,q],[0,9387,a6],[0,9388,b$],[0,9389,aj],[0,9390,ac],[0,9391,aJ],[0,9392,A],[0,9393,bx],[0,9394,a7],[0,9395,cl],[0,9396,aR],[0,9397,au],[0,9398,y],[0,9399,a5],[0,9400,aE],[0,9401,am],[0,9402,E],[0,9403,bv],[0,9404,aq],[0,9405,aF],[0,9406,Z],[0,9407,bT],[0,9408,aH],[0,9409,ah],[0,9410,bn],[0,9411,as],[0,9412,q],[0,9413,a6],[0,9414,b$],[0,9415,aj],[0,9416,ac],[0,9417,aJ],[0,9418,A],[0,9419,bx],[0,9420,a7],[0,9421,cl],[0,9422,aR],[0,9423,au],[0,9424,u],[0,9425,aP],[0,9426,aT],[0,9427,ae],[0,9428,d],[0,9429,cg],[0,9430,Y],[0,9431,W],[0,9432,N],[0,9433,bJ],[0,9434,a1],[0,9435,C],[0,9436,a8],[0,9437,af],[0,9438,c],[0,9439,bI],[0,9440,dE],[0,9441,p],[0,9442,R],[0,9443,al],[0,9444,s],[0,9445,a9],[0,9446,be],[0,9447,b8],[0,9448,aD],[0,9449,ad],[0,11360,ah],[0,11361,C],[0,11362,ah],[0,11363,a6],[0,11364,aj],[0,11365,u],[0,11366,al],[0,11367,aF],[0,11368,W],[0,11369,aH],[0,11370,a1],[0,11371,au],[0,11372,ad],[0,11373,y],[0,11374,bn],[0,11375,y],[0,11376,y],[0,11377,a9],[0,11378,a7],[0,11379,be],[0,11380,a9],[0,11381,aF],[0,11382,W],[0,11383,lq],[0,11384,d],[0,11385,p],[0,11386,c],[0,11387,d],[0,11389,a9],[0,11390,ac],[0,11391,au],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,q],[0,42789,c],[0,42790,aF],[0,42791,W],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,sp],[0,42795,sp],[0,42796,iL],[0,42797,iL],[0,42798,iL],[0,42799,iL],[0,42800,cg],[0,42801,R],[0,42802,"AA"],[0,42803,tG],[0,42804,sq],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,lC],[0,42809,vO],[0,42810,lC],[0,42811,vO],[0,42812,"AY"],[0,42813,"ay"],[0,42814,aE],[0,42815,aT],[0,42816,aH],[0,42817,a1],[0,42818,aH],[0,42819,a1],[0,42820,aH],[0,42821,a1],[0,42822,ah],[0,42823,C],[0,42824,ah],[0,42825,C],[0,42826,q],[0,42827,c],[0,42828,q],[0,42829,c],[0,42830,"OO"],[0,42831,"oo"],[0,42832,a6],[0,42833,bI],[0,42834,a6],[0,42835,bI],[0,42836,a6],[0,42837,bI],[0,42838,b$],[0,42839,dE],[0,42840,b$],[0,42841,dE],[0,42842,aj],[0,42843,p],[0,42844,aj],[0,42845,p],[0,42846,bx],[0,42847,a9],[0,42848,"VY"],[0,42849,"vy"],[0,42850,au],[0,42851,ad],[0,42852,lR],[0,42853,gq],[0,42854,lR],[0,42855,gq],[0,42856,bx],[0,42857,a9],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,p],[0,42870,p],[0,42871,"tum"],[0,42872,"um"],[0,42873,am],[0,42874,ae],[0,42875,bv],[0,42876,cg],[0,42877,aq],[0,42878,aq],[0,42879,Y],[0,42880,ah],[0,42881,C],[0,42882,aj],[0,42883,p],[0,42884,ac],[0,42885,R],[0,42886,aJ],[0,42887,al],[0,42891,iw],[0,42892,iw],[0,42893,aF],[0,42894,C],[0,42895,vM],[0,42896,as],[0,42897,af],[0,42898,aE],[0,42899,aT],[0,42900,aT],[0,42901,W],[0,42902,a5],[0,42903,aP],[0,42904,bv],[0,42905,cg],[0,42906,gc],[0,42907,c8],[0,42908,sT],[0,42909,c$],[0,42910,"UE"],[0,42911,vi],[0,42912,aq],[0,42913,Y],[0,42914,aH],[0,42915,a1],[0,42916,as],[0,42917,af],[0,42918,aj],[0,42919,p],[0,42920,ac],[0,42921,R],[0,42922,aF],[0,42923,E],[0,42924,aq],[0,42925,ah],[0,42926,Z],[0,42927,dE],[0,42928,aH],[0,42929,aJ],[0,42930,bT],[0,42931,cl],[0,42932,a5],[0,42933,aP],[0,42934,q],[0,42935,c],[0,42936,A],[0,42937,s],[0,42938,y],[0,42939,u],[0,42940,Z],[0,42941,N],[0,42942,A],[0,42943,s],[0,42944,q],[0,42945,c],[0,42946,a7],[0,42947,be],[0,42948,aE],[0,42949,ac],[0,42950,au],[0,42951,am],[0,42952,ae],[0,42953,ac],[0,42954,R],[0,42960,aq],[0,42961,Y],[0,42963,gq],[0,42965,be],[0,42966,ac],[0,42967,R],[0,42968,ac],[0,42969,R],[0,42994,aE],[0,42995,bv],[0,42996,b$],[0,42997,aF],[0,42998,W],[0,42999,Z],[0,43000,W],[0,43001,"{letter}"],[0,43002,a8],[0,43003,bv],[0,43004,a6],[0,43005,bn],[0,43006,Z],[0,43007,bn],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,u],[0,43825,u],[0,43826,d],[0,43827,d],[0,43828,d],[0,43829,cg],[0,43830,Y],[0,43831,C],[0,43832,C],[0,43833,C],[0,43834,a8],[0,43835,af],[0,43836,gs],[0,43837,c],[0,43838,c],[0,43839,c],[0,43840,c$],[0,43841,c$],[0,43842,c$],[0,43843,c],[0,43844,c],[0,43845,p],[0,43846,p],[0,43847,p],[0,43848,p],[0,43849,p],[0,43850,p],[0,43851,p],[0,43852,p],[0,43853,c_],[0,43854,s],[0,43855,s],[0,43856,rV],[0,43857,rV],[0,43858,s],[0,43859,b8],[0,43860,b8],[0,43861,b8],[0,43862,b8],[0,43863,b8],[0,43864,b8],[0,43865,b8],[0,43866,aD],[0,43868,W],[0,43869,C],[0,43870,C],[0,43871,s],[0,43872,"wa"],[0,43873,d],[0,43874,c$],[0,43875,"uo"],[0,43876,u],[0,43878,ck],[0,43879,b7],[0,43880,p],[0,43881,be],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,R],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,y],[0,65314,a5],[0,65315,aE],[0,65316,am],[0,65317,E],[0,65318,bv],[0,65319,aq],[0,65320,aF],[0,65321,Z],[0,65322,bT],[0,65323,aH],[0,65324,ah],[0,65325,bn],[0,65326,as],[0,65327,q],[0,65328,a6],[0,65329,b$],[0,65330,aj],[0,65331,ac],[0,65332,aJ],[0,65333,A],[0,65334,bx],[0,65335,a7],[0,65336,cl],[0,65337,aR],[0,65338,au],[0,65345,u],[0,65346,aP],[0,65347,aT],[0,65348,ae],[0,65349,d],[0,65350,cg],[0,65351,Y],[0,65352,W],[0,65353,N],[0,65354,bJ],[0,65355,a1],[0,65356,C],[0,65357,a8],[0,65358,af],[0,65359,c],[0,65360,bI],[0,65361,dE],[0,65362,p],[0,65363,R],[0,65364,al],[0,65365,s],[0,65366,a9],[0,65367,be],[0,65368,b8],[0,65369,aD],[0,65370,ad],[0,66045,e],[0,67456,tG],[0,67457,re],[0,67458,re],[0,67459,c8],[0,67460,aP],[0,67461,aP],[0,67463,ck],[0,67464,ck],[0,67465,ck],[0,67466,ck],[0,67467,ae],[0,67468,ae],[0,67469,ae],[0,67470,d],[0,67471,d],[0,67472,me],[0,67473,uZ],[0,67474,Y],[0,67475,Y],[0,67476,Y],[0,67477,W],[0,67478,W],[0,67479,W],[0,67480,bJ],[0,67481,u1],[0,67482,e$],[0,67483,C],[0,67484,C],[0,67485,C],[0,67486,e$],[0,67487,e$],[0,67488,aD],[0,67489,aD],[0,67490,c],[0,67491,c$],[0,67492,c],[0,67493,dE],[0,67494,p],[0,67495,p],[0,67496,p],[0,67497,p],[0,67498,p],[0,67499,sh],[0,67500,b7],[0,67501,b7],[0,67502,iI],[0,67503,al],[0,67504,a9],[0,67506,aD],[0,67507,b7],[0,67508,b7],[0,67509,cx],[0,67510,cx],[0,67511,cx],[0,67512,cx],[0,67513,cx],[0,67514,R],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,me],[0,122625,Y],[0,122626,Y],[0,122627,a1],[0,122628,C],[0,122629,e$],[0,122630,aD],[0,122631,gs],[0,122632,p],[0,122633,al],[0,122634,cx],[0,122635,c_],[0,122636,c_],[0,122637,al],[0,122638,b7],[0,122639,aT],[0,122640,a1],[0,122641,C],[0,122642,ck],[0,122643,C],[0,122644,gs],[0,122645,p],[0,122646,p],[0,122647,iI],[0,122648,ad],[0,122649,ck],[0,122650,N],[0,122651,c],[0,122652,iI],[0,122653,aT],[0,122654,R],[0,122661,ae],[0,122662,C],[0,122663,af],[0,122664,p],[0,122665,R],[0,122666,al],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,y],[0,127249,a5],[0,127250,aE],[0,127251,am],[0,127252,E],[0,127253,bv],[0,127254,aq],[0,127255,aF],[0,127256,Z],[0,127257,bT],[0,127258,aH],[0,127259,ah],[0,127260,bn],[0,127261,as],[0,127262,q],[0,127263,a6],[0,127264,b$],[0,127265,aj],[0,127266,ac],[0,127267,aJ],[0,127268,A],[0,127269,bx],[0,127270,a7],[0,127271,cl],[0,127272,aR],[0,127273,au],[0,127274,ac],[0,127275,aE],[0,127276,aj],[0,127280,y],[0,127281,a5],[0,127282,aE],[0,127283,am],[0,127284,E],[0,127285,bv],[0,127286,aq],[0,127287,aF],[0,127288,Z],[0,127289,bT],[0,127290,aH],[0,127291,ah],[0,127292,bn],[0,127293,as],[0,127294,q],[0,127295,a6],[0,127296,b$],[0,127297,aj],[0,127298,ac],[0,127299,aJ],[0,127300,A],[0,127301,bx],[0,127302,a7],[0,127303,cl],[0,127304,aR],[0,127305,au],[0,127312,y],[0,127313,a5],[0,127314,aE],[0,127315,am],[0,127316,E],[0,127317,bv],[0,127318,aq],[0,127319,aF],[0,127320,Z],[0,127321,bT],[0,127322,aH],[0,127323,ah],[0,127324,bn],[0,127325,as],[0,127326,q],[0,127327,a6],[0,127328,b$],[0,127329,aj],[0,127330,ac],[0,127331,aJ],[0,127332,A],[0,127333,bx],[0,127334,a7],[0,127335,cl],[0,127336,aR],[0,127337,au],[0,127344,y],[0,127345,a5],[0,127346,aE],[0,127347,am],[0,127348,E],[0,127349,bv],[0,127350,aq],[0,127351,aF],[0,127352,Z],[0,127353,bT],[0,127354,aH],[0,127355,ah],[0,127356,bn],[0,127357,as],[0,127358,q],[0,127359,a6],[0,127360,b$],[0,127361,aj],[0,127362,ac],[0,127363,aJ],[0,127364,A],[0,127365,bx],[0,127366,a7],[0,127367,cl],[0,127368,aR],[0,127369,au],[0,127370,a6],[0,127397,am],[0,917569,y],[0,917570,a5],[0,917571,aE],[0,917572,am],[0,917573,E],[0,917574,bv],[0,917575,aq],[0,917576,aF],[0,917577,Z],[0,917578,bT],[0,917579,aH],[0,917580,ah],[0,917581,bn],[0,917582,as],[0,917583,q],[0,917584,a6],[0,917585,b$],[0,917586,aj],[0,917587,ac],[0,917588,aJ],[0,917589,A],[0,917590,bx],[0,917591,a7],[0,917592,cl],[0,917593,aR],[0,917594,au],[0,917601,y],[0,917602,a5],[0,917603,aE],[0,917604,am],[0,917605,E],[0,917606,bv],[0,917607,aq],[0,917608,aF],[0,917609,Z],[0,917610,bT],[0,917611,aH],[0,917612,ah],[0,917613,bn],[0,917614,as],[0,917615,q],[0,917616,a6],[0,917617,b$],[0,917618,aj],[0,917619,ac],[0,917620,aJ],[0,917621,A],[0,917622,bx],[0,917623,a7],[0,917624,cl],[0,917625,aR],[0,917626,au]]),NF=bS,NE=iY([[0,170,u],[0,rE,c],[0,sF,"ss"],[0,8208,cA],[0,8211,cA],[0,8212,cA],[0,8216,iw],[0,8217,iw],[0,8220,dJ],[0,8221,dJ],[0,8230,"..."],[0,8722,cA]]),NM="?",NW=[0,lH],NS=[1,[0,sR,rS]],NP=[0,1],NX=[0,"lib/codec.ml",32,4],N0="Yojson__Common.Json_error",N2="Yojson__Common.End_of_array",N3="Yojson__Common.End_of_object",N4="Yojson__Common.End_of_tuple",N5="Yojson__Common.End_of_input",N7=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Pn=[0,bo,1],Po=[0,bo,0],Pp=b9,Pq="Invalid token",Pr=b9,Ps="Invalid escape sequence",Pt=b9,Pu="Invalid low surrogate for code point beyond U+FFFF",Pv="Missing escape sequence representing low surrogate for code point beyond U+FFFF",Pw=b9,Px="Expected ':' or '>' but found",Py=b9,Pz="Expected '>' but found",PA=b9,PB="Unterminated comment",PC="Expected string or identifier but found",PD=b9,PE="Expected ',' or ']' but found",PF=b9,PG="Expected ',' or ')' but found",PH=b9,PI="Expected ',' or '}' but found",PJ=b9,PK="Expected ':' but found",PL=b9,P7="Expected string, got ",P6="Expected object, got ",PU=gn,PW=iN,PX="floatlit",PY=iF,PZ="tuple",PV="bool",P1="variant",P2="float",P3="int",P4=lD,P0="intlit",PQ="Blank input data",PN="Junk after end of JSON value:",OV=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],OQ=[0,[11,"File ",[2,0,[11,ra,0]]],"File %s, line"],OU="Line",OR=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],OT=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],OS=[0,[2,0,[12,32,[4,3,0,0,[11,l7,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],OP=[0,"lib/read.mll",41,13],OO=e,OM=e,Oy="NaN value not allowed in standard JSON",Oz=[0,[8,[0,0,3],0,[0,16],0],vP],OB=[0,[8,[0,0,3],0,[0,17],0],uW],OA=vA,Ow="Infinity value not allowed in standard JSON",Ox="-Infinity value not allowed in standard JSON",Or="NaN",Os=[0,[8,[0,0,3],0,[0,16],0],vP],Ou=[0,[8,[0,0,3],0,[0,17],0],uW],Ot=vA,Op="Infinity",Oq="-Infinity",Ol=ei,Om=gx,Ok=gn,Oe=iy,Of=iG,Og=ir,Oh="\\f",Oi=ij,Oj=ma,Od=iv,Ob=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,k$,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],N$="\\u00",OW="Yojson__Safe.Int_overflow",PR="Yojson__Safe.Util.Type_error",Qd="list_of_yojson: list needed",Qc="int_of_yojson: integer needed",Qb="string_of_yojson: string needed",Qa="bool_of_yojson: true/false needed",P9="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",Qr=bS,Qt="_of_yojson: list instead of atom for record expected",Qs=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Qp="extra fields",Qo="duplicate fields",Qm=bS,Qn=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,ln,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Ql="_of_yojson: unexpected variant constructor",Qk="_of_yojson: expected a variant type, saw an empty list",Qj="_of_yojson: expected a variant type, saw a nested list",Qi="_of_yojson: this constructor requires arguments",Qg=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Qe="_of_yojson: this constructor does not take arguments",So="An error occured while decoding response: ",Sj=[0,[11,", Token=",[3,0,0]],", Token=%S"],Sm=e,Sk=e,Sl=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],Se=lh,Sf=vQ,Sg=cz,Sa="item_id",Sb="locations",Sc=aS,R_=tJ,RY=tR,RZ=tt,R0=sj,R1=e7,R2=rP,R3=s3,R4=vI,R5=uk,R6=e_,R7=sw,R8=uM,R9=cz,RR="type_",RS="image_blur_hashes",RT=fb,RU="is_folder",RV=aQ,RW=aS,RP=[0,"lib/data_source/jellyfin_api.ml",ty,64],RL=vy,RM=cz,RI="url",RJ=aS,Q8=[0,r,[0,[0,o,vH],0]],Q9=[0,r,[0,[0,o,vf],0]],Q_=[0,r,[0,[0,o,s7],0]],Q$=[0,r,[0,[0,o,sB],0]],Ra=[0,r,[0,[0,o,rT],0]],Rb=[0,r,[0,[0,o,r4],0]],Rc=[0,r,[0,[0,o,sS],0]],Rd=[0,r,[0,[0,o,sd],0]],Re=[0,r,[0,[0,o,t8],0]],Rf=[0,r,[0,[0,o,vk],0]],Rg=[0,r,[0,[0,o,vn],0]],Rh=[0,r,[0,[0,o,tp],0]],Ri=[0,r,[0,[0,o,vJ],0]],Rj=[0,r,[0,[0,o,rG],0]],Rk=[0,r,[0,[0,o,rL],0]],Rl=[0,r,[0,[0,o,vD],0]],Rm=[0,r,[0,[0,o,uI],0]],Rn=[0,r,[0,[0,o,se],0]],Ro=[0,r,[0,[0,o,tZ],0]],Rp=[0,r,[0,[0,o,sN],0]],Rq=[0,r,[0,[0,o,rn],0]],Rr=[0,r,[0,[0,o,vc],0]],Rs=[0,r,[0,[0,o,va],0]],Rt=[0,r,[0,[0,o,rB],0]],Ru=[0,r,[0,[0,o,uQ],0]],Rv=[0,r,[0,[0,o,tD],0]],Rw=[0,r,[0,[0,o,vz],0]],Rx=[0,r,[0,[0,o,rX],0]],Ry=[0,r,[0,[0,o,rJ],0]],Rz=[0,r,[0,[0,o,sE],0]],RA=[0,r,[0,[0,o,tQ],0]],RB=[0,r,[0,[0,o,sm],0]],RC=[0,r,[0,[0,o,tc],0]],RD=[0,r,[0,[0,o,rM],0]],RE=[0,r,[0,[0,o,rQ],0]],RF=[0,r,[0,[0,o,uY],0]],RG=[0,r,[0,[0,o,sb],0]],Q5=vG,Q1=e_,Q2=cz,QY=aQ,QZ=aS,QU=[0,"Users",[0,"AuthenticateByName",0]],QP=e7,QQ=vx,QR=tK,QL=fb,QM="access_token",QN="user",QI=tF,QJ=sr,QF="pw",QG="username",QA=e_,QB=tn,QC=e7,QD=cz,Qw=aQ,Qx=fb,Qy=aS,S7=fb,S8=ci,S9=l9,S_=aQ,S2=fb,S3=ci,S4=l9,S5=aQ,SX=ci,SY=ee,SZ=aQ,S0=il,SS=ci,ST=ee,SU=aQ,SV=il,SO=eh,SP=aS,SM=eh,SN=aS,SG=ci,SH=eh,SI=aS,SJ=ee,SK=aQ,SB=ci,SC=eh,SD=aS,SE=ee,SF=aQ,Sy=aS,Sz=aQ,Sw=aS,Sx=aQ,Sv=[0,o,lm],T5=[0,db,lp,15],T4=[0,db,lv,21],T3=rz,TX=[0,db,tU,15],TW=[0,db,dK,21],TV=rz,Tw=[0,db,168,11],Ts=[0,db,ej,13],Tr=[0,db,r$,19],Tq=[0,db,108,13],Tp=[0,db,gb,19],Tm=it,Tn=lI,Tj=it,Tk=lI,Tf=ci,Tg=mc,Th=ea,Tb=ci,Tc=mc,Td=ea,S$=rd,Tt="items",Tu="virtual_folders",TI="collections",TM="genres",TQ="artists",TU="albums",T2=tf,UQ=tf,T$="to",Ua="Upgrading indexed_db schema from version",Ub=[0,"Erasing existing stores",0],Uc=[0,aQ],Ud=[0,0],Ue=[0,"sorts.date_added"],Uf=rd,Ug=s8,Uh="item.Name",Ui=vK,Uj=[0,0],Uk=[0,vK],Ul="items_by_id",Um=s8,Un="item.Type",Uo="items_by_view_and_kind",Up="sorts.sort_name",Uq="item.CollectionType",Ur="items_by_type_and_name",Us=[0,lh],Ut=[0,0],Uu=[0,1],Uv=[0,1],Uw=[0,aQ],Ux=lO,Uy=[0,1],Uz=[0,1],UA=[0,eh],UB="genres_by_canon_name",UC=[0,1],UD=[0,1],UE=[0,aQ],UF=lO,UG=[0,ee],UH="by-mbid",UI=[0,1],UJ=[0,aQ],UK=lO,UL=[0,il],UM=tj,UN="Stores created:",UT="./db_worker.bc.js",UU=e,Vj=[2,0],Vf="Synchronized",Vd=[0,[11,"Sync in progress: ",[4,3,0,0,[12,47,[4,3,0,0,[11," (",[4,3,0,0,[11," jobs)",0]]]]]]],"Sync in progress: %i/%i (%i jobs)"],Ve="Desynchronized",U_=l8,Vb=l8,U$=l8,Va=e,UW="ui_servers",UY=[0,0,0,0],UZ=[0,"https://demo.jellyfin.org/stable"],U0=[0,1],U2=[0,"demo"],U3=[0,1],U5=[0,0],U7=[0,80,"Connect"],VI=sx,VF=[0,[11,t_,[3,0,[12,41,0]]],rw],VE=gd,VC="A playback error happened. This is probably due to a codec unsupported by the browser.",VD=[0,80,"NEXT"],VG=[0,80,"now-playing-cover"],VH=[0,80,"now-playing-details"],VJ=[0,80,sP],VK=[0,80,"now-playing-display"],VL=[0,80,"player-wrapper"],VM=[0,80,sP],VA="image/jpeg",VB="500x500",Vx="Now playing:",Vy=e,Vz=e,Vv=gd,Vt=gd,Vs=[0,[2,0,[11,"/Items/",[2,0,[11,"/Images/Primary?width=",[4,3,0,0,[11,"&format=Jpg",0]]]]]],"%s/Items/%s/Images/Primary?width=%i&format=Jpg"],Vq=[0,0],Vr=tj,Vu=gd,Vn=[0,[2,0,[11,"/Audio/",[2,0,[11,"/universal?api_key=",[2,0,[11,"&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls",0]]]]]],"%s/Audio/%s/universal?api_key=%s&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls"],Wc=[0,[4,3,0,0,[11," results",0]],"%i results"],V$=[0,25],V7=[0,25],VU=[0,ip,0],VV=[0,vg,0],VO=e,VP=ea,VQ=iJ,VR=e,VS=[0,[0,0,0,0,0],0,0],VX="library-selection",V0="+classi -opera",V1=[0,"genre-formula",0,0],V4=[0,"pouet",0,0],V6=[0,[0,ea,"Date added"],[0,[0,aS,cz],0]],V8=[0,"view-sort",ea,0],V_=[0,[0,t3,"Asc"],[0,[0,iJ,"Desc"],[0,[0,uB,"Random"],0]]],Wa=[0,"view-order",iJ,0],Wf=[0,80,[0,"vertical-picker"]],Wh=[0,80,[0,"genres-picker"]],Wj="Filter by genre: ",Wl=[0,80,[0,"filters-row"]],Wo=[0,80,[0,"filters-container"]],WA="|>",WB=[2,4.],Wr=s9,Ws="1fr",Wt=s9,Wu=uX,Wv=t4,Ww=uX,Wx="#",Wy=t4,Wz="Order",W2="Persist ?",WR=[0,[11,t_,[3,0,[12,41,0]]],rw],WS=gd,WO=sx,WD="session_uuid",WF="Welcome to OCAMIX",WZ=[0,"main-layout"];function +ax(a){if(typeof a==="number")return 0;switch(a[0]){case -0:return[0,av(a[1])];case -1:return[1,av(a[1])];case -2:return[2,av(a[1])];case -3:return[3,av(a[1])];case -4:return[4,av(a[1])];case -5:return[5,av(a[1])];case -6:return[6,av(a[1])];case -7:return[7,av(a[1])];case +0:return[0,ax(a[1])];case +1:return[1,ax(a[1])];case +2:return[2,ax(a[1])];case +3:return[3,ax(a[1])];case +4:return[4,ax(a[1])];case +5:return[5,ax(a[1])];case +6:return[6,ax(a[1])];case +7:return[7,ax(a[1])];case 8:var -c=a[1];return[8,c,av(a[2])];case +c=a[1];return[8,c,ax(a[2])];case 9:var -b=a[1];return[9,b,b,av(a[3])];case -10:return[10,av(a[1])];case -11:return[11,av(a[1])];case -12:return[12,av(a[1])];case -13:return[13,av(a[1])];default:return[14,av(a[1])]}}function -bo(a,b){if(typeof +b=a[1];return[9,b,b,ax(a[3])];case +10:return[10,ax(a[1])];case +11:return[11,ax(a[1])];case +12:return[12,ax(a[1])];case +13:return[13,ax(a[1])];default:return[14,ax(a[1])]}}function +bq(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,bo(a[1],b)];case -1:return[1,bo(a[1],b)];case -2:return[2,bo(a[1],b)];case -3:return[3,bo(a[1],b)];case -4:return[4,bo(a[1],b)];case -5:return[5,bo(a[1],b)];case -6:return[6,bo(a[1],b)];case -7:return[7,bo(a[1],b)];case +0:return[0,bq(a[1],b)];case +1:return[1,bq(a[1],b)];case +2:return[2,bq(a[1],b)];case +3:return[3,bq(a[1],b)];case +4:return[4,bq(a[1],b)];case +5:return[5,bq(a[1],b)];case +6:return[6,bq(a[1],b)];case +7:return[7,bq(a[1],b)];case 8:var -c=a[1];return[8,c,bo(a[2],b)];case +c=a[1];return[8,c,bq(a[2],b)];case 9:var -d=a[2],e=a[1];return[9,e,d,bo(a[3],b)];case -10:return[10,bo(a[1],b)];case -11:return[11,bo(a[1],b)];case -12:return[12,bo(a[1],b)];case -13:return[13,bo(a[1],b)];default:return[14,bo(a[1],b)]}}function -am(a,b){if(typeof +d=a[2],e=a[1];return[9,e,d,bq(a[3],b)];case +10:return[10,bq(a[1],b)];case +11:return[11,bq(a[1],b)];case +12:return[12,bq(a[1],b)];case +13:return[13,bq(a[1],b)];default:return[14,bq(a[1],b)]}}function +ao(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,am(a[1],b)];case -1:return[1,am(a[1],b)];case +0:return[0,ao(a[1],b)];case +1:return[1,ao(a[1],b)];case 2:var -c=a[1];return[2,c,am(a[2],b)];case +c=a[1];return[2,c,ao(a[2],b)];case 3:var -d=a[1];return[3,d,am(a[2],b)];case +d=a[1];return[3,d,ao(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,am(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,ao(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,am(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,ao(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,am(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,ao(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,am(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,ao(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,am(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,ao(a[4],b)];case 9:var -t=a[1];return[9,t,am(a[2],b)];case -10:return[10,am(a[1],b)];case +t=a[1];return[9,t,ao(a[2],b)];case +10:return[10,ao(a[1],b)];case 11:var -u=a[1];return[11,u,am(a[2],b)];case +u=a[1];return[11,u,ao(a[2],b)];case 12:var -v=a[1];return[12,v,am(a[2],b)];case +v=a[1];return[12,v,ao(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,am(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,ao(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,am(a[3],b)];case -15:return[15,am(a[1],b)];case -16:return[16,am(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,ao(a[3],b)];case +15:return[15,ao(a[1],b)];case +16:return[16,ao(a[1],b)];case 17:var -A=a[1];return[17,A,am(a[2],b)];case +A=a[1];return[17,A,ao(a[2],b)];case 18:var -B=a[1];return[18,B,am(a[2],b)];case -19:return[19,am(a[1],b)];case +B=a[1];return[18,B,ao(a[2],b)];case +19:return[19,ao(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,am(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,ao(a[3],b)];case 21:var -E=a[1];return[21,E,am(a[2],b)];case -22:return[22,am(a[1],b)];case +E=a[1];return[21,E,ao(a[2],b)];case +22:return[22,ao(a[1],b)];case 23:var -F=a[1];return[23,F,am(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,am(a[3],b)]}}function -fh(a){throw g([0,dL,a],1)}function -F(a){throw g([0,iP,a],1)}var -mq=[B,wh,at(0)];function -mv(a,b){return V1(a,b)?a:b}function -fi(a){return 0<=a?a:-a|0}var -gv=b4;function -bb(a,b){return a+b}function -wv(b){var +F=a[1];return[23,F,ao(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,ao(a[3],b)]}}function +fp(a){throw g([0,dT,a],1)}function +I(a){throw g([0,i6,a],1)}var +mH=[B,wJ,av(0)];function +mM(a,b){return X5(a,b)?a:b}function +fq(a){return 0<=a?a:-a|0}var +gK=b_;function +a2(a,b){return a+b}function +mN(a){return e+a}function +wW(b){var e=l(b);return function(a){var -c=a;for(;;){if(e<=c)return bb(b,ww);var -d=V(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function -mw(a,b){if(!a)return b;var +c=a;for(;;){if(e<=c)return a2(b,wX);var +d=X(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function +mO(a,b){if(!a)return b;var c=a[2],d=a[1];if(!c)return[0,d,b];var e=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var -g=[0,e[1],cd];wy(g,1,e[2],b);return[0,d,[0,f,g]]}function -wy(a,b,c,d){var +g=[0,e[1],ch];wZ(g,1,e[2],b);return[0,d,[0,f,g]]}function +wZ(a,b,c,d){var f=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var h=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var j=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var -l=[0,j[1],cd],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}V$(0);var -iR=v4(1),bO=v4(2);function -fj(a,b){mh(a,b,0,l(b));return}function -mx(a,b,c,d){if(0<=c&&0<=d&&(l(b)-d|0)>=c)return mh(a,b,c,d);return F(wz)}function -my(a){fj(bO,a);v5(bO,10);return ej(bO)}var -iS=[0,function(a){return function(a){var +l=[0,j[1],ch],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}Yf(0);var +i8=wt(1),bW=wt(2);function +fr(a,b){mz(a,b,0,l(b))}function +mP(a,b,c,d){if(0<=c&&0<=d&&(l(b)-d|0)>=c)return mz(a,b,c,d);return I(w0)}function +mQ(a){fr(bW,a);wu(bW,10);return ep(bW)}var +i9=[0,function(a){return function(a){var b=a;for(;;){if(!b)return 0;var -d=b[2],e=b[1];try{ej(e)}catch(f){var -c=O(f);if(c[1]!==mt)throw g(c,0)}b=d}}(Wa(0))}],mz=[0,function(a){return}];function -iT(a){h(mz[1],0);return h(l2(iS),0)}mn(sB,iT);function -fk(a){return ej(a)}function -wi(a,b){return VC(a,b)?a:b}function -wj(a){return a^-1}var -wk=-2147483648,wm=fb(wl),wo=fb(wn),wq=fb(wp);function -wr(a){return a?ws:wt}function -wu(a){return e+a}function -wx(a){return wv(l7("%.12g",a))}function -wA(a,b,c,d){if(0<=c&&0<=d&&(aR(b)-d|0)>=c)return V9(a,b,c,d);return F(wB)}function -wC(c){for(;;){var -a=l2(iS);let +d=b[2],e=b[1];try{ep(e)}catch(f){var +c=T(f);if(c[1]!==mK)throw g(c,0)}b=d}}(Yg(0))}],mR=[0,function(a){}];function +i_(a){h(mR[1],0);return h(mh(i9),0)}mE(s0,i_);function +fs(a){return ep(a)}function +wK(a,b){return XG(a,b)?a:b}function +wL(a){return a^-1}var +wM=-2147483648,wO=fj(wN),wQ=fj(wP),wS=fj(wR);function +wT(a){return a?wU:wV}function +wY(a){return wW(mm("%.12g",a))}function +w1(a,b,c,d){if(0<=c&&0<=d&&(aV(b)-d|0)>=c)return Yd(a,b,c,d);return I(w2)}function +w3(c){for(;;){var +a=mh(i9);let d=[0,1],e=a;var -b=1-l1(iS,a,function(a){if(l1(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function -wD(a,b){v5(a,b);return}var -iU=Wm(0),fl=(4*iU|0)-1|0;function -mA(a){return 1-(typeof +b=1-mg(i9,a,function(a){if(mg(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function +w4(a,b){wu(a,b)}var +i$=Yt(0),ft=(4*i$|0)-1|0;function +mS(a){return 1-(typeof a==="number"?1:0)}function -mB(a,b,c){return l1(a,b,c)}function -fm(a){return l2(a)}function -fn(a){return[0,a]}function -wE(a,b){return Vi(a,b)}var -wG=[B,wF,at(0)];function -wH(a){var +mT(a,b,c){return mg(a,b,c)}function +fu(a){return mh(a)}function +fv(a){return[0,a]}function +w5(a,b){return Xm(a,b)}var +w7=[B,w6,av(0)];function +w8(a){var d=a[1];a[1]=0;try{var -c=h(d,0);a[1]=c;v2(a);return c}catch(f){var -b=O(f);a[1]=function(a){throw g(b,0)};VZ(a);throw g(b,0)}}function -wI(a){var +c=h(d,0);a[1]=c;wr(a);return c}catch(f){var +b=T(f);a[1]=function(a){throw g(b,0)};X3(a);throw g(b,0)}}function +w9(a){var c=a[1];a[1]=0;var -b=h(c,0);a[1]=b;v2(a);return b}function -wJ(a,b){if(0===V0(b))return a?wI(b):wH(b);throw g(wG,1)}function -mC(a){return wJ(0,a)}function -wK(a){var -b=dK(a);if(b!==cI&&b!==d9&&b!==dC&&b!==k6)return a;return VY(a)}function -iV(a,b){return b?[0,h(a,b[1])]:0}function -mD(a){return a?1:0}function -wL(a){return a?a[1]:F(wM)}function -wN(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function -aw(a){if(0<=a&&dx>=a)return a;return F(wO)}function -wY(a,b){return a-b|0}function -mE(a,b){return 0===wY(a,b)?1:0}function -wP(a){a:{if(40<=a){if(92===a)return wQ;if(cZ>a)break a}else{if(32<=a){if(39<=a)return wR;break a}if(14>a)switch(a){case -8:return wS;case -9:return wT;case -10:return wU;case -13:return wV}}var -b=al(4);ao(b,0,92);ao(b,1,48+(a/h$|0)|0);ao(b,2,48+((a/10|0)%10|0)|0);ao(b,3,48+(a%10|0)|0);return iM(b)}var -c=al(1);ao(c,0,a);return iM(c)}function -wW(a){return 25>>0?a:a+32|0}function -wX(a){return 25>>0?a:a-32|0}function -wZ(a){return bb(go(vb,a),w0)}function -w1(a){var +b=h(c,0);a[1]=b;wr(a);return b}function +w_(a,b){if(0===X4(b))return a?w9(b):w8(b);throw g(w7,1)}function +mU(a){return w_(0,a)}function +w$(a){var +b=dS(a);if(b!==cN&&b!==ec&&b!==dL&&b!==li)return a;return X2(a)}function +ja(a,b){return b?[0,h(a,b[1])]:0}function +mV(a){return a?1:0}function +xa(a){return a?a[1]:I(xb)}function +xc(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function +aA(a){if(0<=a&&dF>=a)return a;return I(xd)}function +xn(a,b){return a-b|0}function +mW(a,b){return 0===xn(a,b)?1:0}function +xe(a){a:{if(40<=a){if(92===a)return xf;if(c6>a)break a}else{if(32<=a){if(39<=a)return xg;break a}if(14>a)switch(a){case +8:return xh;case +9:return xi;case +10:return xj;case +13:return xk}}var +b=an(4);ar(b,0,92);ar(b,1,48+(a/is|0)|0);ar(b,2,48+((a/10|0)%10|0)|0);ar(b,3,48+(a%10|0)|0);return i2(b)}var +c=an(1);ar(c,0,a);return i2(c)}function +xl(a){return 25>>0?a:a+32|0}function +xm(a){return 25>>0?a:a-32|0}function +xo(a){return a2(gE(vB,a),xp)}function +xq(a){var b=0<=a?1:0,c=b?a<=55295?1:0:b;if(c)var d=c;else var -e=57344<=a?1:0,d=e?a<=sq?1:0:e;return d}function -iW(a){return w1(a)?a:F(wZ(a))}function -P(a){return a<<24|uO}function -bD(a){return a}function -bP(a){return a}function -w2(a){return 1===(a>>>27|0)?1:0}function -w3(a){return(a>>>24|0)&7}function -w4(a){return a&16777215}function -w5(a,b){return(8|a)<<24|b}function -w6(a,b){var +e=57344<=a?1:0,d=e?a<=sQ?1:0:e;return d}function +jb(a){return xq(a)?a:I(xo(a))}function +P(a){return a<<24|vd}function +bL(a){return a}function +bX(a){return a}function +xr(a){return 1===(a>>>27|0)?1:0}function +xs(a){return(a>>>24|0)&7}function +xt(a){return a&16777215}function +xu(a,b){return(8|a)<<24|b}function +xv(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -fo(a){return w6(0,a)}function -cC(a,b){var +fw(a){return xv(0,a)}function +cF(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[1],d];c=c[2];d=e}}function -bp(a){return cC(a,0)}function -w_(a,b,c){if(b>1,o=g(n,b),t=o[1],p=g(a-n|0,o[2]),u=p[2];return[0,q(t,p[1],0),u]}var -a=fo(b);return 2<=a?g(a,b)[1]:b}function -xh(d,b){function +a=fw(b);return 2<=a?g(a,b)[1]:b}function +xI(d,b){function A(a,b,c){var -g=a,f=b,e=c;for(;;){if(!g)return cC(f,e);if(!f)return cC(g,e);var +g=a,f=b,e=c;for(;;){if(!g)return cF(f,e);if(!f)return cF(g,e);var j=f[2],k=f[1],l=g[2],h=g[1],m=i(d,h,k);if(0===m){g=l;f=j;e=[0,h,e]}else if(0<=m){f=j;e=[0,k,e]}else{g=l;e=[0,h,e]}}}function B(a,b,c){var -g=a,f=b,e=c;for(;;){if(!g)return cC(f,e);if(!f)return cC(g,e);var +g=a,f=b,e=c;for(;;){if(!g)return cF(f,e);if(!f)return cF(g,e);var j=f[2],k=f[1],l=g[2],h=g[1],m=i(d,h,k);if(0===m){g=l;f=j;e=[0,h,e]}else if(0>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var -a=fo(b);return 2<=a?h(a,b)[1]:b}function -iX(a,b){return b<=a?a:b}function -xi(a,b){return me(a,b)}function -xj(a,b){return a<=b?a:b}function -xk(a){return e+a}function -dM(a,b){var -c=al(a);Vy(c,0,a,b);return c}var -gy=al(0);function -xl(a){var -b=aR(a),c=al(b);ci(a,0,c,0,b);return c}function -mJ(a){return xl(dF(a))}function -gz(a,b,c){if(0<=b&&0<=c&&(aR(a)-c|0)>=b){var -d=al(c);ci(a,b,d,0,c);return d}return F(xm)}function -el(a,b,c){return iM(gz(a,b,c))}function -mK(a,b,c,d,e){if(0<=e&&0<=b&&(aR(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){ci(a,b,c,d,e);return}return F(xn)}function -cn(a,b,c,d,e){if(0<=e&&0<=b&&(l(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){dE(a,b,c,d,e);return}return F(xo)}function -mL(a){var +a=fw(b);return 2<=a?h(a,b)[1]:b}function +jc(a,b){return b<=a?a:b}function +xJ(a,b){return mv(a,b)}function +xK(a,b){return a<=b?a:b}function +xL(a){return e+a}function +dU(a,b){var +c=an(a);XC(c,0,a,b);return c}var +gN=an(0);function +xM(a){var +b=aV(a),c=an(b);cm(a,0,c,0,b);return c}function +m1(a){return xM(dO(a))}function +gO(a,b,c){if(0<=b&&0<=c&&(aV(a)-c|0)>=b){var +d=an(c);cm(a,b,d,0,c);return d}return I(xN)}function +er(a,b,c){return i2(gO(a,b,c))}function +m2(a,b,c,d,e){if(0<=e&&0<=b&&(aV(a)-e|0)>=b&&0<=d&&(aV(c)-e|0)>=d){cm(a,b,c,d,e);return}return I(xO)}function +cq(a,b,c,d,e){if(0<=e&&0<=b&&(l(a)-e|0)>=b&&0<=d&&(aV(c)-e|0)>=d){dN(a,b,c,d,e);return}return I(xP)}function +m3(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -mM(a,b){var -d=aR(b);if(0===d)return b;var -e=al(d),f=d-1|0,g=0;if(f>=0){var -c=g;for(;;){ao(e,c,h(a,cM(b,c)));var +m4(a,b){var +d=aV(b);if(0===d)return b;var +e=an(d),f=d-1|0,g=0;if(f>=0){var +c=g;for(;;){ar(e,c,h(a,cD(b,c)));var i=c+1|0;if(f===c)break;c=i}}return e}function -mN(a,b,c){vK(a,b,VK(c));return}function -em(a,b,c){cj(a,b,c);return}function -dc(a,b){return w5(a,bP(b))}function -b6(a){return 2!==(a>>>6|0)?1:0}function -xx(a){return 5!==(a>>>5|0)?1:0}function -xy(a){return 4!==(a>>>5|0)?1:0}function -xz(a){var -b=a>>4|0)?1:0}function -xB(a,b){return(a&31)<<6|b&63}function -iY(a,b,c){return(a&15)<<12|(b&63)<<6|c&63}function -iZ(a,b,c,d){return(a&7)<<18|(b&63)<<12|(c&63)<<6|d&63}function -mO(a,b){return e$(a,b)}function -cN(a){return dF(a)}function -aX(a){return iM(a)}function -xp(a,b){var -c=aR(a),e=aR(b),d=al(c+e|0);ci(a,0,d,0,c);ci(b,0,d,c,e);return d}function -xq(a){var -d=aR(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!mL(cM(a,b[1])))break;b[1]++}var -c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&mL(cM(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?gz(a,b[1],(c[1]-b[1]|0)+1|0):gy}}function -xr(a){var -b=[0,0],j=aR(a)-1|0,l=0;if(j>=0){var +m5(a,b,c){wa(a,b,XO(c))}function +es(a,b,c){cn(a,b,c)}function +di(a,b){return xu(a,bX(b))}function +cb(a){return 2!==(a>>>6|0)?1:0}function +xY(a){return 5!==(a>>>5|0)?1:0}function +xZ(a){return 4!==(a>>>5|0)?1:0}function +x0(a){var +b=a>>4|0)?1:0}function +x2(a,b){return(a&31)<<6|b&63}function +jd(a,b,c){return(a&15)<<12|(b&63)<<6|c&63}function +je(a,b,c,d){return(a&7)<<18|(b&63)<<12|(c&63)<<6|d&63}function +m6(a,b){return fh(a,b)}function +cS(a){return dO(a)}function +a3(a){return i2(a)}function +xQ(a,b){var +c=aV(a),e=aV(b),d=an(c+e|0);cm(a,0,d,0,c);cm(b,0,d,c,e);return d}function +xR(a){var +d=aV(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!m3(cD(a,b[1])))break;b[1]++}var +c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&m3(cD(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?gO(a,b[1],(c[1]-b[1]|0)+1|0):gN}}function +xS(a){var +b=[0,0],j=aV(a)-1|0,l=0;if(j>=0){var g=l;for(;;){var -e=cM(a,g);a:{b:{c:{if(32<=e){var +e=cD(a,g);a:{b:{c:{if(32<=e){var h=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var i=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var i=4;break a}var i=2}b[1]=b[1]+i|0;var -o=g+1|0;if(j===g)break;g=o}}if(b[1]===aR(a))return a;var -c=al(b[1]);b[1]=0;var -k=aR(a)-1|0,m=0;if(k>=0){var +o=g+1|0;if(j===g)break;g=o}}if(b[1]===aV(a))return a;var +c=an(b[1]);b[1]=0;var +k=aV(a)-1|0,m=0;if(k>=0){var f=m;for(;;){var -d=cM(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(cZ<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case -8:ao(c,b[1],92);b[1]++;ao(c,b[1],98);break a;case -9:ao(c,b[1],92);b[1]++;ao(c,b[1],116);break a;case -10:ao(c,b[1],92);b[1]++;ao(c,b[1],110);break a;case -13:ao(c,b[1],92);b[1]++;ao(c,b[1],114);break a;default:break c}}if(34>d)break b}ao(c,b[1],92);b[1]++;ao(c,b[1],d);break a}ao(c,b[1],92);b[1]++;ao(c,b[1],48+(d/h$|0)|0);b[1]++;ao(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;ao(c,b[1],48+(d%10|0)|0);break a}ao(c,b[1],d)}b[1]++;var +d=cD(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(c6<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case +8:ar(c,b[1],92);b[1]++;ar(c,b[1],98);break a;case +9:ar(c,b[1],92);b[1]++;ar(c,b[1],116);break a;case +10:ar(c,b[1],92);b[1]++;ar(c,b[1],110);break a;case +13:ar(c,b[1],92);b[1]++;ar(c,b[1],r$);break a;default:break c}}if(34>d)break b}ar(c,b[1],92);b[1]++;ar(c,b[1],d);break a}ar(c,b[1],92);b[1]++;ar(c,b[1],48+(d/is|0)|0);b[1]++;ar(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;ar(c,b[1],48+(d%10|0)|0);break a}ar(c,b[1],d)}b[1]++;var n=f+1|0;if(k===f)break;f=n}}return c}function -xs(a,b,c){var -e=[0,b],f=aR(c)-1|0,g=0;if(f>=0){var -d=g;for(;;){e[1]=i(a,e[1],cM(c,d));var +xT(a,b,c){var +e=[0,b],f=aV(c)-1|0,g=0;if(f>=0){var +d=g;for(;;){e[1]=i(a,e[1],cD(c,d));var h=d+1|0;if(f===d)break;d=h}}return e[1]}function -xt(a){return mM(wX,a)}function -xu(a){return mM(wW,a)}function -xv(a,b){return Vs(a,b)}function -xw(a,b,c){vK(a,b,c);return}function -xC(a,b){var -e=e$(a,b);function -c(a,b){return cM(a,b)}var -d=aR(a)-1|0;a:{if(ee<=e){if(f7<=e){if(lL<=e)break a;switch(e-237|0){case +xU(a){return m4(xm,a)}function +xV(a){return m4(xl,a)}function +xW(a,b){return Xw(a,b)}function +xX(a,b,c){wa(a,b,c)}function +x3(a,b){var +e=fh(a,b);function +c(a,b){return cD(a,b)}var +d=aV(a)-1|0;a:{if(ek<=e){if(gj<=e){if(l2<=e)break a;switch(e-237|0){case 0:var f=b+1|0;if(de){var +B=c(a,A);return cb(B)?P(3):di(4,je(e,y,z,B))}}else if(u7>e){var n=b+1|0;if(de)return dc(1,e);if(tg<=e){var -K=b+1|0;if(dd)throw g([0,f,xF],1);if(cZ>=d){em(a,b,d);return 1}if(k2>=d){var -k=b+1|0;return h>>6|0),e(a,k,J|d&63),2)}if(tR>=d){var -j=b+2|0;return h>>12|0),e(a,b+1|0,J|(d>>>6|0)&63),e(a,j,J|d&63),3)}if(sq>>18|0),e(a,b+1|0,J|(d>>>12|0)&63),e(a,b+2|0,J|(d>>>6|0)&63),e(a,i,J|d&63),4)}function -fq(a,b){return aX(dM(a,b))}function -i0(a,b,c){return aX(gz(cN(a),b,c))}function -xG(a,b){return b<=a?a:F(xH)}function -xI(a,b,c){var +t=c(a,s);return cb(t)?P(2):di(3,jd(e,r,t))}if(M>e)return di(1,e);if(tI<=e){var +J=b+1|0;if(dd)throw g([0,f,x6],1);if(c6>=d){es(a,b,d);return 1}if(ld>=d){var +k=b+1|0;return h>>6|0),e(a,k,M|d&63),2)}if(uj>=d){var +j=b+2|0;return h>>12|0),e(a,b+1|0,M|(d>>>6|0)&63),e(a,j,M|d&63),3)}if(sQ>>18|0),e(a,b+1|0,M|(d>>>12|0)&63),e(a,b+2|0,M|(d>>>6|0)&63),e(a,i,M|d&63),4)}function +fy(a,b){return a3(dU(a,b))}function +fz(a,b,c){return a3(gO(cS(a),b,c))}function +x7(a,b){return b<=a?a:I(x8)}function +x9(a,b,c){var e=a,d=c;for(;;){if(!d)return e;var f=d[1];if(!d[2])return l(f)+e|0;var -g=d[2];e=xG((l(f)+b|0)+e|0,e);d=g}}function -xJ(a,b,c,d,e){var +g=d[2];e=x7((l(f)+b|0)+e|0,e);d=g}}function +x_(a,b,c,d,e){var h=b,g=e;for(;;){if(!g)return a;var -f=g[1];if(!g[2]){dE(f,0,a,h,l(f));return a}var -i=g[2];dE(f,0,a,h,l(f));dE(c,0,a,h+l(f)|0,d);h=(h+l(f)|0)+d|0;g=i}}function -mP(a,b){if(!b)return xK;var -c=l(a);return aX(xJ(al(xI(0,c,b)),0,a,c,b))}function -mQ(a){var +f=g[1];if(!g[2]){dN(f,0,a,h,l(f));return a}var +i=g[2];dN(f,0,a,h,l(f));dN(c,0,a,h+l(f)|0,d);h=(h+l(f)|0)+d|0;g=i}}function +m7(a,b){if(!b)return x$;var +c=l(a);return a3(x_(an(x9(0,c,b)),0,a,c,b))}function +m8(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -mR(a,b,c,d){var -e=c;for(;;){if(b<=e)throw g(a6,1);if(bn(a,e)===d)return e;e=e+1|0}}function -xR(a,b,c){var -d=l(a);if(0<=b&&d>=b)try{mR(a,d,b,c);var +m9(a,b,c,d){var +e=c;for(;;){if(b<=e)throw g(br,1);if(bg(a,e)===d)return e;e=e+1|0}}function +yg(a,b,c){var +d=l(a);if(0<=b&&d>=b)try{m9(a,d,b,c);var f=1;return f}catch(f){var -e=O(f);if(e===a6)return 0;throw g(e,0)}return F(xS)}function -fr(a,b){return ff(a,b)}function -gA(a,b){return xv(cN(a),b)}function -i1(a,b){return a==b?1:0}function -xL(a,b){var +e=T(f);if(e===br)return 0;throw g(e,0)}return I(yh)}function +m_(a,b){var +d=[0,0],e=[0,l(b)],f=l(b)-1|0;if(f>=0){var +c=f;for(;;){if(bg(b,c)===a){var +h=d[1];d[1]=[0,fz(b,c+1|0,(e[1]-c|0)-1|0),h];e[1]=c}var +i=c-1|0;if(0===c)break;c=i}}var +g=d[1];return[0,fz(b,0,e[1]),g]}function +fA(a,b){return fn(a,b)}function +gP(a,b){return xW(cS(a),b)}function +jf(a,b){return a===b?1:0}function +ya(a,b){var d=l(b)-1|0,e=0;if(d>=0){var -c=e;for(;;){h(a,bn(b,c));var -f=c+1|0;if(d===c)break;c=f}}return}function -xM(a,b,c){return xs(a,b,cN(c))}function -xN(a){if(a==e)return a;if(!mQ(bn(a,0))&&!mQ(bn(a,l(a)-1|0)))return a;return aX(xq(cN(a)))}function -xO(a){return aX(xr(cN(a)))}function -xP(a,b,c){var -d=l(a);if(0<=b&&d>=b)return mR(a,d,b,c);return F(xQ)}function -xT(a,b){return xR(a,0,b)}function -xU(a){return aX(xt(cN(a)))}function -xV(a){return aX(xu(cN(a)))}function -xW(a,b){return xC(cN(a),b)}function -mS(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){Vg(a,b,c,d,e);return}return F(x1)}function -x5(a,b){var +c=e;for(;;){h(a,bg(b,c));var +f=c+1|0;if(d===c)break;c=f}}}function +yb(a,b,c){return xT(a,b,cS(c))}function +yc(a){if(a===e)return a;if(!m8(bg(a,0))&&!m8(bg(a,l(a)-1|0)))return a;return a3(xR(cS(a)))}function +yd(a){return a3(xS(cS(a)))}function +ye(a,b,c){var +d=l(a);if(0<=b&&d>=b)return m9(a,d,b,c);return I(yf)}function +yi(a,b){return yg(a,0,b)}function +yj(a){return a3(xU(cS(a)))}function +yk(a){return a3(xV(cS(a)))}function +yl(a,b){return x3(cS(a),b)}function +m$(a,b){if(0===a)return[0];if(0>a)return I(ym);var +d=ca(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var +c=f;for(;;){d[1+c]=h(b,c);var +g=c+1|0;if(e===c)break;c=g}}return d}function +na(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){Xj(a,b,c,d,e);return}return I(yp)}function +yv(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -gB(a){if(!a)return[0];var -b=a[2],c=a[1],e=ck(x5(0,a),c);return function(a,b){var +fB(a){if(!a)return[0];var +b=a[2],c=a[1],e=ca(yv(0,a),c);return function(a,b){var d=a,c=b;for(;;){if(!c)return e;var f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function -xX(a,b){if(0===a)return[0];if(0>a)return F(xY);var -d=ck(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var -c=f;for(;;){d[1+c]=h(b,c);var -g=c+1|0;if(e===c)break;c=g}}return d}function -xZ(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return Vh(a,b,c);return F(x0)}function -x2(a,b,c){if(b.length-1!==c.length-1)return F(x3);var +yn(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return Xl(a,b,c);return I(yo)}function +yq(a,b){var +d=b.length-2|0,e=0;if(d>=0){var +c=e;for(;;){h(a,b[1+c]);var +f=c+1|0;if(d===c)break;c=f}}}function +yr(a,b,c){if(b.length-1!==c.length-1)return I(ys);var e=b.length-2|0,f=0;if(e>=0){var d=f;for(;;){i(a,b[1+d],c[1+d]);var g=d+1|0;if(e===d)break;d=g}}return 0}function -x4(e){return function(a,b){var +yt(a,b){var +d=b.length-1;if(0===d)return[0];var +e=ca(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var +c=g;for(;;){e[1+c]=h(a,b[1+c]);var +i=c+1|0;if(f===c)break;c=i}}return e}function +yu(e){return function(a,b){var c=a,d=b;for(;;){if(0>c)return d;var f=[0,e[1+c],d];c=c-1|0;d=f}}(e.length-2|0,0)}function -gC(a){return el(a[2],a[5],a[6]-a[5]|0)}function -cO(a,b){return e$(a[2],b)}function -x6(a,b,c){var -e=v3(a,b,c),f=0<=e?1:0,g=f?c[12]!==i2?1:0:f;if(g){c[11]=c[12];var +gQ(a){return er(a[2],a[5],a[6]-a[5]|0)}function +cT(a,b){return fh(a[2],b)}function +yw(a,b,c){var +e=ws(a,b,c),f=0<=e?1:0,g=f?c[12]!==jg?1:0:f;if(g){c[11]=c[12];var d=c[12];c[12]=[0,d[1],d[2],d[3],c[4]+c[6]|0]}return e}function -x7(a,b){var -c=a?a[1]:1,d=c?mT:i2,e=c?mT:i2;return[0,function(a){a[9]=1;return 0},mJ(b),l(b),0,0,0,0,0,1,[0],e,d]}function -x8(a,b,c){return el(a[2],b,c-b|0)}function -x9(a,b){return e$(a[2],a[5]+b|0)}function -x_(l){function -q(a){return a?a[4]:0}function +yx(a,b){var +c=a?a[1]:1,d=c?nb:jg,e=c?nb:jg;return[0,function(a){a[9]=1;return 0},m1(b),l(b),0,0,0,0,0,1,[0],e,d]}function +yy(a,b,c){return er(a[2],b,c-b|0)}function +yz(a,b){return fh(a[2],a[5]+b|0)}function +yA(k){function +h(a){return a?a[4]:0}function d(a,b,c){var d=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function -e(a,b,c){var -g=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var -v=h<=g?g+1|0:h+1|0;return[0,a,b,c,v]}if(!c)return F(yc);var -j=c[3],l=c[2],f=c[1],r=q(f);if(r<=q(j))return d(d(a,b,f),l,j);if(!f)return F(yb);var -s=f[2],t=f[1],u=d(f[3],l,j);return d(d(a,b,t),s,u)}function +j(a,b,c){var +g=a?a[4]:0,i=c?c[4]:0;if((i+2|0)=i){var +v=i<=g?g+1|0:i+1|0;return[0,a,b,c,v]}if(!c)return I(yE);var +k=c[3],m=c[2],f=c[1],r=h(f);if(r<=h(k))return d(d(a,b,f),m,k);if(!f)return I(yD);var +s=f[2],t=f[1],u=d(f[3],m,k);return d(d(a,b,t),s,u)}function c(a,b){if(!b)return[0,0,a,0,1];var -d=b[3],f=b[2],g=b[1],h=i(l[1],a,f);if(0===h)return b;if(0<=h){var -j=c(a,d);return d===j?b:e(g,f,j)}var -k=c(a,g);return g===k?b:e(k,f,d)}function -k(a){return[0,0,a,0,1]}function -v(a,b){if(!b)return k(a);var -c=b[3],d=b[2];return e(v(a,b[1]),d,c)}function -w(a,b){if(!b)return k(a);var -c=b[2],d=b[1];return e(d,c,w(a,b[3]))}function -j(a,b,c){if(!a)return v(b,c);if(!c)return w(b,a);var -f=c[4],g=a[4],h=c[3],i=c[2],k=c[1],l=a[3],m=a[2],n=a[1];return(f+2|0)=a>>>0)switch(a){case 0:return[0,0,b];case 1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case @@ -1564,295 +1503,241 @@ c(a,b){if(3>=a>>>0)switch(a){case h=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var i=b[2];if(i){var j=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var -k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,yf],1);var -o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(fo(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,z,function(a){return a?0:1},,u,n,o,,,p,,,A,function(a,b){return 0===A(a,b)?1:0},s,B,C,,,,,b,,function(a){return D(0,a)},,,,,,,,,,,function(a,b){var -c=b;for(;;){if(!c)return;var -d=c[2],e=c[3],f=c[1];if(h(a,d))return H(d,a,e);c=f}},,,,,,,,function(a){if(!a)return z;var -e=a[2],b=a[1];if(!e)return k(b);var -f=e[2],d=e[1];if(!f)return c(d,k(b));var -g=f[2],h=f[1];if(!g)return c(h,c(d,k(b)));var -i=g[2],j=g[1];if(!i)return c(j,c(h,c(d,k(b))));if(i[2])return I(xh(l[1],a));var -m=i[1];return c(m,c(j,c(h,c(d,k(b)))))}]}function -mU(a){var -b=x_(a);return[0,b[17],b[4],,b[20],b[21],b[22],,b[25],b[37],b[39],,,,,,,,,,,,b[50],b[31],b[32],,,,,,b[18],,b[29],b[28],b[30],,,,b[58]]}function -yg(d){function -l(a){return a?a[5]:0}function -j(a,b,c,d){var -e=l(a),f=l(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function -s(a,b){return[0,0,a,b,0,1]}function +k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,yF],1);var +o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(fw(a),a)[1]}return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return e(0,a)},,,,,,,,,,,,,,,,,,,function(a){if(!a)return m;var +f=a[2],d=a[1];if(!f)return b(d);var +g=f[2],e=f[1];if(!g)return c(e,b(d));var +h=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var +j=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return n(xI(k[1],a));var +o=j[1];return c(o,c(l,c(i,c(e,b(d)))))}]}function +nc(a){var +b=yA(a);return[0,,,,,,,,,,b[39],,,,,,,,,,,,,,,,,,,,,,,,,,,,b[58]]}function +yG(f){function +h(a){return a?a[5]:0}function e(a,b,c,d){var -g=a?a[5]:0,h=d?d[5]:0;if((h+2|0)=h){var -A=h<=g?g+1|0:h+1|0;return[0,a,b,c,d,A]}if(!d)return F(yk);var -k=d[4],o=d[3],p=d[2],f=d[1],v=l(f);if(v<=l(k))return j(j(a,b,c,f),p,o,k);if(!f)return F(yj);var -w=f[3],x=f[2],y=f[1],z=j(f[4],p,o,k);return j(j(a,b,c,y),x,w,z)}function -p(a,b,c){if(!c)return[0,0,a,b,0,1];var -f=c[4],h=c[3],j=c[2],g=c[1],n=c[5],k=i(d[1],a,j);if(0===k)return h===b?c:[0,g,a,b,f,n];if(0<=k){var -l=p(a,b,f);return f===l?c:e(g,j,h,l)}var -m=p(a,b,g);return g===m?c:e(m,j,h,f)}function -t(a){var -b=a;for(;;){if(!b)throw g(a6,1);var +e=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function +d(a,b,c,d){var +i=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var +A=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,A]}if(!d)return I(yK);var +l=d[4],o=d[3],p=d[2],g=d[1],v=h(g);if(v<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return I(yJ);var +w=g[3],x=g[2],y=g[1],z=e(g[4],p,o,l);return e(e(a,b,c,y),x,w,z)}function +j(a,b,c){if(!c)return[0,0,a,b,0,1];var +e=c[4],h=c[3],k=c[2],g=c[1],o=c[5],l=i(f[1],a,k);if(0===l)return h===b?c:[0,g,a,b,e,o];if(0<=l){var +m=j(a,b,e);return e===m?c:d(g,k,h,m)}var +n=j(a,b,g);return g===n?c:d(n,k,h,e)}function +m(a){var +b=a;for(;;){if(!b)throw g(br,1);var c=b[1];if(!c)return[0,b[2],b[3]];b=c}}function -c(a){if(!a)return F(yl);var +c(a){if(!a)return I(yL);var b=a[1];if(!b)return a[4];var -d=a[4],f=a[3],g=a[2];return e(c(b),g,f,d)}function -u(a,b){if(!a)return b;if(!b)return a;var -d=t(b),f=d[2],g=d[1];return e(a,g,f,c(b))}function -q(a,b){if(!b)return 0;var -c=b[4],h=b[3],g=b[2],f=b[1],j=i(d[1],a,g);if(0===j)return u(f,c);if(0<=j){var -k=q(a,c);return c===k?b:e(f,g,h,k)}var -l=q(a,f);return f===l?b:e(l,g,h,c)}function -r(a,b,c){if(!c){var -q=h(b,0);return q?[0,0,a,q[1],0,1]:0}var -f=c[4],j=c[3],k=c[2],g=c[1],s=c[5],l=i(d[1],a,k);if(0===l){var -m=h(b,[0,j]);if(!m)return u(g,f);var -n=m[1];return j===n?c:[0,g,a,n,f,s]}if(0<=l){var -o=r(a,b,f);return f===o?c:e(g,k,j,o)}var -p=r(a,b,g);return g===p?c:e(p,k,j,f)}function -v(a,b){var -c=b;for(;;){if(!c)return;var -d=c[4],e=c[3],f=c[2];v(a,c[1]);i(a,f,e);c=d}}function -w(a,b,c){var +e=a[4],f=a[3],g=a[2];return d(c(b),g,f,e)}function +n(a,b){if(!a)return b;if(!b)return a;var +e=m(b),f=e[2],g=e[1];return d(a,g,f,c(b))}function +k(a,b){if(!b)return 0;var +c=b[4],h=b[3],g=b[2],e=b[1],j=i(f[1],a,g);if(0===j)return n(e,c);if(0<=j){var +l=k(a,c);return c===l?b:d(e,g,h,l)}var +m=k(a,e);return e===m?b:d(m,g,h,c)}function +l(a,b,c){var d=b,e=c;for(;;){if(!d)return e;var -f=d[4],g=d[3],h=d[2],i=a$(a,h,g,w(a,d[1],e));d=f;e=i}}function -x(a,b){var -c=b;for(;;){if(!c)return 1;var -g=c[4],h=c[1],d=i(a,c[2],c[3]);if(d){var -e=x(a,h);if(e){c=g;continue}var -f=e}else -var -f=d;return f}}function -y(a,b,c){if(!c)return s(a,b);var -d=c[4],f=c[3],g=c[2];return e(y(a,b,c[1]),g,f,d)}function -z(a,b,c){if(!c)return s(a,b);var -d=c[3],f=c[2],g=c[1];return e(g,f,d,z(a,b,c[4]))}function -m(a,b,c,d){if(!a)return y(b,c,d);if(!d)return z(b,c,a);var -f=d[5],g=a[5],h=d[4],i=d[3],k=d[2],l=d[1],n=a[4],o=a[3],p=a[2],q=a[1];return(f+2|0)=(d+b|0))break;c[1]=2*c[1]|0}if(fl=(d+b|0))break;c[1]=2*c[1]|0}if(ft=b)return el(a[1][1],b,c);return F(yx)}function -yy(a){a[2]=0;a[1]=[0,a[3],aR(a[3])];return}function -yB(a,b,c,d){return er(a,aX(b),c,d)}var -i9=[0,0];function -mZ(a){return a}function -m0(a){return a!==i9?1:0}function -m1(a){return a}(function(a){Vw(ck(8,i9));return}(0));var -yC=fn(0),m2=fn(0);function -yD(a){for(;;){var -b=fm(m2),c=1-mB(m2,b,[0,a,b]);if(!c)return c}}function -cP(a,b){var -c=[0,wE(yC,1),b];if(a)yD([0,c,a[1]]);return c}function -m3(d){for(;;){var -a=vN(0),b=a.length-1;if(d=b)return er(a[1][1],b,c);return I(yV)}function +yW(a){a[2]=0;a[1]=[0,a[3],aV(a[3])]}function +yZ(a,b,c,d){return ex(a,a3(b),c,d)}var +jn=[0,0];function +nh(a){return a}function +ni(a){return a!==jn?1:0}function +nj(a){return a}(function(a){XA(ca(8,jn))}(0));var +y0=fv(0),nk=fv(0);function +y1(a){for(;;){var +b=fu(nk),c=1-mT(nk,b,[0,a,b]);if(!c)return c}}function +cU(a,b){var +c=[0,w5(y0,1),b];if(a)y1([0,c,a[1]]);return c}function +nl(d){for(;;){var +a=wd(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e+uz|0){case -5:c:if(c<(d+2|0)&&1e){if(32!==e){if(43>e)break a;switch(e+u0|0){case +5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var -f=dM(d+1|0,48);cj(f,0,e);cn(b,1,f,(d-c|0)+2|0,c-1|0);return aX(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(c>>0)break a}else if(65>e)break a}if(ca)return b;var +14:return AA;default:return AJ}}function +nr(a,b){var +d=fq(b),e=y7(AK,a),c=nn(16);ey(c,37);y8(c,a);ey(c,46);ba(c,xL(d));ey(c,e);return np(c)}function +gS(a,b){if(13>a)return b;var h=[0,0],i=l(b)-1|0,o=0;if(i>=0){var -d=o;for(;;){if(9>=bn(b,d)+ge>>>0)h[1]++;var +d=o;for(;;){if(9>=bg(b,d)+gt>>>0)h[1]++;var r=d+1|0;if(i===d)break;d=r}}var -j=h[1],k=al(l(b)+((j-1|0)/3|0)|0),m=[0,0];function -e(a){cj(k,m[1],a);m[1]++;return}var +j=h[1],k=an(l(b)+((j-1|0)/3|0)|0),m=[0,0];function +e(a){cn(k,m[1],a);m[1]++}var f=[0,((j-1|0)%3|0)+1|0],n=l(b)-1|0,p=0;if(n>=0){var c=p;for(;;){var -g=bn(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var -q=c+1|0;if(n===c)break;c=q}}return aX(k)}function -An(a,b){return gE(a,go(zu(a),b))}function -Ao(a,b){return gE(a,go(zW(a),b))}function -Ap(a,b){return gE(a,go(z_(a),b))}function -Aq(a,b){return gE(a,VN(zI(a),b))}function -cQ(d,b,c){function +g=bg(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var +q=c+1|0;if(n===c)break;c=q}}return a3(k)}function +AL(a,b){return gS(a,gE(zS(a),b))}function +AM(a,b){return gS(a,gE(Ai(a),b))}function +AN(a,b){return gS(a,gE(Aw(a),b))}function +AO(a,b){return gS(a,XR(z6(a),b))}function +cV(d,b,c){function a(a){switch(d[1]){case 0:var e=45;break;case 1:var e=43;break;default:var -e=32}return VI(c,b,e)}function +e=32}return XM(c,b,e)}function e(a){var -b=iD(c);return 3===b?c<0.?As:At:4<=b?Au:a}function +b=iS(c);return 3===b?c<0.?AQ:AR:4<=b?AS:a}function f(b){var e=l(b);return function(a){var c=a;for(;;){if(c===e)return 0;var -d=V(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:bb(b,Ar)}switch(d[2]){case -5:return e(f(l7(m9(d,b),c)));case +d=X(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:a2(b,AP)}switch(d[2]){case +5:return e(f(mm(nr(d,b),c)));case 6:return a(0);case -7:return xU(a(0));case -8:return e(a(0));default:return l7(m9(d,b),c)}}function -Av(a){var -b=wP(a),c=l(b),d=dM(c+2|0,39);dE(b,0,d,1,c);return aX(d)}function -Aw(a){var -b=m5(16);ja(b,a);return m7(b)}function -fV(a,b,c,d){var +7:return yj(a(0));case +8:return e(a(0));default:return mm(nr(d,b),c)}}function +AT(a){var +b=xe(a),c=l(b),d=dU(c+2|0,39);dN(b,0,d,1,c);return a3(d)}function +AU(a){var +b=nn(16);jq(b,a);return np(b)}function +f7(a,b,c,d){var k=b,j=c,e=d;for(;;){if(typeof e==="number")return h(k,j);switch(e[0]){case 0:var s=e[1];return function(a){return G(k,[5,j,a],s)};case 1:var -t=e[1];return function(a){return G(k,[4,j,Av(a)],t)};case -2:return jb(k,j,e[2],e[1],function(a){return a});case -3:return jb(k,j,e[2],e[1],zt);case -4:return gF(k,j,e[4],e[2],e[3],An,e[1]);case -5:return gF(k,j,e[4],e[2],e[3],Ao,e[1]);case -6:return gF(k,j,e[4],e[2],e[3],Ap,e[1]);case -7:return gF(k,j,e[4],e[2],e[3],Aq,e[1]);case -8:return Ax(k,j,e[4],e[2],e[3],e[1]);case -9:return jb(k,j,e[2],e[1],wr);case +t=e[1];return function(a){return G(k,[4,j,AT(a)],t)};case +2:return jr(k,j,e[2],e[1],function(a){return a});case +3:return jr(k,j,e[2],e[1],zR);case +4:return gT(k,j,e[4],e[2],e[3],AL,e[1]);case +5:return gT(k,j,e[4],e[2],e[3],AM,e[1]);case +6:return gT(k,j,e[4],e[2],e[3],AN,e[1]);case +7:return gT(k,j,e[4],e[2],e[3],AO,e[1]);case +8:return AV(k,j,e[4],e[2],e[3],e[1]);case +9:return jr(k,j,e[2],e[1],wT);case 10:j=[7,j];e=e[1];break;case 11:j=[2,j,e[1]];e=e[2];break;case 12:j=[3,j,e[1]];e=e[2];break;case 13:var -u=e[3],v=Aw(e[2]);return function(a){return G(k,[4,j,v],u)};case +u=e[3],v=AU(e[2]);return function(a){return G(k,[4,j,v],u)};case 14:var -w=e[3],x=e[2];return function(a){return G(k,j,am(zs(a[1],x),w))};case +w=e[3],x=e[2];return function(a){return G(k,j,ao(zQ(a[1],x),w))};case 15:var y=e[1];return function(c,b){return G(k,[6,j,function(a){return i(c,a,b)}],y)};case 16:var @@ -2311,269 +2196,269 @@ z=e[1];return function(a){return G(k,[6,j,a],z)};case l=e[1];if(0===l[0]){let b=j,c=k,d=e[2];k=function(a){return G(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let b=j,c=k,d=e[2];k=function(a){return G(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case -19:throw g([0,f,Az],1);case +19:throw g([0,f,AX],1);case 20:var -A=e[3],B=[8,j,AA];return function(a){return G(k,B,A)};case +A=e[3],B=[8,j,AY];return function(a){return G(k,B,A)};case 21:var -C=e[2];return function(a){return G(k,[4,j,go(ri,a)],C)};case +C=e[2];return function(a){return G(k,[4,j,gE(rK,a)],C)};case 22:var D=e[1];return function(a){return G(k,[5,j,a],D)};case 23:var -m=e[2],o=e[1];return a<50?qD(a+1|0,k,j,o,m):n(qD,[0,k,j,o,m]);default:var -p=e[3],q=e[1],r=h(e[2],0);return a<50?kS(a+1|0,k,j,p,q,r):n(kS,[0,k,j,p,q,r])}}}function -G(a,b,c){return bN(fV(0,a,b,c))}function -qD(a,b,c,d,e){if(typeof +m=e[2],o=e[1];return a<50?q3(a+1|0,k,j,o,m):n(q3,[0,k,j,o,m]);default:var +p=e[3],q=e[1],r=h(e[2],0);return a<50?k6(a+1|0,k,j,p,q,r):n(k6,[0,k,j,p,q,r])}}}function +G(a,b,c){return bV(f7(0,a,b,c))}function +q3(a,b,c,d,e){if(typeof d==="number")switch(d){case -0:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -1:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -2:throw g([0,f,AB],1);default:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e])}switch(d[0]){case -0:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -1:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -2:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -3:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -4:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -5:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -6:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -7:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case -8:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);case +0:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +1:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +2:throw g([0,f,AZ],1);default:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e])}switch(d[0]){case +0:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +1:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +2:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +3:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +4:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +5:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +6:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +7:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case +8:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);case 9:var -h=d[2];return a<50?kT(a+1|0,b,c,h,e):n(kT,[0,b,c,h,e]);case -10:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e]);default:return a<50?Z(a+1|0,b,c,e):n(Z,[0,b,c,e])}}function -kT(a,h,c,d,e){if(typeof -d==="number")return a<50?Z(a+1|0,h,c,e):n(Z,[0,h,c,e]);switch(d[0]){case +h=d[2];return a<50?k7(a+1|0,b,c,h,e):n(k7,[0,b,c,h,e]);case +10:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e]);default:return a<50?ab(a+1|0,b,c,e):n(ab,[0,b,c,e])}}function +k7(a,h,c,d,e){if(typeof +d==="number")return a<50?ab(a+1|0,h,c,e):n(ab,[0,h,c,e]);switch(d[0]){case 0:var -b=d[1];return function(a){return bS(h,c,b,e)};case +b=d[1];return function(a){return b0(h,c,b,e)};case 1:var -i=d[1];return function(a){return bS(h,c,i,e)};case +i=d[1];return function(a){return b0(h,c,i,e)};case 2:var -j=d[1];return function(a){return bS(h,c,j,e)};case +j=d[1];return function(a){return b0(h,c,j,e)};case 3:var -k=d[1];return function(a){return bS(h,c,k,e)};case +k=d[1];return function(a){return b0(h,c,k,e)};case 4:var -l=d[1];return function(a){return bS(h,c,l,e)};case +l=d[1];return function(a){return b0(h,c,l,e)};case 5:var -m=d[1];return function(a){return bS(h,c,m,e)};case +m=d[1];return function(a){return b0(h,c,m,e)};case 6:var -o=d[1];return function(a){return bS(h,c,o,e)};case +o=d[1];return function(a){return b0(h,c,o,e)};case 7:var -p=d[1];return function(a){return bS(h,c,p,e)};case +p=d[1];return function(a){return b0(h,c,p,e)};case 8:var -q=d[2];return function(a){return bS(h,c,q,e)};case +q=d[2];return function(a){return b0(h,c,q,e)};case 9:var -r=d[3],s=d[2],t=aS(aJ(d[1]),s);return function(a){return bS(h,c,bo(t,r),e)};case +r=d[3],s=d[2],t=aW(aL(d[1]),s);return function(a){return b0(h,c,bq(t,r),e)};case 10:var -u=d[1];return function(a,b){return bS(h,c,u,e)};case +u=d[1];return function(a,b){return b0(h,c,u,e)};case 11:var -v=d[1];return function(a){return bS(h,c,v,e)};case +v=d[1];return function(a){return b0(h,c,v,e)};case 12:var -w=d[1];return function(a){return bS(h,c,w,e)};case -13:throw g([0,f,AC],1);default:throw g([0,f,AD],1)}}function -bS(a,b,c,d){return bN(kT(0,a,b,c,d))}function -Z(a,b,c,d){var -e=[8,c,AE];return a<50?fV(a+1|0,b,e,d):n(fV,[0,b,e,d])}function -jb(g,f,c,d,e){if(typeof +w=d[1];return function(a){return b0(h,c,w,e)};case +13:throw g([0,f,A0],1);default:throw g([0,f,A1],1)}}function +b0(a,b,c,d){return bV(k7(0,a,b,c,d))}function +ab(a,b,c,d){var +e=[8,c,A2];return a<50?f7(a+1|0,b,e,d):n(f7,[0,b,e,d])}function +jr(g,f,c,d,e){if(typeof d==="number")return function(a){return G(g,[4,f,h(e,a)],c)};if(0===d[0]){var -b=d[2],i=d[1];return function(a){return G(g,[4,f,bF(i,b,h(e,a))],c)}}var -j=d[1];return function(a,b){return G(g,[4,f,bF(j,a,h(e,b))],c)}}function -gF(k,j,h,d,e,f,g){if(typeof +b=d[2],i=d[1];return function(a){return G(g,[4,f,bN(i,b,h(e,a))],c)}}var +j=d[1];return function(a,b){return G(g,[4,f,bN(j,a,h(e,b))],c)}}function +gT(k,j,h,d,e,f,g){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return G(k,[4,j,et(a,i(f,g,b))],h)}:function(a){return G(k,[4,j,i(f,g,a)],h)};var -b=e[1];return function(a){return G(k,[4,j,et(b,i(f,g,a))],h)}}if(0===d[0]){var +e==="number")return e?function(a,b){return G(k,[4,j,ez(a,i(f,g,b))],h)}:function(a){return G(k,[4,j,i(f,g,a)],h)};var +b=e[1];return function(a){return G(k,[4,j,ez(b,i(f,g,a))],h)}}if(0===d[0]){var c=d[2],l=d[1];if(typeof -e==="number")return e?function(a,b){return G(k,[4,j,bF(l,c,et(a,i(f,g,b)))],h)}:function(a){return G(k,[4,j,bF(l,c,i(f,g,a))],h)};var -n=e[1];return function(a){return G(k,[4,j,bF(l,c,et(n,i(f,g,a)))],h)}}var +e==="number")return e?function(a,b){return G(k,[4,j,bN(l,c,ez(a,i(f,g,b)))],h)}:function(a){return G(k,[4,j,bN(l,c,i(f,g,a))],h)};var +n=e[1];return function(a){return G(k,[4,j,bN(l,c,ez(n,i(f,g,a)))],h)}}var m=d[1];if(typeof -e==="number")return e?function(a,b,c){return G(k,[4,j,bF(m,a,et(b,i(f,g,c)))],h)}:function(a,b){return G(k,[4,j,bF(m,a,i(f,g,b))],h)};var -o=e[1];return function(a,b){return G(k,[4,j,bF(m,a,et(o,i(f,g,b)))],h)}}function -Ax(i,h,g,d,e,f){if(typeof +e==="number")return e?function(a,b,c){return G(k,[4,j,bN(m,a,ez(b,i(f,g,c)))],h)}:function(a,b){return G(k,[4,j,bN(m,a,i(f,g,b))],h)};var +o=e[1];return function(a,b){return G(k,[4,j,bN(m,a,ez(o,i(f,g,b)))],h)}}function +AV(i,h,g,d,e,f){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return G(i,[4,h,cQ(f,a,b)],g)}:function(a){return G(i,[4,h,cQ(f,i$(f),a)],g)};var -b=e[1];return function(a){return G(i,[4,h,cQ(f,b,a)],g)}}if(0===d[0]){var +e==="number")return e?function(a,b){return G(i,[4,h,cV(f,a,b)],g)}:function(a){return G(i,[4,h,cV(f,jp(f),a)],g)};var +b=e[1];return function(a){return G(i,[4,h,cV(f,b,a)],g)}}if(0===d[0]){var c=d[2],j=d[1];if(typeof -e==="number")return e?function(a,b){return G(i,[4,h,bF(j,c,cQ(f,a,b))],g)}:function(a){return G(i,[4,h,bF(j,c,cQ(f,i$(f),a))],g)};var -l=e[1];return function(a){return G(i,[4,h,bF(j,c,cQ(f,l,a))],g)}}var +e==="number")return e?function(a,b){return G(i,[4,h,bN(j,c,cV(f,a,b))],g)}:function(a){return G(i,[4,h,bN(j,c,cV(f,jp(f),a))],g)};var +l=e[1];return function(a){return G(i,[4,h,bN(j,c,cV(f,l,a))],g)}}var k=d[1];if(typeof -e==="number")return e?function(a,b,c){return G(i,[4,h,bF(k,a,cQ(f,b,c))],g)}:function(a,b){return G(i,[4,h,bF(k,a,cQ(f,i$(f),b))],g)};var -m=e[1];return function(a,b){return G(i,[4,h,bF(k,a,cQ(f,m,b))],g)}}function -kS(a,b,c,d,e,f){if(e){var -i=e[1];return function(a){return Ay(b,c,d,i,h(f,a))}}var -g=[4,c,f];return a<50?fV(a+1|0,b,g,d):n(fV,[0,b,g,d])}function -Ay(a,b,c,d,e){return bN(kS(0,a,b,c,d,e))}function -cR(a,b){var +e==="number")return e?function(a,b,c){return G(i,[4,h,bN(k,a,cV(f,b,c))],g)}:function(a,b){return G(i,[4,h,bN(k,a,cV(f,jp(f),b))],g)};var +m=e[1];return function(a,b){return G(i,[4,h,bN(k,a,cV(f,m,b))],g)}}function +k6(a,b,c,d,e,f){if(e){var +i=e[1];return function(a){return AW(b,c,d,i,h(f,a))}}var +g=[4,c,f];return a<50?f7(a+1|0,b,g,d):n(f7,[0,b,g,d])}function +AW(a,b,c,d,e){return bV(k6(0,a,b,c,d,e))}function +cW(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],g=m8(c[2]);cR(a,f);return fj(a,g);case +f=c[1],g=nq(c[2]);cW(a,f);return fr(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cR(a,e);fj(a,AF);c=i}else{var -j=d[1];cR(a,e);fj(a,AG);c=j}break;case +i=d[1];cW(a,e);fr(a,A3);c=i}else{var +j=d[1];cW(a,e);fr(a,A4);c=j}break;case 6:var -m=c[2];cR(a,c[1]);return h(m,a);case -7:cR(a,c[1]);return fk(a);case +m=c[2];cW(a,c[1]);return h(m,a);case +7:cW(a,c[1]);return fs(a);case 8:var -n=c[2];cR(a,c[1]);return F(n);case +n=c[2];cW(a,c[1]);return I(n);case 2:case 4:var -k=c[2];cR(a,c[1]);return fj(a,k);default:var -l=c[2];cR(a,c[1]);return wD(a,l)}}}function -cS(a,b){var +k=c[2];cW(a,c[1]);return fr(a,k);default:var +l=c[2];cW(a,c[1]);return w4(a,l)}}}function +cX(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],g=m8(c[2]);cS(a,f);return aI(a,g);case +f=c[1],g=nq(c[2]);cX(a,f);return aK(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cS(a,e);aI(a,AH);c=i}else{var -j=d[1];cS(a,e);aI(a,AI);c=j}break;case +i=d[1];cX(a,e);aK(a,A5);c=i}else{var +j=d[1];cX(a,e);aK(a,A6);c=j}break;case 6:var -n=c[2];cS(a,c[1]);return aI(a,h(n,0));case +n=c[2];cX(a,c[1]);return aK(a,h(n,0));case 7:c=c[1];break;case 8:var -o=c[2];cS(a,c[1]);return F(o);case +o=c[2];cX(a,c[1]);return I(o);case 2:case 4:var -k=c[2];cS(a,c[1]);return aI(a,k);default:var -l=c[2];cS(a,c[1]);return m(a,l)}}}function -AJ(a){var -c=a[1],b=bq(cK);return G(function(a){cS(b,a);return fh(bx(b))},0,c)}function -m_(c){if(c==e)return AK;var +k=c[2];cX(a,c[1]);return aK(a,k);default:var +l=c[2];cX(a,c[1]);return m(a,l)}}}function +A7(a){var +c=a[1],b=bt(cP);return G(function(a){cX(b,a);return fp(bA(b))},0,c)}function +ns(c){if(c===e)return A8;var f=l(c);function -j(a){return h(AJ(AL),c)}function +j(a){return h(A7(A9),c)}function k(a){var b=a;for(;;){if(b===f)return b;var -d=V(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var +d=X(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var i=k(0),o=function(a,b){var -d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=i0(c,i,o-i|0),d=k(o),m=function(a,b){var +d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=fz(c,i,o-i|0),d=k(o),m=function(a,b){var d=b;for(;;){if(d===f)return d;var -e=V(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===m)var +e=X(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===m)var n=0;else try{var -r=vZ(i0(c,d,m-d|0)),n=r}catch(f){var -p=O(f);if(p[1]!==dL)throw g(p,0);var -q=j(0),n=q}if(k(m)!==f)j(0);a:{if(a!==e&&a!==aN){if(a===U){var +r=wp(fz(c,d,m-d|0)),n=r}catch(f){var +p=T(f);if(p[1]!==dT)throw g(p,0);var +q=j(0),n=q}if(k(m)!==f)j(0);a:{if(a!==e&&a!==aP){if(a===W){var b=0;break a}if(a==="hov"){var -b=3;break a}if(a===sG){var -b=2;break a}if(a!==a3){var +b=3;break a}if(a===s5){var +b=2;break a}if(a!==a9){var b=j(0);break a}var b=1;break a}var b=4}return[0,n,b]}function -AM(d,b,c){return G(function(a){cR(b,a);return h(d,b)},0,c[1])}function -gG(a,b){return AM(function(a){return 0},a,b)}function -gH(a){return gG(bO,a)}function -m$(c,b){return G(function(a){var -b=bq(64);cS(b,a);return h(c,bx(b))},0,b[1])}function -t(a){return m$(function(a){return a},a)}var -jc=fn(0);function -je(a,b){var -c=a[1+b];return mA(c)?dK(c)===e4?h(t(AN),c):dK(c)===k6?wx(c):AO:h(t(AP),c)}function -na(a,b){if(a.length-1<=b)return AQ;var -c=na(a,b+1|0),d=je(a,b);return i(t(AR),d,c)}function -AS(a){var +A_(d,b,c){return G(function(a){cW(b,a);return h(d,b)},0,c[1])}function +gU(a,b){return A_(function(a){return 0},a,b)}function +gV(a){return gU(bW,a)}function +nt(c,b){return G(function(a){var +b=bt(64);cX(b,a);return h(c,bA(b))},0,b[1])}function +v(a){return nt(function(a){return a},a)}var +js=fv(0);function +ju(a,b){var +c=a[1+b];return mS(c)?dS(c)===fa?h(v(A$),c):dS(c)===li?wY(c):Ba:h(v(Bb),c)}function +nu(a,b){if(a.length-1<=b)return Bc;var +c=nu(a,b+1|0),d=ju(a,b);return i(v(Bd),d,c)}function +Be(a){var b=a.length-1;if(2>=b>>>0)switch(b){case -0:return AU;case -1:return AV;default:var -e=je(a,1);return h(t(AW),e)}var -c=na(a,2),d=je(a,1);return i(t(AT),d,c)}function -AX(d){return function(a){var +0:return Bg;case +1:return Bh;default:var +e=ju(a,1);return h(v(Bi),e)}var +c=nu(a,2),d=ju(a,1);return i(v(Bf),d,c)}function +Bj(d){return function(a){var b=a;for(;;){if(!b)return 0;var e=b[2],f=b[1];a:{try{var -c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(fm(jc))}function -AY(a){if(0!==dK(a))return[0,a[1],0];var -b=a[1][1];return[0,b,[0,AS(a)]]}function -AZ(a){var -b=AY(a),c=b[2],d=b[1];return c?bb(d,c[1]):d}function -A0(a){if(a===iQ)return A1;if(a===ms)return A2;if(a[1]===mr){var -b=a[2],e=b[3],i=b[2],j=b[1];return eT(t(jd),j,i,e,e+5|0,A3)}if(a[1]===f){var -c=a[2],g=c[3],k=c[2],l=c[1];return eT(t(jd),l,k,g,g+6|0,A4)}if(a[1]!==mu)return AZ(a);var -d=a[2],h=d[3],m=d[2],n=d[1];return eT(t(jd),n,m,h,h+6|0,A5)}function -gI(a){var -b=AX(a);return b?b[1]:A0(a)}function -A6(a){var -b=[0,Vt(a)];return b}function -A7(c,b){function -a(a){return a?0===c?A8:A9:0===c?A_:A$}if(0!==b[0]){if(b[1])return 0;var -p=a(0);return[0,h(t(Bf),p)]}if(b[3]===b[6])var -e=b[3],d=h(t(Ba),e);else +c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(fu(js))}function +Bk(a){if(0!==dS(a))return[0,a[1],0];var +b=a[1][1];return[0,b,[0,Be(a)]]}function +Bl(a){var +b=Bk(a),c=b[2],d=b[1];return c?a2(d,c[1]):d}function +Bm(a){if(a===i7)return Bn;if(a===mJ)return Bo;if(a[1]===mI){var +b=a[2],e=b[3],i=b[2],j=b[1];return d$(v(jt),j,i,e,e+5|0,Bp)}if(a[1]===f){var +c=a[2],g=c[3],k=c[2],l=c[1];return d$(v(jt),l,k,g,g+6|0,Bq)}if(a[1]!==mL)return Bl(a);var +d=a[2],h=d[3],m=d[2],n=d[1];return d$(v(jt),n,m,h,h+6|0,Br)}function +gW(a){var +b=Bj(a);return b?b[1]:Bm(a)}function +Bs(a){var +b=[0,Xx(a)];return b}function +Bt(c,b){function +a(a){return a?0===c?Bu:Bv:0===c?Bw:Bx}if(0!==b[0]){if(b[1])return 0;var +p=a(0);return[0,h(v(BD),p)]}if(b[3]===b[6])var +e=b[3],d=h(v(By),e);else var -n=b[6],o=b[3],d=i(t(Be),o,n);var -f=b[7],g=b[4],j=b[8]?Bb:Bd,k=b[2],l=b[9],m=a(b[1]);return[0,Vc(t(Bc),m,l,k,j,d,g,f)]}function -Bg(a,b){if(!b)return gG(a,Bi);var +n=b[6],o=b[3],d=i(v(BC),o,n);var +f=b[7],g=b[4],j=b[8]?Bz:BB,k=b[2],l=b[9],m=a(b[1]);return[0,Xf(v(BA),m,l,k,j,d,g,f)]}function +BE(a,b){if(!b)return gU(a,BG);var d=b[1],e=d.length-2|0,g=0;if(e>=0){var c=g;for(;;){var -f=A7(c,j(d,c)[1+c]);if(f){var -i=f[1];h(gG(a,Bh),i)}var +f=Bt(c,j(d,c)[1+c]);if(f){var +i=f[1];h(gU(a,BF),i)}var k=c+1|0;if(e===c)break;c=k}}return 0}function -gJ(a,b){return Bg(a,A6(b))}var -Bl=Bk.slice();function -Bm(a,b){var -e=gI(a);h(gH(Bn),e);gJ(bO,b);var -c=V8(0);if(c<0){var -d=fi(c);my(j(Bl,d)[1+d])}return fk(bO)}var -Bo=[0];function -nb(a){var -b=vQ(0);return b}function -Bp(a,b){try{var -d=b?Bo:nb(0);try{iT(0)}catch(f){}try{var -f=Bm(a,d),e=f}catch(f){var -i=O(f),j=nb(0),k=gI(a);h(gH(Br),k);gJ(bO,d);var -l=gI(i);h(gH(Bs),l);gJ(bO,j);var -e=fk(bO)}return e}catch(f){var -c=O(f);if(c===iQ)return my(Bq);throw g(c,0)}}mn(vj,function(a,b){try{var -c=Bp(a,b);return c}catch(f){return 0}});function -Bj(a){for(;;){var -b=fm(jc),c=1-mB(jc,b,[0,a,b]);if(!c)return c}}function -Bt(a){return vQ(a)}var -Bv=[B,Bu,at(0)];Bj(function(a){return a[1]===Bv?[0,bb(Bw,gI(a[2]))]:0});function -jf(a){var -b=a[1]<1?1:0,c=b||(64=0){var -c=i;for(;;){xw(d,c*8|0,gp(j(b,c)[1+c]));var -n=c+1|0;if(f===c)break;c=n}}cj(d,e*8|0,1);var -g=nc(d);cj(d,e*8|0,2);var -h=nc(d),k=gA(h,8),l=gA(h,0),m=gA(g,8);return ne(a,gA(g,0),m,l,k)}function -BJ(a){var -b=jg(0);BI(b,a);return b}function -ng(a){return BJ(Wo(0))}var -BK=im;function -BM(a,b,c){for(;;){var -d=mc(mf(a))&c,e=Wd(d,b);if(((c-b|0)+1|0)>=(d-e|0))return e}}function -eu(a){return mf(a)}function -BH(a){var -b=jg(0);BG(b,a);return b}function -BL(a){return mc(mf(a))&im}function -BN(a,b){if(im>=b&&0=0){var +c=i;for(;;){xX(d,c*8|0,gF(j(b,c)[1+c]));var +n=c+1|0;if(f===c)break;c=n}}cn(d,e*8|0,1);var +g=nw(d);cn(d,e*8|0,2);var +h=nw(d),k=gP(h,8),l=gP(h,0),m=gP(g,8);return ny(a,gP(g,0),m,l,k)}function +B7(a){var +b=jw(0);B6(b,a);return b}function +nA(a){return B7(Yv(0))}var +B8=iD;function +B_(a,b,c){for(;;){var +d=mt(mx(a))&c,e=Yj(d,b);if(((c-b|0)+1|0)>=(d-e|0))return e}}function +eA(a){return mx(a)}function +B5(a){var +b=jw(0);B4(b,a);return b}function +B9(a){return mt(mx(a))&iD}function +B$(a,b){if(iD>=b&&0=0){var a=p;for(;;){var l=j(f,a)[1+a];if(l)l[3]=0;var -q=a+1|0;if(k===a)break;a=q}}}return}function -nm(a,b){var -c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return ns(a,d)}function -Cd(a){var -b=yv(a[28]);if(!b)return;var +c=b[3],g=b[2];if(0===dP(b[1],e)){var +d=[0,g,ch];f(d,1,c);return d}b=c}}(j(a[2],b)[1+b])}function +Cu(a,b,c){var +d=dV(a,b),e=j(a[2],d)[1+d];if(Ct(b,c,e)){j(a[2],d)[1+d]=[0,b,c,e];a[1]=a[1]+1|0;if(a[2].length-1<<1>>0)return;return nM(a,d)}function +CB(a){var +b=yT(a[28]);if(!b)return;var c=b[1],d=c[1];a[12]=a[12]-c[3]|0;var -e=bc(d);a[9]=a[9]+e|0;return}function -Ce(a,b,c){if(typeof +e=bh(d);a[9]=a[9]+e|0}function +CC(a,b,c){if(typeof c==="number")switch(c){case 0:var -j=ep(a[3]);if(!j)return;var +j=ev(a[3]);if(!j)return;var k=j[1][1],m=function(a,b){if(!b)return[0,a,0];var -c=b[1],d=b[2];return V2(a,c)?[0,a,b]:[0,c,m(a,d)]};k[1]=m(a[6]-a[9]|0,k[1]);return;case -1:eo(a[2]);return;case -2:eo(a[3]);return;case +c=b[1],d=b[2];return X6(a,c)?[0,a,b]:[0,c,m(a,d)]};k[1]=m(a[6]-a[9]|0,k[1]);return;case +1:eu(a[2]);return;case +2:eu(a[3]);return;case 3:var -n=ep(a[2]);return n?ns(a,n[1][2]):gM(a);case +n=ev(a[2]);return n?nM(a,n[1][2]):g0(a);case 4:var -o=a[10]!==(a[6]-a[9]|0)?1:0;return o?Cd(a):o;default:var -p=eo(a[5]);if(p)return ji(a,h(a[25],p[1]));return}switch(c[0]){case -0:return nr(a,b,c[1]);case +o=a[10]!==(a[6]-a[9]|0)?1:0;return o?CB(a):o;default:var +p=eu(a[5]);if(p)return jy(a,h(a[25],p[1]));return}switch(c[0]){case +0:return nL(a,b,c[1]);case 1:var -d=c[2],f=c[1],q=d[1],z=d[2],r=ep(a[2]);if(!r)return;var +d=c[2],f=c[1],q=d[1],z=d[2],r=ev(a[2]);if(!r)return;var s=r[1],e=s[2];switch(s[1]){case -0:return ew(a,f);case -1:return dO(a,d,e);case -2:return dO(a,d,e);case -3:return a[9]<(b+l(q)|0)?dO(a,d,e):ew(a,f);case -4:return a[11]?ew(a,f):a[9]<(b+l(q)|0)?dO(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=nq;nt(a);if(b)gM(a);return Cp(a)}jl(a,0)}}function -ex(a,b,c){var -d=a[14]=a[14]){a[13]=nK;nN(a);if(b)g0(a);return CN(a)}jB(a,0)}}function +eD(a,b,c){var +d=a[14]=c)return a$(a[17],nE,0,c);a$(a[17],nE,0,80);c=c-80|0}}function -CA(a){return a[1]===ev?bb(CC,bb(a[2],CB)):CD}function -CE(a){return a[1]===ev?bb(CG,bb(a[2],CF)):CH}function -CI(a){return 0}function -CJ(a){return 0}function -jp(a,b,c,d,e){var -g=i5(0),h=[0,no,CK,0];i7(h,g);var -f=en(0);jj(f);dd([0,1,h],f);var -i=78,j=en(0),k=en(0),l=en(0);return[0,f,en(0),l,k,j,i,10,68,i,0,1,1,1,1,gv,CL,a,b,c,d,e,0,0,CA,CE,CI,CJ,g]}function -nF(a,b){var -c=jp(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return jo(c,a)};c[20]=function(a){return ez(c,a)};c[21]=function(a){return ez(c,a)};return c}function -nG(d){return nF(function(a,b,c){return mx(d,a,b,c)},function(a){return fk(d)})}function -dP(d){return nF(function(a,b,c){return er(d,a,b,c)},function(a){return 0})}var -jq=il;function -gP(a){return bq(jq)}var -nH=gP(0),jr=nG(iR),js=nG(bO),nI=dP(nH),jt=cP(0,gP);fu(jt,nH);var -nJ=cP(0,function(a){return dP(bR(jt))});fu(nJ,nI);function -gQ(a,b,c,d){return er(bR(a),b,c,d)}function -gR(a,b,c){var -d=bR(b),e=mW(d);mx(a,bx(d),0,e);fk(a);return eq(d)}var -gS=cP(0,function(a){return bq(jq)}),gT=cP(0,function(a){return bq(jq)}),ju=cP(0,function(a){var -b=jp(function(a,b,c){return gQ(gS,a,b,c)},function(a){return gR(iR,gS,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return jo(b,a)};b[20]=function(a){return ez(b,a)};b[21]=function(a){return ez(b,a)};m4(function(a){return cD(b,a)});return b});fu(ju,jr);var -nK=cP(0,function(a){var -b=jp(function(a,b,c){return gQ(gT,a,b,c)},function(a){return gR(bO,gT,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return jo(b,a)};b[20]=function(a){return ez(b,a)};b[21]=function(a){return ez(b,a)};m4(function(a){return cD(b,a)});return b});fu(nK,js);function -Cs(a,b){jm(a,1);return h(a[18],0)}function -Ct(a,b){var -c=a[14]=c)return bH(a[17],nY,0,c);bH(a[17],nY,0,80);c=c-80|0}}function +CY(a){return a[1]===eB?a2(C0,a2(a[2],CZ)):C1}function +C2(a){return a[1]===eB?a2(C4,a2(a[2],C3)):C5}function +C6(a){return 0}function +C7(a){return 0}function +jF(a,b,c,d,e){var +g=jj(0),h=[0,nI,C8,0];jl(h,g);var +f=et(0);jz(f);dj([0,1,h],f);var +i=78,j=et(0),k=et(0),l=et(0);return[0,f,et(0),l,k,j,i,10,68,i,0,1,1,1,1,gK,C9,a,b,c,d,e,0,0,CY,C2,C6,C7,g]}function +nZ(a,b){var +c=jF(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return jE(c,a)};c[20]=function(a){return eF(c,a)};c[21]=function(a){return eF(c,a)};return c}function +n0(d){return nZ(function(a,b,c){return mP(d,a,b,c)},function(a){return fs(d)})}function +dX(d){return nZ(function(a,b,c){return ex(d,a,b,c)},function(a){return 0})}var +jG=iC;function +g3(a){return bt(jG)}var +n1=g3(0),jH=n0(i8),jI=n0(bW),n2=dX(n1),jJ=cU(0,g3);fE(jJ,n1);var +n3=cU(0,function(a){return dX(bZ(jJ))});fE(n3,n2);function +g4(a,b,c,d){return ex(bZ(a),b,c,d)}function +g5(a,b,c){var +d=bZ(b),e=ne(d);mP(a,bA(d),0,e);fs(a);return ew(d)}var +g6=cU(0,function(a){return bt(jG)}),g7=cU(0,function(a){return bt(jG)}),jK=cU(0,function(a){var +b=jF(function(a,b,c){return g4(g6,a,b,c)},function(a){return g5(i8,g6,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return jE(b,a)};b[20]=function(a){return eF(b,a)};b[21]=function(a){return eF(b,a)};nm(function(a){return cG(b,a)});return b});fE(jK,jH);var +n4=cU(0,function(a){var +b=jF(function(a,b,c){return g4(g7,a,b,c)},function(a){return g5(bW,g7,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return jE(b,a)};b[20]=function(a){return eF(b,a)};b[21]=function(a){return eF(b,a)};nm(function(a){return cG(b,a)});return b});fE(n4,jI);function +CQ(a,b){jC(a,1);return h(a[18],0)}function +CR(a,b){var +c=a[14]=0){var -e=q;for(;;){de(b,c,j(d[3],e)[1+e]);var +e=q;for(;;){dk(b,c,j(d[3],e)[1+e]);var r=e+1|0;if(k===e)break;e=r}}return}}function -C6(a){return i(gG(bO,C7),gJ,VB(20))}function -gZ(a,b){var -c=[0,0];de(c,a,b);var -d=2<=c[1]?1:0;return d?C6(0):d}function -aC(a){return eB([5,a])}function -aD(a){return a}function -ah(a,b){if(1===a[0]){var -c=a[4];if(5===c[0]){c[1]=b;return gZ(0,a)}}throw g([0,f,C8],1)}function -ap(a){if(1===a[0]){var -b=a[4];if(5===b[0])return b[1]}throw g([0,f,C9],1)}function -eC(a,b,c){var +Ds(a){return i(gU(bW,Dt),gX,XF(20))}function +g$(a,b){var +c=[0,0];dk(c,a,b);var +d=2<=c[1]?1:0;return d?Ds(0):d}function +aB(a){return eI([5,a])}function +ap(a){return a}function +ai(a,b){if(1===a[0]){var +c=a[4];if(5===c[0]){c[1]=b;return g$(0,a)}}throw g([0,f,Du],1)}function +az(a){if(1===a[0]){var +b=a[4];if(5===b[0])return b[1]}throw g([0,f,Dv],1)}function +eK(a,b,c){var k=a,h=b,d=c;for(;;)switch(d[0]){case 0:return k;case 1:var e=d[2];if(typeof -e==="number")throw g([0,f,Dd],1);switch(e[0]){case -0:if(e[1]!==h)throw g([0,f,De],1);var +e==="number")throw g([0,f,DB],1);switch(e[0]){case +0:if(e[1]!==h)throw g([0,f,DC],1);var o=0;break;case 1:var B=e[2],C=e[1];if(C===h)var -D=[0,B];else{if(B!==h)throw g([0,f,Df],1);var +D=[0,B];else{if(B!==h)throw g([0,f,DD],1);var D=[0,C]}var o=D;break;case 2:var u=e[3],v=e[2],w=e[1];if(w===h)var x=[1,v,u];else if(v===h)var -x=[1,w,u];else{if(u!==h)throw g([0,f,Dg],1);var +x=[1,w,u];else{if(u!==h)throw g([0,f,DE],1);var x=[1,w,v]}var o=x;break;case 3:var p=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var t=[2,r,q,p];else if(r===h)var t=[2,s,q,p];else if(q===h)var -t=[2,s,r,p];else{if(p!==h)throw g([0,f,Dh],1);var +t=[2,s,r,p];else{if(p!==h)throw g([0,f,DF],1);var t=[2,s,r,q]}var o=t;break;default:var -n=fy(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,Di],1);var +n=fH(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,DG],1);var m=e[2]-1|0;e[2]=m;if(n>>2|0))var -U=xZ(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else +U=yn(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else var L=e;var J=L}var @@ -3013,21 +2896,21 @@ y=d[1];d[1]=1;var l=d[4];switch(l[0]){case 0:h=d;d=l[1];break;case 1:var -M=l[2];k=eC(k,d,l[1]);h=d;d=M;break;case +M=l[2];k=eK(k,d,l[1]);h=d;d=M;break;case 2:var -N=l[2];k=eC(k,d,l[1]);h=d;d=N;break;case +N=l[2];k=eK(k,d,l[1]);h=d;d=N;break;case 3:var -P=l[2];k=eC(k,d,l[1]);h=d;d=P;break;case +O=l[2];k=eK(k,d,l[1]);h=d;d=O;break;case 4:var -z=l[2],A=eC(k,d,l[1]);if(!z)return A;var -Q=z[1];l[2]=0;k=A;h=d;d=Q;break;case +z=l[2],A=eK(k,d,l[1]);if(!z)return A;var +P=z[1];l[2]=0;k=A;h=d;d=P;break;case 5:return k;case 6:if(typeof y==="number")return k;var -R=y[1];try{i(l[2],d,R);return k}catch(f){var -S=O(f);return[0,[0,S,Bt(0)],k]}default:var -T=l[1];k=eC(k,d,l[2]);h=d;d=T}break;default:throw g([0,f,Dj],1)}}function -df(a,b){var +Q=y[1];try{i(l[2],d,Q);return k}catch(f){var +R=T(f);return[0,[0,R,BR(0)],k]}default:var +S=l[1];k=eK(k,d,l[2]);h=d;d=S}break;default:throw g([0,f,DH],1)}}function +dl(a,b){var e=a,c=b;for(;;)switch(c[0]){case 0:return;case 1:var @@ -3043,46 +2926,46 @@ k=[2,e,d[1],d[2]];break;case 2:var k=[3,e,d[1],d[2],d[3]];break;case 3:var -o=[0,d[1],d[2],d[3],d[4],e,eA,eA,eA],l=0;for(;;){nP(c,l,j(o,l)[1+l]);var +o=[0,d[1],d[2],d[3],d[4],e,eH,eH,eH],l=0;for(;;){n9(c,l,j(o,l)[1+l]);var w=l+1|0;if(4===l)break;l=w}var k=[4,5,5,o];break;default:var i=d[2];if(i>>1|0)}function -n0(a,b,c){if(typeof -a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,DM],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,DL],1)}function -kV(a,b,c){if(typeof +oi(a,b){return jQ(a,b>>>1|0)}function +oj(a,b,c){if(typeof +a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,D9],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,D8],1)}function +k9(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[2];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,DQ],1);e[5]=c;var -i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;n0(h,c,d);jB(b,c);return a<50?fW(a+1|0,b,d):n(fW,[0,b,d])}}throw g([0,f,DP],1)}function -DN(a,b){return bN(kV(0,a,b))}function -kU(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,Eb],1);e[5]=c;var +i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;oj(h,c,d);jR(b,c);return a<50?f8(a+1|0,b,d):n(f8,[0,b,d])}}throw g([0,f,Ea],1)}function +D_(a,b){return bV(k9(0,a,b))}function +k8(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[4];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,DS],1);e[5]=c;var -i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;n0(h,c,d);jB(b,c);return a<50?fW(a+1|0,b,d):n(fW,[0,b,d])}}throw g([0,f,DR],1)}function -DO(a,b){return bN(kU(0,a,b))}function -qG(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,Ed],1);e[5]=c;var +i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;oj(h,c,d);jR(b,c);return a<50?f8(a+1|0,b,d):n(f8,[0,b,d])}}throw g([0,f,Ec],1)}function +D$(a,b){return bV(k8(0,a,b))}function +q6(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];a:if(typeof d!=="number"&&0===d[0]){var -e=eD(d[2]);if(jA(eD(d[4]),e)){DO(b,d);break a}}return a<50?kV(a+1|0,b,c):n(kV,[0,b,c])}throw g([0,f,DT],1)}function -qF(a,b,c){if(typeof +e=eL(d[2]);if(jQ(eL(d[4]),e)){D$(b,d);break a}}return a<50?k9(a+1|0,b,c):n(k9,[0,b,c])}throw g([0,f,Ee],1)}function +q5(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];a:if(typeof d!=="number"&&0===d[0]){var -e=eD(d[4]);if(jA(eD(d[2]),e)){DN(b,d);break a}}return a<50?kU(a+1|0,b,c):n(kU,[0,b,c])}throw g([0,f,DU],1)}function -fW(a,b,c){if(typeof +e=eL(d[4]);if(jQ(eL(d[2]),e)){D_(b,d);break a}}return a<50?k8(a+1|0,b,c):n(k8,[0,b,c])}throw g([0,f,Ef],1)}function +f8(a,b,c){if(typeof c!=="number"&&0===c[0]){var -d=eD(c[2]),e=eD(c[4]);return d>>2|0}function -b8(a,b){if(typeof +d=c[4],e=ol(a),h=function(a,b){return a!==b?1:0};c[4]=mZ(function(a){return h(e,a)},d);return 0}throw g([0,f,EA],1)})),Ex)}function +EF(a){if(typeof +a!=="number"&&1===a[0])return om(a[2]);throw g([0,f,EG],1)}var +cd=0;function +bi(a){return[0,0,a]}function +oo(a,b){return a>>2|0}function +ce(a,b){if(typeof a==="number")var c=b;else{if(typeof b!=="number"){var -d=g4(b);return[1,(n5(g4(a),d)+1|0)<<2,a,b]}var +d=he(b);return[1,(oo(he(a),d)+1|0)<<2,a,b]}var c=a}return c}function -fz(a){return typeof +fI(a){return typeof a==="number"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var -jC=1,jD=2,Ep=3;function -n6(a){return-1===a?1:0}function -jE(a){return-1!==a?1:0}function -eE(a){return(a&3)===3?1:0}function -n7(a){return(a&3)===1?1:0}function -n8(a){return(a&3)===2?1:0}function -n9(a){return a|3}function -Eq(a){return a>>>2|0}function -n_(a){return a<<2|2}function -fA(a){return a&wj(Ep)}function -n$(a){return a[2]}function -oa(a){return a[3]}function -ob(a){return[0,0,0,0]}function -g5(a){a[1]=a[1]+1|0;return}function -g6(a){a[2]=a[2]+1|0;return}function -g7(a){a[3]=a[3]+1|0;return}function -jF(a,b,c){var +jS=1,jT=2,EM=3;function +op(a){return-1===a?1:0}function +jU(a){return-1!==a?1:0}function +eM(a){return(a&3)===3?1:0}function +oq(a){return(a&3)===1?1:0}function +or(a){return(a&3)===2?1:0}function +os(a){return a|3}function +EN(a){return a>>>2|0}function +ot(a){return a<<2|2}function +fJ(a){return a&wL(EM)}function +ou(a){return a[2]}function +ov(a){return a[3]}function +ow(a){return[0,0,0,0]}function +hf(a){a[1]=a[1]+1|0}function +hg(a){a[2]=a[2]+1|0}function +hh(a){a[3]=a[3]+1|0}function +jV(a,b,c){var d=c;for(;;){if(typeof d==="number")return;if(0===d[0]){var -e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,Es],1);g5(a);g7(a);d[1]=e|3}return}var -h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,Et],1);g5(a);g7(a);d[1]=h|3;jF(a,b,d[2]);d=d[3]}}function -g8(a,b,c,d){if(typeof +e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,EP],1);hf(a);hh(a);d[1]=e|3}return}var +h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,EQ],1);hf(a);hh(a);d[1]=h|3;jV(a,b,d[2]);d=d[3]}}function +hi(a,b,c,d){if(typeof d==="number")return;if(0===d[0]){var -e=d[1];if(0===(e&c)){g5(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;g7(a);g6(a)}}var -g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,g6(a)):h}var -f=d[1];if(0===(f&c)){g5(a);if(0===(f&3)){d[1]=f|c;i7(d,b)}else{d[1]=-1;g7(a);g6(a);jF(a,c,d[2]);jF(a,c,d[3])}}var -i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,g6(a)):j}function -jG(a,b,c){var -d=mV(b);if(typeof +e=d[1];if(0===(e&c)){hf(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;hh(a);hg(a)}}var +g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,hg(a)):h}var +f=d[1];if(0===(f&c)){hf(a);if(0===(f&3)){d[1]=f|c;jl(d,b)}else{d[1]=-1;hh(a);hg(a);jV(a,c,d[2]);jV(a,c,d[3])}}var +i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,hg(a)):j}function +jW(a,b,c){var +d=nd(b);if(typeof d!=="number"&&1===d[0]){var -e=(d[1]&3)===c?1:0;return e?(g8(a,b,c,d[2]),g8(a,b,c,d[3])):e}throw g([0,f,Eu],1)}function -oc(a,b,c){for(;;){if(i8(b))return;jG(a,b,c)}}function -Ev(a,b,c,d){for(;;){if(i8(c))return oc(b,d,jD);if(i8(d))return oc(a,c,jC);jG(a,c,jC);jG(b,d,jD)}}function -jH(a){var +e=(d[1]&3)===c?1:0;return e?(hi(a,b,c,d[2]),hi(a,b,c,d[3])):e}throw g([0,f,ER],1)}function +ox(a,b,c){for(;;){if(jm(b))return;jW(a,b,c)}}function +ES(a,b,c,d){for(;;){if(jm(c))return ox(b,d,jT);if(jm(d))return ox(a,c,jS);jW(a,c,jS);jW(b,d,jT)}}function +jX(a){var b=a[6];a[6]=b+1|0;return b}function -jI(a){var +jY(a){var b=a;for(;;){if(typeof b==="number")return;if(0===b[0]){var c=b[1];if(typeof c!=="number"&&0===c[0]){var -e=c[1],i=jE(e),l=i?eE(e):i;if(l)c[1]=fA(e);return}throw g([0,f,EA],1)}var +e=c[1],i=jU(e),l=i?eM(e):i;if(l)c[1]=fJ(e);return}throw g([0,f,EX],1)}var d=b[1];if(typeof d!=="number"&&1===d[0]){var -h=d[1],m=b[4],n=b[3],j=jE(h),k=j?eE(h):j;if(!k)return k;d[1]=fA(h);jI(n);b=m;continue}throw g([0,f,EB],1)}}function -od(a,b){var +h=d[1],m=b[4],n=b[3],j=jU(h),k=j?eM(h):j;if(!k)return k;d[1]=fJ(h);jY(n);b=m;continue}throw g([0,f,EY],1)}}function +oy(a,b){var c=b;for(;;){if(typeof c==="number")return;if(0===c[0]){var d=c[1];if(typeof d!=="number"&&0===d[0]){var -e=d[1],u=c[2];if(!n7(e)){if(n6(e)){var -k=jH(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=n_(k);return}if(n8(e)){var -n=Eq(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var -q=eE(e);if(q)throw g([0,f,EE],1);return q}var -m=a[2];if(-1a[3])throw g([0,f,ED],1)}d[1]=fA(e);return}throw g([0,f,EC],1)}var +e=d[1],u=c[2];if(!oq(e)){if(op(e)){var +k=jX(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=ot(k);return}if(or(e)){var +n=EN(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var +q=eM(e);if(q)throw g([0,f,E1],1);return q}var +m=a[2];if(-1a[3])throw g([0,f,E0],1)}d[1]=fJ(e);return}throw g([0,f,EZ],1)}var h=c[1];if(typeof h!=="number"&&1===h[0]){var -r=c[4],s=c[3],i=h[1],w=c[2];if(n6(i)){var -l=jH(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=n_(l);jI(s);return jI(r)}if(!n7(i)){if(n8(i)){var +r=c[4],s=c[3],i=h[1],w=c[2];if(op(i)){var +l=jX(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=ot(l);jY(s);return jY(r)}if(!oq(i)){if(or(i)){var o=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var -t=eE(i);if(t)throw g([0,f,EH],1);return t}if(-1a[3])throw g([0,f,EG],1)}h[1]=fA(i);od(a,s);c=r;continue}throw g([0,f,EF],1)}}function -fB(a,b){if(typeof +t=eM(i);if(t)throw g([0,f,E4],1);return t}if(-1a[3])throw g([0,f,E3],1)}h[1]=fJ(i);oy(a,s);c=r;continue}throw g([0,f,E2],1)}}function +fK(a,b){if(typeof b==="number")return 0;if(0!==b[0]){var i=b[1];if(-1===i){var -l=jH(a);b[1]=0;j(a[4],l)[1+l]=b;var -p=fB(a,b[2]);return[1,b,0,p,fB(a,b[3])]}if(!eE(i)){b[1]=fA(b[1]);var -r=fB(a,b[2]);return[1,b,0,r,fB(a,b[3])]}var -d=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,EK],1);var +l=jX(a);b[1]=0;j(a[4],l)[1+l]=b;var +p=fK(a,b[2]);return[1,b,0,p,fK(a,b[3])]}if(!eM(i)){b[1]=fJ(b[1]);var +r=fK(a,b[2]);return[1,b,0,r,fK(a,b[3])]}var +d=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,E7],1);var m=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var -e=b[1];if(jE(e)&&eE(e)){var +e=b[1];if(jU(e)&&eM(e)){var c=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var n=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var -jJ=[0,0,[0],0,0];function -Er(a){return a[1]}function -Ew(a){return a[1]}function -Ex(a){return a[2]}function -Ey(a,b){var -c=ob(0),d=ob(0),e=i5(0),f=i5(0);g8(c,e,jC,a);g8(d,f,jD,b);Ev(c,d,e,f);return[0,c,d]}function -Ez(a){if(typeof +jZ=[0,0,[0],0,0];function +EO(a){return a[1]}function +ET(a){return a[1]}function +EU(a){return a[2]}function +EV(a,b){var +c=ow(0),d=ow(0),e=jj(0),f=jj(0);hi(c,e,jS,a);hi(d,f,jT,b);ES(c,d,e,f);return[0,c,d]}function +EW(a){if(typeof a==="number")return;if(0===a[0]){a[1]=0;return}var -b=g4(a[3]);a[1]=(n5(g4(a[2]),b)+1|0)<<2;return}function -EI(a){var +b=he(a[3]);a[1]=(oo(he(a[2]),b)+1|0)<<2}function +E5(a){var e=a[6]-1|0,h=0;if(e>=0){var b=h;for(;;){var c=j(a[4],b)[1+b];if(typeof -c!=="number")if(0===c[0])c[1]=n9(c[1]);else -c[1]=n9(c[1]);var -d=j(a[5],b)[1+b];if(!d)throw g([0,f,EJ],1);if(d[2]){var -i=bp(d);j(a[5],b)[1+b]=i}var -k=b+1|0;if(e===b)break;b=k}}return}function -oe(a,b,c){if(typeof +c!=="number")if(0===c[0])c[1]=os(c[1]);else +c[1]=os(c[1]);var +d=j(a[5],b)[1+b];if(!d)throw g([0,f,E6],1);if(d[2]){var +i=bs(d);j(a[5],b)[1+b]=i}var +k=b+1|0;if(e===b)break;b=k}}}function +oz(a,b,c){if(typeof b==="number"){if(typeof -c==="number")return[0,jJ,0]}else if(b[1]===c)return[0,jJ,b];var +c==="number")return[0,jZ,0]}else if(b[1]===c)return[0,jZ,b];var t=typeof -b==="number"?b7:b[1],m=Ey(t,c),i=Ew(m),n=Ex(m),u=oa(n),v=oa(i)+u|0,o=Er(i)-v|0,w=n$(n),p=n$(i)+w|0,x=0,y=ck(p,0),z=ck(p,0),A=a?o:-1,B=a?0:-1,C=a?ck(o,0):[0],d=[0,C,B,A,z,y,x];od(d,b);if(d[2]!==d[3])throw g([0,f,EL],1);EI(d);var -q=fB(d,c),r=d[6]-1|0;if(r>=0){var -h=r;for(;;){Ez(j(d[4],h)[1+h]);var -F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,jJ,q];var +b==="number"?cd:b[1],m=EV(t,c),i=ET(m),n=EU(m),u=ov(n),v=ov(i)+u|0,o=EO(i)-v|0,w=ou(n),p=ou(i)+w|0,x=0,y=ca(p,0),z=ca(p,0),A=a?o:-1,B=a?0:-1,C=a?ca(o,0):[0],d=[0,C,B,A,z,y,x];oy(d,b);if(d[2]!==d[3])throw g([0,f,E8],1);E5(d);var +q=fK(d,c),r=d[6]-1|0;if(r>=0){var +h=r;for(;;){EW(j(d[4],h)[1+h]);var +F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,jZ,q];var k=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var -e=D;for(;;){cm(function(a){if(typeof +e=D;for(;;){cp(function(a){if(typeof a!=="number")if(0===a[0]){var b=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var c=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var E=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function -EM(d,b){if(typeof +E9(d,b){if(typeof b==="number")return 0;function c(a){a:if(typeof a!=="number"){b:{if(0===a[0]){var @@ -3421,681 +3304,723 @@ j=e[1];break b}var k=h(d[1],b[2]);a[2]=[0,k];return k}break a}var l=a[2];if(!l){var n=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var -j=l[1]}return j}throw g([0,f,EN],1)}return[0,c(b)]}function -g9(a,b){return[0,[0,a,b],0]}function -g_(a){return EM(a[1],a[2])}function -EO(a,b){var -c=a[1];return[0,c,oe(0,a[2],b)[2]]}function -jK(a,b){var -d=a[1],c=oe(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function -g$(a,b,c,d){var -e=[0,d];if(e6===a)var -h=c[1],g=0;else if(rd<=a)var +j=l[1]}return j}throw g([0,f,E_],1)}return[0,c(b)]}function +hj(a,b){return[0,[0,a,b],0]}function +hk(a){return E9(a[1],a[2])}function +E$(a,b){var +c=a[1];return[0,c,oz(0,a[2],b)[2]]}function +j0(a,b){var +d=a[1],c=oz(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function +hl(a,b,c,d){var +e=[0,d];if(fc===a)var +h=c[1],g=0;else if(rF<=a)var h=c[2].length-1,g=c[1];else var h=c[2].length-1,g=0;var k=h-1|0;if(k>=g){var f=g;for(;;){var l=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var -m=f+1|0;if(k===f)break;f=m}}if(rd>a)cm(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(e6!==a)cm(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function -jL(a,b,c){if(typeof -c==="number")throw g([0,f,EP],1);if(0===c[0])return h(a,c[2]);var -d=jL(a,b,c[3]);return i(b,jL(a,b,c[2]),d)}function -dh(a,b,c){var -d=b[2],e=b[1],f=gX(c);if(f){var +m=f+1|0;if(k===f)break;f=m}}if(rF>a)cp(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(fc!==a)cp(function(a){e[1]=i(b,a,e[1]);return 0},c[4])}function +j1(a,b,c){if(typeof +c==="number")throw g([0,f,Fa],1);if(0===c[0])return h(a,c[2]);var +d=j1(a,b,c[3]);return i(b,j1(a,b,c[2]),d)}function +dn(a,b,c){var +d=b[2],e=b[1],f=g_(c);if(f){var g=f[1];return typeof -g==="number"?aB(e):aB(jL(a,d,g))}var -h=[0,g9(a,d)];return x(c,function(a){var -b=EO(h[1],a);h[1]=b;var -c=g_(b);return c?c[1]:e})}var -fC=[0,b7,b8];function -EQ(a,b){return g2(b,fC,a)}function -fD(a){return EQ(a,bd)}function -jM(a,b,c,d){if(d=0){var +x["Error"](b);return a?(c[aS]=a[1],c):c}function +oF(a,b){return h(function(a){throw a},Fw(a,b))}var +oG=x["Promise"];function +Ft(a){return bK(a)}function +j7(a){return oG.resolve(a)}function +dY(a,b,c){return de(a,Ft(b),c)}function +aX(a){return bK(a)}function +_(a){return S(a)}function +Fm(a,b,c){if(!c)return;a[b]=c[1]}var +Fn=true;function +Fo(a,b){a[b]}function +Fq(a,b,c){if(c)return Fp(a,b,c[1])}function +Fr(a,b){return a[b]}function +Fs(a,b){return a[b]}function +Fu(c,b){return m$(oE(b),function(a){return h(c,b[a])})}function +Fv(a,b){var +d=b.length-1,e=j6(d),f=d-1|0,g=0;if(f>=0){var c=g;for(;;){e[c]=h(a,j(b,c)[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -Fa(a){return new -ok(c$(2,function(c,b){return i(a,function(a){return c(a)},function(a){return b(a)})}))}function -Fb(a,b){a.then(c$(1,b));return}function -Fc(a,b){return a.then(c$(1,b))}function -Fd(a,b,c){return a.then(c$(1,b),c$(1,c))}function -hd(a){return{fut:a}}function -jT(a){return a["fut"]}function -jU(a){return hd(jS(a))}function -ol(a,b){return hd(Fc(jT(a),function(a){return jT(h(b,a))}))}function -he(c,b){return ol(b,function(a){return jU(h(c,a))})}function -Fi(d,b,c){return hd(Fd(c,function(a){return jS([0,h(d,a)])},function(a){return jS([1,h(b,a)])}))}function -jV(a,b){return Fi(a,function(a){return a},b)}function -cF(a,b){return he(function(a){return wN(b,a)},a)}function -Fe(a){var -c=[0,function(a){throw g([0,f,Ff],1)}];function -b(a){return oj(0,"The future is already set")}return[0,hd(Fa(function(a,b){c[1]=a;return 0})),function(a){h(c[1],a);c[1]=b;return 0}]}function -Fg(a,b){return Fb(jT(a),b)}function -Fh(a){return jU([0,a])}function -Fj(c,b){return function(a){return ol(c,a)}(function(a){return 0===a[0]?h(b,a[1]):jU(a)})}w["Event"];function -hf(a){return a["target"]}function -om(a){a.preventDefault();return 0}function -dR(a,b,c,d){var -e=a?a[1]:{},f=c$(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function -on(a){return h(a,0)}var -jW="change",hg="click",oo=h5;w["ArrayBuffer"];w["DataView"];function -Fk(a){a.stopImmediatePropagation();return}var -Fl="DOMContentLoaded",Fm="ended",Fn=lM,Fo="keyup",Fp="play",Fq="scroll",Fr="wheel";w["Blob"];w["File"];var -op=w[iu];function -jX(a){return op.stringify(a)}function -hh(a){try{var -c=op.parse(a)}catch(f){var -b=O(f);if(b[1]===fx)return[1,b[2]];throw g(b,0)}return[0,c]}w["encodeURI"];w["decodeURI"];var -Fs=w["encodeURIComponent"],Ft=w["decodeURIComponent"],hi=w["URL"],jY=cy;function -Fv(a){return E7(a,Fw)}var -FA=w["URLSearchParams"];function -FB(a){return a.toString()}function -oq(a){return a.toString()}function -bT(a,b){return[0,a,b]}var -hj=[0,dk,dk];function -jZ(a){return[0,a,dk]}function -or(a){return a}var -cp=s2,hk=bI,j0=bk,j1="placeholder",j2=sd,fG="type",hl=cY,FH="for";function -cq(a){return bT(cp,a)}function -j3(a){return bT(FH,a)}var -FK=jZ(qR),FM=jZ("required");function -FG(a,b){return[0,a,EW(0,b)]}var -FI=rB,FJ="width";function -os(a){return bT(FI,a)}function -dS(a){return bT(j2,a)}function -ot(a){return bT(hl,a)}var -FN=jZ("selected"),dT=w["document"];function -Fu(a,b){return a?new -hi(b,a[1]):new -hi(b)}function -Fx(a){function -d(a){return Ft(a)}try{var -c=Fv(a),e=E0(jY,c)?EY(Fy,0,c):c,f=[0,bQ(d,EZ(jY,e))];return f}catch(f){var -b=O(f);if(b[1]===fx)return[1,b[2]];throw g(b,0)}}function -Fz(a,b){function -e(a){return EX(jY,Fs(a))}try{var +Fx(a){return new +oG(df(2,function(c,b){return i(a,function(a){return c(a)},function(a){return b(a)})}))}function +Fy(a,b){a.then(df(1,b))}function +Fz(a,b){return a.then(df(1,b))}function +FA(a,b,c){return a.then(df(1,b),df(1,c))}function +hq(a){return{fut:a}}function +j8(a){return a["fut"]}function +j9(a){var +c=[0,function(a){throw g([0,f,FB],1)}];function +b(a){return oF(0,"The future is already set")}return[0,hq(Fx(function(a,b){c[1]=a;return 0})),function(a){h(c[1],a);c[1]=b;return 0}]}function +j_(a,b){return Fy(j8(a),b)}function +hr(a){return hq(j7(a))}function +j$(a,b){return hq(Fz(j8(a),function(a){return j8(h(b,a))}))}function +eP(c,b){return j$(b,function(a){return hr(h(c,a))})}function +FD(d,b,c){return hq(FA(c,function(a){return j7([0,h(d,a)])},function(a){return j7([1,h(b,a)])}))}function +ka(a,b){return FD(a,function(a){return a},b)}function +cY(a,b){return eP(function(a){return xc(b,a)},a)}function +FC(a){return hr([0,a])}function +FE(a,b){return eP(b,a)}function +FF(c,b){return function(a){return j$(c,a)}(function(a){return 0===a[0]?h(b,a[1]):hr(a)})}x["Event"];function +hs(a){return a["target"]}function +oH(a){a.preventDefault();return 0}function +cZ(a,b,c,d){var +e=a?a[1]:{},f=df(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function +oI(a){return h(a,0)}var +kb="change",ht="click",oJ=im;x["ArrayBuffer"];x["DataView"];function +FG(a){return a["currentTarget"]}function +FH(a){a.stopImmediatePropagation()}var +FI="DOMContentLoaded",FJ="ended",FK=gr,FL="keyup",FM="play",FN="scroll",FO="wheel";x["Blob"];x["File"];var +oK=x[iK];function +kc(a){return oK.stringify(a)}function +hu(a){try{var +c=oK.parse(a)}catch(f){var +b=T(f);if(b[1]===eG)return[1,b[2]];throw g(b,0)}return[0,c]}x["encodeURI"];x["decodeURI"];var +FP=x["encodeURIComponent"],FQ=x["decodeURIComponent"],hv=x["URL"],kd=cR;function +FS(a){return Fs(a,FT)}var +FX=x["URLSearchParams"];function +FY(a){return a.toString()}function +oL(a){return a.toString()}function +b1(a,b){return[0,a,b]}var +hw=[0,dr,dr];function +ke(a){return[0,a,dr]}function +oM(a){return a}var +cr=tr,hx=aQ,kf=aS,kg="placeholder",kh=sD,fP="type",hy=c5,F4="for";function +cs(a){return b1(cr,a)}function +ki(a){return b1(F4,a)}var +F7=ke(rg),F9=ke("required");function +F3(a,b){return[0,a,Fh(0,b)]}var +F5=r2,F6="width";function +dZ(a){return b1(kh,a)}function +oN(a){return b1(hy,a)}var +F_=ke("selected"),d0=x["document"];function +FR(a,b){return a?new +hv(b,a[1]):new +hv(b)}function +FU(a){function +d(a){return FQ(a)}try{var +c=FS(a),e=Fl(kd,c)?Fj(FV,0,c):c,f=[0,bY(d,Fk(kd,e))];return f}catch(f){var +b=T(f);if(b[1]===eG)return[1,b[2]];throw g(b,0)}}function +FW(a,b){function +e(a){return Fi(kd,FP(a))}try{var d=new -hi(a);d[vt]=jN(0,bQ(e,b));var +hv(a);d[vV]=j3(0,bY(e,b));var f=[0,d];return f}catch(f){var -c=O(f);if(c[1]===fx)return[1,c[2]];throw g(c,0)}}function -FC(a){return new -FA(a)}function -FD(a,b){var +c=T(f);if(c[1]===eG)return[1,c[2]];throw g(c,0)}}function +FZ(a){return new +FX(a)}function +F0(a,b){var c=new -hi(a);oi(c,FE,FB(b));return c}function -FF(a,b){return a?b:hj}function -FL(a){return bT(hk,a)}function -FO(a){return bT(fG,a)}function -FP(a){return FG(FJ,a)}function -FQ(a){return a["ownerDocument"]}if(!hc(dT))dT[q6];function -FR(a,b){a.appendChild(b);return 0}function -FS(a,b,c,d){var -g=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(sd,jN([0,";"],bp(g)));if(0!==f)a.setAttribute(s2,jN([0,bK],bp(f)));return}var -h=e[2],k=e[1],i=k[2],j=k[1];if(jO(j))e=h;else if(ha(j,j2)){g=[0,i,g];e=h}else if(ha(j,cp)){var -l=jO(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function -ou(a,b,c,d){var -f=a?a[1]:dT,g=b?b[1]:0,e=f.createElement(c);FS(e,0,0,g);cm(function(a){return FR(e,a)},d);return e}function -a9(a,b){var -c=a?a[1]:dT;return c.createTextNode(aE(b))}function -j4(a,b,c){return jO(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function -FU(a){return og(a)?0.:a}function -j5(a){return[0,a,FU,function(a){return a}]}function -j6(a,b){var +hv(a);oD(c,F1,FY(b));return c}function +F2(a,b){return a?b:hw}function +F8(a){return b1(hx,a)}function +F$(a){return b1(F5,a)}function +Ga(a){return b1(fP,a)}function +Gb(a){return F3(F6,a)}function +Gc(a){return a["ownerDocument"]}if(!ho(d0))d0[rv];function +Gd(a,b){a.appendChild(b);return 0}function +Ge(a,b,c,d){var +g=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(sD,j3([0,";"],bs(g)));if(0!==f)a.setAttribute(tr,j3([0,bS],bs(f)));return}var +h=e[2],k=e[1],i=k[2],j=k[1];if(j4(j))e=h;else if(hm(j,kh)){g=[0,i,g];e=h}else if(hm(j,cr)){var +l=j4(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function +oO(a,b,c,d){var +f=a?a[1]:d0,g=b?b[1]:0,e=f.createElement(c);Ge(e,0,0,g);cp(function(a){return Gd(e,a)},d);return e}function +bc(a,b){var +c=a?a[1]:d0;return c.createTextNode(_(b))}function +kj(a,b,c){return j4(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function +Gg(a){return oB(a)?0.:a}function +kk(a){return[0,a,Gg,function(a){return a}]}function +kl(a,b){var c=b[a[1]];return h(a[2],c)}function -ov(a,b,c){return b?(c[qV].add(a),0):(c[qV].remove(a),0)}var -ow="div",ox="span",FZ="audio",F2="h1";function -hm(a,b,c,d){return ou(b,c,a,d)}function -hn(a,b,c){return hm(ow,a,b,c)}function -oy(a){return a[q6]}function -ho(a,b,c){dH(a,b,c);return 0}var -hp=w[rW];function -hq(a){return fd(function(a,b,c){var +oP(a,b,c){return b?(c[rk].add(a),0):(c[rk].remove(a),0)}var +oQ="div",oR="span",Gl="audio",Go="h1";function +hz(a,b,c,d){return oO(b,c,a,d)}function +hA(a,b,c){return hz(oQ,a,b,c)}function +oS(a){return a[rv]}function +fQ(a,b,c){de(a,b,c);return 0}var +fR=x[sk];function +fS(a){return fl(function(a,b,c){var e=b,d=c;for(;;){if(!d)return a;var -f=d[2];a[e]=d[1];e=e+1|0;d=f}}(jR(0),0,a))}function -b9(a){return ho(hp,Gb,hq(a))}function -oz(a){return ho(hp,Gc,hq(a))}w[rW];var -j7=w["navigator"],Gj=w["performance"],oA=w[vf];E3(w,Gk);function -oB(a,b){return w.setTimeout(c$(1,b),a)}function -oC(a){w.clearTimeout(a);return}function -FT(a,b){dH(a,uf,gB(b));return}function -FV(a,b,c){var -e=a?a[1]:w[vf],d=e.getComputedStyle(c)[b];return hc(d)?dk:d}function -FW(a){return E6(a,FX)}function -FY(a,b){var -c=a?a[1]:sS,d=sS<=c?1:0;b.scrollIntoView(!!d);return 0}var -F0=uC,F1="form",F3="img",F4=h5,F5="label",F6="option",F7="select";function -F8(a,b,c){return hm(FZ,a,b,c)}function -F9(a,b,c){return hm(F2,a,b,c)}function -F_(a,b,c){return hm(ox,a,b,c)}function -F$(a){var -b=a[sL];return oh(b)?b:oj(0,"Document body is null. Try to defer your script execution.")}function -Ga(a){return jP(function(a){return a},a["activeElement"])}function -Gd(a){return ho(hp,Ge,hq(a))}function -Gf(a){return ho(hp,Gg,hq(a))}function -Gh(a){return a}function -Gi(a){return a.now()}function -Gl(a){w.requestAnimationFrame(c$(1,a));return}w["ClipboardItem"];w["FormData"];var -Go=w["Headers"];function -oD(a,b,c,d,e,f,g,h,i,j,k,l,m){var -n={};n[sL]=jQ(eF,function(a){return a},a);dl(n,Gq,b);dl(n,Gr,c);E1(n,Gs,iV(function(a){return a},d));dl(n,Gt,e);E5(n,Gu,f);dl(n,Gv,g);dl(n,Gw,h);dl(n,Gx,i);dl(n,Gy,j);dl(n,Gz,k);n["signal"]=jQ(eF,function(a){return a},l);return n}var -GA=w["Request"];w["Response"];var -GC=w["fetch"];w["MediaStream"];w["MediaRecorder"];w["MessageChannel"];w["BroadcastChannel"];var -oE="message";function -oF(a){return a["data"]}w["Notification"];w["WebSocket"];function -Gm(a){return a}function -Gn(a){return jV(function(a){return a},a.text())}function -Gp(a,b){var -d=a?[0,a[1]]:[0],c=VX(Go,d);function -e(a,b){a.append(b[1],b[2]);return 0}cm(function(a){return e(c,a)},b);return c}function -GB(a,b){var +f=d[2];a[e]=d[1];e=e+1|0;d=f}}(j6(0),0,a))}function +c0(a){return fQ(fR,Gz,fS(a))}function +km(a){return fQ(fR,GA,fS(a))}function +hB(a){return fQ(fR,GD,fS(a))}x[sk];var +kn=x["navigator"],GI=x["performance"],oT=x[vF];Fo(x,GJ);function +oU(a,b){return x.setTimeout(df(1,b),a)}function +oV(a){x.clearTimeout(a)}function +Gf(a,b){de(a,uH,fB(b))}function +Gh(a,b,c){var +e=a?a[1]:x[vF],d=e.getComputedStyle(c)[b];return ho(d)?dr:d}function +Gi(a){return Fr(a,Gj)}function +Gk(a,b){var +c=a?a[1]:th,d=th<=c?1:0;b.scrollIntoView(!!d);return 0}var +Gm=u3,Gn="form",Gp="img",Gq=im,Gr="label",Gs="option",Gt="select";function +Gu(a,b,c){return hz(Gl,a,b,c)}function +Gv(a,b,c){return hz(Go,a,b,c)}function +Gw(a,b,c){return hz(oR,a,b,c)}function +Gx(a){var +b=a[s$];return oC(b)?b:oF(0,"Document body is null. Try to defer your script execution.")}function +Gy(a){return hp(function(a){return a},a["activeElement"])}function +GB(a){return fQ(fR,GC,fS(a))}function +GE(a){return fQ(fR,GF,fS(a))}function +GG(a){return a}function +GH(a){return a.now()}function +GK(a){x.requestAnimationFrame(df(1,a))}x["ClipboardItem"];x["FormData"];var +GN=x["Headers"];function +oW(a,b,c,d,e,f,g,h,i,j,k,l,m){var +n={};n[s$]=j5(fN,function(a){return a},a);ds(n,GP,b);ds(n,GQ,c);Fm(n,GR,ja(function(a){return a},d));ds(n,GS,e);Fq(n,GT,f);ds(n,GU,g);ds(n,GV,h);ds(n,GW,i);ds(n,GX,j);ds(n,GY,k);n["signal"]=j5(fN,function(a){return a},l);return n}var +GZ=x["Request"];x["Response"];var +G1=x["fetch"];x["MediaStream"];x["MediaRecorder"];x["MessageChannel"];x["BroadcastChannel"];x["Notification"];x["WebSocket"];function +GL(a){return a}function +GM(a){return ka(function(a){return a},a.text())}function +GO(a,b){var +d=a?[0,a[1]]:[0],c=X1(GN,d);function +e(a,b){a.append(b[1],b[2]);return 0}cp(function(a){return e(c,a)},b);return c}function +G0(a,b){var c=a?a[1]:{};return new -GA(b,c)}function -GD(a){function -b(a){return a}return function(a){return jV(b,a)}(GC(a))}function -GE(a){return a["localStorage"]}function -GF(a,b){function -c(a){return a}return function(a){return jP(c,a)}(a.getItem(b))}function -GG(a,b,c){try{a.setItem(b,c);return}catch(f){var -d=O(f);if(d[1]===fx)return;throw g(d,0)}}var -GH=w["Worker"];w["SharedWorker"];w["clients"];w["registration"];w["serviceWorker"];function -GI(a,b){var -c=a?a[1]:eF;return new -GH(b,c)}function -GJ(a,b,c){var -d=a?a[1]:eF;b.postMessage(c,d);return}function -GK(a,b){var -c=a?a[1]:eF;w.postMessage(b,c);return 0}function -cr(a,b,c){return[0,a,b,c]}function -oG(a){var -b=a[1];return 82===b?mD(gX(a[2])):83<=b?mD(gX(a[2])):1}function -hr(a){return wL(gX(a))}function -GL(a){return gw(bQ(function(a){var -b=a[1];return 82===b?[0,hr(a[2]),0]:83<=b?di(hr(a[2])):[0,a[2],0]},a))}function -oH(a){if(!a)return GM;var -b=xf(oG,a),c=b[2];return[0,GL(b[1]),c]}var -oI=uf,j8="before";function -GP(a){return[0,a]}function -GQ(a,b){return[1,hb,a,b]}var -GR="remove",GS="contains";function -oJ(a){var -b=Ga(FQ(a));return b?dQ(a,GS,[0,b[1]])|0:0}function -oK(e,b){var -c=[0,g9(GP,GQ)];return x(b,function(a){var -b=jK(c[1],a),d=b[2],g=b[1];c[1]=d;g$(e6,function(a,b){return 0===a[0]?a[1][ii]=E2:0},g,0);var -h=oJ(e),i=g_(d);if(i){var -f=function(d,b){if(0!==b[0]){if(!fE(b[1]))return b[1];var +GZ(b,c)}function +G2(a){function +b(a){return a}return function(a){return ka(b,a)}(G1(a))}var +G3="message";function +G4(a){return a["data"]}function +G5(a){return a["localStorage"]}function +G6(a,b){function +c(a){return a}return function(a){return hp(c,a)}(a.getItem(b))}function +G7(a,b,c){try{a.setItem(b,c);return}catch(f){var +d=T(f);if(d[1]===eG)return;throw g(d,0)}}var +G8=x["Worker"];x["SharedWorker"];x["clients"];x["registration"];x["serviceWorker"];function +G9(a,b){var +c=a?a[1]:fN;return new +G8(b,c)}function +G_(a,b,c){var +d=a?a[1]:fN;b.postMessage(c,d)}function +ct(a,b,c){return[0,a,b,c]}function +oX(a){var +b=a[1];return 82===b?mV(g_(a[2])):83<=b?mV(g_(a[2])):1}function +hC(a){return xa(g_(a))}function +G$(a){return gL(bY(function(a){var +b=a[1];return 82===b?[0,hC(a[2]),0]:83<=b?dp(hC(a[2])):[0,a[2],0]},a))}function +oY(a){if(!a)return Ha;var +b=xG(oX,a),c=b[2];return[0,G$(b[1]),c]}var +oZ=uH,ko="before";function +Hd(a){return[0,a]}function +He(a,b){return[1,hn,a,b]}var +Hf="remove",Hg="contains";function +o0(a){var +b=Gy(Gc(a));return b?dY(a,Hg,[0,b[1]])|0:0}function +o1(e,b){var +c=[0,hj(Hd,He)];return w(b,function(a){var +b=j0(c[1],a),d=b[2],g=b[1];c[1]=d;hl(fc,function(a,b){return 0===a[0]?a[1][iA]=Fn:0},g,0);var +h=o0(e),i=hk(d);if(i){var +f=function(d,b){if(0!==b[0]){if(!fO(b[1]))return b[1];var l=f(d,b[3]),k=f(l,b[2]);b[1]=k;return k}var c=b[1];delete -c[ii];if(c.parentNode!==e)if(fE(d))dQ(e,oI,[0,c]);else -dQ(d,j8,[0,c]);else{var +c[iA];if(c.parentNode!==e)if(fO(d))dY(e,oZ,[0,c]);else +dY(d,ko,[0,c]);else{var a=c.nextSibling!==d?1:0;if(a){if(h)var -g=oJ(c),i=g?function(a){for(;;){var -b=c.nextSibling;if(b===d)return 1;if(fE(b))return 0;dQ(c,j8,[0,b])}}(0):g;else +g=o0(c),i=g?function(a){for(;;){var +b=c.nextSibling;if(b===d)return 1;if(fO(b))return 0;dY(c,ko,[0,b])}}(0):g;else var i=h;var j=1-i}else var -j=a;if(j)if(fE(d))dQ(e,oI,[0,c]);else -dQ(d,j8,[0,c])}return c};f(hb,i[1])}g$(e6,function(a,b){if(0!==a[0])return 0;var -c=a[1],d=oh(c[ii]),e=d?(delete -c[ii],dQ(c,GR,[0]),0):d;return e},g,0);return e})}var -hs=aB(0),j9=[0,dk,dk];function -GN(a){if(!a)return GO;var -b=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,x(b[2],bd)]]}else -if(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return xc(oG,a)?[0,gw(bQ(function(a){var -b=a[1];return 82===b?[0,hr(a[2]),0]:83<=b?di(hr(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,g2(function(a){var -b=a[1];return 82===b?x(a[2],bd):83<=b?a[2]:aB(bd(a[2]))},of,a)]]}function -oL(c,b){function +j=a;if(j)if(fO(d))dY(e,oZ,[0,c]);else +dY(d,ko,[0,c])}return c};f(hn,i[1])}hl(fc,function(a,b){if(0!==a[0])return 0;var +c=a[1],d=oC(c[iA]),e=d?(delete +c[iA],dY(c,Hf,[0]),0):d;return e},g,0);return e})}var +hD=ay(0),kp=[0,dr,dr];function +Hb(a){if(!a)return Hc;var +b=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,w(b[2],bi)]]}else +if(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return xD(oX,a)?[0,gL(bY(function(a){var +b=a[1];return 82===b?[0,hC(a[2]),0]:83<=b?dp(hC(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,hc(function(a){var +b=a[1];return 82===b?w(a[2],bi):83<=b?a[2]:ay(bi(a[2]))},oA,a)]]}function +o2(c,b){function d(a){var -b=a[2],d=a[1];return ha(d,cp)?ov(b,1,c):j4(d,[0,b],c)}function +b=a[2],d=a[1];return hm(d,cr)?oP(b,1,c):kj(d,[0,b],c)}function e(a){var -b=a[1],d=a[2];return ha(b,cp)?ov(d,0,c):j4(b,0,c)}function +b=a[1],d=a[2];return hm(b,cr)?oP(d,0,c):kj(b,0,c)}function h(a){var -b=[0,j9];return function(a){if(b[1]!==j9)e(b[1]);var -c=or(a);d(c);b[1]=c;return 0}}return g2(function(a){var +b=[0,kp];return function(a){if(b[1]!==kp)e(b[1]);var +c=oM(a);d(c);b[1]=c;return 0}}return hc(function(a){var b=a[1];if(82===b){var -i=a[2];return x(i,h(0))}if(83>b)throw g([0,f,GT],1);var -j=a[2],c=[0,g9(function(a){var -b=or(a);d(b);return b},function(a,b){return j9})];return x(j,function(a){var -b=jK(c[1],a),d=b[2],f=b[1];c[1]=d;g$(e6,function(a,b){return e(a)},f,0);g_(d);return 0})},[0,hs,function(a,b){return hs}],b)}function -j_(a,b){return dR(b[1],b[2],b[3],a)}function -GU(c,b){return g2(function(a){var +i=a[2];return w(i,h(0))}if(83>b)throw g([0,f,Hh],1);var +j=a[2],c=[0,hj(function(a){var +b=oM(a);d(b);return b},function(a,b){return kp})];return w(j,function(a){var +b=j0(c[1],a),d=b[2],f=b[1];c[1]=d;hl(fc,function(a,b){return e(a)},f,0);hk(d);return 0})},[0,hD,function(a,b){return hD}],b)}function +kq(a,b){return cZ(b[1],b[2],b[3],a)}function +Hi(c,b){return hc(function(a){var b=a[1];if(82===b){var -d=[0,0];return x(a[2],function(a){var -b=d[1];if(b)on(b[1]);d[1]=[0,j_(c,a)];return 0})}if(83>b)throw g([0,f,GV],1);var -h=a[2],e=[0,g9(function(a){return j_(c,a)},function(a,b){return a})];return x(h,function(a){var -b=jK(e[1],a),c=b[2],d=b[1];e[1]=c;g$(e6,function(a,b){return on(a)},d,0);g_(c);return 0})},[0,hs,function(a,b){return hs}],b)}function -oM(a,b,c,d,e,f){var -p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){return},l=oH(p),k=l[2],s=l[1],m=oH(q),n=m[2],t=m[1],o=GN(f),i=o[2],g=ou(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var -u=oK(g,i[1]),j=co(oL(g,k),u,function(a,b){return b});else +d=[0,0];return w(a[2],function(a){var +b=d[1];if(b)oI(b[1]);d[1]=[0,kq(c,a)];return 0})}if(83>b)throw g([0,f,Hj],1);var +h=a[2],e=[0,hj(function(a){return kq(c,a)},function(a,b){return a})];return w(h,function(a){var +b=j0(e[1],a),c=b[2],d=b[1];e[1]=c;hl(fc,function(a,b){return oI(a)},d,0);hk(c);return 0})},[0,hD,function(a,b){return hD}],b)}function +o3(a,b,c,d,e,f){var +p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){},l=oY(p),k=l[2],s=l[1],m=oY(q),n=m[2],t=m[1],o=Hb(f),i=o[2],g=oO(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var +u=o1(g,i[1]),j=cc(o2(g,k),u,function(a,b){return b});else var -j=x(oL(g,k),function(a){return g});else +j=w(o2(g,k),function(a){return g});else var -j=i?oK(g,i[1]):aB(g);cm(function(a){j_(g,a);return 0},t);var -v=n?co(GU(g,n),j,function(a,b){return b}):j;return v}function -dU(a,b,c,d,e,f){return oM(b,c,d,e,a,f)}function -oN(a,b,c,d,e,f){return oM(b,c,d,e,a,0)}function -Q(a,b,c,d,e){return dU(ow,a,b,c,d,e)}function -ht(a,b,c,d,e){return oN(F4,a,b,c,d,e)}function -j$(a,b,c,d,e){return dU(F5,a,b,c,d,e)}function -oO(a,b,c,d,e){return dU(ox,a,b,c,d,e)}function -GW(a,b,c,d,e){return dU(F0,a,b,c,d,e)}function -GX(a,b,c,d,e){return dU(F1,a,b,c,d,e)}function -GY(a,b,c,d,e){return oN(F3,a,b,c,d,e)}function -GZ(a,b,c,d,e){return dU(F6,a,b,c,d,e)}function -G0(a,b,c,d,e){return dU(F7,a,b,c,d,e)}function -hu(a,b){return a===b?1:0}function -oP(a,b){return a!==b?1:0}function -hv(a,b){return a=i){var e=g;for(;;){var f=h(a,e+1|0),k=j(b,f)[1+f];b[1+f]=j(b,e)[1+e];b[1+e]=k;var -l=e-1|0;if(i===e)break;e=l}}return}function -G2(a){return G1(BT,a,0,a.length-1)}function -G3(a){return a}function -hw(a,b){return vO(a,b)}function -ka(a){try{var -c=[0,gn(a)];return c}catch(f){var -b=O(f);if(b[1]===dL)return 0;throw g(b,0)}}function -G4(a){return 4===iD(a)?1:0}function -oR(a){return k9<=a?k7<=a?lk<=a?2:6:lj<=a?4:3:h4<=a?lc<=a?1:7:lD<=a?5:0}function -G5(a){return typeof -a==="number"?cH<=a?1:0:bi<=a[1]?30+oR(a[2])|0:40+oR(a[2])|0}(function(a){var -b=G5(a);return h(t(G6),b)}(sl));var -kb=[B,G7,at(0)];function -oS(a){var -b=xN(a),c=ff(b,"blue");if(0<=c){if(0>=c)return He;if(b==="bold")return Hd;if(b==="cyan")return Hc;if(b==="green")return Hb;if(b==="magenta")return Ha;if(b==="red")return G$;if(b==="reset")return G_;if(b==="white")return G9;if(b==="yellow")return G8}else{if(b==="Black")return Hn;if(b==="Blue")return Hm;if(b==="Cyan")return Hl;if(b==="Green")return Hk;if(b==="Magenta")return Hj;if(b==="Red")return Hi;if(b==="White")return Hh;if(b==="Yellow")return Hg;if(b==="black")return Hf}throw g(kb,1)}function -oT(a,b){dd(b,a);return Hp}function -oU(a){try{yp(a);yq(a)}catch(f){var -b=O(f);if(b!==i4)throw g(b,0)}return Hq}var -oV=[B,Hr,at(0)],Ho=0;function -Hs(a,b,c){if(c[1]===oV)return oT(a,c[2]);if(c[1]!==ev)return h(b,c);var +l=e-1|0;if(i===e)break;e=l}}}function +Hr(a){return Hq(Cf,a,0,a.length-1)}function +Hs(a){return a}function +hH(a,b){return we(a,b)}function +ks(a){try{var +c=[0,gD(a)];return c}catch(f){var +b=T(f);if(b[1]===dT)return 0;throw g(b,0)}}function +Ht(a){return 4===iS(a)?1:0}function +o7(a){return ll<=a?lj<=a?lB<=a?2:6:lA<=a?4:3:ik<=a?lt<=a?1:7:lV<=a?5:0}function +Hu(a){return typeof +a==="number"?cL<=a?1:0:bm<=a[1]?30+o7(a[2])|0:40+o7(a[2])|0}(function(a){var +b=Hu(a);return h(v(Hv),b)}(sL));var +kt=[B,Hw,av(0)];function +o8(a){var +b=yc(a),c=fn(b,"blue");if(0<=c){if(0>=c)return HF;if(b==="bold")return HE;if(b==="cyan")return HD;if(b==="green")return HC;if(b==="magenta")return HB;if(b==="red")return HA;if(b==="reset")return Hz;if(b==="white")return Hy;if(b==="yellow")return Hx}else{if(b==="Black")return HO;if(b==="Blue")return HN;if(b==="Cyan")return HM;if(b==="Green")return HL;if(b==="Magenta")return HK;if(b==="Red")return HJ;if(b==="White")return HI;if(b==="Yellow")return HH;if(b==="black")return HG}throw g(kt,1)}function +o9(a,b){dj(b,a);return HQ}function +o_(a){try{yN(a);yO(a)}catch(f){var +b=T(f);if(b!==ji)throw g(b,0)}return HR}var +o$=[B,HS,av(0)],HP=0;function +HT(a,b,c){if(c[1]===o$)return o9(a,c[2]);if(c[1]!==eB)return h(b,c);var e=c[2];try{var -f=oT(a,oS(e));return f}catch(f){var -d=O(f);if(d===kb)return h(b,c);throw g(d,0)}}function -Ht(a,b,c){if(c[1]===oV)return oU(a);if(c[1]!==ev)return h(b,c);var -e=c[2];try{oS(e)}catch(f){var -d=O(f);if(d===kb)return h(b,c);throw g(d,0)}return oU(a)}function -Hu(a){var -c=en(0);Cm(a,1);var -b=Cn(a,0),d=b[2],e=b[1];return Co(a,[0,function(a){return Hs(c,e,a)},function(a){return Ht(c,d,a)},b[3],b[4]])}function -Hv(a,b){var -d=bq(64),c=dP(d),e=a?Ho:a;if(e)Hu(c);return jw(function(a){cD(c,0);return bx(d)},c,b)}function -kc(a){return Hv(1,a)}function -hx(a,b){return xi(a,b)}function -oW(a){return a|0}function -Hw(a){try{var -c=[0,vZ(a)];return c}catch(f){var -b=O(f);if(b[1]===dL)return 0;throw g(b,0)}}function -oX(a,b){try{var -d=[0,nn(a,b)];return d}catch(f){var -c=O(f);if(c===a6)return 0;throw g(c,0)}}function -oY(f,b){return function(a,b){var -d=a,c=b;for(;;){if(!c)return bp(d);var +f=o9(a,o8(e));return f}catch(f){var +d=T(f);if(d===kt)return h(b,c);throw g(d,0)}}function +HU(a,b,c){if(c[1]===o$)return o_(a);if(c[1]!==eB)return h(b,c);var +e=c[2];try{o8(e)}catch(f){var +d=T(f);if(d===kt)return h(b,c);throw g(d,0)}return o_(a)}function +HV(a){var +c=et(0);CK(a,1);var +b=CL(a,0),d=b[2],e=b[1];return CM(a,[0,function(a){return HT(c,e,a)},function(a){return HU(c,d,a)},b[3],b[4]])}function +HW(a,b){var +d=bt(64),c=dX(d),e=a?HP:a;if(e)HV(c);return jM(function(a){cG(c,0);return bA(d)},c,b)}function +HX(a){return HW(1,a)}function +hI(a,b){return xJ(a,b)}function +pa(a){return a|0}function +HY(a){try{var +c=[0,wp(a)];return c}catch(f){var +b=T(f);if(b[1]===dT)return 0;throw g(b,0)}}function +pb(a,b){try{var +d=[0,nH(a,b)];return d}catch(f){var +c=T(f);if(c===br)return 0;throw g(c,0)}}function +pc(f,b){return function(a,b){var +d=a,c=b;for(;;){if(!c)return bs(d);var g=c[2],e=h(f,c[1]),i=e?[0,e[1],d]:d;d=i;c=g}}(0,b)}function -Hx(a){var -b=i3(a)[24];return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return b(function(a,b,c){return[0,[0,a,b],c]},a,0)}]}function -oZ(a){return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Hx(a)[60]]}function -dV(a,b){return b?[0,h(a,b[1])]:0}function -o0(a,b,c){return c?h(b,c[1]):a}function -Hz(a,b){if(b)return h(a,b[1]);return}function -o1(a,b){return Hz(b,a)}function -o2(a,b){if(b)return h(a,b[1]);return}function -eI(a,b){return a?a[1]:b}function -o3(a,b){return dV(b,a)}function -Hy(a){return a?1:0}function -HA(a,b){return b?b[1]:a}function -HB(a){return a?[0,a[1],0]:0}ng(0);function -HC(a,b){if(0!==b[0])return;h(a,b[1]);return}var -HE=[B,HD,at(0)];function -b_(a){if(0===a[0])return a[1];throw g(HE,1)}function -HG(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function -o4(a,b){return HC(b,a)}function -HF(a,b){return 0===a[0]?a[1]:b}function -HH(a,b){return HG(b,a)}function -HI(a){var -b=mU(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[38],,,,,,,,,,,b[10]]}function -kd(a){var -b=HI(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function -ke(a){return l(a)}function -o5(a){return i1(a,HJ)}function -HK(a){return l(a[2])}function -HL(a){return a?function(a,b){return V(a,(l(a)-b|0)-1|0)}:function(a,b){return V(a,b)}}function -HM(a,b){var -h=ke(b),i=HL(a);if(0===h)return[0,[0],b];if(1===h)return[0,[0,-1],b];var -e=ck(h,0);j(e,0)[1]=-1;var -d=[0,2],c=[0,0];for(;;){if(!hv(d[1],h))return[0,e,b];var -n=c[1],o=i(b,c[1]);if(mE(i(b,d[1]-1|0),o)){c[1]++;var +HZ(a){var +b=jh(a)[24];return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return b(function(a,b,c){return[0,[0,a,b],c]},a,0)}]}function +pd(a){return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,HZ(a)[60]]}function +fV(a,b){return b?[0,h(a,b[1])]:0}function +pe(a,b,c){return c?h(b,c[1]):a}function +H1(a,b){if(b)return h(a,b[1])}function +pf(a,b){return H1(b,a)}function +pg(a,b){if(b)return h(a,b[1])}function +hJ(a,b){return a?a[1]:b}function +ph(a,b){return fV(b,a)}function +H0(a){return a?1:0}function +H2(a,b){return b?b[1]:a}function +H3(a){return a?[0,a[1],0]:0}nA(0);function +H4(a,b){if(0!==b[0])return;h(a,b[1])}var +H6=[B,H5,av(0)];function +dt(a){if(0===a[0])return a[1];throw g(H6,1)}function +H8(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function +H7(a,b){return 0===a[0]?a[1]:b}function +H9(a,b){return H4(b,a)}function +H_(a,b){return H8(b,a)}function +H$(a){var +b=nc(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[38],,,,,,,,,,,b[10]]}function +ku(a){var +b=H$(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function +kv(a){return l(a)}function +pi(a){return jf(a,Ia)}function +Ib(a){return l(a[2])}function +Ic(a){return a?function(a,b){return X(a,(l(a)-b|0)-1|0)}:function(a,b){return X(a,b)}}function +Id(a,b){var +h=kv(b),i=Ic(a);if(0===h)return[0,[0],b];if(1===h)return[0,[0,-1],b];var +e=ca(h,0);j(e,0)[1]=-1;var +d=[0,2],c=[0,0];for(;;){if(!hG(d[1],h))return[0,e,b];var +n=c[1],o=i(b,c[1]);if(mW(i(b,d[1]-1|0),o)){c[1]++;var k=d[1],p=c[1];j(e,k)[1+k]=p;d[1]++}else if(0===n){var -l=d[1];j(e,l)[1+l]=0;d[1]++}else{if(!fH(c[1],0))throw g([0,f,HN],1);var +l=d[1];j(e,l)[1+l]=0;d[1]++}else{if(!fT(c[1],0))throw g([0,f,Ie],1);var m=c[1];c[1]=j(e,m)[1+m]}}}function -HO(a){return HM(0,a)}function -HP(a,b,c){var -e=[0,c],d=[0,0],l=ke(b),i=HK(a);for(;;){if(hv(d[1],i)&&hv(e[1]+d[1]|0,l)){var -m=V(b,e[1]+d[1]|0);if(mE(m,V(a[2],d[1])))d[1]++;else{var -k=d[1],h=j(a[1],k)[1+k];if(eH(h,0)){if(!hv(h,d[1]))throw g([0,f,HQ],1);e[1]=(e[1]+d[1]|0)-h|0;d[1]=h}else{d[1]=0;e[1]++}}continue}return hu(d[1],i)?e[1]:-1}}function -HR(a){return hu(ke(a),1)?[0,V(a,0)]:[1,HO(a)]}function -HS(a,b,c){var -d=a?a[1]:0;if(0!==b[0])return HP(b[1],c,d);var +If(a){return Id(0,a)}function +Ig(a,b,c){var +e=[0,c],d=[0,0],l=kv(b),i=Ib(a);for(;;){if(hG(d[1],i)&&hG(e[1]+d[1]|0,l)){var +m=X(b,e[1]+d[1]|0);if(mW(m,X(a[2],d[1])))d[1]++;else{var +k=d[1],h=j(a[1],k)[1+k];if(eQ(h,0)){if(!hG(h,d[1]))throw g([0,f,Ih],1);e[1]=(e[1]+d[1]|0)-h|0;d[1]=h}else{d[1]=0;e[1]++}}continue}return hF(d[1],i)?e[1]:-1}}function +Ii(a){return hF(kv(a),1)?[0,X(a,0)]:[1,If(a)]}function +Ij(a,b,c){var +d=a?a[1]:0;if(0!==b[0])return Ig(b[1],c,d);var f=b[1];try{var -h=xP(c,d,f);return h}catch(f){var -e=O(f);if(e===a6)return-1;throw g(e,0)}}function -HU(e,b){var -d=l(e);if(fH(d,l(b)))return 0;var +h=ye(c,d,f);return h}catch(f){var +e=T(f);if(e===br)return-1;throw g(e,0)}}function +Il(e,b){var +d=l(e);if(fT(d,l(b)))return 0;var f=l(b)-d|0;return function(a){var -c=a;for(;;){if(hu(c,d))return 1;if(bn(b,f+c|0)!==bn(e,c))return 0;c=c+1|0}}(0)}function -kf(a,b){return HU(a,b)?[0,i0(b,0,l(b)-l(a)|0)]:0}function -HT(a,b){var -c=a?a[1]:0,d=HR(b);return function(a){return HS([0,c],d,a)}}function -HV(a){var -b=bq(fo(a));cm(function(a){return m(b,a)},a);return bx(b)}function -HW(d,b){var -c=bq(l(b));xL(function(a){var -b=h(d,a);return b?m(c,a):b},b);return bx(c)}function -HX(a,b){return}function -HY(a,b){HX(a,b);return}var -o7=[B,HZ,at(0)];function -o8(a){return[0,[0,a]]}function -dW(a,b,c,d){return[1,a,b,c,d]}function -H1(a){if(0===a[0]&&typeof +c=a;for(;;){if(hF(c,d))return 1;if(bg(b,f+c|0)!==bg(e,c))return 0;c=c+1|0}}(0)}function +kw(a,b){return Il(a,b)?[0,fz(b,0,l(b)-l(a)|0)]:0}function +Ik(a,b){var +c=a?a[1]:0,d=Ii(b);return function(a){return Ij([0,c],d,a)}}function +Im(a){var +b=bt(fw(a));cp(function(a){return m(b,a)},a);return bA(b)}function +In(d,b){var +c=bt(l(b));ya(function(a){var +b=h(d,a);return b?m(c,a):b},b);return bA(c)}function +Io(a,b){}function +Ip(a,b){Io(a,b)}var +pk=[B,Iq,av(0)];function +pl(a){return[0,[0,a]]}function +d2(a,b,c,d){return[1,a,b,c,d]}function +Is(a){if(0===a[0]&&typeof a[1]==="number")return 1;return 0}function -o9(a,b){if(0===b[0]){var +pm(a,b){if(0===b[0]){var c=b[1];if(typeof -c==="number")return o8(a);switch(c[0]){case +c==="number")return pl(a);switch(c[0]){case 0:return[0,[1,a,c[1]]];case -1:return[0,[2,a,c[1],c[2]]];default:return dW(4,[1,a,c[1]],H0,[1,c[2],c[3]])}}var +1:return[0,[2,a,c[1],c[2]]];default:return d2(4,[1,a,c[1]],Ir,[1,c[2],c[3]])}}var d=b[2],f=b[1];if(typeof d!=="number")switch(d[0]){case 0:break;case -1:return dW(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var -e=b[3],i=d[3],j=d[2],k=d[1],g=dK(e);a:if(cI===g)var -h=e[1];else{if(d9!==g&&dC!==g){var +1:return d2(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var +e=b[3],i=d[3],j=d[2],k=d[1],g=dS(e);a:if(cN===g)var +h=e[1];else{if(ec!==g&&dL!==g){var h=e;break a}var -h=mC(e)}return dW(f+1|0,[1,a,k],[d9,function(a){return o9([0,j,i],h)}],b[4])}return dW(f+1|0,[1,a,d[1]],b[3],b[4])}function -o_(a){if(0===a[0]){var +h=mU(e)}return d2(f+1|0,[1,a,k],[ec,function(a){return pm([0,j,i],h)}],b[4])}return d2(f+1|0,[1,a,d[1]],b[3],b[4])}function +pn(a){if(0===a[0]){var b=a[1];if(typeof -b==="number")throw g(o7,1);switch(b[0]){case -0:return[0,o6,b[1]];case +b==="number")throw g(pk,1);switch(b[0]){case +0:return[0,pj,b[1]];case 1:var -n=b[2];return[0,o8(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var -d=a[3],e=a[2],h=a[1],i=dK(d);a:if(cI===i)var -f=d[1];else{if(d9!==i&&dC!==i){var +n=b[2];return[0,pl(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var +d=a[3],e=a[2],h=a[1],i=dS(d);a:if(cN===i)var +f=d[1];else{if(ec!==i&&dL!==i){var f=d;break a}var -f=mC(d)}var +f=mU(d)}var j=a[4];if(typeof j!=="number"&&0!==j[0]){var c=a[4];if(typeof c!=="number"&&2===c[0]){var -q=c[3];return[0,dW(h-1|0,e,d,[1,c[1],c[2]]),q]}var -p=c[2];return[0,dW(h-1|0,e,d,[0,c[1]]),p]}var -k=j[1];if(H1(f))return[0,[0,e],k];var -l=o_(f),m=l[2],o=[1,m[1],m[2]];return[0,dW(h-1|0,e,wK(l[1]),o),k]}function -H3(a){if(typeof +q=c[3];return[0,d2(h-1|0,e,d,[1,c[1],c[2]]),q]}var +p=c[2];return[0,d2(h-1|0,e,d,[0,c[1]]),p]}var +k=j[1];if(Is(f))return[0,[0,e],k];var +l=pn(f),m=l[2],o=[1,m[1],m[2]];return[0,d2(h-1|0,e,w$(l[1]),o),k]}function +Iu(a){if(typeof a==="number")return 0;switch(a[0]){case 0:return 1;case 1:return 2;default:return 3}}function -H2(a){try{var -c=[0,o_(a)];return c}catch(f){var -b=O(f);if(b===o7)return 0;throw g(b,0)}}function -H4(a){return 0===a[0]?H3(a[1]):a[1]}function -H5(a){return a["height"]}function -H6(a){return a}function -H8(a){switch(a){case -0:return H9;case -1:return H_;default:return H$}}function -H7(a){return H6(a["contentRect"])}function -Ia(a,b,c){var -d=b?[0,c,{box:aE(H8(b[1]))}]:[0,c];dH(a,"observe",d);return 0}function -Ib(c){return new -w["ResizeObserver"](function(a,b){return i(c,eG(function(a){return a},a),b)})}function -o$(a){return a["mediaSession"]}function -Ic(a){var -b=aE(a[3]),c=aE(a[2]);return{src:aE(a[1]),sizes:c,type:b}}function -pa(a){var -b=fF(Ic,a[4]),c=aE(a[3]),d=aE(a[2]);return{title:aE(a[1]),artist:d,album:c,artwork:b}}function -pb(a,b,c){a.setActionHandler(b,c$(1,c));return}function -Id(a,b){b9([0,Ie,[0,pa(b),0]]);var -c=pa(b);a["metadata"]=new -w["MediaMetadata"](c);return}var -If="nexttrack",Ig="previoustrack";function -Ih(a,b,c,d){function -e(c,b){return iV(function(a){return[0,c,a]},b)}var -g=e(Ii,a),h=e(Ij,b),f=mI(function(a){return a},[0,g,[0,h,[0,e(Ik,c),0]]]),i=f?[0,v1(gB(f))]:[0];dH(d,"setPositionState",i);return 0}w["IDBKeyRange"];function -pc(a,b){return[0,b,a]}var -pd=[0,function(a){return a},function(a){return a}];function -Il(a){return 0===a[0]?aE(a[1]):E_(aE,a[1])}function -Im(a,b,c){return[0,a,b]}function -In(f,b){function -g(a,b){return Im(f,a,b)}var -c=function(a){return g(b,a)}(b),d=c[1],e=c[2],a=[0,d,e,,,,,,,,,,,function(a,b,c){if(b)var -g=h(e[1],b[1]),f=[0,h(d[2],a),g];else +It(a){try{var +c=[0,pn(a)];return c}catch(f){var +b=T(f);if(b===pk)return 0;throw g(b,0)}}function +Iv(a){return 0===a[0]?Iu(a[1]):a[1]}function +Iw(a){return a["height"]}function +Ix(a){return a}function +Iz(a){switch(a){case +0:return IA;case +1:return IB;default:return IC}}function +Iy(a){return Ix(a["contentRect"])}function +ID(a,b,c){var +d=b?[0,c,{box:_(Iz(b[1]))}]:[0,c];de(a,"observe",d);return 0}function +IE(c){return new +x["ResizeObserver"](function(a,b){return i(c,eN(function(a){return a},a),b)})}function +po(a){return a["mediaSession"]}function +IF(a){var +b=_(a[3]),c=_(a[2]);return{src:_(a[1]),sizes:c,type:b}}function +pp(a){var +b=eO(IF,a[4]),c=_(a[3]),d=_(a[2]);return{title:_(a[1]),artist:d,album:c,artwork:b}}function +pq(a,b,c){a.setActionHandler(b,df(1,c))}function +IG(a,b){c0([0,IH,[0,pp(b),0]]);var +c=pp(b);return a["metadata"]=new +x["MediaMetadata"](c)}var +II="nexttrack",IJ="previoustrack";function +IK(a,b,c,d){function +e(c,b){return ja(function(a){return[0,c,a]},b)}var +g=e(IL,a),h=e(IM,b),f=m0(function(a){return a},[0,g,[0,h,[0,e(IN,c),0]]]),i=f?[0,mw(fB(f))]:[0];de(d,"setPositionState",i);return 0}function +pr(a){return 0===a[0]?_(a[1]):Fv(_,a[1])}x["IDBKeyRange"];var +IR="success",IS=gr;function +fW(a,b){return[0,b,a]}function +IT(a){return a[1][gr]}function +kx(a){var +b=a[1]["result"];return h(a[2],b)}function +ps(c,b){cZ(0,IR,function(a){return i(c,a,b)},b[1]);return b}function +IU(c,b){cZ(0,IS,function(a){return i(c,a,b)},b[1]);return b}function +IV(a){var +b=j9(0),c=b[2],d=b[1];ps(function(a,b){return c([0,kx(b)])},a);IU(function(a,b){return c([1,IT(b)])},a);return d}var +ky=[0,function(a){return a},function(a){return a}],IQ="upgradeneeded";function +pt(d,b,c){return[0,d,b,,function(a,b){function +e(a){return hp(function(a){return h(d[3],a)},a)}return function(a){return fW(e,a)}(b.get(h(c[1],a)))}]}function +IY(a){switch(a){case +0:return IZ;case +1:return I0;default:return I1}}function +I3(a,b,c,d){var +g=c?c[1]:0,e=[0,[0,I4,!!g],0],i=b?[0,[0,I5,pr(b[1])],e]:e,f=mw(fB(i));hB([0,I6,[0,f,0]]);var +j=d.createObjectStore(_(a[2][1]),f);return h(a[1],j)}function +I_(c,b){function +g(a,b){return pt(c,a,b)}var +a=function(a){return g(b,a)}(b),e=a[1],f=a[2],d=[0,e,f,,,,,,,,,,,function(a,b,c){if(b)var +g=h(f[1],b[1]),d=[0,h(e[2],a),g];else var -f=[0,h(d[2],a)];var -i=dH(c,"add",f),j=e[2];return function(a){return pc(j,a)}(i)},function(a,b,c,d,e){function +d=[0,h(e[2],a)];var +i=de(c,"add",d),j=f[2];return function(a){return fW(j,a)}(i)},function(a,b,c,d,e){function f(a){return a}var -g=v1(gB(function(a){return mI(f,a)}([0,iV(function(a){return[0,Io,!!a]},d),0]))),i=Il(c),j=e.createIndex(aE(b),i,g);return h(a[1],j)},function(a,b,c){var -d=c.index(aE(b));return h(a[1],d)},function(a,b,c){if(b)var -g=h(e[1],b[1]),f=[0,h(d[2],a),g];else +g=mw(fB(function(a){return m0(f,a)}([0,ja(function(a){return[0,I$,!!a]},d),0]))),i=pr(c),j=e.createIndex(_(b),i,g);return h(a[1],j)},function(a,b,c){var +d=c.index(_(b));return h(a[1],d)},function(a,b,c){if(b)var +g=h(f[1],b[1]),d=[0,h(e[2],a),g];else var -f=[0,h(d[2],a)];var -i=dH(c,"put",f),j=e[2];return function(a){return pc(j,a)}(i)}];return[0,,a[1],a[2],,,,,,,,,,,,a[14]]}function -dX(a,b){return}function -dY(a,b){var -c=In(a,b);return[0,,,,,,,,,,,,c[2],c[3],,c[15]]}var -Ip=q0,Iq="pattern";function -Ir(a){function -b(a){return a|0}return function(a){return jV(b,a)}(a.persist())}function -Is(a){return a["storage"]}var -pe=kd([0,fr]);function -It(a,b){h(a,b);return b}function -Iu(a){var -b=kf(Iv,a);if(b){var -c=b[1],d=Hw(c);if(d)return[0,[0,d[1]]];var -g=function(a){return[0,a]};return function(a){return dV(g,a)}(ka(c))}var -e=kf(Iw,a);if(e){var -h=function(a){return[1,a]};return function(a){return dV(h,a)}(ka(e[1]))}var -f=kf(Ix,a);if(!f)return 0;function -i(a){return[1,a]}return function(a){return dV(i,a)}(ka(f[1]))}function -pf(a){switch(a[0]){case +d=[0,h(e[2],a)];var +i=de(c,"put",d),j=f[2];return function(a){return fW(j,a)}(i)}];return[0,,d[1],d[2],,,,,,,,,,,d[13],d[14],d[15],d[16],function(a,b,c){return I3([0,function(a){return a},d[1],d[2],d[13],d[14],d[15],d[16]],a,b,c)}]}function +Ja(e,b){var +c=e[3],d=e[2];function +g(a,b){return pt(d,a,b)}var +f=[0,,,,function(a){return g(c,a)}(b)[4],,,,,,,,,b];return[0,,,,,f[4],,,,,,,,,f[13],function(a,b,c,d){return d$(e[5],[0,function(a){return a},f[13]],a,b,c,d)}]}function +cI(a,b){var +c=Ja(a,b);return[0,c[14],function(a){return a},,,,,,c[5],,,,,,,c[15]]}function +du(a,b){var +c=I_(a,b);return[0,,,,,,,,,,,function(a){return a},c[2],c[3],c[14],c[15],c[16],c[17],c[18]]}function +IO(a){return a["oldVersion"]}function +IP(a){return a["newVersion"]}function +IW(a){return eP(function(a){if(0===a[0])return a[1];var +b=a[1];km([0,IX,[0,b,0]]);throw g([0,eG,b],1)},IV(a))}function +I2(a,b){var +c=b.objectStore(_(a[2][1]));return h(a[1],c)}function +I7(a,b){a.deleteObjectStore(_(b));return 0}function +I8(a,b,c){var +d=b?b[1]:0,e=_(IY(d));return c.transaction(eO(function(a){return _(a[2][1])},a),e)}function +I9(a){return function(a){return Fu(aX,a)}(a["objectStoreNames"])}function +Jb(c,b){cZ(0,IQ,function(a){function +b(a){return a}return i(c,a,function(a){return fW(b,a)}(FG(a)))},b[1]);return b}function +Jc(a,b,c){var +d=b?[0,a,mN(b[1])]:[0,a];function +e(a,b,c){return de(a,b,c)}function +f(a){return a}return function(a){return fW(f,a)}(function(a){return e(c,Jd,a)}(yt(_,d)))}function +Je(a,b){var +c=a?a[1]:x;return c["indexedDB"]}var +Jf=rp,Jg="pattern";function +Jh(a){function +b(a){return a|0}return function(a){return ka(b,a)}(a.persist())}function +Ji(a){return a["storage"]}var +pu=ku([0,fA]);function +Jj(a,b){h(a,b);return b}function +Jk(a){var +b=kw(Jl,a);if(b){var +c=b[1],d=HY(c);if(d)return[0,[0,d[1]]];var +g=function(a){return[0,a]};return function(a){return fV(g,a)}(ks(c))}var +e=kw(Jm,a);if(e){var +h=function(a){return[1,a]};return function(a){return fV(h,a)}(ks(e[1]))}var +f=kw(Jn,a);if(!f)return 0;function +i(a){return[1,a]}return function(a){return fV(i,a)}(ks(f[1]))}function +pv(a){switch(a[0]){case 0:var -b=a[1];return h(t(Iy),b);case +b=a[1];return h(v(Jo),b);case 1:var -c=a[1];return h(t(Iz),c);default:var -d=a[1];return h(t(IA),d)}}function -kg(a){var -c=a?a[1]:oy(dT);function +c=a[1];return h(v(Jp),c);default:var +d=a[1];return h(v(Jq),d)}}function +kz(a){var +c=a?a[1]:oS(d0);function b(a){var -b=Iu(bM(FV(0,"font-size",a)));if(!b)return 16.;var -c=b[1];return 0===c[0]?c[1]:fh(IB)}return function(a){switch(a[0]){case +b=Jk(bK(Gh(0,"font-size",a)));if(!b)return 16.;var +c=b[1];return 0===c[0]?c[1]:fp(Jr)}return function(a){switch(a[0]){case 0:return a[1];case 1:var -d=a[1];return d*b(oy(dT));default:var +d=a[1];return d*b(oS(d0));default:var e=a[1];return e*b(c)}}}function -pg(e,b,c,d){function -f(a,b){return a$(e,b[1],b[2],a)}function -g(a,b){return co(d,a,b)}return function(a){return g(a,f)}(co(b,c,function(a,b){return[0,a,b]}))}var -IE=[B,ID,at(0)],IG=[B,IF,at(0)];function -ph(a){return[0,0]}function -pi(a,b){if(a[1])throw g(IG,1);a[1]=[0,b];return 0}function -kh(a){var -b=a[1];if(b)return b[1];throw g(IE,1)}function -IC(a,b,c){return pg(function(a,b,c){return[0,a,b,c]},a,b,c)}function -IH(a){return jX(a)}function -II(a){var -b=hh(a);return 0===b[0]?[0,b[1]]:(oz([0,b[1],0]),IJ)}var -pj=GE(oA);function -pk(c,b){return function(a){return GG(pj,c,a)}(IH(b))}function -IK(a){var -b=GF(pj,a);function -c(a){return II(a)}var -d=b?[0,b[1]]:IL;return HH(d,c)}function -IM(a,b){var -c=IK(a);if(0===c[0])return c[1];var +pw(e,b,c,d){function +f(a,b){return bH(e,b[1],b[2],a)}function +g(a,b){return cc(d,a,b)}return function(a){return g(a,f)}(cc(b,c,function(a,b){return[0,a,b]}))}var +Ju=[B,Jt,av(0)],Jw=[B,Jv,av(0)];function +px(a){return[0,0]}function +py(a,b){if(a[1])throw g(Jw,1);a[1]=[0,b];return 0}function +kA(a){var +b=a[1];if(b)return b[1];throw g(Ju,1)}function +Js(a,b,c){return pw(function(a,b,c){return[0,a,b,c]},a,b,c)}function +Jx(a,b){var +c=aB(a);j_(b,function(a){return ai(c,a)});return c}function +Jy(a){return kc(a)}function +Jz(a){var +b=hu(a);return 0===b[0]?[0,b[1]]:(km([0,b[1],0]),JA)}var +pz=G5(oT);function +pA(c,b){return function(a){return G7(pz,c,a)}(Jy(b))}function +JB(a){var +b=G6(pz,a);function +c(a){return Jz(a)}var +d=b?[0,b[1]]:JC;return H_(d,c)}function +JD(a,b){var +c=JB(a);if(0===c[0])return c[1];var d=c[1];return typeof -d==="number"?h(b,0):(Gd([0,d[2],0]),h(b,0))}function -IN(d,b){pk(d,b);var -a=aC(b),c=g0(0,aD(a));g1(c,function(a){pk(d,dg(c));return 0});dg(c);return a}function -pl(a,b){var -c=S(a);return IN(c,IM(c,b))}function -hy(a,b){return pl(a,function(a){return b})}function -IO(d){function +d==="number"?h(b,0):(GB([0,d[2],0]),h(b,0))}function +JE(d,b){pA(d,b);var +a=aB(b),c=ha(0,ap(a));hb(c,function(a){pA(d,dm(c));return 0});dm(c);return a}function +pB(a,b){var +c=S(a);return JE(c,JD(c,b))}function +hK(a,b){return pB(a,function(a){return b})}function +JF(d){function c(a,b,c){var -e=b?b[1]:IQ;return h(a,[0,i(t(IP),d,e),c])}function -b(a,b){return c(Gf,a,b)}return[0,,,,function(a){return b(0,a)}]}var -IS=pe[49],IR=pe[29];function -IT(a){return bQ(function(a){return[0,80,cq(S(a))]},IS(a))}var -IU=0;function -pm(a,b){var -d=IT(b[1]),e=b[2],c=function(a){return cC(e,a)}(d);return a?[0,[0,80,FL(S(a[1]))],c]:c}function -pn(a){return[0,IR(a),IU]}function -aT(d,b,c){var -a=b[1],e=82===a?[0,82,x(b[2],function(a){return function(a){return bT(d,a)}(S(a))})]:83<=a?fh(IV):[0,80,function(a){return bT(d,a)}(S(b[2]))];return[0,e,c]}function -fJ(d,b,c){return b?[0,[0,80,function(a){return bT(d,a)}(S(b[1]))],c]:c}function -po(a,b){var -c=b[1];return 82===c?[0,82,x(b[2],a)]:83<=c?[0,83,dj(a,b[2])]:[0,80,h(a,b[2])]}function -IX(a){return 0===a[0]?cq(S(a[1])):a[1]}function -ki(a,b){return[0,po(IX,a),b]}function -dZ(a){return ki(a,0)}function -kj(a,b){return ki(a,b)}function -IW(a,b,c){return b?[0,[0,80,a],c]:c}function -IY(a){return ki(po(function(a){return[0,a]},a),0)}function -IZ(a,b,c,d){var -e=b?b[1]:0;return ht(a,[0,function(a){return aT(hl,d,a)}(aT(fG,I0,e))],c,0,0)}function -I1(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):FY(0,b[1])}function -I2(a,b,c,d,e){var -g=a?a[1]:0,h=b?b[1]:0,f=aC(1),i=kj(I3,kj([0,82,x(aD(f),function(a){return a?[1,cq("locked")]:[1,hj]})],g)),j=IY(I4),k=[0,[0,80,cr(0,hg,function(a){return ah(f,1)})],0],l=Q(0,[0,j],[0,k],0,[0,[0,82,GW(0,0,0,0,[0,[0,80,a9(0,I5)],0])],0]),m=cr(0,Fr,function(a){var -b=ap(f);return b?ah(f,0):b});return Q(0,[0,i],[0,[0,[0,80,m],h]],c,[0,[0,82,x(IC(e,aD(f),d),function(a){var -b=a[1],c=a[3];if(a[2])o2(function(a){return I1(b,a)},c);return b})],[0,[0,82,l],0]])}function -I6(e,b,c){var -d=aC(c);return[0,cr(0,b,function(a){return ah(d,h(e,hf(a)[cY]))}),d]}function -kk(a,b,c,d,e,f,g,h,i,j){var -l=d?d[1]:0,m=f?f[1]:0,n=function(a){return fJ(Iq,h,a)}(function(a){return IW(FM,m,a)}([0,[0,80,FO(S(i))],l])),o=eI(b,function(a){return[0,a]}),k=I6(a,g,j),p=k[2],q=k[1];return[0,ht(c,[0,n],[0,[0,[0,80,q],HB(e)]],0,0),p,o]}function -pp(a,b,c,d,e,f,g,h){var -i=c?c[1]:0,j=function(a){return fJ(hl,h,a)}(function(a){return fJ(j1,g,a)}(i));return kk(be,a,b,[0,j],d,e,oo,f,I8,HA(I7,h))}function -I9(a,b,c,d,e,f,g,h){var -i=c?c[1]:0;return kk(be,a,b,[0,function(a){return fJ(j1,g,a)}(i)],d,e,oo,f,I$,I_)}function -Ja(a,b,c,d){var -e=b?b[1]:0;return kk(function(a){return 0},0,a,[0,aT(hl,d,e)],c,0,jW,0,Jb,0)}function -hz(a,b){return x(a,function(a){return[0,a,b]})}function -Jc(a,b,c,d,e){var -i=[0,[0,b7,function(a){return a}],function(a,b){var -c=b[2],d=a[2];return[0,b8(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function +e=b?b[1]:JH;return h(a,[0,i(v(JG),d,e),c])}function +b(a,b){return c(GE,a,b)}return[0,,,,function(a){return b(0,a)}]}var +JJ=pu[49],JI=pu[29];function +JK(a){return bY(function(a){return[0,80,cs(S(a))]},JJ(a))}var +JL=0;function +pC(a,b){var +d=JK(b[1]),e=b[2],c=function(a){return cF(e,a)}(d);return a?[0,[0,80,F8(S(a[1]))],c]:c}function +pD(a){return[0,JI(a),JL]}function +aY(d,b,c){var +a=b[1],e=82===a?[0,82,w(b[2],function(a){return function(a){return b1(d,a)}(S(a))})]:83<=a?fp(JM):[0,80,function(a){return b1(d,a)}(S(b[2]))];return[0,e,c]}function +fX(d,b,c){return b?[0,[0,80,function(a){return b1(d,a)}(S(b[1]))],c]:c}function +pE(a,b){var +c=b[1];return 82===c?[0,82,w(b[2],a)]:83<=c?[0,83,dq(a,b[2])]:[0,80,h(a,b[2])]}function +JO(a){return 0===a[0]?cs(S(a[1])):a[1]}function +kB(a,b){return[0,pE(JO,a),b]}function +d3(a){return kB(a,0)}function +kC(a,b){return kB(a,b)}function +JN(a,b,c){return b?[0,[0,80,a],c]:c}function +JP(a){return kB(pE(function(a){return[0,a]},a),0)}function +JQ(a,b,c,d){var +e=b?b[1]:0;return hE(a,[0,function(a){return aY(hy,d,a)}(aY(fP,JR,e))],c,0,0)}function +JS(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):Gk(0,b[1])}function +JT(a,b,c,d,e){var +g=a?a[1]:0,h=b?b[1]:0,f=aB(1),i=kC(JU,kC([0,82,w(ap(f),function(a){return a?[1,cs("locked")]:[1,hw]})],g)),j=JP(JV),k=[0,[0,80,ct(0,ht,function(a){return ai(f,1)})],0],l=Q(0,[0,j],[0,k],0,[0,[0,82,Hk(0,0,0,0,[0,[0,80,bc(0,JW)],0])],0]),m=ct(0,FO,function(a){var +b=az(f);return b?ai(f,0):b});return Q(0,[0,i],[0,[0,[0,80,m],h]],c,[0,[0,82,w(Js(e,ap(f),d),function(a){var +b=a[1],c=a[3];if(a[2])pg(function(a){return JS(b,a)},c);return b})],[0,[0,82,l],0]])}function +JX(e,b,c){var +d=aB(c);return[0,ct(0,b,function(a){return ai(d,h(e,hs(a)[c5]))}),d]}function +kD(a,b,c,d,e,f,g,h,i,j){var +l=d?d[1]:0,m=f?f[1]:0,n=function(a){return fX(Jg,h,a)}(function(a){return JN(F9,m,a)}([0,[0,80,Ga(S(i))],l])),o=hJ(b,function(a){return[0,a]}),k=JX(a,g,j),p=k[2],q=k[1];return[0,hE(c,[0,n],[0,[0,[0,80,q],H3(e)]],0,0),p,o]}function +pF(a,b,c,d,e,f,g,h){var +i=c?c[1]:0,j=function(a){return fX(hy,h,a)}(function(a){return fX(kg,g,a)}(i));return kD(aX,a,b,[0,j],d,e,oJ,f,JZ,H2(JY,h))}function +J0(a,b,c,d,e,f,g,h){var +i=c?c[1]:0;return kD(aX,a,b,[0,function(a){return fX(kg,g,a)}(i)],d,e,oJ,f,J2,J1)}function +J3(a,b,c,d){var +e=b?b[1]:0;return kD(function(a){return 0},0,a,[0,aY(hy,d,e)],c,0,kb,0,J4,0)}function +hL(a,b){return w(a,function(a){return[0,a,b]})}function +J5(a,b,c,d,e){var +i=[0,[0,cd,function(a){return a}],function(a,b){var +c=b[2],d=a[2];return[0,ce(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function j(a){var b=a[1],c=a[2];function d(a){var -c=ap(b[2]);return h(b[3],c)}return[0,bd(b[1]),function(a){var +c=az(b[2]);return h(b[3],c)}return[0,bi(b[1]),function(a){var b=d(0);return h(h(c,a),b)}]}var -f=function(a){return dh(j,i,a)}(cE(d[2])),g=[0,82,x(f,function(a){var -b=a[2];return cr(0,Ip,function(a){h(e,h(b,d[1]));return om(a)})})],k=x(f,function(a){return a[1]}),l=o0([0,g,0],function(a){return w7(g,a)},c);return GX(a,b,[0,l],0,[0,[0,83,cE(k)],0])}function -pq(a,b){return a?h(t(Jd),b):h(t(Je),b)}function -pr(a,b,c,d,e){var -m=a?a[1]:0,n=b?b[1]:0,j=d?d[1]:function(a){return function(a){return 0}},f=pq(1,e[1]),o=pq(0,e[1]),g=hy(f,e[2]),p=ap(g),q=h(j,1);(function(a){return o2(q,a)}(p));var -r=e[3];j$(0,[0,[0,[0,80,j3(S(f))],0]],0,0,r);var -s=[0,80,o],k=function(a){return fJ(j1,c,a)}(function(a){return aT(fG,Jf,a)}(function(a){return aT(j0,s,a)}(aT(hk,[0,80,f],m)))),l=ap(g),t=l?[0,[0,80,ot(S(l[1]))],k]:k;return[0,ht(0,[0,t],[0,[0,[0,80,cr(0,Fo,function(a){var -b=be(hf(a)[cY]);i(j,0,b);return ah(g,[0,b])})],n]],0,0)]}function -ps(a,b){return a?h(t(Jg),b):b}function -pt(a,b,c,d,e,f){var -l=a?a[1]:1,m=b?b[1]:0,n=c?c[1]:0,k=d?d[1]:function(a){return function(a){return 0}},g=ps(1,e[1]),o=ps(0,e[1]),j=l?hy(g,e[2]):aC(e[2]),p=ap(j);h(h(k,1),p);var -q=e[3];j$(0,[0,[0,[0,80,j3(S(g))],0]],0,0,q);var -r=[0,80,o],s=function(a){return aT(fG,Jh,a)}(function(a){return aT(j0,r,a)}(aT(hk,[0,80,g],m))),t=[0,[0,80,cr(0,jW,function(a){var -b=be(hf(a)[cY]);i(k,0,b);return ah(j,b)})],n];return[0,G0(0,[0,s],[0,t],0,[0,[0,83,cE(dj(function(a){var -b=a[1],c=a[2],d=dZ([0,80,[1,ot(S(b))]]),e=kj([0,82,x(aD(j),function(a){return[1,FF(hw(a,b),FN)]})],d);return GZ(0,[0,e],0,0,[0,[0,80,a9(0,c)],0])},f))],0])]}function -Ji(a,b,c){return a$(t(Jj),c,a,b)}function -Jk(a,b,c,d,e,f,g){var -l=b?b[1]:0,m=c?c[1]:function(a){return},j=h(kc(Jl),d);function +f=function(a){return dn(j,i,a)}(cH(d[2])),g=[0,82,w(f,function(a){var +b=a[2];return ct(0,Jf,function(a){h(e,h(b,d[1]));return oH(a)})})],k=w(f,function(a){return a[1]}),l=pe([0,g,0],function(a){return xw(g,a)},c);return Hl(a,b,[0,l],0,[0,[0,83,cH(k)],0])}function +pG(a,b){return a?h(v(J6),b):h(v(J7),b)}function +pH(a,b,c,d,e){var +m=a?a[1]:0,n=b?b[1]:0,j=d?d[1]:function(a){return function(a){return 0}},f=pG(1,e[1]),o=pG(0,e[1]),g=hK(f,e[2]),p=az(g),q=h(j,1);(function(a){return pg(q,a)}(p));var +r=e[3];kr(0,[0,[0,[0,80,ki(S(f))],0]],0,0,r);var +s=[0,80,o],k=function(a){return fX(kg,c,a)}(function(a){return aY(fP,J8,a)}(function(a){return aY(kf,s,a)}(aY(hx,[0,80,f],m)))),l=az(g),t=l?[0,[0,80,oN(S(l[1]))],k]:k;return[0,hE(0,[0,t],[0,[0,[0,80,ct(0,FL,function(a){var +b=aX(hs(a)[c5]);i(j,0,b);return ai(g,[0,b])})],n]],0,0)]}function +pI(a,b){return a?h(v(J9),b):b}function +pJ(a,b,c,d,e,f){var +l=a?a[1]:1,m=b?b[1]:0,n=c?c[1]:0,k=d?d[1]:function(a){return function(a){return 0}},g=pI(1,e[1]),o=pI(0,e[1]),j=l?hK(g,e[2]):aB(e[2]),p=az(j);h(h(k,1),p);var +q=e[3];kr(0,[0,[0,[0,80,ki(S(g))],0]],0,0,q);var +r=[0,80,o],s=function(a){return aY(fP,J_,a)}(function(a){return aY(kf,r,a)}(aY(hx,[0,80,g],m))),t=[0,[0,80,ct(0,kb,function(a){var +b=aX(hs(a)[c5]);i(k,0,b);return ai(j,b)})],n];return[0,Ho(0,[0,s],[0,t],0,[0,[0,83,cH(dq(function(a){var +b=a[1],c=a[2],d=d3([0,80,[1,oN(S(b))]]),e=kC([0,82,w(ap(j),function(a){return[1,F2(hH(a,b),F_)]})],d);return Hn(0,[0,e],0,0,[0,[0,80,bc(0,c)],0])},f))],0])]}function +J$(a,b,c){return bH(v(Ka),c,a,b)}function +Kb(a,b,c,d,e,f,g){var +l=b?b[1]:0,m=c?c[1]:function(a){},j=h(HX(Kc),d);function k(a){return a?[0,e]:0}a:{if(a&&a[1]){var -n=hy(j,k(g)),i=n;break a}var -i=aC(k(g))}var -o=j$(0,[0,[0,[0,80,j3(S(j))],0]],0,0,f),p=[0,80,d],q=function(a){return aT(fG,Jm,a)}(function(a){return aT(j0,p,a)}(aT(hk,[0,80,j],0))),r=[0,[0,82,x(aD(i),function(a){return a?FK:hj})],q];return[0,Q(0,0,0,0,[0,[0,82,ht(0,[0,r],[0,[0,[0,80,cr(0,jW,function(a){var -b=k(hf(a)[qR]|0);h(m,b);return ah(i,b)})],l]],0,0)],[0,[0,82,o],0]]),i]}function -Jn(a,b,c){var -e=b?b[1]:1,d=function(f,b){return dj(function(a){var -b=a[1],g=a[3],h=a[2],i=B1(b),d=Jk([0,e],0,0,Ji(f,i,c[1]),b,h,g);return[0,d[1],d[2]]},b)}(0,c[2]),f=dj(function(a){return a[1]},d);function +n=hK(j,k(g)),i=n;break a}var +i=aB(k(g))}var +o=kr(0,[0,[0,[0,80,ki(S(j))],0]],0,0,f),p=[0,80,d],q=function(a){return aY(fP,Kd,a)}(function(a){return aY(kf,p,a)}(aY(hx,[0,80,j],0))),r=[0,[0,82,w(ap(i),function(a){return a?F7:hw})],q];return[0,Q(0,0,0,0,[0,[0,82,hE(0,[0,r],[0,[0,[0,80,ct(0,kb,function(a){var +b=k(hs(a)[rg]|0);h(m,b);return ai(i,b)})],l]],0,0)],[0,[0,82,o],0]]),i]}function +Ke(a,b,c){var +e=b?b[1]:1,d=function(f,b){return dq(function(a){var +b=a[1],g=a[3],h=a[2],i=Cn(b),d=Kb([0,e],0,0,J$(f,i,c[1]),b,h,g);return[0,d[1],d[2]]},b)}(0,c[2]),f=dq(function(a){return a[1]},d);function g(a){return a}var -h=function(a){return ET(g,a)}(cE(dh(function(a){return bd(aD(a[2]))},fC,d)));return[0,Q(0,a,0,0,[0,[0,83,cE(f)],0]),h]}function -Jo(a){var -d=i3(a);return[0,,function(a){return H4(a[1])},function(a){return[0,o6,d[1]]},,function(a,b,c){var -e=d[2].call(null,b,c,a[2]);return[0,o9(b,a[1]),e]},function(a){var -c=H2(a[1]);if(!c)return[0,a,0];var +h=function(a){return Fe(g,a)}(cH(dn(function(a){return bi(ap(a[2]))},fL,d)));return[0,Q(0,a,0,0,[0,[0,83,cH(f)],0]),h]}function +Kf(a){var +d=jh(a);return[0,,function(a){return Iv(a[1])},function(a){return[0,pj,d[1]]},,function(a,b,c){var +e=d[2].call(null,b,c,a[2]);return[0,pm(b,a[1]),e]},function(a){var +c=It(a[1]);if(!c)return[0,a,0];var e=c[1],b=e[2],f=e[1],g=[0,[0,b,d[17].call(null,b,a[2])]];return[0,[0,f,d[6].call(null,b,a[2])],g]},function(a,b){return d[18].call(null,b,a[2])}]}function -Jp(a){var -f=Jo(a);function +Kg(a){var +f=Kf(a);function g(a,b){return c(a,b)}function e(a,b,c){var d=c;for(;;){var e=f[6].call(null,d[2]),g=e[2],i=e[1];if(!g)return a<50?m(a+1|0,b,d):n(m,[0,b,d]);var j=g[1],k=j[2],l=k[1],o=j[1];if(!k[2][1]){h(b,l);return[0,d[1],i,d[3]]}var p=f[5].call(null,d[1],o,[0,l,[0,0]]);d=[0,p,i,d[3]]}}function -c(a,b){return bN(e(0,a,b))}function +c(a,b){return bV(e(0,a,b))}function m(a,b,c){var d=c;for(;;){var g=f[6].call(null,d[1]),i=g[2],j=g[1];if(!i)return a<50?e(a+1|0,b,d):n(e,[0,b,d]);var @@ -4105,109 +4030,109 @@ j(a,b){var c=b;for(;;){var e=f[2].call(null,c[2]),d=f[2].call(null,c[1])+e|0;if(0>>4|0)));var +e(a,b,c){cn(a,b,c)}(function(a){return e(d,b,a)}(h(g,c>>>4|0)));var f=b+1|0;function -i(a,b,c){cj(a,b,c);return}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var -n=V(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var -m=V(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var -l=V(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var -k=V(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return aX(e);var -j=V(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}function -JN(a,b){return JM(a)}function -pv(a,b){var -c=Vn(b[1]),d=b[3],e=b[2];return a$(k(a)(JP),e,d,c)}function -pw(a,b){return h(k(a)(JQ),l(b))}function -px(a){var -b=bq(20);return jw(function(a){cD(a,0);return F(bx(b))},dP(b),a)}function -py(a){return[0,nd(Bz,BA,a),0,a]}py(0);function -JR(a,b){return fZ(px(JS),pw,a,pv,b)}function -JT(a,b){return fZ(px(JU),pw,a,pv,b)}function -JV(a,b,c,d,e){if(0<=e&&0<=b&&0<=d&&(l(a)-b|0)>=e)return(c[3]-d|0)=e)return(c[3]-d|0)=0){var c=h;for(;;){var -e=c%16|0,i=vF(b[1],b[2]+c|0);eT(k(a)(J2),f,e,i,g,e);var -j=c+1|0;if(d===c)break;c=j}}return jl(a,0)});function -JY(a,b,c,d){return JX(JV,function(a){return l(a)},a,b,c,d)}JY(0,0,0,J4);function -J5(a,b){return bQ(b,a)}function -J6(a,c){function +e=c%16|0,i=v7(b[1],b[2]+c|0);d$(k(a)(KT),f,e,i,g,e);var +j=c+1|0;if(d===c)break;c=j}}return jB(a,0)});function +KP(a,b,c,d){return KO(KM,function(a){return l(a)},a,b,c,d)}KP(0,0,0,KV);function +KW(a,b){return bY(b,a)}function +KX(a,c){function o(a,b){var e=a,d=b;for(;;){if(!d)return e;var c=d[1];e=[0,c[1],[0,c[2],[0,c[3],[0,c[4],[0,c[5],[0,c[6],[0,c[7],[0,c[8],[0,c[9],e]]]]]]]]];d=d[2]}}return function(a,b){var @@ -4220,1227 +4145,1256 @@ k=j[2];if(k){var l=k[2];if(l){var m=l[2];if(m){var n=m[2];if(n){var -p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=g[1],x=f[1],y=h(c,d[1]),z=h(c,x),A=h(c,w),B=h(c,v),C=h(c,u),D=h(c,t),E=h(c,s),F=h(c,r);e=[0,[0,y,z,A,B,C,D,E,F,h(c,q)],e];d=p;continue}}}}}}}}}return o(J5(d,c),e)}}(0,a)}function -pz(a,b,c){if(!b)return 0;var +p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=g[1],x=f[1],y=h(c,d[1]),z=h(c,x),A=h(c,w),B=h(c,v),C=h(c,u),D=h(c,t),E=h(c,s),F=h(c,r);e=[0,[0,y,z,A,B,C,D,E,F,h(c,q)],e];d=p;continue}}}}}}}}}return o(KW(d,c),e)}}(0,a)}function +pP(a,b,c){if(!b)return 0;var f=b[2],d=b[1];if(!f)return[0,h(a,d),0];var g=f[2],e=f[1];if(!g){var z=h(a,d);return[0,z,[0,h(a,e),0]]}var i=g[2],j=g[1];if(!i){var x=h(a,d),y=h(a,e);return[0,x,[0,y,[0,h(a,j),0]]]}var k=i[2],l=i[1];if(k){var -m=k[2],n=k[1],o=h(a,d),p=h(a,e),q=h(a,j),r=h(a,l),s=h(a,n),t=50=0){var d=f;for(;;){var -c=V(b,d);a:if(34===c)k(a)(J$);else if(32<=c)if(92===c)k(a)(Ka);else -h(k(a)(Kb),c);else{if(14>c)switch(c){case -8:k(a)(Kd);break a;case -9:k(a)(Ke);break a;case -10:k(a)(Kf);break a;case -13:k(a)(Kg);break a}h(k(a)(Kc),c)}var -g=d+1|0;if(e===d)break;d=g}}return k(a)(J_)}var -J7=[0,function(a){if(typeof -a==="number")return c0;var -b=a[1];if(gf>b)return c8<=b?bh<=b?[0,bh,a[2]]:[0,bh,a[2]]:d8<=b?[0,o,a[2]]:[0,o,a[2]];if(f_===b)return[0,65,a[2]];if(r<=b)return K<=b?[0,79,a[2]]:[0,65,a[2]];if(bB<=b)return[0,bB,a[2]];var +c=X(b,d);a:if(34===c)k(a)(K2);else if(32<=c)if(92===c)k(a)(K3);else +h(k(a)(K4),c);else{if(14>c)switch(c){case +8:k(a)(K6);break a;case +9:k(a)(K7);break a;case +10:k(a)(K8);break a;case +13:k(a)(K9);break a}h(k(a)(K5),c)}var +g=d+1|0;if(e===d)break;d=g}}return k(a)(K1)}var +KY=[0,function(a){if(typeof +a==="number")return c7;var +b=a[1];if(gu>b)return da<=b?bl<=b?[0,bl,a[2]]:[0,bl,a[2]]:eb<=b?[0,o,a[2]]:[0,o,a[2]];if(gm===b)return[0,65,a[2]];if(r<=b)return H<=b?[0,79,a[2]]:[0,65,a[2]];if(bo<=b)return[0,bo,a[2]];var c=a[2],d=c[2],e=c[1];return d?[0,65,[0,[0,o,e],[0,d[1],0]]]:[0,o,e]},function(a){if(typeof -a==="number")return c0;var -b=a[1];return 65===b?[0,r,a[2]]:bh<=b?bB<=b?[0,bB,a[2]]:[0,bh,a[2]]:79<=b?[0,K,a[2]]:[0,o,a[2]]},function(a){return[0,0]}(0)];function -Kh(a,b,c,d,e){var -l=a?a[1]:0,g=b?b[1]:J8;function +a==="number")return c7;var +b=a[1];return 65===b?[0,r,a[2]]:bl<=b?bo<=b?[0,bo,a[2]]:[0,bl,a[2]]:79<=b?[0,H,a[2]]:[0,o,a[2]]},function(a){return[0,0]}(0)];function +K_(a,b,c,d,e){var +l=a?a[1]:0,g=b?b[1]:KZ;function f(a,b){var d=h(c[1],b);if(typeof -d==="number")return k(a)(Ki);var +d==="number")return k(a)(K$);var e=d[1];if(65===e){var -n=[0,function(a,b){return k(a)(Kj)}],m=d[2];return i(k(a)(Kk),function(a,b){return gU(n,f,a,b)},m)}if(bh<=e){if(bB<=e)return d[2]?k(a)(Kl):k(a)(Km);var -j=d[2],l=v6(j),o=l[2];return l[1]==0.?h(k(a)(Kn),o):h(k(a)(Ko),j)}if(79>e)return i(g,a,d[2]);function +n=[0,function(a,b){return k(a)(La)}],m=d[2];return i(k(a)(Lb),function(a,b){return g8(n,f,a,b)},m)}if(bl<=e){if(bo<=e)return d[2]?k(a)(Lc):k(a)(Ld);var +j=d[2],l=wv(j),o=l[2];return l[1]===0.?h(k(a)(Le),o):h(k(a)(Lf),j)}if(79>e)return i(g,a,d[2]);function q(a,b){var -c=b[2],d=b[1];return fZ(k(a)(Kq),g,d,f,c)}var -r=[0,function(a,b){return k(a)(Kp)}],p=d[2];return i(k(a)(Kr),function(a,b){return gU(r,q,a,b)},p)}function +c=b[2],d=b[1];return f$(k(a)(Lh),g,d,f,c)}var +r=[0,function(a,b){return k(a)(Lg)}],p=d[2];return i(k(a)(Li),function(a,b){return g8(r,q,a,b)},p)}function j(a,b){var d=h(c[1],b);if(typeof d!=="number"){var e=d[1];if(65===e){var -l=d[2];if(!l)return k(a)(Ku);var -n=[0,function(a,b){return k(a)(Ks)}];return i(k(a)(Kt),function(a,b){return gU(n,j,a,b)},l)}if(79===e){var -m=d[2];if(!m)return k(a)(Ky);var +l=d[2];if(!l)return k(a)(Ll);var +n=[0,function(a,b){return k(a)(Lj)}];return i(k(a)(Lk),function(a,b){return g8(n,j,a,b)},l)}if(79===e){var +m=d[2];if(!m)return k(a)(Lp);var o=function(a,b){var -c=b[2],d=b[1];return fZ(k(a)(Kw),g,d,j,c)},p=[0,function(a,b){return k(a)(Kv)}];return i(k(a)(Kx),function(a,b){return gU(p,o,a,b)},m)}}return f(a,b)}return l?f(d,e):j(d,e)}function -Kz(a){function +c=b[2],d=b[1];return f$(k(a)(Ln),g,d,j,c)},p=[0,function(a,b){return k(a)(Lm)}];return i(k(a)(Lo),function(a,b){return g8(p,o,a,b)},m)}}return f(a,b)}return l?f(d,e):j(d,e)}function +Lq(a){function d(a){if(typeof -a==="number")return c0;var -b=a[1];if(65===b)return[0,r,pA(d,a[2])];if(bh>b)return 79<=b?[0,K,pA(function(a){var -b=a[1];return[0,b,d(a[2])]},a[2])]:[0,o,a[2]];if(bB<=b)return[0,bB,a[2]];var -e=a[2],f=v6(e),c=f[2];if(f[1]!=0.)return[0,bh,e];if(-1073741824.<=c&&c<=im)return[0,c8,c|0];return[0,d8,h(t(KA),c)]}return d(a)}function -ax(a,b){return cM(a,b)}function -eJ(a,b,c){ao(a,b,c);return}var -pB=bP(q4);function -aK(a,b,c){return[0,f8,el(a,b,c)]}function -hA(a,b,c,d,e){var -f=al(2),i=gz(c,d,e);if(a)var +a==="number")return c7;var +b=a[1];if(65===b)return[0,r,pQ(d,a[2])];if(bl>b)return 79<=b?[0,H,pQ(function(a){var +b=a[1];return[0,b,d(a[2])]},a[2])]:[0,o,a[2]];if(bo<=b)return[0,bo,a[2]];var +e=a[2],f=wv(e),c=f[2];if(f[1]!==0.)return[0,bl,e];if(-1073741824.<=c&&c<=iD)return[0,da,c|0];return[0,eb,h(v(Lr),c)]}return d(a)}function +aC(a,b){return cD(a,b)}function +eR(a,b,c){ar(a,b,c)}var +pR=bX(rt);function +aM(a,b,c){return[0,gk,er(a,b,c)]}function +hM(a,b,c,d,e){var +f=an(2),i=gO(c,d,e);if(a)var h=1,g=0;else var -h=0,g=1;eJ(f,g,b>>>8|0);eJ(f,h,b&dx);return[0,f8,aX(xp(f,i))]}var -KG=bP(uO),fK=KJ.slice();function -KB(a,b){return F(i(t(KC),a,b))}function -KD(a){return a}function -KE(a,b,c,d,e){ci(a,b,c,d,e);return}function -KF(a,b){return a[1+b]}function -KH(a,b){var -c=ax(a,b);return cZ>>0)throw g([0,f,KK],1);switch(m){case -0:return d(ax(a,b));case +h=0,g=1;eR(f,g,b>>>8|0);eR(f,h,b&dF);return[0,gk,a3(xQ(f,i))]}var +Lx=bX(vd),fY=LA.slice();function +Ls(a,b){return I(i(v(Lt),a,b))}function +Lu(a){return a}function +Lv(a,b,c,d,e){cm(a,b,c,d,e)}function +Lw(a,b){return a[1+b]}function +Ly(a,b){var +c=aC(a,b);return c6>>0)throw g([0,f,LB],1);switch(m){case +0:return d(aC(a,b));case 1:var -r=ax(a,b),n=ax(a,b+1|0);return 2===(n>>>6|0)?d((r&31)<<6|n&63):aK(a,b,c);case +r=aC(a,b),n=aC(a,b+1|0);return 2===(n>>>6|0)?d((r&31)<<6|n&63):aM(a,b,c);case 2:var -i=ax(a,b),e=ax(a,b+1|0),o=ax(a,b+2|0),j=(i&15)<<12|(e&63)<<6|o&63;if(2!==(o>>>6|0))return aK(a,b,c);if(ee===i){if(q2<=e&&f6>=e)return d(j);return aK(a,b,c)}if(f7!==i)return 2===(e>>>6|0)?d(j):aK(a,b,c);if(J<=e&&159>=e)return d(j);return aK(a,b,c);default:var -k=ax(a,b),h=ax(a,b+1|0),p=ax(a,b+2|0),q=ax(a,b+3|0),l=(k&7)<<18|(h&63)<<12|(p&63)<<6|q&63;if(2===(q>>>6|0)&&2===(p>>>6|0)){if(d_===k){if(u6<=h&&f6>=h)return d(l);return aK(a,b,c)}if(dC!==k)return 2===(h>>>6|0)?d(l):aK(a,b,c);if(J<=h&&143>=h)return d(l);return aK(a,b,c)}return aK(a,b,c)}}function -fL(a,b,c){var -e=ax(a,b),d=e<<8|ax(a,c);if(k3<=d&&f2>=d)return lU=e)return[0,aG,bP(((a&f9)<<10|e&f9)+eZ|0)];return hA(c=(c+d|0)){if(0===d)return pC(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return KB(c,d)}function -eK(a,b){var +i=aC(a,b),e=aC(a,b+1|0),o=aC(a,b+2|0),j=(i&15)<<12|(e&63)<<6|o&63;if(2!==(o>>>6|0))return aM(a,b,c);if(ek===i){if(rr<=e&&gi>=e)return d(j);return aM(a,b,c)}if(gj!==i)return 2===(e>>>6|0)?d(j):aM(a,b,c);if(M<=e&&159>=e)return d(j);return aM(a,b,c);default:var +k=aC(a,b),h=aC(a,b+1|0),p=aC(a,b+2|0),q=aC(a,b+3|0),l=(k&7)<<18|(h&63)<<12|(p&63)<<6|q&63;if(2===(q>>>6|0)&&2===(p>>>6|0)){if(ef===k){if(vu<=h&&gi>=h)return d(l);return aM(a,b,c)}if(dL!==k)return 2===(h>>>6|0)?d(l):aM(a,b,c);if(M<=h&&143>=h)return d(l);return aM(a,b,c)}return aM(a,b,c)}}function +fZ(a,b,c){var +e=aC(a,b),d=e<<8|aC(a,c);if(le<=d&&ge>=d)return l$=e)return[0,aI,bX(((a&gl)<<10|e&gl)+e8|0)];return hM(c=(c+d|0)){if(0===d)return pS(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return Ls(c,d)}function +eS(a,b){var c=b[1];if(typeof -c==="number"){b[18]=a;return ij}if(qU<=c[1]){var -d=wA(c[2],b[5],0,aR(b[5]));KW(b,b[5],0,d);return h(a,b)}pC(b);return h(a,b)}function -eL(a,b){a[9]=0;a[10]=b;return}function -cs(c,b){function -d(a,b){KE(a[5],a[6],a[8],a[9],b);a[6]=a[6]+b|0;a[9]=a[9]+b|0;return}var -a=dm(b);if(0>a)return h(c,b);var -e=b[10]-b[9]|0;return a=b)return 0<=b?eK(kn,a):cL;var -c=a[6];a[6]=a[6]+1|0;return T(kn,KH(a[5],c),1,a)}function -ko(a){var -b=dm(a);if(0>=b)return 0<=b?eK(ko,a):cL;var -c=a[6];a[6]=a[6]+1|0;return T(ko,KI(a[5],c),1,a)}function -hC(a){if(a[9]=c)return 0<=c?eK(br,a):cL;var -b=KF(fK,ax(a[5],a[6]));if(c=a[10])return pF(fL(a[8],0,1),a);var -b=a[9];return T(ct,aK(a[8],0,a[9]),b,a)}function -pF(a,b){if(f8<=a[1])return T(ct,a,2,b);var -c=a[2];if(2<=dm(b)){var -d=b[6];b[6]=b[6]+2|0;return T(ct,hB(c,b[5],d,d+1|0),4,b)}eL(b,2);return cs(function(a){return pD(c,a)},b)}function -ct(a){var -b=dm(a);if(0>=b)return 0<=b?eK(ct,a):cL;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return pF(fL(a[5],c,c+1|0),a)}eL(a,2);return cs(pE,a)}function -pG(a,b){var -c=b[9]+2|0;return b[9]=a[10])return pI(fL(a[8],1,0),a);var -b=a[9];return T(cG,aK(a[8],0,a[9]),b,a)}function -pI(a,b){if(f8<=a[1])return T(cG,a,2,b);var -c=a[2];if(2<=dm(b)){var -d=b[6];b[6]=b[6]+2|0;return T(cG,hB(c,b[5],d+1|0,d),4,b)}eL(b,2);return cs(function(a){return pG(c,a)},b)}function -cG(a){var -b=dm(a);if(0>=b)return 0<=b?eK(cG,a):cL;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return pI(fL(a[5],c+1|0,c),a)}eL(a,2);return cs(pH,a)}function -KX(a){function +c==="number"){b[18]=a;return iB}if(rj<=c[1]){var +d=w1(c[2],b[5],0,aV(b[5]));LN(b,b[5],0,d);return h(a,b)}pS(b);return h(a,b)}function +eT(a,b){a[9]=0;a[10]=b}function +cu(c,b){function +d(a,b){Lv(a[5],a[6],a[8],a[9],b);a[6]=a[6]+b|0;a[9]=a[9]+b|0}var +a=dv(b);if(0>a)return h(c,b);var +e=b[10]-b[9]|0;return a=b)return 0<=b?eS(kG,a):cQ;var +c=a[6];a[6]=a[6]+1|0;return V(kG,Ly(a[5],c),1,a)}function +kH(a){var +b=dv(a);if(0>=b)return 0<=b?eS(kH,a):cQ;var +c=a[6];a[6]=a[6]+1|0;return V(kH,Lz(a[5],c),1,a)}function +hO(a){if(a[9]=c)return 0<=c?eS(bu,a):cQ;var +b=Lw(fY,aC(a[5],a[6]));if(c=a[10])return pV(fZ(a[8],0,1),a);var +b=a[9];return V(cv,aM(a[8],0,a[9]),b,a)}function +pV(a,b){if(gk<=a[1])return V(cv,a,2,b);var +c=a[2];if(2<=dv(b)){var +d=b[6];b[6]=b[6]+2|0;return V(cv,hN(c,b[5],d,d+1|0),4,b)}eT(b,2);return cu(function(a){return pT(c,a)},b)}function +cv(a){var +b=dv(a);if(0>=b)return 0<=b?eS(cv,a):cQ;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return pV(fZ(a[5],c,c+1|0),a)}eT(a,2);return cu(pU,a)}function +pW(a,b){var +c=b[9]+2|0;return b[9]=a[10])return pY(fZ(a[8],1,0),a);var +b=a[9];return V(cJ,aM(a[8],0,a[9]),b,a)}function +pY(a,b){if(gk<=a[1])return V(cJ,a,2,b);var +c=a[2];if(2<=dv(b)){var +d=b[6];b[6]=b[6]+2|0;return V(cJ,hN(c,b[5],d+1|0,d),4,b)}eT(b,2);return cu(function(a){return pW(c,a)},b)}function +cJ(a){var +b=dv(a);if(0>=b)return 0<=b?eS(cJ,a):cQ;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return pY(fZ(a[5],c+1|0,c),a)}eT(a,2);return cu(pX,a)}function +LO(a){function d(a){var -b=ax(a[8],2),c=j(fK,b)[1+b];return 0===c?T(br,aK(a[8],2,1),1,a):(a[10]=c,a[9]=1,eJ(a[8],0,b),cs(hC,a))}var -b=ax(a[8],0);function +b=aC(a[8],2),c=j(fY,b)[1+b];return 0===c?V(bu,aM(a[8],2,1),1,a):(a[10]=c,a[9]=1,eR(a[8],0,b),cu(hO,a))}var +b=aC(a[8],0);function h(a){var -b=ax(a[8],1),e=2>>0)throw g([0,f,KY],1);switch(e){case -0:return T(c,aK(a[8],0,1),1,a);case -1:return T(c,d0(a[8],0,1),1,a);case -2:return 2<=a[9]?3<=a[9]?T(d,d0(a[8],0,2),2,a):T(br,d0(a[8],0,2),2,a):T(br,aK(a[8],0,1),1,a);case -3:if(3<=a[9])return T(br,d0(a[8],0,3),3,a);var -i=a[9];return T(br,aK(a[8],0,a[9]),i,a);default:if(3<=a[9]){a[10]=4;return cs(hC,a)}var -k=a[9];return T(br,aK(a[8],0,a[9]),k,a)}}function -pJ(a,b,c){if(b)var -j=1,i=0,h=pD,d=pE,f=ct;else +b=aC(a[8],1),e=2>>0)throw g([0,f,LP],1);switch(e){case +0:return V(c,aM(a[8],0,1),1,a);case +1:return V(c,d4(a[8],0,1),1,a);case +2:return 2<=a[9]?3<=a[9]?V(d,d4(a[8],0,2),2,a):V(bu,d4(a[8],0,2),2,a):V(bu,aM(a[8],0,1),1,a);case +3:if(3<=a[9])return V(bu,d4(a[8],0,3),3,a);var +i=a[9];return V(bu,aM(a[8],0,a[9]),i,a);default:if(3<=a[9]){a[10]=4;return cu(hO,a)}var +k=a[9];return V(bu,aM(a[8],0,a[9]),k,a)}}function +pZ(a,b,c){if(b)var +j=1,i=0,h=pT,d=pU,f=cv;else var -j=0,i=1,h=pG,d=pH,f=cG;function +j=0,i=1,h=pW,d=pX,f=cJ;function e(a,b){if(3>b[9])return f(b);b[10]=2;b[9]=1;var -c=ax(b[8],2);eJ(b[8],0,c);return cs(a,b)}if(typeof -c!=="number")return T(function(a){return e(d,a)},[0,aG,bP(c[2])],2,a);if(f4>c)return T(function(a){return e(d,a)},[0,aG,pB],2,a);var -g=fL(a[8],i,j);if(f8<=g[1])return T(function(a){return e(d,a)},g,2,a);var +c=aC(b[8],2);eR(b[8],0,c);return cu(a,b)}if(typeof +c!=="number")return V(function(a){return e(d,a)},[0,aI,bX(c[2])],2,a);if(gg>c)return V(function(a){return e(d,a)},[0,aI,pR],2,a);var +g=fZ(a[8],i,j);if(gk<=g[1])return V(function(a){return e(d,a)},g,2,a);var k=g[2];if(3<=a[9]){var l=function(a){return h(k,a)};return function(a){return e(l,a)}(a)}var -m=a[9];return T(f,hA(b,k,gy,0,0),m,a)}function -KZ(a){eL(a,3);return cs(function(a){var -b=KL(a[8],0,a[9]),c=b[1];if(e9===c){var -e=b[2];a[2]=e9;a[18]=cG;return pJ(a,0,e)}if(dy<=c){var -d=b[2];a[2]=dy;a[18]=br;return cL===d?cL:f4<=d?KX(a):T(br,[0,aG,pB],3,a)}var -f=b[2];a[2]=gb;a[18]=ct;return pJ(a,1,f)},a)}function -bU(a){a[14]=0;a[13]=a[13]+1|0;return}function -dn(a){a[14]=a[14]+1|0;return}function -aL(a){a[16]=a[16]+1|0;return}function -aM(a,b){a[12]=b;return}function -K0(a,b,c,d){if(aG>d[1]){c[11]=0;c[17]=b;return i(c[17],c,d)}var -e=bD(d[2]);if(q4===e){if(a){c[2]=gb;c[18]=ct}c[11]=1;c[17]=b;return h(c[18],c)}if(65534===e&&a){c[2]=e9;c[18]=cG;c[11]=1;c[17]=b;return h(c[18],c)}c[11]=0;c[17]=b;return i(c[17],c,d)}function -K1(a,b){if(aG>b[1]){aM(a,0);aL(a);dn(a);return b}var -c=bD(b[2])+lg|0;a:{if(lH>>0){var -d=c+e1|0;if(3>>0)break a;switch(d){case +m=a[9];return V(f,hM(b,k,gN,0,0),m,a)}function +LQ(a){eT(a,3);return cu(function(a){var +b=LC(a[8],0,a[9]),c=b[1];if(ff===c){var +e=b[2];a[2]=ff;a[18]=cJ;return pZ(a,0,e)}if(dG<=c){var +d=b[2];a[2]=dG;a[18]=bu;return cQ===d?cQ:gg<=d?LO(a):V(bu,[0,aI,pR],3,a)}var +f=b[2];a[2]=gp;a[18]=cv;return pZ(a,1,f)},a)}function +b2(a){a[14]=0;a[13]=a[13]+1|0}function +dw(a){a[14]=a[14]+1|0}function +aN(a){a[16]=a[16]+1|0}function +aO(a,b){a[12]=b}function +LR(a,b,c,d){if(aI>d[1]){c[11]=0;c[17]=b;return i(c[17],c,d)}var +e=bL(d[2]);if(rt===e){if(a){c[2]=gp;c[18]=cv}c[11]=1;c[17]=b;return h(c[18],c)}if(65534===e&&a){c[2]=ff;c[18]=cJ;c[11]=1;c[17]=b;return h(c[18],c)}c[11]=0;c[17]=b;return i(c[17],c,d)}function +LS(a,b){if(aI>b[1]){aO(a,0);aN(a);dw(a);return b}var +c=bL(b[2])+lx|0;a:{if(lY>>0){var +d=c+ej|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aM(a,0);aL(a);return e?b:(bU(a),b);case +e=a[12];aO(a,0);aN(a);return e?b:(b2(a),b);case 1:break a;case -2:break;default:aM(a,1);aL(a);bU(a);return b}}else if(lW>=c-1>>>0)break a;aM(a,0);aL(a);bU(a);return b}aM(a,0);aL(a);dn(a);return b}function -K2(a,b){if(aG>b[1]){aM(a,0);aL(a);dn(a);return b}var -c=bD(b[2])+lg|0;a:{if(lH>>0){var -d=c+e1|0;if(3>>0)break a;switch(d){case +2:break;default:aO(a,1);aN(a);b2(a);return b}}else if(mb>=c-1>>>0)break a;aO(a,0);aN(a);b2(a);return b}aO(a,0);aN(a);dw(a);return b}function +LT(a,b){if(aI>b[1]){aO(a,0);aN(a);dw(a);return b}var +c=bL(b[2])+lx|0;a:{if(lY>>0){var +d=c+ej|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aM(a,0);return e?h(a[18],a):(aL(a),bU(a),[0,aG,a[4]]);case +e=a[12];aO(a,0);return e?h(a[18],a):(aN(a),b2(a),[0,aI,a[4]]);case 1:break a;case -2:break;default:aM(a,1);aL(a);bU(a);return[0,aG,a[4]]}}else if(lW>=c-1>>>0)break a;aM(a,0);aL(a);bU(a);return[0,aG,a[4]]}aM(a,0);aL(a);dn(a);return b}function -K3(a,b){if(aG>b[1]){aM(a,0);aL(a);dn(a);return b}var -c=bD(b[2]);a:{if(14<=c){if(sT<=c){if(8234>c)break a}else if(lP===c){aM(a,0);aL(a);bU(a);return[0,aG,a[4]]}}else if(10<=c)switch(c+rp|0){case +2:break;default:aO(a,1);aN(a);b2(a);return[0,aI,a[4]]}}else if(mb>=c-1>>>0)break a;aO(a,0);aN(a);b2(a);return[0,aI,a[4]]}aO(a,0);aN(a);dw(a);return b}function +LU(a,b){if(aI>b[1]){aO(a,0);aN(a);dw(a);return b}var +c=bL(b[2]);a:{if(14<=c){if(ti<=c){if(8234>c)break a}else if(l6===c){aO(a,0);aN(a);b2(a);return[0,aI,a[4]]}}else if(10<=c)switch(c+rR|0){case 0:var -d=a[12];aM(a,0);return d?h(a[18],a):(aL(a),bU(a),[0,aG,a[4]]);case +d=a[12];aO(a,0);return d?h(a[18],a):(aN(a),b2(a),[0,aI,a[4]]);case 1:break;case -2:break a;default:aM(a,1);aL(a);bU(a);return[0,aG,a[4]]}aM(a,0);aL(a);dn(a);return b}aM(a,0);aL(a);bU(a);return b}function -K4(a,b){if(aG>b[1]){aM(a,0);aL(a);dn(a);return b}var -c=bD(b[2])+lg|0;a:{if(lH>>0){var -d=c+e1|0;if(3>>0)break a;switch(d){case +2:break a;default:aO(a,1);aN(a);b2(a);return[0,aI,a[4]]}aO(a,0);aN(a);dw(a);return b}aO(a,0);aN(a);b2(a);return b}function +LV(a,b){if(aI>b[1]){aO(a,0);aN(a);dw(a);return b}var +c=bL(b[2])+lx|0;a:{if(lY>>0){var +d=c+ej|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aM(a,0);return e?h(a[18],a):(aL(a),bU(a),[0,aG,a[4]]);case +e=a[12];aO(a,0);return e?h(a[18],a):(aN(a),b2(a),[0,aI,a[4]]);case 1:break a;case -2:break;default:aM(a,1);aL(a);bU(a);return[0,aG,a[4]]}}else if(lW>=c-1>>>0)break a;aM(a,0);aL(a);bU(a);return b}aM(a,0);aL(a);dn(a);return b}function -K5(a){return uj<=a?423112016<=a?dy<=a?br:kn:338302576<=a?ko:ct:e9<=a?cG:ct}function -kp(a){return a[13]}function -kq(a){return a[14]}function -kr(d,b){var -a=bD(b);function -c(a){return m(d,KD(a))}return cZ>>18|0),c(J|(a>>>12|0)&63),c(J|(a>>>6|0)&63),c(J|a&63)):(c(ee|a>>>12|0),c(J|(a>>>6|0)&63),c(J|a&63)):(c(ix|a>>>6|0),c(J|a&63)):c(a)}function -K6(a,b,c){if(a){var +2:break;default:aO(a,1);aN(a);b2(a);return[0,aI,a[4]]}}else if(mb>=c-1>>>0)break a;aO(a,0);aN(a);b2(a);return b}aO(a,0);aN(a);dw(a);return b}function +LW(a){return uL<=a?423112016<=a?dG<=a?bu:kG:338302576<=a?kH:cv:ff<=a?cJ:cv}function +kI(a){return a[13]}function +kJ(a){return a[14]}function +kK(d,b){var +a=bL(b);function +c(a){return m(d,Lu(a))}return c6>>18|0),c(M|(a>>>12|0)&63),c(M|(a>>>6|0)&63),c(M|a&63)):(c(ek|a>>>12|0),c(M|(a>>>6|0)&63),c(M|a&63)):(c(iM|a>>>6|0),c(M|a&63)):c(a)}function +LX(a,b,c){if(a){var d=a[1],k=d[1];if(3895880===k)var -f=d[2],e=K3;else if(io<=k)var -f=d[2],e=K4;else +f=d[2],e=LU;else if(iE<=k)var +f=d[2],e=LV;else var -f=d[2],e=K2}else +f=d[2],e=LT}else var -f=bP(10),e=K1;if(b)var -m=b[1],n=K5(m),g=m;else +f=bX(10),e=LS;if(b)var +m=b[1],n=LW(m),g=m;else var -n=KZ,g=dy;if(typeof +n=LQ,g=dG;if(typeof c==="number")var -j=0,i=1,h=gy;else if(qU<=c[1])var -j=0,i=1,h=al(eZ);else +j=0,i=1,h=gN;else if(rj<=c[1])var +j=0,i=1,h=an(e8);else var -o=c[2],j=l(o)-1|0,i=0,h=cN(o);var -p=uj===g?1:0;return[0,c,g,a,f,h,i,j,al(4),0,0,0,0,1,0,0,0,function(a,b){return K0(p,e,a,b)},n]}function -K7(a){return h(a[18],a)}function -K8(a){return a[11]}var -pK=44,hD=bD(KG),K_=10,K$=34,La=93,Lb=e7,Lc=47,Ld=92,Le=42;function -Lf(a){var +o=c[2],j=l(o)-1|0,i=0,h=cS(o);var +p=uL===g?1:0;return[0,c,g,a,f,h,i,j,an(4),0,0,0,0,1,0,0,0,function(a,b){return LR(p,e,a,b)},n]}function +LY(a){return h(a[18],a)}function +LZ(a){return a[11]}var +p0=44,hP=bL(Lx),L1=10,L2=34,L3=93,L4=fd,L5=47,L6=92,L7=42;function +L8(a){var b=a<=31?1:0;if(b)var c=b;else var d=34===a?1:0,c=d||(92===a?1:0);return c}function -Lg(a){var +L9(a){var b=48<=a?1:0,c=b?a<=57?1:0:b;return c}function -Lh(a){var +L_(a){var c=48<=a?1:0,d=c?a<=57?1:0:c;if(d)var b=d;else{var e=65<=a?1:0,f=e?a<=70?1:0:e;if(f)var b=f;else var -g=97<=a?1:0,b=g?a<=h3?1:0:g}return b}function -hE(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function -pL(a){a:{if(44<=a){var +g=97<=a?1:0,b=g?a<=gb?1:0:g}return b}function +hQ(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function +p1(a){a:{if(44<=a){var b=a-45|0;if(79>>0){if(81<=b)break a}else if(48!==b)break a}else if(11<=a){if(32!==a)break a}else if(9>a)break a;return 1}return 0}function -Lj(a){return[0,ai,[0,e0,[0,-542918501,iW(a)]]]}function -Lk(a){return[0,ai,[0,e0,[0,tU,iW(a)]]]}function -Ll(a){return[0,ai,[0,e0,[0,tP,a]]]}function -Lm(a){return[0,ai,[0,e0,[0,tY,a]]]}function -pM(a){return[0,ai,[0,e0,[0,rC,a]]]}function -Ln(a){return[0,ai,[0,-635137946,iW(a)]]}function -Lo(a){return[0,ai,[0,u1,a]]}function -Lt(a){return[0,ai,[0,ui,a]]}function -Lu(a){return[0,ai,[0,q5,a]]}function -fM(a,b){return h(k(a)(LD),b)}function -ks(a,b){if(31>=bD(b))return fM(a,bD(b));var -c=bq(4);kr(c,b);var -d=bD(b),e=bx(c);return a$(k(a)(LE),e,fM,d)}function -bH(a,b){var -c=bP(b);return kr(a[2],c)}function -dp(a){var -b=bP(a[8]);return kr(a[2],b)}function -d1(a){var -b=bx(a[2]);eq(a[2]);return b}function -pP(a){var -b=kq(a[1]);return[0,kp(a[1]),b]}function -bV(a){a[4]=kp(a[1]);a[5]=kq(a[1]);return}function -aU(a){a[6]=kp(a[1]);a[7]=kq(a[1]);return}function -pQ(a){var -b=a[9];if(!b)throw g([0,f,L_],1);var -c=b[1][2],d=c[2];a[4]=c[1];a[5]=d;return aU(a)}function -pR(a){bV(a);aU(a);var -c=a[9];if(!c)throw g([0,f,L$],1);var -b=c[2];if(!b){a[10]=0;a[9]=0;return}if(d$<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b;return}function -eM(a){return cL}function -Y(a,b,c){c[12]=b;return a}function +Ma(a){return[0,ak,[0,e9,[0,-542918501,jb(a)]]]}function +Mb(a){return[0,ak,[0,e9,[0,um,jb(a)]]]}function +Mc(a){return[0,ak,[0,e9,[0,uh,a]]]}function +Md(a){return[0,ak,[0,e9,[0,up,a]]]}function +p2(a){return[0,ak,[0,e9,[0,r3,a]]]}function +Me(a){return[0,ak,[0,-635137946,jb(a)]]}function +Mf(a){return[0,ak,[0,vp,a]]}function +Mk(a){return[0,ak,[0,uK,a]]}function +Ml(a){return[0,ak,[0,ru,a]]}function +f0(a,b){return h(k(a)(Mu),b)}function +kL(a,b){if(31>=bL(b))return f0(a,bL(b));var +c=bt(4);kK(c,b);var +d=bL(b),e=bA(c);return bH(k(a)(Mv),e,f0,d)}function +bP(a,b){var +c=bX(b);return kK(a[2],c)}function +dx(a){var +b=bX(a[8]);return kK(a[2],b)}function +d5(a){var +b=bA(a[2]);ew(a[2]);return b}function +p5(a){var +b=kJ(a[1]);return[0,kI(a[1]),b]}function +b3(a){a[4]=kI(a[1]);a[5]=kJ(a[1])}function +aZ(a){a[6]=kI(a[1]);a[7]=kJ(a[1])}function +p6(a){var +b=a[9];if(!b)throw g([0,f,M1],1);var +c=b[1][2],d=c[2];a[4]=c[1];a[5]=d;return aZ(a)}function +p7(a){b3(a);aZ(a);var +c=a[9];if(!c)throw g([0,f,M2],1);var +b=c[2];if(!b){a[10]=0;a[9]=0;return}if(eg<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b}function +eU(a){return cQ}function +$(a,b,c){c[12]=b;return a}function z(c,b){var -a=K7(b[1]);if(typeof -a==="number")return ij<=a?Y(ij,function(a){return z(c,a)},b):(b[8]=gv,h(c,b));if(aG<=a[1]){b[8]=bD(a[2]);return h(c,b)}var -d=a[2];b[8]=hD;aU(b);return Y(Lo(d),c,b)}function -pS(c,b){if(b[8]!==10&&b[8]!==b4){dp(b);return z(function(a){return pS(c,a)},b)}aU(b);return Y([0,eW,[0,83,d1(b)]],function(a){return z(c,a)},b)}function -fN(a,b,c){if(c[8]===b4){aU(c);return Y(Lp,eM,c)}if(a){if(c[8]===47){aU(c);return Y([0,eW,[0,77,d1(c)]],function(a){return z(b,a)},c)}if(c[8]===42){dp(c);var -d=1;return z(function(a){return fN(d,b,a)},c)}bH(c,Le);dp(c);var -e=0;return z(function(a){return fN(e,b,a)},c)}if(c[8]===42){var -f=1;return z(function(a){return fN(f,b,a)},c)}dp(c);var -g=0;return z(function(a){return fN(g,b,a)},c)}function -Ma(c,b){if(b[8]===47)return z(function(a){return pS(c,a)},b);if(b[8]===42){var -d=0;return z(function(a){return fN(d,c,a)},b)}aU(b);return Y(Lv,c,b)}function -pT(c,b){return hE(b[8])?(aU(b),dp(b),z(function(a){return pT(c,a)},b)):Y([0,h4,d1(b)],c,b)}function -kt(c,b){if(hE(b[8])){bV(b);return pT(function(a){return kt(c,a)},b)}if(b[8]!==47)return h(c,b);bV(b);function -d(a){return kt(c,a)}return z(function(a){return Ma(d,a)},b)}function -pU(c,b){return hE(b[8])?z(function(a){return pU(c,a)},b):h(c,b)}function -cT(a,b){return b[3]?kt(a,b):pU(a,b)}function -ku(g,b,c,d,e){function -f(a,b,c){bH(c,hD);return Y(a,b,c)}if(0=b)return lU=b){bH(e,((k&f9)<<10|b&f9)+eZ|0);return h(d,e)}return f(Ll(b),d,e)}function -pV(c,b){var -a=b[8];if(34===a){bH(b,K$);return z(c,b)}if(92<=a){if(118>a)switch(a-92|0){case -0:bH(b,Ld);return z(c,b);case -6:bH(b,8);return z(c,b);case -10:bH(b,12);return z(c,b);case -18:bH(b,K_);return z(c,b);case -22:bH(b,13);return z(c,b);case -24:bH(b,9);return z(c,b);case +a=LY(b[1]);if(typeof +a==="number")return iB<=a?$(iB,function(a){return z(c,a)},b):(b[8]=gK,h(c,b));if(aI<=a[1]){b[8]=bL(a[2]);return h(c,b)}var +d=a[2];b[8]=hP;aZ(b);return $(Mf(d),c,b)}function +p8(c,b){if(b[8]!==10&&b[8]!==b_){dx(b);return z(function(a){return p8(c,a)},b)}aZ(b);return $([0,e5,[0,83,d5(b)]],function(a){return z(c,a)},b)}function +f1(a,b,c){if(c[8]===b_){aZ(c);return $(Mg,eU,c)}if(a){if(c[8]===47){aZ(c);return $([0,e5,[0,77,d5(c)]],function(a){return z(b,a)},c)}if(c[8]===42){dx(c);var +d=1;return z(function(a){return f1(d,b,a)},c)}bP(c,L7);dx(c);var +e=0;return z(function(a){return f1(e,b,a)},c)}if(c[8]===42){var +f=1;return z(function(a){return f1(f,b,a)},c)}dx(c);var +g=0;return z(function(a){return f1(g,b,a)},c)}function +M3(c,b){if(b[8]===47)return z(function(a){return p8(c,a)},b);if(b[8]===42){var +d=0;return z(function(a){return f1(d,c,a)},b)}aZ(b);return $(Mm,c,b)}function +p9(c,b){return hQ(b[8])?(aZ(b),dx(b),z(function(a){return p9(c,a)},b)):$([0,ik,d5(b)],c,b)}function +kM(c,b){if(hQ(b[8])){b3(b);return p9(function(a){return kM(c,a)},b)}if(b[8]!==47)return h(c,b);b3(b);function +d(a){return kM(c,a)}return z(function(a){return M3(d,a)},b)}function +p_(c,b){return hQ(b[8])?z(function(a){return p_(c,a)},b):h(c,b)}function +c1(a,b){return b[3]?kM(a,b):p_(a,b)}function +kN(g,b,c,d,e){function +f(a,b,c){bP(c,hP);return $(a,b,c)}if(0=b)return l$=b){bP(e,((k&gl)<<10|b&gl)+e8|0);return h(d,e)}return f(Mc(b),d,e)}function +p$(c,b){var +a=b[8];if(34===a){bP(b,L2);return z(c,b)}if(92<=a){if(118>a)switch(a-92|0){case +0:bP(b,L6);return z(c,b);case +6:bP(b,8);return z(c,b);case +10:bP(b,12);return z(c,b);case +18:bP(b,L1);return z(c,b);case +22:bP(b,13);return z(c,b);case +24:bP(b,9);return z(c,b);case 25:var -d=4,e=0,f=0;return z(function(a){return ku(f,e,d,c,a)},b)}}else if(47===a){bH(b,Lc);return z(c,b)}aU(b);bH(b,hD);return Y(Lk(a),function(a){return z(c,a)},b)}function -fO(c,b){if(b[8]===b4){aU(b);return Y(Lq,eM,b)}if(!Lf(b[8])){dp(b);return z(function(a){return fO(c,a)},b)}if(b[8]===34){aU(b);return z(c,b)}if(b[8]===92){var -d=function(a){return fO(c,a)};return z(function(a){return pV(d,a)},b)}aU(b);bH(b,hD);function -e(a){return fO(c,a)}return Y(Ln(b[8]),function(a){return z(e,a)},b)}function -pW(c,b){if(!pL(b[8])&&b[8]!==b4){aU(b);dp(b);return z(function(a){return pW(c,a)},b)}var -a=d1(b);try{var -e=Y([0,b0,[0,bh,gn(a)]],c,b);return e}catch(f){var -d=O(f);if(d[1]===dL)return Y(Lt(a),c,b);throw g(d,0)}}function -pX(c,b){if(!pL(b[8])&&b[8]!==b4){aU(b);dp(b);return z(function(a){return pX(c,a)},b)}var -a=d1(b);return a!==gh?a!==f$?a!==eb?Y(Lu(a),c,b):Y(Mb,c,b):Y(Mc,c,b):Y(Md,c,b)}function -hF(a,b,c){var -d=c[8];a:{if(h0<=d){var -e=d-110|0;if(6>>0){if(13!==e)break a;bV(c);aU(c);c[11]=1;c[10]=1;var -f=c[9];c[9]=[0,[0,d$,pP(c)],f];return Y(Me,function(a){return z(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bV(c);var -g=function(a,b){return Y([0,b0,[0,o,d1(b)]],a,b)},h=function(a){return g(b,a)};return z(function(a){return fO(h,a)},c)}if(91===d){bV(c);aU(c);c[11]=1;var -j=c[9];c[9]=[0,[0,f5,pP(c)],j];return Y(Mf,function(a){return z(b,a)},c)}if(h3>d)break a}bV(c);return pX(b,c)}if(!Lg(d)&&d!==45)return i(a,b,c);bV(c);return pW(b,c)}function -hG(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b4){aU(e);return z(function(a){return hG(f,b,c,d,a)},e)}return Y(c,d,e)}function -Mg(c,b){function -d(a,b,c){bV(c);return hG(pK,La,a,b,c)}var -a=b[11];b[11]=0;if(b[8]===b4){pQ(b);return Y(Lr,eM,b)}if(b[8]===93){pR(b);return Y(Mh,function(a){return z(c,a)},b)}if(a)return hF(function(a,b){return d(Ly,a,b)},c,b);if(b[8]!==44)return d(Lz,c,b);function -e(a,b){return d(pN,a,b)}function -f(a){return hF(e,c,a)}return z(function(a){return cT(f,a)},b)}function -hH(a,b,c){bV(c);c[10]=1;return hG(pK,Lb,a,b,c)}function -Mi(c,b){b[10]=1;if(b[8]!==58)return hH(Lx,c,b);function -d(a,b){return hH(pN,a,b)}function -e(a){return hF(d,c,a)}return z(function(a){return cT(e,a)},b)}function -Mj(c,b){function +d=4,e=0,f=0;return z(function(a){return kN(f,e,d,c,a)},b)}}else if(47===a){bP(b,L5);return z(c,b)}aZ(b);bP(b,hP);return $(Mb(a),function(a){return z(c,a)},b)}function +f2(c,b){if(b[8]===b_){aZ(b);return $(Mh,eU,b)}if(!L8(b[8])){dx(b);return z(function(a){return f2(c,a)},b)}if(b[8]===34){aZ(b);return z(c,b)}if(b[8]===92){var +d=function(a){return f2(c,a)};return z(function(a){return p$(d,a)},b)}aZ(b);bP(b,hP);function +e(a){return f2(c,a)}return $(Me(b[8]),function(a){return z(e,a)},b)}function +qa(c,b){if(!p1(b[8])&&b[8]!==b_){aZ(b);dx(b);return z(function(a){return qa(c,a)},b)}var +a=d5(b);try{var +e=$([0,b6,[0,bl,gD(a)]],c,b);return e}catch(f){var +d=T(f);if(d[1]===dT)return $(Mk(a),c,b);throw g(d,0)}}function +qb(c,b){if(!p1(b[8])&&b[8]!==b_){aZ(b);dx(b);return z(function(a){return qb(c,a)},b)}var +a=d5(b);return a!==gx?a!==gn?a!==ei?$(Ml(a),c,b):$(M4,c,b):$(M5,c,b):$(M6,c,b)}function +hR(a,b,c){var +d=c[8];a:{if(ih<=d){var +e=d-110|0;if(6>>0){if(13!==e)break a;b3(c);aZ(c);c[11]=1;c[10]=1;var +f=c[9];c[9]=[0,[0,eg,p5(c)],f];return $(M7,function(a){return z(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){b3(c);var +g=function(a,b){return $([0,b6,[0,o,d5(b)]],a,b)},h=function(a){return g(b,a)};return z(function(a){return f2(h,a)},c)}if(91===d){b3(c);aZ(c);c[11]=1;var +j=c[9];c[9]=[0,[0,gh,p5(c)],j];return $(M8,function(a){return z(b,a)},c)}if(gb>d)break a}b3(c);return qb(b,c)}if(!L9(d)&&d!==45)return i(a,b,c);b3(c);return qa(b,c)}function +hS(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b_){aZ(e);return z(function(a){return hS(f,b,c,d,a)},e)}return $(c,d,e)}function +M9(c,b){function +d(a,b,c){b3(c);return hS(p0,L3,a,b,c)}var +a=b[11];b[11]=0;if(b[8]===b_){p6(b);return $(Mi,eU,b)}if(b[8]===93){p7(b);return $(M_,function(a){return z(c,a)},b)}if(a)return hR(function(a,b){return d(Mp,a,b)},c,b);if(b[8]!==44)return d(Mq,c,b);function +e(a,b){return d(p3,a,b)}function +f(a){return hR(e,c,a)}return z(function(a){return c1(f,a)},b)}function +hT(a,b,c){b3(c);c[10]=1;return hS(p0,L4,a,b,c)}function +M$(c,b){b[10]=1;if(b[8]!==58)return hT(Mo,c,b);function +d(a,b){return hT(p3,a,b)}function +e(a){return hR(d,c,a)}return z(function(a){return c1(e,a)},b)}function +Na(c,b){function d(a,b,c){function -d(a,b){return Y([0,b0,[0,ie,d1(b)]],a,b)}if(c[8]!==34)return hH(a,b,c);bV(c);function -e(a){return d(b,a)}return z(function(a){return fO(e,a)},c)}var -a=b[11];b[11]=0;b[10]=0;if(b[8]===b4){pQ(b);return Y(Ls,eM,b)}if(b[8]===e7){pR(b);return Y(Mk,function(a){return z(c,a)},b)}if(a)return d(LA,c,b);if(b[8]!==44)return hH(LB,c,b);function -e(a){return d(Lw,c,a)}return z(function(a){return cT(e,a)},b)}function -Ml(a,b){return b[8]===b4?Y(cL,eM,b):function(a,b){bV(b);return hG(gv,gv,LC,a,b)}(eM,b)}function -fP(a){var -b=a[9];return b?d$<=b[1][1]?a[10]?cT(function(a){return Mj(fP,a)},a):cT(function(a){return Mi(fP,a)},a):cT(function(a){return Mg(fP,a)},a):cT(function(a){return Ml(fP,a)},a)}function -pY(d,b,c){if(!hE(c[8])&&c[8]!==b4){aU(c);return z(function(a){return pY(d,b,a)},c)}return Y(d,b,c)}function -pZ(a,b){function -c(c,b){bV(b);function -d(a){return pZ(c,a)}return pY(pO,function(a){return cT(d,a)},b)}return b[8]!==b4?hF(c,a,b):Y(pO,a,b)}var -K9=2147483646;function -Mm(a){function -b(a,b){return K8(b[1])?Y(Li,a,b):h(a,b)}function -c(a){return pZ(fP,a)}function -d(a){return cT(c,a)}return z(function(a){return b(d,a)},a)}var -Mn=[0,io,bP(10)];function -LF(a,b){if(typeof -b==="number")return k(a)(LG);var -d=b[1];if(ui>d){if(f0===d){var -m=b[2];k(a)(L3);return f5<=m?d$<=m?k(a)(L4):k(a)(L5):eW<=m?k(a)(L6):k(a)(L7)}if(q5<=d){var -z=b[2];return h(k(a)(L8),z)}var -A=b[2];return i(k(a)(L9),ks,A)}if(u1>d){if(cu<=d){var -c=b[2];k(a)(LR);return typeof -c==="number"?rH<=c?s8<=c?ie<=c?k(a)(LS):k(a)(LT):u5<=c?k(a)(LU):k(a)(LV):eW<=c?k(a)(LW):k(a)(LX):k4<=c[1]?c[2]?k(a)(LY):k(a)(LZ):c[2]?k(a)(L0):k(a)(L1)}var -y=b[2];return h(k(a)(L2),y)}if(e0<=d){var -e=b[2];k(a)(LH);var -f=e[1];if(tP===f){var -p=e[2];return i(k(a)(LI),fM,p)}if(tY<=f){if(tU<=f){var -q=e[2];return i(k(a)(LJ),ks,q)}var -r=e[2];return i(k(a)(LK),fM,r)}if(rC<=f){var -s=e[2];return i(k(a)(LL),fM,s)}var -t=e[2];return i(k(a)(LM),ks,t)}var -j=b[2],n=l(j);k(a)(LN);if(0d){if(ga===d){var +m=b[2];k(a)(MU);return gh<=m?eg<=m?k(a)(MV):k(a)(MW):e5<=m?k(a)(MX):k(a)(MY)}if(ru<=d){var +z=b[2];return h(k(a)(MZ),z)}var +A=b[2];return i(k(a)(M0),kL,A)}if(vp>d){if(cw<=d){var +c=b[2];k(a)(MI);return typeof +c==="number"?r8<=c?tx<=c?ix<=c?k(a)(MJ):k(a)(MK):vt<=c?k(a)(ML):k(a)(MM):e5<=c?k(a)(MN):k(a)(MO):lf<=c[1]?c[2]?k(a)(MP):k(a)(MQ):c[2]?k(a)(MR):k(a)(MS)}var +y=b[2];return h(k(a)(MT),y)}if(e9<=d){var +e=b[2];k(a)(My);var +f=e[1];if(uh===f){var +p=e[2];return i(k(a)(Mz),f0,p)}if(up<=f){if(um<=f){var +q=e[2];return i(k(a)(MA),kL,q)}var +r=e[2];return i(k(a)(MB),f0,r)}if(r3<=f){var +s=e[2];return i(k(a)(MC),f0,s)}var +t=e[2];return i(k(a)(MD),kL,t)}var +j=b[2],n=l(j);k(a)(ME);if(0=1){var g=v;for(;;){var -w=V(j,g);h(k(a)(LQ),w);var -x=g+1|0;if(o===g)break;g=x}}return k(a)(LP)}function -Mo(a,b){var -c=K6([0,Mn],a,b);return[0,c,bq(eV),0,1,0,1,0,K9,0,0,0,Mm]}function -Mp(a){a[3]=0;var +w=X(j,g);h(k(a)(MH),w);var +x=g+1|0;if(o===g)break;g=x}}return k(a)(MG)}function +Nf(a,b){var +c=LX([0,Ne],a,b);return[0,c,bt(ed),0,1,0,1,0,L0,0,0,0,Nd]}function +Ng(a){a[3]=0;var b=h(a[12],a);if(typeof b!=="number"){var -c=b[1];if(b0!==c&&ai>c)throw g([0,f,Mq],1)}return b}function -Mr(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var -p0=[B,My,at(0)];function -Ms(a){var -c=Mo(0,a),e=[B,Mt,at(0)];function -l(a){return Mr(c)}function +c=b[1];if(b6!==c&&ak>c)throw g([0,f,Nh],1)}return b}function +Ni(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var +qe=[B,Np,av(0)];function +Nj(a){var +c=Nf(0,a),e=[B,Nk,av(0)];function +l(a){return Ni(c)}function i(a){var -b=Mp(c);if(typeof -b==="number"){if(ij<=b)throw g([0,f,Mu],1);throw g([0,e,Mv],1)}if(ai>b[1])return b[2];var -d=b[2];throw g([0,e,[0,ai,[0,l(0),d]]],1)}function +b=Ng(c);if(typeof +b==="number"){if(iB<=b)throw g([0,f,Nl],1);throw g([0,e,Nm],1)}if(ak>b[1])return b[2];var +d=b[2];throw g([0,e,[0,ak,[0,l(0),d]]],1)}function h(a,b,c){a:{if(typeof -b==="number"){if(f5===b){var -h=0;return a<50?k(a+1|0,h,c):n(k,[0,h,c])}if(d$===b){var -i=0;return a<50?j(a+1|0,i,c):n(j,[0,i,c])}if(c0===b)break a}else{var -f=b[1];if(o===f||bh===f||bB===f)break a}throw g([0,e,[0,ib,[0,b0,[0,l(0),b,Mw]]]],1)}return a<50?d(a+1|0,b,c):n(d,[0,b,c])}function +b==="number"){if(gh===b){var +h=0;return a<50?k(a+1|0,h,c):n(k,[0,h,c])}if(eg===b){var +i=0;return a<50?j(a+1|0,i,c):n(j,[0,i,c])}if(c7===b)break a}else{var +f=b[1];if(o===f||bl===f||bo===f)break a}throw g([0,e,[0,iu,[0,b6,[0,l(0),b,Nn]]]],1)}return a<50?d(a+1|0,b,c):n(d,[0,b,c])}function k(a,b,c){var e=i(0);if(typeof -e==="number"&&ve===e){var -f=[0,65,bp(b)];return a<50?d(a+1|0,f,c):n(d,[0,f,c])}var +e==="number"&&vE===e){var +f=[0,65,bs(b)];return a<50?d(a+1|0,f,c):n(d,[0,f,c])}var g=[0,b,c];return a<50?h(a+1|0,e,g):n(h,[0,e,g])}function j(a,b,c){var f=i(0);if(typeof -f==="number"){if(sh===f){var -j=[0,79,bp(b)];return a<50?d(a+1|0,j,c):n(d,[0,j,c])}}else if(ie===f[1]){var -k=[1,f[2],b,c],m=i(0);return a<50?h(a+1|0,m,k):n(h,[0,m,k])}throw g([0,e,[0,ib,[0,b0,[0,l(0),f,Mx]]]],1)}function +f==="number"){if(sH===f){var +j=[0,79,bs(b)];return a<50?d(a+1|0,j,c):n(d,[0,j,c])}}else if(ix===f[1]){var +k=[1,f[2],b,c],m=i(0);return a<50?h(a+1|0,m,k):n(h,[0,m,k])}throw g([0,e,[0,iu,[0,b6,[0,l(0),f,No]]]],1)}function d(a,b,c){if(typeof c==="number")return b;if(0===c[0]){var d=c[2],e=[0,b,c[1]];return a<50?k(a+1|0,e,d):n(k,[0,e,d])}var f=c[3],g=[0,[0,c[1],b],c[2]];return a<50?j(a+1|0,g,f):n(j,[0,g,f])}function -m(a,b){return bN(h(0,a,b))}try{var +m(a,b){return bV(h(0,a,b))}try{var p=[0,m(i(0),0)];return p}catch(f){var -b=O(f);if(b[1]===e)return[1,b[2]];throw g(b,0)}}function -Mz(c,b){return m$(function(a){throw g([0,p0,c,a],1)},b)}function -MA(a){var -b=a[1];if(381139274===b)return MB;if(ib>b){var -e=a[2][2];return i(nN(ME),LF,e)}var +b=T(f);if(b[1]===e)return[1,b[2]];throw g(b,0)}}function +Nq(c,b){return nt(function(a){throw g([0,qe,c,a],1)},b)}function +Nr(a){var +b=a[1];if(381139274===b)return Ns;if(iu>b){var +e=a[2][2];return i(Dd(Nv),Mw,e)}var c=a[2];if(typeof -c==="number")return nM(MC);var -d=c[2][3];return h(nM(MD),d)}function -MF(a){return Ms(a)}function -MG(a){var -b=MF(a);if(0===b[0])return b[1];var -c=MA(b[1]);return h(Mz(c0,MH),c)}function -MI(a){return MG([0,o,a])}function -MJ(a){a:if(typeof +c==="number")return n6(Nt);var +d=c[2][3];return h(n6(Nu),d)}function +Nw(a){return Nj(a)}function +Nx(a){var +b=Nw(a);if(0===b[0])return b[1];var +c=Nr(b[1]);return h(Nq(c7,Ny),c)}function +Nz(a){return Nx([0,o,a])}function +NA(a){a:if(typeof a!=="number"){var -b=a[1];if(65!==b&&79!==b)break a;return a}throw g([0,p0,a,MK],1)}function -ML(a){return MJ(MI(a))}var -MP=bQ(function(a){return[0,a,MO]},mH(function(a){return cZ>>a|0)?1:0}if(c(7,b))return m(a,aw(b));if(c(11,b)){m(a,aw(ix|(b>>>6|0)&31));return m(a,aw(J|b&63))}if(c(16,b)){m(a,aw(ee|(b>>>12|0)&15));m(a,aw(J|(b>>>6|0)&63));return m(a,aw(J|b&63))}if(c(21,b)){m(a,aw(d_|(b>>>18|0)&7));m(a,aw(J|(b>>>12|0)&63));m(a,aw(J|(b>>>6|0)&63));return m(a,aw(J|b&63))}if(c(26,b)){m(a,aw(B|(b>>>24|0)&3));m(a,aw(J|(b>>>18|0)&63));m(a,aw(J|(b>>>12|0)&63));m(a,aw(J|(b>>>6|0)&63));return m(a,aw(J|b&63))}if(!c(31,b))throw g([0,f,M5],1);m(a,aw(e4|(b>>>30|0)&1));m(a,aw(J|(b>>>24|0)&63));m(a,aw(J|(b>>>18|0)&63));m(a,aw(J|(b>>>12|0)&63));m(a,aw(J|(b>>>6|0)&63));return m(a,aw(J|b&63))}function -M6(a,b){return eZ+((a-55296|0)<<10|b-56320|0)|0}function -M7(a,b,c){return p5(a,M6(b,c))}var -M9=[B,M8,at(0)];function -hI(a){throw g([0,M9,a],1)}var -kz=[B,M_,at(0)],kA=[B,M$,at(0)],kB=[B,Na,at(0)],p6=[B,Nb,at(0)];function -Nc(a,b,c,d){var -e=c?c[1]:1,f=a?a[1]:bq(cK);return[0,f,e,0,b]}function -kW(a,b,c,d){var -e=0;return a<50?qH(a+1|0,b,c,d,e):n(qH,[0,b,c,d,e])}function -Ne(a,b,c){return bN(kW(0,a,b,c))}function -qH(a,b,c,d,e){var +f=eQ(b,48);if(f)return fU(b,57);var +e=f}return e}return function(a){return In(b,a)}(yk(NL(0,NW,a)))}function +qk(a,b){function +c(a,b){return 0===(b>>>a|0)?1:0}if(c(7,b))return m(a,aA(b));if(c(11,b)){m(a,aA(iM|(b>>>6|0)&31));return m(a,aA(M|b&63))}if(c(16,b)){m(a,aA(ek|(b>>>12|0)&15));m(a,aA(M|(b>>>6|0)&63));return m(a,aA(M|b&63))}if(c(21,b)){m(a,aA(ef|(b>>>18|0)&7));m(a,aA(M|(b>>>12|0)&63));m(a,aA(M|(b>>>6|0)&63));return m(a,aA(M|b&63))}if(c(26,b)){m(a,aA(B|(b>>>24|0)&3));m(a,aA(M|(b>>>18|0)&63));m(a,aA(M|(b>>>12|0)&63));m(a,aA(M|(b>>>6|0)&63));return m(a,aA(M|b&63))}if(!c(31,b))throw g([0,f,NX],1);m(a,aA(fa|(b>>>30|0)&1));m(a,aA(M|(b>>>24|0)&63));m(a,aA(M|(b>>>18|0)&63));m(a,aA(M|(b>>>12|0)&63));m(a,aA(M|(b>>>6|0)&63));return m(a,aA(M|b&63))}function +NY(a,b){return e8+((a-55296|0)<<10|b-56320|0)|0}function +NZ(a,b,c){return qk(a,NY(b,c))}var +N1=[B,N0,av(0)];function +hU(a){throw g([0,N1,a],1)}var +kQ=[B,N2,av(0)],kR=[B,N3,av(0)],kS=[B,N4,av(0)],ql=[B,N5,av(0)];function +N6(a,b,c,d){var +e=c?c[1]:1,f=a?a[1]:bt(cP);return[0,f,e,0,b]}function +k_(a,b,c,d){var +e=0;return a<50?q7(a+1|0,b,c,d,e):n(q7,[0,b,c,d,e])}function +N8(a,b,c){return bV(k_(0,a,b,c))}function +q7(a,b,c,d,e){var g=e;for(;;){var -f=x6(Nd,g,d);if(0===f)return;if(1===f){if(0>=c)return;m(b,x9(d,0));var -i=c-1|0;return a<50?kW(a+1|0,b,i,d):n(kW,[0,b,i,d])}h(d[1],d);g=f}}function -Nf(a,b,c){var -d=c[4],e=c[5];Ne(a,b,c);c[5]=e+1|0;c[4]=d;return}function -p7(a){var -b=10<=a?a+87|0:a+48|0;return aw(b)}function -d2(a,b,c,d,e){er(d,a,b[1],c-b[1]|0);aI(d,e);b[1]=c+1|0;return}function -Ng(a,b,c,d,e){er(d,a,b[1],c-b[1]|0);aI(d,Nh);m(d,p7(e>>>4|0));m(d,p7(e&15));b[1]=c+1|0;return}function -Ni(a,b,c){try{er(c,a,b[1],l(a)-b[1]|0);return}catch(f){var -d=O(f),e=l(a)-b[1]|0,h=b[1];a$(gH(Nj),a,h,e);throw g(d,0)}}function -Nk(a,b){var +f=yw(N7,g,d);if(0===f)return;if(1===f){if(0>=c)return;m(b,yz(d,0));var +i=c-1|0;return a<50?k_(a+1|0,b,i,d):n(k_,[0,b,i,d])}h(d[1],d);g=f}}function +N9(a,b,c){var +d=c[4],e=c[5];N8(a,b,c);c[5]=e+1|0;c[4]=d}function +qm(a){var +b=10<=a?a+87|0:a+48|0;return aA(b)}function +d6(a,b,c,d,e){ex(d,a,b[1],c-b[1]|0);aK(d,e);b[1]=c+1|0}function +N_(a,b,c,d,e){ex(d,a,b[1],c-b[1]|0);aK(d,N$);m(d,qm(e>>>4|0));m(d,qm(e&15));b[1]=c+1|0}function +Oa(a,b,c){try{ex(c,a,b[1],l(a)-b[1]|0);return}catch(f){var +d=T(f),e=l(a)-b[1]|0,h=b[1];bH(gV(Ob),a,h,e);throw g(d,0)}}function +Oc(a,b){var d=[0,0],f=l(b)-1|0,g=0;if(f>=0){var c=g;for(;;){var -e=V(b,c);a:if(92===e)d2(b,d,c,a,Nl);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case -0:d2(b,d,c,a,Nm);break;case -1:d2(b,d,c,a,Nn);break;case -2:d2(b,d,c,a,No);break;case -4:d2(b,d,c,a,Np);break;case -5:d2(b,d,c,a,Nq);break;case -26:d2(b,d,c,a,Nr);break;case +e=X(b,c);a:if(92===e)d6(b,d,c,a,Od);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case +0:d6(b,d,c,a,Oe);break;case +1:d6(b,d,c,a,Of);break;case +2:d6(b,d,c,a,Og);break;case +4:d6(b,d,c,a,Oh);break;case +5:d6(b,d,c,a,Oi);break;case +26:d6(b,d,c,a,Oj);break;case 24:case -25:break c;default:break b}break a}if(cZ===e)break b}break a}Ng(b,d,c,a,e)}var -h=c+1|0;if(f===c)break;c=h}}return Ni(b,d,a)}function -d3(a,b){m(a,34);Nk(a,b);return m(a,34)}function -p8(a,b){return aI(a,Ns)}function -p9(a,b){var -c=b?Nt:Nu;return aI(a,c)}function -Nv(a){return aw(a+48|0)}function -kC(a,b){return 0===b?0:(kC(a,b/10|0),m(a,Nv(fi(b%10|0))))}function -p_(a,b){return 0=0){var b=f;for(;;){var -c=V(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw g(mq,1)}var +c=X(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw g(mH,1)}var i=b+1|0;if(e===b)break;b=i}}var h=1;return h}catch(f){var -d=O(f);if(d===mq)return 0;throw g(d,0)}}function -Nw(a,b){var -c=iD(b);if(3===c){var -g=0.c)return c8<=c?bh<=c?Nw(a,b[2]):p_(a,b[2]):d8<=c?aI(a,b[2]):d3(a,b[2]);if(f_===c)return NN(a,b[2]);if(r<=c)return K<=c?NL(a,b[2]):NM(a,b[2]);if(bB<=c)return p9(a,b[2]);var -d=b[2];return NO(a,d[1],d[2])}function -NL(a,b){m(a,e1);eN(function(a,b){var -c=b[2];d3(a,b[1]);m(a,58);return fQ(a,c)},eO,a,b);return m(a,e7)}function -NM(a,b){m(a,91);eN(fQ,eO,a,b);return m(a,93)}function -NN(a,b){m(a,40);eN(fQ,eO,a,b);return m(a,41)}function -NO(a,b,c){m(a,60);d3(a,b);if(c){var -d=c[1];m(a,58);fQ(a,d)}return m(a,62)}function -fR(a,b){if(typeof -b==="number")return p8(a,0);var -c=b[1];if(gf>c)return c8<=c?bh<=c?ND(a,b[2]):p_(a,b[2]):d8<=c?aI(a,b[2]):d3(a,b[2]);if(f_===c)return NR(a,b[2]);if(r<=c)return K<=c?NP(a,b[2]):NQ(a,b[2]);if(bB<=c)return p9(a,b[2]);var -d=b[2];return NS(a,d[1],d[2])}function -NP(a,b){m(a,e1);eN(function(a,b){var -c=b[2];d3(a,b[1]);m(a,58);return fR(a,c)},eO,a,b);return m(a,e7)}function -NQ(a,b){m(a,91);eN(fR,eO,a,b);return m(a,93)}function -NR(a,b){m(a,91);eN(fR,eO,a,b);return m(a,93)}function -NS(a,b,c){if(!c)return d3(a,b);var -d=c[1];m(a,91);d3(a,b);m(a,44);fR(a,d);return m(a,93)}function -NT(a,b,c,d){var -e=a?a[1]:NU,f=b?b[1]:0;if(f)fR(c,d);else -fQ(c,d);return aI(c,e)}function -bf(a,b,c){return v3(a,b,c)}function -qa(a){return a+ge|0}function -dq(a){if(65<=a){if(97<=a){if(h0>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+ge>>>0)return a-48|0;throw g([0,f,NX],1)}function -b$(a,b,c){var -e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,g=wi(d,(e+c[6]|0)-f|0),j=b[4];if(j)var -l=j[1],k=h(t(NY),l);else +eV(a,b,c,d){if(!d)return;var +e=d[2];i(a,c,d[1]);return OC(a,b,c,e)}function +eW(a){return m(a,44)}function +f4(a,b){if(typeof +b==="number")return qn(a,0);var +c=b[1];if(gu>c)return da<=c?bl<=c?Oo(a,b[2]):qp(a,b[2]):eb<=c?aK(a,b[2]):d7(a,b[2]);if(gm===c)return OF(a,b[2]);if(r<=c)return H<=c?OD(a,b[2]):OE(a,b[2]);if(bo<=c)return qo(a,b[2]);var +d=b[2];return OG(a,d[1],d[2])}function +OD(a,b){m(a,ej);eV(function(a,b){var +c=b[2];d7(a,b[1]);m(a,58);return f4(a,c)},eW,a,b);return m(a,fd)}function +OE(a,b){m(a,91);eV(f4,eW,a,b);return m(a,93)}function +OF(a,b){m(a,40);eV(f4,eW,a,b);return m(a,41)}function +OG(a,b,c){m(a,60);d7(a,b);if(c){var +d=c[1];m(a,58);f4(a,d)}return m(a,62)}function +f5(a,b){if(typeof +b==="number")return qn(a,0);var +c=b[1];if(gu>c)return da<=c?bl<=c?Ov(a,b[2]):qp(a,b[2]):eb<=c?aK(a,b[2]):d7(a,b[2]);if(gm===c)return OJ(a,b[2]);if(r<=c)return H<=c?OH(a,b[2]):OI(a,b[2]);if(bo<=c)return qo(a,b[2]);var +d=b[2];return OK(a,d[1],d[2])}function +OH(a,b){m(a,ej);eV(function(a,b){var +c=b[2];d7(a,b[1]);m(a,58);return f5(a,c)},eW,a,b);return m(a,fd)}function +OI(a,b){m(a,91);eV(f5,eW,a,b);return m(a,93)}function +OJ(a,b){m(a,91);eV(f5,eW,a,b);return m(a,93)}function +OK(a,b,c){if(!c)return d7(a,b);var +d=c[1];m(a,91);d7(a,b);m(a,44);f5(a,d);return m(a,93)}function +OL(a,b,c,d){var +e=a?a[1]:OM,f=b?b[1]:0;if(f)f5(c,d);else +f4(c,d);return aK(c,e)}function +bj(a,b,c){return ws(a,b,c)}function +qr(a){return a+gt|0}function +dy(a){if(65<=a){if(97<=a){if(ih>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+gt>>>0)return a-48|0;throw g([0,f,OP],1)}function +cf(a,b,c){var +e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,g=wK(d,(e+c[6]|0)-f|0),j=b[4];if(j)var +l=j[1],k=h(v(OQ),l);else var -k=N2;var -m=d===g?h(t(NZ),d+1|0):i(t(N1),d+1|0,g+1|0),n=b[2];return hI(fZ(t(N0),k,n,m,a))}function -bW(a,b,c){var -d=32,f=gC(c),e=bq(d);Nf(e,d,c);var -g=bx(e);return b$(a$(t(N3),a,f,g),b,c)}function -NV(a,b,c,d,e){var -h=b?b[1]:cK,i=c?c[1]:NW;if(a){var -g=a[1];eq(g);var +k=OU;var +m=d===g?h(v(OR),d+1|0):i(v(OT),d+1|0,g+1|0),n=b[2];return hU(f$(v(OS),k,n,m,a))}function +b4(a,b,c){var +d=32,f=gQ(c),e=bt(d);N9(e,d,c);var +g=bA(e);return cf(bH(v(OV),a,f,g),b,c)}function +ON(a,b,c,d,e){var +h=b?b[1]:cP,i=c?c[1]:OO;if(a){var +g=a[1];ew(g);var f=g}else var -f=bq(h);NT([0,i],d,f,e);var -j=bx(f);eq(f);return j}var -eP=[B,N4,at(0)];function -N5(a){var +f=bt(h);OL([0,i],d,f,e);var +j=bA(f);ew(f);return j}var +eX=[B,OW,av(0)];function +OX(a){var d=a[5],b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(214748365<=b[1])throw g(eP,1);var -h=qa(e$(f,c));b[1]=(10*b[1]|0)+h|0;var -i=c+1|0;if(e===c)break;c=i}}if(0<=b[1])return b[1];throw g(eP,1)}function -N6(a,b){try{var -d=[0,c8,N5(b)];return d}catch(f){var -c=O(f);if(c===eP)return[0,d8,gC(b)];throw g(c,0)}}function -N7(a){var +c=d;for(;;){if(214748365<=b[1])throw g(eX,1);var +h=qr(fh(f,c));b[1]=(10*b[1]|0)+h|0;var +i=c+1|0;if(e===c)break;c=i}}if(0<=b[1])return b[1];throw g(eX,1)}function +OY(a,b){try{var +d=[0,da,OX(b)];return d}catch(f){var +c=T(f);if(c===eX)return[0,eb,gQ(b)];throw g(c,0)}}function +OZ(a){var d=a[5]+1|0,b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(b[1]<=-214748365)throw g(eP,1);var -h=qa(e$(f,c));b[1]=(10*b[1]|0)-h|0;var -i=c+1|0;if(e===c)break;c=i}}if(0>>0){h(c[1],c);k=f}else +f=bj(bk,k,c);if(19>>0){h(c[1],c);k=f}else switch(f){case -0:return Ov;case -1:return Ow;case -2:return c0;case -3:return[0,bh,wq];case -4:return[0,bh,wm];case -5:return[0,bh,wo];case -6:eq(b[1]);return[0,o,qb(b,c)];case -7:return N6(b,c);case -8:return N8(b,c);case -9:return[0,bh,gn(gC(c))];case +0:return Pn;case +1:return Po;case +2:return c7;case +3:return[0,bl,wS];case +4:return[0,bl,wO];case +5:return[0,bl,wQ];case +6:ew(b[1]);return[0,o,qs(b,c)];case +7:return OY(b,c);case +8:return O0(b,c);case +9:return[0,bl,gD(gQ(c))];case 10:var -e=[0,0];try{a_(b,c);Oq(c);var -q=kD(b,c);a_(b,c);qe(b,c);a_(b,c);var -s=e[1];e[1]=[0,[0,q,dr(b,c)],s];for(;;){a_(b,c);Os(b,c);a_(b,c);var -t=kD(b,c);a_(b,c);qe(b,c);a_(b,c);var -u=e[1];e[1]=[0,[0,t,dr(b,c)],u]}}catch(f){var -l=O(f);if(l===kA)return[0,K,bp(e[1])];throw g(l,0)}break;case +e=[0,0];try{bd(b,c);Pi(c);var +q=kU(b,c);bd(b,c);qv(b,c);bd(b,c);var +s=e[1];e[1]=[0,[0,q,dz(b,c)],s];for(;;){bd(b,c);Pk(b,c);bd(b,c);var +t=kU(b,c);bd(b,c);qv(b,c);bd(b,c);var +u=e[1];e[1]=[0,[0,t,dz(b,c)],u]}}catch(f){var +l=T(f);if(l===kR)return[0,H,bs(e[1])];throw g(l,0)}break;case 11:var -i=[0,0];try{a_(b,c);Oi(c);var -v=i[1];i[1]=[0,dr(b,c),v];for(;;){a_(b,c);Ok(b,c);a_(b,c);var -w=i[1];i[1]=[0,dr(b,c),w]}}catch(f){var -m=O(f);if(m===kz)return[0,r,bp(i[1])];throw g(m,0)}break;case +i=[0,0];try{bd(b,c);Pa(c);var +v=i[1];i[1]=[0,dz(b,c),v];for(;;){bd(b,c);Pc(b,c);bd(b,c);var +w=i[1];i[1]=[0,dz(b,c),w]}}catch(f){var +m=T(f);if(m===kQ)return[0,r,bs(i[1])];throw g(m,0)}break;case 12:var -j=[0,0];try{a_(b,c);Om(c);var -x=j[1];j[1]=[0,dr(b,c),x];for(;;){a_(b,c);Oo(b,c);a_(b,c);var -y=j[1];j[1]=[0,dr(b,c),y]}}catch(f){var -p=O(f);if(p===kB)return[0,f_,bp(j[1])];throw g(p,0)}break;case -13:a_(b,c);var -z=kD(b,c);a_(b,c);return[0,gf,[0,z,Oc(b,c)]];case -14:return a<50?cX(a+1|0,b,c):n(cX,[0,b,c]);case -15:qc(b,c);return a<50?cX(a+1|0,b,c):n(cX,[0,b,c]);case -16:hJ(b,c);return a<50?cX(a+1|0,b,c):n(cX,[0,b,c]);case -17:return a<50?cX(a+1|0,b,c):n(cX,[0,b,c]);case -18:return b$(Ox,b,c);default:return bW(Oy,b,c)}}}function -fY(a,b,c){var -d=58;return a<50?qK(a+1|0,b,c,d):n(qK,[0,b,c,d])}function -qb(a,b){return bN(fY(0,a,b))}function -qK(a,b,c,d){var +j=[0,0];try{bd(b,c);Pe(c);var +x=j[1];j[1]=[0,dz(b,c),x];for(;;){bd(b,c);Pg(b,c);bd(b,c);var +y=j[1];j[1]=[0,dz(b,c),y]}}catch(f){var +p=T(f);if(p===kS)return[0,gm,bs(j[1])];throw g(p,0)}break;case +13:bd(b,c);var +z=kU(b,c);bd(b,c);return[0,gu,[0,z,O6(b,c)]];case +14:return a<50?c4(a+1|0,b,c):n(c4,[0,b,c]);case +15:qt(b,c);return a<50?c4(a+1|0,b,c):n(c4,[0,b,c]);case +16:hV(b,c);return a<50?c4(a+1|0,b,c):n(c4,[0,b,c]);case +17:return a<50?c4(a+1|0,b,c):n(c4,[0,b,c]);case +18:return cf(Pp,b,c);default:return b4(Pq,b,c)}}}function +f_(a,b,c){var +d=58;return a<50?q_(a+1|0,b,c,d):n(q_,[0,b,c,d])}function +qs(a,b){return bV(f_(0,a,b))}function +q_(a,b,c,d){var f=d;for(;;){var -e=bf(bg,f,c);if(3>=e>>>0)switch(e){case -0:return bx(b[1]);case -1:N_(b,c);return a<50?fY(a+1|0,b,c):n(fY,[0,b,c]);case -2:N9(b[1],c);return a<50?fY(a+1|0,b,c):n(fY,[0,b,c]);default:return b$(Oz,b,c)}h(c[1],c);f=e}}function -N_(a,b){return N$(a,b,68)}function -N$(a,b,c){var +e=bj(bk,f,c);if(3>=e>>>0)switch(e){case +0:return bA(b[1]);case +1:O2(b,c);return a<50?f_(a+1|0,b,c):n(f_,[0,b,c]);case +2:O1(b[1],c);return a<50?f_(a+1|0,b,c):n(f_,[0,b,c]);default:return cf(Pr,b,c)}h(c[1],c);f=e}}function +O2(a,b){return O3(a,b,68)}function +O3(a,b,c){var f=c;for(;;){var -e=bf(bg,f,b);if(8>=e>>>0)switch(e){case +e=bj(bk,f,b);if(8>=e>>>0)switch(e){case 0:var -g=cO(b,b[5]);return m(a[1],g);case +g=cT(b,b[5]);return m(a[1],g);case 1:return m(a[1],8);case 2:return m(a[1],12);case 3:return m(a[1],10);case 4:return m(a[1],13);case 5:return m(a[1],9);case 6:var -i=cO(b,b[5]+1|0),j=cO(b,b[5]+2|0),k=cO(b,b[5]+3|0),l=dq(cO(b,b[5]+4|0)),n=dq(k)<<4,o=dq(j)<<8,d=dq(i)<<12|o|n|l;if(k3<=d&&lU>=d)return Oa(a,d,b);return p5(a[1],d);case -7:return bW(OA,a,b);default:return b$(OB,a,b)}h(b[1],b);f=e}}function -Oa(a,b,c){return Ob(a,b,c,82)}function -Ob(a,b,c,d){var +i=cT(b,b[5]+1|0),j=cT(b,b[5]+2|0),k=cT(b,b[5]+3|0),l=dy(cT(b,b[5]+4|0)),n=dy(k)<<4,o=dy(j)<<8,d=dy(i)<<12|o|n|l;if(le<=d&&l$>=d)return O4(a,d,b);return qk(a[1],d);case +7:return b4(Ps,a,b);default:return cf(Pt,a,b)}h(b[1],b);f=e}}function +O4(a,b,c){return O5(a,b,c,82)}function +O5(a,b,c,d){var g=d;for(;;){var -e=bf(bg,g,c);if(2>=e>>>0)switch(e){case +e=bj(bk,g,c);if(2>=e>>>0)switch(e){case 0:var -i=cO(c,c[5]+2|0),j=cO(c,c[5]+3|0),k=cO(c,c[5]+4|0),l=dq(cO(c,c[5]+5|0)),m=dq(k)<<4,n=dq(j)<<8,f=dq(i)<<12|n|m|l;if(lC<=f&&f2>=f)return M7(a[1],b,f);return bW(OC,a,c);case -1:return bW(OD,a,c);default:return b$(OE,a,c)}h(c[1],c);g=e}}function -Oc(a,b){return Od(a,b,h3)}function -Od(a,b,c){var +i=cT(c,c[5]+2|0),j=cT(c,c[5]+3|0),k=cT(c,c[5]+4|0),l=dy(cT(c,c[5]+5|0)),m=dy(k)<<4,n=dy(j)<<8,f=dy(i)<<12|n|m|l;if(lU<=f&&ge>=f)return NZ(a[1],b,f);return b4(Pu,a,c);case +1:return b4(Pv,a,c);default:return cf(Pw,a,c)}h(c[1],c);g=e}}function +O6(a,b){return O7(a,b,gb)}function +O7(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(3>=d>>>0)switch(d){case +d=bj(bk,e,b);if(3>=d>>>0)switch(d){case 0:var -f=dr(a,b);a_(a,b);Oe(a,b);return[0,f];case +f=dz(a,b);bd(a,b);O8(a,b);return[0,f];case 1:return 0;case -2:return bW(OF,a,b);default:return b$(OG,a,b)}h(b[1],b);e=d}}function -Oe(a,b){return Of(a,b,111)}function -Of(a,b,c){var +2:return b4(Px,a,b);default:return cf(Py,a,b)}h(b[1],b);e=d}}function +O8(a,b){return O9(a,b,111)}function +O9(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(2>=d>>>0)switch(d){case +d=bj(bk,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bW(OH,a,b);default:return b$(OI,a,b)}h(b[1],b);e=d}}function -fX(a,b,c){var -d=e7;return a<50?qJ(a+1|0,b,c,d):n(qJ,[0,b,c,d])}function -qc(a,b){return bN(fX(0,a,b))}function -qJ(a,b,c,d){var +1:return b4(Pz,a,b);default:return cf(PA,a,b)}h(b[1],b);e=d}}function +f9(a,b,c){var +d=fd;return a<50?q9(a+1|0,b,c,d):n(q9,[0,b,c,d])}function +qt(a,b){return bV(f9(0,a,b))}function +q9(a,b,c,d){var f=d;for(;;){var -e=bf(bg,f,c);if(3>=e>>>0)switch(e){case +e=bj(bk,f,c);if(3>=e>>>0)switch(e){case 0:return;case -1:return bW(OJ,b,c);case -2:hJ(b,c);return a<50?fX(a+1|0,b,c):n(fX,[0,b,c]);default:return a<50?fX(a+1|0,b,c):n(fX,[0,b,c])}h(c[1],c);f=e}}function -qd(a){return Og(a,131)}function -Og(a,b){var +1:return b4(PB,b,c);case +2:hV(b,c);return a<50?f9(a+1|0,b,c):n(f9,[0,b,c]);default:return a<50?f9(a+1|0,b,c):n(f9,[0,b,c])}h(c[1],c);f=e}}function +qu(a){return O_(a,131)}function +O_(a,b){var d=b;for(;;){var -c=bf(bg,d,a);if(0===c)return 1;if(1===c)return 0;h(a[1],a);d=c}}function -cW(a,b,c){var -d=lP;return a<50?qI(a+1|0,b,c,d):n(qI,[0,b,c,d])}function -a_(a,b){return bN(cW(0,a,b))}function -qI(a,b,c,d){var +c=bj(bk,d,a);if(0===c)return 1;if(1===c)return 0;h(a[1],a);d=c}}function +c3(a,b,c){var +d=l6;return a<50?q8(a+1|0,b,c,d):n(q8,[0,b,c,d])}function +bd(a,b){return bV(c3(0,a,b))}function +q8(a,b,c,d){var f=d;for(;;){var -e=bf(bg,f,c);if(4>=e>>>0)switch(e){case -0:hJ(b,c);return a<50?cW(a+1|0,b,c):n(cW,[0,b,c]);case -1:qc(b,c);return a<50?cW(a+1|0,b,c):n(cW,[0,b,c]);case -2:hJ(b,c);return a<50?cW(a+1|0,b,c):n(cW,[0,b,c]);case -3:return a<50?cW(a+1|0,b,c):n(cW,[0,b,c]);default:return}h(c[1],c);f=e}}function -kD(a,b){return Oh(a,b,f7)}function -Oh(a,b,c){var +e=bj(bk,f,c);if(4>=e>>>0)switch(e){case +0:hV(b,c);return a<50?c3(a+1|0,b,c):n(c3,[0,b,c]);case +1:qt(b,c);return a<50?c3(a+1|0,b,c):n(c3,[0,b,c]);case +2:hV(b,c);return a<50?c3(a+1|0,b,c):n(c3,[0,b,c]);case +3:return a<50?c3(a+1|0,b,c):n(c3,[0,b,c]);default:return}h(c[1],c);f=e}}function +kU(a,b){return O$(a,b,gj)}function +O$(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(3>=d>>>0)switch(d){case -0:eq(a[1]);return qb(a,b);case -1:return x8(b,b[5],b[6]);case -2:return bW(OK,a,b);default:return b$(OL,a,b)}h(b[1],b);e=d}}function -Oi(a){return Oj(a,dx)}function -Oj(a,b){var +d=bj(bk,e,b);if(3>=d>>>0)switch(d){case +0:ew(a[1]);return qs(a,b);case +1:return yy(b,b[5],b[6]);case +2:return b4(PC,a,b);default:return cf(PD,a,b)}h(b[1],b);e=d}}function +Pa(a){return Pb(a,dF)}function +Pb(a,b){var d=b;for(;;){var -c=bf(bg,d,a);if(0===c)throw g(kz,1);if(1===c)return;h(a[1],a);d=c}}function -Ok(a,b){return Ol(a,b,uK)}function -Ol(a,b,c){var +c=bj(bk,d,a);if(0===c)throw g(kQ,1);if(1===c)return;h(a[1],a);d=c}}function +Pc(a,b){return Pd(a,b,u$)}function +Pd(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(3>=d>>>0)switch(d){case +d=bj(bk,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw g(kz,1);case -2:return bW(OM,a,b);default:return b$(ON,a,b)}h(b[1],b);e=d}}function -Om(a){return On(a,sm)}function -On(a,b){var +1:throw g(kQ,1);case +2:return b4(PE,a,b);default:return cf(PF,a,b)}h(b[1],b);e=d}}function +Pe(a){return Pf(a,sM)}function +Pf(a,b){var d=b;for(;;){var -c=bf(bg,d,a);if(0===c)throw g(kB,1);if(1===c)return;h(a[1],a);d=c}}function -Oo(a,b){return Op(a,b,qS)}function -Op(a,b,c){var +c=bj(bk,d,a);if(0===c)throw g(kS,1);if(1===c)return;h(a[1],a);d=c}}function +Pg(a,b){return Ph(a,b,rh)}function +Ph(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(3>=d>>>0)switch(d){case +d=bj(bk,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw g(kB,1);case -2:return bW(OO,a,b);default:return b$(OP,a,b)}h(b[1],b);e=d}}function -Oq(a){return Or(a,sA)}function -Or(a,b){var +1:throw g(kS,1);case +2:return b4(PG,a,b);default:return cf(PH,a,b)}h(b[1],b);e=d}}function +Pi(a){return Pj(a,lv)}function +Pj(a,b){var d=b;for(;;){var -c=bf(bg,d,a);if(0===c)throw g(kA,1);if(1===c)return;h(a[1],a);d=c}}function -Os(a,b){return Ot(a,b,uq)}function -Ot(a,b,c){var +c=bj(bk,d,a);if(0===c)throw g(kR,1);if(1===c)return;h(a[1],a);d=c}}function +Pk(a,b){return Pl(a,b,uS)}function +Pl(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(3>=d>>>0)switch(d){case +d=bj(bk,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw g(kA,1);case -2:return bW(OQ,a,b);default:return b$(OR,a,b)}h(b[1],b);e=d}}function -qe(a,b){return Ou(a,b,sK)}function -Ou(a,b,c){var +1:throw g(kR,1);case +2:return b4(PI,a,b);default:return cf(PJ,a,b)}h(b[1],b);e=d}}function +qv(a,b){return Pm(a,b,s_)}function +Pm(a,b,c){var e=c;for(;;){var -d=bf(bg,e,b);if(2>=d>>>0)switch(d){case +d=bj(bk,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bW(OS,a,b);default:return b$(OT,a,b)}h(b[1],b);e=d}}function -OU(a,b){a_(a,b);var -c=1-qd(b);return c?bW(OV,a,b):c}function -OW(a,b,c){var -d=b?b[1]:0;a_(a,c);if(qd(c))throw g(p6,1);var -e=dr(a,c);if(1-d)OU(a,c);return e}var -O0=[B,OZ,at(0)];function -O1(a){if(typeof -a==="number")return O2;var -b=a[1];return f_<=b?bB===b?O3:928231259<=b?K<=b?O4:O5:r<=b?O6:O7:d8===b?O8:bh<=b?gf<=b?O9:O_:c8<=b?O$:Pa}function -qf(a,b){throw g([0,O0,bb(a,O1(b)),b],1)}function -qg(a){if(typeof -a!=="number"&&o===a[1])return a[2];return qf(Pd,a)}function -OX(a,b,c,d){try{var -f=x7(0,d),h=OW(Nc(a,b,c,0),0,f);return h}catch(f){var -e=O(f);if(e===p6)return hI(OY);throw g(e,0)}}function -Pb(a){if(typeof -a!=="number"&&K===a[1])return a[2];return qf(Pc,a)}function -ad(a){return[0,o,a]}function -kE(a){return[0,c8,a]}function -hK(a,b){return b?h(a,b[1]):c0}function -fS(a,b){return[0,r,bp(mG(a,b))]}var -ds=[0,1],Pf=[B,Pe,at(0)];function -ca(a,b){throw g([0,Pf,[0,dL,a],b],1)}function -ae(a){if(typeof -a!=="number"&&o===a[1])return a[2];return ca(Pg,a)}function -kF(a){if(typeof -a!=="number"&&c8===a[1])return a[2];return ca(Ph,a)}function -hL(a,b){if(typeof -b==="number"&&c0===b)return 0;return[0,h(a,b)]}function -fT(a,b){if(typeof -b!=="number"&&r===b[1])return bp(mG(a,b[2]));return ca(Pi,b)}function -I(a,b){return ca(bb(a,Pj),b)}function -qh(a,b){return ca(bb(a,Po),b)}function -qi(a,b){return ca(bb(a,Pp),b)}function -qj(a,b){return ca(bb(a,Pq),b)}function -qk(a,b,c,d){var -e=mP(Pr,bp(c));return ca(a$(t(Ps),b,a,e),d)}function -bX(a,b,c){return qk(Pt,a,b,c)}function -bY(a,b,c){return qk(Pu,a,b,c)}function -Pv(a,b){var -d=a,c=b;for(;;){if(!c)return mP(Pw,bp(d));var +1:return b4(PK,a,b);default:return cf(PL,a,b)}h(b[1],b);e=d}}function +PM(a,b){bd(a,b);var +c=1-qu(b);return c?b4(PN,a,b):c}function +PO(a,b,c){var +d=b?b[1]:0;bd(a,c);if(qu(c))throw g(ql,1);var +e=dz(a,c);if(1-d)PM(a,c);return e}var +PS=[B,PR,av(0)];function +PT(a){if(typeof +a==="number")return PU;var +b=a[1];return gm<=b?bo===b?PV:928231259<=b?H<=b?PW:PX:r<=b?PY:PZ:eb===b?P0:bl<=b?gu<=b?P1:P2:da<=b?P3:P4}function +qw(a,b){throw g([0,PS,a2(a,PT(b)),b],1)}function +qx(a){if(typeof +a!=="number"&&o===a[1])return a[2];return qw(P7,a)}function +PP(a,b,c,d){try{var +f=yx(0,d),h=PO(N6(a,b,c,0),0,f);return h}catch(f){var +e=T(f);if(e===ql)return hU(PQ);throw g(e,0)}}function +P5(a){if(typeof +a!=="number"&&H===a[1])return a[2];return qw(P6,a)}function +K(a){return[0,o,a]}function +kV(a){return[0,da,a]}function +eY(a,b){return b?h(a,b[1]):c7}function +hW(a,b){return[0,r,bs(mY(a,b))]}var +cK=[0,1],P_=[B,P9,av(0)];function +b5(a,b){throw g([0,P_,[0,dT,a],b],1)}function +L(a){if(typeof +a!=="number"&&o===a[1])return a[2];return b5(Qb,a)}function +kW(a){if(typeof +a!=="number"&&da===a[1])return a[2];return b5(Qc,a)}function +eZ(a,b){if(typeof +b==="number"&&c7===b)return 0;return[0,h(a,b)]}function +hX(a,b){if(typeof +b!=="number"&&r===b[1])return bs(mY(a,b[2]));return b5(Qd,b)}function +P8(a){return[0,bo,a]}function +P$(a){if(typeof +a!=="number"&&bo===a[1])return a[2];return b5(Qa,a)}function +J(a,b){return b5(a2(a,Qe),b)}function +qy(a,b){return b5(a2(a,Qj),b)}function +qz(a,b){return b5(a2(a,Qk),b)}function +qA(a,b){return b5(a2(a,Ql),b)}function +qB(a,b,c,d){var +e=m7(Qm,bs(c));return b5(bH(v(Qn),b,a,e),d)}function +bD(a,b,c){return qB(Qo,a,b,c)}function +bE(a,b,c){return qB(Qp,a,b,c)}function +Qq(a,b){var +d=a,c=b;for(;;){if(!c)return m7(Qr,bs(d));var e=c[1];if(e[1]){d=[0,e[2],d];c=c[2]}else c=c[2]}}function -cb(a,b,c){var -d=Pv(0,c);return ca(i(t(Px),a,d),b)}function -bZ(a,b){return ca(bb(a,Py),b)}function -Pk(a,b,c){return ca(i(t(Pl),a,b),c)}function -Pm(a,b){return ca(bb(a,Pn),b)}function +bQ(a,b,c){var +d=Qq(0,c);return b5(i(v(Qs),a,d),b)}function +bF(a,b){return b5(a2(a,Qt),b)}function +Qf(a,b,c){return b5(i(v(Qg),a,b),c)}function +Qh(a,b){return b5(a2(a,Qi),b)}function b(a){return a[1]}function -PA(a){if(typeof -a!=="number"&&K===a[1]){var +Qv(a){if(typeof +a!=="number"&&H===a[1]){var e=[0,0],f=[0,0],j=[0,0],g=[0,0],c=[0,0],d=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -k=h[1],i=k[2],d=k[1],l=h[2];if(d!==e2)if(d!==c6)if(d!==eY){if(d===sX)if(b(j))c[1]=[0,d,b(c)];else -j[1]=[0,hL(ae,i)]}else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ae(i)];else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,ae(i)];else if(b(g))c[1]=[0,d,b(c)];else -g[1]=[0,ae(i)];h=l}}(a[2]));if(b(c))return bX(hM,b(c),a);if(b(d))return bY(hM,b(d),a);var +k=h[1],i=k[2],d=k[1],l=h[2];if(d!==e_)if(d!==cz)if(d!==e7){if(d===tn)if(b(j))c[1]=[0,d,b(c)];else +j[1]=[0,eZ(L,i)]}else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,L(i)];else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,L(i)];else if(b(g))c[1]=[0,d,b(c)];else +g[1]=[0,L(i)];h=l}}(a[2]));if(b(c))return bD(hY,b(c),a);if(b(d))return bE(hY,b(d),a);var h=b(e),i=b(f),k=b(j),l=b(g);if(h&&i&&l){var m=l[1],n=i[1],o=h[1],p=k?k[1]:0;return[0,o,n,p,m]}var -q=[0,[0,0===b(g)?1:0,PB],0],r=[0,[0,0===b(f)?1:0,PC],q];return cb(hM,a,[0,[0,0===b(e)?1:0,PD],r])}return bZ(hM,a)}function -PE(a){var -b=a[3],c=a[2],d=a[1],e=[0,[0,PF,ad(a[4])],0],f=[0,[0,PG,hK(ad,b)],e],g=[0,[0,PH,ad(c)],f];return[0,K,[0,[0,PI,ad(d)],g]]}function -P0(a){return bQ(function(a){var -b=a[1];return[0,b,qg(a[2])]},Pb(a))}function -P1(a){return[0,K,bQ(function(a){return[0,a[1],[0,o,a[2]]]},a)]}function -P2(a){if(typeof -a!=="number"&&K===a[1]){var +q=[0,[0,0===b(g)?1:0,Qw],0],r=[0,[0,0===b(f)?1:0,Qx],q];return bQ(hY,a,[0,[0,0===b(e)?1:0,Qy],r])}return bF(hY,a)}function +Qz(a){var +b=a[3],c=a[2],d=a[1],e=[0,[0,QA,K(a[4])],0],f=[0,[0,QB,eY(K,b)],e],g=[0,[0,QC,K(c)],f];return[0,H,[0,[0,QD,K(d)],g]]}function +QV(a){return bY(function(a){var +b=a[1];return[0,b,qx(a[2])]},P5(a))}function +QW(a){return[0,H,bY(function(a){return[0,a[1],[0,o,a[2]]]},a)]}function +QX(a){if(typeof +a!=="number"&&H===a[1]){var e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -i=h[1],j=i[2],d=i[1],k=h[2];if(d!==e2)if(d!==c6){if(b(ds))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,ae(j)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ae(j)];h=k}}(a[2]));if(b(c))return bX(hP,b(c),a);if(b(g))return bY(hP,b(g),a);var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==e_)if(d!==cz){if(b(cK))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,L(j)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,L(j)];h=k}}(a[2]));if(b(c))return bD(h1,b(c),a);if(b(g))return bE(h1,b(g),a);var d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var -i=[0,[0,0===b(f)?1:0,P3],0];return cb(hP,a,[0,[0,0===b(e)?1:0,P4],i])}return bZ(hP,a)}function -P5(a){var -b=a[1],c=[0,[0,P6,ad(a[2])],0];return[0,K,[0,[0,P7,ad(b)],c]]}function -P8(a){if(typeof -a!=="number"&&K===a[1]){var +i=[0,[0,0===b(f)?1:0,QY],0];return bQ(h1,a,[0,[0,0===b(e)?1:0,QZ],i])}return bF(h1,a)}function +Q0(a){var +b=a[1],c=[0,[0,Q1,K(a[2])],0];return[0,H,[0,[0,Q2,K(b)],c]]}function +Q3(a){if(typeof +a!=="number"&&H===a[1]){var e=[0,0],c=[0,0],d=[0,0];(function(a){var d=a;for(;;){if(!d)return;var -f=d[1],g=f[1],h=d[2],i=f[2];if(g===vg)if(b(e))c[1]=[0,g,b(c)];else -e[1]=[0,P0(i)];d=h}}(a[2]));return b(c)?bX(kG,b(c),a):b(d)?bY(kG,b(d),a):[0,b(e)]}return bZ(kG,a)}function -P9(a){var -b=a[1],c=0,d=b?[0,[0,P_,P1(b[1])],c]:c;return[0,K,d]}function -P$(a){if(typeof +f=d[1],g=f[1],h=d[2],i=f[2];if(g===vG)if(b(e))c[1]=[0,g,b(c)];else +e[1]=[0,QV(i)];d=h}}(a[2]));return b(c)?bD(kX,b(c),a):b(d)?bE(kX,b(d),a):[0,b(e)]}return bF(kX,a)}function +Q4(a){var +b=a[1],c=0,d=b?[0,[0,Q5,QW(b[1])],c]:c;return[0,H,d]}function +Q6(a){if(typeof a!=="number"&&r===a[1]){var -b=a[2];if(!b)return qi(D,a);var +b=a[2];if(!b)return qz(D,a);var d=b[1];if(typeof d!=="number"){var e=d[1];if(o===e){var -c=d[2],f=ff(c,tw);if(0<=f){if(0>=f)return b[2]?I(D,a):18;var -g=ff(c,rh);if(0<=g){if(0>=g)return b[2]?I(D,a):28;if(c===se)return b[2]?I(D,a):29;if(c===to)return b[2]?I(D,a):30;if(c===rY)return b[2]?I(D,a):31;if(c===sO)return b[2]?I(D,a):32;if(c===rk)return b[2]?I(D,a):33;if(c===ro)return b[2]?I(D,a):34;if(c===ux)return b[2]?I(D,a):35;if(c===rL)return b[2]?I(D,a):36}else{if(c===sn)return b[2]?I(D,a):19;if(c===qY)return b[2]?I(D,a):20;if(c===uN)return b[2]?I(D,a):21;if(c===uL)return b[2]?I(D,a):22;if(c===q$)return b[2]?I(D,a):23;if(c===uo)return b[2]?I(D,a):24;if(c===tb)return b[2]?I(D,a):25;if(c===u$)return b[2]?I(D,a):26;if(c===rw)return b[2]?I(D,a):27}}else{var -h=ff(c,uW);if(0<=h){if(0>=h)return b[2]?I(D,a):9;if(c===uZ)return b[2]?I(D,a):10;if(c===s0)return b[2]?I(D,a):11;if(c===vi)return b[2]?I(D,a):12;if(c===re)return b[2]?I(D,a):13;if(c===rj)return b[2]?I(D,a):14;if(c===vd)return b[2]?I(D,a):15;if(c===ug)return b[2]?I(D,a):16;if(c===rO)return b[2]?I(D,a):17}else{if(c===vh)return b[2]?I(D,a):0;if(c===uQ)return b[2]?I(D,a):1;if(c===sI)return b[2]?I(D,a):2;if(c===sa)return b[2]?I(D,a):3;if(c===rr)return b[2]?I(D,a):4;if(c===rD)return b[2]?I(D,a):5;if(c===ss)return b[2]?I(D,a):6;if(c===rN)return b[2]?I(D,a):7;if(c===tE)return b[2]?I(D,a):8}}}else if(r===e)return qh(D,a)}}return qj(D,a)}function -Qa(a){switch(a){case -0:return Qb;case -1:return Qc;case -2:return Qd;case -3:return Qe;case -4:return Qf;case -5:return Qg;case -6:return Qh;case -7:return Qi;case -8:return Qj;case -9:return Qk;case -10:return Ql;case -11:return Qm;case -12:return Qn;case -13:return Qo;case -14:return Qp;case -15:return Qq;case -16:return Qr;case -17:return Qs;case -18:return Qt;case -19:return Qu;case -20:return Qv;case -21:return Qw;case -22:return Qx;case -23:return Qy;case -24:return Qz;case -25:return QA;case -26:return QB;case -27:return QC;case -28:return QD;case -29:return QE;case -30:return QF;case -31:return QG;case -32:return QH;case -33:return QI;case -34:return QJ;case -35:return QK;default:return QL}}function -QM(a){return P$([0,r,[0,[0,o,qg(a)],0]])}function -QN(a){var -b=Qa(a);if(typeof +c=d[2],f=fn(c,tZ);if(0<=f){if(0>=f)return b[2]?J(D,a):18;var +g=fn(c,rJ);if(0<=g){if(0>=g)return b[2]?J(D,a):28;if(c===sE)return b[2]?J(D,a):29;if(c===tQ)return b[2]?J(D,a):30;if(c===sm)return b[2]?J(D,a):31;if(c===tc)return b[2]?J(D,a):32;if(c===rM)return b[2]?J(D,a):33;if(c===rQ)return b[2]?J(D,a):34;if(c===uY)return b[2]?J(D,a):35;if(c===sb)return b[2]?J(D,a):36}else{if(c===sN)return b[2]?J(D,a):19;if(c===rn)return b[2]?J(D,a):20;if(c===vc)return b[2]?J(D,a):21;if(c===va)return b[2]?J(D,a):22;if(c===rB)return b[2]?J(D,a):23;if(c===uQ)return b[2]?J(D,a):24;if(c===tD)return b[2]?J(D,a):25;if(c===vz)return b[2]?J(D,a):26;if(c===rX)return b[2]?J(D,a):27}}else{var +h=fn(c,vk);if(0<=h){if(0>=h)return b[2]?J(D,a):9;if(c===vn)return b[2]?J(D,a):10;if(c===tp)return b[2]?J(D,a):11;if(c===vJ)return b[2]?J(D,a):12;if(c===rG)return b[2]?J(D,a):13;if(c===rL)return b[2]?J(D,a):14;if(c===vD)return b[2]?J(D,a):15;if(c===uI)return b[2]?J(D,a):16;if(c===se)return b[2]?J(D,a):17}else{if(c===vH)return b[2]?J(D,a):0;if(c===vf)return b[2]?J(D,a):1;if(c===s7)return b[2]?J(D,a):2;if(c===sB)return b[2]?J(D,a):3;if(c===rT)return b[2]?J(D,a):4;if(c===r4)return b[2]?J(D,a):5;if(c===sS)return b[2]?J(D,a):6;if(c===sd)return b[2]?J(D,a):7;if(c===t8)return b[2]?J(D,a):8}}}else if(r===e)return qy(D,a)}}return qA(D,a)}function +Q7(a){switch(a){case +0:return Q8;case +1:return Q9;case +2:return Q_;case +3:return Q$;case +4:return Ra;case +5:return Rb;case +6:return Rc;case +7:return Rd;case +8:return Re;case +9:return Rf;case +10:return Rg;case +11:return Rh;case +12:return Ri;case +13:return Rj;case +14:return Rk;case +15:return Rl;case +16:return Rm;case +17:return Rn;case +18:return Ro;case +19:return Rp;case +20:return Rq;case +21:return Rr;case +22:return Rs;case +23:return Rt;case +24:return Ru;case +25:return Rv;case +26:return Rw;case +27:return Rx;case +28:return Ry;case +29:return Rz;case +30:return RA;case +31:return RB;case +32:return RC;case +33:return RD;case +34:return RE;case +35:return RF;default:return RG}}function +RH(a){if(typeof +a!=="number"&&H===a[1]){var +e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var +h=a;for(;;){if(!h)return;var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==cz)if(d!==vy){if(b(cK))g[1]=[0,d,b(g)]}else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,L(j)];else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,L(j)];h=k}}(a[2]));if(b(c))return bD(h2,b(c),a);if(b(g))return bE(h2,b(g),a);var +d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var +i=[0,[0,0===b(f)?1:0,RI],0];return bQ(h2,a,[0,[0,0===b(e)?1:0,RJ],i])}return bF(h2,a)}function +RK(a){var +b=a[1],c=[0,[0,RL,K(a[2])],0];return[0,H,[0,[0,RM,K(b)],c]]}function +RN(a){return Q6([0,r,[0,[0,o,qx(a)],0]])}function +RO(a){var +b=Q7(a);if(typeof b!=="number"&&r===b[1]){var -c=b[2];if(c&&!c[2])return c[1]}throw g([0,f,QO],1)}var -ql=[0,0];function -Pz(a){return a?"POST":"GET"}function -Re(a,b){if(a)var -d=a[1],c=h(t(Rf),d);else +c=b[2];if(c&&!c[2])return c[1]}throw g([0,f,RP],1)}var +qC=[0,0];function +Qu(a){return a?"POST":"GET"}function +Si(a,b){if(a)var +d=a[1],c=h(v(Sj),d);else var -c=Ri;var -e=eI(ql[1],Rg);return i(t(Rh),e,c)}function -PJ(a){if(typeof -a!=="number"&&K===a[1]){var +c=Sm;var +e=hJ(qC[1],Sk);return i(v(Sl),e,c)}function +QE(a){if(typeof +a!=="number"&&H===a[1]){var e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -i=h[1],j=i[2],d=i[1],k=h[2];if(d!==td)if(d!==r3){if(b(ds))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,ae(j)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ae(j)];h=k}}(a[2]));if(b(c))return bX(hN,b(c),a);if(b(g))return bY(hN,b(g),a);var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==tF)if(d!==sr){if(b(cK))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,L(j)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,L(j)];h=k}}(a[2]));if(b(c))return bD(hZ,b(c),a);if(b(g))return bE(hZ,b(g),a);var d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var -i=[0,[0,0===b(f)?1:0,PK],0];return cb(hN,a,[0,[0,0===b(e)?1:0,PL],i])}return bZ(hN,a)}function -PM(a){var -b=a[1],c=[0,[0,PN,ad(a[2])],0];return[0,K,[0,[0,PO,ad(b)],c]]}function -PP(a){if(typeof -a!=="number"&&K===a[1]){var +i=[0,[0,0===b(f)?1:0,QF],0];return bQ(hZ,a,[0,[0,0===b(e)?1:0,QG],i])}return bF(hZ,a)}function +QH(a){var +b=a[1],c=[0,[0,QI,K(a[2])],0];return[0,H,[0,[0,QJ,K(b)],c]]}function +QK(a){if(typeof +a!=="number"&&H===a[1]){var e=[0,0],f=[0,0],g=[0,0],c=[0,0],d=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -j=h[1],i=j[2],d=j[1],k=h[2];if(d!==u_)if(d!==eY){if(d===ti)if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,PA(i)]}else if(b(g))c[1]=[0,d,b(c)];else -g[1]=[0,ae(i)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ae(i)];h=k}}(a[2]));if(b(c))return bX(hO,b(c),a);if(b(d))return bY(hO,b(d),a);var +j=h[1],i=j[2],d=j[1],k=h[2];if(d!==vx)if(d!==e7){if(d===tK)if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,Qv(i)]}else if(b(g))c[1]=[0,d,b(c)];else +g[1]=[0,L(i)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,L(i)];h=k}}(a[2]));if(b(c))return bD(h0,b(c),a);if(b(d))return bE(h0,b(d),a);var h=b(e),i=b(f),j=b(g);if(h&&i&&j)return[0,h[1],i[1],j[1]];var -k=[0,[0,0===b(g)?1:0,PQ],0],l=[0,[0,0===b(f)?1:0,PR],k];return cb(hO,a,[0,[0,0===b(e)?1:0,PS],l])}return bZ(hO,a)}function -PT(a){var -b=a[2],c=a[1],d=[0,[0,PU,ad(a[3])],0],e=[0,[0,PV,ad(b)],d];return[0,K,[0,[0,PW,PE(c)],e]]}var -PX=1;function -PY(a){return PZ}function -QP(a){if(typeof -a!=="number"&&K===a[1]){var -f=[0,0],l=[0,0],g=[0,0],m=[0,0],n=[0,0],o=[0,0],h=[0,0],i=[0,0],j=[0,0],p=[0,0],q=[0,0],c=[0,0],d=[0,0];(function(a){var -k=a;for(;;){if(!k)return;var -r=k[1],e=r[2],d=r[1],s=ff(d,c6);a:b:{var -t=k[2];if(0<=s)if(0=d>>>0)switch(d){case -0:return[0,TO,a];case -1:break;default:return[0,TP,a]}if(!a)return a;var -c=a[1];return h7<=c[1]?[0,[0,h7,[0,b,c[2]]],a[2]]:[0,[0,uR,[0,b,c[2]]],a[2]]},0,b)))}function -qw(a){var -b=[0,di(ap(kN))],c=Rq(ap(qt));function +b=NV(a),c=pc(function(a){var +c=a[2],d=a[1];return eQ(Ik(0,b)(c),0)?[0,d]:0},e);return NN[29].call(null,c)}function +f(a){if(ip<=a[1]){var +b=c(a[2]);return pi(b)?0:[0,[0,d(b)]]}var +e=c(a[2]);return pi(e)?0:[0,[1,d(e)]]}function +g(a){return[1,a]}return function(a){return bY(g,a)}(function(a){return pc(f,a)}(yb(function(a,b){var +d=b+u0|0;if(2>=d>>>0)switch(d){case +0:return[0,VU,a];case +1:break;default:return[0,VV,a]}if(!a)return a;var +c=a[1];return ip<=c[1]?[0,[0,ip,[0,b,c[2]]],a[2]]:[0,[0,vg,[0,b,c[2]]],a[2]]},0,b)))}function +qW(a){var +b=[0,dp(az(k1))],c=Su(az(qT));function d(a){return[0,a[1],a[2][2][2]]}var -e=function(a){return bQ(d,a)}(ap(qr)),f=TN(e,ap(qs));return cF(d6([3,[0,0,b,c,[0,[0,ap(qv)],f]]]),function(a){return ah(kO,a)})}var -kP=[0,-1];function -hZ(a,b){var -c=a?a[1]:cI;if(eH(kP[1],0))oC(kP[1]);kP[1]=oB(c,function(a){qw(0);return 0});return}var -qx=Jn(0,0,[0,TR,gY(dh(function(a){return dj(function(a){var -b=a[1];return[0,b,[0,[0,80,a9(0,a[2][2])],0],1]},a[2])},[0,gW(b7),function(c){function -b(a,b){return co(c,a,b)}return function(a){return b(a,b8)}}],Tk))]);function -TQ(a){return cF(d6([3,[0,0,[0,di(ap(kN))],0,0]]),function(b){return cF(d6([4,b]),function(a){function -c(a,b){return hx(b[2][1],a[2][1])}var -d=function(a){return xg(c,a)}(MX[58].call(null,a));ah(TH,[0,b]);ah(qr,d);return qw(0)})})}var -TS=qx[1],TT=co(TS,x(qx[2],function(a){ah(kN,a);TQ(0);return a}),function(a,b){return a}),TW=pr(0,0,[0,TU],[0,function(a,b){ah(qs,b);var -c=1-a,d=c?(hZ(0,0),0):c;return d}],TV)[1],TX=x(aD(kO),function(a){return a[3]}),TZ=pr(0,0,0,[0,function(a,b){ah(qv,b);var -c=1-a,d=c?(hZ(0,0),0):c;return d}],TY),T3=pt(0,0,0,[0,function(a,b){ah(qt,b);var -c=1-a,d=c?(hZ(T1,0),0):c;return d}],T2,aB(fD(T0))),T7=pt(0,0,0,[0,function(a,b){ah(qu,b);var -c=1-a,d=c?(hZ(T5,0),0):c;return d}],T6,aB(fD(T4))),T9=[0,[0,82,function(a){return Q(0,0,0,0,[0,[0,82,a],0])}(x(TX,function(a){return a9(0,h(t(T8),a))}))],0],T_=[0,[0,82,T3[1]],[0,[0,82,T7[1]],[0,[0,82,TZ[1]],T9]]],Ua=Q(0,[0,dZ(T$)],0,0,[0,[0,82,TT],0]),Uc=dZ(Ub),Ue=Q(0,[0,Uc],0,0,[0,[0,80,a9(0,Ud)],[0,[0,82,TW],0]]),qy=dZ(Uf),Ug=Q(0,[0,qy],0,0,[0,[0,82,Ua],[0,[0,82,Ue],0]]),Uh=Q(0,[0,qy],0,0,T_),Uj=Q(0,[0,dZ(Ui)],0,0,[0,[0,82,Ug],[0,[0,82,Uh],0]]);function -Uk(a){var -b=function(a){return kl(Un,Um,a)}([0,[0,80,a9(0,Ul)],0]),c=function(a){return kl(Uq,Up,a)}([0,[0,80,a9(0,Uo)],0]);return aB(ES([0,function(a){return kl(Ut,Us,a)}([0,[0,80,a9(0,Ur)],0]),c,b]))}function -qz(j,f,c,d){var -a=d[4],e=co(SP(d),a,function(a,b){return[0,a,0,0,b]});function -k(a,b){var -e=di(ap(eQ));try{var -f=gx(a,e)[1],h=i(t(Uv),f,b),d=h}catch(f){var -c=O(f);if(c!==a6)throw g(c,0);var -d=Uu}return os(S(d))}var -b=[0,[0,Uk(0)],Ux],m=co(d[2],d[3],function(a,b){return a-b|0});function -l(a,d,c){var -b=c[2],e=b[2],f=b[5][1],g=b[1][1],i=c[1][1],l=x(function(a){return x(a,function(a,b){var -c=a[1];h(j,[0,[0,c[1],a[1][2]+d|0,c[3]],a[2],a[3],a[4]]);return 0})}(a),function(a){return cr(0,hg,a)}),m=e?gW(k(f,e[1][1])):gW(os(ld)),n=x(aD(eS),function(a){if(a&&i1(a[1][1][2][1][1],g)){var -b=[0,a9(0,Uw),0];return hn(0,[0,[0,cq("playing"),0]],b)}return hn(0,0,[0,a9(0,wu(d+1|0)),0])}),o=[0,[0,80,hn(0,0,[0,F_(0,0,[0,a9(0,i),0]),0])],0];return[0,[0,82,n],[0,[0,82,Q(0,0,[0,[0,[0,82,l],0]],0,[0,[0,82,GY(0,[0,[0,[0,82,m],[0,[0,80,FP(50)],0]]],0,0,0)],0])],o]]}var -n=x(e,function(a,b){return i(f,a,b)});return JC(b,[0,function(a){return 0}],c,[0,m,n,aB(function(a,b){return l(e,a,b)})])}function -Uy(a,b,c){return qz(a,b,[0,aD(eR)],c)}var -qA=pl(Uz,function(a){return km(0,ky(0))});Rd(ap(qA));d6([0,ap(qA)]);function -kQ(a,b){return d6([5,a[1],a[4],b])}var -kR=To([0,kQ]),UA=[0,[0,82,Tl(0)],0],UC=[0,[0,80,F9(0,0,[0,a9(0,UB),0])],UA],UD=Q(0,[0,[0,[0,80,dS(s5)],0]],0,0,UC),UE=[0,[0,82,kR[3].call(null,0)],0],UF=Q(0,[0,[0,[0,80,dS(s5)],0]],0,0,UE),qB=aD(kO),UG=x(qB,function(a){return a[1]}),qC=x(qB,function(a){return a[3]}),UH=co(qC,aD(qu),function(b){return function(a){return Rp(b,a)}}),UI=[0,UG,qC,aB(0),UH],UJ=qz(kR[2],kQ,0,UI),UL=gY(x(aD(hY),function(a){if(!a)return oO(0,0,0,0,[0,[0,80,a9(0,UK)],0]);var -b=a[1],c=aB(b[4]),d=aB(b[1][2]),e=aB(b[1][3]),f=[0,aB(b[1][1]),e,d,c];return Uy(kR[2],kQ,f)})),UM=x(aD(kL),function(a){return a?hj:cq("display-none")}),UQ=x(aD(eS),function(a){if(a)var -b=a[1][1][2],d=b[5][1],e=b[1][1],f=function(a){return eI(a,e)}(dV(function(a){return a[1]},b[2])),g=gx(d,di(ap(eQ)))[1],c=i(t(UN),g,f);else +e=function(a){return bY(d,a)}(az(qR)),f=VT(e,az(qS));return cY(d_([3,[0,0,b,c,[0,[0,az(qV)],f]]]),function(a){return ai(k2,a)})}var +k3=[0,-1];function +ig(a,b){var +c=a?a[1]:cN;if(eQ(k3[1],0))oV(k3[1]);k3[1]=oU(c,function(a){qW(0);return 0})}var +qX=Ke(0,0,[0,VX,eJ(dn(function(a){return dq(function(a){var +b=a[1];return[0,b,[0,[0,80,bc(0,a[2][2])],0],1]},a[2])},[0,n8(cd),function(c){function +b(a,b){return cc(c,a,b)}return function(a){return b(a,ce)}}],Vk))]);function +VW(a){return cY(d_([3,[0,0,[0,dp(az(k1))],0,0]]),function(b){return cY(d_([4,b]),function(a){function +c(a,b){return hI(b[2][1],a[2][1])}var +d=function(a){return xH(c,a)}(NO[58].call(null,a));ai(VN,[0,b]);ai(qR,d);return qW(0)})})}var +VY=qX[1],VZ=cc(VY,w(qX[2],function(a){ai(k1,a);VW(0);return a}),function(a,b){return a}),V2=pH(0,0,[0,V0],[0,function(a,b){ai(qS,b);var +c=1-a,d=c?(ig(0,0),0):c;return d}],V1)[1],V3=w(ap(k2),function(a){return a[3]}),V5=pH(0,0,0,[0,function(a,b){ai(qV,b);var +c=1-a,d=c?(ig(0,0),0):c;return d}],V4),V9=pJ(0,0,0,[0,function(a,b){ai(qT,b);var +c=1-a,d=c?(ig(V7,0),0):c;return d}],V8,ay(fM(V6))),Wb=pJ(0,0,0,[0,function(a,b){ai(qU,b);var +c=1-a,d=c?(ig(V$,0),0):c;return d}],Wa,ay(fM(V_))),Wd=[0,[0,82,function(a){return Q(0,0,0,0,[0,[0,82,a],0])}(w(V3,function(a){return bc(0,h(v(Wc),a))}))],0],We=[0,[0,82,V9[1]],[0,[0,82,Wb[1]],[0,[0,82,V5[1]],Wd]]],Wg=Q(0,[0,d3(Wf)],0,0,[0,[0,82,VZ],0]),Wi=d3(Wh),Wk=Q(0,[0,Wi],0,0,[0,[0,80,bc(0,Wj)],[0,[0,82,V2],0]]),qY=d3(Wl),Wm=Q(0,[0,qY],0,0,[0,[0,82,Wg],[0,[0,82,Wk],0]]),Wn=Q(0,[0,qY],0,0,We),Wp=Q(0,[0,d3(Wo)],0,0,[0,[0,82,Wm],[0,[0,82,Wn],0]]);function +Wq(a){var +b=function(a){return kE(Wt,Ws,a)}([0,[0,80,bc(0,Wr)],0]),c=function(a){return kE(Ww,Wv,a)}([0,[0,80,bc(0,Wu)],0]);return ay(Fd([0,function(a){return kE(Wz,Wy,a)}([0,[0,80,bc(0,Wx)],0]),c,b]))}function +qZ(g,f,c,d){var +a=d[4],e=cc(US(d),a,function(a,b){return[0,a,0,0,b]});function +j(a,b){return w(ap(k0(gM(a,dp(az(e1)))[1],50,b)),function(a){return F$(S(a))})}var +b=[0,[0,Wq(0)],WB],l=cc(d[2],d[3],function(a,b){return a-b|0});function +k(a,d,c){var +b=c[2],e=b[4][1],f=b[2],i=b[1][1],k=c[1][2],l=w(function(a){return w(a,function(a,b){var +c=a[1];h(g,[0,[0,c[1],a[1][2]+d|0,c[3]],a[2],a[3],a[4]]);return 0})}(a),function(a){return ct(0,ht,a)}),m=j(e,f),n=w(ap(e3),function(a){if(a&&jf(a[1][1][2][1][1],i)){var +b=[0,bc(0,WA),0];return hA(0,[0,[0,cs("playing"),0]],b)}return hA(0,0,[0,bc(0,mN(d+1|0)),0])}),o=[0,[0,80,hA(0,0,[0,Gw(0,0,[0,bc(0,k),0]),0])],0];return[0,[0,82,n],[0,[0,82,Q(0,0,[0,[0,[0,82,l],0]],0,[0,[0,82,Hm(0,[0,[0,[0,82,m],[0,[0,80,Gb(50)],0]]],0,0,0)],0])],o]]}var +m=w(e,function(a,b){return i(f,a,b)});return Kt(b,[0,function(a){return 0}],c,[0,l,m,ay(function(a,b){return k(e,a,b)})])}function +WC(a,b,c){return qZ(a,b,[0,ap(e2)],c)}var +q0=pB(WD,function(a){return kF(0,kP(0))});Sh(az(q0));d_([0,az(q0)]);function +k4(a,b){return d_([5,a[1],a[4],b])}var +k5=Vw([0,k4]),WE=[0,[0,82,Vl(0)],0],WG=[0,[0,80,Gv(0,0,[0,bc(0,WF),0])],WE],WH=Q(0,[0,[0,[0,80,dZ(tu)],0]],0,0,WG),WI=[0,[0,82,k5[3].call(null,0)],0],WJ=Q(0,[0,[0,[0,80,dZ(tu)],0]],0,0,WI),q1=ap(k2),WK=w(q1,function(a){return a[1]}),q2=w(q1,function(a){return a[3]}),WL=cc(q2,ap(qU),function(b){return function(a){return St(b,a)}}),WM=[0,WK,q2,ay(0),WL],WN=qZ(k5[2],k4,0,WM),WP=eJ(w(ap(ie),function(a){if(!a)return o5(0,0,0,0,[0,[0,80,bc(0,WO)],0]);var +b=a[1],c=ay(b[4]),d=ay(b[1][2]),e=ay(b[1][3]),f=[0,ay(b[1][1]),e,d,c];return WC(k5[2],k4,f)})),WQ=w(ap(kY),function(a){return a?hw:cs("display-none")}),WT=w(ap(e3),function(a){function +d(a){return dZ(S(h(v(WR),a)))}if(a)var +b=a[1][1][2],e=b[4][1],f=b[2],c=ap(k0(gM(e,dp(az(e1)))[1],ed,f));else var -c=UP;return dS(S(h(t(UO),c)))}),UR=[0,[0,82,UM],[0,[0,80,cq("big-cover")],0]],US=Q(0,[0,UR],0,0,[0,[0,82,Q(0,[0,[0,[0,82,UQ],0]],0,0,0)],0]),UT=[0,[0,82,Q(0,[0,[0,[0,80,cq("playlist")],0]],0,0,[0,[0,82,UL],0])],[0,[0,82,UF],0]],UU=[0,[0,82,US],[0,[0,82,Uj],[0,[0,82,Q(0,0,0,0,[0,[0,82,UJ],0])],0]]],UV=[0,[0,82,UD],[0,[0,82,Q(0,[0,[0,[0,80,cq("item-list")],0]],0,0,UU)],UT]],UX=Q(0,[0,function(a){return pm(UW,a)}(pn(0))],0,0,UV),UY=Ir(Is(j7));dR(0,Fl,function(a){b9([0,UZ,[0,UY,0]]);var -b=g0(0,UX),c=[0,dg(b),0];FT(F$(dT),c);return g1(b,function(a){Gl(function(a){dg(b);return 0});return 0})},Gh(oA));iT(0);return}(globalThis)); +c=ay(WS);return od(c,d)}),WU=[0,[0,82,WQ],[0,[0,80,cs("big-cover")],0]],WV=Q(0,[0,WU],0,0,[0,[0,82,Q(0,[0,[0,[0,82,eJ(WT)],0]],0,0,0)],0]),WW=[0,[0,82,Q(0,[0,[0,[0,80,cs("playlist")],0]],0,0,[0,[0,82,WP],0])],[0,[0,82,WJ],0]],WX=[0,[0,82,WV],[0,[0,82,Wp],[0,[0,82,Q(0,0,0,0,[0,[0,82,WN],0])],0]]],WY=[0,[0,82,WH],[0,[0,82,Q(0,[0,[0,[0,80,cs("item-list")],0]],0,0,WX)],WW]],W0=Q(0,[0,function(a){return pC(WZ,a)}(pD(0))],0,0,WY),W1=Jh(Ji(kn));cZ(0,FI,function(a){c0([0,W2,[0,W1,0]]);var +b=ha(0,W0),c=[0,dm(b),0];Gf(Gx(d0),c);return hb(b,function(a){GK(function(a){dm(b);return 0});return 0})},GG(oT));i_(0);return}(globalThis)); diff --git a/vtable/main.bc.js b/vtable/main.bc.js index f7c560e..7e84549 100644 --- a/vtable/main.bc.js +++ b/vtable/main.bc.js @@ -1,38 +1,40 @@ // Generated by js_of_ocaml -//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.8.2+5.8.2 +//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.9.0+5.9.0 (function(a){typeof globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:true,get:b}),_T_));function b(){var b=this||self;b.globalThis=b;delete -a.prototype._T_}}(Object));(function(m){"use strict";var -bj=3850876,am=" ",R="0",ez="compare: functional value",ey="mkdir",bR=1000,M="vendor/lwd/lib/lwd/lwd_seq.pp.ml",ia="@[",h$="window",iy="console",ax="int_of_string",eo="fs",hW="%u",h_="/static/",hx="%i",ix="%ni",aw=0xff,h9="Assert_failure",hw="0x",hV=0x7ff0,iw=218,hv=0xdfff,hU="End_of_file",h8="OCAMLRUNPARAM",hu=": closedir failed",h7=253,iu=19067,iv="Out_of_memory",ht="Not_found",eC="Failure",cU="Unix.Unix_error",hs="style",bl=244,hT="^",it="length",eu="ENOTDIR",h6="Lwd_seq.rank: node is marked",hr="%Li",hq="Invalid_argument",cO=254,bk="+",cP="Set.bal",is=", characters ",al=0xffffff,hS=858694086,h5=120,h4=1027,bQ=1024,cT="Map.bal",bm=246,hR="Pervasives.do_at_exit",h3=389604418,hQ=65536,et=0xf,hp=", ",en=512,iq="Match_failure",ir="closedir",hn="%li",ho=1026,em="nan",e="",el="rmdir",ex="Fatal error: exception ",hP="infinity",C="camlinternalFormat.ml",hN=571,hO="fd ",io="append",ip=": ",hm=174,c=248,hM="em",im=0xe0,aK=24029,hL=0xf0,hK="Sys_error",ad=0x80,h2="ENOTEMPTY",il="EEXIST",ew=1255,ek=" : flags Open_text and Open_binary are not compatible",ik="px",es="e",ej=": Not a directory",er="ENOENT",h1="Stack_overflow",ij="Undefined_recursive_module",ii=2147483647,ag=0x8000,h0="a",hJ=0x800,hZ=-48,hl=" : is a directory",hH="@{",hI="Division_by_zero",hk="classList",aJ=".",hG="(Program not linked with -g, cannot print stack backtrace)\n",aL=0x3f,eq=" : file already exists",bP=128,cS=": No such file or directory",hE="vendor/lwd/lib/brr-lwd/elwd.ml",hF=255,cN="lwd-to-remove",cR=256,ep=100,hD="id",ei="index out of bounds",an="/",cM=252,ih="height: ",hj="lwdui-virtual-table-row",eh="%d",hi=": file descriptor already closed",aY="-",eg="EBADF",hC=-97,ig="Printexc.handle_uncaught_exception",hh=12520,eB=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",hY="Fatal error: exception %s\n",ie="class",aI=250,hB=199,id=">",hA="([^/]+)",hz=759637122,ev="jsError",hg=103,cL='"',eA=127,ah=0xffff,hf=0xdc00,hy="documentElement",ic="Sys_blocked_io",b="vendor/lwd/lib/lwd/lwd.ml",ib="_",hX="rem",cQ="_bigarr02";function -to(a,b,c,d,e){if(d<=b)for(var +a.prototype._T_}}(Object));(function(c){"use strict";var +bj=3850876,am=" ",R="0",ez="compare: functional value",ey="mkdir",bR=1000,M="vendor/lwd/lib/lwd/lwd_seq.pp.ml",ia="@[",h$="window",iy="console",ax="int_of_string",hW="%u",h_="/static/",eD="node:fs",hx="%i",ix="%ni",an=0xff,h9="Assert_failure",hw="0x",hV=0x7ff0,iw=218,hv=0xdfff,hU="End_of_file",h8="OCAMLRUNPARAM",hu=": closedir failed",h7=253,iu=19067,iv="Out_of_memory",ht="Not_found",eC="Failure",cU="Unix.Unix_error",hs="style",bl=244,hT="^",it="length",eu="ENOTDIR",h6="Lwd_seq.rank: node is marked",hr="%Li",hq="Invalid_argument",cP=254,bk="+",cQ="Set.bal",is=", characters ",al=0xffffff,hS=858694086,h5=120,h4=1027,bQ=1024,cT="Map.bal",bm=246,hR="Pervasives.do_at_exit",h3=389604418,hQ=65536,et=0xf,hp=", ",eo=512,iq="Match_failure",ir="closedir",hn="%li",ho=1026,en="nan",e="",em="rmdir",ex="Fatal error: exception ",hP="infinity",C="camlinternalFormat.ml",hN=571,hO="fd ",io="append",ip=": ",hm=174,r=248,hM="em",im=0xe0,aK=24029,hL=0xf0,hK="Sys_error",ae=0x80,h2="ENOTEMPTY",il="EEXIST",ew=1255,el=" : flags Open_text and Open_binary are not compatible",ik="px",es="e",ek=": Not a directory",er="ENOENT",h1="Stack_overflow",ij="Undefined_recursive_module",ii=2147483647,ah=0x8000,h0="a",hJ=0x800,hZ=-48,hl=" : is a directory",hH="@{",hI="Division_by_zero",hk="classList",aJ=".",hG="(Program not linked with -g, cannot print stack backtrace)\n",aL=0x3f,eq=" : file already exists",bP=128,bS=": No such file or directory",hE="vendor/lwd/lib/brr-lwd/elwd.ml",hF=255,cO="lwd-to-remove",cS=256,ep=100,hD="id",ej="index out of bounds",aw="/",cN=252,ih="height: ",hj="lwdui-virtual-table-row",ei="%d",hi=": file descriptor already closed",aY="-",eh="EBADF",hC=-97,ig="Printexc.handle_uncaught_exception",hh=12520,eB=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",hY="Fatal error: exception %s\n",ie="class",aI=250,hB=199,id=">",hA="([^/]+)",hz=759637122,ev="jsError",hg=103,cM='"',eA=127,ai=0xffff,hf=0xdc00,hy="documentElement",ic="Sys_blocked_io",b="vendor/lwd/lib/lwd/lwd.ml",ib="_",hX="rem",cR="_bigarr02";function +tp(a,b,c,d,e){if(d<=b)for(var f=1;f<=e;f++)c[d+f]=a[b+f];else for(var f=e;f>=1;f--)c[d+f]=a[b+f];return 0}function -tp(a,b,c){var +tr(a,b,c){var d=new Array(c+1);d[0]=0;for(var e=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function -eD(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function -tq(a,b){var +eE(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function +ts(a,b){var c=a[1];a[1]+=b;return c}function -eE(a){return a[1]}function -jb(a){var -b=m.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(m.jsoo_static_env&&m.jsoo_static_env[a])return m.jsoo_static_env[a]}var -eX=0;(function(){var +eF(a){return a[1]}var +ja={};function +jb(a){if(ja[a])return ja[a];var +b=c.process;if(b&&b.env&&b.env[a]!==undefined)return b.env[a];if(c.jsoo_env&&typeof +c.jsoo_env[a]==="string")return c.jsoo_env[a]}var +c9=0;(function(){var c=jb(h8);if(c!==undefined){var b=c.split(",");for(var -a=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new @@ -70,68 +72,66 @@ d(b,c,e)};d.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new d(b,c,e)};d.prototype.mul=function(a){var b=this.lo*a.lo,c=(b*iS|0)+this.mi*a.lo+this.lo*a.mi,e=(c*iS|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -d(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new +d(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)===0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new d(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new d(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new -d(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new +d(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a===0)return this;if(a<24)return new d(this.lo<>24-a,this.hi<>24-a);if(a<48)return new d(0,this.lo<>48-a);return new -d(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new d(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -d(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +d(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a===0)return this;var c=this.hi<<16>>16;if(a<24)return new d(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -d(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&ah);return new +d(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&ai);return new d(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&al;this.lo=this.lo<<1&al};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&al;this.mi=(this.mi>>>1|this.hi<<23)&al;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var e=0,c=this.copy(),b=a.copy(),f=new d(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var -b=this;if(a.isZero())i8();var -d=b.hi^a.hi;if(b.hi&ag)b=b.neg();if(a.hi&ag)a=a.neg();var -c=b.udivmod(a).quotient;if(d&ag)c=c.neg();return c};d.prototype.mod=function(a){var -b=this;if(a.isZero())i8();var -d=b.hi;if(b.hi&ag)b=b.neg();if(a.hi&ag)a=a.neg();var -c=b.udivmod(a).modulus;if(d&ag)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&aw,this.mi>>16,this.mi>>8&aw,this.mi&aw,this.lo>>16,this.lo>>8&aw,this.lo&aw]};d.prototype.lo32=function(){return this.lo|(this.mi&aw)<<24};d.prototype.hi32=function(){return this.mi>>>8&ah|this.hi<<16};function -tS(a,b){return new -d(a&al,a>>>24&aw|(b&ah)<<8,b>>>16&ah)}function -eQ(a){return a.hi32()}function -eR(a){return a.lo32()}function -bT(){A(ei)}var -ts=cQ;function -aM(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}aM.prototype.caml_custom=ts;aM.prototype.offset=function(a){var +b=this;if(a.isZero())i7();var +d=b.hi^a.hi;if(b.hi&ah)b=b.neg();if(a.hi&ah)a=a.neg();var +c=b.udivmod(a).quotient;if(d&ah)c=c.neg();return c};d.prototype.mod=function(a){var +b=this;if(a.isZero())i7();var +d=b.hi;if(b.hi&ah)b=b.neg();if(a.hi&ah)a=a.neg();var +c=b.udivmod(a).modulus;if(d&ah)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&an,this.mi>>16,this.mi>>8&an,this.mi&an,this.lo>>16,this.lo>>8&an,this.lo&an]};d.prototype.lo32=function(){return this.lo|(this.mi&an)<<24};d.prototype.hi32=function(){return this.mi>>>8&ai|this.hi<<16};function +tU(a,b){return new +d(a&al,a>>>24&an|(b&ai)<<8,b>>>16&ai)}function +eR(a){return a.hi32()}function +eS(a){return a.lo32()}function +bU(){A(ej)}var +tu=cR;function +aM(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}aM.prototype.caml_custom=tu;aM.prototype.offset=function(a){var c=0;if(typeof -a==="number")a=[a];if(!(a -instanceof -Array))A("bigarray.js: invalid offset");if(this.dims.length!=a.length)A("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -b=0;b=this.dims[b])bT();c=c*this.dims[b]+a[b]}else +a==="number")a=[a];if(!Array.isArray(a))A("bigarray.js: invalid offset");if(this.dims.length!==a.length)A("Bigarray.get/set: bad number of dimensions");if(this.layout===0)for(var +b=0;b=this.dims[b])bU();c=c*this.dims[b]+a[b]}else for(var -b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])bT();c=c*this.dims[b]+(a[b]-1)}return c};aM.prototype.get=function(a){switch(this.kind){case +b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])bU();c=c*this.dims[b]+(a[b]-1)}return c};aM.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return tS(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return tU(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[cO,e,c];default:return this.data[a]}};aM.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=eR(b);this.data[a*2+1]=eQ(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[cP,e,c];default:return this.data[a]}};aM.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=eS(b);this.data[a*2+1]=eR(b);break;case 10:case 11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};aM.prototype.fill=function(a){switch(this.kind){case 7:var -c=eR(a),e=eQ(a);if(c==e)this.data.fill(c);else +c=eS(a),e=eR(a);if(c===e)this.data.fill(c);else for(var -b=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case +c=0;ce)return 1;if(d!==e){if(!b)return Number.NaN;if(!Number.isNaN(d))return 1;if(!Number.isNaN(e))return-1}}break;case 7:for(var c=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case 2:case @@ -145,73 +145,75 @@ c=0;ca.data[c])return 1}break}return 0};function bn(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bn.prototype=new aM();bn.prototype.offset=function(a){if(typeof -a!=="number")if(a -instanceof -Array&&a.length==1)a=a[0];else -A("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])bT();return a};bn.prototype.get=function(a){return this.data[a]};bn.prototype.set=function(a,b){this.data[a]=b;return 0};bn.prototype.fill=function(a){this.data.fill(a);return 0};function -eF(a,b,c,d){var -e=iD(a);if(cW(c)*e!=d.length)A("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new +a!=="number")if(Array.isArray(a)&&a.length===1)a=a[0];else +A("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])bU();return a};bn.prototype.get=function(a){return this.data[a]};bn.prototype.set=function(a,b){this.data[a]=b;return 0};bn.prototype.fill=function(a){this.data.fill(a);return 0};function +eG(a,b,c,d){var +e=iD(a);if(cW(c)*e!==d.length)A("length doesn't match dims");if(b===0&&c.length===1&&e===1)return new bn(a,b,c,d);return new aM(a,b,c,d)}function iX(a){return a.slice(1)}function -tr(a,b,c){var -d=iX(c),e=iB(a,cW(d));return eF(a,b,d,e)}function -bU(a,b,c){a.set(a.offset(b),c);return 0}function -b1(a,b,c){var -d=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var +tt(a,b,c){var +d=iX(c),e=iB(a,cW(d));return eG(a,b,d,e)}function +bV(a,b,c){a.set(a.offset(b),c);return 0}function +b2(a,b,c){var +d=String.fromCharCode;if(b===0&&c<=4096&&c===a.length)return d.apply(null,a);var f=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?b1(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?b1(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)c0(c);var -g=a.c,h=c.c;if(a.t==4)if(d<=b)for(var +aN(a,b,c,d,e){if(e===0)return 0;if(d===0&&(e>=c.l||c.t===2&&e>=c.c.length)){c.c=a.t===4?b2(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else if(c.t===2&&d===c.c.length){c.c+=a.t===4?b2(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else{if(c.t!==4)c0(c);var +g=a.c,h=c.c;if(a.t===4)if(d<=b)for(var f=0;f=0;f--)h[d+f]=g[b+f];else{var i=Math.min(e,g.length-b);for(var f=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function -bX(a){if(a.t==2)a.c+=br(a.l-a.c.length,"\0");else -a.c=b1(a.c,0,a.c.length);a.t=0}function +br(a,b){if(a===0)return e;if(b.repeat)return b.repeat(a);var +d=e,c=0;for(;;){if(a&1)d+=b;a>>=1;if(a===0)return d;b+=b;c++;if(c===9)b.slice(0,1)}}function +bY(a){if(a.t===2)a.c+=br(a.l-a.c.length,"\0");else +a.c=b2(a.c,0,a.c.length);a.t=0}function e0(a){if(a.length<24){for(var b=0;beA)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -i$(a){for(var -k=e,d=e,h,g,i,b,c=0,j=a.length;cen){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else -d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>ah)d+=String.fromCharCode(0xd7c0+(b>>10),hf+(b&0x3FF));else -d+=String.fromCharCode(b);if(d.length>bQ){d.substr(0,1);k+=d;d=e}}return k+d}function +i_(a){for(var +k=e,d=e,h,g,i,b,c=0,j=a.length;ceo){d.slice(0,1);k+=d;d=e;k+=a.slice(c,f)}else +d+=a.slice(c,f);if(f===j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>ai)d+=String.fromCharCode(0xd7c0+(b>>10),hf+(b&0x3ff));else +d+=String.fromCharCode(b);if(d.length>bQ){d.slice(0,1);k+=d;d=e}}return k+d}function ay(a,b,c){this.t=a;this.c=b;this.l=c}ay.prototype.toString=function(){switch(this.t){case -9:return this.c;default:bX(this);case -0:if(e0(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};ay.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return i$(a)};ay.prototype.slice=function(){var -a=this.t==4?this.c.slice():this.c;return new +9:case +8:return this.c;case +4:case +2:bY(this);case +0:if(e0(this.c))this.t=9;else +this.t=8;return this.c}};ay.prototype.toUtf16=function(){var +a=this.toString();if(this.t===9)return a;return i_(a)};ay.prototype.slice=function(){var +a=this.t===4?this.c.slice():this.c;return new ay(this.t,a,this.l)};function iG(a){return new ay(0,a,a.length)}function ap(a){return a}function a0(a){return iG(ap(a))}function -bV(a,b,c,d,e){aN(a0(a),b,c,d,e);return 0}function +bW(a,b,c,d,e){aN(a0(a),b,c,d,e);return 0}function bo(a){return new d(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function -cX(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +cX(a,b){switch(a.t&6){case 0:return a.c.charCodeAt(b);case +2:if(b>=a.c.length)return 0;return a.c.charCodeAt(b);case 4:return a.c[b]}}function -eG(){A(ei)}function -tw(a,b){if(b>>>0>=a.l-7)eG();var +eH(){A(ej)}function +ty(a,b){if(b>>>0>=a.l-7)eH();var d=new Array(8);for(var c=0;c<8;c++)d[7-c]=cX(a,b+c);return bo(d)}function -v(a,b,c){c&=aw;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}c0(a)}a.c[b]=c;return 0}function -az(a,b,c){if(b>>>0>=a.l)eG();return v(a,b,c)}function +v(a,b,c){c&=an;if(a.t!==4){if(b===a.c.length){a.c+=String.fromCharCode(c);if(b+1===a.l)a.t=0;return 0}c0(a)}a.c[b]=c;return 0}function +az(a,b,c){if(b>>>0>=a.l)eH();return v(a,b,c)}function bp(a){return a.toArray()}function -tx(a,b,c){if(b>>>0>=a.l-7)eG();var +tz(a,b,c){if(b>>>0>=a.l-7)eH();var e=bp(c);for(var d=0;d<8;d++)v(a,b+7-d,e[d]);return 0}function aO(d,c){var -f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var +f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b===0)return d.apply(null,c);else if(b<0){var a=d.apply(null,c.slice(0,f));if(typeof a!=="function")return a;return aO(a,c.slice(f))}else{switch(b){case 1:{var @@ -225,32 +227,32 @@ g=new Array(e+2);for(var f=0;f>>0>=a.length-1)bT();return a}function -ty(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -iW(a){return a==245?1:0}var -uv=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -uu(a){if(uv)return Math.floor(Math.log2(a));var -b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else +j(a,b){if(b>>>0>=a.length-1)bU();return a}function +tA(a){if(Number.isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!==0)return 1;return 2}return Number.isNaN(a)?4:3}function +iW(a){return a===245?1:0}var +uA=Math.log2&&Math.log2(1.1235582092889474e307)===1020;function +uz(a){if(uA)return Math.floor(Math.log2(a));var +b=0;if(a===0)return Number.NEGATIVE_INFINITY;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -eN(a){var +eO(a){var b=new Float32Array(1);b[0]=a;var c=new Int32Array(b.buffer);return c[0]|0}function -_(a,b,c){return new +Z(a,b,c){return new d(a,b,c)}function -c3(a){if(!isFinite(a)){if(isNaN(a))return _(1,0,hV);return a>0?_(0,0,hV):_(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?ag:a>=0?0:ag;if(f)a=-a;var -b=uu(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-ho)}else{a/=Math.pow(2,b-h4);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +c3(a){if(!Number.isFinite(a)){if(Number.isNaN(a))return Z(1,0,hV);return a>0?Z(0,0,hV):Z(0,0,0xfff0)}var +f=a===0&&1/a===Number.NEGATIVE_INFINITY?ah:a>=0?0:ah;if(f)a=-a;var +b=uz(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-ho)}else{a/=Math.pow(2,b-h4);if(a<16){a*=2;b-=1}if(b===0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&et|f|b<<4;return _(g,e,c)}function -iF(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==cQ)for(var -d=0;d>4;if(d==2047)return(f|g|c&et)==0?c&ag?-Infinity:Infinity:NaN;var +eQ(a){var +f=a.lo,g=a.mi,c=a.hi,d=(c&0x7fff)>>4;if(d===2047)return(f|g|c&et)===0?c&ah?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY:Number.NaN;var e=Math.pow(2,-24),b=(f*e+g)*e+(c&et);if(d>0){b+=16;b*=Math.pow(2,d-h4)}else -b*=Math.pow(2,-ho);if(c&ag)b=-b;return b}function -I(a){if(!J.Failure)J.Failure=[c,U(eC),-3];eW(J.Failure,a)}function +b*=Math.pow(2,-ho);if(c&ah)b=-b;return b}function +J(a){if(!G.Failure)G.Failure=[r,_(eC),-3];eX(G.Failure,a)}function iC(a,b,c){var -k=a.read32s();if(k<0||k>16)I("input_value: wrong number of bigarray dimensions");var -r=a.read32s(),l=r&aw,q=r>>8&1,j=[];if(c==cQ)for(var +k=a.read32s();if(k<0||k>16)J("input_value: wrong number of bigarray dimensions");var +r=a.read32s(),l=r&an,q=r>>8&1,j=[];if(c===cR)for(var d=0;d>>32-15;b=bq(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function -tN(a,b){a=K(a,eR(b));a=K(a,eQ(b));return a}function -eL(a,b){return tN(a,c3(b))}function +tP(a,b){a=K(a,eS(b));a=K(a,eR(b));return a}function +eM(a,b){return tP(a,c3(b))}function iE(a){var c=cW(a.dims),d=0;switch(a.kind){case 2:case 3:case -12:if(c>cR)c=cR;var +12:if(c>cS)c=cS;var e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=K(d,e)}e=0;switch(c&3){case 3:e=a.data[b+2]<<16;case 2:e|=a.data[b+1]<<8;case 1:e|=a.data[b+0];d=K(d,e)}break;case 4:case 5:if(c>bP)c=bP;var -e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=K(d,e)}if((c&1)!=0)d=K(d,a.data[b]);break;case +e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=K(d,e)}if((c&1)!==0)d=K(d,a.data[b]);break;case 6:if(c>64)c=64;for(var b=0;b64)c=64;for(var -b=0;b32)c=32;for(var -b=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function +f=eJ(b);if(f){var +e=c>0?f(b,a,d):f(a,b,d);if(d&&Number.isNaN(e))return c;if(Number.isNaN(+e))return+e;if((e|0)!==0)return e|0}return c}function c5(a){return typeof a==="string"&&!/[^\x00-\xff]/.test(a)}function c4(a){return a instanceof ay}function iI(a){if(typeof -a==="number")return bR;else if(c4(a))return cM;else if(c5(a))return 1252;else if(a -instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=hF){var -b=a[0]|0;return b==cO?0:b}else if(a +a==="number")return bR;else if(c4(a))return cN;else if(c5(a))return 1252;else if(Array.isArray(a)&&a[0]===a[0]>>>0&&a[0]<=hF){var +b=a[0]|0;return b===cP?0:b}else if(a instanceof String)return hh;else if(typeof -a=="string")return hh;else if(a +a==="string")return hh;else if(a instanceof Number)return bR;else if(a&&a.caml_custom)return ew;else if(a&&a.compare)return 1256;else if(typeof -a=="function")return 1247;else if(typeof -a=="symbol")return 1251;return 1001}function -iV(a,b){if(ab?1:0}function -tv(a,b){a.t&6&&bX(a);b.t&6&&bX(b);return a.cb.c?1:0}function +a==="function")return 1247;else if(typeof +a==="symbol")return 1251;return 1001}function +iV(a,b){if(ab?1:0}function +tx(a,b){a.t&6&&bY(a);b.t&6&&bY(b);return a.cb.c?1:0}function cZ(a,b,c){var f=[];for(;;){if(!(c&&a===b)){var -e=iI(a);if(e==aI){a=a[1];continue}var -g=iI(b);if(g==aI){b=b[1];continue}if(e!==g){if(e==bR){if(g==ew)return iH(a,b,-1,c);return-1}if(g==bR){if(e==ew)return iH(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case -1001:if(ab)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case -1251:if(a!==b){if(!c)return NaN;return 1}break;case +d=a.compare(b,c);if(Number.isNaN(d))return c?-1:d;if(d!==(d|0))return-1;if(d!==0)return d|0;break;case +1000:a=+a;b=+b;if(ab)return 1;if(a!==b){if(!c)return Number.NaN;if(!Number.isNaN(a))return 1;if(!Number.isNaN(b))return-1}break;case +1001:if(ab)return 1;if(a!==b)return c?1:Number.NaN;break;case +1251:if(a!==b)return c?1:Number.NaN;break;case 1252:var a=ap(a),b=ap(b);if(a!==b){if(ab)return 1}break;case 12520:var -a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case -246:case -254:default:if(iW(e)){A("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var +a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;default:if(iW(e)){A("compare: continuation value");break}if(a.length!==b.length)return a.length1)f.push(a,b,1);break}}if(f.length===0)return 0;var h=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=br(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)c0(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var -c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;I("float_of_string")}function -eV(a){a=ap(a);var +tE(a){c1=a}function +iK(a,b){return+(cZ(a,b,false)===0)}function +tG(a,b,c,d){if(c>0)if(b===0&&(c>=a.l||a.t===2&&c>=a.c.length))if(d===0){a.c=e;a.t=2}else{a.c=br(c,String.fromCharCode(d));a.t=c===a.l?0:2}else{if(a.t!==4)c0(a);for(c+=b;b31)A("format_int: format too long");var b={justify:bk,signstyle:aY,filler:am,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var d=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function -eJ(a,b){if(a.uppercase)b=b.toUpperCase();var -f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=aY))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var -c=e;if(a.justify==bk&&a.filler==am)for(var -d=f;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;break;case"d":case"i":b.signedconv=true;b.base=10;break;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function +eK(a,b){if(a.uppercase)b=b.toUpperCase();var +f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!==aY))f++;if(a.alternate){if(a.base===8)f+=1;if(a.base===16)f+=2}var +c=e;if(a.justify===bk&&a.filler===am)for(var +d=f;d20){c-=20;a/=Math.pow(10,c);a+=new +c=Number.parseInt(a.toString().split(bk)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new Array(c+1).join(R);if(b>0)a=a+aJ+new Array(b+1).join(R);return a}else return a.toFixed(b)}}var -c,f=eV(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=em;f.filler=am}else if(!isFinite(b)){c="inf";f.filler=am}else +c,f=eW(a),e=f.prec<0?6:f.prec;if(b<0||b===0&&1/b===Number.NEGATIVE_INFINITY){f.sign=-1;b=-b}if(Number.isNaN(b)){c=en;f.filler=am}else if(!Number.isFinite(b)){c="inf";f.filler=am}else switch(f.conv){case"e":var -c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==es)c=c.slice(0,d-1)+R+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var +c=b.toExponential(e),d=c.length;if(c.charAt(d-3)===es)c=c.slice(0,d-1)+R+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var i=c.indexOf(es),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var -d=i-1;while(c.charAt(d)==R)d--;if(c.charAt(d)==aJ)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==es)c=c.slice(0,d-1)+R+c.slice(d-1);break}else{var +d=i-1;while(c.charAt(d)===R)d--;if(c.charAt(d)===aJ)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)===es)c=c.slice(0,d-1)+R+c.slice(d-1);break}else{var g=e;if(h<0){g-=h+1;c=b.toFixed(g)}else while(c=b.toFixed(g),c.length>e+1)g--;if(g){var -d=c.length-1;while(c.charAt(d)==R)d--;if(c.charAt(d)==aJ)d--;c=c.slice(0,d+1)}}break}return eJ(f,c)}function -c2(a,b){if(ap(a)==eh)return U(e+b);var -c=eV(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else +d=c.length-1;while(c.charAt(d)===R)d--;if(c.charAt(d)===aJ)d--;c=c.slice(0,d+1)}}break}return eK(f,c)}function +c2(a,b){if(ap(a)===ei)return _(e+b);var +c=eW(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else b>>>=0;var d=b.toString(c.base);if(c.prec>=0){c.filler=am;var -f=c.prec-d.length;if(f>0)d=br(f,R)+d}return eJ(c,d)}var -ui=0;function -ao(){return ui++}function -S(a){if(e0(a))return a;return i$(a)}function -b2(){return typeof -m.process!=="undefined"&&typeof -m.process.versions!=="undefined"&&typeof -m.process.versions.node!=="undefined"}function -uw(){function -a(a){if(a.charAt(0)===an)return[e,a.substring(1)];return}function +f=c.prec-d.length;if(f>0)d=br(f,R)+d}return eK(c,d)}var +um=0;function +ao(){return um++}function +S(a){if(e0(a))return a;return i_(a)}function +b3(){return typeof +c.process!=="undefined"&&typeof +c.process.versions!=="undefined"&&typeof +c.process.versions.node!=="undefined"}function +uB(){function +a(a){if(a.charAt(0)===aw)return[e,a.slice(1)];return}function b(a){var -h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==":");if(Boolean(b[2]||f)){var -d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return b2()&&m.process&&m.process.platform?m.process.platform==="win32"?b:a:a}var -e1=uw();function -i_(a){return a.slice(-1)!==an?a+an:a}if(b2()&&m.process&&m.process.cwd)var -bY=m.process.cwd().replace(/\\/g,an);else +h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=c.length>0&&c.charAt(1)!==":";if(b[2]||f){var +d=b[1]||e,g=b[2]||e;return[d,a.slice(d.length+g.length)]}return}return b3()&&c.process&&c.process.platform?c.process.platform==="win32"?b:a:a}var +e1=uB();function +i9(a){return a.slice(-1)!==aw?a+aw:a}if(b3()&&c.process&&c.process.cwd)var +bZ=c.process.cwd().replace(/\\/g,aw);else var -bY="/static";bY=i_(bY);function -t_(a){a=S(a);if(!e1(a))a=bY+a;var -e=e1(a),d=e[1].split(an),b=[];for(var +bZ="/static";bZ=i9(bZ);function +uc(a){a=S(a);if(!e1(a))a=bZ+a;var +e=e1(a),d=e[1].split(/[/\\]/),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -ut(a){for(var -g=e,c=g,b,i,d=0,h=a.length;den){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else -c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(ad|b&aL)}else if(b<0xd800||b>=hv)c+=String.fromCharCode(im|b>>12,ad|b>>6&aL,ad|b&aL);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))hv)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(hL|b>>18,ad|b>>12&aL,ad|b>>6&aL,ad|b&aL)}if(c.length>bQ){c.substr(0,1);g+=c;c=e}}return g+c}function -ak(a){return e0(a)?U(a):U(ut(a))}var -ux=["E2BIG","EACCES","EAGAIN",eg,"EBUSY","ECHILD","EDEADLK","EDOM",il,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",er,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",eu,h2,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function +uy(a){for(var +g=e,c=g,b,i,d=0,h=a.length;deo){c.slice(0,1);g+=c;c=e;g+=a.slice(d,f)}else +c+=a.slice(d,f);if(f===h)break;d=f}if(b>6);c+=String.fromCharCode(ae|b&aL)}else if(b<0xd800||b>=hv)c+=String.fromCharCode(im|b>>12,ae|b>>6&aL,ae|b&aL);else if(b>=0xdbff||d+1===h||(i=a.charCodeAt(d+1))hv)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(hL|b>>18,ae|b>>12&aL,ae|b>>6&aL,ae|b&aL)}if(c.length>bQ){c.slice(0,1);g+=c;c=e}}return g+c}function +$(a){return e0(a)?_(a):_(uy(a))}var +uC=["E2BIG","EACCES","EAGAIN",eh,"EBUSY","ECHILD","EDEADLK","EDOM",il,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",er,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",eu,h2,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function aB(a,b,c,d){var -f=ux.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var -g=[f,ak(b||e),ak(c||e)];return g}var +f=uC.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var +g=[f,$(b||e),$(c||e)];return g}var i3={};function aQ(a){return i3[a]}function aA(a,b){throw g([0,a].concat(b))}function -eH(a){if(!(a +eI(a){if(!(a instanceof Uint8Array))a=new Uint8Array(a);return new ay(4,a,a.length)}function -l(a){eW(J.Sys_error,a)}function -i7(a){l(a+cS)}function -eZ(a){if(a.t!=4)c0(a);return a.c}function +k(a){eX(G.Sys_error,a)}function +i6(a){k(a+bS)}function +eZ(a){if(a.t!==4)c0(a);return a.c}function aq(a){return a.l}function iz(){}function N(a){this.data=a}N.prototype=new iz();N.prototype.constructor=N;N.prototype.truncate=function(a){var b=this.data;this.data=F(a|0);aN(b,0,this.data,0,a)};N.prototype.length=function(){return aq(this.data)};N.prototype.write=function(a,b,c,d){var e=this.length();if(a+d>=e){var -f=F(a+d),g=this.data;this.data=f;aN(g,0,this.data,0,e)}aN(eH(b),c,this.data,a,d);return 0};N.prototype.read=function(a,b,c,d){var +f=F(a+d),g=this.data;this.data=f;aN(g,0,this.data,0,e)}aN(eI(b),c,this.data,a,d);return 0};N.prototype.read=function(a,b,c,d){var e=this.length();if(a+d>=e)d=e-a;if(d){var f=F(d|0);aN(this.data,a,f,0,d);b.set(eZ(f),c)}return d};function -aZ(a,b,c){this.file=b;this.name=a;this.flags=c}aZ.prototype.err_closed=function(){l(this.name+hi)};aZ.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};aZ.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};aZ.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};aZ.prototype.close=function(){this.file=undefined};function +aZ(a,b,c){this.file=b;this.name=a;this.flags=c}aZ.prototype.err_closed=function(){k(this.name+hi)};aZ.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};aZ.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};aZ.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};aZ.prototype.close=function(){this.file=undefined};function E(a,b){this.content={};this.root=a;this.lookupFun=b}E.prototype.nm=function(a){return this.root+a};E.prototype.create_dir_if_needed=function(a){var -d=a.split(an),c=e;for(var -b=0;b>>16;a=bq(a,0x85ebca6b|0);a^=a>>>13;a=bq(a,0xc2b2ae35|0);a^=a>>>16;return a}function -tJ(a,b,c,d){var -j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cR)h=cR;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(bZ[e.caml_custom]&&bZ[e.caml_custom].hash){var -n=bZ[e.caml_custom].hash(e);f=K(f,n);g--}}else if(e -instanceof -Array&&e[0]===(e[0]|0))switch(e[0]){case +uf(a){switch(a.t&6){case +2:bY(a);return a.c;default:return a.c}}function +tM(a,b){var +c=uf(b);return typeof +c==="string"?eN(a,c):tN(a,c)}function +tO(a){a^=a>>>16;a=bq(a,0x85ebca6b|0);a^=a>>>13;a=bq(a,0xc2b2ae35|0);a^=a>>>16;return a}function +tL(a,b,c,d){var +j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cS)h=cS;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(b0[e.caml_custom]&&b0[e.caml_custom].hash){var +n=b0[e.caml_custom].hash(e);f=K(f,n);g--}}else if(Array.isArray(e)&&e[0]===(e[0]|0))switch(e[0]){case 248:f=K(f,e[2]);g--;break;case 250:j[--k]=e[1];break;default:if(iW(e[0]))break;var -o=e.length-1<<10|e[0];f=K(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(c4(e)){f=tK(f,e);g--}else if(c5(e)){f=tO(f,e);g--}else if(typeof -e==="string"){f=eM(f,e);g--}else if(e===(e|0)){f=K(f,e+e+1);g--}else if(typeof -e==="number"){f=eL(f,e);g--}}f=tM(f);return f&0x3FFFFFFF}function -tP(a,b,c){if(!isFinite(a)){if(isNaN(a))return ak(em);return ak(a>0?hP:"-infinity")}var -k=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var -f=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else +o=e.length-1<<10|e[0];f=K(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(c4(e)){f=tM(f,e);g--}else if(c5(e)){f=tQ(f,e);g--}else if(typeof +e==="string"){f=eN(f,e);g--}else if(e===(e|0)){f=K(f,e+e+1);g--}else if(typeof +e==="number"){f=eM(f,e);g--}}f=tO(f);return f&0x3fffffff}function +tR(a,b,c){if(!Number.isFinite(a)){if(Number.isNaN(a))return $(en);return $(a>0?hP:"-infinity")}var +k=a===0&&1/a===Number.NEGATIVE_INFINITY?1:a>=0?0:1;if(k)a=-a;var +f=0;if(a===0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else while(a>=2){a/=2;f++}var l=f<0?e:bk,g=e;if(k)g=aY;else switch(c){case @@ -680,37 +671,37 @@ i=Math.pow(2,b*4);a=Math.round(a*i)/i}var d=a.toString(16);if(b>=0){var j=d.indexOf(aJ);if(j<0)d+=aJ+br(b,R);else{var h=j+1+b;if(d.length>24&al,a>>31&ah)}function +d=d.slice(0,h)}}return $(g+hw+d+"p"+l+f.toString(10))}function +tY(a){return+a.isZero()}function +b1(a){return new +d(a&al,a>>24&al,a>>31&ai)}function iU(a){return a.toInt()}function -tV(a){return+a.isNeg()}function +tX(a){return+a.isNeg()}function iQ(a){return a.neg()}function -tT(a,b){var -c=eV(a);if(c.signedconv&&tV(b)){c.sign=-1;b=iQ(b)}var -d=e,i=b0(c.base),h="0123456789abcdef";do{var -g=b.udivmod(i);b=g.quotient;d=h.charAt(iU(g.modulus))+d}while(!tW(b));if(c.prec>=0){c.filler=am;var -f=c.prec-d.length;if(f>0)d=br(f,R)+d}return eJ(c,d)}function +tV(a,b){var +c=eW(a);if(c.signedconv&&tX(b)){c.sign=-1;b=iQ(b)}var +d=e,i=b1(c.base),h="0123456789abcdef";do{var +g=b.udivmod(i);b=g.quotient;d=h.charAt(iU(g.modulus))+d}while(!tY(b));if(c.prec>=0){c.filler=am;var +f=c.prec-d.length;if(f>0)d=br(f,R)+d}return eK(c,d)}function iT(a,b){return a.or(b)}function -i5(a){var -b=0,e=p(a),c=10,d=1;if(e>0)switch(V(a,b)){case -45:b++;d=-1;break;case -43:b++;d=1;break}if(b+10)switch(U(a,b)){case +45:b++;e=-1;break;case +43:b++;e=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function -t2(a){var -h=i5(a),d=h[0],i=h[1],e=h[2],g=p(a),j=-1>>>0,f=d=e)I(ax);var -b=c;for(d++;d=e)break;b=e*b+c;if(b>j)I(ax)}if(d!=g)I(ax);b=i*b;if(e==10&&(b|0)!=b)I(ax);return b|0}function -c6(a,b,c){return a[S(b)].apply(a,iX(c))}function t4(a){var +f=i4(a),d=f[0],i=f[1],g=f[2],j=f[3],h=o(a),k=-1>>>0,e=d=g)J(ax);var +b=c;for(d++;d=g)break;b=g*b+c;if(b>k)J(ax)}if(d!==h)J(ax);b=i*b;if(j&&(b|0)!==b)J(ax);return b|0}function +c6(a,b,c){return a[S(b)].apply(a,iX(c))}function +t6(a){var d=a.length,c=new Array(d+1);c[0]=0;for(var b=0;b>>0&&eU(a,bm,bl)?0:1}function -iY(a){eU(a,bl,aI);return 0}function -t8(a,b){return+(cZ(a,b,false)<0)}function -t9(a){var +t7(a){return[aI,a]}function +eV(a,b,c){if(a[0]===b){a[0]=c;return 1}return 0}function +t8(a){eV(a,bl,bm);return 0}function +t9(a){return Array.isArray(a)&&a[0]===a[0]>>>0&&eV(a,bm,bl)?0:1}function +iY(a){eV(a,bl,aI);return 0}function +t_(a,b){return+(cZ(a,b,false)<0)}function +t$(a){var b=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function -i4(a){return U(a)}function iO(a,b){return a.add(b)}function iP(a,b){return a.mul(b)}function -eS(a,b){return a.ucompare(b)<0}function +eT(a,b){return a.ucompare(b)<0}function iR(a){var -h=i5(a),g=h[0],j=h[1],e=h[2],i=b0(e),k=new -d(al,0xfffffff,ah).udivmod(i).quotient,f=V(a,g),b=c8(f);if(b<0||b>=e)I(ax);var -c=b0(b);for(;;){g++;f=V(a,g);if(f==95)continue;b=c8(f);if(b<0||b>=e)break;if(eS(k,c))I(ax);b=b0(b);c=iO(iP(i,c),b);if(eS(c,b))I(ax)}if(g!=p(a))I(ax);if(e==10&&eS(new -d(0,0,ag),c))I(ax);if(j<0)c=iQ(c);return c}function -tt(a,b){return a.get(a.offset(b))}function -t1(a,b){return a.xor(b)}function -tZ(a,b){return a.shift_right_unsigned(b)}function -tY(a,b){return a.shift_left(b)}function +g=i4(a),f=g[0],j=g[1],h=g[2],k=g[3],i=b1(h),l=new +d(al,0xfffffff,ai).udivmod(i).quotient,e=U(a,f),b=c8(e);if(b<0||b>=h)J(ax);var +c=b1(b);for(;;){f++;e=U(a,f);if(e===95)continue;b=c8(e);if(b<0||b>=h)break;if(eT(l,c))J(ax);b=b1(b);c=iO(iP(i,c),b);if(eT(c,b))J(ax)}if(f!==o(a))J(ax);if(k&&eT(new +d(0,0,ah),c))J(ax);if(j<0)c=iQ(c);return c}var +ub=iR($("0xdaba0b6eb09322e3")),ua=iR($("0xd1342543de82ef95"));function +tv(a,b){return a.get(a.offset(b))}function +t3(a,b){return a.xor(b)}function +t1(a,b){return a.shift_right_unsigned(b)}function +t0(a,b){return a.shift_left(b)}function iZ(a){function -o(a,b){return tY(a,b)}function -h(a,b){return tZ(a,b)}function +o(a,b){return t0(a,b)}function +h(a,b){return t1(a,b)}function s(a,b){return iT(a,b)}function -f(a,b){return t1(a,b)}function +f(a,b){return t3(a,b)}function k(a,b){return iO(a,b)}function i(a,b){return iP(a,b)}function m(a,b){return s(o(a,b),h(a,64-b))}function -g(a,b){return tt(a,b)}function -j(a,b,c){return bU(a,b,c)}var -q=iR(i4("0xd1342543de82ef95")),l=iR(i4("0xdaba0b6eb09322e3")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var +g(a,b){return tv(a,b)}function +j(a,b,c){return bV(a,b,c)}var +q=ua,l=ub,b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var d=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function -aj(a,b){if(a<0)bT();var +tq(a,b){if(a<0)bU();var a=a+1|0,c=new Array(a);c[0]=0;for(var d=1;d>>32-e,c)}function @@ -771,44 +761,44 @@ g(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function h(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function i(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function j(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var -c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function -tn(a,b,c){var +c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xd76aa478);f=g(f,c,d,e,b[1],12,0xe8c7b756);e=g(e,f,c,d,b[2],17,0x242070db);d=g(d,e,f,c,b[3],22,0xc1bdceee);c=g(c,d,e,f,b[4],7,0xf57c0faf);f=g(f,c,d,e,b[5],12,0x4787c62a);e=g(e,f,c,d,b[6],17,0xa8304613);d=g(d,e,f,c,b[7],22,0xfd469501);c=g(c,d,e,f,b[8],7,0x698098d8);f=g(f,c,d,e,b[9],12,0x8b44f7af);e=g(e,f,c,d,b[10],17,0xffff5bb1);d=g(d,e,f,c,b[11],22,0x895cd7be);c=g(c,d,e,f,b[12],7,0x6b901122);f=g(f,c,d,e,b[13],12,0xfd987193);e=g(e,f,c,d,b[14],17,0xa679438e);d=g(d,e,f,c,b[15],22,0x49b40821);c=h(c,d,e,f,b[1],5,0xf61e2562);f=h(f,c,d,e,b[6],9,0xc040b340);e=h(e,f,c,d,b[11],14,0x265e5a51);d=h(d,e,f,c,b[0],20,0xe9b6c7aa);c=h(c,d,e,f,b[5],5,0xd62f105d);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xd8a1e681);d=h(d,e,f,c,b[4],20,0xe7d3fbc8);c=h(c,d,e,f,b[9],5,0x21e1cde6);f=h(f,c,d,e,b[14],9,0xc33707d6);e=h(e,f,c,d,b[3],14,0xf4d50d87);d=h(d,e,f,c,b[8],20,0x455a14ed);c=h(c,d,e,f,b[13],5,0xa9e3e905);f=h(f,c,d,e,b[2],9,0xfcefa3f8);e=h(e,f,c,d,b[7],14,0x676f02d9);d=h(d,e,f,c,b[12],20,0x8d2a4c8a);c=i(c,d,e,f,b[5],4,0xfffa3942);f=i(f,c,d,e,b[8],11,0x8771f681);e=i(e,f,c,d,b[11],16,0x6d9d6122);d=i(d,e,f,c,b[14],23,0xfde5380c);c=i(c,d,e,f,b[1],4,0xa4beea44);f=i(f,c,d,e,b[4],11,0x4bdecfa9);e=i(e,f,c,d,b[7],16,0xf6bb4b60);d=i(d,e,f,c,b[10],23,0xbebfbc70);c=i(c,d,e,f,b[13],4,0x289b7ec6);f=i(f,c,d,e,b[0],11,0xeaa127fa);e=i(e,f,c,d,b[3],16,0xd4ef3085);d=i(d,e,f,c,b[6],23,0x04881d05);c=i(c,d,e,f,b[9],4,0xd9d4d039);f=i(f,c,d,e,b[12],11,0xe6db99e5);e=i(e,f,c,d,b[15],16,0x1fa27cf8);d=i(d,e,f,c,b[2],23,0xc4ac5665);c=j(c,d,e,f,b[0],6,0xf4292244);f=j(f,c,d,e,b[7],10,0x432aff97);e=j(e,f,c,d,b[14],15,0xab9423a7);d=j(d,e,f,c,b[5],21,0xfc93a039);c=j(c,d,e,f,b[12],6,0x655b59c3);f=j(f,c,d,e,b[3],10,0x8f0ccc92);e=j(e,f,c,d,b[10],15,0xffeff47d);d=j(d,e,f,c,b[1],21,0x85845dd1);c=j(c,d,e,f,b[8],6,0x6fa87e4f);f=j(f,c,d,e,b[15],10,0xfe2ce6e0);e=j(e,f,c,d,b[6],15,0xa3014314);d=j(d,e,f,c,b[13],21,0x4e0811a1);c=j(c,d,e,f,b[4],6,0xf7537e82);f=j(f,c,d,e,b[11],10,0xbd3af235);e=j(e,f,c,d,b[2],15,0x2ad7d2bb);d=j(d,e,f,c,b[9],21,0xeb86d391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function +to(a,b,c){var e=a.len&aL,d=0;a.len+=c;if(e){var f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);cV(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function -tl(a){var -c=a.len&aL;a.b8[c]=ad;c++;if(c>56){for(var +tm(a){var +c=a.len&aL;a.b8[c]=ae;c++;if(c>56){for(var b=c;b<64;b++)a.b8[b]=0;cV(a.w,a.b32);for(var b=0;b<56;b++)a.b8[b]=0}else for(var -b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;cV(a.w,a.b32);var +b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1fffffff;cV(a.w,a.b32);var e=new Uint8Array(16);for(var d=0;d<4;d++)for(var -b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function -uo(a){return U(b1(a,0,a.length))}function -t$(a,b,c){var -d=tm(),e=eZ(a);tn(d,e.subarray(b,b+c),c);return uo(tl(d))}function -ua(a,b,c){return t$(a0(a),b,c)}function -uc(){return 0}var +b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&an;return e}function +ut(a){return _(b2(a,0,a.length))}function +ud(a,b,c){var +d=tn(),e=eZ(a);to(d,e.subarray(b,b+c),c);return ut(tm(d))}function +ue(a,b,c){return ud(a0(a),b,c)}function +ug(){return 0}var aP=new Array();function i0(a){return aP[a]}function a1(a){var -b=i0(a);if(!b.opened)l("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(b1(b.buffer,0,b.buffer_curr));else +b=i0(a);if(!b.opened)k("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr===0)return 0;if(b.output)b.output(b2(b.buffer,0,b.buffer_curr));else b.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function -uq(a,b){if(b.name)try{var -d=require(eo),c=d.openSync(b.name,"rs");return new -ai(c,b)}catch(f){}return new -ai(a,b)}var -c$=new +uv(a,b){if(b.name)try{var +d=require(eD),c=d.openSync(b.name,"rs");return new +aj(c,b)}catch(f){}return new +aj(a,b)}var +da=new Array(3);function -bS(a,b){N.call(this,F(0));this.log=function(a){return 0};if(a==1&&typeof -console.log=="function")this.log=console.log;else if(a==2&&typeof -console.error=="function")this.log=console.error;else if(typeof -console.log=="function")this.log=console.log;this.flags=b}bS.prototype.length=function(){return 0};bS.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var -e=F(d);aN(eH(b),c,e,0,d);this.log(e.toUtf16());return 0}l(this.fd+hi)};bS.prototype.read=function(a,b,c,d){l(this.fd+": file descriptor is write only")};bS.prototype.close=function(){this.log=undefined};function -da(a,b){if(b==undefined)b=c$.length;c$[b]=a;return b|0}function -uz(a,b,c){var +bT(a,b){N.call(this,F(0));this.log=function(a){return 0};if(a===1&&typeof +console.log==="function")this.log=console.log;else if(a===2&&typeof +console.error==="function")this.log=console.error;else if(typeof +console.log==="function")this.log=console.log;this.flags=b}bT.prototype.length=function(){return 0};bT.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]===10)d--;var +e=F(d);aN(eI(b),c,e,0,d);this.log(e.toUtf16());return 0}k(this.fd+hi)};bT.prototype.read=function(a,b,c,d){k(this.fd+": file descriptor is write only")};bT.prototype.close=function(){this.log=undefined};function +db(a,b){if(b===undefined)b=da.length;da[b]=a;return b|0}function +uE(a,b,c){var d={};while(b){switch(b[1]){case 0:d.rdonly=1;break;case 1:d.wronly=1;break;case @@ -818,112 +808,108 @@ d={};while(b){switch(b[1]){case 5:d.excl=1;break;case 6:d.binary=1;break;case 7:d.text=1;break;case -8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)l(ap(a)+eB);if(d.text&&d.binary)l(ap(a)+ek);var -e=jc(a),f=e.device.open(e.rest,d);return da(f,undefined)}(function(){function -a(a,b){return b2()?uq(a,b):new -bS(a,b)}da(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);da(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);da(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function -ud(a){var -b=c$[a];if(b.flags.wronly)l(hO+a+" is writeonly");var +8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)k(ap(a)+eB);if(d.text&&d.binary)k(ap(a)+el);var +e=jd(a),f=e.device.open(e.rest,d);return db(f,undefined)}(function(){function +a(a,b){return b3()?uv(a,b):new +bT(a,b)}db(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);db(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);db(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function +uh(a){var +b=da[a];if(b.flags.wronly)k(hO+a+" is writeonly");var d=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(hQ),refill:d};aP[c.fd]=c;return c.fd}function i1(a){var -b=c$[a];if(b.flags.rdonly)l(hO+a+" is readonly");var +b=da[a];if(b.flags.rdonly)k(hO+a+" is readonly");var d=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new Uint8Array(hQ),buffered:d};aP[c.fd]=c;return c.fd}function -ue(){var +ui(){var b=0;for(var a=0;ae.buffer.length){var +uk(a,b,c,d){var +e=i0(a);if(!e.opened)k("Cannot output to a closed channel");b=b.subarray(c,c+d);if(e.buffer_curr+b.length>e.buffer.length){var g=new Uint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case 0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;a1(a);break;case 1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)a1(a);break;case 2:var f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)a1(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;a1(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function -uf(a,b,c,d){var -b=eZ(b);return ug(a,b,c,d)}function -eT(a,b,c,d){return uf(a,a0(b),c,d)}function +uj(a,b,c,d){var +b=eZ(b);return uk(a,b,c,d)}function +eU(a,b,c,d){return uj(a,a0(b),c,d)}function i2(a,b){var -c=U(String.fromCharCode(b));eT(a,c,0,1);return 0}function -a2(a,b){return+(cZ(a,b,false)!=0)}function -a3(a){if(a -instanceof -Array&&a[0]==a[0]>>>0)return a[0];else if(c4(a))return cM;else if(c5(a))return cM;else if(a +c=_(String.fromCharCode(b));eU(a,c,0,1);return 0}function +a2(a,b){return+(cZ(a,b,false)!==0)}function +a3(a){if(Array.isArray(a)&&a[0]===a[0]>>>0)return a[0];else if(c4(a))return cN;else if(c5(a))return cN;else if(a instanceof Function||typeof -a=="function")return 247;else if(a&&a.caml_custom)return hF;else -return bR}function -tu(a){var -c={};if(a)for(var -b=1;b=0)a=e;else -I("caml_register_global: cannot locate "+d)}}J[a+1]=b;if(c)J[c]=b}function +a==="function")return 247;else if(a&&a.caml_custom)return hF;else +return bR}var +jc=undefined;function +tw(a){var +d={},c=-1;if(a)for(var +b=1;b=0)a=e;else{var +a=G.symidx.next_idx++;G.symidx[d]=a}}}G[a+1]=b;if(c)G[c]=b}function eY(a,b){i3[ap(a)]=b;return 0}function -um(){A(ei)}function -T(a,b){if(b>>>0>=p(a))um();return V(a,b)}function -c_(a){a.t&6&&bX(a);return U(a.c)}function -up(){return 0x7FFFFFFF/4|0}function -uj(){i6(J.Not_found)}function -i9(a){var -b=jb(S(a));if(b===undefined)uj();return ak(b)}function -ur(){if(m.crypto)if(m.crypto.getRandomValues){var -a=m.crypto.getRandomValues(new -Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(m.crypto.randomBytes){var +ur(){A(ej)}function +T(a,b){if(b>>>0>=o(a))ur();return U(a,b)}function +c$(a){a.t&6&&bY(a);return _(a.c)}function +uu(){return 0x7fffffff/4|0}function +un(){i5(G.Not_found)}function +i8(a){var +b=jb(S(a));if(b===undefined)un();return $(b)}function +uw(){if(c.crypto)if(c.crypto.getRandomValues){var +a=c.crypto.getRandomValues(new +Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(c.crypto.randomBytes){var a=new -Int32Array(m.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var +Int32Array(c.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var b=new -Date().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function +Date().getTime(),d=b^0xffffffff*Math.random();return[0,d]}function aR(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function -o(a,b){return{joo_tramp:a,joo_args:b}}function -us(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof +n(a,b){return{joo_tramp:a,joo_args:b}}function +ux(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof b==="function"){a.fun=b;return 0}var c=b.length;while(c--)a[c]=b[c];return 0}function -$(a){{if(a +aa(a){{if(Array.isArray(a))return a;var +b;if(c.RangeError&&a instanceof -Array)return a;var -b;if(m.RangeError&&a +c.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=G.Stack_overflow;else if(c.InternalError&&a instanceof -m.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=J.Stack_overflow;else if(m.InternalError&&a +c.InternalError&&a.message&&a.message.match(/too much recursion/i))b=G.Stack_overflow;else if(a instanceof -m.InternalError&&a.message&&a.message.match(/too much recursion/i))b=J.Stack_overflow;else if(a +c.Error&&aQ(ev))b=[0,aQ(ev),a];else +b=[0,G.Failure,$(String(a))];if(a instanceof -m.Error&&aQ(ev))b=[0,aQ(ev),a];else -b=[0,J.Failure,ak(String(a))];if(a -instanceof -m.Error)b.js_error=a;return b}}function -t3(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function -tG(a){var -b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&t3(a[1]))var -g=a[2],h=1;else +c.Error)b.js_error=a;return b}}function +t5(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function +tI(a){var +b=e;if(a[0]===0){b+=a[1][1];if(a.length===3&&a[2][0]===0&&t5(a[1]))var +f=a[2],g=1;else var -h=2,g=a;b+="(";for(var -f=h;fh)b+=hp;var -d=g[f];if(typeof -d=="number")b+=d.toString();else if(d -instanceof -ay)b+=cL+d.toString()+cL;else if(typeof -d=="string")b+=cL+d.toString()+cL;else -b+=ib}b+=")"}else if(a[0]==c)b+=a[1];return b}function -iL(a){if(a +g=2,f=a;b+="(";for(var +d=g;dg)b+=hp;var +c=f[d];if(typeof +c==="number")b+=c.toString();else if(c instanceof -Array&&(a[0]==0||a[0]==c)){var -d=aQ(ig);if(d)cY(d,[a,false]);else{var -e=tG(a),b=aQ(hR);if(b)cY(b,[0]);console.error(ex+e);if(a.js_error)throw a.js_error}}else +ay)b+=cM+c.toString()+cM;else if(typeof +c==="string")b+=cM+c.toString()+cM;else +b+=ib}b+=")"}else if(a[0]===r)b+=a[1];return b}function +iL(a){if(Array.isArray(a)&&(a[0]===0||a[0]===r)){var +c=aQ(ig);if(c)cY(c,[a,false]);else{var +d=tI(a),b=aQ(hR);if(b)cY(b,[0]);console.error(ex+d);if(a.js_error)throw a.js_error}}else throw a}function -ul(){var -c=m.process;if(c&&c.on)c.on("uncaughtException",function(a,b){iL(a);c.exit(2)});else if(m.addEventListener)m.addEventListener("error",function(a){if(a.error)iL(a.error)})}ul();function -h(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):aO(a,[b])}function -i(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):aO(a,[b,c])}function -bO(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):aO(a,[b,c,d])}function -ef(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):aO(a,[b,c,d,e,f])}function -tk(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):aO(a,[b,c,d,e,f,g,h])}var -uy=undefined;tH();var -dc=[c,iv,-1],e4=[c,hK,-2],b4=[c,eC,-3],db=[c,hq,-4],W=[c,ht,-7],e2=[c,iq,-8],e3=[c,h1,-9],f=[c,h9,-11],e5=[c,ij,-12],tj=[4,0,0,0,[12,45,[4,0,0,0,0]]],dx=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,is,[4,0,0,0,[12,45,[4,0,0,0,[11,ip,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],g0=[0,0];ae(11,e5,ij);ae(10,f,h9);ae(9,[c,ic,-10],ic);ae(8,e3,h1);ae(7,e2,iq);ae(6,W,ht);ae(5,[c,hI,-6],hI);ae(4,[c,hU,-5],hU);ae(3,db,hq);ae(2,b4,eC);ae(1,e4,hK);ae(0,dc,iv);var -jn="output_substring",jj=aJ,jg="true",jh="false",js="CamlinternalLazy.Undefined",jz="option is None",jC="\\\\",jD="\\'",jE="\\b",jF="\\t",jG="\\n",jH="\\r",jO="List.init",jL="hd",j0="String.blit / Bytes.blit_string",jZ="Bytes.blit",jY="String.sub / Bytes.sub",j_="String.contains_from / Bytes.contains_from",kg="Array.iter2: arrays must have the same length",ke="Array.blit",kd="Array.sub",ko=[0,"set.ml",hN,18],kk=cP,kl=cP,km=cP,kn=cP,kv="Map.remove_min_elt",kr=cT,ks=cT,kt=cT,ku=cT,ky="Stdlib.Queue.Empty",kG="Buffer.add_substring/add_subbytes",kE="Buffer.add: cannot grow buffer",kN="first domain already spawned",kK=[0,"domain.ml",184,13],kY="%c",kZ="%s",k0=hx,k1=hn,k2=ix,k3=hr,k4="%f",k5="%B",k6="%{",k7="%}",k8="%(",k9="%)",k_="%a",k$="%t",la="%?",lb="%r",lc="%_r",ld=[0,C,850,23],lo=[0,C,814,21],lg=[0,C,815,21],lp=[0,C,818,21],lh=[0,C,819,21],lq=[0,C,822,19],li=[0,C,823,19],lr=[0,C,826,22],lj=[0,C,827,22],ls=[0,C,831,30],lk=[0,C,832,30],lm=[0,C,836,26],le=[0,C,837,26],ln=[0,C,846,28],lf=[0,C,847,28],ll=[0,C,851,23],mE=[0,C,1558,4],mF="Printf: bad conversion %[",mG=[0,C,1626,39],mH=[0,C,1649,31],mI=[0,C,1650,31],mJ="Printf: bad conversion %_",mK=hH,mL=ia,mM=hH,mN=ia,mz=em,mx="neg_infinity",my=hP,mw=aJ,mr=[0,hg],mf="%+nd",mg="% nd",mi="%+ni",mj="% ni",mk="%nx",ml="%#nx",mm="%nX",mn="%#nX",mo="%no",mp="%#no",me="%nd",mh=ix,mq="%nu",l3="%+ld",l4="% ld",l6="%+li",l7="% li",l8="%lx",l9="%#lx",l_="%lX",l$="%#lX",ma="%lo",mb="%#lo",l2="%ld",l5=hn,mc="%lu",lP="%+Ld",lQ="% Ld",lS="%+Li",lT="% Li",lU="%Lx",lV="%#Lx",lW="%LX",lX="%#LX",lY="%Lo",lZ="%#Lo",lO="%Ld",lR=hr,l0="%Lu",lB="%+d",lC="% d",lE="%+i",lF="% i",lG="%x",lH="%#x",lI="%X",lJ="%#X",lK="%o",lL="%#o",lA=eh,lD=hx,lM=hW,kQ="@]",kR="@}",kS="@?",kT="@\n",kU="@.",kV="@@",kW="@%",kX="@",lt="CamlinternalFormat.Type_mismatch",mT=e,mU=[0,[11,hp,[2,0,[2,0,0]]],", %s%s"],nu=[0,[11,ex,[2,0,[12,10,0]]],hY],nv=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],nt="Fatal error: out of memory in uncaught exception handler",nq=[0,[11,ex,[2,0,[12,10,0]]],hY],nk=[0,[2,0,[12,10,0]],"%s\n"],nl=[0,[11,hG,0],hG],m$="Raised at",na="Re-raised at",nb="Raised by primitive operation at",nc="Called from",nd=[0,[12,32,[4,0,0,0,0]]," %d"],nh=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],ne=" (inlined)",ng=e,nf=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,is,tj]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],ni=[0,[2,0,[11," unknown location",0]],"%s unknown location"],m4="Out of memory",m5="Stack overflow",m6="Pattern matching failed",m7="Assertion failed",m8="Undefined recursive module",mW=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],mX=e,mY=e,mZ=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],mS=[0,[4,0,0,0,0],eh],mQ=[0,[3,0,0],"%S"],mR=ib,nn=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],nz="Fun.Finally_raised: ",nx="Stdlib.Fun.Finally_raised",nA="Digest.BLAKE2: wrong hash size",nM=_(14371852,15349651,22696),nN=_(12230193,11438743,35013),nO=_(1424933,15549263,2083),nP=_(9492471,4696708,43520),nD=_(1,0,0),nE=_(0,0,0),nH=_(1,0,0),nF=_(0,0,0),nG=_(2,0,0),nX="Hashtbl: unsupported hash table format",nR=e,oA=[3,0,3],oB=aJ,ov=id,ow="<\/",ox=e,or=id,os="<",ot=e,op="\n",og=[0,e],n$=e,oa=e,ob=e,oc=e,n7=[0,e,0,e],n3="Stdlib.Format.String_tag",oE="Jsoo_runtime.Error.Exn",oF=ev,oJ=[0,b,157,10],oL=[0,b,179,10],oN=[0,b,191,10],oQ=[0,b,iw,17],oZ=[0,b,367,16],o0=[0,b,368,18],o1=[0,b,372,15],o2=[0,b,377,15],o3=[0,b,383,15],o4=[0,b,386,10],o5=[0,b,362,16],o6=[0,b,517,12],o7=[0,b,459,14],pg=[0,b,686,27],pf=[0,b,651,27],o$=[0,b,560,16],o8=[0,b,550,23],o9=[0,b,544,14],oY=[0,b,334,9],oU=[0,b,309,9],oT=[0,b,305,9],oS=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],oP=[0,b,hB,14],oM=[0,b,186,14],oK=[0,b,169,14],oI=[0,b,152,14],pa="Lwd.Release_failure",pn=[0,a,64,12],pA=[0,a,205,18],pz=[0,a,iw,9],pC=[0,a,224,18],pB=[0,a,237,9],pD=[0,a,240,21],pE=[0,a,aI,21],pF=[0,a,260,21],pH=[0,a,296,14],p6=[0,a,553,18],p7=[0,a,557,12],p8=[0,a,546,14],p5=[0,a,538,21],p3=[0,a,531,14],p2=[0,a,523,14],p0=[0,a,492,29],pZ=[0,a,499,29],pX=[0,a,462,21],pS=[0,a,420,10],pT=[0,a,423,15],pU=[0,a,435,10],pV=[0,a,457,2],pN=[0,a,371,24],pO=[0,a,391,16],pP=[0,a,394,2],pK=[0,a,315,18],pJ=[0,a,317,9],pw=[0,a,193,4],pv=[0,a,hB,21],pt=[0,a,hm,4],pu=[0,a,177,14],pr=[0,a,113,14],pp=[0,a,82,21],pl=[0,a,32,14],qz=[0,M,hN,12],qk=[0,M,321,37],ql=[0,M,322,37],qn=[0,M,346,10],qo=[0,M,358,8],qm=[0,M,337,37],qq=[0,M,375,10],qr=[0,M,384,8],qp=[0,M,338,37],qu=[0,M,425,16],qx=[0,M,513,50],qv=[0,M,480,6],qt=[0,M,395,14],qc=[0,M,hm,57],qd=[0,M,182,57],qe=[0,M,238,11],p9=h6,p_=h6,rl="debug",rb="scrollTop",rq="isSecureContext",rE=[0,hE,233,16],rC=[0,hE,201,16],rx=[0,0,0],rv=[0,0,0],rT="CCFQueue.Empty",rU=[0,0],r3="content-box",r4="border-box",r5="device-pixel-content-box",se="not implemented",sb=[0,[8,[0,0,0],0,0,[11,ik,0]],"%fpx"],sc=[0,[8,[0,0,0],0,0,[11,hX,0]],"%frem"],sd=[0,[8,[0,0,0],0,0,[11,hM,0]],"%fem"],r_=ik,r$=hX,sa=hM,sh="Common.Utils.Forward_ref.Not_set",sj="Common.Utils.Forward_ref.Already_set",sn=e,sm=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],sv="TODO not implemented",sA=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],sB=[0,80,"lwdui-controlled-scroll-controls"],sC="Show playing",sN=[0,[11,ih,[2,0,0]],"height: %s"],sJ=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],sH="grid-template-columns",sI=[0,[2,0,[11,ip,[2,0,[12,59,0]]]],"%s: %s;"],sK=e,sO=[1,4.],sW=[0,80,hj],sU="Row height",sV="Visible height:",sS=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],sT=[0,[11,ih,[2,0,[11," !important;",0]]],"height: %s !important;"],sX=[0,80,[0,"lwdui-lazy-table-content"]],sY=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],sZ=[0,"lwdui-lazy-table",0],sP="virtual table",s3="square",s4="1fr",s5=h0,s7=hD,s8="5em",s9=h0,s_=[2,5.],tb=[0,80,[0,"table"]],td="options",tf=[0,80,[0,"flex"]];function +uq(){var +d=c.process;if(d&&d.on)d.on("uncaughtException",function(a,b){iL(a);d.exit(2)});else if(c.addEventListener)c.addEventListener("error",function(a){if(a.error)iL(a.error)})}uq();function +h(a,b){return(a.l>=0?a.l:a.l=a.length)===1?a(b):aO(a,[b])}function +i(a,b,c){return(a.l>=0?a.l:a.l=a.length)===2?a(b,c):aO(a,[b,c])}function +bO(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)===3?a(b,c,d):aO(a,[b,c,d])}function +eg(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)===5?a(b,c,d,e,f):aO(a,[b,c,d,e,f])}function +tl(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)===7?a(b,c,d,e,f,g,h):aO(a,[b,c,d,e,f,g,h])}var +uD=0;tJ();var +dd=[r,iv,-1],e4=[r,hK,-2],b5=[r,eC,-3],dc=[r,hq,-4],V=[r,ht,-7],e2=[r,iq,-8],e3=[r,h1,-9],f=[r,h9,-11],e5=[r,ij,-12],tk=[4,0,0,0,[12,45,[4,0,0,0,0]]],dy=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,is,[4,0,0,0,[12,45,[4,0,0,0,[11,ip,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],g0=[0,0];af(11,e5,ij);af(10,f,h9);af(9,[r,ic,-10],ic);af(8,e3,h1);af(7,e2,iq);af(6,V,ht);af(5,[r,hI,-6],hI);af(4,[r,hU,-5],hU);af(3,dc,hq);af(2,b5,eC);af(1,e4,hK);af(0,dd,iv);var +jo="output_substring",jk=aJ,jh="true",ji="false",jt="CamlinternalLazy.Undefined",jA="option is None",jD="\\\\",jE="\\'",jF="\\b",jG="\\t",jH="\\n",jI="\\r",jP="List.init",jM="hd",j1="String.blit / Bytes.blit_string",j0="Bytes.blit",jZ="String.sub / Bytes.sub",j$="String.contains_from / Bytes.contains_from",kh="Array.iter2: arrays must have the same length",kf="Array.blit",ke="Array.sub",kp=[0,"set.ml",hN,18],kl=cQ,km=cQ,kn=cQ,ko=cQ,kw="Map.remove_min_elt",ks=cT,kt=cT,ku=cT,kv=cT,kz="Stdlib.Queue.Empty",kH="Buffer.add_substring/add_subbytes",kF="Buffer.add: cannot grow buffer",kO="first domain already spawned",kL=[0,"domain.ml",184,13],kZ="%c",k0="%s",k1=hx,k2=hn,k3=ix,k4=hr,k5="%f",k6="%B",k7="%{",k8="%}",k9="%(",k_="%)",k$="%a",la="%t",lb="%?",lc="%r",ld="%_r",le=[0,C,850,23],lp=[0,C,814,21],lh=[0,C,815,21],lq=[0,C,818,21],li=[0,C,819,21],lr=[0,C,822,19],lj=[0,C,823,19],ls=[0,C,826,22],lk=[0,C,827,22],lt=[0,C,831,30],ll=[0,C,832,30],ln=[0,C,836,26],lf=[0,C,837,26],lo=[0,C,846,28],lg=[0,C,847,28],lm=[0,C,851,23],mF=[0,C,1558,4],mG="Printf: bad conversion %[",mH=[0,C,1626,39],mI=[0,C,1649,31],mJ=[0,C,1650,31],mK="Printf: bad conversion %_",mL=hH,mM=ia,mN=hH,mO=ia,mA=en,my="neg_infinity",mz=hP,mx=aJ,ms=[0,hg],mg="%+nd",mh="% nd",mj="%+ni",mk="% ni",ml="%nx",mm="%#nx",mn="%nX",mo="%#nX",mp="%no",mq="%#no",mf="%nd",mi=ix,mr="%nu",l4="%+ld",l5="% ld",l7="%+li",l8="% li",l9="%lx",l_="%#lx",l$="%lX",ma="%#lX",mb="%lo",mc="%#lo",l3="%ld",l6=hn,md="%lu",lQ="%+Ld",lR="% Ld",lT="%+Li",lU="% Li",lV="%Lx",lW="%#Lx",lX="%LX",lY="%#LX",lZ="%Lo",l0="%#Lo",lP="%Ld",lS=hr,l1="%Lu",lC="%+d",lD="% d",lF="%+i",lG="% i",lH="%x",lI="%#x",lJ="%X",lK="%#X",lL="%o",lM="%#o",lB=ei,lE=hx,lN=hW,kR="@]",kS="@}",kT="@?",kU="@\n",kV="@.",kW="@@",kX="@%",kY="@",lu="CamlinternalFormat.Type_mismatch",mU=e,mV=[0,[11,hp,[2,0,[2,0,0]]],", %s%s"],nv=[0,[11,ex,[2,0,[12,10,0]]],hY],nw=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],nu="Fatal error: out of memory in uncaught exception handler",nr=[0,[11,ex,[2,0,[12,10,0]]],hY],nl=[0,[2,0,[12,10,0]],"%s\n"],nm=[0,[11,hG,0],hG],na="Raised at",nb="Re-raised at",nc="Raised by primitive operation at",nd="Called from",ne=[0,[12,32,[4,0,0,0,0]]," %d"],ni=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],nf=" (inlined)",nh=e,ng=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,is,tk]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],nj=[0,[2,0,[11," unknown location",0]],"%s unknown location"],m5="Out of memory",m6="Stack overflow",m7="Pattern matching failed",m8="Assertion failed",m9="Undefined recursive module",mX=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],mY=e,mZ=e,m0=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],mT=[0,[4,0,0,0,0],ei],mR=[0,[3,0,0],"%S"],mS=ib,no=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],nA="Fun.Finally_raised: ",ny="Stdlib.Fun.Finally_raised",nB="Digest.BLAKE2: wrong hash size",nN=Z(14371852,15349651,22696),nO=Z(12230193,11438743,35013),nP=Z(1424933,15549263,2083),nQ=Z(9492471,4696708,43520),nE=Z(1,0,0),nF=Z(0,0,0),nI=Z(1,0,0),nG=Z(0,0,0),nH=Z(2,0,0),nY="Hashtbl: unsupported hash table format",nS=e,oB=[3,0,3],oC=aJ,ow=id,ox="<\/",oy=e,os=id,ot="<",ou=e,oq="\n",oh=[0,e],oa=e,ob=e,oc=e,od=e,n8=[0,e,0,e],n4="Stdlib.Format.String_tag",oF="Jsoo_runtime.Error.Exn",oG=ev,oK=[0,b,157,10],oM=[0,b,179,10],oO=[0,b,191,10],oR=[0,b,iw,17],o0=[0,b,367,16],o1=[0,b,368,18],o2=[0,b,372,15],o3=[0,b,377,15],o4=[0,b,383,15],o5=[0,b,386,10],o6=[0,b,362,16],o7=[0,b,517,12],o8=[0,b,459,14],ph=[0,b,686,27],pg=[0,b,651,27],pa=[0,b,560,16],o9=[0,b,550,23],o_=[0,b,544,14],oZ=[0,b,334,9],oV=[0,b,309,9],oU=[0,b,305,9],oT=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],oQ=[0,b,hB,14],oN=[0,b,186,14],oL=[0,b,169,14],oJ=[0,b,152,14],pb="Lwd.Release_failure",po=[0,a,64,12],pB=[0,a,205,18],pA=[0,a,iw,9],pD=[0,a,224,18],pC=[0,a,237,9],pE=[0,a,240,21],pF=[0,a,aI,21],pG=[0,a,260,21],pI=[0,a,296,14],p7=[0,a,553,18],p8=[0,a,557,12],p9=[0,a,546,14],p6=[0,a,538,21],p4=[0,a,531,14],p3=[0,a,523,14],p1=[0,a,492,29],p0=[0,a,499,29],pY=[0,a,462,21],pT=[0,a,420,10],pU=[0,a,423,15],pV=[0,a,435,10],pW=[0,a,457,2],pO=[0,a,371,24],pP=[0,a,391,16],pQ=[0,a,394,2],pL=[0,a,315,18],pK=[0,a,317,9],px=[0,a,193,4],pw=[0,a,hB,21],pu=[0,a,hm,4],pv=[0,a,177,14],ps=[0,a,113,14],pq=[0,a,82,21],pm=[0,a,32,14],qA=[0,M,hN,12],ql=[0,M,321,37],qm=[0,M,322,37],qo=[0,M,346,10],qp=[0,M,358,8],qn=[0,M,337,37],qr=[0,M,375,10],qs=[0,M,384,8],qq=[0,M,338,37],qv=[0,M,425,16],qy=[0,M,513,50],qw=[0,M,480,6],qu=[0,M,395,14],qd=[0,M,hm,57],qe=[0,M,182,57],qf=[0,M,238,11],p_=h6,p$=h6,rm="debug",rc="scrollTop",rr="isSecureContext",rF=[0,hE,233,16],rD=[0,hE,201,16],ry=[0,0,0],rw=[0,0,0],rU="CCFQueue.Empty",rV=[0,0],r4="content-box",r5="border-box",r6="device-pixel-content-box",sf="not implemented",sc=[0,[8,[0,0,0],0,0,[11,ik,0]],"%fpx"],sd=[0,[8,[0,0,0],0,0,[11,hX,0]],"%frem"],se=[0,[8,[0,0,0],0,0,[11,hM,0]],"%fem"],r$=ik,sa=hX,sb=hM,si="Common.Utils.Forward_ref.Not_set",sk="Common.Utils.Forward_ref.Already_set",so=e,sn=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],sw="TODO not implemented",sB=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],sC=[0,80,"lwdui-controlled-scroll-controls"],sD="Show playing",sO=[0,[11,ih,[2,0,0]],"height: %s"],sK=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],sI="grid-template-columns",sJ=[0,[2,0,[11,ip,[2,0,[12,59,0]]]],"%s: %s;"],sL=e,sP=[1,4.],sX=[0,80,hj],sV="Row height",sW="Visible height:",sT=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],sU=[0,[11,ih,[2,0,[11," !important;",0]]],"height: %s !important;"],sY=[0,80,[0,"lwdui-lazy-table-content"]],sZ=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],s0=[0,"lwdui-lazy-table",0],sQ="virtual table",s4="square",s5="1fr",s6=h0,s8=hD,s9="5em",s_=h0,s$=[2,5.],tc=[0,80,[0,"table"]],te="options",tg=[0,80,[0,"flex"]];function u(a){if(typeof a==="number")return 0;switch(a[0]){case 0:return[0,u(a[1])];case @@ -1004,119 +990,119 @@ F=a[1];return[21,F,s(a[2],b)];case 23:var G=a[1];return[23,G,s(a[2],b)];default:var H=a[2],I=a[1];return[24,I,H,s(a[3],b)]}}function -b3(a){throw g([0,b4,a],1)}function -t(a){throw g([0,db,a],1)}function -b5(a){return 0<=a?a:-a|0}function +b4(a){throw g([0,b5,a],1)}function +t(a){throw g([0,dc,a],1)}function +b6(a){return 0<=a?a:-a|0}function ar(a,b){return a+b}function e6(a){return e+a}function -ji(b){var -e=p(b);return function(a){var -c=a;for(;;){if(e<=c)return ar(b,jj);var +jj(b){var +e=o(b);return function(a){var +c=a;for(;;){if(e<=c)return ar(b,jk);var d=T(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function -jm(a,b,c,d){var +jn(a,b,c,d){var f=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var h=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var j=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var -l=[0,j[1],aK],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}ud(0);var -dd=i1(1),X=i1(2);function -bt(a,b){eT(a,b,0,p(b));return}function -e7(a,b,c,d){if(0<=c&&0<=d&&(p(b)-d|0)>=c)return eT(a,b,c,d);return t(jn)}function -e8(a){bt(X,a);i2(X,10);return a1(X)}var -de=[0,function(a){return function(a){var +l=[0,j[1],aK],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}uh(0);var +de=i1(1),W=i1(2);function +bt(a,b){eU(a,b,0,o(b))}function +e7(a,b,c,d){if(0<=c&&0<=d&&(o(b)-d|0)>=c)return eU(a,b,c,d);return t(jo)}function +e8(a){bt(W,a);i2(W,10);return a1(W)}var +df=[0,function(a){return function(a){var b=a;for(;;){if(!b)return 0;var d=b[2],e=b[1];try{a1(e)}catch(f){var -c=$(f);if(c[1]!==e4)throw g(c,0)}b=d}}(ue(0))}],e9=[0,function(a){return}];function -df(a){h(e9[1],0);return h(eE(de),0)}eY(hR,df);function +c=aa(f);if(c[1]!==e4)throw g(c,0)}b=d}}(ui(0))}],e9=[0,function(a){}];function +dg(a){h(e9[1],0);return h(eF(df),0)}eY(hR,dg);function bu(a){return a1(a)}function -jd(a){return a^-1}var -je=ii;function -jf(a){return a?jg:jh}function -jk(a){return ji(eK("%.12g",a))}function -jl(a,b){if(!a)return b;var +je(a){return a^-1}var +jf=ii;function +jg(a){return a?jh:ji}function +jl(a){return jj(eL("%.12g",a))}function +jm(a,b){if(!a)return b;var c=a[2],d=a[1];if(!c)return[0,d,b];var e=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var -g=[0,e[1],aK];jm(g,1,e[2],b);return[0,d,[0,f,g]]}function -jo(c){for(;;){var -a=eE(de);let +g=[0,e[1],aK];jn(g,1,e[2],b);return[0,d,[0,f,g]]}function +jp(c){for(;;){var +a=eF(df);let d=[0,1],e=a;var -b=1-eD(de,a,function(a){if(eD(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function -jp(a,b){i2(a,b);return}var -dg=up(0),bv=(4*dg|0)-1|0;function -jq(a){return 1-(typeof +b=1-eE(df,a,function(a){if(eE(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function +jq(a,b){i2(a,b)}var +dh=uu(0),bv=(4*dh|0)-1|0;function +jr(a){return 1-(typeof a==="number"?1:0)}function -e_(a,b,c){return eD(a,b,c)}function -bw(a){return eE(a)}function +e_(a,b,c){return eE(a,b,c)}function +bw(a){return eF(a)}function bx(a){return[0,a]}function -jr(a,b){return tq(a,b)}var -jt=[c,js,ao(0)];function -ju(a){var +js(a,b){return ts(a,b)}var +ju=[r,jt,ao(0)];function +jv(a){var d=a[1];a[1]=0;try{var c=h(d,0);a[1]=c;iY(a);return c}catch(f){var -b=$(f);a[1]=function(a){throw g(b,0)};t6(a);throw g(b,0)}}function -jv(a){var +b=aa(f);a[1]=function(a){throw g(b,0)};t8(a);throw g(b,0)}}function +jw(a){var c=a[1];a[1]=0;var b=h(c,0);a[1]=b;iY(a);return b}function -jw(a,b){if(0===t7(b))return a?jv(b):ju(b);throw g(jt,1)}function -e$(a){return jw(0,a)}function -jx(a){var -b=a3(a);if(b!==aI&&b!==bm&&b!==bl&&b!==h7)return a;return t5(a)}function +jx(a,b){if(0===t9(b))return a?jw(b):jv(b);throw g(ju,1)}function +e$(a){return jx(0,a)}function +jy(a){var +b=a3(a);if(b!==aI&&b!==bm&&b!==bl&&b!==h7)return a;return t7(a)}function fa(a){return a?1:0}function -jy(a){return a?a[1]:t(jz)}function -jA(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function -jB(a){a:{if(40<=a){if(92===a)return jC;if(eA>a)break a}else{if(32<=a){if(39<=a)return jD;break a}if(14>a)switch(a){case -8:return jE;case -9:return jF;case -10:return jG;case -13:return jH}}var -b=F(4);v(b,0,92);v(b,1,48+(a/ep|0)|0);v(b,2,48+((a/10|0)%10|0)|0);v(b,3,48+(a%10|0)|0);return c_(b)}var -c=F(1);v(c,0,a);return c_(c)}function -jI(a){return 25>>0?a:a-32|0}function -jJ(a,b){var +jz(a){return a?a[1]:t(jA)}function +jB(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function +jC(a){a:{if(40<=a){if(92===a)return jD;if(eA>a)break a}else{if(32<=a){if(39<=a)return jE;break a}if(14>a)switch(a){case +8:return jF;case +9:return jG;case +10:return jH;case +13:return jI}}var +b=F(4);v(b,0,92);v(b,1,48+(a/ep|0)|0);v(b,2,48+((a/10|0)%10|0)|0);v(b,3,48+(a%10|0)|0);return c$(b)}var +c=F(1);v(c,0,a);return c$(c)}function +jJ(a){return 25>>0?a:a-32|0}function +jK(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -dh(a){return jJ(0,a)}function +di(a){return jK(0,a)}function a4(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[1],d];c=c[2];d=e}}function by(a){return a4(a,0)}function -jM(a,b,c){if(b>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var -a=dh(b);return 2<=a?h(a,b)[1]:b}function +a=di(b);return 2<=a?h(a,b)[1]:b}function fc(a,b){return b<=a?a:b}function -jV(a,b){return iV(a,b)}function -jW(a,b){return a<=b?a:b}function -jX(a){return e+a}function +jW(a,b){return iV(a,b)}function +jX(a,b){return a<=b?a:b}function +jY(a){return e+a}function aT(a,b){var -c=F(a);tE(c,0,a,b);return c}function +c=F(a);tG(c,0,a,b);return c}function fd(a,b,c){if(0<=b&&0<=c&&(aq(a)-c|0)>=b){var -d=F(c);aN(a,b,d,0,c);return d}return t(jY)}function -fe(a,b,c){return c_(fd(a,b,c))}function -ff(a,b,c,d,e){if(0<=e&&0<=b&&(aq(a)-e|0)>=b&&0<=d&&(aq(c)-e|0)>=d){aN(a,b,c,d,e);return}return t(jZ)}function -af(a,b,c,d,e){if(0<=e&&0<=b&&(p(a)-e|0)>=b&&0<=d&&(aq(c)-e|0)>=d){bV(a,b,c,d,e);return}return t(j0)}function -j2(a,b){var +d=F(c);aN(a,b,d,0,c);return d}return t(jZ)}function +fe(a,b,c){return c$(fd(a,b,c))}function +ff(a,b,c,d,e){if(0<=e&&0<=b&&(aq(a)-e|0)>=b&&0<=d&&(aq(c)-e|0)>=d){aN(a,b,c,d,e);return}return t(j0)}function +ag(a,b,c,d,e){if(0<=e&&0<=b&&(o(a)-e|0)>=b&&0<=d&&(aq(c)-e|0)>=d){bW(a,b,c,d,e);return}return t(j1)}function +j3(a,b){var d=aq(b);if(0===d)return b;var e=F(d),f=d-1|0,g=0;if(f>=0){var c=g;for(;;){v(e,c,h(a,cX(b,c)));var i=c+1|0;if(f===c)break;c=i}}return e}function -b7(a){return a0(a)}function -aa(a){return c_(a)}function -j1(a){var +b8(a){return a0(a)}function +ab(a){return c$(a)}function +j2(a){var b=[0,0],j=aq(a)-1|0,l=0;if(j>=0){var g=l;for(;;){var e=cX(a,g);a:{b:{c:{if(32<=e){var @@ -1200,66 +1186,60 @@ d=cX(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(eA<=d)break c;break b}}else{if(32>d){ 10:v(c,b[1],92);b[1]++;v(c,b[1],110);break a;case 13:v(c,b[1],92);b[1]++;v(c,b[1],114);break a;default:break c}}if(34>d)break b}v(c,b[1],92);b[1]++;v(c,b[1],d);break a}v(c,b[1],92);b[1]++;v(c,b[1],48+(d/ep|0)|0);b[1]++;v(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;v(c,b[1],48+(d%10|0)|0);break a}v(c,b[1],d)}b[1]++;var n=f+1|0;if(k===f)break;f=n}}return c}function -j3(a){return j2(jI,a)}function -j4(a,b){return tw(a,b)}function -j5(a,b,c){tx(a,b,c);return}function -fg(a,b){return aa(aT(a,b))}function -j8(a,b,c,d){var -e=c;for(;;){if(b<=e)throw g(W,1);if(V(a,e)===d)return e;e=e+1|0}}function -j9(a,b,c){var -d=p(a);if(0<=b&&d>=b)try{j8(a,d,b,c);var +j4(a){return j3(jJ,a)}function +j5(a,b){return ty(a,b)}function +j6(a,b,c){tz(a,b,c)}function +fg(a,b){return ab(aT(a,b))}function +j9(a,b,c,d){var +e=c;for(;;){if(b<=e)throw g(V,1);if(U(a,e)===d)return e;e=e+1|0}}function +j_(a,b,c){var +d=o(a);if(0<=b&&d>=b)try{j9(a,d,b,c);var f=1;return f}catch(f){var -e=$(f);if(e===W)return 0;throw g(e,0)}return t(j_)}function -b8(a,b){return j4(b7(a),b)}function -j6(a,b,c){return aa(fd(b7(a),b,c))}function -j7(a){return aa(j1(b7(a)))}function -j$(a,b){return j9(a,0,b)}function -ka(a){return aa(j3(b7(a)))}function -kb(a,b){return un(a,b)}function -fh(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){to(a,b,c,d,e);return}return t(ke)}function -ki(a,b){var +e=aa(f);if(e===V)return 0;throw g(e,0)}return t(j$)}function +b9(a,b){return j5(b8(a),b)}function +j7(a,b,c){return ab(fd(b8(a),b,c))}function +j8(a){return ab(j2(b8(a)))}function +ka(a,b){return j_(a,0,b)}function +kb(a){return ab(j4(b8(a)))}function +kc(a,b){return us(a,b)}function +fh(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){tp(a,b,c,d,e);return}return t(kf)}function +kj(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function fi(a){if(!a)return[0];var -b=a[2],c=a[1],e=aj(ki(0,a),c);return function(a,b){var +b=a[2],c=a[1],e=ak(kj(0,a),c);return function(a,b){var d=a,c=b;for(;;){if(!c)return e;var f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function -kc(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return tp(a,b,c);return t(kd)}function -kf(a,b,c){if(b.length-1!==c.length-1)return t(kg);var +kd(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return tr(a,b,c);return t(ke)}function +kg(a,b,c){if(b.length-1!==c.length-1)return t(kh);var e=b.length-2|0,f=0;if(e>=0){var d=f;for(;;){i(a,b[1+d],c[1+d]);var g=d+1|0;if(e===d)break;d=g}}return 0}function -kh(a,b){var +ki(a,b){var d=b.length-1;if(0===d)return[0];var -e=aj(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var +e=ak(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var c=g;for(;;){e[1+c]=h(a,b[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -kj(k){function -j(a){return a?a[4]:0}function +kk(k){function +h(a){return a?a[4]:0}function d(a,b,c){var d=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function -l(a,b,c){var -g=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var -w=h<=g?g+1|0:h+1|0;return[0,a,b,c,w]}if(!c)return t(kn);var -k=c[3],m=c[2],f=c[1],r=j(f);if(r<=j(k))return d(d(a,b,f),m,k);if(!f)return t(km);var +j(a,b,c){var +g=a?a[4]:0,i=c?c[4]:0;if((i+2|0)=i){var +w=i<=g?g+1|0:i+1|0;return[0,a,b,c,w]}if(!c)return t(ko);var +k=c[3],m=c[2],f=c[1],r=h(f);if(r<=h(k))return d(d(a,b,f),m,k);if(!f)return t(kn);var s=f[2],u=f[1],v=d(f[3],m,k);return d(d(a,b,u),s,v)}function c(a,b){if(!b)return[0,0,a,0,1];var d=b[3],e=b[2],f=b[1],g=i(k[1],a,e);if(0===g)return b;if(0<=g){var -h=c(a,d);return d===h?b:l(f,e,h)}var -j=c(a,f);return f===j?b:l(j,e,d)}function +h=c(a,d);return d===h?b:j(f,e,h)}var +l=c(a,f);return f===l?b:j(l,e,d)}function b(a){return[0,0,a,0,1]}var m=0;function e(a,b){var -c=b;for(;;){if(!c)return;var -d=c[3],f=c[2];e(a,c[1]);h(a,f);c=d}}function -n(a,b){var d=a,c=b;for(;;){if(!c)return d;var -e=c[2],f=c[1];d=[0,e,n(d,c[3])];c=f}}function -o(a,b,c){var -d=c;for(;;){if(!d)return;var -e=d[3],f=d[1];d=h(b,d[2])?e:f}}function -p(a){function +f=c[2],g=c[1];d=[0,f,e(d,c[3])];c=g}}function +n(a){function c(a,b){if(3>=a>>>0)switch(a){case 0:return[0,0,b];case 1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case @@ -1267,36 +1247,34 @@ c(a,b){if(3>=a>>>0)switch(a){case h=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var i=b[2];if(i){var j=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var -k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,ko],1);var -o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(dh(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,m,,,,,,,,,,,,,,e,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var -c=b;for(;;){if(!c)return;var -d=c[2],e=c[3],f=c[1];if(h(a,d))return o(d,a,e);c=f}},,,,,,,,function(a){if(!a)return m;var +k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,kp],1);var +o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(di(a),a)[1]}return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return e(0,a)},,,,,,,,,,,,,,,,,,,function(a){if(!a)return m;var f=a[2],d=a[1];if(!f)return b(d);var g=f[2],e=f[1];if(!g)return c(e,b(d));var h=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var -j=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return p(jU(k[1],a));var -n=j[1];return c(n,c(l,c(i,c(e,b(d)))))}]}function -kp(a){var -b=kj(a);return[0,b[17],b[4],,,,,,,,b[39],,,,,,,,,,,,b[50],b[31],,,,,,,,,,,,,,,b[58]]}function -kq(f){function +j=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return n(jV(k[1],a));var +o=j[1];return c(o,c(l,c(i,c(e,b(d)))))}]}function +kq(a){var +b=kk(a);return[0,,,,,,,,,,b[39],,,,,,,,,,,,,,,,,,,,,,,,,,,,b[58]]}function +kr(f){function h(a){return a?a[5]:0}function e(a,b,c,d){var e=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function d(a,b,c,d){var -i=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var -B=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return t(ku);var -l=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return t(kt);var +B=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return t(kv);var +l=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return t(ku);var x=g[3],y=g[2],z=g[1],A=e(g[4],p,o,l);return e(e(a,b,c,z),y,x,A)}function j(a,b,c){if(!c)return[0,0,a,b,0,1];var e=c[4],h=c[3],k=c[2],g=c[1],o=c[5],l=i(f[1],a,k);if(0===l)return h===b?c:[0,g,a,b,e,o];if(0<=l){var m=j(a,b,e);return e===m?c:d(g,k,h,m)}var n=j(a,b,g);return g===n?c:d(n,k,h,e)}function l(a){var -b=a;for(;;){if(!b)throw g(W,1);var +b=a;for(;;){if(!b)throw g(V,1);var c=b[1];if(!c)return[0,b[2],b[3]];b=c}}function -c(a){if(!a)return t(kv);var +c(a){if(!a)return t(kw);var b=a[1];if(!b)return a[4];var e=a[4],f=a[3],g=a[2];return d(c(b),g,f,e)}function n(a,b){if(!a)return b;if(!b)return a;var @@ -1305,136 +1283,136 @@ k(a,b){if(!b)return 0;var c=b[4],h=b[3],g=b[2],e=b[1],j=i(f[1],a,g);if(0===j)return n(e,c);if(0<=j){var l=k(a,c);return c===l?b:d(e,g,h,l)}var m=k(a,e);return e===m?b:d(m,g,h,c)}return[0,,,,,0,,j,function(a,b){var -c=b;for(;;){if(!c)throw g(W,1);var +c=b;for(;;){if(!c)throw g(V,1);var e=c[4],h=c[3],j=c[1],d=i(f[1],a,c[2]);if(0===d)return h;var k=0<=d?e:j;c=k}},,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return 0;var e=c[4],g=c[3],h=c[1],d=i(f[1],a,c[2]);if(0===d)return[0,g];var j=0<=d?e:h;c=j}},,,,,,,k]}function -kw(a){var -b=kq(a);return[0,b[5],b[7],,,,b[24],,,,,,,,,,,b[8],b[17]]}function +kx(a){var +b=kr(a);return[0,b[5],b[7],,,,b[24],,,,,,,,,,,b[8],b[17]]}function bz(a){return[0,0,0]}function -bA(a){a[1]=0;a[2]=0;return}function -a5(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function +bA(a){a[1]=0;a[2]=0}function +a5(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0}function a6(a){var b=a[1];if(!b)return 0;var c=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function a7(a){var b=a[1];return b?[0,b[1]]:0}function -kx(a,b){return aS(a,b[1])}var -kz=[c,ky,ao(0)];function -dk(a){return[0,0,0,0]}function -dl(a){a[1]=0;a[2]=0;a[3]=0;return}function -dm(a,b){var -c=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function +ky(a,b){return aS(a,b[1])}var +kA=[r,kz,ao(0)];function +dl(a){return[0,0,0,0]}function +dm(a){a[1]=0;a[2]=0;a[3]=0}function +dn(a,b){var +c=[0,a,0],d=b[3];if(d){b[1]=b[1]+1|0;d[2]=c;b[3]=c;return}b[1]=1;b[2]=c;b[3]=c}function fj(a){var -b=a[2];if(!b)throw g(kz,1);var +b=a[2];if(!b)throw g(kA,1);var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return c}dl(a);return c}function -dn(a){return 0===a[1]?1:0}function -kA(a){var -b=a[2];return b?[0,b[1]]:0}function +d=b[2];a[1]=a[1]-1|0;a[2]=d;return c}dm(a);return c}function +dp(a){return 0===a[1]?1:0}function kB(a){var +b=a[2];return b?[0,b[1]]:0}function +kC(a){var b=a[2];if(!b)return 0;var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}dl(a);return[0,c]}function -b9(a){var +d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}dm(a);return[0,c]}function +b_(a){var b=1<=a?a:1,c=bv=(d+b|0))break;c[1]=2*c[1]|0}if(bve){if(32!==e){if(43>e)break a;switch(e-43|0){case +d=b6(a),c=o(b),e=T(b,0);a:{b:{if(58>e){if(32!==e){if(43>e)break a;switch(e-43|0){case 5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var -f=aT(d+1|0,48);az(f,0,e);af(b,1,f,(d-c|0)+2|0,c-1|0);return aa(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(c>>0)break a}else if(65>e)break a}if(ca)return b;var -h=[0,0],i=p(b)-1|0,n=0;if(i>=0){var -d=n;for(;;){if(9>=V(b,d)+hZ>>>0)h[1]++;var +d=b6(b),e=kP(ms,a),c=fs(16);a8(c,37);kQ(c,a);a8(c,46);H(c,jY(d));a8(c,e);return fu(c)}function +ca(a,b){if(13>a)return b;var +h=[0,0],i=o(b)-1|0,n=0;if(i>=0){var +d=n;for(;;){if(9>=U(b,d)+hZ>>>0)h[1]++;var r=d+1|0;if(i===d)break;d=r}}var -j=h[1],k=F(p(b)+((j-1|0)/3|0)|0),l=[0,0];function -e(a){az(k,l[1],a);l[1]++;return}var -f=[0,((j-1|0)%3|0)+1|0],m=p(b)-1|0,o=0;if(m>=0){var -c=o;for(;;){var -g=V(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var -q=c+1|0;if(m===c)break;c=q}}return aa(k)}function -ms(a,b){return b$(a,c2(lz(a),b))}function -mt(a,b){return b$(a,c2(l1(a),b))}function -mu(a,b){return b$(a,c2(md(a),b))}function -mv(a,b){return b$(a,tT(lN(a),b))}function +j=h[1],k=F(o(b)+((j-1|0)/3|0)|0),l=[0,0];function +e(a){az(k,l[1],a);l[1]++}var +f=[0,((j-1|0)%3|0)+1|0],m=o(b)-1|0,p=0;if(m>=0){var +c=p;for(;;){var +g=U(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var +q=c+1|0;if(m===c)break;c=q}}return ab(k)}function +mt(a,b){return ca(a,c2(lA(a),b))}function +mu(a,b){return ca(a,c2(l2(a),b))}function +mv(a,b){return ca(a,c2(me(a),b))}function +mw(a,b){return ca(a,tV(lO(a),b))}function at(d,b,c){function a(a){switch(d[1]){case 0:var e=45;break;case 1:var e=43;break;default:var -e=32}return tP(c,b,e)}function +e=32}return tR(c,b,e)}function e(a){var -b=ty(c);return 3===b?c<0.?mx:my:4<=b?mz:a}function +b=tA(c);return 3===b?c<0.?my:mz:4<=b?mA:a}function f(b){var -e=p(b);return function(a){var +e=o(b);return function(a){var c=a;for(;;){if(c===e)return 0;var -d=T(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:ar(b,mw)}switch(d[2]){case -5:return e(f(eK(fw(d,b),c)));case +d=T(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:ar(b,mx)}switch(d[2]){case +5:return e(f(eL(fw(d,b),c)));case 6:return a(0);case -7:return ka(a(0));case -8:return e(a(0));default:return eK(fw(d,b),c)}}function -mA(a){var -b=jB(a),c=p(b),d=aT(c+2|0,39);bV(b,0,d,1,c);return aa(d)}function +7:return kb(a(0));case +8:return e(a(0));default:return eL(fw(d,b),c)}}function mB(a){var -b=fs(16);dt(b,a);return fu(b)}function +b=jC(a),c=o(b),d=aT(c+2|0,39);bW(b,0,d,1,c);return ab(d)}function +mC(a){var +b=fs(16);du(b,a);return fu(b)}function bM(a,b,c,d){var k=b,j=c,e=d;for(;;){if(typeof e==="number")return h(k,j);switch(e[0]){case 0:var -u=e[1];return function(a){return n(k,[5,j,a],u)};case +u=e[1];return function(a){return m(k,[5,j,a],u)};case 1:var -v=e[1];return function(a){return n(k,[4,j,mA(a)],v)};case -2:return du(k,j,e[2],e[1],function(a){return a});case -3:return du(k,j,e[2],e[1],ly);case -4:return ca(k,j,e[4],e[2],e[3],ms,e[1]);case -5:return ca(k,j,e[4],e[2],e[3],mt,e[1]);case -6:return ca(k,j,e[4],e[2],e[3],mu,e[1]);case -7:return ca(k,j,e[4],e[2],e[3],mv,e[1]);case -8:return mC(k,j,e[4],e[2],e[3],e[1]);case -9:return du(k,j,e[2],e[1],jf);case +v=e[1];return function(a){return m(k,[4,j,mB(a)],v)};case +2:return dv(k,j,e[2],e[1],function(a){return a});case +3:return dv(k,j,e[2],e[1],lz);case +4:return cb(k,j,e[4],e[2],e[3],mt,e[1]);case +5:return cb(k,j,e[4],e[2],e[3],mu,e[1]);case +6:return cb(k,j,e[4],e[2],e[3],mv,e[1]);case +7:return cb(k,j,e[4],e[2],e[3],mw,e[1]);case +8:return mD(k,j,e[4],e[2],e[3],e[1]);case +9:return dv(k,j,e[2],e[1],jg);case 10:j=[7,j];e=e[1];break;case 11:j=[2,j,e[1]];e=e[2];break;case 12:j=[3,j,e[1]];e=e[2];break;case 13:var -w=e[3],x=mB(e[2]);return function(a){return n(k,[4,j,x],w)};case +w=e[3],x=mC(e[2]);return function(a){return m(k,[4,j,x],w)};case 14:var -y=e[3],z=e[2];return function(a){return n(k,j,s(lx(a[1],z),y))};case +y=e[3],z=e[2];return function(a){return m(k,j,s(ly(a[1],z),y))};case 15:var -A=e[1];return function(c,b){return n(k,[6,j,function(a){return i(c,a,b)}],A)};case +A=e[1];return function(c,b){return m(k,[6,j,function(a){return i(c,a,b)}],A)};case 16:var -B=e[1];return function(a){return n(k,[6,j,a],B)};case +B=e[1];return function(a){return m(k,[6,j,a],B)};case 17:j=[0,j,e[1]];e=e[2];break;case 18:var l=e[1];if(0===l[0]){let -b=j,c=k,d=e[2];k=function(a){return n(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let -b=j,c=k,d=e[2];k=function(a){return n(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case -19:throw g([0,f,mE],1);case +b=j,c=k,d=e[2];k=function(a){return m(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let +b=j,c=k,d=e[2];k=function(a){return m(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case +19:throw g([0,f,mF],1);case 20:var -C=e[3],D=[8,j,mF];return function(a){return n(k,D,C)};case +C=e[3],D=[8,j,mG];return function(a){return m(k,D,C)};case 21:var -E=e[2];return function(a){return n(k,[4,j,c2(hW,a)],E)};case +E=e[2];return function(a){return m(k,[4,j,c2(hW,a)],E)};case 22:var -F=e[1];return function(a){return n(k,[5,j,a],F)};case +F=e[1];return function(a){return m(k,[5,j,a],F)};case 23:var -m=e[2],p=e[1];return a<50?hb(a+1|0,k,j,p,m):o(hb,[0,k,j,p,m]);default:var -q=e[3],r=e[1],t=h(e[2],0);return a<50?eb(a+1|0,k,j,q,r,t):o(eb,[0,k,j,q,r,t])}}}function -n(a,b,c){return aR(bM(0,a,b,c))}function +o=e[2],p=e[1];return a<50?hb(a+1|0,k,j,p,o):n(hb,[0,k,j,p,o]);default:var +q=e[3],r=e[1],t=h(e[2],0);return a<50?ec(a+1|0,k,j,q,r,t):n(ec,[0,k,j,q,r,t])}}}function +m(a,b,c){return aR(bM(0,a,b,c))}function hb(a,b,c,d,e){if(typeof d==="number")switch(d){case -0:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -1:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -2:throw g([0,f,mG],1);default:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e])}switch(d[0]){case -0:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -1:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -2:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -3:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -4:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -5:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -6:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -7:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -8:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case +0:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +1:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +2:throw g([0,f,mH],1);default:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e])}switch(d[0]){case +0:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +1:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +2:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +3:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +4:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +5:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +6:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +7:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case +8:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);case 9:var -h=d[2];return a<50?ec(a+1|0,b,c,h,e):o(ec,[0,b,c,h,e]);case -10:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);default:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e])}}function -ec(a,h,c,d,e){if(typeof -d==="number")return a<50?q(a+1|0,h,c,e):o(q,[0,h,c,e]);switch(d[0]){case +h=d[2];return a<50?ed(a+1|0,b,c,h,e):n(ed,[0,b,c,h,e]);case +10:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e]);default:return a<50?p(a+1|0,b,c,e):n(p,[0,b,c,e])}}function +ed(a,h,c,d,e){if(typeof +d==="number")return a<50?p(a+1|0,h,c,e):n(p,[0,h,c,e]);switch(d[0]){case 0:var -b=d[1];return function(a){return Y(h,c,b,e)};case +b=d[1];return function(a){return X(h,c,b,e)};case 1:var -i=d[1];return function(a){return Y(h,c,i,e)};case +i=d[1];return function(a){return X(h,c,i,e)};case 2:var -j=d[1];return function(a){return Y(h,c,j,e)};case +j=d[1];return function(a){return X(h,c,j,e)};case 3:var -k=d[1];return function(a){return Y(h,c,k,e)};case +k=d[1];return function(a){return X(h,c,k,e)};case 4:var -l=d[1];return function(a){return Y(h,c,l,e)};case +l=d[1];return function(a){return X(h,c,l,e)};case 5:var -m=d[1];return function(a){return Y(h,c,m,e)};case +m=d[1];return function(a){return X(h,c,m,e)};case 6:var -n=d[1];return function(a){return Y(h,c,n,e)};case +o=d[1];return function(a){return X(h,c,o,e)};case 7:var -p=d[1];return function(a){return Y(h,c,p,e)};case +q=d[1];return function(a){return X(h,c,q,e)};case 8:var -r=d[2];return function(a){return Y(h,c,r,e)};case +r=d[2];return function(a){return X(h,c,r,e)};case 9:var -s=d[3],t=d[2],u=B(x(d[1]),t);return function(a){return Y(h,c,L(u,s),e)};case +s=d[3],t=d[2],u=B(x(d[1]),t);return function(a){return X(h,c,L(u,s),e)};case 10:var -v=d[1];return function(a,b){return Y(h,c,v,e)};case +v=d[1];return function(a,b){return X(h,c,v,e)};case 11:var -w=d[1];return function(a){return Y(h,c,w,e)};case +w=d[1];return function(a){return X(h,c,w,e)};case 12:var -y=d[1];return function(a){return Y(h,c,y,e)};case -13:throw g([0,f,mH],1);default:throw g([0,f,mI],1)}}function -Y(a,b,c,d){return aR(ec(0,a,b,c,d))}function -q(a,b,c,d){var -e=[8,c,mJ];return a<50?bM(a+1|0,b,e,d):o(bM,[0,b,e,d])}function -du(g,f,c,d,e){if(typeof -d==="number")return function(a){return n(g,[4,f,h(e,a)],c)};if(0===d[0]){var -b=d[2],i=d[1];return function(a){return n(g,[4,f,Q(i,b,h(e,a))],c)}}var -j=d[1];return function(a,b){return n(g,[4,f,Q(j,a,h(e,b))],c)}}function -ca(k,j,h,d,e,f,g){if(typeof +y=d[1];return function(a){return X(h,c,y,e)};case +13:throw g([0,f,mI],1);default:throw g([0,f,mJ],1)}}function +X(a,b,c,d){return aR(ed(0,a,b,c,d))}function +p(a,b,c,d){var +e=[8,c,mK];return a<50?bM(a+1|0,b,e,d):n(bM,[0,b,e,d])}function +dv(g,f,c,d,e){if(typeof +d==="number")return function(a){return m(g,[4,f,h(e,a)],c)};if(0===d[0]){var +b=d[2],i=d[1];return function(a){return m(g,[4,f,Q(i,b,h(e,a))],c)}}var +j=d[1];return function(a,b){return m(g,[4,f,Q(j,a,h(e,b))],c)}}function +cb(k,j,h,d,e,f,g){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return n(k,[4,j,a9(a,i(f,g,b))],h)}:function(a){return n(k,[4,j,i(f,g,a)],h)};var -b=e[1];return function(a){return n(k,[4,j,a9(b,i(f,g,a))],h)}}if(0===d[0]){var +e==="number")return e?function(a,b){return m(k,[4,j,a9(a,i(f,g,b))],h)}:function(a){return m(k,[4,j,i(f,g,a)],h)};var +b=e[1];return function(a){return m(k,[4,j,a9(b,i(f,g,a))],h)}}if(0===d[0]){var c=d[2],l=d[1];if(typeof -e==="number")return e?function(a,b){return n(k,[4,j,Q(l,c,a9(a,i(f,g,b)))],h)}:function(a){return n(k,[4,j,Q(l,c,i(f,g,a))],h)};var -o=e[1];return function(a){return n(k,[4,j,Q(l,c,a9(o,i(f,g,a)))],h)}}var -m=d[1];if(typeof -e==="number")return e?function(a,b,c){return n(k,[4,j,Q(m,a,a9(b,i(f,g,c)))],h)}:function(a,b){return n(k,[4,j,Q(m,a,i(f,g,b))],h)};var -p=e[1];return function(a,b){return n(k,[4,j,Q(m,a,a9(p,i(f,g,b)))],h)}}function -mC(i,h,g,d,e,f){if(typeof +e==="number")return e?function(a,b){return m(k,[4,j,Q(l,c,a9(a,i(f,g,b)))],h)}:function(a){return m(k,[4,j,Q(l,c,i(f,g,a))],h)};var +o=e[1];return function(a){return m(k,[4,j,Q(l,c,a9(o,i(f,g,a)))],h)}}var +n=d[1];if(typeof +e==="number")return e?function(a,b,c){return m(k,[4,j,Q(n,a,a9(b,i(f,g,c)))],h)}:function(a,b){return m(k,[4,j,Q(n,a,i(f,g,b))],h)};var +p=e[1];return function(a,b){return m(k,[4,j,Q(n,a,a9(p,i(f,g,b)))],h)}}function +mD(i,h,g,d,e,f){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return n(i,[4,h,at(f,a,b)],g)}:function(a){return n(i,[4,h,at(f,ds(f),a)],g)};var -b=e[1];return function(a){return n(i,[4,h,at(f,b,a)],g)}}if(0===d[0]){var +e==="number")return e?function(a,b){return m(i,[4,h,at(f,a,b)],g)}:function(a){return m(i,[4,h,at(f,dt(f),a)],g)};var +b=e[1];return function(a){return m(i,[4,h,at(f,b,a)],g)}}if(0===d[0]){var c=d[2],j=d[1];if(typeof -e==="number")return e?function(a,b){return n(i,[4,h,Q(j,c,at(f,a,b))],g)}:function(a){return n(i,[4,h,Q(j,c,at(f,ds(f),a))],g)};var -l=e[1];return function(a){return n(i,[4,h,Q(j,c,at(f,l,a))],g)}}var +e==="number")return e?function(a,b){return m(i,[4,h,Q(j,c,at(f,a,b))],g)}:function(a){return m(i,[4,h,Q(j,c,at(f,dt(f),a))],g)};var +l=e[1];return function(a){return m(i,[4,h,Q(j,c,at(f,l,a))],g)}}var k=d[1];if(typeof -e==="number")return e?function(a,b,c){return n(i,[4,h,Q(k,a,at(f,b,c))],g)}:function(a,b){return n(i,[4,h,Q(k,a,at(f,ds(f),b))],g)};var -m=e[1];return function(a,b){return n(i,[4,h,Q(k,a,at(f,m,b))],g)}}function -eb(a,b,c,d,e,f){if(e){var -i=e[1];return function(a){return mD(b,c,d,i,h(f,a))}}var -g=[4,c,f];return a<50?bM(a+1|0,b,g,d):o(bM,[0,b,g,d])}function -mD(a,b,c,d,e){return aR(eb(0,a,b,c,d,e))}function +e==="number")return e?function(a,b,c){return m(i,[4,h,Q(k,a,at(f,b,c))],g)}:function(a,b){return m(i,[4,h,Q(k,a,at(f,dt(f),b))],g)};var +n=e[1];return function(a,b){return m(i,[4,h,Q(k,a,at(f,n,b))],g)}}function +ec(a,b,c,d,e,f){if(e){var +i=e[1];return function(a){return mE(b,c,d,i,h(f,a))}}var +g=[4,c,f];return a<50?bM(a+1|0,b,g,d):n(bM,[0,b,g,d])}function +mE(a,b,c,d,e){return aR(ec(0,a,b,c,d,e))}function au(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case @@ -2043,8 +2021,8 @@ c==="number")return;switch(c[0]){case f=c[1],g=fv(c[2]);au(a,f);return bt(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];au(a,e);bt(a,mK);c=i}else{var -j=d[1];au(a,e);bt(a,mL);c=j}break;case +i=d[1];au(a,e);bt(a,mL);c=i}else{var +j=d[1];au(a,e);bt(a,mM);c=j}break;case 6:var m=c[2];au(a,c[1]);return h(m,a);case 7:au(a,c[1]);return bu(a);case @@ -2053,7 +2031,7 @@ n=c[2];au(a,c[1]);return t(n);case 2:case 4:var k=c[2];au(a,c[1]);return bt(a,k);default:var -l=c[2];au(a,c[1]);return jp(a,l)}}}function +l=c[2];au(a,c[1]);return jq(a,l)}}}function aD(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case @@ -2061,8 +2039,8 @@ c==="number")return;switch(c[0]){case f=c[1],g=fv(c[2]);aD(a,f);return bB(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];aD(a,e);bB(a,mM);c=i}else{var -j=d[1];aD(a,e);bB(a,mN);c=j}break;case +i=d[1];aD(a,e);bB(a,mN);c=i}else{var +j=d[1];aD(a,e);bB(a,mO);c=j}break;case 6:var m=c[2];aD(a,c[1]);return bB(a,h(m,0));case 7:c=c[1];break;case @@ -2071,110 +2049,110 @@ n=c[2];aD(a,c[1]);return t(n);case 2:case 4:var k=c[2];aD(a,c[1]);return bB(a,k);default:var -l=c[2];aD(a,c[1]);return kF(a,l)}}}function -mO(d,b,c){return n(function(a){au(b,a);return h(d,b)},0,c[1])}function -cb(a,b){return mO(function(a){return 0},a,b)}function -dv(a){return cb(X,a)}function -mP(c,b){return n(function(a){var -b=b9(64);aD(b,a);return h(c,fk(b))},0,b[1])}function -y(a){return mP(function(a){return a},a)}var -dw=bx(0);function -dy(a,b){var -c=a[1+b];return jq(c)?a3(c)===cM?h(y(mQ),c):a3(c)===h7?jk(c):mR:h(y(mS),c)}function -fx(a,b){if(a.length-1<=b)return mT;var -c=fx(a,b+1|0),d=dy(a,b);return i(y(mU),d,c)}function -mV(a){var +l=c[2];aD(a,c[1]);return kG(a,l)}}}function +mP(d,b,c){return m(function(a){au(b,a);return h(d,b)},0,c[1])}function +cc(a,b){return mP(function(a){return 0},a,b)}function +dw(a){return cc(W,a)}function +mQ(c,b){return m(function(a){var +b=b_(64);aD(b,a);return h(c,fk(b))},0,b[1])}function +y(a){return mQ(function(a){return a},a)}var +dx=bx(0);function +dz(a,b){var +c=a[1+b];return jr(c)?a3(c)===cN?h(y(mR),c):a3(c)===h7?jl(c):mS:h(y(mT),c)}function +fx(a,b){if(a.length-1<=b)return mU;var +c=fx(a,b+1|0),d=dz(a,b);return i(y(mV),d,c)}function +mW(a){var b=a.length-1;if(2>=b>>>0)switch(b){case -0:return mX;case -1:return mY;default:var -e=dy(a,1);return h(y(mZ),e)}var -c=fx(a,2),d=dy(a,1);return i(y(mW),d,c)}function -m0(d){return function(a){var +0:return mY;case +1:return mZ;default:var +e=dz(a,1);return h(y(m0),e)}var +c=fx(a,2),d=dz(a,1);return i(y(mX),d,c)}function +m1(d){return function(a){var b=a;for(;;){if(!b)return 0;var e=b[2],f=b[1];a:{try{var -c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(bw(dw))}function -m1(a){if(0!==a3(a))return[0,a[1],0];var -b=a[1][1];return[0,b,[0,mV(a)]]}function -m2(a){var -b=m1(a),c=b[2],d=b[1];return c?ar(d,c[1]):d}function -m3(a){if(a===dc)return m4;if(a===e3)return m5;if(a[1]===e2){var -b=a[2],e=b[3],i=b[2],j=b[1];return ef(y(dx),j,i,e,e+5|0,m6)}if(a[1]===f){var -c=a[2],g=c[3],k=c[2],l=c[1];return ef(y(dx),l,k,g,g+6|0,m7)}if(a[1]!==e5)return m2(a);var -d=a[2],h=d[3],m=d[2],n=d[1];return ef(y(dx),n,m,h,h+6|0,m8)}function -cc(a){var -b=m0(a);return b?b[1]:m3(a)}function -m9(a){var -b=[0,tz(a)];return b}function -m_(c,b){function -a(a){return a?0===c?m$:na:0===c?nb:nc}if(0!==b[0]){if(b[1])return 0;var -p=a(0);return[0,h(y(ni),p)]}if(b[3]===b[6])var -e=b[3],d=h(y(nd),e);else +c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(bw(dx))}function +m2(a){if(0!==a3(a))return[0,a[1],0];var +b=a[1][1];return[0,b,[0,mW(a)]]}function +m3(a){var +b=m2(a),c=b[2],d=b[1];return c?ar(d,c[1]):d}function +m4(a){if(a===dd)return m5;if(a===e3)return m6;if(a[1]===e2){var +b=a[2],e=b[3],i=b[2],j=b[1];return eg(y(dy),j,i,e,e+5|0,m7)}if(a[1]===f){var +c=a[2],g=c[3],k=c[2],l=c[1];return eg(y(dy),l,k,g,g+6|0,m8)}if(a[1]!==e5)return m3(a);var +d=a[2],h=d[3],m=d[2],n=d[1];return eg(y(dy),n,m,h,h+6|0,m9)}function +cd(a){var +b=m1(a);return b?b[1]:m4(a)}function +m_(a){var +b=[0,tB(a)];return b}function +m$(c,b){function +a(a){return a?0===c?na:nb:0===c?nc:nd}if(0!==b[0]){if(b[1])return 0;var +p=a(0);return[0,h(y(nj),p)]}if(b[3]===b[6])var +e=b[3],d=h(y(ne),e);else var -n=b[6],o=b[3],d=i(y(nh),o,n);var -f=b[7],g=b[4],j=b[8]?ne:ng,k=b[2],l=b[9],m=a(b[1]);return[0,tk(y(nf),m,l,k,j,d,g,f)]}function -nj(a,b){if(!b)return cb(a,nl);var +n=b[6],o=b[3],d=i(y(ni),o,n);var +f=b[7],g=b[4],j=b[8]?nf:nh,k=b[2],l=b[9],m=a(b[1]);return[0,tl(y(ng),m,l,k,j,d,g,f)]}function +nk(a,b){if(!b)return cc(a,nm);var d=b[1],e=d.length-2|0,g=0;if(e>=0){var c=g;for(;;){var -f=m_(c,j(d,c)[1+c]);if(f){var -i=f[1];h(cb(a,nk),i)}var +f=m$(c,j(d,c)[1+c]);if(f){var +i=f[1];h(cc(a,nl),i)}var k=c+1|0;if(e===c)break;c=k}}return 0}function -cd(a,b){return nj(a,m9(b))}var -no=nn.slice();function -np(a,b){var -e=cc(a);h(dv(nq),e);cd(X,b);var -c=uc(0);if(c<0){var -d=b5(c);e8(j(no,d)[1+d])}return bu(X)}var -nr=[0];function +ce(a,b){return nk(a,m_(b))}var +np=no.slice();function +nq(a,b){var +e=cd(a);h(dw(nr),e);ce(W,b);var +c=ug(0);if(c<0){var +d=b6(c);e8(j(np,d)[1+d])}return bu(W)}var +ns=[0];function fy(a){var b=iM(0);return b}function -ns(a,b){try{var -d=b?nr:fy(0);try{df(0)}catch(f){}try{var -f=np(a,d),e=f}catch(f){var -i=$(f),j=fy(0),k=cc(a);h(dv(nu),k);cd(X,d);var -l=cc(i);h(dv(nv),l);cd(X,j);var -e=bu(X)}return e}catch(f){var -c=$(f);if(c===dc)return e8(nt);throw g(c,0)}}eY(ig,function(a,b){try{var -c=ns(a,b);return c}catch(f){return 0}});function -nm(a){for(;;){var -b=bw(dw),c=1-e_(dw,b,[0,a,b]);if(!c)return c}}function -nw(a){return iM(a)}var -ny=[c,nx,ao(0)];nm(function(a){return a[1]===ny?[0,ar(nz,cc(a[2]))]:0});function -dz(a){var -b=a[1]<1?1:0,c=b||(64=0){var -c=i;for(;;){j5(d,c*8|0,b0(j(b,c)[1+c]));var +c=i;for(;;){j6(d,c*8|0,b1(j(b,c)[1+c]));var n=c+1|0;if(f===c)break;c=n}}az(d,e*8|0,1);var g=fz(d);az(d,e*8|0,2);var -h=fz(d),k=b8(h,8),l=b8(h,0),m=b8(g,8);return fB(a,b8(g,0),m,l,k)}function -nJ(a){var -b=fA(0);nI(b,a);return b}function -ce(a){return iZ(a)}function -nK(a){return nJ(ur(0))}function -nL(a){return iU(iZ(a))&1073741823}as([0,function(a){var -b=ce(a),c=ce(a),d=ce(a);return fC(b,c,d,ce(a))}],function(a){return fC(nP,nO,nN,nM)});function -nQ(a){var +h=fz(d),k=b9(h,8),l=b9(h,0),m=b9(g,8);return fB(a,b9(g,0),m,l,k)}function +nK(a){var +b=fA(0);nJ(b,a);return b}function +cf(a){return iZ(a)}function +nL(a){return nK(uw(0))}function +nM(a){return iU(iZ(a))&1073741823}as([0,function(a){var +b=cf(a),c=cf(a),d=cf(a);return fC(b,c,d,cf(a))}],function(a){return fC(nQ,nP,nO,nN)});function +nR(a){var b=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var -ti=i9(h8),fG=ti}catch(f){var -fD=$(f);if(fD!==W)throw g(fD,0);try{var -th=i9("CAMLRUNPARAM"),fF=th}catch(f){var -fE=$(f);if(fE!==W)throw g(fE,0);var -fF=nR}var +tj=i8(h8),fG=tj}catch(f){var +fD=aa(f);if(fD!==V)throw g(fD,0);try{var +ti=i8("CAMLRUNPARAM"),fF=ti}catch(f){var +fE=aa(f);if(fE!==V)throw g(fE,0);var +fF=nS}var fG=fF}var -nS=bx(j$(fG,82)),nT=as(0,nK);function -nU(a,b){var -c=a;for(;;){if(b<=c)return c;if(dg<(c*2|0))return c;c=c*2|0}}function -nW(m,b,c,d){var -g=d.length-1,f=aj(g,0),i=c.length-2|0;function +nT=bx(ka(fG,82)),nU=as(0,nL);function +nV(a,b){var +c=a;for(;;){if(b<=c)return c;if(dh<(c*2|0))return c;c=c*2|0}}function +nX(m,b,c,d){var +g=d.length-1,f=ak(g,0),i=c.length-2|0;function n(a){var c=a;for(;;){if(!c)return;var i=c[1],l=c[2],n=c[3],g=b?c:[0,i,l,0],e=h(m,i),k=j(f,e)[1+e];if(k)k[3]=g;else @@ -2185,68 +2163,68 @@ r=e+1|0;if(i===e)break;e=r}}if(b){var k=g-1|0,p=0;if(k>=0){var a=p;for(;;){var l=j(f,a)[1+a];if(l)l[3]=0;var -q=a+1|0;if(k===a)break;a=q}}}return}function +q=a+1|0;if(k===a)break;a=q}}}}function fH(a,b){var -c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return fO(a,d)}function +c=b[2],d=b[3];ci(a,b[1]);a[9]=a[9]-c|0;n6(a,c);return ci(a,d)}function n9(a){var -b=kB(a[28]);if(!b)return;var +b=a7(a[2]);if(!b)return ch(a);var +c=b[1],d=c[2],e=a[9]>>0)return;return fO(a,d)}function +n_(a){var +b=kC(a[28]);if(!b)return;var c=b[1],d=c[1];a[12]=a[12]-c[3]|0;var -e=aE(d);a[9]=a[9]+e|0;return}function -n_(a,b,c){if(typeof +e=aE(d);a[9]=a[9]+e|0}function +n$(a,b,c){if(typeof c==="number")switch(c){case 0:var j=a7(a[3]);if(!j)return;var k=j[1][1],l=function(a,b){if(!b)return[0,a,0];var -c=b[1],d=b[2];return t8(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case +c=b[1],d=b[2];return t_(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case 1:a6(a[2]);return;case 2:a6(a[3]);return;case 3:var -m=a7(a[2]);return m?fO(a,m[1][2]):cg(a);case +m=a7(a[2]);return m?fO(a,m[1][2]):ch(a);case 4:var -n=a[10]!==(a[6]-a[9]|0)?1:0;return n?n9(a):n;default:var -o=a6(a[5]);if(o)return dA(a,h(a[25],o[1]));return}switch(c[0]){case +n=a[10]!==(a[6]-a[9]|0)?1:0;return n?n_(a):n;default:var +p=a6(a[5]);if(p)return dB(a,h(a[25],p[1]));return}switch(c[0]){case 0:return fN(a,b,c[1]);case 1:var d=c[2],f=c[1],q=d[1],z=d[2],r=a7(a[2]);if(!r)return;var @@ -2254,8 +2232,8 @@ s=r[1],e=s[2];switch(s[1]){case 0:return a_(a,f);case 1:return aU(a,d,e);case 2:return aU(a,d,e);case -3:return a[9]<(b+p(q)|0)?aU(a,d,e):a_(a,f);case -4:return a[11]?a_(a,f):a[9]<(b+p(q)|0)?aU(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=fM;fP(a);if(b)cg(a);return om(a)}ok(a,0)}}function -ci(a,b){oo(a,0);return h(a[18],0)}function +on(a){n5(a);dC(a[1]);bA(a[2]);bA(a[3]);bA(a[4]);bA(a[5]);a[10]=0;a[14]=0;a[9]=a[6];return ok(a)}function +oo(b){return ky(function(a){return om(b,0)},b[4])}function +op(a,b){oo(a);for(;;){if(1>=a[14]){a[13]=fM;fP(a);if(b)ch(a);return on(a)}ol(a,0)}}function +cj(a,b){op(a,0);return h(a[18],0)}function fQ(a,b){var c=b[5],d=b[4],e=b[3],f=b[2];a[17]=b[1];a[18]=f;a[19]=e;a[20]=d;a[21]=c;return 0}function fR(a,b){return[0,,,a[19],a[20],a[21]]}function -dD(a,b){return bO(a[17],op,0,1)}var +dE(a,b){return bO(a[17],oq,0,1)}var fS=fg(80,32);function a$(a,b){var c=b;for(;;){var d=0=c)return bO(a[17],fS,0,c);bO(a[17],fS,0,80);c=c-80|0}}function -oq(a){return a[1]===fL?ar(os,ar(a[2],or)):ot}function -ou(a){return a[1]===fL?ar(ow,ar(a[2],ov)):ox}function -oy(a){return 0}function +or(a){return a[1]===fL?ar(ot,ar(a[2],os)):ou}function +ov(a){return a[1]===fL?ar(ox,ar(a[2],ow)):oy}function oz(a){return 0}function -dE(a,b,c,d,e){var -g=dk(0),h=[0,fJ,oA,0];dm(h,g);var -f=bz(0);dB(f);a5([0,1,h],f);var -i=78,j=bz(0),k=bz(0),l=bz(0);return[0,f,bz(0),l,k,j,i,10,68,i,0,1,1,1,1,je,oB,a,b,c,d,e,0,0,oq,ou,oy,oz,g]}function +oA(a){return 0}function +dF(a,b,c,d,e){var +g=dl(0),h=[0,fJ,oB,0];dn(h,g);var +f=bz(0);dC(f);a5([0,1,h],f);var +i=78,j=bz(0),k=bz(0),l=bz(0);return[0,f,bz(0),l,k,j,i,10,68,i,0,1,1,1,1,jf,oC,a,b,c,d,e,0,0,or,ov,oz,oA,g]}function fT(a,b){var -c=dE(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return dD(c,a)};c[20]=function(a){return a$(c,a)};c[21]=function(a){return a$(c,a)};return c}function +c=dF(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return dE(c,a)};c[20]=function(a){return a$(c,a)};c[21]=function(a){return a$(c,a)};return c}function fU(d){return fT(function(a,b,c){return e7(d,a,b,c)},function(a){return bu(d)})}function fV(d){return fT(function(a,b,c){return fl(d,a,b,c)},function(a){return 0})}var -dF=en;function -fW(a){return b9(dF)}var -fX=fW(0),dG=fU(dd),dH=fU(X),oC=fV(fX),fY=as(0,fW);bC(fY,fX);bC(as(0,function(a){return fV(aC(fY))}),oC);function -cj(a,b,c,d){return fl(aC(a),b,c,d)}function -ck(a,b,c){var -d=aC(b),e=kC(d);e7(a,fk(d),0,e);bu(a);return kD(d)}var -cl=as(0,function(a){return b9(dF)}),cm=as(0,function(a){return b9(dF)}),fZ=as(0,function(a){var -b=dE(function(a,b,c){return cj(cl,a,b,c)},function(a){return ck(dd,cl,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return dD(b,a)};b[20]=function(a){return a$(b,a)};b[21]=function(a){return a$(b,a)};fr(function(a){return ci(b,a)});return b});bC(fZ,dG);var +dG=eo;function +fW(a){return b_(dG)}var +fX=fW(0),dH=fU(de),dI=fU(W),oD=fV(fX),fY=as(0,fW);bC(fY,fX);bC(as(0,function(a){return fV(aC(fY))}),oD);function +ck(a,b,c,d){return fl(aC(a),b,c,d)}function +cl(a,b,c){var +d=aC(b),e=kD(d);e7(a,fk(d),0,e);bu(a);return kE(d)}var +cm=as(0,function(a){return b_(dG)}),cn=as(0,function(a){return b_(dG)}),fZ=as(0,function(a){var +b=dF(function(a,b,c){return ck(cm,a,b,c)},function(a){return cl(de,cm,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return dE(b,a)};b[20]=function(a){return a$(b,a)};b[21]=function(a){return a$(b,a)};fr(function(a){return cj(b,a)});return b});bC(fZ,dH);var f0=as(0,function(a){var -b=dE(function(a,b,c){return cj(cm,a,b,c)},function(a){return ck(X,cm,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return dD(b,a)};b[20]=function(a){return a$(b,a)};b[21]=function(a){return a$(b,a)};fr(function(a){return ci(b,a)});return b});bC(f0,dH);function -f1(a){ci(aC(fZ),0);return ci(aC(f0),0)}jo(f1);kM(function(a){f1(0);var -b=fR(dG,0);fQ(dG,[0,function(a,b,c){return cj(cl,a,b,c)},function(a){return ck(dd,cl,a)},b[3],b[4],b[5]]);var -c=fR(dH,0);return fQ(dH,[0,function(a,b,c){return cj(cm,a,b,c)},function(a){return ck(X,cm,a)},c[3],c[4],c[5]])});function -oD(a,b){var -d=a3(b)===c?b:b[1];eY(a,d);return}oD(oF,[0,[c,oE,ao(0)],[0]]);(function(a){throw a});function -Z(a){return[0,a]}function -cn(a){return 0===a[0]?[0,a[1]]:0}var +b=dF(function(a,b,c){return ck(cn,a,b,c)},function(a){return cl(W,cn,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return dE(b,a)};b[20]=function(a){return a$(b,a)};b[21]=function(a){return a$(b,a)};fr(function(a){return cj(b,a)});return b});bC(f0,dI);function +f1(a){cj(aC(fZ),0);return cj(aC(f0),0)}jp(f1);kN(function(a){f1(0);var +b=fR(dH,0);fQ(dH,[0,function(a,b,c){return ck(cm,a,b,c)},function(a){return cl(de,cm,a)},b[3],b[4],b[5]]);var +c=fR(dI,0);return fQ(dI,[0,function(a,b,c){return ck(cn,a,b,c)},function(a){return cl(W,cn,a)},c[3],c[4],c[5]])});function +oE(a,b){var +c=a3(b)===r?b:b[1];eY(a,c)}oE(oG,[0,[r,oF,ao(0)],[0]]);(function(a){throw a});function +Y(a){return[0,a]}function +co(a){return 0===a[0]?[0,a[1]]:0}var ba=[0,function(a){return a}(0)];function bb(a){return[1,0,0,0,a]}function w(a,b){return 0===a[0]?[0,h(b,a[1])]:bb([0,a,b])}function bc(a,b,c){if(0===a[0]){var d=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return bb([1,a,b,c])}function f2(a,b,c){switch(c[0]){case -0:throw g([0,f,oI],1);case +0:throw g([0,f,oJ],1);case 1:c[3]=[0,b,a,c[3]];return;default:c[2]=[0,b,a,c[2]];return}}function -dI(a,b){if(!b)throw g([0,f,oJ],1);if(b[2]===a)return[0,b[1],b[3]];var -c=dI(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function +dJ(a,b){if(!b)throw g([0,f,oK],1);if(b[2]===a)return[0,b[1],b[3]];var +c=dJ(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function bF(a,b){switch(b[0]){case -0:throw g([0,f,oK],1);case +0:throw g([0,f,oL],1);case 1:var -c=dI(a,b[3]),e=c[1];b[3]=c[2];return e;default:var -d=dI(a,b[2]),h=d[1];b[2]=d[2];return h}}function +c=dJ(a,b[3]),e=c[1];b[3]=c[2];return e;default:var +d=dJ(a,b[2]),h=d[1];b[2]=d[2];return h}}function f3(a,b,c,d){var -e=d;for(;;){if(!e)throw g([0,f,oL],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function -dJ(a,b,c,d){switch(d[0]){case -0:throw g([0,f,oM],1);case +e=d;for(;;){if(!e)throw g([0,f,oM],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function +dK(a,b,c,d){switch(d[0]){case +0:throw g([0,f,oN],1);case 1:return f3(a,b,c,d[3]);default:return f3(a,b,c,d[2])}}function f4(a,b){var -c=b;for(;;){if(!c)throw g([0,f,oN],1);if(c[2]===a)return c[1];c=c[3]}}function -oO(a,b){switch(b[0]){case -0:throw g([0,f,oP],1);case +c=b;for(;;){if(!c)throw g([0,f,oO],1);if(c[2]===a)return c[1];c=c[3]}}function +oP(a,b){switch(b[0]){case +0:throw g([0,f,oQ],1);case 1:return f4(a,b[3]);default:return f4(a,b[2])}}function av(a,b,c,d){switch(d[0]){case -0:throw g([0,f,oQ],1);case +0:throw g([0,f,oR],1);case 1:var j=d[1];if(typeof j==="number"&&!j){if(!c)return;if(b[1])return;b[1]=1;return}var k=d[4];if(7===k[0]){var -n=k[2];if(1===n[0]){var -p=n[1];if(typeof +o=k[2];if(1===o[0]){var +p=o[1];if(typeof p==="number"){if(!p&&c){if(b[1])return;b[1]=1;return}}else if(c)return}}var l=d[1];a:{if(typeof l==="number"&&l){var e=1;break a}var e=c}d[1]=0;var -m=d[2];return a<50?hc(a+1|0,b,e,m):o(hc,[0,b,e,m]);default:var +m=d[2];return a<50?hc(a+1|0,b,e,m):n(hc,[0,b,e,m]);default:var i=d[1];d[1]=0;if(typeof i==="number"){if(!i)return;b[1]=2;return}var q=i[1];if(c)b[1]=2;return h(d[3],q)}}function @@ -2388,61 +2362,61 @@ aF(a,b,c){return aR(av(0,a,b,c))}function hc(a,b,c,d){if(typeof d==="number")return;switch(d[0]){case 0:var -f=d[1];return a<50?av(a+1|0,b,c,f):o(av,[0,b,c,f]);case +f=d[1];return a<50?av(a+1|0,b,c,f):n(av,[0,b,c,f]);case 1:var -g=d[2];aF(b,c,d[1]);return a<50?av(a+1|0,b,c,g):o(av,[0,b,c,g]);case +g=d[2];aF(b,c,d[1]);return a<50?av(a+1|0,b,c,g):n(av,[0,b,c,g]);case 2:var -h=d[3],l=d[2];aF(b,c,d[1]);aF(b,c,l);return a<50?av(a+1|0,b,c,h):o(av,[0,b,c,h]);case +h=d[3],l=d[2];aF(b,c,d[1]);aF(b,c,l);return a<50?av(a+1|0,b,c,h):n(av,[0,b,c,h]);case 3:var -i=d[4],m=d[3],n=d[2];aF(b,c,d[1]);aF(b,c,n);aF(b,c,m);return a<50?av(a+1|0,b,c,i):o(av,[0,b,c,i]);default:var +i=d[4],m=d[3],o=d[2];aF(b,c,d[1]);aF(b,c,o);aF(b,c,m);return a<50?av(a+1|0,b,c,i):n(av,[0,b,c,i]);default:var p=d[1];d[1]=0;var k=p-1|0,q=0;if(k>=0){var e=q;for(;;){aF(b,c,j(d[3],e)[1+e]);var r=e+1|0;if(k===e)break;e=r}}return}}function -oR(a){return i(cb(X,oS),cd,tI(20))}function -co(a,b){var +oS(a){return i(cc(W,oT),ce,tK(20))}function +cp(a,b){var c=[0,0];aF(c,a,b);var -d=2<=c[1]?1:0;return d?oR(0):d}function -dK(a){return bb([5,a])}function -cp(a){return a}function -cq(a,b){if(1===a[0]){var -c=a[4];if(5===c[0]){c[1]=b;return co(0,a)}}throw g([0,f,oT],1)}function +d=2<=c[1]?1:0;return d?oS(0):d}function +dL(a){return bb([5,a])}function +cq(a){return a}function +cr(a,b){if(1===a[0]){var +c=a[4];if(5===c[0]){c[1]=b;return cp(0,a)}}throw g([0,f,oU],1)}function f5(a){if(1===a[0]){var -b=a[4];if(5===b[0])return b[1]}throw g([0,f,oU],1)}function +b=a[4];if(5===b[0])return b[1]}throw g([0,f,oV],1)}function bd(a,b,c){var k=a,h=b,d=c;for(;;)switch(d[0]){case 0:return k;case 1:var e=d[2];if(typeof -e==="number")throw g([0,f,oZ],1);switch(e[0]){case -0:if(e[1]!==h)throw g([0,f,o0],1);var +e==="number")throw g([0,f,o0],1);switch(e[0]){case +0:if(e[1]!==h)throw g([0,f,o1],1);var o=0;break;case 1:var B=e[2],C=e[1];if(C===h)var -D=[0,B];else{if(B!==h)throw g([0,f,o1],1);var +D=[0,B];else{if(B!==h)throw g([0,f,o2],1);var D=[0,C]}var o=D;break;case 2:var u=e[3],v=e[2],w=e[1];if(w===h)var x=[1,v,u];else if(v===h)var -x=[1,w,u];else{if(u!==h)throw g([0,f,o2],1);var +x=[1,w,u];else{if(u!==h)throw g([0,f,o3],1);var x=[1,w,v]}var o=x;break;case 3:var p=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var t=[2,r,q,p];else if(r===h)var t=[2,s,q,p];else if(q===h)var -t=[2,s,r,p];else{if(p!==h)throw g([0,f,o3],1);var +t=[2,s,r,p];else{if(p!==h)throw g([0,f,o4],1);var t=[2,s,r,q]}var o=t;break;default:var -n=bF(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,o4],1);var +n=bF(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,o5],1);var m=e[2]-1|0;e[2]=m;if(n>>2|0))var -T=kc(e[3],0,K>>>1|0),L=[4,e[1],e[2],T];else +T=kd(e[3],0,K>>>1|0),L=[4,e[1],e[2],T];else var L=e;var J=L}var @@ -2464,8 +2438,8 @@ P=z[1];l[2]=0;k=A;h=d;d=P;break;case 6:if(typeof y==="number")return k;var Q=y[1];try{i(l[2],d,Q);return k}catch(f){var -R=$(f);return[0,[0,R,nw(0)],k]}default:var -S=l[1];k=bd(k,d,l[2]);h=d;d=S}break;default:throw g([0,f,o5],1)}}function +R=aa(f);return[0,[0,R,nx(0)],k]}default:var +S=l[1];k=bd(k,d,l[2]);h=d;d=S}break;default:throw g([0,f,o6],1)}}function aG(a,b){var e=a,c=b;for(;;)switch(c[0]){case 0:return;case @@ -2487,7 +2461,7 @@ w=l+1|0;if(4===l)break;l=w}var k=[4,5,5,o];break;default:var i=d[2];if(i>>1|0)}function +gd(a,b){return dN(a,b>>>1|0)}function ge(a,b,c){if(typeof -a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,pw],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,pv],1)}function -ee(a,b,c){if(typeof +a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,px],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,pw],1)}function +ef(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[2];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,pA],1);e[5]=c;var -i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;ge(h,c,d);dN(b,c);return a<50?bN(a+1|0,b,d):o(bN,[0,b,d])}}throw g([0,f,pz],1)}function -px(a,b){return aR(ee(0,a,b))}function -ed(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,pB],1);e[5]=c;var +i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;ge(h,c,d);dO(b,c);return a<50?bN(a+1|0,b,d):n(bN,[0,b,d])}}throw g([0,f,pA],1)}function +py(a,b){return aR(ef(0,a,b))}function +ee(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[4];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,pC],1);e[5]=c;var -i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;ge(h,c,d);dN(b,c);return a<50?bN(a+1|0,b,d):o(bN,[0,b,d])}}throw g([0,f,pB],1)}function -py(a,b){return aR(ed(0,a,b))}function +i=0;else{if(0!==e[0])throw g([0,f,pD],1);e[5]=c;var +i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;ge(h,c,d);dO(b,c);return a<50?bN(a+1|0,b,d):n(bN,[0,b,d])}}throw g([0,f,pC],1)}function +pz(a,b){return aR(ee(0,a,b))}function he(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];a:if(typeof d!=="number"&&0===d[0]){var -e=be(d[2]);if(dM(be(d[4]),e)){py(b,d);break a}}return a<50?ee(a+1|0,b,c):o(ee,[0,b,c])}throw g([0,f,pD],1)}function +e=be(d[2]);if(dN(be(d[4]),e)){pz(b,d);break a}}return a<50?ef(a+1|0,b,c):n(ef,[0,b,c])}throw g([0,f,pE],1)}function hd(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];a:if(typeof d!=="number"&&0===d[0]){var -e=be(d[4]);if(dM(be(d[2]),e)){px(b,d);break a}}return a<50?ed(a+1|0,b,c):o(ed,[0,b,c])}throw g([0,f,pE],1)}function +e=be(d[4]);if(dN(be(d[2]),e)){py(b,d);break a}}return a<50?ee(a+1|0,b,c):n(ee,[0,b,c])}throw g([0,f,pF],1)}function bN(a,b,c){if(typeof c!=="number"&&0===c[0]){var -d=be(c[2]),e=be(c[4]);return d>>2|0}function +cv(a){if(typeof +a==="number")return 0;if(0===a[0]){if(0!==a[1])t(p_);return 0}if(0!==(a[1]&2))t(p$);return a[1]>>>2|0}function aH(a,b){if(typeof a==="number")var c=b;else{if(typeof b!=="number"){var -d=cu(b);return[1,(gj(cu(a),d)+1|0)<<2,a,b]}var +d=cv(b);return[1,(gj(cv(a),d)+1|0)<<2,a,b]}var c=a}return c}function gk(a){return typeof a==="number"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var -dO=1,dP=2,p$=3;function +dP=1,dQ=2,qa=3;function gl(a){return-1===a?1:0}function -dQ(a){return-1!==a?1:0}function +dR(a){return-1!==a?1:0}function bf(a){return(a&3)===3?1:0}function gm(a){return(a&3)===1?1:0}function gn(a){return(a&3)===2?1:0}function go(a){return a|3}function -qa(a){return a>>>2|0}function +qb(a){return a>>>2|0}function gp(a){return a<<2|2}function -bH(a){return a&jd(p$)}function +bH(a){return a&je(qa)}function gq(a){return a[2]}function gr(a){return a[3]}function gs(a){return[0,0,0,0]}function -cv(a){a[1]=a[1]+1|0;return}function -cw(a){a[2]=a[2]+1|0;return}function -cx(a){a[3]=a[3]+1|0;return}function -dR(a,b,c){var +cw(a){a[1]=a[1]+1|0}function +cx(a){a[2]=a[2]+1|0}function +cy(a){a[3]=a[3]+1|0}function +dS(a,b,c){var d=c;for(;;){if(typeof d==="number")return;if(0===d[0]){var -e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,qc],1);cv(a);cx(a);d[1]=e|3}return}var -h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,qd],1);cv(a);cx(a);d[1]=h|3;dR(a,b,d[2]);d=d[3]}}function -cy(a,b,c,d){if(typeof +e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,qd],1);cw(a);cy(a);d[1]=e|3}return}var +h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,qe],1);cw(a);cy(a);d[1]=h|3;dS(a,b,d[2]);d=d[3]}}function +cz(a,b,c,d){if(typeof d==="number")return;if(0===d[0]){var -e=d[1];if(0===(e&c)){cv(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;cx(a);cw(a)}}var -g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,cw(a)):h}var -f=d[1];if(0===(f&c)){cv(a);if(0===(f&3)){d[1]=f|c;dm(d,b)}else{d[1]=-1;cx(a);cw(a);dR(a,c,d[2]);dR(a,c,d[3])}}var -i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,cw(a)):j}function -dS(a,b,c){var +e=d[1];if(0===(e&c)){cw(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;cy(a);cx(a)}}var +g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,cx(a)):h}var +f=d[1];if(0===(f&c)){cw(a);if(0===(f&3)){d[1]=f|c;dn(d,b)}else{d[1]=-1;cy(a);cx(a);dS(a,c,d[2]);dS(a,c,d[3])}}var +i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,cx(a)):j}function +dT(a,b,c){var d=fj(b);if(typeof d!=="number"&&1===d[0]){var -e=(d[1]&3)===c?1:0;return e?(cy(a,b,c,d[2]),cy(a,b,c,d[3])):e}throw g([0,f,qe],1)}function -gt(a,b,c){for(;;){if(dn(b))return;dS(a,b,c)}}function -qf(a,b,c,d){for(;;){if(dn(c))return gt(b,d,dP);if(dn(d))return gt(a,c,dO);dS(a,c,dO);dS(b,d,dP)}}function -dT(a){var -b=a[6];a[6]=b+1|0;return b}function +e=(d[1]&3)===c?1:0;return e?(cz(a,b,c,d[2]),cz(a,b,c,d[3])):e}throw g([0,f,qf],1)}function +gt(a,b,c){for(;;){if(dp(b))return;dT(a,b,c)}}function +qg(a,b,c,d){for(;;){if(dp(c))return gt(b,d,dQ);if(dp(d))return gt(a,c,dP);dT(a,c,dP);dT(b,d,dQ)}}function dU(a){var +b=a[6];a[6]=b+1|0;return b}function +dV(a){var b=a;for(;;){if(typeof b==="number")return;if(0===b[0]){var c=b[1];if(typeof c!=="number"&&0===c[0]){var -e=c[1],i=dQ(e),l=i?bf(e):i;if(l)c[1]=bH(e);return}throw g([0,f,qk],1)}var +e=c[1],i=dR(e),l=i?bf(e):i;if(l)c[1]=bH(e);return}throw g([0,f,ql],1)}var d=b[1];if(typeof d!=="number"&&1===d[0]){var -h=d[1],m=b[4],n=b[3],j=dQ(h),k=j?bf(h):j;if(!k)return k;d[1]=bH(h);dU(n);b=m;continue}throw g([0,f,ql],1)}}function +h=d[1],m=b[4],n=b[3],j=dR(h),k=j?bf(h):j;if(!k)return k;d[1]=bH(h);dV(n);b=m;continue}throw g([0,f,qm],1)}}function gu(a,b){var c=b;for(;;){if(typeof c==="number")return;if(0===c[0]){var d=c[1];if(typeof d!=="number"&&0===d[0]){var e=d[1],u=c[2];if(!gm(e)){if(gl(e)){var -k=dT(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=gp(k);return}if(gn(e)){var -n=qa(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var -q=bf(e);if(q)throw g([0,f,qo],1);return q}var -m=a[2];if(-1a[3])throw g([0,f,qn],1)}d[1]=bH(e);return}throw g([0,f,qm],1)}var +k=dU(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=gp(k);return}if(gn(e)){var +n=qb(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var +q=bf(e);if(q)throw g([0,f,qp],1);return q}var +m=a[2];if(-1a[3])throw g([0,f,qo],1)}d[1]=bH(e);return}throw g([0,f,qn],1)}var h=c[1];if(typeof h!=="number"&&1===h[0]){var r=c[4],s=c[3],i=h[1],w=c[2];if(gl(i)){var -l=dT(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=gp(l);dU(s);return dU(r)}if(!gm(i)){if(gn(i)){var +l=dU(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=gp(l);dV(s);return dV(r)}if(!gm(i)){if(gn(i)){var o=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var -t=bf(i);if(t)throw g([0,f,qr],1);return t}if(-1a[3])throw g([0,f,qq],1)}h[1]=bH(i);gu(a,s);c=r;continue}throw g([0,f,qp],1)}}function +t=bf(i);if(t)throw g([0,f,qs],1);return t}if(-1a[3])throw g([0,f,qr],1)}h[1]=bH(i);gu(a,s);c=r;continue}throw g([0,f,qq],1)}}function bI(a,b){if(typeof b==="number")return 0;if(0!==b[0]){var i=b[1];if(-1===i){var -l=dT(a);b[1]=0;j(a[4],l)[1+l]=b;var +l=dU(a);b[1]=0;j(a[4],l)[1+l]=b;var p=bI(a,b[2]);return[1,b,0,p,bI(a,b[3])]}if(!bf(i)){b[1]=bH(b[1]);var r=bI(a,b[2]);return[1,b,0,r,bI(a,b[3])]}var -d=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,qu],1);var +d=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,qv],1);var m=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var -e=b[1];if(dQ(e)&&bf(e)){var +e=b[1];if(dR(e)&&bf(e)){var c=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var n=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var -dV=[0,0,[0],0,0];function -qb(a){return a[1]}function -qg(a){return a[1]}function -qh(a){return a[2]}function -qi(a,b){var -c=gs(0),d=gs(0),e=dk(0),f=dk(0);cy(c,e,dO,a);cy(d,f,dP,b);qf(c,d,e,f);return[0,c,d]}function -qj(a){if(typeof +dW=[0,0,[0],0,0];function +qc(a){return a[1]}function +qh(a){return a[1]}function +qi(a){return a[2]}function +qj(a,b){var +c=gs(0),d=gs(0),e=dl(0),f=dl(0);cz(c,e,dP,a);cz(d,f,dQ,b);qg(c,d,e,f);return[0,c,d]}function +qk(a){if(typeof a==="number")return;if(0===a[0]){a[1]=0;return}var -b=cu(a[3]);a[1]=(gj(cu(a[2]),b)+1|0)<<2;return}function -qs(a){var +b=cv(a[3]);a[1]=(gj(cv(a[2]),b)+1|0)<<2}function +qt(a){var e=a[6]-1|0,h=0;if(e>=0){var b=h;for(;;){var c=j(a[4],b)[1+b];if(typeof c!=="number")if(0===c[0])c[1]=go(c[1]);else c[1]=go(c[1]);var -d=j(a[5],b)[1+b];if(!d)throw g([0,f,qt],1);if(d[2]){var +d=j(a[5],b)[1+b];if(!d)throw g([0,f,qu],1);if(d[2]){var i=by(d);j(a[5],b)[1+b]=i}var -k=b+1|0;if(e===b)break;b=k}}return}function +k=b+1|0;if(e===b)break;b=k}}}function gv(a,b,c){if(typeof b==="number"){if(typeof -c==="number")return[0,dV,0]}else if(b[1]===c)return[0,dV,b];var +c==="number")return[0,dW,0]}else if(b[1]===c)return[0,dW,b];var t=typeof -b==="number"?bG:b[1],m=qi(t,c),i=qg(m),n=qh(m),u=gr(n),v=gr(i)+u|0,o=qb(i)-v|0,w=gq(n),p=gq(i)+w|0,x=0,y=aj(p,0),z=aj(p,0),A=a?o:-1,B=a?0:-1,C=a?aj(o,0):[0],d=[0,C,B,A,z,y,x];gu(d,b);if(d[2]!==d[3])throw g([0,f,qv],1);qs(d);var +b==="number"?bG:b[1],m=qj(t,c),i=qh(m),n=qi(m),u=gr(n),v=gr(i)+u|0,o=qc(i)-v|0,w=gq(n),p=gq(i)+w|0,x=0,y=ak(p,0),z=ak(p,0),A=a?o:-1,B=a?0:-1,C=a?ak(o,0):[0],d=[0,C,B,A,z,y,x];gu(d,b);if(d[2]!==d[3])throw g([0,f,qw],1);qt(d);var q=bI(d,c),r=d[6]-1|0;if(r>=0){var -h=r;for(;;){qj(j(d[4],h)[1+h]);var -F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,dV,q];var +h=r;for(;;){qk(j(d[4],h)[1+h]);var +F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,dW,q];var k=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var e=D;for(;;){aS(function(a){if(typeof a!=="number")if(0===a[0]){var b=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var c=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var E=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function -qw(d,b){if(typeof +qx(d,b){if(typeof b==="number")return 0;function c(a){a:if(typeof a!=="number"){b:{if(0===a[0]){var @@ -2859,14 +2833,14 @@ j=e[1];break b}var k=h(d[1],b[2]);a[2]=[0,k];return k}break a}var l=a[2];if(!l){var n=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var -j=l[1]}return j}throw g([0,f,qx],1)}return[0,c(b)]}function -cz(a,b){return[0,[0,a,b],0]}function -cA(a){return qw(a[1],a[2])}function -qy(a,b){var +j=l[1]}return j}throw g([0,f,qy],1)}return[0,c(b)]}function +cA(a,b){return[0,[0,a,b],0]}function +cB(a){return qx(a[1],a[2])}function +qz(a,b){var c=a[1];return[0,c,gv(0,a[2],b)[2]]}function -dW(a,b){var +dX(a,b){var d=a[1],c=gv(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function -cB(a,b,c,d){var +cC(a,b,c,d){var e=[0,d];if(bj===a)var h=c[1],g=0;else if(hS<=a)var h=c[2].length-1,g=c[1];else @@ -2875,234 +2849,234 @@ h=c[2].length-1,g=0;var k=h-1|0;if(k>=g){var f=g;for(;;){var l=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var -m=f+1|0;if(k===f)break;f=m}}if(hS>a)aS(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(bj!==a)aS(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function -dX(a,b,c){if(typeof -c==="number")throw g([0,f,qz],1);if(0===c[0])return h(a,c[2]);var -d=dX(a,b,c[3]);return i(b,dX(a,b,c[2]),d)}function -cC(a,b,c){var -d=b[2],e=b[1],f=cn(c);if(f){var +m=f+1|0;if(k===f)break;f=m}}if(hS>a)aS(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(bj!==a)aS(function(a){e[1]=i(b,a,e[1]);return 0},c[4])}function +dY(a,b,c){if(typeof +c==="number")throw g([0,f,qA],1);if(0===c[0])return h(a,c[2]);var +d=dY(a,b,c[3]);return i(b,dY(a,b,c[2]),d)}function +cD(a,b,c){var +d=b[2],e=b[1],f=co(c);if(f){var g=f[1];return typeof -g==="number"?Z(e):Z(dX(a,d,g))}var -h=[0,cz(a,d)];return w(c,function(a){var -b=qy(h[1],a);h[1]=b;var -c=cA(b);return c?c[1]:e})}var -dY=[0,bG,aH];function -qA(a,b){return cs(b,dY,a)}function -dZ(a,b,c,d){if(db)throw g([0,f,rC],1);var -j=a[2],c=[0,cz(function(a){var -b=gG(a);d(b);return b},function(a,b){return d5})];return w(j,function(a){var -b=dW(c[1],a),d=b[2],f=b[1];c[1]=d;cB(bj,function(a,b){return e(a)},f,0);cA(d);return 0})},[0,cH,function(a,b){return cH}],b)}function -d6(a,b){return gE(b[1],b[2],b[3],a)}function -rD(c,b){return cs(function(a){var +i=a[2];return w(i,h(0))}if(83>b)throw g([0,f,rD],1);var +j=a[2],c=[0,cA(function(a){var +b=gG(a);d(b);return b},function(a,b){return d6})];return w(j,function(a){var +b=dX(c[1],a),d=b[2],f=b[1];c[1]=d;cC(bj,function(a,b){return e(a)},f,0);cB(d);return 0})},[0,cI,function(a,b){return cI}],b)}function +d7(a,b){return gE(b[1],b[2],b[3],a)}function +rE(c,b){return ct(function(a){var b=a[1];if(82===b){var d=[0,0];return w(a[2],function(a){var -b=d[1];if(b)gF(b[1]);d[1]=[0,d6(c,a)];return 0})}if(83>b)throw g([0,f,rE],1);var -h=a[2],e=[0,cz(function(a){return d6(c,a)},function(a,b){return a})];return w(h,function(a){var -b=dW(e[1],a),c=b[2],d=b[1];e[1]=c;cB(bj,function(a,b){return gF(a)},d,0);cA(c);return 0})},[0,cH,function(a,b){return cH}],b)}function -rF(a,b,c,d,e,f){var -p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){return},l=gP(p),k=l[2],s=l[1],m=gP(q),n=m[2],t=m[1],o=rw(f),i=o[2],g=gI(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var +b=d[1];if(b)gF(b[1]);d[1]=[0,d7(c,a)];return 0})}if(83>b)throw g([0,f,rF],1);var +h=a[2],e=[0,cA(function(a){return d7(c,a)},function(a,b){return a})];return w(h,function(a){var +b=dX(e[1],a),c=b[2],d=b[1];e[1]=c;cC(bj,function(a,b){return gF(a)},d,0);cB(c);return 0})},[0,cI,function(a,b){return cI}],b)}function +rG(a,b,c,d,e,f){var +p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){},l=gP(p),k=l[2],s=l[1],m=gP(q),n=m[2],t=m[1],o=rx(f),i=o[2],g=gI(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var u=gS(g,i[1]),j=bc(gT(g,k),u,function(a,b){return b});else var j=w(gT(g,k),function(a){return g});else var -j=i?gS(g,i[1]):Z(g);aS(function(a){d6(g,a);return 0},t);var -v=n?bc(rD(g,n),j,function(a,b){return b}):j;return v}function -gU(a,b,c,d,e,f){return rF(b,c,d,e,a,f)}function -ac(a,b,c,d,e){return gU(gL,a,b,c,d,e)}function -rG(a,b,c,d,e){return gU(rd,a,b,c,d,e)}function -cI(a,b){return b1&&(r5-=1),r5<1/6?t5+6*(e4-t5)*r5:r5<.5?e4:r5<2/3?t5+(e4-t5)*(2/3-r5)*6:t5}if(t4=x(t4,360),e3=x(e3,100),r4=x(r4,100),e3===0)n5=i4=o4=r4;else{var s3=r4<.5?r4*(1+e3):r4+e3-r4*e3,u3=2*r4-s3;n5=a3(u3,s3,t4+1/3),i4=a3(u3,s3,t4),o4=a3(u3,s3,t4-1/3)}return{r:255*n5,g:255*i4,b:255*o4}}(r3.h,o3,s2),u2=!0,c2="hsl"),r3.hasOwnProperty("a")&&(i3=r3.a)),i3=A(i3),{ok:u2,format:r3.format||c2,r:Math.min(255,Math.max(n4.r,0)),g:Math.min(255,Math.max(n4.g,0)),b:Math.min(255,Math.max(n4.b,0)),a:i3};var l2,f2,h2}(n3);this._originalInput=n3,this._r=o2.r,this._g=o2.g,this._b=o2.b,this._a=o2.a,this._roundA=Math.round(100*this._a)/100,this._format=i2.format||o2.format,this._gradientType=i2.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o2.ok}function n2(t4,e3,r3){t4=x(t4,255),e3=x(e3,255),r3=x(r3,255);var n3,i2,o2=Math.max(t4,e3,r3),a2=Math.min(t4,e3,r3),s2=(o2+a2)/2;if(o2==a2)n3=i2=0;else{var u2=o2-a2;switch(i2=s2>.5?u2/(2-o2-a2):u2/(o2+a2),o2){case t4:n3=(e3-r3)/u2+(e3>1)+720)%360;--e3;)i2.h=(i2.h+o2)%360,a2.push(r2(i2));return a2}function b(t4,e3){e3=e3||6;for(var n3=r2(t4).toHsv(),i2=n3.h,o2=n3.s,a2=n3.v,s2=[],u2=1/e3;e3--;)s2.push(r2({h:i2,s:o2,v:a2})),a2=(a2+u2)%1;return s2}r2.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t4=this.toRgb();return(299*t4.r+587*t4.g+114*t4.b)/1e3},getLuminance:function(){var t4,e3,r3,n3=this.toRgb();return t4=n3.r/255,e3=n3.g/255,r3=n3.b/255,.2126*(t4<=.03928?t4/12.92:Math.pow((t4+.055)/1.055,2.4))+.7152*(e3<=.03928?e3/12.92:Math.pow((e3+.055)/1.055,2.4))+.0722*(r3<=.03928?r3/12.92:Math.pow((r3+.055)/1.055,2.4))},setAlpha:function(t4){return this._a=A(t4),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t4=i(this._r,this._g,this._b);return{h:360*t4.h,s:t4.s,v:t4.v,a:this._a}},toHsvString:function(){var t4=i(this._r,this._g,this._b),e3=Math.round(360*t4.h),r3=Math.round(100*t4.s),n3=Math.round(100*t4.v);return this._a==1?"hsv("+e3+", "+r3+"%, "+n3+"%)":"hsva("+e3+", "+r3+"%, "+n3+"%, "+this._roundA+")"},toHsl:function(){var t4=n2(this._r,this._g,this._b);return{h:360*t4.h,s:t4.s,l:t4.l,a:this._a}},toHslString:function(){var t4=n2(this._r,this._g,this._b),e3=Math.round(360*t4.h),r3=Math.round(100*t4.s),i2=Math.round(100*t4.l);return this._a==1?"hsl("+e3+", "+r3+"%, "+i2+"%)":"hsla("+e3+", "+r3+"%, "+i2+"%, "+this._roundA+")"},toHex:function(t4){return o(this._r,this._g,this._b,t4)},toHexString:function(t4){return"#"+this.toHex(t4)},toHex8:function(t4){return function(t5,e3,r3,n3,i2){var o2=[E(Math.round(t5).toString(16)),E(Math.round(e3).toString(16)),E(Math.round(r3).toString(16)),E(M(n3))];return i2&&o2[0].charAt(0)==o2[0].charAt(1)&&o2[1].charAt(0)==o2[1].charAt(1)&&o2[2].charAt(0)==o2[2].charAt(1)&&o2[3].charAt(0)==o2[3].charAt(1)?o2[0].charAt(0)+o2[1].charAt(0)+o2[2].charAt(0)+o2[3].charAt(0):o2.join("")}(this._r,this._g,this._b,this._a,t4)},toHex8String:function(t4){return"#"+this.toHex8(t4)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*x(this._r,255))+"%",g:Math.round(100*x(this._g,255))+"%",b:Math.round(100*x(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*x(this._r,255))+"%, "+Math.round(100*x(this._g,255))+"%, "+Math.round(100*x(this._b,255))+"%)":"rgba("+Math.round(100*x(this._r,255))+"%, "+Math.round(100*x(this._g,255))+"%, "+Math.round(100*x(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(m[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t4){var e3="#"+a(this._r,this._g,this._b,this._a),n3=e3,i2=this._gradientType?"GradientType = 1, ":"";if(t4){var o2=r2(t4);n3="#"+a(o2._r,o2._g,o2._b,o2._a)}return"progid:DXImageTransform.Microsoft.gradient("+i2+"startColorstr="+e3+",endColorstr="+n3+")"},toString:function(t4){var e3=!!t4;t4=t4||this._format;var r3=!1,n3=this._a<1&&this._a>=0;return e3||!n3||t4!=="hex"&&t4!=="hex6"&&t4!=="hex3"&&t4!=="hex4"&&t4!=="hex8"&&t4!=="name"?(t4==="rgb"&&(r3=this.toRgbString()),t4==="prgb"&&(r3=this.toPercentageRgbString()),t4!=="hex"&&t4!=="hex6"||(r3=this.toHexString()),t4==="hex3"&&(r3=this.toHexString(!0)),t4==="hex4"&&(r3=this.toHex8String(!0)),t4==="hex8"&&(r3=this.toHex8String()),t4==="name"&&(r3=this.toName()),t4==="hsl"&&(r3=this.toHslString()),t4==="hsv"&&(r3=this.toHsvString()),r3||this.toHexString()):t4==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return r2(this.toString())},_applyModification:function(t4,e3){var r3=t4.apply(null,[this].concat([].slice.call(e3)));return this._r=r3._r,this._g=r3._g,this._b=r3._b,this.setAlpha(r3._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t4,e3){return t4.apply(null,[this].concat([].slice.call(e3)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},r2.fromRatio=function(t4,e3){if(typeof t4=="object"){var n3={};for(var i2 in t4)t4.hasOwnProperty(i2)&&(n3[i2]=i2==="a"?t4[i2]:S(t4[i2]));t4=n3}return r2(t4,e3)},r2.equals=function(t4,e3){return!(!t4||!e3)&&r2(t4).toRgbString()==r2(e3).toRgbString()},r2.random=function(){return r2.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},r2.mix=function(t4,e3,n3){n3=n3===0?0:n3||50;var i2=r2(t4).toRgb(),o2=r2(e3).toRgb(),a2=n3/100;return r2({r:(o2.r-i2.r)*a2+i2.r,g:(o2.g-i2.g)*a2+i2.g,b:(o2.b-i2.b)*a2+i2.b,a:(o2.a-i2.a)*a2+i2.a})},r2.readability=function(t4,e3){var n3=r2(t4),i2=r2(e3);return(Math.max(n3.getLuminance(),i2.getLuminance())+.05)/(Math.min(n3.getLuminance(),i2.getLuminance())+.05)},r2.isReadable=function(t4,e3,n3){var i2,o2,a2,s2,u2,c2=r2.readability(t4,e3);switch(o2=!1,(a2=n3,(s2=((a2=a2||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&s2!=="AAA"&&(s2="AA"),(u2=(a2.size||"small").toLowerCase())!=="small"&&u2!=="large"&&(u2="small"),i2={level:s2,size:u2}).level+i2.size){case"AAsmall":case"AAAlarge":o2=c2>=4.5;break;case"AAlarge":o2=c2>=3;break;case"AAAsmall":o2=c2>=7}return o2},r2.mostReadable=function(t4,e3,n3){var i2,o2,a2,s2,u2=null,c2=0;o2=(n3=n3||{}).includeFallbackColors,a2=n3.level,s2=n3.size;for(var l2=0;l2c2&&(c2=i2,u2=r2(e3[l2]));return r2.isReadable(t4,u2,{level:a2,size:s2})||!o2?u2:(n3.includeFallbackColors=!1,r2.mostReadable(t4,["#fff","#000"],n3))};var y=r2.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},m=r2.hexNames=function(t4){var e3={};for(var r3 in t4)t4.hasOwnProperty(r3)&&(e3[t4[r3]]=r3);return e3}(y);function A(t4){return t4=parseFloat(t4),(isNaN(t4)||t4<0||t4>1)&&(t4=1),t4}function x(t4,e3){(function(t5){return typeof t5=="string"&&t5.indexOf(".")!=-1&&parseFloat(t5)===1})(t4)&&(t4="100%");var r3=function(t5){return typeof t5=="string"&&t5.indexOf("%")!=-1}(t4);return t4=Math.min(e3,Math.max(0,parseFloat(t4))),r3&&(t4=parseInt(t4*e3,10)/100),Math.abs(t4-e3)<1e-6?1:t4%e3/parseFloat(e3)}function C(t4){return Math.min(1,Math.max(0,t4))}function w(t4){return parseInt(t4,16)}function E(t4){return t4.length==1?"0"+t4:""+t4}function S(t4){return t4<=1&&(t4=100*t4+"%"),t4}function M(t4){return Math.round(255*parseFloat(t4)).toString(16)}function O(t4){return w(t4)/255}var j,L,k,T=(L="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",k="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+L),rgba:new RegExp("rgba"+k),hsl:new RegExp("hsl"+L),hsla:new RegExp("hsla"+k),hsv:new RegExp("hsv"+L),hsva:new RegExp("hsva"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(t4){return!!T.CSS_UNIT.exec(t4)}return r2}()}},e={};function r(n2){var i=e[n2];if(i!==void 0)return i.exports;var o=e[n2]={id:n2,loaded:!1,exports:{}};return t[n2].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t2=>{var e2=t2&&t2.__esModule?()=>t2.default:()=>t2;return r.d(e2,{a:e2}),e2},r.d=(t2,e2)=>{for(var n2 in e2)r.o(e2,n2)&&!r.o(t2,n2)&&Object.defineProperty(t2,n2,{enumerable:!0,get:e2[n2]})},r.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),r.o=(t2,e2)=>Object.prototype.hasOwnProperty.call(t2,e2),r.r=t2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t2,"__esModule",{value:!0})},r.nmd=t2=>(t2.paths=[],t2.children||(t2.children=[]),t2),r.nc=void 0;var n=r(607);return n.default})())}});var reconnectTimeoutBase,maxReconnectTimeout,messageReconnectTimeout,setupWS,WebsocketClient,init_websocket=__esm({"node_modules/lib0/websocket.js"(){init_observable();init_time();init_math();reconnectTimeoutBase=1200,maxReconnectTimeout=2500,messageReconnectTimeout=3e4,setupWS=wsclient=>{if(wsclient.shouldConnect&&wsclient.ws===null){let websocket=new WebSocket(wsclient.url),binaryType=wsclient.binaryType,pingTimeout=null;binaryType&&(websocket.binaryType=binaryType),wsclient.ws=websocket,wsclient.connecting=!0,wsclient.connected=!1,websocket.onmessage=event=>{wsclient.lastMessageReceived=getUnixTime();let data=event.data,message=typeof data=="string"?JSON.parse(data):data;message&&message.type==="pong"&&(clearTimeout(pingTimeout),pingTimeout=setTimeout(sendPing,messageReconnectTimeout/2)),wsclient.emit("message",[message,wsclient])};let onclose=error=>{wsclient.ws!==null&&(wsclient.ws=null,wsclient.connecting=!1,wsclient.connected?(wsclient.connected=!1,wsclient.emit("disconnect",[{type:"disconnect",error},wsclient])):wsclient.unsuccessfulReconnects++,setTimeout(setupWS,min(log10(wsclient.unsuccessfulReconnects+1)*reconnectTimeoutBase,maxReconnectTimeout),wsclient)),clearTimeout(pingTimeout)},sendPing=()=>{wsclient.ws===websocket&&wsclient.send({type:"ping"})};websocket.onclose=()=>onclose(null),websocket.onerror=error=>onclose(error),websocket.onopen=()=>{wsclient.lastMessageReceived=getUnixTime(),wsclient.connecting=!1,wsclient.connected=!0,wsclient.unsuccessfulReconnects=0,wsclient.emit("connect",[{type:"connect"},wsclient]),pingTimeout=setTimeout(sendPing,messageReconnectTimeout/2)}}},WebsocketClient=class extends Observable{constructor(url,{binaryType}={}){super(),this.url=url,this.ws=null,this.binaryType=binaryType||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&messageReconnectTimeoute.key===room&&this.onmessage!==null&&this.onmessage({data:fromBase64(e.newValue||"")}),onChange(this._onChange)}postMessage(buf){varStorage.setItem(this.room,toBase64(createUint8ArrayFromArrayBuffer(buf)))}close(){offChange(this._onChange)}},BC=typeof BroadcastChannel>"u"?LocalStoragePolyfill:BroadcastChannel,getChannel=room=>setIfUndefined(channels,room,()=>{let subs=create(),bc=new BC(room);return bc.onmessage=e=>subs.forEach(sub=>sub(e.data,"broadcastchannel")),{bc,subs}}),subscribe=(room,f)=>(getChannel(room).subs.add(f),f),unsubscribe=(room,f)=>{let channel=getChannel(room),unsubscribed=channel.subs.delete(f);return unsubscribed&&channel.subs.size===0&&(channel.bc.close(),channels.delete(room)),unsubscribed},publish=(room,data,origin=null)=>{let c=getChannel(room);c.bc.postMessage(data),c.subs.forEach(sub=>sub(data,origin))}}});var createMutex,init_mutex=__esm({"node_modules/lib0/mutex.js"(){createMutex=()=>{let token=!0;return(f,g)=>{if(token){token=!1;try{f()}finally{token=!0}}else g!==void 0&&g()}}}});var require_simplepeer_min=__commonJS({"node_modules/simple-peer/simplepeer.min.js"(exports2,module2){(function(e){if(typeof exports2=="object"&&typeof module2<"u")module2.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;t=typeof window>"u"?typeof global>"u"?typeof self>"u"?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(s,e,n2){function t2(o,i){if(!e[o]){if(!s[o]){var l=typeof __require=="function"&&__require;if(!i&&l)return l(o,!0);if(r2)return r2(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var a2=e[o]={exports:{}};s[o][0].call(a2.exports,function(e2){var r3=s[o][1][e2];return t2(r3||e2)},a2,a2.exports,d,s,e,n2)}return e[o].exports}for(var r2=typeof __require=="function"&&__require,a=0;a>16,l2[c2++]=255&t3>>8,l2[c2++]=255&t3;return s2===2&&(t3=u[e2.charCodeAt(n3)]<<2|u[e2.charCodeAt(n3+1)]>>4,l2[c2++]=255&t3),s2===1&&(t3=u[e2.charCodeAt(n3)]<<10|u[e2.charCodeAt(n3+1)]<<4|u[e2.charCodeAt(n3+2)]>>2,l2[c2++]=255&t3>>8,l2[c2++]=255&t3),l2}function d(e2){return c[63&e2>>18]+c[63&e2>>12]+c[63&e2>>6]+c[63&e2]}function s(e2,t3,n3){for(var r3,a2=[],o2=t3;o2l2?l2:d2+o2));return r3===1?(t3=e2[n3-1],a2.push(c[t3>>2]+c[63&t3<<4]+"==")):r3===2&&(t3=(e2[n3-2]<<8)+e2[n3-1],a2.push(c[t3>>10]+c[63&t3>>4]+c[63&t3<<2]+"=")),a2.join("")}n2.byteLength=function(e2){var t3=r2(e2),n3=t3[0],a2=t3[1];return 3*(n3+a2)/4-a2},n2.toByteArray=o,n2.fromByteArray=l;for(var c=[],u=[],p=typeof Uint8Array>"u"?Array:Uint8Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,_=f.length;g<_;++g)c[g]=f[g],u[f.charCodeAt(g)]=g;u[45]=62,u[95]=63},{}],2:[function(){},{}],3:[function(e,t2,n2){(function(){(function(){"use strict";var t3=String.fromCharCode,o=Math.min;function d(e2){if(2147483647e2)throw new RangeError('The value "'+e2+'" is invalid for option "size"')}function u(e2,t4,n3){return c(e2),0>=e2||t4===void 0?d(e2):typeof n3=="string"?d(e2).fill(t4,n3):d(e2).fill(t4)}function p(e2){return c(e2),d(0>e2?0:0|m(e2))}function f(e2,t4){if((typeof t4!="string"||t4==="")&&(t4="utf8"),!s.isEncoding(t4))throw new TypeError("Unknown encoding: "+t4);var n3=0|b(e2,t4),r2=d(n3),a=r2.write(e2,t4);return a!==n3&&(r2=r2.slice(0,a)),r2}function g(e2){for(var t4=0>e2.length?0:0|m(e2.length),n3=d(t4),r2=0;r2t4||e2.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e2}function b(e2,t4){if(s.isBuffer(e2))return e2.length;if(ArrayBuffer.isView(e2)||K(e2,ArrayBuffer))return e2.byteLength;if(typeof e2!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e2);var n3=e2.length,r2=2>>1;case"base64":return z(e2).length;default:if(a)return r2?-1:H(e2).length;t4=(""+t4).toLowerCase(),a=!0}}function y(e2,t4,n3){var r2=!1;if((t4===void 0||0>t4)&&(t4=0),t4>this.length||((n3===void 0||n3>this.length)&&(n3=this.length),0>=n3)||(n3>>>=0,t4>>>=0,n3<=t4))return"";for(e2||(e2="utf8");;)switch(e2){case"hex":return P(this,t4,n3);case"utf8":case"utf-8":return x(this,t4,n3);case"ascii":return D(this,t4,n3);case"latin1":case"binary":return I(this,t4,n3);case"base64":return A(this,t4,n3);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t4,n3);default:if(r2)throw new TypeError("Unknown encoding: "+e2);e2=(e2+"").toLowerCase(),r2=!0}}function C(e2,t4,n3){var r2=e2[t4];e2[t4]=e2[n3],e2[n3]=r2}function R(e2,t4,n3,r2,a){if(e2.length===0)return-1;if(typeof n3=="string"?(r2=n3,n3=0):2147483647n3&&(n3=-2147483648),n3=+n3,X(n3)&&(n3=a?0:e2.length-1),0>n3&&(n3=e2.length+n3),n3>=e2.length){if(a)return-1;n3=e2.length-1}else if(0>n3)if(a)n3=0;else return-1;if(typeof t4=="string"&&(t4=s.from(t4,r2)),s.isBuffer(t4))return t4.length===0?-1:E(e2,t4,n3,r2,a);if(typeof t4=="number")return t4&=255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e2,t4,n3):Uint8Array.prototype.lastIndexOf.call(e2,t4,n3):E(e2,[t4],n3,r2,a);throw new TypeError("val must be string, number or Buffer")}function E(e2,t4,n3,r2,a){function o2(e3,t5){return d2===1?e3[t5]:e3.readUInt16BE(t5*d2)}var d2=1,s2=e2.length,l2=t4.length;if(r2!==void 0&&(r2=(r2+"").toLowerCase(),r2==="ucs2"||r2==="ucs-2"||r2==="utf16le"||r2==="utf-16le")){if(2>e2.length||2>t4.length)return-1;d2=2,s2/=2,l2/=2,n3/=2}var c2;if(a){var u2=-1;for(c2=n3;c2s2&&(n3=s2-l2),c2=n3;0<=c2;c2--){for(var p2=!0,f2=0;f2a&&(r2=a)):r2=a;var o2=t4.length;r2>o2/2&&(r2=o2/2);for(var d2,s2=0;s2d2&&(s2=d2):l2===2?(c2=e2[a+1],(192&c2)==128&&(f2=(31&d2)<<6|63&c2,127f2||57343f2&&(s2=f2)))}s2===null?(s2=65533,l2=1):65535>>10),s2=56320|1023&s2),r2.push(s2),a+=l2}return N(r2)}function N(e2){var n3=e2.length;if(n3<=4096)return t3.apply(String,e2);for(var r2="",a=0;at4)&&(t4=0),(!n3||0>n3||n3>r2)&&(n3=r2);for(var a="",o2=t4;o2e2)throw new RangeError("offset is not uint");if(e2+t4>n3)throw new RangeError("Trying to access beyond buffer length")}function F(e2,t4,n3,r2,a,o2){if(!s.isBuffer(e2))throw new TypeError('"buffer" argument must be a Buffer instance');if(t4>a||t4e2.length)throw new RangeError("Index out of range")}function B(e2,t4,n3,r2){if(n3+r2>e2.length)throw new RangeError("Index out of range");if(0>n3)throw new RangeError("Index out of range")}function U(e2,t4,n3,r2,a){return t4=+t4,n3>>>=0,a||B(e2,t4,n3,4,34028234663852886e22,-34028234663852886e22),J.write(e2,t4,n3,r2,23,4),n3+4}function j(e2,t4,n3,r2,a){return t4=+t4,n3>>>=0,a||B(e2,t4,n3,8,17976931348623157e292,-17976931348623157e292),J.write(e2,t4,n3,r2,52,8),n3+8}function q(e2){if(e2=e2.split("=")[0],e2=e2.trim().replace(Q,""),2>e2.length)return"";for(;e2.length%4!=0;)e2+="=";return e2}function W(e2){return 16>e2?"0"+e2.toString(16):e2.toString(16)}function H(e2,t4){t4=t4||1/0;for(var n3,r2=e2.length,a=null,o2=[],d2=0;d2n3){if(!a){if(56319n3){-1<(t4-=3)&&o2.push(239,191,189),a=n3;continue}n3=(a-55296<<10|n3-56320)+65536}else a&&-1<(t4-=3)&&o2.push(239,191,189);if(a=null,128>n3){if(0>(t4-=1))break;o2.push(n3)}else if(2048>n3){if(0>(t4-=2))break;o2.push(192|n3>>6,128|63&n3)}else if(65536>n3){if(0>(t4-=3))break;o2.push(224|n3>>12,128|63&n3>>6,128|63&n3)}else if(1114112>n3){if(0>(t4-=4))break;o2.push(240|n3>>18,128|63&n3>>12,128|63&n3>>6,128|63&n3)}else throw new Error("Invalid code point")}return o2}function Y(e2){for(var t4=[],n3=0;n3(t4-=2));++d2)n3=e2.charCodeAt(d2),r2=n3>>8,a=n3%256,o2.push(a),o2.push(r2);return o2}function z(e2){return $.toByteArray(q(e2))}function G(e2,t4,n3,r2){for(var a=0;a=t4.length||a>=e2.length);++a)t4[a+n3]=e2[a];return a}function K(e2,t4){return e2 instanceof t4||e2!=null&&e2.constructor!=null&&e2.constructor.name!=null&&e2.constructor.name===t4.name}function X(e2){return e2!==e2}var $=e("base64-js"),J=e("ieee754");n2.Buffer=s,n2.SlowBuffer=function(e2){return+e2!=e2&&(e2=0),s.alloc(+e2)},n2.INSPECT_MAX_BYTES=50,n2.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e2=new Uint8Array(1);return e2.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e2.foo()===42}catch{return!1}}(),s.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e2,t4,n3){return l(e2,t4,n3)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e2,t4,n3){return u(e2,t4,n3)},s.allocUnsafe=function(e2){return p(e2)},s.allocUnsafeSlow=function(e2){return p(e2)},s.isBuffer=function(e2){return e2!=null&&e2._isBuffer===!0&&e2!==s.prototype},s.compare=function(e2,t4){if(K(e2,Uint8Array)&&(e2=s.from(e2,e2.offset,e2.byteLength)),K(t4,Uint8Array)&&(t4=s.from(t4,t4.offset,t4.byteLength)),!s.isBuffer(e2)||!s.isBuffer(t4))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e2===t4)return 0;for(var n3=e2.length,r2=t4.length,d2=0,l2=o(n3,r2);d2t4&&(e2+=" ... "),""},s.prototype.compare=function(e2,t4,n3,r2,a){if(K(e2,Uint8Array)&&(e2=s.from(e2,e2.offset,e2.byteLength)),!s.isBuffer(e2))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e2);if(t4===void 0&&(t4=0),n3===void 0&&(n3=e2?e2.length:0),r2===void 0&&(r2=0),a===void 0&&(a=this.length),0>t4||n3>e2.length||0>r2||a>this.length)throw new RangeError("out of range index");if(r2>=a&&t4>=n3)return 0;if(r2>=a)return-1;if(t4>=n3)return 1;if(t4>>>=0,n3>>>=0,r2>>>=0,a>>>=0,this===e2)return 0;for(var d2=a-r2,l2=n3-t4,c2=o(d2,l2),u2=this.slice(r2,a),p2=e2.slice(t4,n3),f2=0;f2>>=0,isFinite(n3)?(n3>>>=0,r2===void 0&&(r2="utf8")):(r2=n3,n3=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t4;if((n3===void 0||n3>a)&&(n3=a),0n3||0>t4)||t4>this.length)throw new RangeError("Attempt to write outside buffer bounds");r2||(r2="utf8");for(var o2=!1;;)switch(r2){case"hex":return w(this,e2,t4,n3);case"utf8":case"utf-8":return S(this,e2,t4,n3);case"ascii":return T(this,e2,t4,n3);case"latin1":case"binary":return v(this,e2,t4,n3);case"base64":return k(this,e2,t4,n3);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e2,t4,n3);default:if(o2)throw new TypeError("Unknown encoding: "+r2);r2=(""+r2).toLowerCase(),o2=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e2,t4){var n3=this.length;e2=~~e2,t4=t4===void 0?n3:~~t4,0>e2?(e2+=n3,0>e2&&(e2=0)):e2>n3&&(e2=n3),0>t4?(t4+=n3,0>t4&&(t4=0)):t4>n3&&(t4=n3),t4>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var r2=this[e2],a=1,o2=0;++o2>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var r2=this[e2+--t4],a=1;0>>=0,t4||O(e2,1,this.length),this[e2]},s.prototype.readUInt16LE=function(e2,t4){return e2>>>=0,t4||O(e2,2,this.length),this[e2]|this[e2+1]<<8},s.prototype.readUInt16BE=function(e2,t4){return e2>>>=0,t4||O(e2,2,this.length),this[e2]<<8|this[e2+1]},s.prototype.readUInt32LE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),(this[e2]|this[e2+1]<<8|this[e2+2]<<16)+16777216*this[e2+3]},s.prototype.readUInt32BE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),16777216*this[e2]+(this[e2+1]<<16|this[e2+2]<<8|this[e2+3])},s.prototype.readIntLE=function(e2,t4,n3){e2>>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var a=this[e2],o2=1,d2=0;++d2=o2&&(a-=r(2,8*t4)),a},s.prototype.readIntBE=function(e2,t4,n3){e2>>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var a=t4,o2=1,d2=this[e2+--a];0=o2&&(d2-=r(2,8*t4)),d2},s.prototype.readInt8=function(e2,t4){return e2>>>=0,t4||O(e2,1,this.length),128&this[e2]?-1*(255-this[e2]+1):this[e2]},s.prototype.readInt16LE=function(e2,t4){e2>>>=0,t4||O(e2,2,this.length);var n3=this[e2]|this[e2+1]<<8;return 32768&n3?4294901760|n3:n3},s.prototype.readInt16BE=function(e2,t4){e2>>>=0,t4||O(e2,2,this.length);var n3=this[e2+1]|this[e2]<<8;return 32768&n3?4294901760|n3:n3},s.prototype.readInt32LE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),this[e2]|this[e2+1]<<8|this[e2+2]<<16|this[e2+3]<<24},s.prototype.readInt32BE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),this[e2]<<24|this[e2+1]<<16|this[e2+2]<<8|this[e2+3]},s.prototype.readFloatLE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),J.read(this,e2,!0,23,4)},s.prototype.readFloatBE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),J.read(this,e2,!1,23,4)},s.prototype.readDoubleLE=function(e2,t4){return e2>>>=0,t4||O(e2,8,this.length),J.read(this,e2,!0,52,8)},s.prototype.readDoubleBE=function(e2,t4){return e2>>>=0,t4||O(e2,8,this.length),J.read(this,e2,!1,52,8)},s.prototype.writeUIntLE=function(e2,t4,n3,a){if(e2=+e2,t4>>>=0,n3>>>=0,!a){var o2=r(2,8*n3)-1;F(this,e2,t4,n3,o2,0)}var d2=1,s2=0;for(this[t4]=255&e2;++s2>>=0,n3>>>=0,!a){var o2=r(2,8*n3)-1;F(this,e2,t4,n3,o2,0)}var d2=n3-1,s2=1;for(this[t4+d2]=255&e2;0<=--d2&&(s2*=256);)this[t4+d2]=255&e2/s2;return t4+n3},s.prototype.writeUInt8=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,1,255,0),this[t4]=255&e2,t4+1},s.prototype.writeUInt16LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,65535,0),this[t4]=255&e2,this[t4+1]=e2>>>8,t4+2},s.prototype.writeUInt16BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,65535,0),this[t4]=e2>>>8,this[t4+1]=255&e2,t4+2},s.prototype.writeUInt32LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,4294967295,0),this[t4+3]=e2>>>24,this[t4+2]=e2>>>16,this[t4+1]=e2>>>8,this[t4]=255&e2,t4+4},s.prototype.writeUInt32BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,4294967295,0),this[t4]=e2>>>24,this[t4+1]=e2>>>16,this[t4+2]=e2>>>8,this[t4+3]=255&e2,t4+4},s.prototype.writeIntLE=function(e2,t4,n3,a){if(e2=+e2,t4>>>=0,!a){var o2=r(2,8*n3-1);F(this,e2,t4,n3,o2-1,-o2)}var d2=0,s2=1,l2=0;for(this[t4]=255&e2;++d2e2&&l2===0&&this[t4+d2-1]!==0&&(l2=1),this[t4+d2]=255&(e2/s2>>0)-l2;return t4+n3},s.prototype.writeIntBE=function(e2,t4,n3,a){if(e2=+e2,t4>>>=0,!a){var o2=r(2,8*n3-1);F(this,e2,t4,n3,o2-1,-o2)}var d2=n3-1,s2=1,l2=0;for(this[t4+d2]=255&e2;0<=--d2&&(s2*=256);)0>e2&&l2===0&&this[t4+d2+1]!==0&&(l2=1),this[t4+d2]=255&(e2/s2>>0)-l2;return t4+n3},s.prototype.writeInt8=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,1,127,-128),0>e2&&(e2=255+e2+1),this[t4]=255&e2,t4+1},s.prototype.writeInt16LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,32767,-32768),this[t4]=255&e2,this[t4+1]=e2>>>8,t4+2},s.prototype.writeInt16BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,32767,-32768),this[t4]=e2>>>8,this[t4+1]=255&e2,t4+2},s.prototype.writeInt32LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,2147483647,-2147483648),this[t4]=255&e2,this[t4+1]=e2>>>8,this[t4+2]=e2>>>16,this[t4+3]=e2>>>24,t4+4},s.prototype.writeInt32BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,2147483647,-2147483648),0>e2&&(e2=4294967295+e2+1),this[t4]=e2>>>24,this[t4+1]=e2>>>16,this[t4+2]=e2>>>8,this[t4+3]=255&e2,t4+4},s.prototype.writeFloatLE=function(e2,t4,n3){return U(this,e2,t4,!0,n3)},s.prototype.writeFloatBE=function(e2,t4,n3){return U(this,e2,t4,!1,n3)},s.prototype.writeDoubleLE=function(e2,t4,n3){return j(this,e2,t4,!0,n3)},s.prototype.writeDoubleBE=function(e2,t4,n3){return j(this,e2,t4,!1,n3)},s.prototype.copy=function(e2,t4,n3,r2){if(!s.isBuffer(e2))throw new TypeError("argument should be a Buffer");if(n3||(n3=0),r2||r2===0||(r2=this.length),t4>=e2.length&&(t4=e2.length),t4||(t4=0),0t4)throw new RangeError("targetStart out of bounds");if(0>n3||n3>=this.length)throw new RangeError("Index out of range");if(0>r2)throw new RangeError("sourceEnd out of bounds");r2>this.length&&(r2=this.length),e2.length-t4a||r2==="latin1")&&(e2=a)}}else typeof e2=="number"&&(e2&=255);if(0>t4||this.length>>=0,n3=n3===void 0?this.length:n3>>>0,e2||(e2=0);var o2;if(typeof e2=="number")for(o2=t4;o2{e3==="%%"||(r3++,e3==="%c"&&(a2=r3))}),e2.splice(a2,0,n3)},n2.save=function(e2){try{e2?n2.storage.setItem("debug",e2):n2.storage.removeItem("debug")}catch{}},n2.load=r2,n2.useColors=function(){return!!(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))||!(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n2.storage=function(){try{return localStorage}catch{}}(),n2.destroy=(()=>{let e2=!1;return()=>{e2||(e2=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n2.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n2.log=console.debug||console.log||(()=>{}),t2.exports=e("./common")(n2);let{formatters:o}=t2.exports;o.j=function(e2){try{return JSON.stringify(e2)}catch(e3){return"[UnexpectedJSONParseError]: "+e3.message}}}).call(this)}).call(this,e("_process"))},{"./common":5,_process:12}],5:[function(e,t2){t2.exports=function(t3){function r2(e2){function t4(...e3){if(!t4.enabled)return;let a2=t4,o3=+new Date,i=o3-(n2||o3);a2.diff=i,a2.prev=n2,a2.curr=o3,n2=o3,e3[0]=r2.coerce(e3[0]),typeof e3[0]!="string"&&e3.unshift("%O");let d=0;e3[0]=e3[0].replace(/%([a-zA-Z%])/g,(t5,n3)=>{if(t5==="%%")return"%";d++;let o4=r2.formatters[n3];if(typeof o4=="function"){let n4=e3[d];t5=o4.call(a2,n4),e3.splice(d,1),d--}return t5}),r2.formatArgs.call(a2,e3),(a2.log||r2.log).apply(a2,e3)}let n2,o2=null;return t4.namespace=e2,t4.useColors=r2.useColors(),t4.color=r2.selectColor(e2),t4.extend=a,t4.destroy=r2.destroy,Object.defineProperty(t4,"enabled",{enumerable:!0,configurable:!1,get:()=>o2===null?r2.enabled(e2):o2,set:e3=>{o2=e3}}),typeof r2.init=="function"&&r2.init(t4),t4}function a(e2,t4){let n2=r2(this.namespace+(typeof t4>"u"?":":t4)+e2);return n2.log=this.log,n2}function o(e2){return e2.toString().substring(2,e2.toString().length-2).replace(/\.\*\?$/,"*")}return r2.debug=r2,r2.default=r2,r2.coerce=function(e2){return e2 instanceof Error?e2.stack||e2.message:e2},r2.disable=function(){let e2=[...r2.names.map(o),...r2.skips.map(o).map(e3=>"-"+e3)].join(",");return r2.enable(""),e2},r2.enable=function(e2){r2.save(e2),r2.names=[],r2.skips=[];let t4,n2=(typeof e2=="string"?e2:"").split(/[\s,]+/),a2=n2.length;for(t4=0;t4{r2[e2]=t3[e2]}),r2.names=[],r2.skips=[],r2.formatters={},r2.selectColor=function(e2){let t4=0;for(let n2=0;n2d2&&!l2.warned){l2.warned=!0;var c2=new Error("Possible EventEmitter memory leak detected. "+l2.length+" "+(t3+" listeners added. Use emitter.setMaxListeners() to increase limit"));c2.name="MaxListenersExceededWarning",c2.emitter=e2,c2.type=t3,c2.count=l2.length,n2(c2)}return e2}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e2,t3,n3){var r3={fired:!1,wrapFn:void 0,target:e2,type:t3,listener:n3},a2=d.bind(r3);return a2.listener=n3,r3.wrapFn=a2,a2}function l(e2,t3,n3){var r3=e2._events;if(r3===void 0)return[];var a2=r3[t3];return a2===void 0?[]:typeof a2=="function"?n3?[a2.listener||a2]:[a2]:n3?f(a2):u(a2,a2.length)}function c(e2){var t3=this._events;if(t3!==void 0){var n3=t3[e2];if(typeof n3=="function")return 1;if(n3!==void 0)return n3.length}return 0}function u(e2,t3){for(var n3=Array(t3),r3=0;r3e2||y(e2))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e2+".");C=e2}}),r2.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r2.prototype.setMaxListeners=function(e2){if(typeof e2!="number"||0>e2||y(e2))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e2+".");return this._maxListeners=e2,this},r2.prototype.getMaxListeners=function(){return o(this)},r2.prototype.emit=function(e2){for(var t3=[],n3=1;n3o2)return this;o2===0?n3.shift():p(n3,o2),n3.length===1&&(r3[e2]=n3[0]),r3.removeListener!==void 0&&this.emit("removeListener",e2,s2||t3)}return this},r2.prototype.off=r2.prototype.removeListener,r2.prototype.removeAllListeners=function(e2){var t3,n3,r3;if(n3=this._events,n3===void 0)return this;if(n3.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n3[e2]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n3[e2]),this;if(arguments.length===0){var a2,o2=Object.keys(n3);for(r3=0;r3"u")return null;var e2={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e2.RTCPeerConnection?e2:null}},{}],9:[function(e,a,o){o.read=function(t2,n2,a2,o2,l){var c,u,p=8*l-o2-1,f=(1<>1,_=-7,h=a2?l-1:0,b=a2?-1:1,d=t2[n2+h];for(h+=b,c=d&(1<<-_)-1,d>>=-_,_+=p;0<_;c=256*c+t2[n2+h],h+=b,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=o2;0<_;u=256*u+t2[n2+h],h+=b,_-=8);if(c===0)c=1-g;else{if(c===f)return u?NaN:(d?-1:1)*(1/0);u+=r(2,o2),c-=g}return(d?-1:1)*u*r(2,c-o2)},o.write=function(a2,o2,l,u,p,f){var h,b,y,g=Math.LN2,_=Math.log,C=8*f-p-1,R=(1<>1,w=p===23?r(2,-24)-r(2,-77):0,S=u?0:f-1,T=u?1:-1,d=0>o2||o2===0&&0>1/o2?1:0;for(o2=n(o2),isNaN(o2)||o2===1/0?(b=isNaN(o2)?1:0,h=R):(h=t(_(o2)/g),1>o2*(y=r(2,-h))&&(h--,y*=2),o2+=1<=h+E?w/y:w*r(2,1-E),2<=o2*y&&(h++,y/=2),h+E>=R?(b=0,h=R):1<=h+E?(b=(o2*y-1)*r(2,p),h+=E):(b=o2*r(2,E-1)*r(2,p),h=0));8<=p;a2[l+S]=255&b,S+=T,b/=256,p-=8);for(h=h<=1.5*a2?"s":"")}var l=24*(60*6e4);t2.exports=function(e2,t3){t3=t3||{};var n2=typeof e2;if(n2=="string"&&0"u"?e2:window):e3=>(n2||(n2=Promise.resolve())).then(e3).catch(e4=>setTimeout(()=>{throw e4},0))}).call(this)}).call(this,typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{}],14:[function(e,t2){(function(n2,r2){(function(){"use strict";var a=e("safe-buffer").Buffer,o=r2.crypto||r2.msCrypto;t2.exports=o&&o.getRandomValues?function(e2,t3){if(e2>4294967295)throw new RangeError("requested too many random bytes");var r3=a.allocUnsafe(e2);if(0"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{_process:12,"safe-buffer":30}],15:[function(e,t2){"use strict";function n2(e2,t3){e2.prototype=Object.create(t3.prototype),e2.prototype.constructor=e2,e2.__proto__=t3}function r2(e2,t3,r3){function a2(e3,n3,r4){return typeof t3=="string"?t3:t3(e3,n3,r4)}r3||(r3=Error);var o2=function(e3){function t4(t5,n3,r4){return e3.call(this,a2(t5,n3,r4))||this}return n2(t4,e3),t4}(r3);o2.prototype.name=r3.name,o2.prototype.code=e2,s[e2]=o2}function a(e2,t3){if(Array.isArray(e2)){var n3=e2.length;return e2=e2.map(function(e3){return e3+""}),2n3?0:+n3,t3.length)===t3}function i(e2,t3,n3){return(n3===void 0||n3>e2.length)&&(n3=e2.length),e2.substring(n3-t3.length,n3)===t3}function d(e2,t3,n3){return typeof n3!="number"&&(n3=0),!(n3+t3.length>e2.length)&&e2.indexOf(t3,n3)!==-1}var s={};r2("ERR_INVALID_OPT_VALUE",function(e2,t3){return'The value "'+t3+'" is invalid for option "'+e2+'"'},TypeError),r2("ERR_INVALID_ARG_TYPE",function(e2,t3,n3){var r3;typeof t3=="string"&&o(t3,"not ")?(r3="must not be",t3=t3.replace(/^not /,"")):r3="must be";var s2;if(i(e2," argument"))s2="The ".concat(e2," ").concat(r3," ").concat(a(t3,"type"));else{var l=d(e2,".")?"property":"argument";s2='The "'.concat(e2,'" ').concat(l," ").concat(r3," ").concat(a(t3,"type"))}return s2+=". Received type ".concat(typeof n3),s2},TypeError),r2("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r2("ERR_METHOD_NOT_IMPLEMENTED",function(e2){return"The "+e2+" method is not implemented"}),r2("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r2("ERR_STREAM_DESTROYED",function(e2){return"Cannot call "+e2+" after a stream was destroyed"}),r2("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r2("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r2("ERR_STREAM_WRITE_AFTER_END","write after end"),r2("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r2("ERR_UNKNOWN_ENCODING",function(e2){return"Unknown encoding: "+e2},TypeError),r2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t2.exports.codes=s},{}],16:[function(e,t2){(function(n2){(function(){"use strict";function r2(e2){return this instanceof r2?(d.call(this,e2),s.call(this,e2),this.allowHalfOpen=!0,void(e2&&(e2.readable===!1&&(this.readable=!1),e2.writable===!1&&(this.writable=!1),e2.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a))))):new r2(e2)}function a(){this._writableState.ended||n2.nextTick(o,this)}function o(e2){e2.end()}var i=Object.keys||function(e2){var t3=[];for(var n3 in e2)t3.push(n3);return t3};t2.exports=r2;var d=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(r2,d);for(var l,c=i(s.prototype),u=0;u>>1,e2|=e2>>>2,e2|=e2>>>4,e2|=e2>>>8,e2|=e2>>>16,e2++),e2}function f(e2,t3){return 0>=e2||t3.length===0&&t3.ended?0:t3.objectMode?1:e2===e2?(e2>t3.highWaterMark&&(t3.highWaterMark=p(e2)),e2<=t3.length?e2:t3.ended?t3.length:(t3.needReadable=!0,0)):t3.flowing&&t3.length?t3.buffer.head.data.length:t3.length}function g(e2,t3){if(x("onEofChunk"),!t3.ended){if(t3.decoder){var n3=t3.decoder.end();n3&&n3.length&&(t3.buffer.push(n3),t3.length+=t3.objectMode?1:n3.length)}t3.ended=!0,t3.sync?_(e2):(t3.needReadable=!1,!t3.emittedReadable&&(t3.emittedReadable=!0,h(e2)))}}function _(e2){var t3=e2._readableState;x("emitReadable",t3.needReadable,t3.emittedReadable),t3.needReadable=!1,t3.emittedReadable||(x("emitReadable",t3.flowing),t3.emittedReadable=!0,n2.nextTick(h,e2))}function h(e2){var t3=e2._readableState;x("emitReadable_",t3.destroyed,t3.length,t3.ended),!t3.destroyed&&(t3.length||t3.ended)&&(e2.emit("readable"),t3.emittedReadable=!1),t3.needReadable=!t3.flowing&&!t3.ended&&t3.length<=t3.highWaterMark,S(e2)}function m(e2,t3){t3.readingMore||(t3.readingMore=!0,n2.nextTick(b,e2,t3))}function b(e2,t3){for(;!t3.reading&&!t3.ended&&(t3.length=t3.length?(n3=t3.decoder?t3.buffer.join(""):t3.buffer.length===1?t3.buffer.first():t3.buffer.concat(t3.length),t3.buffer.clear()):n3=t3.buffer.consume(e2,t3.decoder),n3}function v(e2){var t3=e2._readableState;x("endReadable",t3.endEmitted),t3.endEmitted||(t3.ended=!0,n2.nextTick(k,t3,e2))}function k(e2,t3){if(x("endReadableNT",e2.endEmitted,e2.length),!e2.endEmitted&&e2.length===0&&(e2.endEmitted=!0,t3.readable=!1,t3.emit("end"),e2.autoDestroy)){var n3=t3._writableState;(!n3||n3.autoDestroy&&n3.finished)&&t3.destroy()}}function L(e2,t3){for(var n3=0,r3=e2.length;n3=t3.highWaterMark)||t3.ended))return x("read: emitReadable",t3.length,t3.ended),t3.length===0&&t3.ended?v(this):_(this),null;if(e2=f(e2,t3),e2===0&&t3.ended)return t3.length===0&&v(this),null;var a2=t3.needReadable;x("need readable",a2),(t3.length===0||t3.length-e2"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(e,t2){"use strict";function n2(e2,t3){var n3=this._transformState;n3.transforming=!1;var r3=n3.writecb;if(r3===null)return this.emit("error",new s);n3.writechunk=null,n3.writecb=null,t3!=null&&this.push(t3),r3(e2);var a2=this._readableState;a2.reading=!1,(a2.needReadable||a2.length"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(e,t2){(function(n2){(function(){"use strict";function r2(e2,t3,n3){return t3 in e2?Object.defineProperty(e2,t3,{value:n3,enumerable:!0,configurable:!0,writable:!0}):e2[t3]=n3,e2}function a(e2,t3){return{value:e2,done:t3}}function o(e2){var t3=e2[c];if(t3!==null){var n3=e2[h].read();n3!==null&&(e2[g]=null,e2[c]=null,e2[u]=null,t3(a(n3,!1)))}}function i(e2){n2.nextTick(o,e2)}function d(e2,t3){return function(n3,r3){e2.then(function(){return t3[f]?void n3(a(void 0,!0)):void t3[_](n3,r3)},r3)}}var s,l=e("./end-of-stream"),c=Symbol("lastResolve"),u=Symbol("lastReject"),p=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),_=Symbol("handlePromise"),h=Symbol("stream"),m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((s={get stream(){return this[h]},next:function(){var e2=this,t3=this[p];if(t3!==null)return Promise.reject(t3);if(this[f])return Promise.resolve(a(void 0,!0));if(this[h].destroyed)return new Promise(function(t4,r4){n2.nextTick(function(){e2[p]?r4(e2[p]):t4(a(void 0,!0))})});var r3,o2=this[g];if(o2)r3=new Promise(d(o2,this));else{var i2=this[h].read();if(i2!==null)return Promise.resolve(a(i2,!1));r3=new Promise(this[_])}return this[g]=r3,r3}},r2(s,Symbol.asyncIterator,function(){return this}),r2(s,"return",function(){var e2=this;return new Promise(function(t3,n3){e2[h].destroy(null,function(e3){return e3?void n3(e3):void t3(a(void 0,!0))})})}),s),m);t2.exports=function(e2){var t3,n3=Object.create(b,(t3={},r2(t3,h,{value:e2,writable:!0}),r2(t3,c,{value:null,writable:!0}),r2(t3,u,{value:null,writable:!0}),r2(t3,p,{value:null,writable:!0}),r2(t3,f,{value:e2._readableState.endEmitted,writable:!0}),r2(t3,_,{value:function(e3,t4){var r3=n3[h].read();r3?(n3[g]=null,n3[c]=null,n3[u]=null,e3(a(r3,!1))):(n3[c]=e3,n3[u]=t4)},writable:!0}),t3));return n3[g]=null,l(e2,function(e3){if(e3&&e3.code!=="ERR_STREAM_PREMATURE_CLOSE"){var t4=n3[u];return t4!==null&&(n3[g]=null,n3[c]=null,n3[u]=null,t4(e3)),void(n3[p]=e3)}var r3=n3[c];r3!==null&&(n3[g]=null,n3[c]=null,n3[u]=null,r3(a(void 0,!0))),n3[f]=!0}),e2.on("readable",i.bind(null,n3)),n3}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":24,_process:12}],22:[function(e,t2){"use strict";function n2(e2,t3){var n3=Object.keys(e2);if(Object.getOwnPropertySymbols){var r3=Object.getOwnPropertySymbols(e2);t3&&(r3=r3.filter(function(t4){return Object.getOwnPropertyDescriptor(e2,t4).enumerable})),n3.push.apply(n3,r3)}return n3}function r2(e2){for(var t3,r3=1;r3>>0),n3=this.head,r3=0;n3;)s(n3.data,t3,r3),r3+=n3.data.length,n3=n3.next;return t3}},{key:"consume",value:function(e3,t3){var n3;return e3o2.length?o2.length:e3;if(a2+=i2===o2.length?o2:o2.slice(0,e3),e3-=i2,e3===0){i2===o2.length?(++r3,this.head=t3.next?t3.next:this.tail=null):(this.head=t3,t3.data=o2.slice(i2));break}++r3}return this.length-=r3,a2}},{key:"_getBuffer",value:function(e3){var t3=u.allocUnsafe(e3),r3=this.head,a2=1;for(r3.data.copy(t3),e3-=r3.data.length;r3=r3.next;){var o2=r3.data,i2=e3>o2.length?o2.length:e3;if(o2.copy(t3,t3.length-e3,0,i2),e3-=i2,e3===0){i2===o2.length?(++a2,this.head=r3.next?r3.next:this.tail=null):(this.head=r3,r3.data=o2.slice(i2));break}++a2}return this.length-=a2,t3}},{key:g,value:function(e3,t3){return f(this,r2({},t3,{depth:0,customInspect:!1}))}}]),e2}()},{buffer:3,util:2}],23:[function(e,t2){(function(e2){(function(){"use strict";function n2(e3,t3){a(e3,t3),r2(e3)}function r2(e3){e3._writableState&&!e3._writableState.emitClose||e3._readableState&&!e3._readableState.emitClose||e3.emit("close")}function a(e3,t3){e3.emit("error",t3)}t2.exports={destroy:function(t3,o){var i=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(t3):t3&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e2.nextTick(a,this,t3)):e2.nextTick(a,this,t3)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t3||null,function(t4){!o&&t4?i._writableState?i._writableState.errorEmitted?e2.nextTick(r2,i):(i._writableState.errorEmitted=!0,e2.nextTick(n2,i,t4)):e2.nextTick(n2,i,t4):o?(e2.nextTick(r2,i),o(t4)):e2.nextTick(r2,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e3,t3){var n3=e3._readableState,r3=e3._writableState;n3&&n3.autoDestroy||r3&&r3.autoDestroy?e3.destroy(t3):e3.emit("error",t3)}}}).call(this)}).call(this,e("_process"))},{_process:12}],24:[function(e,t2){"use strict";function n2(e2){var t3=!1;return function(){if(!t3){t3=!0;for(var n3=arguments.length,r3=Array(n3),a2=0;a2t3.length)throw new u("streams");var a2,l2=t3.map(function(e3,n4){var d2=n4d){var s=i?o:"highWaterMark";throw new a(s,d)}return t(d)}return e2.objectMode?16:16384}}},{"../../../errors":15}],28:[function(e,t2){t2.exports=e("events").EventEmitter},{events:7}],29:[function(e,t2,n2){n2=t2.exports=e("./lib/_stream_readable.js"),n2.Stream=n2,n2.Readable=n2,n2.Writable=e("./lib/_stream_writable.js"),n2.Duplex=e("./lib/_stream_duplex.js"),n2.Transform=e("./lib/_stream_transform.js"),n2.PassThrough=e("./lib/_stream_passthrough.js"),n2.finished=e("./lib/internal/streams/end-of-stream.js"),n2.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(e,t2,n2){function r2(e2,t3){for(var n3 in e2)t3[n3]=e2[n3]}function a(e2,t3,n3){return i(e2,t3,n3)}var o=e("buffer"),i=o.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t2.exports=o:(r2(o,n2),n2.Buffer=a),a.prototype=Object.create(i.prototype),r2(i,a),a.from=function(e2,t3,n3){if(typeof e2=="number")throw new TypeError("Argument must not be a number");return i(e2,t3,n3)},a.alloc=function(e2,t3,n3){if(typeof e2!="number")throw new TypeError("Argument must be a number");var r3=i(e2);return t3===void 0?r3.fill(0):typeof n3=="string"?r3.fill(t3,n3):r3.fill(t3),r3},a.allocUnsafe=function(e2){if(typeof e2!="number")throw new TypeError("Argument must be a number");return i(e2)},a.allocUnsafeSlow=function(e2){if(typeof e2!="number")throw new TypeError("Argument must be a number");return o.SlowBuffer(e2)}},{buffer:3}],31:[function(e,t2,n2){"use strict";function r2(e2){if(!e2)return"utf8";for(var t3;;)switch(e2){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e2;default:if(t3)return;e2=(""+e2).toLowerCase(),t3=!0}}function a(e2){var t3=r2(e2);if(typeof t3!="string"&&(m.isEncoding===b||!b(e2)))throw new Error("Unknown encoding: "+e2);return t3||e2}function o(e2){this.encoding=a(e2);var t3;switch(this.encoding){case"utf16le":this.text=u,this.end=p,t3=4;break;case"utf8":this.fillLast=c,t3=4;break;case"base64":this.text=f,this.end=g,t3=3;break;default:return this.write=_,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t3)}function d(e2){return 127>=e2?0:e2>>5==6?2:e2>>4==14?3:e2>>3==30?4:e2>>6==2?-1:-2}function s(e2,t3,n3){var r3=t3.length-1;if(r3=r3)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e2[e2.length-2],this.lastChar[1]=e2[e2.length-1],n3.slice(0,-1)}return n3}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e2[e2.length-1],e2.toString("utf16le",t3,e2.length-1)}function p(e2){var t3=e2&&e2.length?this.write(e2):"";if(this.lastNeed){var n3=this.lastTotal-this.lastNeed;return t3+this.lastChar.toString("utf16le",0,n3)}return t3}function f(e2,t3){var r3=(e2.length-t3)%3;return r3==0?e2.toString("base64",t3):(this.lastNeed=3-r3,this.lastTotal=3,r3==1?this.lastChar[0]=e2[e2.length-1]:(this.lastChar[0]=e2[e2.length-2],this.lastChar[1]=e2[e2.length-1]),e2.toString("base64",t3,e2.length-r3))}function g(e2){var t3=e2&&e2.length?this.write(e2):"";return this.lastNeed?t3+this.lastChar.toString("base64",0,3-this.lastNeed):t3}function _(e2){return e2.toString(this.encoding)}function h(e2){return e2&&e2.length?this.write(e2):""}var m=e("safe-buffer").Buffer,b=m.isEncoding||function(e2){switch(e2=""+e2,e2&&e2.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n2.StringDecoder=o,o.prototype.write=function(e2){if(e2.length===0)return"";var t3,n3;if(this.lastNeed){if(t3=this.fillLast(e2),t3===void 0)return"";n3=this.lastNeed,this.lastNeed=0}else n3=0;return n3"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{}],"/":[function(e,t2){function n2(e2){return e2.replace(/a=ice-options:trickle\s\n/g,"")}function r2(e2){console.warn(e2)}let a=e("debug")("simple-peer"),o=e("get-browser-rtc"),i=e("randombytes"),d=e("readable-stream"),s=e("queue-microtask"),l=e("err-code"),{Buffer:c}=e("buffer"),u=65536;class p extends d.Duplex{constructor(e2){if(e2=Object.assign({allowHalfOpen:!1},e2),super(e2),this._id=i(4).toString("hex").slice(0,7),this._debug("new peer %o",e2),this.channelName=e2.initiator?e2.channelName||i(20).toString("hex"):null,this.initiator=e2.initiator||!1,this.channelConfig=e2.channelConfig||p.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},p.config,e2.config),this.offerOptions=e2.offerOptions||{},this.answerOptions=e2.answerOptions||{},this.sdpTransform=e2.sdpTransform||(e3=>e3),this.streams=e2.streams||(e2.stream?[e2.stream]:[]),this.trickle=e2.trickle===void 0||e2.trickle,this.allowHalfTrickle=e2.allowHalfTrickle!==void 0&&e2.allowHalfTrickle,this.iceCompleteTimeout=e2.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e2.wrtc&&typeof e2.wrtc=="object"?e2.wrtc:o(),!this._wrtc)throw l(typeof window>"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e3){return void this.destroy(l(e3,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e3=>{this._onIceCandidate(e3)},typeof this._pc.peerIdentity=="object"&&this._pc.peerIdentity.catch(e3=>{this.destroy(l(e3,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e3=>{this._setupData(e3)},this.streams&&this.streams.forEach(e3=>{this.addStream(e3)}),this._pc.ontrack=e3=>{this._onTrack(e3)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof e2=="string")try{e2=JSON.parse(e2)}catch{e2={}}this._debug("signal()"),e2.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e2.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e2.transceiverRequest.kind,e2.transceiverRequest.init)),e2.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e2.candidate):this._pendingCandidates.push(e2.candidate)),e2.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e2)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e3=>{this._addIceCandidate(e3)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(e3=>{this.destroy(l(e3,"ERR_SET_REMOTE_DESCRIPTION"))}),e2.sdp||e2.candidate||e2.renegotiate||e2.transceiverRequest||this.destroy(l(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e2){let t3=new this._wrtc.RTCIceCandidate(e2);this._pc.addIceCandidate(t3).catch(e3=>{!t3.address||t3.address.endsWith(".local")?r2("Ignoring unsupported ICE candidate."):this.destroy(l(e3,"ERR_ADD_ICE_CANDIDATE"))})}send(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e2)}}addTransceiver(e2,t3){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e2,t3),this._needsNegotiation()}catch(e3){this.destroy(l(e3,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e2,init:t3}})}}addStream(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e2.getTracks().forEach(t3=>{this.addTrack(t3,e2)})}}addTrack(e2,t3){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");let n3=this._senderMap.get(e2)||new Map,r3=n3.get(t3);if(!r3)r3=this._pc.addTrack(e2,t3),n3.set(t3,r3),this._senderMap.set(e2,n3),this._needsNegotiation();else throw r3.removed?l(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):l(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(e2,t3,n3){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");let r3=this._senderMap.get(e2),a2=r3?r3.get(n3):null;if(!a2)throw l(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t3&&this._senderMap.set(t3,r3),a2.replaceTrack==null?this.destroy(l(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):a2.replaceTrack(t3)}removeTrack(e2,t3){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");let n3=this._senderMap.get(e2),r3=n3?n3.get(t3):null;if(!r3)throw l(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r3.removed=!0,this._pc.removeTrack(r3)}catch(e3){e3.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(r3):this.destroy(l(e3,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e2.getTracks().forEach(t3=>{this.removeTrack(t3,e2)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e2){this._destroy(e2,()=>{})}_destroy(e2,t3){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e2&&(e2.message||e2)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e2&&(e2.message||e2)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e2&&this.emit("error",e2),this.emit("close"),t3()}))}_setupData(e2){if(!e2.channel)return this.destroy(l(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e2.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e3=>{this._onChannelMessage(e3)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e3=>{let t4=e3.error instanceof Error?e3.error:new Error(`Datachannel error: ${e3.message} ${e3.filename}:${e3.lineno}:${e3.colno}`);this.destroy(l(t4,"ERR_DATA_CHANNEL"))};let t3=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(t3&&this._onChannelClose(),t3=!0):t3=!1},5e3)}_read(){}_write(e2,t3,n3){if(this.destroyed)return n3(l(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e2)}catch(e3){return this.destroy(l(e3,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>u?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n3):n3(null)}else this._debug("write before connect"),this._chunk=e2,this._cb=n3}_onFinish(){if(!this.destroyed){let e2=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e2():this.once("connect",e2)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e2=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e2.sdp=n2(e2.sdp)),e2.sdp=this.sdpTransform(e2.sdp);let t3=()=>{if(!this.destroyed){let t4=this._pc.localDescription||e2;this._debug("signal"),this.emit("signal",{type:t4.type,sdp:t4.sdp})}};this._pc.setLocalDescription(e2).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t3():this.once("_iceComplete",t3))}).catch(e3=>{this.destroy(l(e3,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(e2=>{this.destroy(l(e2,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e2=>{e2.mid||!e2.sender.track||e2.requested||(e2.requested=!0,this.addTransceiver(e2.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e2=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e2.sdp=n2(e2.sdp)),e2.sdp=this.sdpTransform(e2.sdp);let t3=()=>{if(!this.destroyed){let t4=this._pc.localDescription||e2;this._debug("signal"),this.emit("signal",{type:t4.type,sdp:t4.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e2).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t3():this.once("_iceComplete",t3))}).catch(e3=>{this.destroy(l(e3,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(e2=>{this.destroy(l(e2,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(l(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;let e2=this._pc.iceConnectionState,t3=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e2,t3),this.emit("iceStateChange",e2,t3),(e2==="connected"||e2==="completed")&&(this._pcReady=!0,this._maybeReady()),e2==="failed"&&this.destroy(l(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),e2==="closed"&&this.destroy(l(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e2){let t3=e3=>(Object.prototype.toString.call(e3.values)==="[object Array]"&&e3.values.forEach(t4=>{Object.assign(e3,t4)}),e3);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(n3=>{let r3=[];n3.forEach(e3=>{r3.push(t3(e3))}),e2(null,r3)},t4=>e2(t4)):0{if(this.destroyed)return;let r3=[];n3.result().forEach(e3=>{let n4={};e3.names().forEach(t4=>{n4[t4]=e3.stat(t4)}),n4.id=e3.id,n4.type=e3.type,n4.timestamp=e3.timestamp,r3.push(t3(n4))}),e2(null,r3)},t4=>e2(t4)):e2(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;let e2=()=>{this.destroyed||this.getStats((t3,n3)=>{if(this.destroyed)return;t3&&(n3=[]);let r3={},a2={},o2={},i2=!1;n3.forEach(e3=>{(e3.type==="remotecandidate"||e3.type==="remote-candidate")&&(r3[e3.id]=e3),(e3.type==="localcandidate"||e3.type==="local-candidate")&&(a2[e3.id]=e3),(e3.type==="candidatepair"||e3.type==="candidate-pair")&&(o2[e3.id]=e3)});let d2=e3=>{i2=!0;let t4=a2[e3.localCandidateId];t4&&(t4.ip||t4.address)?(this.localAddress=t4.ip||t4.address,this.localPort=+t4.port):t4&&t4.ipAddress?(this.localAddress=t4.ipAddress,this.localPort=+t4.portNumber):typeof e3.googLocalAddress=="string"&&(t4=e3.googLocalAddress.split(":"),this.localAddress=t4[0],this.localPort=+t4[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n4=r3[e3.remoteCandidateId];n4&&(n4.ip||n4.address)?(this.remoteAddress=n4.ip||n4.address,this.remotePort=+n4.port):n4&&n4.ipAddress?(this.remoteAddress=n4.ipAddress,this.remotePort=+n4.portNumber):typeof e3.googRemoteAddress=="string"&&(n4=e3.googRemoteAddress.split(":"),this.remoteAddress=n4[0],this.remotePort=+n4[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n3.forEach(e3=>{e3.type==="transport"&&e3.selectedCandidatePairId&&d2(o2[e3.selectedCandidatePairId]),(e3.type==="googCandidatePair"&&e3.googActiveConnection==="true"||(e3.type==="candidatepair"||e3.type==="candidate-pair")&&e3.selected)&&d2(e3)}),!i2&&(!Object.keys(o2).length||Object.keys(a2).length))return void setTimeout(e2,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e4){return this.destroy(l(e4,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');let e3=this._cb;this._cb=null,e3(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};e2()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e2=>{this._pc.removeTrack(e2),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e2){this.destroyed||(e2.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e2.candidate.candidate,sdpMLineIndex:e2.candidate.sdpMLineIndex,sdpMid:e2.candidate.sdpMid}}):!e2.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),e2.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e2){if(this.destroyed)return;let t3=e2.data;t3 instanceof ArrayBuffer&&(t3=c.from(t3)),this.push(t3)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);let e2=this._cb;this._cb=null,e2(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e2){this.destroyed||e2.streams.forEach(t3=>{this._debug("on track"),this.emit("track",e2.track,t3),this._remoteTracks.push({track:e2.track,stream:t3}),this._remoteStreams.some(e3=>e3.id===t3.id)||(this._remoteStreams.push(t3),s(()=>{this._debug("on stream"),this.emit("stream",t3)}))})}_debug(){let e2=[].slice.call(arguments);e2[0]="["+this._id+"] "+e2[0],a.apply(null,e2)}}p.WEBRTC_SUPPORT=!!o(),p.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},p.channelConfig={},t2.exports=p},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})}});var messageYjsSyncStep1,messageYjsSyncStep2,messageYjsUpdate,writeSyncStep1,writeSyncStep2,readSyncStep1,readSyncStep2,writeUpdate,readUpdate2,readSyncMessage,init_sync=__esm({"node_modules/y-protocols/sync.js"(){init_encoding();init_decoding();init_yjs();messageYjsSyncStep1=0,messageYjsSyncStep2=1,messageYjsUpdate=2,writeSyncStep1=(encoder,doc2)=>{writeVarUint(encoder,messageYjsSyncStep1);let sv=encodeStateVector(doc2);writeVarUint8Array(encoder,sv)},writeSyncStep2=(encoder,doc2,encodedStateVector)=>{writeVarUint(encoder,messageYjsSyncStep2),writeVarUint8Array(encoder,encodeStateAsUpdate(doc2,encodedStateVector))},readSyncStep1=(decoder,encoder,doc2)=>writeSyncStep2(encoder,doc2,readVarUint8Array(decoder)),readSyncStep2=(decoder,doc2,transactionOrigin)=>{try{applyUpdate(doc2,readVarUint8Array(decoder),transactionOrigin)}catch(error){console.error("Caught error while handling a Yjs update",error)}},writeUpdate=(encoder,update)=>{writeVarUint(encoder,messageYjsUpdate),writeVarUint8Array(encoder,update)},readUpdate2=readSyncStep2,readSyncMessage=(decoder,encoder,doc2,transactionOrigin)=>{let messageType=readVarUint(decoder);switch(messageType){case messageYjsSyncStep1:readSyncStep1(decoder,encoder,doc2);break;case messageYjsSyncStep2:readSyncStep2(decoder,doc2,transactionOrigin);break;case messageYjsUpdate:readUpdate2(decoder,doc2,transactionOrigin);break;default:throw new Error("Unknown message type")}return messageType}}});var deriveKey,encrypt,encryptJson,decrypt,decryptJson,init_crypto=__esm({"node_modules/y-webrtc/src/crypto.js"(){init_encoding();init_decoding();init_promise();init_error();init_string();deriveKey=(secret,roomName)=>{let secretBuffer=encodeUtf8(secret).buffer,salt=encodeUtf8(roomName).buffer;return crypto.subtle.importKey("raw",secretBuffer,"PBKDF2",!1,["deriveKey"]).then(keyMaterial=>crypto.subtle.deriveKey({name:"PBKDF2",salt,iterations:1e5,hash:"SHA-256"},keyMaterial,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))},encrypt=(data,key)=>{if(!key)return resolve(data);let iv=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv},key,data).then(cipher=>{let encryptedDataEncoder=createEncoder();return writeVarString(encryptedDataEncoder,"AES-GCM"),writeVarUint8Array(encryptedDataEncoder,iv),writeVarUint8Array(encryptedDataEncoder,new Uint8Array(cipher)),toUint8Array(encryptedDataEncoder)})},encryptJson=(data,key)=>{let dataEncoder=createEncoder();return writeAny(dataEncoder,data),encrypt(toUint8Array(dataEncoder),key)},decrypt=(data,key)=>{if(!key)return resolve(data);let dataDecoder=createDecoder(data);readVarString(dataDecoder)!=="AES-GCM"&&reject(create2("Unknown encryption algorithm"));let iv=readVarUint8Array(dataDecoder),cipher=readVarUint8Array(dataDecoder);return crypto.subtle.decrypt({name:"AES-GCM",iv},key,cipher).then(data2=>new Uint8Array(data2))},decryptJson=(data,key)=>decrypt(data,key).then(decryptedValue=>readAny(createDecoder(new Uint8Array(decryptedValue))))}});var y_webrtc_exports={};__export(y_webrtc_exports,{Room:()=>Room,SignalingConn:()=>SignalingConn,WebrtcConn:()=>WebrtcConn,WebrtcProvider:()=>WebrtcProvider});var import_simplepeer_min,log,messageSync,messageQueryAwareness,messageAwareness,messageBcPeerId,signalingConns,rooms,checkIsSynced,readMessage,readPeerMessage,sendWebrtcConn,broadcastWebrtcConn,WebrtcConn,broadcastBcMessage,broadcastRoomMessage,announceSignalingInfo,broadcastBcPeerId,Room,openRoom,publishSignalingMessage,SignalingConn,emitStatus,WebrtcProvider,init_y_webrtc=__esm({"node_modules/y-webrtc/src/y-webrtc.js"(){init_websocket();init_map();init_error();init_random();init_encoding();init_decoding();init_observable();init_logging();init_promise();init_broadcastchannel();init_buffer();init_math();init_mutex();import_simplepeer_min=__toESM(require_simplepeer_min(),1);init_sync();init_awareness();init_crypto();log=createModuleLogger2("y-webrtc"),messageSync=0,messageQueryAwareness=3,messageAwareness=1,messageBcPeerId=4,signalingConns=new Map,rooms=new Map,checkIsSynced=room=>{let synced=!0;room.webrtcConns.forEach(peer=>{peer.synced||(synced=!1)}),(!synced&&room.synced||synced&&!room.synced)&&(room.synced=synced,room.provider.emit("synced",[{synced}]),log("synced ",BOLD,room.name,UNBOLD," with all peers"))},readMessage=(room,buf,syncedCallback)=>{let decoder=createDecoder(buf),encoder=createEncoder(),messageType=readVarUint(decoder);if(room===void 0)return null;let awareness=room.awareness,doc2=room.doc,sendReply=!1;switch(messageType){case messageSync:{writeVarUint(encoder,messageSync);let syncMessageType=readSyncMessage(decoder,encoder,doc2,room);syncMessageType===messageYjsSyncStep2&&!room.synced&&syncedCallback(),syncMessageType===messageYjsSyncStep1&&(sendReply=!0);break}case messageQueryAwareness:writeVarUint(encoder,messageAwareness),writeVarUint8Array(encoder,encodeAwarenessUpdate(awareness,Array.from(awareness.getStates().keys()))),sendReply=!0;break;case messageAwareness:applyAwarenessUpdate(awareness,readVarUint8Array(decoder),room);break;case messageBcPeerId:{let add=readUint8(decoder)===1,peerName=readVarString(decoder);if(peerName!==room.peerId&&(room.bcConns.has(peerName)&&!add||!room.bcConns.has(peerName)&&add)){let removed=[],added=[];add?(room.bcConns.add(peerName),added.push(peerName)):(room.bcConns.delete(peerName),removed.push(peerName)),room.provider.emit("peers",[{added,removed,webrtcPeers:Array.from(room.webrtcConns.keys()),bcPeers:Array.from(room.bcConns)}]),broadcastBcPeerId(room)}break}default:return console.error("Unable to compute message"),encoder}return sendReply?encoder:null},readPeerMessage=(peerConn,buf)=>{let room=peerConn.room;return log("received message from ",BOLD,peerConn.remotePeerId,GREY," (",room.name,")",UNBOLD,UNCOLOR),readMessage(room,buf,()=>{peerConn.synced=!0,log("synced ",BOLD,room.name,UNBOLD," with ",BOLD,peerConn.remotePeerId),checkIsSynced(room)})},sendWebrtcConn=(webrtcConn,encoder)=>{log("send message to ",BOLD,webrtcConn.remotePeerId,UNBOLD,GREY," (",webrtcConn.room.name,")",UNCOLOR);try{webrtcConn.peer.send(toUint8Array(encoder))}catch{}},broadcastWebrtcConn=(room,m)=>{log("broadcast message in ",BOLD,room.name,UNBOLD),room.webrtcConns.forEach(conn=>{try{conn.peer.send(m)}catch{}})},WebrtcConn=class{constructor(signalingConn,initiator,remotePeerId,room){log("establishing connection to ",BOLD,remotePeerId),this.room=room,this.remotePeerId=remotePeerId,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new import_simplepeer_min.default({initiator,...room.provider.peerOpts}),this.peer.on("signal",signal=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),publishSignalingMessage(signalingConn,room,{to:remotePeerId,from:room.peerId,type:"signal",token:this.glareToken,signal})}),this.peer.on("connect",()=>{log("connected to ",BOLD,remotePeerId),this.connected=!0;let doc2=room.provider.doc,awareness=room.awareness,encoder=createEncoder();writeVarUint(encoder,messageSync),writeSyncStep1(encoder,doc2),sendWebrtcConn(this,encoder);let awarenessStates=awareness.getStates();if(awarenessStates.size>0){let encoder2=createEncoder();writeVarUint(encoder2,messageAwareness),writeVarUint8Array(encoder2,encodeAwarenessUpdate(awareness,Array.from(awarenessStates.keys()))),sendWebrtcConn(this,encoder2)}}),this.peer.on("close",()=>{this.connected=!1,this.closed=!0,room.webrtcConns.has(this.remotePeerId)&&(room.webrtcConns.delete(this.remotePeerId),room.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(room.webrtcConns.keys()),bcPeers:Array.from(room.bcConns)}])),checkIsSynced(room),this.peer.destroy(),log("closed connection to ",BOLD,remotePeerId),announceSignalingInfo(room)}),this.peer.on("error",err=>{log("Error in connection to ",BOLD,remotePeerId,": ",err),announceSignalingInfo(room)}),this.peer.on("data",data=>{let answer=readPeerMessage(this,data);answer!==null&&sendWebrtcConn(this,answer)})}destroy(){this.peer.destroy()}},broadcastBcMessage=(room,m)=>encrypt(m,room.key).then(data=>room.mux(()=>publish(room.name,data))),broadcastRoomMessage=(room,m)=>{room.bcconnected&&broadcastBcMessage(room,m),broadcastWebrtcConn(room,m)},announceSignalingInfo=room=>{signalingConns.forEach(conn=>{conn.connected&&(conn.send({type:"subscribe",topics:[room.name]}),room.webrtcConns.size{if(room.provider.filterBcConns){let encoderPeerIdBc=createEncoder();writeVarUint(encoderPeerIdBc,messageBcPeerId),writeUint8(encoderPeerIdBc,1),writeVarString(encoderPeerIdBc,room.peerId),broadcastBcMessage(room,toUint8Array(encoderPeerIdBc))}},Room=class{constructor(doc2,provider,name,key){this.peerId=uuidv4(),this.doc=doc2,this.awareness=provider.awareness,this.provider=provider,this.synced=!1,this.name=name,this.key=key,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=createMutex(),this.bcconnected=!1,this._bcSubscriber=data=>decrypt(new Uint8Array(data),key).then(m=>this.mux(()=>{let reply=readMessage(this,m,()=>{});reply&&broadcastBcMessage(this,toUint8Array(reply))})),this._docUpdateHandler=(update,_origin)=>{let encoder=createEncoder();writeVarUint(encoder,messageSync),writeUpdate(encoder,update),broadcastRoomMessage(this,toUint8Array(encoder))},this._awarenessUpdateHandler=({added,updated,removed},_origin)=>{let changedClients=added.concat(updated).concat(removed),encoderAwareness=createEncoder();writeVarUint(encoderAwareness,messageAwareness),writeVarUint8Array(encoderAwareness,encodeAwarenessUpdate(this.awareness,changedClients)),broadcastRoomMessage(this,toUint8Array(encoderAwareness))},this._beforeUnloadHandler=()=>{removeAwarenessStates(this.awareness,[doc2.clientID],"window unload"),rooms.forEach(room=>{room.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof process<"u"&&process.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),announceSignalingInfo(this);let roomName=this.name;subscribe(roomName,this._bcSubscriber),this.bcconnected=!0,broadcastBcPeerId(this);let encoderSync=createEncoder();writeVarUint(encoderSync,messageSync),writeSyncStep1(encoderSync,this.doc),broadcastBcMessage(this,toUint8Array(encoderSync));let encoderState=createEncoder();writeVarUint(encoderState,messageSync),writeSyncStep2(encoderState,this.doc),broadcastBcMessage(this,toUint8Array(encoderState));let encoderAwarenessQuery=createEncoder();writeVarUint(encoderAwarenessQuery,messageQueryAwareness),broadcastBcMessage(this,toUint8Array(encoderAwarenessQuery));let encoderAwarenessState=createEncoder();writeVarUint(encoderAwarenessState,messageAwareness),writeVarUint8Array(encoderAwarenessState,encodeAwarenessUpdate(this.awareness,[this.doc.clientID])),broadcastBcMessage(this,toUint8Array(encoderAwarenessState))}disconnect(){signalingConns.forEach(conn=>{conn.connected&&conn.send({type:"unsubscribe",topics:[this.name]})}),removeAwarenessStates(this.awareness,[this.doc.clientID],"disconnect");let encoderPeerIdBc=createEncoder();writeVarUint(encoderPeerIdBc,messageBcPeerId),writeUint8(encoderPeerIdBc,0),writeVarString(encoderPeerIdBc,this.peerId),broadcastBcMessage(this,toUint8Array(encoderPeerIdBc)),unsubscribe(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach(conn=>conn.destroy())}destroy(){this.disconnect(),typeof window<"u"?window.removeEventListener("beforeunload",this._beforeUnloadHandler):typeof process<"u"&&process.off("exit",this._beforeUnloadHandler)}},openRoom=(doc2,provider,name,key)=>{if(rooms.has(name))throw create2(`A Yjs Doc connected to room "${name}" already exists!`);let room=new Room(doc2,provider,name,key);return rooms.set(name,room),room},publishSignalingMessage=(conn,room,data)=>{room.key?encryptJson(data,room.key).then(data2=>{conn.send({type:"publish",topic:room.name,data:toBase64(data2)})}):conn.send({type:"publish",topic:room.name,data})},SignalingConn=class extends WebsocketClient{constructor(url){super(url),this.providers=new Set,this.on("connect",()=>{log(`connected (${url})`);let topics=Array.from(rooms.keys());this.send({type:"subscribe",topics}),rooms.forEach(room=>publishSignalingMessage(this,room,{type:"announce",from:room.peerId}))}),this.on("message",m=>{switch(m.type){case"publish":{let roomName=m.topic,room=rooms.get(roomName);if(room==null||typeof roomName!="string")return;let execMessage=data=>{let webrtcConns=room.webrtcConns,peerId=room.peerId;if(data==null||data.from===peerId||data.to!==void 0&&data.to!==peerId||room.bcConns.has(data.from))return;let emitPeerChange=webrtcConns.has(data.from)?()=>{}:()=>room.provider.emit("peers",[{removed:[],added:[data.from],webrtcPeers:Array.from(room.webrtcConns.keys()),bcPeers:Array.from(room.bcConns)}]);switch(data.type){case"announce":webrtcConns.sizenew WebrtcConn(this,!0,data.from,room)),emitPeerChange());break;case"signal":if(data.signal.type==="offer"){let existingConn=webrtcConns.get(data.from);if(existingConn){let remoteToken=data.token,localToken=existingConn.glareToken;if(localToken&&localToken>remoteToken){log("offer rejected: ",data.from);return}existingConn.glareToken=void 0}}if(data.signal.type==="answer"){log("offer answered by: ",data.from);let existingConn=webrtcConns.get(data.from);existingConn.glareToken=void 0}data.to===peerId&&(setIfUndefined(webrtcConns,data.from,()=>new WebrtcConn(this,!1,data.from,room)).peer.signal(data.signal),emitPeerChange());break}};room.key?typeof m.data=="string"&&decryptJson(fromBase64(m.data),room.key).then(execMessage):execMessage(m.data)}}}),this.on("disconnect",()=>log(`disconnect (${url})`))}},emitStatus=provider=>{provider.emit("status",[{connected:provider.connected}])},WebrtcProvider=class extends ObservableV2{constructor(roomName,doc2,{signaling=["wss://y-webrtc-eu.fly.dev"],password=null,awareness=new Awareness(doc2),maxConns=20+floor(rand()*15),filterBcConns=!0,peerOpts={}}={}){super(),this.roomName=roomName,this.doc=doc2,this.filterBcConns=filterBcConns,this.awareness=awareness,this.shouldConnect=!1,this.signalingUrls=signaling,this.signalingConns=[],this.maxConns=maxConns,this.peerOpts=peerOpts,this.key=password?deriveKey(password,roomName):resolve(null),this.room=null,this.key.then(key=>{this.room=openRoom(doc2,this,roomName,key),this.shouldConnect?this.room.connect():this.room.disconnect(),emitStatus(this)}),this.connect(),this.destroy=this.destroy.bind(this),doc2.on("destroy",this.destroy)}get connected(){return this.room!==null&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach(url=>{let signalingConn=setIfUndefined(signalingConns,url,()=>new SignalingConn(url));this.signalingConns.push(signalingConn),signalingConn.providers.add(this)}),this.room&&(this.room.connect(),emitStatus(this))}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach(conn=>{conn.providers.delete(this),conn.providers.size===0&&(conn.destroy(),signalingConns.delete(conn.url))}),this.room&&(this.room.disconnect(),emitStatus(this))}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),rooms.delete(this.roomName)}),super.destroy()}}}});var y_quill_exports={};__export(y_quill_exports,{QuillBinding:()=>QuillBinding,normQuillDelta:()=>normQuillDelta});var normQuillDelta,updateCursor,QuillBinding,init_y_quill=__esm({"node_modules/y-quill/src/y-quill.js"(){init_yjs();normQuillDelta=delta=>{if(delta.length>0){let d=delta[delta.length-1],insert=d.insert;if(d.attributes===void 0&&insert!==void 0&&insert.slice(-1)===` `){delta=delta.slice();let ins=insert.slice(0,-1);for(;ins.slice(-1)===` -`;)ins=ins.slice(0,-1);return delta[delta.length-1]={insert:ins},ins.length===0&&delta.pop(),delta}}return delta},updateCursor=(quillCursors,aw,clientId,doc2,type)=>{try{if(aw&&aw.cursor&&clientId!==doc2.clientID){let user=aw.user||{},color=user.color||"#ffa500",name=user.name||`User: ${clientId}`;quillCursors.createCursor(clientId.toString(),name,color);let anchor=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.anchor),doc2),head=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.head),doc2);anchor&&head&&anchor.type===type&&quillCursors.moveCursor(clientId.toString(),{index:anchor.index,length:head.index-anchor.index})}else quillCursors.removeCursor(clientId.toString())}catch(err){console.error(err)}},QuillBinding=class{constructor(type,quill,awareness){let doc2=type.doc;this.type=type,this.doc=doc2,this.quill=quill;let quillCursors=quill.getModule("cursors")||null;this.quillCursors=quillCursors,this._negatedUsedFormats={},this.awareness=awareness,this._awarenessChange=({added,removed,updated})=>{let states=awareness.getStates();added.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),updated.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),removed.forEach(id2=>{quillCursors.removeCursor(id2.toString())})},this._typeObserver=event=>{if(event.transaction.origin!==this){let eventDelta=event.delta,delta=[];for(let i=0;i{if(delta&&delta.ops){let ops=delta.ops;ops.forEach(op=>{if(op.attributes!==void 0)for(let key in op.attributes)this._negatedUsedFormats[key]===void 0&&(this._negatedUsedFormats[key]=!1)}),origin!==this&&doc2.transact(()=>{type.applyDelta(ops)},this)}if(awareness&&quillCursors){let sel=quill.getSelection(),aw=awareness.getLocalState();if(sel===null)awareness.getLocalState()!==null&&awareness.setLocalStateField("cursor",null);else{let anchor=createRelativePositionFromTypeIndex(type,sel.index),head=createRelativePositionFromTypeIndex(type,sel.index+sel.length);(!aw||!aw.cursor||!compareRelativePositions(anchor,aw.cursor.anchor)||!compareRelativePositions(head,aw.cursor.head))&&awareness.setLocalStateField("cursor",{anchor,head})}awareness.getStates().forEach((aw2,clientId)=>{updateCursor(quillCursors,aw2,clientId,doc2,type)})}},quill.on("editor-change",this._quillObserver),quill.setContents(type.toDelta(),this),quillCursors!==null&&awareness&&(awareness.getStates().forEach((aw,clientId)=>{updateCursor(quillCursors,aw,clientId,doc2,type)}),awareness.on("change",this._awarenessChange))}destroy(){this.type.unobserve(this._typeObserver),this.quill.off("editor-change",this._quillObserver),this.awareness&&this.awareness.off("change",this._awarenessChange)}}}});(function(a){typeof globalThis!="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:!0,get:b}),_T_));function b(){var b2=this||self;b2.globalThis=b2,delete a.prototype._T_}})(Object);(function(a){require_quill_core(),require_quill_bubble(),require_quill_snow()})(globalThis);(function(p){"use strict";var w=3850876,af="0",aI=" ",gA="compare: functional value",gi="mkdir",lo="synced",cP=1e3,la="delete",Y="vendor/lwd/lib/lwd/lwd_seq.pp.ml",kI="@[",kV="console",lw="window",a2="int_of_string",gb="fs",kw="%u",lv="/static/",k$="%i",lF="%ni",a1=255,gh=749039939,kH="Assert_failure",kv="camlinternalMod.ml",aJ=737455525,k_="0x",ku=32752,lE=218,k9=57343,kt="End_of_file",lu="OCAMLRUNPARAM",kG=253,k8=": closedir failed",lD="Out_of_memory",kF=553,k7="Not_found",gD="Failure",d6="Unix.Unix_error",k6="style",bE=244,ln="^",b8="text",kU="length",lm="green",gw="ENOTDIR",kE="Lwd_seq.rank: node is marked",bD=936573133,k5="%Li",kd="Invalid_argument",k4="flex",d4=254,b9="+",dY="Set.bal",lC=", characters ",aH=16777215,ks=858694086,kD=120,kC=1027,cL=1024,d1="Map.bal",bg=246,ll="Pervasives.do_at_exit",lt=389604418,kr=65536,kc="submit",c="vendor/brr_lwd_ui/examples/yjs/main.ml",U=16620,gv=15,dW=512,ge=-588596599,k3=", ",kT="closedir",lB="Match_failure",ka="%li",kb=1026,j$=157,j_="b",ga="nan",e="",f$="rmdir",gg="Fatal error: exception ",kq="infinity",L="camlinternalFormat.ml",lj=571,lk="fd ",kR="append",kS=": ",j9=174,q=248,kp="em",ko="data",kQ=224,aL=24029,li=240,kn="Sys_error",as=128,gu="vendor/brr_lwd_ui/bindings/yjs/doc.ml",ls="ENOTEMPTY",lA="EEXIST",gz=1255,k2="checkbox",dV="value",kP="px",gn=" : flags Open_text and Open_binary are not compatible",gt="e",kB="Stack_overflow",gm=": Not a directory",gs="ENOENT",gd=-605101559,T=15681,kO="Undefined_recursive_module",lh="Array",kN=2147483647,lg=544,aA=32768,dX="table",cO="string",km=2048,lr=-48,j8=" : is a directory",kl="@{",k1="error",lf="Division_by_zero",j7="classList",bf=".",kk=`(Program not linked with -g, cannot print stack backtrace) -`,bh=63,bB="name",lq="red",be=737456202,gc=" : file already exists",bz=128,d5=": No such file or directory",kj="vendor/lwd/lib/brr-lwd/elwd.ml",le=255,dU="lwd-to-remove",cM=256,dT="checked",ki="id",cN=-976970511,gr=100,f_="index out of bounds",lp=-937474657,aK="/",kM="height: ",gl=504440814,d3=252,f9="%d",k0="lwdui-virtual-table-row",kY="bold",kZ=": file descriptor already closed",bA="-",f8="EBADF",kh="changes",a0=951901561,kg=102,gq=-97,lz="Printexc.handle_uncaught_exception",kX=12520,gC=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",kL=499,gy=756711075,kA=`Fatal error: exception %s -`,gp=4100401,ly="class",j6="\xE2\x9D\x8C",aZ=250,kf=199,d0="bool",gk=82908052,gB="kind",bC=611392745,go="cell",kK=">",ld="([^/]+)",kz="input",gf="jsError",j5=103,gj=127,d2='"',aB=65535,gx=737308346,ke="documentElement",kJ="Sys_blocked_io",kW=56320,b="vendor/lwd/lib/lwd/lwd.ml",ky="not implemented",lc="Form submitted:",lx="_",f7="target",kx="rem",dZ="_bigarr02",lb=-101336657;function A2(a10,b10,c10,d10,e10){if(d10<=b10)for(var f10=1;f10<=e10;f10++)c10[d10+f10]=a10[b10+f10];else for(var f10=e10;f10>=1;f10--)c10[d10+f10]=a10[b10+f10];return 0}function A3(a10,b10,c10){var d10=new Array(c10+1);d10[0]=0;for(var e10=1,f10=b10+1;e10<=c10;e10++,f10++)d10[e10]=a10[f10];return d10}function gE(a10,b10,c10){return a10[1]===b10?(a10[1]=c10,1):0}function A4(a10,b10){var c10=a10[1];return a10[1]+=b10,c10}function gF(a10){return a10[1]}function mm(a10){var b10=p.process;if(b10&&b10.env&&b10.env[a10]!=null)return b10.env[a10];if(p.jsoo_static_env&&p.jsoo_static_env[a10])return p.jsoo_static_env[a10]}var gZ=0;(function(){var c10=mm(lu);if(c10!==void 0)for(var b10=c10.split(","),a10=0;a10a10.hi?1:this.hia10.mi?1:this.mia10.lo?1:this.loc10?1:b10a10.mi?1:this.mia10.lo?1:this.lo>24),c10=-this.hi+(b10>>24);return new d(a10,b10,c10)},d.prototype.add=function(a10){var b10=this.lo+a10.lo,c10=this.mi+a10.mi+(b10>>24),e10=this.hi+a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.sub=function(a10){var b10=this.lo-a10.lo,c10=this.mi-a10.mi+(b10>>24),e10=this.hi-a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.mul=function(a10){var b10=this.lo*a10.lo,c10=(b10*l0|0)+this.mi*a10.lo+this.lo*a10.mi,e10=(c10*l0|0)+this.hi*a10.lo+this.mi*a10.mi+this.lo*a10.hi;return new d(b10,c10,e10)},d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0},d.prototype.isNeg=function(){return this.hi<<16<0},d.prototype.and=function(a10){return new d(this.lo&a10.lo,this.mi&a10.mi,this.hi&a10.hi)},d.prototype.or=function(a10){return new d(this.lo|a10.lo,this.mi|a10.mi,this.hi|a10.hi)},d.prototype.xor=function(a10){return new d(this.lo^a10.lo,this.mi^a10.mi,this.hi^a10.hi)},d.prototype.shift_left=function(a10){return a10=a10&63,a10==0?this:a10<24?new d(this.lo<>24-a10,this.hi<>24-a10):a10<48?new d(0,this.lo<>48-a10):new d(0,0,this.lo<>a10|this.mi<<24-a10,this.mi>>a10|this.hi<<24-a10,this.hi>>a10):a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi>>a10-24,0):new d(this.hi>>a10-48,0,0)},d.prototype.shift_right=function(a10){if(a10=a10&63,a10==0)return this;var c10=this.hi<<16>>16;if(a10<24)return new d(this.lo>>a10|this.mi<<24-a10,this.mi>>a10|c10<<24-a10,this.hi<<16>>a10>>>16);var b10=this.hi<<16>>31;return a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi<<16>>a10-24>>16,b10&aB):new d(this.hi<<16>>a10-32,b10,b10)},d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&aH,this.lo=this.lo<<1&aH},d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aH,this.mi=(this.mi>>>1|this.hi<<23)&aH,this.hi=this.hi>>>1},d.prototype.udivmod=function(a10){for(var e10=0,c10=this.copy(),b10=a10.copy(),f10=new d(0,0,0);c10.ucompare(b10)>0;)e10++,b10.lsl1();for(;e10>=0;)e10--,f10.lsl1(),c10.ucompare(b10)>=0&&(f10.lo++,c10=c10.sub(b10)),b10.lsr1();return{quotient:f10,modulus:c10}},d.prototype.div=function(a10){var b10=this;a10.isZero()&&mf();var d10=b10.hi^a10.hi;b10.hi&aA&&(b10=b10.neg()),a10.hi&aA&&(a10=a10.neg());var c10=b10.udivmod(a10).quotient;return d10&aA&&(c10=c10.neg()),c10},d.prototype.mod=function(a10){var b10=this;a10.isZero()&&mf();var d10=b10.hi;b10.hi&aA&&(b10=b10.neg()),a10.hi&aA&&(a10=a10.neg());var c10=b10.udivmod(a10).modulus;return d10&aA&&(c10=c10.neg()),c10},d.prototype.toInt=function(){return this.lo|this.mi<<24},d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},d.prototype.toArray=function(){return[this.hi>>8,this.hi&a1,this.mi>>16,this.mi>>8&a1,this.mi&a1,this.lo>>16,this.lo>>8&a1,this.lo&a1]},d.prototype.lo32=function(){return this.lo|(this.mi&a1)<<24},d.prototype.hi32=function(){return this.mi>>>8&aB|this.hi<<16};function Bv(a10,b10){return new d(a10&aH,a10>>>24&a1|(b10&aB)<<8,b10>>>16&aB)}function gQ(a10){return a10.hi32()}function gR(a10){return a10.lo32()}function cR(){G(f_)}var A6=dZ;function bi(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}bi.prototype.caml_custom=A6,bi.prototype.offset=function(a10){var c10=0;if(typeof a10=="number"&&(a10=[a10]),a10 instanceof Array||G("bigarray.js: invalid offset"),this.dims.length!=a10.length&&G("Bigarray.get/set: bad number of dimensions"),this.layout==0)for(var b10=0;b10=this.dims[b10])&&cR(),c10=c10*this.dims[b10]+a10[b10];else for(var b10=this.dims.length-1;b10>=0;b10--)(a10[b10]<1||a10[b10]>this.dims[b10])&&cR(),c10=c10*this.dims[b10]+(a10[b10]-1);return c10},bi.prototype.get=function(a10){switch(this.kind){case 7:var d10=this.data[a10*2+0],b10=this.data[a10*2+1];return Bv(d10,b10);case 10:case 11:var e10=this.data[a10*2+0],c10=this.data[a10*2+1];return[d4,e10,c10];default:return this.data[a10]}},bi.prototype.set=function(a10,b10){switch(this.kind){case 7:this.data[a10*2+0]=gR(b10),this.data[a10*2+1]=gQ(b10);break;case 10:case 11:this.data[a10*2+0]=b10[1],this.data[a10*2+1]=b10[2];break;default:this.data[a10]=b10;break}return 0},bi.prototype.fill=function(a10){switch(this.kind){case 7:var c10=gR(a10),e10=gQ(a10);if(c10==e10)this.data.fill(c10);else for(var b10=0;b10e10)return 1;if(d10!=e10){if(!b10)return NaN;if(d10==d10)return 1;if(e10==e10)return-1}}break;case 7:for(var c10=0;c10a10.data[c10+1])return 1;if(this.data[c10]>>>0>>0)return-1;if(this.data[c10]>>>0>a10.data[c10]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var c10=0;c10a10.data[c10])return 1}break}return 0};function b_(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}b_.prototype=new bi,b_.prototype.offset=function(a10){return typeof a10!="number"&&(a10 instanceof Array&&a10.length==1?a10=a10[0]:G("Ml_Bigarray_c_1_1.offset")),(a10<0||a10>=this.dims[0])&&cR(),a10},b_.prototype.get=function(a10){return this.data[a10]},b_.prototype.set=function(a10,b10){return this.data[a10]=b10,0},b_.prototype.fill=function(a10){return this.data.fill(a10),0};function gG(a10,b10,c10,d10){var e10=lK(a10);return d8(c10)*e10!=d10.length&&G("length doesn't match dims"),b10==0&&c10.length==1&&e10==1?new b_(a10,b10,c10,d10):new bi(a10,b10,c10,d10)}function gT(a10){return a10.slice(1)}function A5(a10,b10,c10){var d10=gT(c10),e10=lI(a10,d8(d10));return gG(a10,b10,d10,e10)}function cS(a10,b10,c10){return a10.set(a10.offset(b10),c10),0}function c0(a10,b10,c10){var d10=String.fromCharCode;if(b10==0&&c10<=4096&&c10==a10.length)return d10.apply(null,a10);for(var f10=e;0=c10.l||c10.t==2&&e10>=c10.c.length))c10.c=a10.t==4?c0(a10.c,b10,e10):b10==0&&a10.c.length==e10?a10.c:a10.c.substr(b10,e10),c10.t=c10.c.length==c10.l?0:2;else if(c10.t==2&&d10==c10.c.length)c10.c+=a10.t==4?c0(a10.c,b10,e10):b10==0&&a10.c.length==e10?a10.c:a10.c.substr(b10,e10),c10.t=c10.c.length==c10.l?0:2;else{c10.t!=4&&ea(c10);var g10=a10.c,h10=c10.c;if(a10.t==4)if(d10<=b10)for(var f10=0;f10=0;f10--)h10[d10+f10]=g10[b10+f10];else{for(var i10=Math.min(e10,g10.length-b10),f10=0;f10>=1,a10==0)return d10;b10+=b10,c10++,c10==9&&b10.slice(0,1)}}function cV(a10){a10.t==2?a10.c+=b$(a10.l-a10.c.length,"\0"):a10.c=c0(a10.c,0,a10.c.length),a10.t=0}function g2(a10){if(a10.length<24){for(var b10=0;b10gj)return!1;return!0}else return!/[^\x00-\x7f]/.test(a10)}function mk(a10){for(var k10=e,d10=e,h10,g10,i10,b10,c10=0,j10=a10.length;c10dW?(d10.substr(0,1),k10+=d10,d10=e,k10+=a10.slice(c10,f10)):d10+=a10.slice(c10,f10),f10==j10)break;c10=f10}b10=1,++c10=55295&&b10<57344)&&(b10=2)):(b10=3,++c101114111)&&(b10=3)))))),b10<4?(c10-=b10,d10+="\uFFFD"):b10>aB?d10+=String.fromCharCode(55232+(b10>>10),kW+(b10&1023)):d10+=String.fromCharCode(b10),d10.length>cL&&(d10.substr(0,1),k10+=d10,d10=e)}return k10+d10}function a3(a10,b10,c10){this.t=a10,this.c=b10,this.l=c10}a3.prototype.toString=function(){switch(this.t){case 9:return this.c;default:cV(this);case 0:if(g2(this.c))return this.t=9,this.c;this.t=8;case 8:return this.c}},a3.prototype.toUtf16=function(){var a10=this.toString();return this.t==9?a10:mk(a10)},a3.prototype.slice=function(){var a10=this.t==4?this.c.slice():this.c;return new a3(this.t,a10,this.l)};function lN(a10){return new a3(0,a10,a10.length)}function aM(a10){return a10}function bj(a10){return lN(a10)}function cT(a10,b10,c10,d10,e10){return a4(bj(a10),b10,c10,d10,e10),0}function d9(){G(f_)}function bG(a10,b10){switch(a10.t&6){default:if(b10>=a10.c.length)return 0;case 0:return a10.c.charCodeAt(b10);case 4:return a10.c[b10]}}function A_(a10,b10){return b10>>>0>=a10.l&&d9(),bG(a10,b10)}function bH(a10){return new d(a10[7]<<0|a10[6]<<8|a10[5]<<16,a10[4]<<0|a10[3]<<8|a10[2]<<16,a10[1]<<0|a10[0]<<8)}function A$(a10,b10){b10>>>0>=a10.l-7&&d9();for(var d10=new Array(8),c10=0;c10<8;c10++)d10[7-c10]=bG(a10,b10+c10);return bH(d10)}function B(a10,b10,c10){if(c10&=a1,a10.t!=4){if(b10==a10.c.length)return a10.c+=String.fromCharCode(c10),b10+1==a10.l&&(a10.t=0),0;ea(a10)}return a10.c[b10]=c10,0}function at(a10,b10,c10){return b10>>>0>=a10.l&&d9(),B(a10,b10,c10)}function bI(a10){return a10.toArray()}function lO(a10,b10,c10){b10>>>0>=a10.l-7&&d9();for(var e10=bI(c10),d10=0;d10<8;d10++)B(a10,b10+7-d10,e10[d10]);return 0}function bk(d10,c10){var f10=d10.l>=0?d10.l:d10.l=d10.length,e10=c10.length,b10=f10-e10;if(b10==0)return d10.apply(null,c10);if(b10<0){var a10=d10.apply(null,c10.slice(0,f10));return typeof a10!="function"?a10:bk(a10,c10.slice(f10))}else{switch(b10){case 1:{var a10=function(a11){for(var f11=new Array(e10+1),b11=0;b11>>0>=a10.length-1&&cR(),a10}function Ba(a10){return isFinite(a10)?Math.abs(a10)>=22250738585072014e-324?0:a10!=0?1:2:isNaN(a10)?4:3}function l5(a10){return a10==245?1:0}var Cd=Math.log2&&Math.log2(11235582092889474e291)==1020;function Cc(a10){if(Cd)return Math.floor(Math.log2(a10));var b10=0;if(a10==0)return-1/0;if(a10>=1)for(;a10>=2;)a10/=2,b10++;else for(;a10<1;)a10*=2,b10--;return b10}function gN(a10){var b10=new Float32Array(1);b10[0]=a10;var c10=new Int32Array(b10.buffer);return c10[0]|0}function ao(a10,b10,c10){return new d(a10,b10,c10)}function ed(a10){if(!isFinite(a10))return isNaN(a10)?ao(1,0,ku):a10>0?ao(0,0,ku):ao(0,0,65520);var f10=a10==0&&1/a10==-1/0?aA:a10>=0?0:aA;f10&&(a10=-a10);var b10=Cc(a10)+1023;b10<=0?(b10=0,a10/=Math.pow(2,-kb)):(a10/=Math.pow(2,b10-kC),a10<16&&(a10*=2,b10-=1),b10==0&&(a10/=2));var d10=Math.pow(2,24),c10=a10|0;a10=(a10-c10)*d10;var e10=a10|0;a10=(a10-e10)*d10;var g10=a10|0;return c10=c10&gv|f10|b10<<4,ao(g10,e10,c10)}function lM(a10,b10,c10){if(a10.write(32,b10.dims.length),a10.write(32,b10.kind|b10.layout<<8),b10.caml_custom==dZ)for(var d10=0;d10>4;if(d10==2047)return f10|g10|c10&gv?NaN:c10&aA?-1/0:1/0;var e10=Math.pow(2,-24),b10=(f10*e10+g10)*e10+(c10&gv);return d10>0?(b10+=16,b10*=Math.pow(2,d10-kC)):b10*=Math.pow(2,-kb),c10&aA&&(b10=-b10),b10}function S(a10){V.Failure||(V.Failure=[q,gD,-3]),gY(V.Failure,a10)}function lJ(a10,b10,c10){var k10=a10.read32s();(k10<0||k10>16)&&S("input_value: wrong number of bigarray dimensions");var r10=a10.read32s(),l10=r10&a1,q10=r10>>8&1,j10=[];if(c10==dZ)for(var d10=0;d10>>17,b10=cZ(b10,461845907),a10^=b10,a10=a10<<13|a10>>>19,(a10+(a10<<2)|0)+-430675100|0}function Bp(a10,b10){return a10=W(a10,gR(b10)),a10=W(a10,gQ(b10)),a10}function gL(a10,b10){return Bp(a10,ed(b10))}function lL(a10){var c10=d8(a10.dims),d10=0;switch(a10.kind){case 2:case 3:case 12:c10>cM&&(c10=cM);var e10=0,b10=0;for(b10=0;b10+4<=a10.data.length;b10+=4)e10=a10.data[b10+0]|a10.data[b10+1]<<8|a10.data[b10+2]<<16|a10.data[b10+3]<<24,d10=W(d10,e10);switch(e10=0,c10&3){case 3:e10=a10.data[b10+2]<<16;case 2:e10|=a10.data[b10+1]<<8;case 1:e10|=a10.data[b10+0],d10=W(d10,e10)}break;case 4:case 5:c10>bz&&(c10=bz);var e10=0,b10=0;for(b10=0;b10+2<=a10.data.length;b10+=2)e10=a10.data[b10+0]|a10.data[b10+1]<<16,d10=W(d10,e10);c10&1&&(d10=W(d10,a10.data[b10]));break;case 6:c10>64&&(c10=64);for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32),c10*=2;for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32);for(var b10=0;b100?f10(b10,a10,d10):f10(a10,b10,d10);if(d10&&e10!=e10)return c10;if(+e10!=+e10)return+e10;if(e10|0)return e10|0}return c10}function ef(a10){return typeof a10=="string"&&!/[^\x00-\xff]/.test(a10)}function ee(a10){return a10 instanceof a3}function lQ(a10){if(typeof a10=="number")return cP;if(ee(a10))return d3;if(ef(a10))return 1252;if(a10 instanceof Array&&a10[0]===a10[0]>>>0&&a10[0]<=le){var b10=a10[0]|0;return b10==d4?0:b10}else{if(a10 instanceof String)return kX;if(typeof a10=="string")return kX;if(a10 instanceof Number)return cP;if(a10&&a10.caml_custom)return gz;if(a10&&a10.compare)return 1256;if(typeof a10=="function")return 1247;if(typeof a10=="symbol")return 1251}return 1001}function l3(a10,b10){return a10b10?1:0}function A9(a10,b10){return a10.t&6&&cV(a10),b10.t&6&&cV(b10),a10.cb10.c?1:0}function d$(a10,b10,c10){for(var f10=[];;){if(!(c10&&a10===b10)){var e10=lQ(a10);if(e10==aZ){a10=a10[1];continue}var g10=lQ(b10);if(g10==aZ){b10=b10[1];continue}if(e10!==g10)return e10==cP?g10==gz?lP(a10,b10,-1,c10):-1:g10==cP?e10==gz?lP(b10,a10,1,c10):1:e10b10)return 1;if(a10!=b10){if(!c10)return NaN;if(a10==a10)return 1;if(b10==b10)return-1}break;case 1001:if(a10b10)return 1;if(a10!=b10){if(!c10)return NaN;if(a10==a10)return 1;if(b10==b10)return-1}break;case 1251:if(a10!==b10)return c10?1:NaN;break;case 1252:var a10=a10,b10=b10;if(a10!==b10){if(a10b10)return 1}break;case 12520:var a10=a10.toString(),b10=b10.toString();if(a10!==b10){if(a10b10)return 1}break;case 246:case 254:default:if(l5(e10)){G("compare: continuation value");break}if(a10.length!=b10.length)return a10.length1&&f10.push(a10,b10,1);break}}if(f10.length==0)return 0;var h10=f10.pop();b10=f10.pop(),a10=f10.pop(),h10+10)if(b10==0&&(c10>=a10.l||a10.t==2&&c10>=a10.c.length))d10==0?(a10.c=e,a10.t=2):(a10.c=b$(c10,String.fromCharCode(d10)),a10.t=c10==a10.l?0:2);else for(a10.t!=4&&ea(a10),c10+=b10;b100&&b10===b10||(a10=a10.replace(/_/g,e),b10=+a10,a10.length>0&&b10===b10||/^[+-]?nan$/i.test(a10)))return b10;var c10=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a10);if(c10){var d10=c10[3].replace(/0+$/,e),g10=parseInt(c10[1]+c10[2]+d10,16),f10=(c10[5]|0)-4*d10.length;return b10=g10*Math.pow(2,f10),b10}if(/^\+?inf(inity)?$/i.test(a10))return 1/0;if(/^-inf(inity)?$/i.test(a10))return-1/0;S("float_of_string")}function gX(a10){a10=a10;var e10=a10.length;e10>31&&G("format_int: format too long");for(var b10={justify:b9,signstyle:bA,filler:aI,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},d10=0;d10=0&&c10<=9;)b10.width=b10.width*10+c10,d10++;d10--;break;case".":for(b10.prec=0,d10++;c10=a10.charCodeAt(d10)-48,c10>=0&&c10<=9;)b10.prec=b10.prec*10+c10,d10++;d10--;case"d":case"i":b10.signedconv=!0;case"u":b10.base=10;break;case"x":b10.base=16;break;case"X":b10.base=16,b10.uppercase=!0;break;case"o":b10.base=8;break;case"e":case"f":case"g":b10.signedconv=!0,b10.conv=c10;break;case"E":case"F":case"G":b10.signedconv=!0,b10.uppercase=!0,b10.conv=c10.toLowerCase();break}}return b10}function gJ(a10,b10){a10.uppercase&&(b10=b10.toUpperCase());var f10=b10.length;a10.signedconv&&(a10.sign<0||a10.signstyle!=bA)&&f10++,a10.alternate&&(a10.base==8&&(f10+=1),a10.base==16&&(f10+=2));var c10=e;if(a10.justify==b9&&a10.filler==aI)for(var d10=f10;d1020?(c11-=20,a11/=Math.pow(10,c11),a11+=new Array(c11+1).join(af),b11>0&&(a11=a11+bf+new Array(b11+1).join(af)),a11):a11.toFixed(b11)}var c10,f10=gX(a10),e10=f10.prec<0?6:f10.prec;if((b10<0||b10==0&&1/b10==-1/0)&&(f10.sign=-1,b10=-b10),isNaN(b10))c10=ga,f10.filler=aI;else if(!isFinite(b10))c10="inf",f10.filler=aI;else switch(f10.conv){case"e":var c10=b10.toExponential(e10),d10=c10.length;c10.charAt(d10-3)==gt&&(c10=c10.slice(0,d10-1)+af+c10.slice(d10-1));break;case"f":c10=j10(b10,e10);break;case"g":e10=e10||1,c10=b10.toExponential(e10-1);var i10=c10.indexOf(gt),h10=+c10.slice(i10+1);if(h10<-4||b10>=1e21||b10.toFixed(0).length>e10){for(var d10=i10-1;c10.charAt(d10)==af;)d10--;c10.charAt(d10)==bf&&d10--,c10=c10.slice(0,d10+1)+c10.slice(i10),d10=c10.length,c10.charAt(d10-3)==gt&&(c10=c10.slice(0,d10-1)+af+c10.slice(d10-1));break}else{var g10=e10;if(h10<0)g10-=h10+1,c10=b10.toFixed(g10);else for(;c10=b10.toFixed(g10),c10.length>e10+1;)g10--;if(g10){for(var d10=c10.length-1;c10.charAt(d10)==af;)d10--;c10.charAt(d10)==bf&&d10--,c10=c10.slice(0,d10+1)}}break}return gJ(f10,c10)}function ec(a10,b10){if(a10==f9)return e+b10;var c10=gX(a10);b10<0&&(c10.signedconv?(c10.sign=-1,b10=-b10):b10>>>=0);var d10=b10.toString(c10.base);if(c10.prec>=0){c10.filler=aI;var f10=c10.prec-d10.length;f10>0&&(d10=b$(f10,af)+d10)}return gJ(c10,d10)}var BX=0;function ag(){return BX++}function H(a10){return g2(a10)?a10:mk(a10)}function c1(){return typeof p.process<"u"&&typeof p.process.versions<"u"&&typeof p.process.versions.node<"u"}function Ce(){function a10(a11){if(a11.charAt(0)===aK)return[e,a11.substring(1)]}function b10(a11){var h10=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b11=h10.exec(a11),c10=b11[1]||e,f10=!!(c10&&c10.charAt(1)!==":");if(b11[2]||f10){var d10=b11[1]||e,g10=b11[2]||e;return[d10,a11.substring(d10.length+g10.length)]}}return c1()&&p.process&&p.process.platform&&p.process.platform==="win32"?b10:a10}var g3=Ce();function mi(a10){return a10.slice(-1)!==aK?a10+aK:a10}if(c1()&&p.process&&p.process.cwd)var cW=p.process.cwd().replace(/\\/g,aK);else var cW="/static";cW=mi(cW);function BM(a10){a10=H(a10),g3(a10)||(a10=cW+a10);for(var e10=g3(a10),d10=e10[1].split(aK),b10=[],c10=0;c101&&b10.pop();break;case".":break;case"":break;default:b10.push(d10[c10]);break}return b10.unshift(e10[0]),b10.orig=a10,b10}function B6(a10){for(var g10=e,c10=g10,b10,i10,d10=0,h10=a10.length;d10dW?(c10.substr(0,1),g10+=c10,c10=e,g10+=a10.slice(d10,f10)):c10+=a10.slice(d10,f10),f10==h10)break;d10=f10}b10>6),c10+=String.fromCharCode(as|b10&bh)):b10<55296||b10>=k9?c10+=String.fromCharCode(kQ|b10>>12,as|b10>>6&bh,as|b10&bh):b10>=56319||d10+1==h10||(i10=a10.charCodeAt(d10+1))k9?c10+="\xEF\xBF\xBD":(d10++,b10=(b10<<10)+i10-56613888,c10+=String.fromCharCode(li|b10>>18,as|b10>>12&bh,as|b10>>6&bh,as|b10&bh)),c10.length>cL&&(c10.substr(0,1),g10+=c10,c10=e)}return g10+c10}function aw(a10){return g2(a10)?a10:B6(a10)}var Cf=["E2BIG","EACCES","EAGAIN",f8,"EBUSY","ECHILD","EDEADLK","EDOM",lA,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",gs,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",gw,ls,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function a6(a10,b10,c10,d10){var f10=Cf.indexOf(a10);f10<0&&(d10==null&&(d10=-9999),f10=[0,d10]);var g10=[f10,aw(b10||e),aw(c10||e)];return g10}var ma={};function bm(a10){return ma[a10]}function a5(a10,b10){throw g([0,a10].concat(b10))}function gH(a10){return a10 instanceof Uint8Array||(a10=new Uint8Array(a10)),new a3(4,a10,a10.length)}function m(a10){gY(V.Sys_error,a10)}function me(a10){m(a10+d5)}function g1(a10){return a10.t!=4&&ea(a10),a10.c}function au(a10){return a10.l}function lG(){}function Z(a10){this.data=a10}Z.prototype=new lG,Z.prototype.constructor=Z,Z.prototype.truncate=function(a10){var b10=this.data;this.data=C(a10|0),a4(b10,0,this.data,0,a10)},Z.prototype.length=function(){return au(this.data)},Z.prototype.write=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10){var f10=C(a10+d10),g10=this.data;this.data=f10,a4(g10,0,this.data,0,e10)}return a4(gH(b10),c10,this.data,a10,d10),0},Z.prototype.read=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10&&(d10=e10-a10),d10){var f10=C(d10|0);a4(this.data,a10,f10,0,d10),b10.set(g1(f10),c10)}return d10};function bF(a10,b10,c10){this.file=b10,this.name=a10,this.flags=c10}bF.prototype.err_closed=function(){m(this.name+kZ)},bF.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()},bF.prototype.write=function(a10,b10,c10,d10){if(this.file)return this.file.write(a10,b10,c10,d10);this.err_closed()},bF.prototype.read=function(a10,b10,c10,d10){if(this.file)return this.file.read(a10,b10,c10,d10);this.err_closed()},bF.prototype.close=function(){this.file=void 0};function O(a10,b10){this.content={},this.root=a10,this.lookupFun=b10}O.prototype.nm=function(a10){return this.root+a10},O.prototype.create_dir_if_needed=function(a10){for(var d10=a10.split(aK),c10=e,b10=0;b10>>16,a10=cZ(a10,-2048144789),a10^=a10>>>13,a10=cZ(a10,-1028477387),a10^=a10>>>16,a10}function Bl(a10,b10,c10,d10){var j10,k10,l10,h10,g10,f10,e10,i10,m10;for(h10=b10,(h10<0||h10>cM)&&(h10=cM),g10=a10,f10=c10,j10=[d10],k10=0,l10=1;k100;)if(e10=j10[k10++],e10&&e10.caml_custom){if(cX[e10.caml_custom]&&cX[e10.caml_custom].hash){var n10=cX[e10.caml_custom].hash(e10);f10=W(f10,n10),g10--}}else if(e10 instanceof Array&&e10[0]===(e10[0]|0))switch(e10[0]){case 248:f10=W(f10,e10[2]),g10--;break;case 250:j10[--k10]=e10[1];break;default:if(l5(e10[0]))break;var o10=e10.length-1<<10|e10[0];for(f10=W(f10,o10),i10=1,m10=e10.length;i10=h10);i10++)j10[l10++]=e10[i10];break}else ee(e10)?(f10=Bm(f10,e10),g10--):ef(e10)?(f10=Bq(f10,e10),g10--):typeof e10=="string"?(f10=gM(f10,e10),g10--):e10===(e10|0)?(f10=W(f10,e10+e10+1),g10--):typeof e10=="number"&&(f10=gL(f10,e10),g10--);return f10=Bo(f10),f10&1073741823}function Br(a10,b10,c10){if(!isFinite(a10))return isNaN(a10)?aw(ga):aw(a10>0?kq:"-infinity");var k10=a10==0&&1/a10==-1/0?1:a10>=0?0:1;k10&&(a10=-a10);var f10=0;if(a10!=0)if(a10<1)for(;a10<1&&f10>-1022;)a10*=2,f10--;else for(;a10>=2;)a10/=2,f10++;var l10=f10<0?e:b9,g10=e;if(k10)g10=bA;else switch(c10){case 43:g10=b9;break;case 32:g10=aI;break;default:break}if(b10>=0&&b10<13){var i10=Math.pow(2,b10*4);a10=Math.round(a10*i10)/i10}var d10=a10.toString(16);if(b10>=0){var j10=d10.indexOf(bf);if(j10<0)d10+=bf+b$(b10,af);else{var h10=j10+1+b10;d10.length>24&aH,a10>>31&aB)}function l2(a10){return a10.toInt()}function By(a10){return+a10.isNeg()}function lY(a10){return a10.neg()}function Bw(a10,b10){var c10=gX(a10);c10.signedconv&&By(b10)&&(c10.sign=-1,b10=lY(b10));var d10=e,i10=cY(c10.base),h10="0123456789abcdef";do{var g10=b10.udivmod(i10);b10=g10.quotient,d10=h10.charAt(l2(g10.modulus))+d10}while(!Bz(b10));if(c10.prec>=0){c10.filler=aI;var f10=c10.prec-d10.length;f10>0&&(d10=b$(f10,af)+d10)}return gJ(c10,d10)}function l1(a10,b10){return a10.or(b10)}function mc(a10){var b10=0,e10=n(a10),c10=10,d10=1;if(e10>0)switch(_(a10,b10)){case 45:b10++,d10=-1;break;case 43:b10++,d10=1;break}if(b10+1=48&&a10<=57?a10-48:a10>=65&&a10<=90?a10-55:a10>=97&&a10<=122?a10-87:-1}function l4(a10){var h10=mc(a10),d10=h10[0],i10=h10[1],e10=h10[2],g10=n(a10),j10=-1>>>0,f10=d10=e10)&&S(a2);var b10=c10;for(d10++;d10=e10)break;b10=e10*b10+c10,b10>j10&&S(a2)}return d10!=g10&&S(a2),b10=i10*b10,e10==10&&(b10|0)!=b10&&S(a2),b10|0}function eg(a10,b10,c10){return a10[H(b10)].apply(a10,gT(c10))}function l6(a10,b10){switch(b10.length){case 1:return new a10;case 2:return new a10(b10[1]);case 3:return new a10(b10[1],b10[2]);case 4:return new a10(b10[1],b10[2],b10[3]);case 5:return new a10(b10[1],b10[2],b10[3],b10[4]);case 6:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5]);case 7:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6]);case 8:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6],b10[7])}function c10(){return a10.apply(this,gT(b10))}return c10.prototype=a10.prototype,new c10}function gU(a10){for(var c10={},b10=1;b10>>0&&gW(a10,bg,bE)?0:1}function l7(a10){return gW(a10,bE,aZ),0}function BK(a10,b10){return+(d$(a10,b10,!1)<0)}function BL(a10){for(var b10=[];a10!==0;a10=a10[2])b10.push(a10[1]);return b10}function mb(a10){return a10}function lW(a10,b10){return a10.add(b10)}function lX(a10,b10){return a10.mul(b10)}function gS(a10,b10){return a10.ucompare(b10)<0}function lZ(a10){var h10=mc(a10),g10=h10[0],j10=h10[1],e10=h10[2],i10=cY(e10),k10=new d(aH,268435455,aB).udivmod(i10).quotient,f10=_(a10,g10),b10=eh(f10);(b10<0||b10>=e10)&&S(a2);for(var c10=cY(b10);;)if(g10++,f10=_(a10,g10),f10!=95){if(b10=eh(f10),b10<0||b10>=e10)break;gS(k10,c10)&&S(a2),b10=cY(b10),c10=lW(lX(i10,c10),b10),gS(c10,b10)&&S(a2)}return g10!=n(a10)&&S(a2),e10==10&&gS(new d(0,0,aA),c10)&&S(a2),j10<0&&(c10=lY(c10)),c10}function A7(a10,b10){return a10.get(a10.offset(b10))}function BE(a10,b10){return a10.xor(b10)}function BC2(a10,b10){return a10.shift_right_unsigned(b10)}function BB(a10,b10){return a10.shift_left(b10)}function l8(a10){function o10(a11,b11){return BB(a11,b11)}function h10(a11,b11){return BC2(a11,b11)}function s10(a11,b11){return l1(a11,b11)}function f10(a11,b11){return BE(a11,b11)}function k10(a11,b11){return lW(a11,b11)}function i10(a11,b11){return lX(a11,b11)}function m10(a11,b11){return s10(o10(a11,b11),h10(a11,64-b11))}function g10(a11,b11){return A7(a11,b11)}function j10(a11,b11,c11){return cS(a11,b11,c11)}var q10=lZ(mb("0xd1342543de82ef95")),l10=lZ(mb("0xdaba0b6eb09322e3")),b10,d10,c10,e10=a10,r10=g10(e10,0),n10=g10(e10,1),p10=g10(e10,2),t10=g10(e10,3);b10=k10(n10,p10),b10=i10(f10(b10,h10(b10,32)),l10),b10=i10(f10(b10,h10(b10,32)),l10),b10=f10(b10,h10(b10,32)),j10(e10,1,k10(i10(n10,q10),r10));var d10=p10,c10=t10;return c10=f10(c10,d10),d10=m10(d10,24),d10=f10(f10(d10,c10),o10(c10,16)),c10=m10(c10,37),j10(e10,2,d10),j10(e10,3,c10),b10}function ap(a10,b10){a10<0&&cR();var a10=a10+1|0,c10=new Array(a10);c10[0]=0;for(var d10=1;d10>>32-e10,c10)}function g10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&c10|~b10&d10,a10,b10,e10,f10,g11)}function h10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&d10|c10&~d10,a10,b10,e10,f10,g11)}function i10(a10,b10,c10,d10,e10,f10,g11){return l10(b10^c10^d10,a10,b10,e10,f10,g11)}function j10(a10,b10,c10,d10,e10,f10,g11){return l10(c10^(b10|~d10),a10,b10,e10,f10,g11)}return function(a10,b10){var c10=a10[0],d10=a10[1],e10=a10[2],f10=a10[3];c10=g10(c10,d10,e10,f10,b10[0],7,3614090360),f10=g10(f10,c10,d10,e10,b10[1],12,3905402710),e10=g10(e10,f10,c10,d10,b10[2],17,606105819),d10=g10(d10,e10,f10,c10,b10[3],22,3250441966),c10=g10(c10,d10,e10,f10,b10[4],7,4118548399),f10=g10(f10,c10,d10,e10,b10[5],12,1200080426),e10=g10(e10,f10,c10,d10,b10[6],17,2821735955),d10=g10(d10,e10,f10,c10,b10[7],22,4249261313),c10=g10(c10,d10,e10,f10,b10[8],7,1770035416),f10=g10(f10,c10,d10,e10,b10[9],12,2336552879),e10=g10(e10,f10,c10,d10,b10[10],17,4294925233),d10=g10(d10,e10,f10,c10,b10[11],22,2304563134),c10=g10(c10,d10,e10,f10,b10[12],7,1804603682),f10=g10(f10,c10,d10,e10,b10[13],12,4254626195),e10=g10(e10,f10,c10,d10,b10[14],17,2792965006),d10=g10(d10,e10,f10,c10,b10[15],22,1236535329),c10=h10(c10,d10,e10,f10,b10[1],5,4129170786),f10=h10(f10,c10,d10,e10,b10[6],9,3225465664),e10=h10(e10,f10,c10,d10,b10[11],14,643717713),d10=h10(d10,e10,f10,c10,b10[0],20,3921069994),c10=h10(c10,d10,e10,f10,b10[5],5,3593408605),f10=h10(f10,c10,d10,e10,b10[10],9,38016083),e10=h10(e10,f10,c10,d10,b10[15],14,3634488961),d10=h10(d10,e10,f10,c10,b10[4],20,3889429448),c10=h10(c10,d10,e10,f10,b10[9],5,568446438),f10=h10(f10,c10,d10,e10,b10[14],9,3275163606),e10=h10(e10,f10,c10,d10,b10[3],14,4107603335),d10=h10(d10,e10,f10,c10,b10[8],20,1163531501),c10=h10(c10,d10,e10,f10,b10[13],5,2850285829),f10=h10(f10,c10,d10,e10,b10[2],9,4243563512),e10=h10(e10,f10,c10,d10,b10[7],14,1735328473),d10=h10(d10,e10,f10,c10,b10[12],20,2368359562),c10=i10(c10,d10,e10,f10,b10[5],4,4294588738),f10=i10(f10,c10,d10,e10,b10[8],11,2272392833),e10=i10(e10,f10,c10,d10,b10[11],16,1839030562),d10=i10(d10,e10,f10,c10,b10[14],23,4259657740),c10=i10(c10,d10,e10,f10,b10[1],4,2763975236),f10=i10(f10,c10,d10,e10,b10[4],11,1272893353),e10=i10(e10,f10,c10,d10,b10[7],16,4139469664),d10=i10(d10,e10,f10,c10,b10[10],23,3200236656),c10=i10(c10,d10,e10,f10,b10[13],4,681279174),f10=i10(f10,c10,d10,e10,b10[0],11,3936430074),e10=i10(e10,f10,c10,d10,b10[3],16,3572445317),d10=i10(d10,e10,f10,c10,b10[6],23,76029189),c10=i10(c10,d10,e10,f10,b10[9],4,3654602809),f10=i10(f10,c10,d10,e10,b10[12],11,3873151461),e10=i10(e10,f10,c10,d10,b10[15],16,530742520),d10=i10(d10,e10,f10,c10,b10[2],23,3299628645),c10=j10(c10,d10,e10,f10,b10[0],6,4096336452),f10=j10(f10,c10,d10,e10,b10[7],10,1126891415),e10=j10(e10,f10,c10,d10,b10[14],15,2878612391),d10=j10(d10,e10,f10,c10,b10[5],21,4237533241),c10=j10(c10,d10,e10,f10,b10[12],6,1700485571),f10=j10(f10,c10,d10,e10,b10[3],10,2399980690),e10=j10(e10,f10,c10,d10,b10[10],15,4293915773),d10=j10(d10,e10,f10,c10,b10[1],21,2240044497),c10=j10(c10,d10,e10,f10,b10[8],6,1873313359),f10=j10(f10,c10,d10,e10,b10[15],10,4264355552),e10=j10(e10,f10,c10,d10,b10[6],15,2734768916),d10=j10(d10,e10,f10,c10,b10[13],21,1309151649),c10=j10(c10,d10,e10,f10,b10[4],6,4149444226),f10=j10(f10,c10,d10,e10,b10[11],10,3174756917),e10=j10(e10,f10,c10,d10,b10[2],15,718787259),d10=j10(d10,e10,f10,c10,b10[9],21,3951481745),a10[0]=k10(c10,a10[0]),a10[1]=k10(d10,a10[1]),a10[2]=k10(e10,a10[2]),a10[3]=k10(f10,a10[3])}}();function A1(a10,b10,c10){var e10=a10.len&bh,d10=0;if(a10.len+=c10,e10){var f10=64-e10;if(c10=64;)a10.b8.set(b10.subarray(d10,d10+64),0),d7(a10.w,a10.b32),c10-=64,d10+=64;c10&&a10.b8.set(b10.subarray(d10,d10+c10),0)}function AZ(a10){var c10=a10.len&bh;if(a10.b8[c10]=as,c10++,c10>56){for(var b10=c10;b10<64;b10++)a10.b8[b10]=0;d7(a10.w,a10.b32);for(var b10=0;b10<56;b10++)a10.b8[b10]=0}else for(var b10=c10;b10<56;b10++)a10.b8[b10]=0;a10.b32[14]=a10.len<<3,a10.b32[15]=a10.len>>29&536870911,d7(a10.w,a10.b32);for(var e10=new Uint8Array(16),d10=0;d10<4;d10++)for(var b10=0;b10<4;b10++)e10[d10*4+b10]=a10.w[d10]>>8*b10&255;return e10}function B2(a10){return c0(a10,0,a10.length)}function BN(a10,b10,c10){var d10=A0(),e10=g1(a10);return A1(d10,e10.subarray(b10,b10+c10),c10),B2(AZ(d10))}function BO(a10,b10,c10){return BN(bj(a10),b10,c10)}function BQ(){return 0}var bl=new Array;function l9(a10){return bl[a10]}function bK(a10){var b10=l9(a10);return b10.opened||m("Cannot flush a closed channel"),!b10.buffer||b10.buffer_curr==0||(b10.output?b10.output(c0(b10.buffer,0,b10.buffer_curr)):b10.file.write(b10.offset,b10.buffer,0,b10.buffer_curr),b10.offset+=b10.buffer_curr,b10.buffer_curr=0),0}function B4(a10,b10){if(b10.name)try{var d10=__require(gb),c10=d10.openSync(b10.name,"rs");return new aC(c10,b10)}catch{}return new aC(a10,b10)}var ek=new Array(3);function cQ(a10,b10){Z.call(this,C(0)),this.log=function(a11){return 0},a10==1&&typeof console.log=="function"?this.log=console.log:a10==2&&typeof console.error=="function"?this.log=console.error:typeof console.log=="function"&&(this.log=console.log),this.flags=b10}cQ.prototype.length=function(){return 0},cQ.prototype.write=function(a10,b10,c10,d10){if(this.log){d10>0&&c10>=0&&c10+d10<=b10.length&&b10[c10+d10-1]==10&&d10--;var e10=C(d10);return a4(gH(b10),c10,e10,0,d10),this.log(e10.toUtf16()),0}m(this.fd+kZ)},cQ.prototype.read=function(a10,b10,c10,d10){m(this.fd+": file descriptor is write only")},cQ.prototype.close=function(){this.log=void 0};function el(a10,b10){return b10==null&&(b10=ek.length),ek[b10]=a10,b10|0}function Ch(a10,b10,c10){for(var d10={};b10;){switch(b10[1]){case 0:d10.rdonly=1;break;case 1:d10.wronly=1;break;case 2:d10.append=1;break;case 3:d10.create=1;break;case 4:d10.truncate=1;break;case 5:d10.excl=1;break;case 6:d10.binary=1;break;case 7:d10.text=1;break;case 8:d10.nonblock=1;break}b10=b10[2]}d10.rdonly&&d10.wronly&&m(a10+gC),d10.text&&d10.binary&&m(a10+gn);var e10=mn(a10),f10=e10.device.open(e10.rest,d10);return el(f10,void 0)}(function(){function a10(a11,b10){return c1()?B4(a11,b10):new cQ(a11,b10)}el(a10(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:!0}),0),el(a10(1,{buffered:2,wronly:1,isCharacterDevice:!0}),1),el(a10(2,{buffered:2,wronly:1,isCharacterDevice:!0}),2)})();function BR(a10){var b10=ek[a10];b10.flags.wronly&&m(lk+a10+" is writeonly");var d10=null,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!1,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(kr),refill:d10};return bl[c10.fd]=c10,c10.fd}function l_(a10){var b10=ek[a10];b10.flags.rdonly&&m(lk+a10+" is readonly");var d10=b10.flags.buffered!==void 0?b10.flags.buffered:1,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!0,buffer_curr:0,buffer:new Uint8Array(kr),buffered:d10};return bl[c10.fd]=c10,c10.fd}function BS(){for(var b10=0,a10=0;a10e10.buffer.length){var g10=new Uint8Array(e10.buffer_curr+b10.length);g10.set(e10.buffer),e10.buffer=g10}switch(e10.buffered){case 0:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,bK(a10);break;case 1:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bK(a10);break;case 2:var f10=b10.lastIndexOf(10);f10<0?(e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bK(a10)):(e10.buffer.set(b10.subarray(0,f10+1),e10.buffer_curr),e10.buffer_curr+=f10+1,bK(a10),e10.buffer.set(b10.subarray(f10+1),e10.buffer_curr),e10.buffer_curr+=b10.length-f10-1);break}return 0}function BT(a10,b10,c10,d10){var b10=g1(b10);return BU(a10,b10,c10,d10)}function gV(a10,b10,c10,d10){return BT(a10,bj(b10),c10,d10)}function l$(a10,b10){var c10=String.fromCharCode(b10);return gV(a10,c10,0,1),0}function bL(a10,b10){return+(d$(a10,b10,!1)!=0)}function BW(a10,b10){var d10=new Array(b10+1);d10[0]=a10;for(var c10=1;c10<=b10;c10++)d10[c10]=0;return d10}function aN(a10){return a10 instanceof Array&&a10[0]==a10[0]>>>0?a10[0]:ee(a10)||ef(a10)?d3:a10 instanceof Function||typeof a10=="function"?247:a10&&a10.caml_custom?le:cP}function A8(a10){var c10={};if(a10)for(var b10=1;b10=0?a10=e10:S("caml_register_global: cannot locate "+d10)}}V[a10+1]=b10,c10&&(V[c10]=b10)}function g0(a10,b10){return ma[a10]=b10,0}function B1(){G(f_)}function D(a10,b10){return b10>>>0>=n(a10)&&B1(),_(a10,b10)}function ej(a10){return a10.t&6&&cV(a10),a10.c}function B3(){return 2147483647/4|0}function BY(){md(V.Not_found)}function mh(a10){var b10=mm(H(a10));return b10===void 0&&BY(),aw(b10)}function B5(){if(p.crypto){if(p.crypto.getRandomValues){var a10=p.crypto.getRandomValues(new Int32Array(4));return[0,a10[0],a10[1],a10[2],a10[3]]}else if(p.crypto.randomBytes){var a10=new Int32Array(p.crypto.randomBytes(16).buffer);return[0,a10[0],a10[1],a10[2],a10[3]]}}var b10=new Date().getTime(),c10=b10^4294967295*Math.random();return[0,c10]}function bM(a10){for(var b10=1;a10&&a10.joo_tramp;)a10=a10.joo_tramp.apply(null,a10.joo_args),b10++;return a10}function r(a10,b10){return{joo_tramp:a10,joo_args:b10}}function mj(a10,b10){if(b10.fun)return a10.fun=b10.fun,0;if(typeof b10=="function")return a10.fun=b10,0;for(var c10=b10.length;c10--;)a10[c10]=b10[c10];return 0}function M(a10){{if(a10 instanceof Array)return a10;var b10;return p.RangeError&&a10 instanceof p.RangeError&&a10.message&&a10.message.match(/maximum call stack/i)||p.InternalError&&a10 instanceof p.InternalError&&a10.message&&a10.message.match(/too much recursion/i)?b10=V.Stack_overflow:a10 instanceof p.Error&&bm(gf)?b10=[0,bm(gf),a10]:b10=[0,V.Failure,aw(String(a10))],a10 instanceof p.Error&&(b10.js_error=a10),b10}}function B7(){return init_awareness(),__toCommonJS(awareness_exports)}function B8(){return(init_y_indexeddb(),__toCommonJS(y_indexeddb_exports)).IndexeddbPersistence}function B9(){return(init_quill2(),__toCommonJS(quill_exports)).default}function B_(){return require_quill_cursors()}function B$(){return(init_y_webrtc(),__toCommonJS(y_webrtc_exports)).WebrtcProvider}function Ca(){return init_y_quill(),__toCommonJS(y_quill_exports)}function Cb(){return init_yjs(),__toCommonJS(yjs_exports)}function BF(a10){switch(a10[2]){case-8:case-11:case-12:return 1;default:return 0}}function Bi(a10){var b10=e;if(a10[0]==0){if(b10+=a10[1][1],a10.length==3&&a10[2][0]==0&&BF(a10[1]))var f10=a10[2],g10=1;else var g10=2,f10=a10;b10+="(";for(var d10=g10;d10g10&&(b10+=k3);var c10=f10[d10];typeof c10=="number"?b10+=c10.toString():c10 instanceof a3||typeof c10=="string"?b10+=d2+c10.toString()+d2:b10+=lx}b10+=")"}else a10[0]==q&&(b10+=a10[1]);return b10}function lT(a10){if(a10 instanceof Array&&(a10[0]==0||a10[0]==q)){var c10=bm(lz);if(c10)d_(c10,[a10,!1]);else{var d10=Bi(a10),b10=bm(ll);if(b10&&d_(b10,[0]),console.error(gg+d10),a10.js_error)throw a10.js_error}}else throw a10}function B0(){var c10=p.process;c10&&c10.on?c10.on("uncaughtException",function(a10,b10){lT(a10),c10.exit(2)}):p.addEventListener&&p.addEventListener(k1,function(a10){a10.error&&lT(a10.error)})}B0();function h(a10,b10){return(a10.l>=0?a10.l:a10.l=a10.length)==1?a10(b10):bk(a10,[b10])}function i(a10,b10,c10){return(a10.l>=0?a10.l:a10.l=a10.length)==2?a10(b10,c10):bk(a10,[b10,c10])}function y(a10,b10,c10,d10){return(a10.l>=0?a10.l:a10.l=a10.length)==3?a10(b10,c10,d10):bk(a10,[b10,c10,d10])}function f6(a10,b10,c10,d10,e10,f10){return(a10.l>=0?a10.l:a10.l=a10.length)==5?a10(b10,c10,d10,e10,f10):bk(a10,[b10,c10,d10,e10,f10])}function AY(a10,b10,c10,d10,e10,f10,g10,h10){return(a10.l>=0?a10.l:a10.l=a10.length)==7?a10(b10,c10,d10,e10,f10,g10,h10):bk(a10,[b10,c10,d10,e10,f10,g10,h10])}var Cg=void 0;Bj();var em=[q,lD,-1],g6=[q,kn,-2],cc=[q,gD,-3],cb=[q,kd,-4],aD=[q,k7,-7],g4=[q,lB,-8],g5=[q,kB,-9],f=[q,kH,-11],cd=[q,kO,-12],AX=[4,0,0,0,[12,45,[4,0,0,0,0]]],eP=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,lC,[4,0,0,0,[12,45,[4,0,0,0,[11,kS,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],jQ=gB,by="content",jW="columns",jX="rows",f0=ki,f1=gB,jY=bB,jZ="page_content";av(11,cd,kO),av(10,f,kH),av(9,[q,kJ,-10],kJ),av(8,g5,kB),av(7,g4,lB),av(6,aD,k7),av(5,[q,lf,-6],lf),av(4,[q,kt,-5],kt),av(3,cb,kd),av(2,cc,gD),av(1,g6,kn),av(0,em,lD);var my="output_substring",mu=bf,mq="true",mr="false",mD="CamlinternalLazy.Undefined",mJ="option is None",mM="\\\\",mN="\\'",mO="\\b",mP="\\t",mQ="\\n",mR="\\r",m0="List.init",mW="hd",nf="String.blit / Bytes.blit_string",ne="Bytes.blit",nd="String.sub / Bytes.sub",nq="String.contains_from / Bytes.contains_from",nw="Array.blit",nv="Array.sub",nt="Array.init",nD=[0,"set.ml",lj,18],nz=dY,nA=dY,nB=dY,nC=dY,nK="Map.remove_min_elt",nG=d1,nH=d1,nI=d1,nJ=d1,nL="Stdlib.Stack.Empty",nP="Stdlib.Queue.Empty",nY="Buffer.add_substring/add_subbytes",nW="Buffer.add: cannot grow buffer",nU="Buffer.sub",n5="first domain already spawned",n2=[0,"domain.ml",184,13],oe="%c",of="%s",og=k$,oh=ka,oi=lF,oj=k5,ok="%f",ol="%B",om="%{",on="%}",oo="%(",op="%)",oq="%a",or="%t",os="%?",ot="%r",ou="%_r",ov=[0,L,850,23],oG=[0,L,814,21],oy=[0,L,815,21],oH=[0,L,818,21],oz=[0,L,819,21],oI=[0,L,822,19],oA=[0,L,823,19],oJ=[0,L,826,22],oB=[0,L,827,22],oK=[0,L,831,30],oC=[0,L,832,30],oE=[0,L,836,26],ow=[0,L,837,26],oF=[0,L,846,28],ox=[0,L,847,28],oD=[0,L,851,23],pW=[0,L,1558,4],pX="Printf: bad conversion %[",pY=[0,L,1626,39],pZ=[0,L,1649,31],p0=[0,L,1650,31],p1="Printf: bad conversion %_",p2=kl,p3=kI,p4=kl,p5=kI,p9=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],p8=[0,0,4],pR=ga,pP="neg_infinity",pQ=kq,pO=bf,pJ=[0,j5],px="%+nd",py="% nd",pA="%+ni",pB="% ni",pC="%nx",pD="%#nx",pE="%nX",pF="%#nX",pG="%no",pH="%#no",pw="%nd",pz=lF,pI="%nu",pj="%+ld",pk="% ld",pm="%+li",pn="% li",po="%lx",pp="%#lx",pq="%lX",pr="%#lX",ps="%lo",pt="%#lo",pi="%ld",pl=ka,pu="%lu",o7="%+Ld",o8="% Ld",o_="%+Li",o$="% Li",pa="%Lx",pb="%#Lx",pc="%LX",pd="%#LX",pe="%Lo",pf="%#Lo",o6="%Ld",o9=k5,pg="%Lu",oT="%+d",oU="% d",oW="%+i",oX="% i",oY="%x",oZ="%#x",o0="%X",o1="%#X",o2="%o",o3="%#o",oS=f9,oV=k$,o4=kw,n8="@]",n9="@}",n_="@?",n$=`@ -`,oa="@.",ob="@@",oc="@%",od="@",oL="CamlinternalFormat.Type_mismatch",qc=e,qd=[0,[11,k3,[2,0,[2,0,0]]],", %s%s"],qP=[0,[11,gg,[2,0,[12,10,0]]],kA],qQ=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],`Fatal error in uncaught exception handler: exception %s -`],qO="Fatal error: out of memory in uncaught exception handler",qL=[0,[11,gg,[2,0,[12,10,0]]],kA],qF=[0,[2,0,[12,10,0]],`%s -`],qG=[0,[11,kk,0],kk],qu="Raised at",qv="Re-raised at",qw="Raised by primitive operation at",qx="Called from",qy=[0,[12,32,[4,0,0,0,0]]," %d"],qC=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],qz=" (inlined)",qB=e,qA=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,lC,AX]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],qD=[0,[2,0,[11," unknown location",0]],"%s unknown location"],qn="Out of memory",qo="Stack overflow",qp="Pattern matching failed",qq="Assertion failed",qr="Undefined recursive module",qf=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],qg=e,qh=e,qi=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],qb=[0,[4,0,0,0,0],f9],p$=[0,[3,0,0],"%S"],qa=lx,qI=[0,e,`(Cannot print locations: +`;)ins=ins.slice(0,-1);return delta[delta.length-1]={insert:ins},ins.length===0&&delta.pop(),delta}}return delta},updateCursor=(quillCursors,aw,clientId,doc2,type)=>{try{if(aw&&aw.cursor&&clientId!==doc2.clientID){let user=aw.user||{},color=user.color||"#ffa500",name=user.name||`User: ${clientId}`;quillCursors.createCursor(clientId.toString(),name,color);let anchor=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.anchor),doc2),head=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.head),doc2);anchor&&head&&anchor.type===type&&quillCursors.moveCursor(clientId.toString(),{index:anchor.index,length:head.index-anchor.index})}else quillCursors.removeCursor(clientId.toString())}catch(err){console.error(err)}},QuillBinding=class{constructor(type,quill,awareness){let doc2=type.doc;this.type=type,this.doc=doc2,this.quill=quill;let quillCursors=quill.getModule("cursors")||null;this.quillCursors=quillCursors,this._negatedUsedFormats={},this.awareness=awareness,this._awarenessChange=({added,removed,updated})=>{let states=awareness.getStates();added.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),updated.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),removed.forEach(id2=>{quillCursors.removeCursor(id2.toString())})},this._typeObserver=event=>{if(event.transaction.origin!==this){let eventDelta=event.delta,delta=[];for(let i=0;i{if(delta&&delta.ops){let ops=delta.ops;ops.forEach(op=>{if(op.attributes!==void 0)for(let key in op.attributes)this._negatedUsedFormats[key]===void 0&&(this._negatedUsedFormats[key]=!1)}),origin!==this&&doc2.transact(()=>{type.applyDelta(ops)},this)}if(awareness&&quillCursors){let sel=quill.getSelection(),aw=awareness.getLocalState();if(sel===null)awareness.getLocalState()!==null&&awareness.setLocalStateField("cursor",null);else{let anchor=createRelativePositionFromTypeIndex(type,sel.index),head=createRelativePositionFromTypeIndex(type,sel.index+sel.length);(!aw||!aw.cursor||!compareRelativePositions(anchor,aw.cursor.anchor)||!compareRelativePositions(head,aw.cursor.head))&&awareness.setLocalStateField("cursor",{anchor,head})}awareness.getStates().forEach((aw2,clientId)=>{updateCursor(quillCursors,aw2,clientId,doc2,type)})}},quill.on("editor-change",this._quillObserver),quill.setContents(type.toDelta(),this),quillCursors!==null&&awareness&&(awareness.getStates().forEach((aw,clientId)=>{updateCursor(quillCursors,aw,clientId,doc2,type)}),awareness.on("change",this._awarenessChange))}destroy(){this.type.unobserve(this._typeObserver),this.quill.off("editor-change",this._quillObserver),this.awareness&&this.awareness.off("change",this._awarenessChange)}}}});(function(a){typeof globalThis!="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:!0,get:b}),_T_));function b(){var b2=this||self;b2.globalThis=b2,delete a.prototype._T_}})(Object);(function(a){require_quill_core(),require_quill_bubble(),require_quill_snow()})(globalThis);(function(c){"use strict";var v=3850876,af="0",aH=" ",gy="compare: functional value",gf="mkdir",lh="synced",cM=1e3,k5="delete",Y="vendor/lwd/lib/lwd/lwd_seq.pp.ml",kB="@[",kO="console",lp="window",aZ="int_of_string",kq="%u",lo="/static/",gi="node:fs",k4="%i",ly="%ni",aK=255,ge=749039939,kA="Assert_failure",kp="camlinternalMod.ml",aI=737455525,k3="0x",ko=32752,lx=218,k2=57343,kn="End_of_file",ln="OCAMLRUNPARAM",k1=": closedir failed",lw="Out_of_memory",kz=553,k0="Not_found",gB="Failure",d5="Unix.Unix_error",kZ="style",d4=244,lg="^",b4="text",kN="length",lf="green",gu="ENOTDIR",ky="Lwd_seq.rank: node is marked",bz=936573133,kY="%Li",j9="Invalid_argument",kX="flex",d3=254,b5="+",dX="Set.bal",lv=", characters ",aG=16777215,km=858694086,kx=120,kw=1027,cI=1024,d0="Map.bal",dW=246,le="Pervasives.do_at_exit",lm=389604418,kl=65536,j8="submit",B="vendor/brr_lwd_ui/examples/yjs/main.ml",U=16620,gt=15,dU=512,gb=-588596599,kW=", ",kM="closedir",lu="Match_failure",j6="%li",j7=1026,j5=157,j4="b",f_="nan",e="",f9="rmdir",gd="Fatal error: exception ",kk="infinity",L="camlinternalFormat.ml",lc=571,ld="fd ",kK="append",kL=": ",j3=174,r=248,kj="em",ki="data",kJ=224,aJ=24029,lb=240,kh="Sys_error",at=128,gs="vendor/brr_lwd_ui/bindings/yjs/doc.ml",ll="ENOTEMPTY",lt="EEXIST",gx=1255,kV="checkbox",dT="value",kI="px",gl=" : flags Open_text and Open_binary are not compatible",gr="e",kv="Stack_overflow",gk=": Not a directory",gq="ENOENT",ga=-605101559,T=15681,kH="Undefined_recursive_module",la="Array",kG=2147483647,k$=544,aA=32768,dV="table",cL="string",kg=2048,lk=-48,j2=" : is a directory",kf="@{",kU="error",k_="Division_by_zero",j1="classList",bd=".",ke=`(Program not linked with -g, cannot print stack backtrace) +`,be=63,bx="name",lj="red",bc=737456202,f$=" : file already exists",bv=128,cN=": No such file or directory",kd="vendor/lwd/lib/brr-lwd/elwd.ml",k9=255,dS="lwd-to-remove",cJ=256,dR="checked",kc="id",cK=-976970511,gp=100,f8="index out of bounds",li=-937474657,aY="/",kF="height: ",gj=504440814,d2=252,f7="%d",kT="lwdui-virtual-table-row",kR="bold",kS=": file descriptor already closed",bw="-",f6="EBADF",kb="changes",aX=951901561,ka=102,go=-97,ls="Printexc.handle_uncaught_exception",kQ=12520,gA=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",kE=499,gw=756711075,ku=`Fatal error: exception %s +`,gn=4100401,lr="class",j0="\xE2\x9D\x8C",cH=250,j$=199,dZ="bool",gh=82908052,gz="kind",by=611392745,gm="cell",kD=">",k8="([^/]+)",kt="input",gc="jsError",jZ=103,gg=127,d1='"',aB=65535,gv=737308346,j_="documentElement",kC="Sys_blocked_io",kP=56320,b="vendor/lwd/lib/lwd/lwd.ml",ks="not implemented",k7="Form submitted:",lq="_",f5="target",kr="rem",dY="_bigarr02",k6=-101336657;function AO(a10,b10,c10,d10,e10){if(d10<=b10)for(var f10=1;f10<=e10;f10++)c10[d10+f10]=a10[b10+f10];else for(var f10=e10;f10>=1;f10--)c10[d10+f10]=a10[b10+f10];return 0}function AQ(a10,b10,c10){var d10=new Array(c10+1);d10[0]=0;for(var e10=1,f10=b10+1;e10<=c10;e10++,f10++)d10[e10]=a10[f10];return d10}function gC(a10,b10,c10){return a10[1]===b10?(a10[1]=c10,1):0}function AR(a10,b10){var c10=a10[1];return a10[1]+=b10,c10}function gD(a10){return a10[1]}var me={};function mf(a10){if(me[a10])return me[a10];var b10=c.process;if(b10&&b10.env&&b10.env[a10]!==void 0)return b10.env[a10];if(c.jsoo_env&&typeof c.jsoo_env[a10]=="string")return c.jsoo_env[a10]}var eh=0;(function(){var c10=mf(ln);if(c10!==void 0)for(var b10=c10.split(","),a10=0;a10a10.hi?1:this.hia10.mi?1:this.mia10.lo?1:this.loc10?1:b10a10.mi?1:this.mia10.lo?1:this.lo>24),c10=-this.hi+(b10>>24);return new d(a10,b10,c10)},d.prototype.add=function(a10){var b10=this.lo+a10.lo,c10=this.mi+a10.mi+(b10>>24),e10=this.hi+a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.sub=function(a10){var b10=this.lo-a10.lo,c10=this.mi-a10.mi+(b10>>24),e10=this.hi-a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.mul=function(a10){var b10=this.lo*a10.lo,c10=(b10*lT|0)+this.mi*a10.lo+this.lo*a10.mi,e10=(c10*lT|0)+this.hi*a10.lo+this.mi*a10.mi+this.lo*a10.hi;return new d(b10,c10,e10)},d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)===0},d.prototype.isNeg=function(){return this.hi<<16<0},d.prototype.and=function(a10){return new d(this.lo&a10.lo,this.mi&a10.mi,this.hi&a10.hi)},d.prototype.or=function(a10){return new d(this.lo|a10.lo,this.mi|a10.mi,this.hi|a10.hi)},d.prototype.xor=function(a10){return new d(this.lo^a10.lo,this.mi^a10.mi,this.hi^a10.hi)},d.prototype.shift_left=function(a10){return a10=a10&63,a10===0?this:a10<24?new d(this.lo<>24-a10,this.hi<>24-a10):a10<48?new d(0,this.lo<>48-a10):new d(0,0,this.lo<>a10|this.mi<<24-a10,this.mi>>a10|this.hi<<24-a10,this.hi>>a10):a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi>>a10-24,0):new d(this.hi>>a10-48,0,0)},d.prototype.shift_right=function(a10){if(a10=a10&63,a10===0)return this;var c10=this.hi<<16>>16;if(a10<24)return new d(this.lo>>a10|this.mi<<24-a10,this.mi>>a10|c10<<24-a10,this.hi<<16>>a10>>>16);var b10=this.hi<<16>>31;return a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi<<16>>a10-24>>16,b10&aB):new d(this.hi<<16>>a10-32,b10,b10)},d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&aG,this.lo=this.lo<<1&aG},d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aG,this.mi=(this.mi>>>1|this.hi<<23)&aG,this.hi=this.hi>>>1},d.prototype.udivmod=function(a10){for(var e10=0,c10=this.copy(),b10=a10.copy(),f10=new d(0,0,0);c10.ucompare(b10)>0;)e10++,b10.lsl1();for(;e10>=0;)e10--,f10.lsl1(),c10.ucompare(b10)>=0&&(f10.lo++,c10=c10.sub(b10)),b10.lsr1();return{quotient:f10,modulus:c10}},d.prototype.div=function(a10){var b10=this;a10.isZero()&&l9();var d10=b10.hi^a10.hi;b10.hi&aA&&(b10=b10.neg()),a10.hi&aA&&(a10=a10.neg());var c10=b10.udivmod(a10).quotient;return d10&aA&&(c10=c10.neg()),c10},d.prototype.mod=function(a10){var b10=this;a10.isZero()&&l9();var d10=b10.hi;b10.hi&aA&&(b10=b10.neg()),a10.hi&aA&&(a10=a10.neg());var c10=b10.udivmod(a10).modulus;return d10&aA&&(c10=c10.neg()),c10},d.prototype.toInt=function(){return this.lo|this.mi<<24},d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},d.prototype.toArray=function(){return[this.hi>>8,this.hi&aK,this.mi>>16,this.mi>>8&aK,this.mi&aK,this.lo>>16,this.lo>>8&aK,this.lo&aK]},d.prototype.lo32=function(){return this.lo|(this.mi&aK)<<24},d.prototype.hi32=function(){return this.mi>>>8&aB|this.hi<<16};function Bi(a10,b10){return new d(a10&aG,a10>>>24&aK|(b10&aB)<<8,b10>>>16&aB)}function gO(a10){return a10.hi32()}function gP(a10){return a10.lo32()}function cP(){G(f8)}var AT=dY;function bf(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}bf.prototype.caml_custom=AT,bf.prototype.offset=function(a10){var c10=0;if(typeof a10=="number"&&(a10=[a10]),Array.isArray(a10)||G("bigarray.js: invalid offset"),this.dims.length!==a10.length&&G("Bigarray.get/set: bad number of dimensions"),this.layout===0)for(var b10=0;b10=this.dims[b10])&&cP(),c10=c10*this.dims[b10]+a10[b10];else for(var b10=this.dims.length-1;b10>=0;b10--)(a10[b10]<1||a10[b10]>this.dims[b10])&&cP(),c10=c10*this.dims[b10]+(a10[b10]-1);return c10},bf.prototype.get=function(a10){switch(this.kind){case 7:var d10=this.data[a10*2+0],b10=this.data[a10*2+1];return Bi(d10,b10);case 10:case 11:var e10=this.data[a10*2+0],c10=this.data[a10*2+1];return[d3,e10,c10];default:return this.data[a10]}},bf.prototype.set=function(a10,b10){switch(this.kind){case 7:this.data[a10*2+0]=gP(b10),this.data[a10*2+1]=gO(b10);break;case 10:case 11:this.data[a10*2+0]=b10[1],this.data[a10*2+1]=b10[2];break;default:this.data[a10]=b10;break}return 0},bf.prototype.fill=function(a10){switch(this.kind){case 7:var c10=gP(a10),e10=gO(a10);if(c10===e10)this.data.fill(c10);else for(var b10=0;b10e10)return 1;if(d10!==e10){if(!b10)return Number.NaN;if(!Number.isNaN(d10))return 1;if(!Number.isNaN(e10))return-1}}break;case 7:for(var c10=0;c10a10.data[c10+1])return 1;if(this.data[c10]>>>0>>0)return-1;if(this.data[c10]>>>0>a10.data[c10]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var c10=0;c10a10.data[c10])return 1}break}return 0};function b6(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}b6.prototype=new bf,b6.prototype.offset=function(a10){return typeof a10!="number"&&(Array.isArray(a10)&&a10.length===1?a10=a10[0]:G("Ml_Bigarray_c_1_1.offset")),(a10<0||a10>=this.dims[0])&&cP(),a10},b6.prototype.get=function(a10){return this.data[a10]},b6.prototype.set=function(a10,b10){return this.data[a10]=b10,0},b6.prototype.fill=function(a10){return this.data.fill(a10),0};function gE(a10,b10,c10,d10){var e10=lD(a10);return d7(c10)*e10!==d10.length&&G("length doesn't match dims"),b10===0&&c10.length===1&&e10===1?new b6(a10,b10,c10,d10):new bf(a10,b10,c10,d10)}function gR(a10){return a10.slice(1)}function AS(a10,b10,c10){var d10=gR(c10),e10=lB(a10,d7(d10));return gE(a10,b10,d10,e10)}function cQ(a10,b10,c10){return a10.set(a10.offset(b10),c10),0}function cY(a10,b10,c10){var d10=String.fromCharCode;if(b10===0&&c10<=4096&&c10===a10.length)return d10.apply(null,a10);for(var f10=e;0=c10.l||c10.t===2&&e10>=c10.c.length))c10.c=a10.t===4?cY(a10.c,b10,e10):b10===0&&a10.c.length===e10?a10.c:a10.c.slice(b10,b10+e10),c10.t=c10.c.length===c10.l?0:2;else if(c10.t===2&&d10===c10.c.length)c10.c+=a10.t===4?cY(a10.c,b10,e10):b10===0&&a10.c.length===e10?a10.c:a10.c.slice(b10,b10+e10),c10.t=c10.c.length===c10.l?0:2;else{c10.t!==4&&d$(c10);var g10=a10.c,h10=c10.c;if(a10.t===4)if(d10<=b10)for(var f10=0;f10=0;f10--)h10[d10+f10]=g10[b10+f10];else{for(var i10=Math.min(e10,g10.length-b10),f10=0;f10>=1,a10===0)return d10;b10+=b10,c10++,c10===9&&b10.slice(0,1)}}function cT(a10){a10.t===2?a10.c+=b7(a10.l-a10.c.length,"\0"):a10.c=cY(a10.c,0,a10.c.length),a10.t=0}function gZ(a10){if(a10.length<24){for(var b10=0;b10gg)return!1;return!0}else return!/[^\x00-\x7f]/.test(a10)}function mc(a10){for(var k10=e,d10=e,h10,g10,i10,b10,c10=0,j10=a10.length;c10dU?(d10.slice(0,1),k10+=d10,d10=e,k10+=a10.slice(c10,f10)):d10+=a10.slice(c10,f10),f10===j10)break;c10=f10}b10=1,++c10=55295&&b10<57344)&&(b10=2)):(b10=3,++c101114111)&&(b10=3)))))),b10<4?(c10-=b10,d10+="\uFFFD"):b10>aB?d10+=String.fromCharCode(55232+(b10>>10),kP+(b10&1023)):d10+=String.fromCharCode(b10),d10.length>cI&&(d10.slice(0,1),k10+=d10,d10=e)}return k10+d10}function a0(a10,b10,c10){this.t=a10,this.c=b10,this.l=c10}a0.prototype.toString=function(){switch(this.t){case 9:case 8:return this.c;case 4:case 2:cT(this);case 0:return gZ(this.c)?this.t=9:this.t=8,this.c}},a0.prototype.toUtf16=function(){var a10=this.toString();return this.t===9?a10:mc(a10)},a0.prototype.slice=function(){var a10=this.t===4?this.c.slice():this.c;return new a0(this.t,a10,this.l)};function lG(a10){return new a0(0,a10,a10.length)}function aL(a10){return a10}function bg(a10){return lG(a10)}function cR(a10,b10,c10,d10,e10){return a1(bg(a10),b10,c10,d10,e10),0}function d8(){G(f8)}function bB(a10,b10){switch(a10.t&6){case 0:return a10.c.charCodeAt(b10);case 2:return b10>=a10.c.length?0:a10.c.charCodeAt(b10);case 4:return a10.c[b10]}}function AX(a10,b10){return b10>>>0>=a10.l&&d8(),bB(a10,b10)}function bC(a10){return new d(a10[7]<<0|a10[6]<<8|a10[5]<<16,a10[4]<<0|a10[3]<<8|a10[2]<<16,a10[1]<<0|a10[0]<<8)}function AY(a10,b10){b10>>>0>=a10.l-7&&d8();for(var d10=new Array(8),c10=0;c10<8;c10++)d10[7-c10]=bB(a10,b10+c10);return bC(d10)}function A(a10,b10,c10){if(c10&=aK,a10.t!==4){if(b10===a10.c.length)return a10.c+=String.fromCharCode(c10),b10+1===a10.l&&(a10.t=0),0;d$(a10)}return a10.c[b10]=c10,0}function au(a10,b10,c10){return b10>>>0>=a10.l&&d8(),A(a10,b10,c10)}function bD(a10){return a10.toArray()}function lH(a10,b10,c10){b10>>>0>=a10.l-7&&d8();for(var e10=bD(c10),d10=0;d10<8;d10++)A(a10,b10+7-d10,e10[d10]);return 0}function bh(d10,c10){var f10=d10.l>=0?d10.l:d10.l=d10.length,e10=c10.length,b10=f10-e10;if(b10===0)return d10.apply(null,c10);if(b10<0){var a10=d10.apply(null,c10.slice(0,f10));return typeof a10!="function"?a10:bh(a10,c10.slice(f10))}else{switch(b10){case 1:{var a10=function(a11){for(var f11=new Array(e10+1),b11=0;b11>>0>=a10.length-1&&cP(),a10}function AZ(a10){return Number.isFinite(a10)?Math.abs(a10)>=22250738585072014e-324?0:a10!==0?1:2:Number.isNaN(a10)?4:3}function lY(a10){return a10===245?1:0}var B4=Math.log2&&Math.log2(11235582092889474e291)===1020;function B3(a10){if(B4)return Math.floor(Math.log2(a10));var b10=0;if(a10===0)return Number.NEGATIVE_INFINITY;if(a10>=1)for(;a10>=2;)a10/=2,b10++;else for(;a10<1;)a10*=2,b10--;return b10}function gL(a10){var b10=new Float32Array(1);b10[0]=a10;var c10=new Int32Array(b10.buffer);return c10[0]|0}function ao(a10,b10,c10){return new d(a10,b10,c10)}function ec(a10){if(!Number.isFinite(a10))return Number.isNaN(a10)?ao(1,0,ko):a10>0?ao(0,0,ko):ao(0,0,65520);var f10=a10===0&&1/a10===Number.NEGATIVE_INFINITY?aA:a10>=0?0:aA;f10&&(a10=-a10);var b10=B3(a10)+1023;b10<=0?(b10=0,a10/=Math.pow(2,-j7)):(a10/=Math.pow(2,b10-kw),a10<16&&(a10*=2,b10-=1),b10===0&&(a10/=2));var d10=Math.pow(2,24),c10=a10|0;a10=(a10-c10)*d10;var e10=a10|0;a10=(a10-e10)*d10;var g10=a10|0;return c10=c10>|f10|b10<<4,ao(g10,e10,c10)}function lF(a10,b10,c10){if(a10.write(32,b10.dims.length),a10.write(32,b10.kind|b10.layout<<8),b10.caml_custom===dY)for(var d10=0;d10>4;if(d10===2047)return f10|g10|c10>?Number.NaN:c10&aA?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var e10=Math.pow(2,-24),b10=(f10*e10+g10)*e10+(c10>);return d10>0?(b10+=16,b10*=Math.pow(2,d10-kw)):b10*=Math.pow(2,-j7),c10&aA&&(b10=-b10),b10}function V(a10){O.Failure||(O.Failure=[r,gB,-3]),gW(O.Failure,a10)}function lC(a10,b10,c10){var k10=a10.read32s();(k10<0||k10>16)&&V("input_value: wrong number of bigarray dimensions");var r10=a10.read32s(),l10=r10&aK,q10=r10>>8&1,j10=[];if(c10===dY)for(var d10=0;d10>>17,b10=cX(b10,461845907),a10^=b10,a10=a10<<13|a10>>>19,(a10+(a10<<2)|0)+-430675100|0}function Bc(a10,b10){return a10=W(a10,gP(b10)),a10=W(a10,gO(b10)),a10}function gJ(a10,b10){return Bc(a10,ec(b10))}function lE(a10){var c10=d7(a10.dims),d10=0;switch(a10.kind){case 2:case 3:case 12:c10>cJ&&(c10=cJ);var e10=0,b10=0;for(b10=0;b10+4<=a10.data.length;b10+=4)e10=a10.data[b10+0]|a10.data[b10+1]<<8|a10.data[b10+2]<<16|a10.data[b10+3]<<24,d10=W(d10,e10);switch(e10=0,c10&3){case 3:e10=a10.data[b10+2]<<16;case 2:e10|=a10.data[b10+1]<<8;case 1:e10|=a10.data[b10+0],d10=W(d10,e10)}break;case 4:case 5:c10>bv&&(c10=bv);var e10=0,b10=0;for(b10=0;b10+2<=a10.data.length;b10+=2)e10=a10.data[b10+0]|a10.data[b10+1]<<16,d10=W(d10,e10);c10&1&&(d10=W(d10,a10.data[b10]));break;case 6:c10>64&&(c10=64);for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32),c10*=2;for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32);for(var b10=0;b100?f10(b10,a10,d10):f10(a10,b10,d10);if(d10&&Number.isNaN(e10))return c10;if(Number.isNaN(+e10))return+e10;if(e10|0)return e10|0}return c10}function ee(a10){return typeof a10=="string"&&!/[^\x00-\xff]/.test(a10)}function ed(a10){return a10 instanceof a0}function lJ(a10){if(typeof a10=="number")return cM;if(ed(a10))return d2;if(ee(a10))return 1252;if(Array.isArray(a10)&&a10[0]===a10[0]>>>0&&a10[0]<=k9){var b10=a10[0]|0;return b10===d3?0:b10}else{if(a10 instanceof String)return kQ;if(typeof a10=="string")return kQ;if(a10 instanceof Number)return cM;if(a10&&a10.caml_custom)return gx;if(a10&&a10.compare)return 1256;if(typeof a10=="function")return 1247;if(typeof a10=="symbol")return 1251}return 1001}function lW(a10,b10){return a10b10?1:0}function AW(a10,b10){return a10.t&6&&cT(a10),b10.t&6&&cT(b10),a10.cb10.c?1:0}function d_(a10,b10,c10){for(var f10=[];;){if(!(c10&&a10===b10)){var e10=lJ(a10);if(e10===cH){a10=a10[1];continue}var g10=lJ(b10);if(g10===cH){b10=b10[1];continue}if(e10!==g10)return e10===cM?g10===gx?lI(a10,b10,-1,c10):-1:g10===cM?e10===gx?lI(b10,a10,1,c10):1:e10b10)return 1;if(a10!==b10){if(!c10)return Number.NaN;if(!Number.isNaN(a10))return 1;if(!Number.isNaN(b10))return-1}break;case 1001:if(a10b10)return 1;if(a10!==b10)return c10?1:Number.NaN;break;case 1251:if(a10!==b10)return c10?1:Number.NaN;break;case 1252:var a10=a10,b10=b10;if(a10!==b10){if(a10b10)return 1}break;case 12520:var a10=a10.toString(),b10=b10.toString();if(a10!==b10){if(a10b10)return 1}break;default:if(lY(e10)){G("compare: continuation value");break}if(a10.length!==b10.length)return a10.length1&&f10.push(a10,b10,1);break}}if(f10.length===0)return 0;var h10=f10.pop();b10=f10.pop(),a10=f10.pop(),h10+10)if(b10===0&&(c10>=a10.l||a10.t===2&&c10>=a10.c.length))d10===0?(a10.c=e,a10.t=2):(a10.c=b7(c10,String.fromCharCode(d10)),a10.t=c10===a10.l?0:2);else for(a10.t!==4&&d$(a10),c10+=b10;b1031&&G("format_int: format too long");for(var b10={justify:b5,signstyle:bw,filler:aH,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},d10=0;d10=0&&c10<=9;)b10.width=b10.width*10+c10,d10++;d10--;break;case".":for(b10.prec=0,d10++;c10=a10.charCodeAt(d10)-48,c10>=0&&c10<=9;)b10.prec=b10.prec*10+c10,d10++;d10--;break;case"d":case"i":b10.signedconv=!0,b10.base=10;break;case"u":b10.base=10;break;case"x":b10.base=16;break;case"X":b10.base=16,b10.uppercase=!0;break;case"o":b10.base=8;break;case"e":case"f":case"g":b10.signedconv=!0,b10.conv=c10;break;case"E":case"F":case"G":b10.signedconv=!0,b10.uppercase=!0,b10.conv=c10.toLowerCase();break}}return b10}function gH(a10,b10){a10.uppercase&&(b10=b10.toUpperCase());var f10=b10.length;a10.signedconv&&(a10.sign<0||a10.signstyle!==bw)&&f10++,a10.alternate&&(a10.base===8&&(f10+=1),a10.base===16&&(f10+=2));var c10=e;if(a10.justify===b5&&a10.filler===aH)for(var d10=f10;d1020?(c11-=20,a11/=Math.pow(10,c11),a11+=new Array(c11+1).join(af),b11>0&&(a11=a11+bd+new Array(b11+1).join(af)),a11):a11.toFixed(b11)}var c10,f10=gV(a10),e10=f10.prec<0?6:f10.prec;if((b10<0||b10===0&&1/b10===Number.NEGATIVE_INFINITY)&&(f10.sign=-1,b10=-b10),Number.isNaN(b10))c10=f_,f10.filler=aH;else if(!Number.isFinite(b10))c10="inf",f10.filler=aH;else switch(f10.conv){case"e":var c10=b10.toExponential(e10),d10=c10.length;c10.charAt(d10-3)===gr&&(c10=c10.slice(0,d10-1)+af+c10.slice(d10-1));break;case"f":c10=j10(b10,e10);break;case"g":e10=e10||1,c10=b10.toExponential(e10-1);var i10=c10.indexOf(gr),h10=+c10.slice(i10+1);if(h10<-4||b10>=1e21||b10.toFixed(0).length>e10){for(var d10=i10-1;c10.charAt(d10)===af;)d10--;c10.charAt(d10)===bd&&d10--,c10=c10.slice(0,d10+1)+c10.slice(i10),d10=c10.length,c10.charAt(d10-3)===gr&&(c10=c10.slice(0,d10-1)+af+c10.slice(d10-1));break}else{var g10=e10;if(h10<0)g10-=h10+1,c10=b10.toFixed(g10);else for(;c10=b10.toFixed(g10),c10.length>e10+1;)g10--;if(g10){for(var d10=c10.length-1;c10.charAt(d10)===af;)d10--;c10.charAt(d10)===bd&&d10--,c10=c10.slice(0,d10+1)}}break}return gH(f10,c10)}function eb(a10,b10){if(a10===f7)return e+b10;var c10=gV(a10);b10<0&&(c10.signedconv?(c10.sign=-1,b10=-b10):b10>>>=0);var d10=b10.toString(c10.base);if(c10.prec>=0){c10.filler=aH;var f10=c10.prec-d10.length;f10>0&&(d10=b7(f10,af)+d10)}return gH(c10,d10)}var BL=0;function an(){return BL++}function H(a10){return gZ(a10)?a10:mc(a10)}function cZ(){return typeof c.process<"u"&&typeof c.process.versions<"u"&&typeof c.process.versions.node<"u"}function B5(){function a10(a11){if(a11.charAt(0)===aY)return[e,a11.slice(1)]}function b10(a11){var h10=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b11=h10.exec(a11),c10=b11[1]||e,f10=c10.length>0&&c10.charAt(1)!==":";if(b11[2]||f10){var d10=b11[1]||e,g10=b11[2]||e;return[d10,a11.slice(d10.length+g10.length)]}}return cZ()&&c.process&&c.process.platform&&c.process.platform==="win32"?b10:a10}var g0=B5();function ma(a10){return a10.slice(-1)!==aY?a10+aY:a10}if(cZ()&&c.process&&c.process.cwd)var cU=c.process.cwd().replace(/\\/g,aY);else var cU="/static";cU=ma(cU);function BA(a10){a10=H(a10),g0(a10)||(a10=cU+a10);for(var e10=g0(a10),d10=e10[1].split(/[/\\]/),b10=[],c10=0;c101&&b10.pop();break;case".":break;case"":break;default:b10.push(d10[c10]);break}return b10.unshift(e10[0]),b10.orig=a10,b10}function BV(a10){for(var g10=e,c10=g10,b10,i10,d10=0,h10=a10.length;d10dU?(c10.slice(0,1),g10+=c10,c10=e,g10+=a10.slice(d10,f10)):c10+=a10.slice(d10,f10),f10===h10)break;d10=f10}b10>6),c10+=String.fromCharCode(at|b10&be)):b10<55296||b10>=k2?c10+=String.fromCharCode(kJ|b10>>12,at|b10>>6&be,at|b10&be):b10>=56319||d10+1===h10||(i10=a10.charCodeAt(d10+1))k2?c10+="\xEF\xBF\xBD":(d10++,b10=(b10<<10)+i10-56613888,c10+=String.fromCharCode(lb|b10>>18,at|b10>>12&be,at|b10>>6&be,at|b10&be)),c10.length>cI&&(c10.slice(0,1),g10+=c10,c10=e)}return g10+c10}function ag(a10){return gZ(a10)?a10:BV(a10)}var B6=["E2BIG","EACCES","EAGAIN",f6,"EBUSY","ECHILD","EDEADLK","EDOM",lt,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",gq,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",gu,ll,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function a3(a10,b10,c10,d10){var f10=B6.indexOf(a10);f10<0&&(d10==null&&(d10=-9999),f10=[0,d10]);var g10=[f10,ag(b10||e),ag(c10||e)];return g10}var l5={};function bj(a10){return l5[a10]}function a2(a10,b10){throw g([0,a10].concat(b10))}function gF(a10){return a10 instanceof Uint8Array||(a10=new Uint8Array(a10)),new a0(4,a10,a10.length)}function l(a10){gW(O.Sys_error,a10)}function l8(a10){l(a10+cN)}function gY(a10){return a10.t!==4&&d$(a10),a10.c}function av(a10){return a10.l}function lz(){}function Z(a10){this.data=a10}Z.prototype=new lz,Z.prototype.constructor=Z,Z.prototype.truncate=function(a10){var b10=this.data;this.data=C(a10|0),a1(b10,0,this.data,0,a10)},Z.prototype.length=function(){return av(this.data)},Z.prototype.write=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10){var f10=C(a10+d10),g10=this.data;this.data=f10,a1(g10,0,this.data,0,e10)}return a1(gF(b10),c10,this.data,a10,d10),0},Z.prototype.read=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10&&(d10=e10-a10),d10){var f10=C(d10|0);a1(this.data,a10,f10,0,d10),b10.set(gY(f10),c10)}return d10};function bA(a10,b10,c10){this.file=b10,this.name=a10,this.flags=c10}bA.prototype.err_closed=function(){l(this.name+kS)},bA.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()},bA.prototype.write=function(a10,b10,c10,d10){if(this.file)return this.file.write(a10,b10,c10,d10);this.err_closed()},bA.prototype.read=function(a10,b10,c10,d10){if(this.file)return this.file.read(a10,b10,c10,d10);this.err_closed()},bA.prototype.close=function(){this.file=void 0};function N(a10,b10){this.content={},this.root=a10,this.lookupFun=b10}N.prototype.nm=function(a10){return this.root+a10},N.prototype.create_dir_if_needed=function(a10){for(var d10=a10.split(aY),c10=e,b10=0;b10>>16,a10=cX(a10,-2048144789),a10^=a10>>>13,a10=cX(a10,-1028477387),a10^=a10>>>16,a10}function A_(a10,b10,c10,d10){var j10,k10,l10,h10,g10,f10,e10,i10,m10;for(h10=b10,(h10<0||h10>cJ)&&(h10=cJ),g10=a10,f10=c10,j10=[d10],k10=0,l10=1;k100;)if(e10=j10[k10++],e10&&e10.caml_custom){if(cV[e10.caml_custom]&&cV[e10.caml_custom].hash){var n10=cV[e10.caml_custom].hash(e10);f10=W(f10,n10),g10--}}else if(Array.isArray(e10)&&e10[0]===(e10[0]|0))switch(e10[0]){case 248:f10=W(f10,e10[2]),g10--;break;case 250:j10[--k10]=e10[1];break;default:if(lY(e10[0]))break;var o10=e10.length-1<<10|e10[0];for(f10=W(f10,o10),i10=1,m10=e10.length;i10=h10);i10++)j10[l10++]=e10[i10];break}else ed(e10)?(f10=A$(f10,e10),g10--):ee(e10)?(f10=Bd(f10,e10),g10--):typeof e10=="string"?(f10=gK(f10,e10),g10--):e10===(e10|0)?(f10=W(f10,e10+e10+1),g10--):typeof e10=="number"&&(f10=gJ(f10,e10),g10--);return f10=Bb(f10),f10&1073741823}function Be(a10,b10,c10){if(!Number.isFinite(a10))return Number.isNaN(a10)?ag(f_):ag(a10>0?kk:"-infinity");var k10=a10===0&&1/a10===Number.NEGATIVE_INFINITY?1:a10>=0?0:1;k10&&(a10=-a10);var f10=0;if(a10!==0)if(a10<1)for(;a10<1&&f10>-1022;)a10*=2,f10--;else for(;a10>=2;)a10/=2,f10++;var l10=f10<0?e:b5,g10=e;if(k10)g10=bw;else switch(c10){case 43:g10=b5;break;case 32:g10=aH;break;default:break}if(b10>=0&&b10<13){var i10=Math.pow(2,b10*4);a10=Math.round(a10*i10)/i10}var d10=a10.toString(16);if(b10>=0){var j10=d10.indexOf(bd);if(j10<0)d10+=bd+b7(b10,af);else{var h10=j10+1+b10;d10.length>24&aG,a10>>31&aB)}function lV(a10){return a10.toInt()}function Bl(a10){return+a10.isNeg()}function lR(a10){return a10.neg()}function Bj(a10,b10){var c10=gV(a10);c10.signedconv&&Bl(b10)&&(c10.sign=-1,b10=lR(b10));var d10=e,i10=cW(c10.base),h10="0123456789abcdef";do{var g10=b10.udivmod(i10);b10=g10.quotient,d10=h10.charAt(lV(g10.modulus))+d10}while(!Bm(b10));if(c10.prec>=0){c10.filler=aH;var f10=c10.prec-d10.length;f10>0&&(d10=b7(f10,af)+d10)}return gH(c10,d10)}function lU(a10,b10){return a10.or(b10)}function l6(a10){var b10=0,f10=n(a10),d10=10,e10=1,c10=1;if(f10>0)switch(_(a10,b10)){case 45:b10++,e10=-1;break;case 43:b10++,e10=1;break}if(b10+1=48&&a10<=57?a10-48:a10>=65&&a10<=90?a10-55:a10>=97&&a10<=122?a10-87:-1}function lX(a10){var f10=l6(a10),d10=f10[0],i10=f10[1],g10=f10[2],j10=f10[3],h10=n(a10),k10=-1>>>0,e10=d10=g10)&&V(aZ);var b10=c10;for(d10++;d10=g10)break;b10=g10*b10+c10,b10>k10&&V(aZ)}return d10!==h10&&V(aZ),b10=i10*b10,j10&&(b10|0)!==b10&&V(aZ),b10|0}function ef(a10,b10,c10){return a10[H(b10)].apply(a10,gR(c10))}function lZ(a10,b10){switch(b10.length){case 1:return new a10;case 2:return new a10(b10[1]);case 3:return new a10(b10[1],b10[2]);case 4:return new a10(b10[1],b10[2],b10[3]);case 5:return new a10(b10[1],b10[2],b10[3],b10[4]);case 6:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5]);case 7:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6]);case 8:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6],b10[7])}function c10(){return a10.apply(this,gR(b10))}return c10.prototype=a10.prototype,new c10}function gS(a10){for(var c10={},b10=1;b10>>0&&gU(a10,dW,d4)?0:1}function l0(a10){return gU(a10,d4,cH),0}function Bw(a10,b10){return+(d_(a10,b10,!1)<0)}function Bx(a10){for(var b10=[];a10!==0;a10=a10[2])b10.push(a10[1]);return b10}function lP(a10,b10){return a10.add(b10)}function lQ(a10,b10){return a10.mul(b10)}function gQ(a10,b10){return a10.ucompare(b10)<0}function lS(a10){var g10=l6(a10),f10=g10[0],j10=g10[1],h10=g10[2],k10=g10[3],i10=cW(h10),l10=new d(aG,268435455,aB).udivmod(i10).quotient,e10=_(a10,f10),b10=eg(e10);(b10<0||b10>=h10)&&V(aZ);for(var c10=cW(b10);;)if(f10++,e10=_(a10,f10),e10!==95){if(b10=eg(e10),b10<0||b10>=h10)break;gQ(l10,c10)&&V(aZ),b10=cW(b10),c10=lP(lQ(i10,c10),b10),gQ(c10,b10)&&V(aZ)}return f10!==n(a10)&&V(aZ),k10&&gQ(new d(0,0,aA),c10)&&V(aZ),j10<0&&(c10=lR(c10)),c10}var Bz=lS(ag("0xdaba0b6eb09322e3")),By=lS(ag("0xd1342543de82ef95"));function AU(a10,b10){return a10.get(a10.offset(b10))}function Br(a10,b10){return a10.xor(b10)}function Bp(a10,b10){return a10.shift_right_unsigned(b10)}function Bo(a10,b10){return a10.shift_left(b10)}function l1(a10){function o10(a11,b11){return Bo(a11,b11)}function h10(a11,b11){return Bp(a11,b11)}function s10(a11,b11){return lU(a11,b11)}function f10(a11,b11){return Br(a11,b11)}function k10(a11,b11){return lP(a11,b11)}function i10(a11,b11){return lQ(a11,b11)}function m10(a11,b11){return s10(o10(a11,b11),h10(a11,64-b11))}function g10(a11,b11){return AU(a11,b11)}function j10(a11,b11,c11){return cQ(a11,b11,c11)}var q10=By,l10=Bz,b10,d10,c10,e10=a10,r10=g10(e10,0),n10=g10(e10,1),p10=g10(e10,2),t10=g10(e10,3);b10=k10(n10,p10),b10=i10(f10(b10,h10(b10,32)),l10),b10=i10(f10(b10,h10(b10,32)),l10),b10=f10(b10,h10(b10,32)),j10(e10,1,k10(i10(n10,q10),r10));var d10=p10,c10=t10;return c10=f10(c10,d10),d10=m10(d10,24),d10=f10(f10(d10,c10),o10(c10,16)),c10=m10(c10,37),j10(e10,2,d10),j10(e10,3,c10),b10}function AP(a10,b10){a10<0&&cP();var a10=a10+1|0,c10=new Array(a10);c10[0]=0;for(var d10=1;d10>>32-e10,c10)}function g10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&c10|~b10&d10,a10,b10,e10,f10,g11)}function h10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&d10|c10&~d10,a10,b10,e10,f10,g11)}function i10(a10,b10,c10,d10,e10,f10,g11){return l10(b10^c10^d10,a10,b10,e10,f10,g11)}function j10(a10,b10,c10,d10,e10,f10,g11){return l10(c10^(b10|~d10),a10,b10,e10,f10,g11)}return function(a10,b10){var c10=a10[0],d10=a10[1],e10=a10[2],f10=a10[3];c10=g10(c10,d10,e10,f10,b10[0],7,3614090360),f10=g10(f10,c10,d10,e10,b10[1],12,3905402710),e10=g10(e10,f10,c10,d10,b10[2],17,606105819),d10=g10(d10,e10,f10,c10,b10[3],22,3250441966),c10=g10(c10,d10,e10,f10,b10[4],7,4118548399),f10=g10(f10,c10,d10,e10,b10[5],12,1200080426),e10=g10(e10,f10,c10,d10,b10[6],17,2821735955),d10=g10(d10,e10,f10,c10,b10[7],22,4249261313),c10=g10(c10,d10,e10,f10,b10[8],7,1770035416),f10=g10(f10,c10,d10,e10,b10[9],12,2336552879),e10=g10(e10,f10,c10,d10,b10[10],17,4294925233),d10=g10(d10,e10,f10,c10,b10[11],22,2304563134),c10=g10(c10,d10,e10,f10,b10[12],7,1804603682),f10=g10(f10,c10,d10,e10,b10[13],12,4254626195),e10=g10(e10,f10,c10,d10,b10[14],17,2792965006),d10=g10(d10,e10,f10,c10,b10[15],22,1236535329),c10=h10(c10,d10,e10,f10,b10[1],5,4129170786),f10=h10(f10,c10,d10,e10,b10[6],9,3225465664),e10=h10(e10,f10,c10,d10,b10[11],14,643717713),d10=h10(d10,e10,f10,c10,b10[0],20,3921069994),c10=h10(c10,d10,e10,f10,b10[5],5,3593408605),f10=h10(f10,c10,d10,e10,b10[10],9,38016083),e10=h10(e10,f10,c10,d10,b10[15],14,3634488961),d10=h10(d10,e10,f10,c10,b10[4],20,3889429448),c10=h10(c10,d10,e10,f10,b10[9],5,568446438),f10=h10(f10,c10,d10,e10,b10[14],9,3275163606),e10=h10(e10,f10,c10,d10,b10[3],14,4107603335),d10=h10(d10,e10,f10,c10,b10[8],20,1163531501),c10=h10(c10,d10,e10,f10,b10[13],5,2850285829),f10=h10(f10,c10,d10,e10,b10[2],9,4243563512),e10=h10(e10,f10,c10,d10,b10[7],14,1735328473),d10=h10(d10,e10,f10,c10,b10[12],20,2368359562),c10=i10(c10,d10,e10,f10,b10[5],4,4294588738),f10=i10(f10,c10,d10,e10,b10[8],11,2272392833),e10=i10(e10,f10,c10,d10,b10[11],16,1839030562),d10=i10(d10,e10,f10,c10,b10[14],23,4259657740),c10=i10(c10,d10,e10,f10,b10[1],4,2763975236),f10=i10(f10,c10,d10,e10,b10[4],11,1272893353),e10=i10(e10,f10,c10,d10,b10[7],16,4139469664),d10=i10(d10,e10,f10,c10,b10[10],23,3200236656),c10=i10(c10,d10,e10,f10,b10[13],4,681279174),f10=i10(f10,c10,d10,e10,b10[0],11,3936430074),e10=i10(e10,f10,c10,d10,b10[3],16,3572445317),d10=i10(d10,e10,f10,c10,b10[6],23,76029189),c10=i10(c10,d10,e10,f10,b10[9],4,3654602809),f10=i10(f10,c10,d10,e10,b10[12],11,3873151461),e10=i10(e10,f10,c10,d10,b10[15],16,530742520),d10=i10(d10,e10,f10,c10,b10[2],23,3299628645),c10=j10(c10,d10,e10,f10,b10[0],6,4096336452),f10=j10(f10,c10,d10,e10,b10[7],10,1126891415),e10=j10(e10,f10,c10,d10,b10[14],15,2878612391),d10=j10(d10,e10,f10,c10,b10[5],21,4237533241),c10=j10(c10,d10,e10,f10,b10[12],6,1700485571),f10=j10(f10,c10,d10,e10,b10[3],10,2399980690),e10=j10(e10,f10,c10,d10,b10[10],15,4293915773),d10=j10(d10,e10,f10,c10,b10[1],21,2240044497),c10=j10(c10,d10,e10,f10,b10[8],6,1873313359),f10=j10(f10,c10,d10,e10,b10[15],10,4264355552),e10=j10(e10,f10,c10,d10,b10[6],15,2734768916),d10=j10(d10,e10,f10,c10,b10[13],21,1309151649),c10=j10(c10,d10,e10,f10,b10[4],6,4149444226),f10=j10(f10,c10,d10,e10,b10[11],10,3174756917),e10=j10(e10,f10,c10,d10,b10[2],15,718787259),d10=j10(d10,e10,f10,c10,b10[9],21,3951481745),a10[0]=k10(c10,a10[0]),a10[1]=k10(d10,a10[1]),a10[2]=k10(e10,a10[2]),a10[3]=k10(f10,a10[3])}}();function AN(a10,b10,c10){var e10=a10.len&be,d10=0;if(a10.len+=c10,e10){var f10=64-e10;if(c10=64;)a10.b8.set(b10.subarray(d10,d10+64),0),d6(a10.w,a10.b32),c10-=64,d10+=64;c10&&a10.b8.set(b10.subarray(d10,d10+c10),0)}function AL(a10){var c10=a10.len&be;if(a10.b8[c10]=at,c10++,c10>56){for(var b10=c10;b10<64;b10++)a10.b8[b10]=0;d6(a10.w,a10.b32);for(var b10=0;b10<56;b10++)a10.b8[b10]=0}else for(var b10=c10;b10<56;b10++)a10.b8[b10]=0;a10.b32[14]=a10.len<<3,a10.b32[15]=a10.len>>29&536870911,d6(a10.w,a10.b32);for(var e10=new Uint8Array(16),d10=0;d10<4;d10++)for(var b10=0;b10<4;b10++)e10[d10*4+b10]=a10.w[d10]>>8*b10&aK;return e10}function BR(a10){return cY(a10,0,a10.length)}function BB(a10,b10,c10){var d10=AM(),e10=gY(a10);return AN(d10,e10.subarray(b10,b10+c10),c10),BR(AL(d10))}function BC2(a10,b10,c10){return BB(bg(a10),b10,c10)}function BE(){return 0}var bi=new Array;function l2(a10){return bi[a10]}function bF(a10){var b10=l2(a10);return b10.opened||l("Cannot flush a closed channel"),!b10.buffer||b10.buffer_curr===0||(b10.output?b10.output(cY(b10.buffer,0,b10.buffer_curr)):b10.file.write(b10.offset,b10.buffer,0,b10.buffer_curr),b10.offset+=b10.buffer_curr,b10.buffer_curr=0),0}function BT(a10,b10){if(b10.name)try{var d10=__require(gi),c10=d10.openSync(b10.name,"rs");return new aC(c10,b10)}catch{}return new aC(a10,b10)}var ek=new Array(3);function cO(a10,b10){Z.call(this,C(0)),this.log=function(a11){return 0},a10===1&&typeof console.log=="function"?this.log=console.log:a10===2&&typeof console.error=="function"?this.log=console.error:typeof console.log=="function"&&(this.log=console.log),this.flags=b10}cO.prototype.length=function(){return 0},cO.prototype.write=function(a10,b10,c10,d10){if(this.log){d10>0&&c10>=0&&c10+d10<=b10.length&&b10[c10+d10-1]===10&&d10--;var e10=C(d10);return a1(gF(b10),c10,e10,0,d10),this.log(e10.toUtf16()),0}l(this.fd+kS)},cO.prototype.read=function(a10,b10,c10,d10){l(this.fd+": file descriptor is write only")},cO.prototype.close=function(){this.log=void 0};function el(a10,b10){return b10===void 0&&(b10=ek.length),ek[b10]=a10,b10|0}function B8(a10,b10,c10){for(var d10={};b10;){switch(b10[1]){case 0:d10.rdonly=1;break;case 1:d10.wronly=1;break;case 2:d10.append=1;break;case 3:d10.create=1;break;case 4:d10.truncate=1;break;case 5:d10.excl=1;break;case 6:d10.binary=1;break;case 7:d10.text=1;break;case 8:d10.nonblock=1;break}b10=b10[2]}d10.rdonly&&d10.wronly&&l(a10+gA),d10.text&&d10.binary&&l(a10+gl);var e10=mh(a10),f10=e10.device.open(e10.rest,d10);return el(f10,void 0)}(function(){function a10(a11,b10){return cZ()?BT(a11,b10):new cO(a11,b10)}el(a10(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:!0}),0),el(a10(1,{buffered:2,wronly:1,isCharacterDevice:!0}),1),el(a10(2,{buffered:2,wronly:1,isCharacterDevice:!0}),2)})();function BF(a10){var b10=ek[a10];b10.flags.wronly&&l(ld+a10+" is writeonly");var d10=null,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!1,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(kl),refill:d10};return bi[c10.fd]=c10,c10.fd}function l3(a10){var b10=ek[a10];b10.flags.rdonly&&l(ld+a10+" is readonly");var d10=b10.flags.buffered!==void 0?b10.flags.buffered:1,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!0,buffer_curr:0,buffer:new Uint8Array(kl),buffered:d10};return bi[c10.fd]=c10,c10.fd}function BG(){for(var b10=0,a10=0;a10e10.buffer.length){var g10=new Uint8Array(e10.buffer_curr+b10.length);g10.set(e10.buffer),e10.buffer=g10}switch(e10.buffered){case 0:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,bF(a10);break;case 1:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bF(a10);break;case 2:var f10=b10.lastIndexOf(10);f10<0?(e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bF(a10)):(e10.buffer.set(b10.subarray(0,f10+1),e10.buffer_curr),e10.buffer_curr+=f10+1,bF(a10),e10.buffer.set(b10.subarray(f10+1),e10.buffer_curr),e10.buffer_curr+=b10.length-f10-1);break}return 0}function BH(a10,b10,c10,d10){var b10=gY(b10);return BI(a10,b10,c10,d10)}function gT(a10,b10,c10,d10){return BH(a10,bg(b10),c10,d10)}function l4(a10,b10){var c10=String.fromCharCode(b10);return gT(a10,c10,0,1),0}function bG(a10,b10){return+(d_(a10,b10,!1)!==0)}function BK(a10,b10){var d10=new Array(b10+1);d10[0]=a10;for(var c10=1;c10<=b10;c10++)d10[c10]=0;return d10}function bH(a10){return Array.isArray(a10)&&a10[0]===a10[0]>>>0?a10[0]:ed(a10)||ee(a10)?d2:a10 instanceof Function||typeof a10=="function"?247:a10&&a10.caml_custom?k9:cM}var mg=void 0;function AV(a10){var d10={},c10=-1;if(a10)for(var b10=1;b10=0)a10=e10;else{var a10=O.symidx.next_idx++;O.symidx[d10]=a10}}}O[a10+1]=b10,c10&&(O[c10]=b10)}function gX(a10,b10){return l5[a10]=b10,0}function BQ(){G(f8)}function D(a10,b10){return b10>>>0>=n(a10)&&BQ(),_(a10,b10)}function ej(a10){return a10.t&6&&cT(a10),a10.c}function BS(){return 2147483647/4|0}function BM(){l7(O.Not_found)}function l$(a10){var b10=mf(H(a10));return b10===void 0&&BM(),ag(b10)}function BU(){if(c.crypto){if(c.crypto.getRandomValues){var a10=c.crypto.getRandomValues(new Int32Array(4));return[0,a10[0],a10[1],a10[2],a10[3]]}else if(c.crypto.randomBytes){var a10=new Int32Array(c.crypto.randomBytes(16).buffer);return[0,a10[0],a10[1],a10[2],a10[3]]}}var b10=new Date().getTime(),d10=b10^4294967295*Math.random();return[0,d10]}function bI(a10){for(var b10=1;a10&&a10.joo_tramp;)a10=a10.joo_tramp.apply(null,a10.joo_args),b10++;return a10}function p(a10,b10){return{joo_tramp:a10,joo_args:b10}}function mb(a10,b10){if(b10.fun)return a10.fun=b10.fun,0;if(typeof b10=="function")return a10.fun=b10,0;for(var c10=b10.length;c10--;)a10[c10]=b10[c10];return 0}function P(a10){{if(Array.isArray(a10))return a10;var b10;return c.RangeError&&a10 instanceof c.RangeError&&a10.message&&a10.message.match(/maximum call stack/i)||c.InternalError&&a10 instanceof c.InternalError&&a10.message&&a10.message.match(/too much recursion/i)?b10=O.Stack_overflow:a10 instanceof c.Error&&bj(gc)?b10=[0,bj(gc),a10]:b10=[0,O.Failure,ag(String(a10))],a10 instanceof c.Error&&(b10.js_error=a10),b10}}function BW(){return init_awareness(),__toCommonJS(awareness_exports)}function BX(){return(init_y_indexeddb(),__toCommonJS(y_indexeddb_exports)).IndexeddbPersistence}function BY(){return(init_quill2(),__toCommonJS(quill_exports)).default}function BZ(){return require_quill_cursors()}function B0(){return(init_y_webrtc(),__toCommonJS(y_webrtc_exports)).WebrtcProvider}function B1(){return init_y_quill(),__toCommonJS(y_quill_exports)}function B2(){return init_yjs(),__toCommonJS(yjs_exports)}function Bs(a10){switch(a10[2]){case-8:case-11:case-12:return 1;default:return 0}}function A7(a10){var b10=e;if(a10[0]===0){if(b10+=a10[1][1],a10.length===3&&a10[2][0]===0&&Bs(a10[1]))var f10=a10[2],g10=1;else var g10=2,f10=a10;b10+="(";for(var d10=g10;d10g10&&(b10+=kW);var c10=f10[d10];typeof c10=="number"?b10+=c10.toString():c10 instanceof a0||typeof c10=="string"?b10+=d1+c10.toString()+d1:b10+=lq}b10+=")"}else a10[0]===r&&(b10+=a10[1]);return b10}function lM(a10){if(Array.isArray(a10)&&(a10[0]===0||a10[0]===r)){var c10=bj(ls);if(c10)d9(c10,[a10,!1]);else{var d10=A7(a10),b10=bj(le);if(b10&&d9(b10,[0]),console.error(gd+d10),a10.js_error)throw a10.js_error}}else throw a10}function BP(){var d10=c.process;d10&&d10.on?d10.on("uncaughtException",function(a10,b10){lM(a10),d10.exit(2)}):c.addEventListener&&c.addEventListener(kU,function(a10){a10.error&&lM(a10.error)})}BP();function h(a10,b10){return(a10.l>=0?a10.l:a10.l=a10.length)===1?a10(b10):bh(a10,[b10])}function i(a10,b10,c10){return(a10.l>=0?a10.l:a10.l=a10.length)===2?a10(b10,c10):bh(a10,[b10,c10])}function x(a10,b10,c10,d10){return(a10.l>=0?a10.l:a10.l=a10.length)===3?a10(b10,c10,d10):bh(a10,[b10,c10,d10])}function f4(a10,b10,c10,d10,e10,f10){return(a10.l>=0?a10.l:a10.l=a10.length)===5?a10(b10,c10,d10,e10,f10):bh(a10,[b10,c10,d10,e10,f10])}function AK(a10,b10,c10,d10,e10,f10,g10,h10){return(a10.l>=0?a10.l:a10.l=a10.length)===7?a10(b10,c10,d10,e10,f10,g10,h10):bh(a10,[b10,c10,d10,e10,f10,g10,h10])}var B7=0;A8();var em=[r,lw,-1],g3=[r,kh,-2],b_=[r,gB,-3],b9=[r,j9,-4],a5=[r,k0,-7],g1=[r,lu,-8],g2=[r,kv,-9],f=[r,kA,-11],b$=[r,kH,-12],AJ=[4,0,0,0,[12,45,[4,0,0,0,0]]],eN=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,lv,[4,0,0,0,[12,45,[4,0,0,0,[11,kL,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],jK=gz,bu="content",jQ="columns",jR="rows",fY=kc,fZ=gz,jS=bx,jT="page_content";aw(11,b$,kH),aw(10,f,kA),aw(9,[r,kC,-10],kC),aw(8,g2,kv),aw(7,g1,lu),aw(6,a5,k0),aw(5,[r,k_,-6],k_),aw(4,[r,kn,-5],kn),aw(3,b9,j9),aw(2,b_,gB),aw(1,g3,kh),aw(0,em,lw);var ms="output_substring",mo=bd,mk="true",ml="false",mx="CamlinternalLazy.Undefined",mD="option is None",mG="\\\\",mH="\\'",mI="\\b",mJ="\\t",mK="\\n",mL="\\r",mU="List.init",mQ="hd",m$="String.blit / Bytes.blit_string",m_="Bytes.blit",m9="String.sub / Bytes.sub",nk="String.contains_from / Bytes.contains_from",nq="Array.blit",np="Array.sub",nn="Array.init",nx=[0,"set.ml",lc,18],nt=dX,nu=dX,nv=dX,nw=dX,nA=d0,nB=d0,nC=d0,nD=d0,nE="Stdlib.Stack.Empty",nI="Stdlib.Queue.Empty",nR="Buffer.add_substring/add_subbytes",nP="Buffer.add: cannot grow buffer",nN="Buffer.sub",nY="first domain already spawned",nV=[0,"domain.ml",184,13],n9="%c",n_="%s",n$=k4,oa=j6,ob=ly,oc=kY,od="%f",oe="%B",of="%{",og="%}",oh="%(",oi="%)",oj="%a",ok="%t",ol="%?",om="%r",on="%_r",oo=[0,L,850,23],oz=[0,L,814,21],or=[0,L,815,21],oA=[0,L,818,21],os=[0,L,819,21],oB=[0,L,822,19],ot=[0,L,823,19],oC=[0,L,826,22],ou=[0,L,827,22],oD=[0,L,831,30],ov=[0,L,832,30],ox=[0,L,836,26],op=[0,L,837,26],oy=[0,L,846,28],oq=[0,L,847,28],ow=[0,L,851,23],pP=[0,L,1558,4],pQ="Printf: bad conversion %[",pR=[0,L,1626,39],pS=[0,L,1649,31],pT=[0,L,1650,31],pU="Printf: bad conversion %_",pV=kf,pW=kB,pX=kf,pY=kB,p2=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],p1=[0,0,4],pK=f_,pI="neg_infinity",pJ=kk,pH=bd,pC=[0,jZ],pq="%+nd",pr="% nd",pt="%+ni",pu="% ni",pv="%nx",pw="%#nx",px="%nX",py="%#nX",pz="%no",pA="%#no",pp="%nd",ps=ly,pB="%nu",pc="%+ld",pd="% ld",pf="%+li",pg="% li",ph="%lx",pi="%#lx",pj="%lX",pk="%#lX",pl="%lo",pm="%#lo",pb="%ld",pe=j6,pn="%lu",o0="%+Ld",o1="% Ld",o3="%+Li",o4="% Li",o5="%Lx",o6="%#Lx",o7="%LX",o8="%#LX",o9="%Lo",o_="%#Lo",oZ="%Ld",o2=kY,o$="%Lu",oM="%+d",oN="% d",oP="%+i",oQ="% i",oR="%x",oS="%#x",oT="%X",oU="%#X",oV="%o",oW="%#o",oL=f7,oO=k4,oX=kq,n1="@]",n2="@}",n3="@?",n4=`@ +`,n5="@.",n6="@@",n7="@%",n8="@",oE="CamlinternalFormat.Type_mismatch",p7=e,p8=[0,[11,kW,[2,0,[2,0,0]]],", %s%s"],qI=[0,[11,gd,[2,0,[12,10,0]]],ku],qJ=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],`Fatal error in uncaught exception handler: exception %s +`],qH="Fatal error: out of memory in uncaught exception handler",qE=[0,[11,gd,[2,0,[12,10,0]]],ku],qy=[0,[2,0,[12,10,0]],`%s +`],qz=[0,[11,ke,0],ke],qn="Raised at",qo="Re-raised at",qp="Raised by primitive operation at",qq="Called from",qr=[0,[12,32,[4,0,0,0,0]]," %d"],qv=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],qs=" (inlined)",qu=e,qt=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,lv,AJ]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],qw=[0,[2,0,[11," unknown location",0]],"%s unknown location"],qg="Out of memory",qh="Stack overflow",qi="Pattern matching failed",qj="Assertion failed",qk="Undefined recursive module",p_=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],p$=e,qa=e,qb=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],p6=[0,[4,0,0,0,0],f7],p4=[0,[3,0,0],"%S"],p5=lq,qB=[0,e,`(Cannot print locations: bytecode executable program file not found)`,`(Cannot print locations: bytecode executable program file appears to be corrupt)`,`(Cannot print locations: bytecode executable program file has wrong magic number)`,`(Cannot print locations: bytecode executable program file cannot be opened; - -- too many open files. Try running with OCAMLRUNPARAM=b=2)`],qU="Fun.Finally_raised: ",qS="Stdlib.Fun.Finally_raised",qV="Digest.BLAKE2: wrong hash size",q6=ao(14371852,15349651,22696),q7=ao(12230193,11438743,35013),q8=ao(1424933,15549263,2083),q9=ao(9492471,4696708,43520),qY=ao(1,0,0),qZ=ao(0,0,0),q2=ao(1,0,0),q0=ao(0,0,0),q1=ao(2,0,0),rf="Hashtbl: unsupported hash table format",q$=e,rX=[3,0,3],rY=bf,rS=kK,rT=" ",z0=[0,0],zY=[0,0],zZ=[0,80,"Update"],zU=e,zV=e,zW=[0,80,[0,"cell-edit-btn"]],zX="\xE2\x9C\x8F\xEF\xB8\x8F",z3=[0,80,[0,"cell-edit-overlay"]],z4=[0,80,[0,go]],zF="GET",zE=[0,c,479,17],zD=[0,c,494,11],zI=[0,c,509,19],zH=[0,c,519,13],zG=[0,c,kL,13],zJ=[0,c,526,11],zP=[0,c,lg,19],zO=[0,c,539,19],zK=[0,c,532,13],zM=[0,c,548,15],zN=[0,c,552,15],zL=[0,c,kF,11],zR=e,zS=[0,c,565,17],zQ=[0,c,568,11],zy=bB,zz=ko,zs="New column kind:",zq=[0,c,354,13],zm=d0,zn=b8,zo=dX,zp=cO,zi="Old value:",zj="Action: delete",zk="Key:",zl=[0,c,279,15],zh="On_change",zg=[0,c,204,22],ze="[blit v(%i) %i %i v'(%i)]",zb=[0,c,147,18],y1=lm,y2="orange",y3=lq,y0="Received peers",yZ="Received synced",yY="Received connected",yT="modules/cursors",yU="Narines",yV=[0,[0,"wss://p2p.u31.fr",0]],yW="testroom5267564",yX="zedoc",y5=[0,80,[0,"p2p_status_icon"]],y7="\xE2\x99\xBC",y_=[0,80,[0,"p2p_status"]],zv=bB,zw=ko,AQ=[0,80,"Add table"],AT=[0,80,[0,k4]];function z(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return[0,z(a10[1])];case 1:return[1,z(a10[1])];case 2:return[2,z(a10[1])];case 3:return[3,z(a10[1])];case 4:return[4,z(a10[1])];case 5:return[5,z(a10[1])];case 6:return[6,z(a10[1])];case 7:return[7,z(a10[1])];case 8:var c10=a10[1];return[8,c10,z(a10[2])];case 9:var b10=a10[1];return[9,b10,b10,z(a10[3])];case 10:return[10,z(a10[1])];case 11:return[11,z(a10[1])];case 12:return[12,z(a10[1])];case 13:return[13,z(a10[1])];default:return[14,z(a10[1])]}}function X(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,X(a10[1],b10)];case 1:return[1,X(a10[1],b10)];case 2:return[2,X(a10[1],b10)];case 3:return[3,X(a10[1],b10)];case 4:return[4,X(a10[1],b10)];case 5:return[5,X(a10[1],b10)];case 6:return[6,X(a10[1],b10)];case 7:return[7,X(a10[1],b10)];case 8:var c10=a10[1];return[8,c10,X(a10[2],b10)];case 9:var d10=a10[2],e10=a10[1];return[9,e10,d10,X(a10[3],b10)];case 10:return[10,X(a10[1],b10)];case 11:return[11,X(a10[1],b10)];case 12:return[12,X(a10[1],b10)];case 13:return[13,X(a10[1],b10)];default:return[14,X(a10[1],b10)]}}function x(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,x(a10[1],b10)];case 1:return[1,x(a10[1],b10)];case 2:var c10=a10[1];return[2,c10,x(a10[2],b10)];case 3:var d10=a10[1];return[3,d10,x(a10[2],b10)];case 4:var e10=a10[3],f10=a10[2],g10=a10[1];return[4,g10,f10,e10,x(a10[4],b10)];case 5:var h10=a10[3],i10=a10[2],j10=a10[1];return[5,j10,i10,h10,x(a10[4],b10)];case 6:var k10=a10[3],l10=a10[2],m10=a10[1];return[6,m10,l10,k10,x(a10[4],b10)];case 7:var n10=a10[3],o10=a10[2],p10=a10[1];return[7,p10,o10,n10,x(a10[4],b10)];case 8:var q10=a10[3],r10=a10[2],s10=a10[1];return[8,s10,r10,q10,x(a10[4],b10)];case 9:var t10=a10[1];return[9,t10,x(a10[2],b10)];case 10:return[10,x(a10[1],b10)];case 11:var u10=a10[1];return[11,u10,x(a10[2],b10)];case 12:var v10=a10[1];return[12,v10,x(a10[2],b10)];case 13:var w10=a10[2],y10=a10[1];return[13,y10,w10,x(a10[3],b10)];case 14:var z10=a10[2],A10=a10[1];return[14,A10,z10,x(a10[3],b10)];case 15:return[15,x(a10[1],b10)];case 16:return[16,x(a10[1],b10)];case 17:var B10=a10[1];return[17,B10,x(a10[2],b10)];case 18:var C2=a10[1];return[18,C2,x(a10[2],b10)];case 19:return[19,x(a10[1],b10)];case 20:var D2=a10[2],E2=a10[1];return[20,E2,D2,x(a10[3],b10)];case 21:var F2=a10[1];return[21,F2,x(a10[2],b10)];case 22:return[22,x(a10[1],b10)];case 23:var G2=a10[1];return[23,G2,x(a10[2],b10)];default:var H2=a10[2],I2=a10[1];return[24,I2,H2,x(a10[3],b10)]}}function a7(a10){throw g([0,cc,a10],1)}function s(a10){throw g([0,cb,a10],1)}function c2(a10){return 0<=a10?a10:-a10|0}var g7=kN;function aO(a10,b10){return a10+b10}function mt(b10){var e10=n(b10);return function(a10){for(var c10=a10;;){if(e10<=c10)return aO(b10,mu);var d10=D(b10,c10);a:{if(48<=d10){if(58>d10)break a}else if(d10===45)break a;return b10}c10=c10+1|0}}(0)}function mx(a10,b10,c10,d10){for(var f10=a10,e10=b10,g10=c10;;){if(!g10){f10[1+e10]=d10;return}var h10=g10[2],i10=g10[1];if(!h10){f10[1+e10]=[0,i10,d10];return}var j10=h10[2],k10=h10[1];if(!j10){f10[1+e10]=[0,i10,[0,k10,d10]];return}var l10=[0,j10[1],aL],m10=j10[2];f10[1+e10]=[0,i10,[0,k10,l10]],f10=l10,e10=1,g10=m10}}BR(0);var en=l_(1),ai=l_(2);function ce(a10,b10){gV(a10,b10,0,n(b10))}function g8(a10,b10,c10,d10){return 0<=c10&&0<=d10&&(n(b10)-d10|0)>=c10?gV(a10,b10,c10,d10):s(my)}function g9(a10){return ce(ai,a10),l$(ai,10),bK(ai)}var eo=[0,function(a10){return function(a11){for(var b10=a11;;){if(!b10)return 0;var d10=b10[2],e10=b10[1];try{bK(e10)}catch(f10){var c10=M(f10);if(c10[1]!==g6)throw g(c10,0)}b10=d10}}(BS(0))}],g_=[0,function(a10){}];function ep(a10){return h(g_[1],0),h(gF(eo),0)}g0(ll,ep);function cf(a10){return bK(a10)}function mo(a10){return a10^-1}function mp(a10){return a10?mq:mr}function ms(a10){return e+a10}function mv(a10){return mt(gK("%.12g",a10))}function mw(a10,b10){if(!a10)return b10;var c10=a10[2],d10=a10[1];if(!c10)return[0,d10,b10];var e10=c10[2],f10=c10[1];if(!e10)return[0,d10,[0,f10,b10]];var g10=[0,e10[1],aL];return mx(g10,1,e10[2],b10),[0,d10,[0,f10,g10]]}function mz(c10){for(;;){var a10=gF(eo);let d10=[0,1],e10=a10;var b10=1-gE(eo,a10,function(a11){return gE(d10,1,0)&&h(c10,0),h(e10,0)});if(!b10)return b10}}function mA(a10,b10){l$(a10,b10)}var eq2=B3(0),cg=(4*eq2|0)-1|0;function mB(a10){return 1-(typeof a10=="number"?1:0)}function g$(a10,b10,c10){return gE(a10,b10,c10)}function ch(a10){return gF(a10)}function ci(a10){return[0,a10]}function mC(a10,b10){return A4(a10,b10)}var mE=[q,mD,ag(0)];function mF(a10){var d10=a10[1];a10[1]=0;try{var c10=h(d10,0);return a10[1]=c10,l7(a10),c10}catch(f10){var b10=M(f10);throw a10[1]=function(a11){throw g(b10,0)},BI(a10),g(b10,0)}}function mG(a10){var c10=a10[1];a10[1]=0;var b10=h(c10,0);return a10[1]=b10,l7(a10),b10}function mH(a10,b10){if(BJ(b10)===0)return a10?mG(b10):mF(b10);throw g(mE,1)}function er(a10){return mH(0,a10)}function mI(a10){var b10=aN(a10);return b10!==aZ&&b10!==bg&&b10!==bE&&b10!==kG?a10:BH(a10)}function c3(a10){return a10?a10[1]:s(mJ)}function cj(a10,b10){return b10?[0,h(a10,b10[1])]:0}function ha(a10){return a10?1:0}function mK(a10){return a10?[0,a10[1],0]:0}function mL(a10){a:{if(40<=a10){if(a10===92)return mM;if(gj>a10)break a}else{if(32<=a10){if(39<=a10)return mN;break a}if(14>a10)switch(a10){case 8:return mO;case 9:return mP;case 10:return mQ;case 13:return mR}}var b10=C(4);return B(b10,0,92),B(b10,1,48+(a10/gr|0)|0),B(b10,2,48+((a10/10|0)%10|0)|0),B(b10,3,48+(a10%10|0)|0),ej(b10)}var c10=C(1);return B(c10,0,a10),ej(c10)}function mS(a10){return 25>>0?a10:a10-32|0}function mT(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function es(a10){return mT(0,a10)}function bN(a10,b10){for(var c10=a10,d10=b10;;){if(!c10)return d10;var e10=[0,c10[1],d10];c10=c10[2],d10=e10}}function ck(a10){return bN(a10,0)}function mX(a10,b10,c10){if(b10>1,s10=p10(r10,b11),D2=s10[1],t10=p10(a11-r10|0,s10[2]),E2=t10[2];return[0,B10(D2,t10[1],0),E2]}function p10(a11,b11){if(a11===2){if(b11){var j10=b11[2];if(j10){var k10=j10[1],g10=b11[1],B11=j10[2],q10=i(d10,g10,k10),C2=q10===0?[0,g10,0]:0>1,s10=h10(r10,b11),D2=s10[1],t10=h10(a11-r10|0,s10[2]),E2=t10[2];return[0,A10(D2,t10[1],0),E2]}var a10=es(b10);return 2<=a10?h10(a10,b10)[1]:b10}function m8(a10,b10){return l3(a10,b10)}function m9(a10,b10){return a10<=b10?a10:b10}function m_(a10,b10){return b10<=a10?a10:b10}function m$(a10){return e+a10}function bn(a10,b10){var c10=C(a10);return Bg(c10,0,a10,b10),c10}var na=C(0);function nb(a10){var b10=au(a10),c10=C(b10);return a4(a10,0,c10,0,b10),c10}function ev(a10,b10,c10){if(0<=b10&&0<=c10&&(au(a10)-c10|0)>=b10){var d10=C(c10);return a4(a10,b10,d10,0,c10),d10}return s(nd)}function ew(a10,b10,c10){return ej(ev(a10,b10,c10))}function hd(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(au(a10)-e10|0)>=b10&&0<=d10&&(au(c10)-e10|0)>=d10){a4(a10,b10,c10,d10,e10);return}return s(ne)}function ax(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(n(a10)-e10|0)>=b10&&0<=d10&&(au(c10)-e10|0)>=d10){cT(a10,b10,c10,d10,e10);return}return s(nf)}function he(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function ni(a10,b10){var d10=au(b10);if(d10===0)return b10;var e10=C(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){B(e10,c10,h(a10,bG(b10,c10)));var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function hf(a10,b10,c10){lO(a10,b10,Bt(c10))}function hg(a10,b10,c10){at(a10,b10,c10)}function hh(a10,b10){return A_(a10,b10)}function cl(a10){return bj(a10)}function $(a10){return ej(a10)}function nc(a10){return nb(bj(a10))}function ng(a10){for(var d10=au(a10),b10=[0,0];!(b10[1]>=d10||!he(bG(a10,b10[1])));)b10[1]++;for(var c10=[0,d10-1|0];;){if(b10[1]<=c10[1]&&he(bG(a10,c10[1]))){c10[1]--;continue}return b10[1]<=c10[1]?ev(a10,b10[1],(c10[1]-b10[1]|0)+1|0):na}}function nh(a10){var b10=[0,0],j10=au(a10)-1|0,l10=0;if(j10>=0)for(var g10=l10;;){var e10=bG(a10,g10);a:{b:{c:{if(32<=e10){var h10=e10-34|0;if(58>>0){if(93<=h10)break c}else if(56>>0)break b;var i10=1;break a}if(11<=e10){if(e10===13)break b}else if(8<=e10)break b}var i10=4;break a}var i10=2}b10[1]=b10[1]+i10|0;var o10=g10+1|0;if(j10===g10)break;g10=o10}if(b10[1]===au(a10))return a10;var c10=C(b10[1]);b10[1]=0;var k10=au(a10)-1|0,m10=0;if(k10>=0)for(var f10=m10;;){var d10=bG(a10,f10);a:{b:{c:{if(35<=d10){if(d10!==92){if(gj<=d10)break c;break b}}else{if(32>d10){if(14<=d10)break c;switch(d10){case 8:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],98);break a;case 9:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],116);break a;case 10:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],110);break a;case 13:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],114);break a;default:break c}}if(34>d10)break b}B(c10,b10[1],92),b10[1]++,B(c10,b10[1],d10);break a}B(c10,b10[1],92),b10[1]++,B(c10,b10[1],48+(d10/gr|0)|0),b10[1]++,B(c10,b10[1],48+((d10/10|0)%10|0)|0),b10[1]++,B(c10,b10[1],48+(d10%10|0)|0);break a}B(c10,b10[1],d10)}b10[1]++;var n10=f10+1|0;if(k10===f10)break;f10=n10}return c10}function nj(a10){return ni(mS,a10)}function nk(a10,b10){return A$(a10,b10)}function nl(a10,b10,c10){lO(a10,b10,c10)}function c5(a10,b10){return $(bn(a10,b10))}function ex(a10,b10,c10){return $(ev(cl(a10),b10,c10))}function hi(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function no(a10,b10,c10,d10){for(var e10=c10;;){if(b10<=e10)throw g(aD,1);if(_(a10,e10)===d10)return e10;e10=e10+1|0}}function np(a10,b10,c10){var d10=n(a10);if(0<=b10&&d10>=b10)try{no(a10,d10,b10,c10);var f10=1;return f10}catch(f11){var e10=M(f11);if(e10===aD)return 0;throw g(e10,0)}return s(nq)}function ey(a10,b10){return mg(a10,b10)}function c6(a10,b10){return nk(cl(a10),b10)}function ez(a10,b10){return a10==b10?1:0}function nm(a10){return a10==e||!hi(_(a10,0))&&!hi(_(a10,n(a10)-1|0))?a10:$(ng(cl(a10)))}function nn(a10){return $(nh(cl(a10)))}function nr(a10,b10){return np(a10,0,b10)}function ns(a10){return $(nj(cl(a10)))}function hj(a10,b10){if(a10===0)return[0];if(0>a10)return s(nt);var d10=ap(a10,h(b10,0)),e10=a10-1|0,f10=1;if(e10>=1)for(var c10=f10;;){d10[1+c10]=h(b10,c10);var g10=c10+1|0;if(e10===c10)break;c10=g10}return d10}function cm(a10,b10,c10,d10,e10){return 0<=e10&&0<=b10&&(a10.length-1-e10|0)>=b10&&0<=d10&&(c10.length-1-e10|0)>=d10?A2(a10,b10,c10,d10,e10):s(nw)}function hk(a10,b10){var d10=b10.length-2|0,e10=0;if(d10>=0)for(var c10=e10;;){h(a10,b10[1+c10]);var f10=c10+1|0;if(d10===c10)break;c10=f10}return 0}function hl(a10,b10){var d10=b10.length-1;if(d10===0)return[0];var e10=ap(d10,h(a10,b10[1])),f10=d10-1|0,g10=1;if(f10>=1)for(var c10=g10;;){e10[1+c10]=h(a10,b10[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function nx(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function c7(a10){if(!a10)return[0];var b10=a10[2],c10=a10[1],e10=ap(nx(0,a10),c10);return function(a11,b11){for(var d10=a11,c11=b11;;){if(!c11)return e10;var f10=c11[2];e10[1+d10]=c11[1],d10=d10+1|0,c11=f10}}(1,b10)}function nu(a10,b10,c10){return 0<=b10&&0<=c10&&(a10.length-1-c10|0)>=b10?A3(a10,b10,c10):s(nv)}function ny(k10){function j10(a10){return a10?a10[4]:0}function d10(a10,b11,c11){var d11=a10?a10[4]:0,e11=c11?c11[4]:0,f10=e11<=d11?d11+1|0:e11+1|0;return[0,a10,b11,c11,f10]}function l10(a10,b11,c11){var g10=a10?a10[4]:0,h10=c11?c11[4]:0;if((h10+2|0)=h10){var w10=h10<=g10?g10+1|0:h10+1|0;return[0,a10,b11,c11,w10]}if(!c11)return s(nC);var k11=c11[3],m11=c11[2],f10=c11[1],r10=j10(f10);if(r10<=j10(k11))return d10(d10(a10,b11,f10),m11,k11);if(!f10)return s(nB);var t10=f10[2],u10=f10[1],v10=d10(f10[3],m11,k11);return d10(d10(a10,b11,u10),t10,v10)}function c10(a10,b11){if(!b11)return[0,0,a10,0,1];var d11=b11[3],e11=b11[2],f10=b11[1],g10=i(k10[1],a10,e11);if(g10===0)return b11;if(0<=g10){var h10=c10(a10,d11);return d11===h10?b11:l10(f10,e11,h10)}var j11=c10(a10,f10);return f10===j11?b11:l10(j11,e11,d11)}function b10(a10){return[0,0,a10,0,1]}var m10=0;function e10(a10,b11){for(var c11=b11;;){if(!c11)return;var d11=c11[3],f10=c11[2];e10(a10,c11[1]),h(a10,f10),c11=d11}}function n10(a10,b11){for(var d11=a10,c11=b11;;){if(!c11)return d11;var e11=c11[2],f10=c11[1];d11=[0,e11,n10(d11,c11[3])],c11=f10}}function o10(a10,b11,c11){for(var d11=c11;;){if(!d11)return;var e11=d11[3],f10=d11[1];d11=h(b11,d11[2])?e11:f10}}function p10(a10){function c11(a11,b11){if(3>=a11>>>0)switch(a11){case 0:return[0,0,b11];case 1:if(b11)return[0,[0,0,b11[1],0,1],b11[2]];break;case 2:if(b11){var h10=b11[2];if(h10)return[0,[0,[0,0,b11[1],0,1],h10[1],0,2],h10[2]]}break;default:if(b11){var i10=b11[2];if(i10){var j11=i10[2];if(j11)return[0,[0,[0,0,b11[1],0,1],i10[1],[0,0,j11[1],0,1],2],j11[2]]}}}var k11=a11/2|0,l11=c11(k11,b11),e11=l11[2],n11=l11[1];if(!e11)throw g([0,f,nD],1);var o11=e11[1],m11=c11((a11-k11|0)-1|0,e11[2]),p11=m11[2];return[0,d10(n11,o11,m11[1]),p11]}return c11(es(a10),a10)[1]}return[0,,,,c10,,,,,,,,,,,,,m10,,,,,,,,,,,,,,e10,,,,,,,,function(a10){return n10(0,a10)},,,,,,,,,,,function(a10,b11){for(var c11=b11;;){if(!c11)return;var d11=c11[2],e11=c11[3],f10=c11[1];if(h(a10,d11))return o10(d11,a10,e11);c11=f10}},,,,,,,,function(a10){if(!a10)return m10;var f10=a10[2],d11=a10[1];if(!f10)return b10(d11);var g10=f10[2],e11=f10[1];if(!g10)return c10(e11,b10(d11));var h10=g10[2],i10=g10[1];if(!h10)return c10(i10,c10(e11,b10(d11)));var j11=h10[2],l11=h10[1];if(!j11)return c10(l11,c10(i10,c10(e11,b10(d11))));if(j11[2])return p10(m7(k10[1],a10));var n11=j11[1];return c10(n11,c10(l11,c10(i10,c10(e11,b10(d11)))))}]}function nE(a10){var b10=ny(a10);return[0,b10[17],b10[4],,,,,,,,b10[39],,,,,,,,,,,,b10[50],b10[31],,,,,,,,,,,,,,,b10[58]]}function nF(f10){function h10(a10){return a10?a10[5]:0}function e10(a10,b10,c11,d11){var e11=h10(a10),f11=h10(d11),g10=f11<=e11?e11+1|0:f11+1|0;return[0,a10,b10,c11,d11,g10]}function d10(a10,b10,c11,d11){var i10=a10?a10[5]:0,j11=d11?d11[5]:0;if((j11+2|0)=j11){var B10=j11<=i10?i10+1|0:j11+1|0;return[0,a10,b10,c11,d11,B10]}if(!d11)return s(nJ);var l11=d11[4],o11=d11[3],p10=d11[2],g10=d11[1],w10=h10(g10);if(w10<=h10(l11))return e10(e10(a10,b10,c11,g10),p10,o11,l11);if(!g10)return s(nI);var x10=g10[3],y10=g10[2],z10=g10[1],A10=e10(g10[4],p10,o11,l11);return e10(e10(a10,b10,c11,z10),y10,x10,A10)}function j10(a10,b10,c11){if(!c11)return[0,0,a10,b10,0,1];var e11=c11[4],h11=c11[3],k11=c11[2],g10=c11[1],o11=c11[5],l11=i(f10[1],a10,k11);if(l11===0)return h11===b10?c11:[0,g10,a10,b10,e11,o11];if(0<=l11){var m11=j10(a10,b10,e11);return e11===m11?c11:d10(g10,k11,h11,m11)}var n11=j10(a10,b10,g10);return g10===n11?c11:d10(n11,k11,h11,e11)}function n10(a10){for(var b10=a10;;){if(!b10)throw g(aD,1);var c11=b10[1];if(!c11)return[0,b10[2],b10[3]];b10=c11}}function c10(a10){if(!a10)return s(nK);var b10=a10[1];if(!b10)return a10[4];var e11=a10[4],f11=a10[3],g10=a10[2];return d10(c10(b10),g10,f11,e11)}function o10(a10,b10){if(!a10)return b10;if(!b10)return a10;var e11=n10(b10),f11=e11[2],g10=e11[1];return d10(a10,g10,f11,c10(b10))}function k10(a10,b10){if(!b10)return 0;var c11=b10[4],h11=b10[3],g10=b10[2],e11=b10[1],j11=i(f10[1],a10,g10);if(j11===0)return o10(e11,c11);if(0<=j11){var l11=k10(a10,c11);return c11===l11?b10:d10(e11,g10,h11,l11)}var m11=k10(a10,e11);return e11===m11?b10:d10(m11,g10,h11,c11)}function l10(a10,b10){for(var c11=b10;;){if(!c11)return 0;var d11=c11[4],e11=c11[3],f11=c11[2];l10(a10,c11[1]),i(a10,f11,e11),c11=d11}}function m10(a10,b10,c11){for(var d11=b10,e11=c11;;){if(!d11)return e11;var f11=d11[4],g10=d11[3],h11=d11[2],i10=y(a10,h11,g10,m10(a10,d11[1],e11));d11=f11,e11=i10}}return[0,,,,,0,,j10,function(a10,b10){for(var c11=b10;;){if(!c11)throw g(aD,1);var e11=c11[4],h11=c11[3],j11=c11[1],d11=i(f10[1],a10,c11[2]);if(d11===0)return h11;var k11=0<=d11?e11:j11;c11=k11}},,,,,,,,,function(a10,b10){for(var c11=b10;;){if(!c11)return 0;var e11=c11[4],g10=c11[3],h11=c11[1],d11=i(f10[1],a10,c11[2]);if(d11===0)return[0,g10];var j11=0<=d11?e11:h11;c11=j11}},,,,,,,k10,,,l10,,,m10]}function eA(a10){var b10=nF(a10);return[0,b10[5],b10[7],,,,b10[24],,,,,,,,,,,b10[8],b10[17],,,,,b10[27],b10[30]]}var eB=[q,nL,ag(0)];function bO(a10){return[0,0,0]}function cn(a10){a10[1]=0,a10[2]=0}function a9(a10,b10){return b10[1]=[0,a10,b10[1]],b10[2]=b10[2]+1|0,0}function bP(a10){var b10=a10[1];if(!b10)return 0;var c10=b10[1];return a10[1]=b10[2],a10[2]=a10[2]-1|0,[0,c10]}function bQ(a10){var b10=a10[1];return b10?[0,b10[1]]:0}function nM(a10){var b10=a10[1];if(!b10)throw g(eB,1);a10[1]=b10[2],a10[2]=a10[2]-1|0}function nN(a10){if(!a10[1])throw g(eB,1)}function nO(a10,b10){return a8(a10,b10[1])}var nQ=[q,nP,ag(0)];function eC(a10){return[0,0,0,0]}function eD(a10){a10[1]=0,a10[2]=0,a10[3]=0}function eE(a10,b10){var c10=[0,a10,0],d10=b10[3];return d10?(b10[1]=b10[1]+1|0,d10[2]=c10,b10[3]=c10,0):(b10[1]=1,b10[2]=c10,b10[3]=c10,0)}function hm(a10){var b10=a10[2];if(!b10)throw g(nQ,1);var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,c10}return eD(a10),c10}function eF(a10){return a10[1]===0?1:0}function nR(a10){var b10=a10[2];return b10?[0,b10[1]]:0}function nS(a10){var b10=a10[2];if(!b10)return 0;var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,[0,c10]}return eD(a10),[0,c10]}function bo(a10){var b10=1<=a10?a10:1,c10=cg=(d10+b10|0));)c10[1]=2*c10[1]|0;cg=b10?ew(a10[1][1],b10,c10):s(nU)}function nV(a10){return a10[2]=0,0}function nX(a10,b10){var c10=a10[2],d10=a10[1],e10=d10[1];d10[2]<=c10?(eG(a10,1),at(a10[1][1],a10[2],b10)):B(e10,c10,b10),a10[2]=c10+1|0}var eH=[0,0];function hp(a10){return a10}function hq(a10){return a10!==eH?1:0}function hr(a10){return a10}(function(a10){Be(ap(8,eH))})(0);var nZ=ci(0),hs=ci(0);function n0(a10){for(;;){var b10=ch(hs),c10=1-g$(hs,b10,[0,a10,b10]);if(!c10)return c10}}function aP(a10,b10){var c10=[0,mC(nZ,1),b10];return a10&&n0([0,c10,a10[1]]),c10}function ht(d10){for(;;){var a10=lR(0),b10=a10.length-1;if(d10e10){if(e10!==32){if(43>e10)break a;switch(e10-43|0){case 5:c:if(c10<(d10+2|0)&&1=(d10+1|0))break a;var f10=bn(d10+1|0,48);return at(f10,0,e10),ax(b10,1,f10,(d10-c10|0)+2|0,c10-1|0),$(f10)}if(71<=e10){if(5>>0)break a}else if(65>e10)break a}if(c10a10)return b10;var h10=[0,0],i10=n(b10)-1|0,o10=0;if(i10>=0)for(var d10=o10;;){9>=_(b10,d10)+lr>>>0&&h10[1]++;var r10=d10+1|0;if(i10===d10)break;d10=r10}var j10=h10[1],k10=C(n(b10)+((j10-1|0)/3|0)|0),l10=[0,0];function e10(a11){at(k10,l10[1],a11),l10[1]++}var f10=[0,((j10-1|0)%3|0)+1|0],m10=n(b10)-1|0,p10=0;if(m10>=0)for(var c10=p10;;){var g10=_(b10,c10);9>>0||(f10[1]===0&&(e10(95),f10[1]=3),f10[1]--),e10(g10);var q10=c10+1|0;if(m10===c10)break;c10=q10}return $(k10)}function pK(a10,b10){return c9(a10,ec(oR(a10),b10))}function pL(a10,b10){return c9(a10,ec(ph(a10),b10))}function pM(a10,b10){return c9(a10,ec(pv(a10),b10))}function pN(a10,b10){return c9(a10,Bw(o5(a10),b10))}function aQ(d10,b10,c10){function a10(a11){switch(d10[1]){case 0:var e11=45;break;case 1:var e11=43;break;default:var e11=32}return Br(c10,b10,e11)}function e10(a11){var b11=Ba(c10);return b11===3?c10<0?pP:pQ:4<=b11?pR:a11}function f10(b11){var e11=n(b11);return function(a11){for(var c11=a11;;){if(c11===e11)return 0;var d11=D(b11,c11)-46|0;a:{if(23>>0){if(d11===55)break a}else if(21>>0)break a;c11=c11+1|0;continue}return 1}}(0)?b11:aO(b11,pO)}switch(d10[2]){case 5:return e10(f10(gK(hz(d10,b10),c10)));case 6:return a10(0);case 7:return ns(a10(0));case 8:return e10(a10(0));default:return gK(hz(d10,b10),c10)}}function pS(a10){var b10=mL(a10),c10=n(b10),d10=bn(c10+2|0,39);return cT(b10,0,d10,1,c10),$(d10)}function pT(a10){var b10=hv(16);return eK(b10,a10),hx(b10)}function cJ(a10,b10,c10,d10){for(var k10=b10,j10=c10,e10=d10;;){if(typeof e10=="number")return h(k10,j10);switch(e10[0]){case 0:var t10=e10[1];return function(a11){return o(k10,[5,j10,a11],t10)};case 1:var u10=e10[1];return function(a11){return o(k10,[4,j10,pS(a11)],u10)};case 2:return eL(k10,j10,e10[2],e10[1],function(a11){return a11});case 3:return eL(k10,j10,e10[2],e10[1],oQ);case 4:return c_(k10,j10,e10[4],e10[2],e10[3],pK,e10[1]);case 5:return c_(k10,j10,e10[4],e10[2],e10[3],pL,e10[1]);case 6:return c_(k10,j10,e10[4],e10[2],e10[3],pM,e10[1]);case 7:return c_(k10,j10,e10[4],e10[2],e10[3],pN,e10[1]);case 8:return pU(k10,j10,e10[4],e10[2],e10[3],e10[1]);case 9:return eL(k10,j10,e10[2],e10[1],mp);case 10:j10=[7,j10],e10=e10[1];break;case 11:j10=[2,j10,e10[1]],e10=e10[2];break;case 12:j10=[3,j10,e10[1]],e10=e10[2];break;case 13:var v10=e10[3],w10=pT(e10[2]);return function(a11){return o(k10,[4,j10,w10],v10)};case 14:var y10=e10[3],z10=e10[2];return function(a11){return o(k10,j10,x(oP(a11[1],z10),y10))};case 15:var A10=e10[1];return function(c11,b11){return o(k10,[6,j10,function(a11){return i(c11,a11,b11)}],A10)};case 16:var B10=e10[1];return function(a11){return o(k10,[6,j10,a11],B10)};case 17:j10=[0,j10,e10[1]],e10=e10[2];break;case 18:var l10=e10[1];if(l10[0]===0){let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[0,a11]],d11)},j10=0,e10=l10[1][1]}else{let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[1,a11]],d11)},j10=0,e10=l10[1][1]}break;case 19:throw g([0,f,pW],1);case 20:var C2=e10[3],D2=[8,j10,pX];return function(a11){return o(k10,D2,C2)};case 21:var E2=e10[2];return function(a11){return o(k10,[4,j10,ec(kw,a11)],E2)};case 22:var F2=e10[1];return function(a11){return o(k10,[5,j10,a11],F2)};case 23:var m10=e10[2],n10=e10[1];return a10<50?j1(a10+1|0,k10,j10,n10,m10):r(j1,[0,k10,j10,n10,m10]);default:var p10=e10[3],q10=e10[1],s10=h(e10[2],0);return a10<50?f2(a10+1|0,k10,j10,p10,q10,s10):r(f2,[0,k10,j10,p10,q10,s10])}}}function o(a10,b10,c10){return bM(cJ(0,a10,b10,c10))}function j1(a10,b10,c10,d10,e10){if(typeof d10=="number")switch(d10){case 0:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 1:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 2:throw g([0,f,pY],1);default:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10])}switch(d10[0]){case 0:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 1:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 2:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 3:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 4:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 5:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 6:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 7:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 8:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 9:var h10=d10[2];return a10<50?f3(a10+1|0,b10,c10,h10,e10):r(f3,[0,b10,c10,h10,e10]);case 10:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);default:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10])}}function f3(a10,h10,c10,d10,e10){if(typeof d10=="number")return a10<50?t(a10+1|0,h10,c10,e10):r(t,[0,h10,c10,e10]);switch(d10[0]){case 0:var b10=d10[1];return function(a11){return aj(h10,c10,b10,e10)};case 1:var i10=d10[1];return function(a11){return aj(h10,c10,i10,e10)};case 2:var j10=d10[1];return function(a11){return aj(h10,c10,j10,e10)};case 3:var k10=d10[1];return function(a11){return aj(h10,c10,k10,e10)};case 4:var l10=d10[1];return function(a11){return aj(h10,c10,l10,e10)};case 5:var m10=d10[1];return function(a11){return aj(h10,c10,m10,e10)};case 6:var n10=d10[1];return function(a11){return aj(h10,c10,n10,e10)};case 7:var o10=d10[1];return function(a11){return aj(h10,c10,o10,e10)};case 8:var p10=d10[2];return function(a11){return aj(h10,c10,p10,e10)};case 9:var q10=d10[3],s10=d10[2],u10=I(E(d10[1]),s10);return function(a11){return aj(h10,c10,X(u10,q10),e10)};case 10:var v10=d10[1];return function(a11,b11){return aj(h10,c10,v10,e10)};case 11:var w10=d10[1];return function(a11){return aj(h10,c10,w10,e10)};case 12:var x10=d10[1];return function(a11){return aj(h10,c10,x10,e10)};case 13:throw g([0,f,pZ],1);default:throw g([0,f,p0],1)}}function aj(a10,b10,c10,d10){return bM(f3(0,a10,b10,c10,d10))}function t(a10,b10,c10,d10){var e10=[8,c10,p1];return a10<50?cJ(a10+1|0,b10,e10,d10):r(cJ,[0,b10,e10,d10])}function eL(g10,f10,c10,d10,e10){if(typeof d10=="number")return function(a10){return o(g10,[4,f10,h(e10,a10)],c10)};if(d10[0]===0){var b10=d10[2],i10=d10[1];return function(a10){return o(g10,[4,f10,ad(i10,b10,h(e10,a10))],c10)}}var j10=d10[1];return function(a10,b11){return o(g10,[4,f10,ad(j10,a10,h(e10,b11))],c10)}}function c_(k10,j10,h10,d10,e10,f10,g10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,bS(a10,i(f10,g10,b11))],h10)}:function(a10){return o(k10,[4,j10,i(f10,g10,a10)],h10)};var b10=e10[1];return function(a10){return o(k10,[4,j10,bS(b10,i(f10,g10,a10))],h10)}}if(d10[0]===0){var c10=d10[2],l10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,ad(l10,c10,bS(a10,i(f10,g10,b11)))],h10)}:function(a10){return o(k10,[4,j10,ad(l10,c10,i(f10,g10,a10))],h10)};var n10=e10[1];return function(a10){return o(k10,[4,j10,ad(l10,c10,bS(n10,i(f10,g10,a10)))],h10)}}var m10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(k10,[4,j10,ad(m10,a10,bS(b11,i(f10,g10,c11)))],h10)}:function(a10,b11){return o(k10,[4,j10,ad(m10,a10,i(f10,g10,b11))],h10)};var p10=e10[1];return function(a10,b11){return o(k10,[4,j10,ad(m10,a10,bS(p10,i(f10,g10,b11)))],h10)}}function pU(i10,h10,g10,d10,e10,f10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,aQ(f10,a10,b11)],g10)}:function(a10){return o(i10,[4,h10,aQ(f10,eJ(f10),a10)],g10)};var b10=e10[1];return function(a10){return o(i10,[4,h10,aQ(f10,b10,a10)],g10)}}if(d10[0]===0){var c10=d10[2],j10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,ad(j10,c10,aQ(f10,a10,b11))],g10)}:function(a10){return o(i10,[4,h10,ad(j10,c10,aQ(f10,eJ(f10),a10))],g10)};var l10=e10[1];return function(a10){return o(i10,[4,h10,ad(j10,c10,aQ(f10,l10,a10))],g10)}}var k10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(i10,[4,h10,ad(k10,a10,aQ(f10,b11,c11))],g10)}:function(a10,b11){return o(i10,[4,h10,ad(k10,a10,aQ(f10,eJ(f10),b11))],g10)};var m10=e10[1];return function(a10,b11){return o(i10,[4,h10,ad(k10,a10,aQ(f10,m10,b11))],g10)}}function f2(a10,b10,c10,d10,e10,f10){if(e10){var i10=e10[1];return function(a11){return pV(b10,c10,d10,i10,h(f10,a11))}}var g10=[4,c10,f10];return a10<50?cJ(a10+1|0,b10,g10,d10):r(cJ,[0,b10,g10,d10])}function pV(a10,b10,c10,d10,e10){return bM(f2(0,a10,b10,c10,d10,e10))}function aR(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=hy(c10[2]);return aR(a10,f10),ce(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aR(a10,e10),ce(a10,p2),c10=i10}else{var j10=d10[1];aR(a10,e10),ce(a10,p3),c10=j10}break;case 6:var m10=c10[2];return aR(a10,c10[1]),h(m10,a10);case 7:return aR(a10,c10[1]),cf(a10);case 8:var n10=c10[2];return aR(a10,c10[1]),s(n10);case 2:case 4:var k10=c10[2];return aR(a10,c10[1]),ce(a10,k10);default:var l10=c10[2];return aR(a10,c10[1]),mA(a10,l10)}}}function aS(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=hy(c10[2]);return aS(a10,f10),cp(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aS(a10,e10),cp(a10,p4),c10=i10}else{var j10=d10[1];aS(a10,e10),cp(a10,p5),c10=j10}break;case 6:var m10=c10[2];return aS(a10,c10[1]),cp(a10,h(m10,0));case 7:c10=c10[1];break;case 8:var n10=c10[2];return aS(a10,c10[1]),s(n10);case 2:case 4:var k10=c10[2];return aS(a10,c10[1]),cp(a10,k10);default:var l10=c10[2];return aS(a10,c10[1]),nX(a10,l10)}}}function p6(a10){var c10=a10[1],b10=bo(cM);return o(function(a11){return aS(b10,a11),a7(co(b10))},0,c10)}function p7(c10){if(c10==e)return p8;var f10=n(c10);function j10(a11){return h(p6(p9),c10)}function k10(a11){for(var b11=a11;;){if(b11===f10)return b11;var d11=D(c10,b11);if(d11!==9&&d11!==32)return b11;b11=b11+1|0}}var i10=k10(0),o10=function(a11,b11){for(var d11=b11;;){if(d11===f10||25>>0)return d11;d11=d11+1|0}}(i10,i10),a10=ex(c10,i10,o10-i10|0),d10=k10(o10),l10=function(a11,b11){for(var d11=b11;;){if(d11===f10)return d11;var e10=D(c10,d11);a:{if(48<=e10){if(58>e10)break a}else if(e10===45)break a;return d11}d11=d11+1|0}}(d10,d10);if(d10===l10)var m10=0;else try{var r10=l4(ex(c10,d10,l10-d10|0)),m10=r10}catch(f11){var p10=M(f11);if(p10[1]!==cc)throw g(p10,0);var q10=j10(0),m10=q10}k10(l10)!==f10&&j10(0);a:{if(a10!==e&&a10!==j_){if(a10==="h"){var b10=0;break a}if(a10==="hov"){var b10=3;break a}if(a10==="hv"){var b10=2;break a}if(a10!=="v"){var b10=j10(0);break a}var b10=1;break a}var b10=4}return[0,m10,b10]}function p_(d10,b10,c10){return o(function(a10){return aR(b10,a10),h(d10,b10)},0,c10[1])}function c$(a10,b10){return p_(function(a11){return 0},a10,b10)}function eM(a10){return c$(ai,a10)}function eN(c10,b10){return o(function(a10){var b11=bo(64);return aS(b11,a10),h(c10,co(b11))},0,b10[1])}function A(a10){return eN(function(a11){return a11},a10)}var eO=ci(0);function eQ(a10,b10){var c10=a10[1+b10];return mB(c10)?aN(c10)===d3?h(A(p$),c10):aN(c10)===kG?mv(c10):qa:h(A(qb),c10)}function hA(a10,b10){if(a10.length-1<=b10)return qc;var c10=hA(a10,b10+1|0),d10=eQ(a10,b10);return i(A(qd),d10,c10)}function qe(a10){var b10=a10.length-1;if(2>=b10>>>0)switch(b10){case 0:return qg;case 1:return qh;default:var e10=eQ(a10,1);return h(A(qi),e10)}var c10=hA(a10,2),d10=eQ(a10,1);return i(A(qf),d10,c10)}function qj(d10){return function(a10){for(var b10=a10;;){if(!b10)return 0;var e10=b10[2],f10=b10[1];a:{try{var c10=h(f10,d10)}catch{break a}if(c10)return[0,c10[1]]}b10=e10}}(ch(eO))}function qk(a10){if(aN(a10)!==0)return[0,a10[1],0];var b10=a10[1][1];return[0,b10,[0,qe(a10)]]}function ql(a10){var b10=qk(a10),c10=b10[2],d10=b10[1];return c10?aO(d10,c10[1]):d10}function qm(a10){if(a10===em)return qn;if(a10===g5)return qo;if(a10[1]===g4){var b10=a10[2],e10=b10[3],i10=b10[2],j10=b10[1];return f6(A(eP),j10,i10,e10,e10+5|0,qp)}if(a10[1]===f){var c10=a10[2],g10=c10[3],k10=c10[2],l10=c10[1];return f6(A(eP),l10,k10,g10,g10+6|0,qq)}if(a10[1]!==cd)return ql(a10);var d10=a10[2],h10=d10[3],m10=d10[2],n10=d10[1];return f6(A(eP),n10,m10,h10,h10+6|0,qr)}function da(a10){var b10=qj(a10);return b10?b10[1]:qm(a10)}function qs(a10){var b10=[0,Bb(a10)];return b10}function qt(c10,b10){function a10(a11){return a11?c10===0?qu:qv:c10===0?qw:qx}if(b10[0]!==0){if(b10[1])return 0;var p10=a10(0);return[0,h(A(qD),p10)]}if(b10[3]===b10[6])var e10=b10[3],d10=h(A(qy),e10);else var n10=b10[6],o10=b10[3],d10=i(A(qC),o10,n10);var f10=b10[7],g10=b10[4],j10=b10[8]?qz:qB,k10=b10[2],l10=b10[9],m10=a10(b10[1]);return[0,AY(A(qA),m10,l10,k10,j10,d10,g10,f10)]}function qE(a10,b10){if(!b10)return c$(a10,qG);var d10=b10[1],e10=d10.length-2|0,g10=0;if(e10>=0)for(var c10=g10;;){var f10=qt(c10,j(d10,c10)[1+c10]);if(f10){var i10=f10[1];h(c$(a10,qF),i10)}var k10=c10+1|0;if(e10===c10)break;c10=k10}return 0}function db(a10,b10){return qE(a10,qs(b10))}var qJ=qI.slice();function qK(a10,b10){var e10=da(a10);h(eM(qL),e10),db(ai,b10);var c10=BQ(0);if(c10<0){var d10=c2(c10);g9(j(qJ,d10)[1+d10])}return cf(ai)}var qM=[0];function hB(a10){var b10=lU(0);return b10}function qN(a10,b10){try{var d10=b10?qM:hB(0);try{ep(0)}catch{}try{var f10=qK(a10,d10),e10=f10}catch(f11){var i10=M(f11),j10=hB(0),k10=da(a10);h(eM(qP),k10),db(ai,d10);var l10=da(i10);h(eM(qQ),l10),db(ai,j10);var e10=cf(ai)}return e10}catch(f11){var c10=M(f11);if(c10===em)return g9(qO);throw g(c10,0)}}g0(lz,function(a10,b10){try{var c10=qN(a10,b10);return c10}catch{return 0}});function qH(a10){for(;;){var b10=ch(eO),c10=1-g$(eO,b10,[0,a10,b10]);if(!c10)return c10}}function qR(a10){return lU(a10)}var qT=[q,qS,ag(0)];qH(function(a10){return a10[1]===qT?[0,aO(qU,da(a10[2]))]:0});function eR(a10){var b10=a10[1]<1?1:0,c10=b10||(64=0)for(var c10=i10;;){nl(d10,c10*8|0,cY(j(b10,c10)[1+c10]));var n10=c10+1|0;if(f10===c10)break;c10=n10}at(d10,e10*8|0,1);var g10=hC(d10);at(d10,e10*8|0,2);var h10=hC(d10),k10=c6(h10,8),l10=c6(h10,0),m10=c6(g10,8);return hE(a10,c6(g10,0),m10,l10,k10)}function q4(a10){var b10=hD(0);return q3(b10,a10),b10}function hG(a10){return q4(B5(0))}function bT(a10){return l8(a10)}function q5(a10){return l2(l8(a10))&1073741823}aP([0,function(a10){var b10=bT(a10),c10=bT(a10),d10=bT(a10);return hF(b10,c10,d10,bT(a10))}],function(a10){return hF(q9,q8,q7,q6)});function q_(a10){var b10=a10.length-1<4?1:0,c10=b10||(a10[4]<0?1:0);return c10}try{var AW=mh(lu),hK=AW}catch(f10){var hH=M(f10);if(hH!==aD)throw g(hH,0);try{var AV=mh("CAMLRUNPARAM"),hJ=AV}catch(f11){var hI=M(f11);if(hI!==aD)throw g(hI,0);var hJ=q$}var hK=hJ}var ra=ci(nr(hK,82)),rb=aP(0,hG);function rc(a10,b10){for(var c10=a10;;){if(b10<=c10||eq2<(c10*2|0))return c10;c10=c10*2|0}}function hL(a10,b10){var d10=a10?a10[1]:ch(ra),c10=rc(16,b10),e10=d10?q5(a_(rb)):0;return[0,0,ap(c10,0),e10,c10]}function rd(m10,b10,c10,d10){var g10=d10.length-1,f10=ap(g10,0),i10=c10.length-2|0;function n10(a11){for(var c11=a11;;){if(!c11)return;var i11=c11[1],l11=c11[2],n11=c11[3],g11=b10?c11:[0,i11,l11,0],e11=h(m10,i11),k11=j(f10,e11)[1+e11];k11?k11[3]=g11:j(d10,e11)[1+e11]=g11,j(f10,e11)[1+e11]=g11,c11=n11}}var o10=0;if(i10>=0)for(var e10=o10;;){n10(j(c10,e10)[1+e10]);var r10=e10+1|0;if(i10===e10)break;e10=r10}if(b10){var k10=g10-1|0,p10=0;if(k10>=0)for(var a10=p10;;){var l10=j(f10,a10)[1+a10];l10&&(l10[3]=0);var q10=a10+1|0;if(k10===a10)break;a10=q10}}}function re(a10,b10){var c10=b10[2],d10=(c10.length-1)*2|0,e10=d10>>0))return hS(a10,d10)}function ro(a10){var b10=nS(a10[28]);if(b10){var c10=b10[1],d10=c10[1];a10[12]=a10[12]-c10[3]|0;var e10=d10;a10[9]=a10[9]+e10|0}}function rp(a10,b10,c10){if(typeof c10=="number")switch(c10){case 0:var j10=bQ(a10[3]);if(!j10)return;var k10=j10[1][1],l10=function(a11,b11){if(!b11)return[0,a11,0];var c11=b11[1],d11=b11[2];return BK(a11,c11)?[0,a11,b11]:[0,c11,l10(a11,d11)]};k10[1]=l10(a10[6]-a10[9]|0,k10[1]);return;case 1:bP(a10[2]);return;case 2:bP(a10[3]);return;case 3:var m10=bQ(a10[2]);return m10?hS(a10,m10[1][2]):dd(a10);case 4:var o10=a10[10]!==(a10[6]-a10[9]|0)?1:0;return o10&&ro(a10);default:var p10=bP(a10[5]);return p10?eT(a10,h(a10[25],p10[1])):void 0}switch(c10[0]){case 0:return hR(a10,b10,c10[1]);case 1:var d10=c10[2],f10=c10[1],q10=d10[1],z10=d10[2],r10=bQ(a10[2]);if(!r10)return;var s10=r10[1],e10=s10[2];switch(s10[1]){case 0:return bU(a10,f10);case 1:return bp(a10,d10,e10);case 2:return bp(a10,d10,e10);case 3:return a10[9]<(b10+n(q10)|0)?bp(a10,d10,e10):bU(a10,f10);case 4:return a10[11]?bU(a10,f10):a10[9]<(b10+n(q10)|0)||((a10[6]-e10|0)+z10|0)=a10[14])return a10[13]=hQ,hT(a10),b10&&dd(a10),rB(a10);hY(a10,0)}}function eW(a10,b10,c10){var d10=a10[14]=c10)return y(a10[17],h4,0,c10);y(a10[17],h4,0,80),c10=c10-80|0}}function rN(a10){return a10[1]===cs?aO(rP,aO(a10[2],rO)):rQ}function rR(a10){return a10[1]===cs?aO(rT,aO(a10[2],rS)):rU}function rV(a10){return 0}function rW(a10){return 0}function eY(a10,b10,c10,d10,e10){var g10=eC(0),h10=[0,hO,rX,0];eE(h10,g10);var f10=bO(0);eU(f10),a9([0,1,h10],f10);var i10=78,j10=bO(0),k10=bO(0),l10=bO(0);return[0,f10,bO(0),l10,k10,j10,i10,10,68,i10,0,1,1,1,1,g7,rY,a10,b10,c10,d10,e10,0,0,rN,rR,rV,rW,g10]}function h5(a10,b10){var c10=eY(a10,b10,function(a11){return 0},function(a11){return 0},function(a11){return 0});return c10[19]=function(a11){return eX(c10,a11)},c10[20]=function(a11){return bV(c10,a11)},c10[21]=function(a11){return bV(c10,a11)},c10}function h6(d10){return h5(function(a10,b10,c10){return g8(d10,a10,b10,c10)},function(a10){return cf(d10)})}function df(d10){return h5(function(a10,b10,c10){return ho(d10,a10,b10,c10)},function(a10){return 0})}var eZ=dW;function h7(a10){return bo(eZ)}var h8=h7(0),e0=h6(en),e1=h6(ai),rZ=df(h8),h9=aP(0,h7);cq(h9,h8),cq(aP(0,function(a10){return df(a_(h9))}),rZ);function dg(a10,b10,c10,d10){return ho(a_(a10),b10,c10,d10)}function dh(a10,b10,c10){var d10=a_(b10),e10=hn(d10);return g8(a10,co(d10),0,e10),cf(a10),nV(d10)}var di=aP(0,function(a10){return bo(eZ)}),dj=aP(0,function(a10){return bo(eZ)}),h_=aP(0,function(a10){var b10=eY(function(a11,b11,c10){return dg(di,a11,b11,c10)},function(a11){return dh(en,di,a11)},function(a11){return 0},function(a11){return 0},function(a11){return 0});return b10[19]=function(a11){return eX(b10,a11)},b10[20]=function(a11){return bV(b10,a11)},b10[21]=function(a11){return bV(b10,a11)},hu(function(a11){return a$(b10,a11)}),b10});cq(h_,e0);var h$=aP(0,function(a10){var b10=eY(function(a11,b11,c10){return dg(dj,a11,b11,c10)},function(a11){return dh(ai,dj,a11)},function(a11){return 0},function(a11){return 0},function(a11){return 0});return b10[19]=function(a11){return eX(b10,a11)},b10[20]=function(a11){return bV(b10,a11)},b10[21]=function(a11){return bV(b10,a11)},hu(function(a11){return a$(b10,a11)}),b10});cq(h$,e1);function rx(a10,b10){a10[22]&&(a9(b10,a10[4]),h(a10[26],b10));var c10=a10[23];return c10&&ct(a10,[0,dc,[5,b10],0])}function rD(a10,b10){return h1(a10,n(b10),b10)}function rE(a10,b10){return h0(a10,1),h(a10[18],0)}function rF(a10,b10){var c10=a10[14]=0)for(var c10=g10;;){r4(e10,c10,a10,j(b10,c10)[1+c10]);var h10=c10+1|0;if(f10===c10)break;c10=h10}return e10}function id2(a10,b10){return typeof b10!="number"&&b10[0]===0?ic(a10,b10[1]):a7(r5)}function r6(a10,b10,c10,d10){if(typeof c10!="number")return c10[0]===0?ie(c10[1],a10[1+b10],d10):void 0;if(c10!==2){a10[1+b10]=d10;return}if(aN(d10)===0&&d10.length-1===4)for(var e10=0,h10=a10[1+b10];;){h10[1+e10]=d10[1+e10];var i10=e10+1|0;if(e10===3)return;e10=i10}throw g([0,f,r7],1)}function ie(a10,b10,c10){if(aN(c10)===0&&a10.length-1<=c10.length-1){var e10=a10.length-2|0,h10=0;if(e10>=0)for(var d10=h10;;){var i10=c10[1+d10];r6(b10,d10,j(a10,d10)[1+d10],i10);var k10=d10+1|0;if(e10===d10)break;d10=k10}return}throw g([0,f,r8],1)}function ig(a10,b10,c10){return typeof a10!="number"&&a10[0]===0?ie(a10[1],b10,c10):a7(r9)}var e2=[q,r_,ag(0)];r2(r$,[0,e2,[0]]);function e3(a10){return[0,a10]}function R(a10){return[0,a10]}function dk(a10){return a10[0]===0?[0,a10[1]]:0}var bW=[0,function(a10){return a10}(0)];function bX(a10){return[1,0,0,0,a10]}function k(a10,b10){return a10[0]===0?[0,h(b10,a10[1])]:bX([0,a10,b10])}function bY(a10,b10,c10){if(a10[0]===0){var d10=a10[1];if(b10[0]===0)return[0,i(c10,d10,b10[1])]}return bX([1,a10,b10,c10])}function ih(a10){return a10[0]===0?a10[1]:bX([4,a10,0])}function ii(a10,b10,c10){switch(c10[0]){case 0:throw g([0,f,sc],1);case 1:c10[3]=[0,b10,a10,c10[3]];return;default:c10[2]=[0,b10,a10,c10[2]];return}}function e4(a10,b10){if(!b10)throw g([0,f,sd],1);if(b10[2]===a10)return[0,b10[1],b10[3]];var c10=e4(a10,b10[3]),d10=c10[1];return b10[3]=c10[2],[0,d10,b10]}function cv(a10,b10){switch(b10[0]){case 0:throw g([0,f,se],1);case 1:var c10=e4(a10,b10[3]),e10=c10[1];return b10[3]=c10[2],e10;default:var d10=e4(a10,b10[2]),h10=d10[1];return b10[2]=d10[2],h10}}function ij(a10,b10,c10,d10){for(var e10=d10;;){if(!e10)throw g([0,f,sf],1);if(e10[1]===b10&&e10[2]===a10){e10[1]=c10;return}e10=e10[3]}}function e5(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,sg],1);case 1:return ij(a10,b10,c10,d10[3]);default:return ij(a10,b10,c10,d10[2])}}function ik(a10,b10){for(var c10=b10;;){if(!c10)throw g([0,f,sh],1);if(c10[2]===a10)return c10[1];c10=c10[3]}}function si(a10,b10){switch(b10[0]){case 0:throw g([0,f,sj],1);case 1:return ik(a10,b10[3]);default:return ik(a10,b10[2])}}function aY(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,sk],1);case 1:var j10=d10[1];if(typeof j10=="number"&&!j10){if(!c10||b10[1])return;b10[1]=1;return}var k10=d10[4];if(k10[0]===7){var n10=k10[2];if(n10[0]===1){var o10=n10[1];if(typeof o10=="number"){if(!o10&&c10){if(b10[1])return;b10[1]=1;return}}else if(c10)return}}var l10=d10[1];a:{if(typeof l10=="number"&&l10){var e10=1;break a}var e10=c10}d10[1]=0;var m10=d10[2];return a10<50?j2(a10+1|0,b10,e10,m10):r(j2,[0,b10,e10,m10]);default:var i10=d10[1];if(d10[1]=0,typeof i10=="number"){if(!i10)return;b10[1]=2;return}var p10=i10[1];return c10&&(b10[1]=2),h(d10[3],p10)}}function ba(a10,b10,c10){return bM(aY(0,a10,b10,c10))}function j2(a10,b10,c10,d10){if(typeof d10!="number")switch(d10[0]){case 0:var f10=d10[1];return a10<50?aY(a10+1|0,b10,c10,f10):r(aY,[0,b10,c10,f10]);case 1:var g10=d10[2];return ba(b10,c10,d10[1]),a10<50?aY(a10+1|0,b10,c10,g10):r(aY,[0,b10,c10,g10]);case 2:var h10=d10[3],l10=d10[2];return ba(b10,c10,d10[1]),ba(b10,c10,l10),a10<50?aY(a10+1|0,b10,c10,h10):r(aY,[0,b10,c10,h10]);case 3:var i10=d10[4],m10=d10[3],n10=d10[2];return ba(b10,c10,d10[1]),ba(b10,c10,n10),ba(b10,c10,m10),a10<50?aY(a10+1|0,b10,c10,i10):r(aY,[0,b10,c10,i10]);default:var o10=d10[1];d10[1]=0;var k10=o10-1|0,p10=0;if(k10>=0)for(var e10=p10;;){ba(b10,c10,j(d10[3],e10)[1+e10]);var q10=e10+1|0;if(k10===e10)break;e10=q10}return}}function sl(a10){return i(c$(ai,sm),db,Bk(20))}function dl(a10,b10){var c10=[0,0];ba(c10,a10,b10);var d10=2<=c10[1]?1:0;return d10&&sl(0)}function ae(a10){return bX([5,a10])}function ar(a10){return a10}function ab(a10,b10){if(a10[0]===1){var c10=a10[4];if(c10[0]===5)return c10[1]=b10,dl(0,a10)}throw g([0,f,sn],1)}function bq(a10){if(a10[0]===1){var b10=a10[4];if(b10[0]===5)return b10[1]}throw g([0,f,so],1)}function bZ(a10,b10,c10){for(var k10=a10,h10=b10,d10=c10;;)switch(d10[0]){case 0:return k10;case 1:var e10=d10[2];if(typeof e10=="number")throw g([0,f,st],1);switch(e10[0]){case 0:if(e10[1]!==h10)throw g([0,f,su],1);var o10=0;break;case 1:var B10=e10[2],C2=e10[1];if(C2===h10)var D2=[0,B10];else{if(B10!==h10)throw g([0,f,sv],1);var D2=[0,C2]}var o10=D2;break;case 2:var u10=e10[3],v10=e10[2],w10=e10[1];if(w10===h10)var x10=[1,v10,u10];else if(v10===h10)var x10=[1,w10,u10];else{if(u10!==h10)throw g([0,f,sw],1);var x10=[1,w10,v10]}var o10=x10;break;case 3:var p10=e10[4],q10=e10[3],r10=e10[2],s10=e10[1];if(s10===h10)var t10=[2,r10,q10,p10];else if(r10===h10)var t10=[2,s10,q10,p10];else if(q10===h10)var t10=[2,s10,r10,p10];else{if(p10!==h10)throw g([0,f,sx],1);var t10=[2,s10,r10,q10]}var o10=t10;break;default:var n10=cv(d10,h10);if(j(e10[3],n10)[1+n10]!==h10)throw g([0,f,sy],1);var m10=e10[2]-1|0;if(e10[2]=m10,n10>>2|0))var U2=nu(e10[3],0,K2>>>1|0),L2=[4,e10[1],e10[2],U2];else var L2=e10;var J2=L2}var o10=J2}if(d10[2]=o10,typeof o10!="number")return k10;var y10=d10[1];d10[1]=1;var l10=d10[4];switch(l10[0]){case 0:h10=d10,d10=l10[1];break;case 1:var N2=l10[2];k10=bZ(k10,d10,l10[1]),h10=d10,d10=N2;break;case 2:var O2=l10[2];k10=bZ(k10,d10,l10[1]),h10=d10,d10=O2;break;case 3:var P2=l10[2];k10=bZ(k10,d10,l10[1]),h10=d10,d10=P2;break;case 4:var z10=l10[2],A10=bZ(k10,d10,l10[1]);if(!z10)return A10;var Q2=z10[1];l10[2]=0,k10=A10,h10=d10,d10=Q2;break;case 5:return k10;case 6:if(typeof y10=="number")return k10;var R2=y10[1];try{return i(l10[2],d10,R2),k10}catch(f10){var S2=M(f10);return[0,[0,S2,qR(0)],k10]}default:var T2=l10[1];k10=bZ(k10,d10,l10[2]),h10=d10,d10=T2}break;default:throw g([0,f,sz],1)}}function bb(a10,b10){for(var e10=a10,c10=b10;;)switch(c10[0]){case 0:return;case 1:var n10=typeof c10[2]=="number"?1:0,d10=c10[2];if(typeof d10=="number")var k10=[0,e10];else switch(d10[0]){case 0:var k10=[1,e10,d10[1]];break;case 1:var k10=[2,e10,d10[1],d10[2]];break;case 2:var k10=[3,e10,d10[1],d10[2],d10[3]];break;case 3:for(var o10=[0,d10[1],d10[2],d10[3],d10[4],e10,bW,bW,bW],l10=0;;){ii(c10,l10,j(o10,l10)[1+l10]);var w10=l10+1|0;if(l10===4)break;l10=w10}var k10=[4,5,5,o10];break;default:var i10=d10[2];if(i10>>1|0)}function is(a10,b10,c10){if(typeof a10!="number"){if(a10[0]!==0){if(a10[2]!==b10)throw g([0,f,s9],1);a10[2]=c10;return}if(a10[2]===b10){a10[2]=c10;return}if(a10[4]===b10){a10[4]=c10;return}}throw g([0,f,s8],1)}function f5(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[2];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,tb],1);e10[5]=c10;var i10=e10}return d10[2]=c10,c10[4]=i10,c10[5]=d10,d10[5]=h10,is(h10,c10,d10),fb(b10,c10),a10<50?cK(a10+1|0,b10,d10):r(cK,[0,b10,d10])}}throw g([0,f,ta],1)}function s_(a10,b10){return bM(f5(0,a10,b10))}function f4(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[4];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,td],1);e10[5]=c10;var i10=e10}return d10[4]=c10,c10[2]=i10,c10[5]=d10,d10[5]=h10,is(h10,c10,d10),fb(b10,c10),a10<50?cK(a10+1|0,b10,d10):r(cK,[0,b10,d10])}}throw g([0,f,tc],1)}function s$(a10,b10){return bM(f4(0,a10,b10))}function j4(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];a:if(typeof d10!="number"&&d10[0]===0){var e10=b1(d10[2]);if(fa(b1(d10[4]),e10)){s$(b10,d10);break a}}return a10<50?f5(a10+1|0,b10,c10):r(f5,[0,b10,c10])}throw g([0,f,te],1)}function j3(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];a:if(typeof d10!="number"&&d10[0]===0){var e10=b1(d10[4]);if(fa(b1(d10[2]),e10)){s_(b10,d10);break a}}return a10<50?f4(a10+1|0,b10,c10):r(f4,[0,b10,c10])}throw g([0,f,tf],1)}function cK(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=b1(c10[2]),e10=b1(c10[4]);return d10>>2|0)}function aE(a10,b10){if(typeof a10=="number")var c10=b10;else{if(typeof b10!="number"){var d10=dq(b10);return[1,(ix(dq(a10),d10)+1|0)<<2,a10,b10]}var c10=a10}return c10}function iy(a10){return typeof a10=="number"?0:a10[0]===0?[0,a10[2]]:[1,a10[2],a10[3]]}var fc=1,fd=2,tL=3;function iz(a10){return a10===-1?1:0}function fe(a10){return a10!==-1?1:0}function b2(a10){return(a10&3)===3?1:0}function iA(a10){return(a10&3)===1?1:0}function iB(a10){return(a10&3)===2?1:0}function iC(a10){return a10|3}function tM(a10){return a10>>>2|0}function iD(a10){return a10<<2|2}function cz(a10){return a10&mo(tL)}function iE(a10){return a10[2]}function iF(a10){return a10[3]}function iG(a10){return[0,0,0,0]}function dr(a10){a10[1]=a10[1]+1|0}function ds(a10){a10[2]=a10[2]+1|0}function dt(a10){a10[3]=a10[3]+1|0}function ff(a10,b10,c10){for(var d10=c10;;){if(typeof d10=="number")return;if(d10[0]===0){var e10=d10[1],i10=(e10&3)!==3?1:0,l10=i10&&(e10&3?1:0);if(l10){if(e10&b10)throw g([0,f,tO],1);dr(a10),dt(a10),d10[1]=e10|3}return}var h10=d10[1],j10=(h10&3)!==3?1:0,k10=j10&&(h10&3?1:0);if(!k10)return k10;if(h10&b10)throw g([0,f,tP],1);dr(a10),dt(a10),d10[1]=h10|3,ff(a10,b10,d10[2]),d10=d10[3]}}function du(a10,b10,c10,d10){if(typeof d10!="number"){if(d10[0]===0){var e10=d10[1];e10&c10||(dr(a10),e10&3?(d10[1]=-1,dt(a10),ds(a10)):d10[1]=e10|c10);var g10=e10!==-1?1:0,h10=g10&&((e10&3)===3?1:0);return h10&&(d10[1]=-1,ds(a10))}var f10=d10[1];f10&c10||(dr(a10),f10&3?(d10[1]=-1,dt(a10),ds(a10),ff(a10,c10,d10[2]),ff(a10,c10,d10[3])):(d10[1]=f10|c10,eE(d10,b10)));var i10=f10!==-1?1:0,j10=i10&&((f10&3)===3?1:0);return j10&&(d10[1]=-1,ds(a10))}}function fg(a10,b10,c10){var d10=hm(b10);if(typeof d10!="number"&&d10[0]===1){var e10=(d10[1]&3)===c10?1:0;return e10&&(du(a10,b10,c10,d10[2]),du(a10,b10,c10,d10[3]))}throw g([0,f,tQ],1)}function iH(a10,b10,c10){for(;;){if(eF(b10))return;fg(a10,b10,c10)}}function tR(a10,b10,c10,d10){for(;;){if(eF(c10))return iH(b10,d10,fd);if(eF(d10))return iH(a10,c10,fc);fg(a10,c10,fc),fg(b10,d10,fd)}}function fh(a10){var b10=a10[6];return a10[6]=b10+1|0,b10}function fi(a10){for(var b10=a10;;){if(typeof b10=="number")return;if(b10[0]===0){var c10=b10[1];if(typeof c10!="number"&&c10[0]===0){var e10=c10[1],i10=fe(e10),l10=i10&&b2(e10);l10&&(c10[1]=cz(e10));return}throw g([0,f,tW],1)}var d10=b10[1];if(typeof d10!="number"&&d10[0]===1){var h10=d10[1],m10=b10[4],n10=b10[3],j10=fe(h10),k10=j10&&b2(h10);if(!k10)return k10;d10[1]=cz(h10),fi(n10),b10=m10;continue}throw g([0,f,tX],1)}}function iI(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;if(c10[0]===0){var d10=c10[1];if(typeof d10!="number"&&d10[0]===0){var e10=d10[1],u10=c10[2];if(!iA(e10)){if(iz(e10)){var k10=fh(a10);j(a10[4],k10)[1+k10]=d10,j(a10[5],k10)[1+k10]=[0,c10,0],d10[1]=iD(k10);return}if(iB(e10)){var n10=tM(e10),v10=[0,c10,j(a10[5],n10)[1+n10]];j(a10[5],n10)[1+n10]=v10;return}var q10=b2(e10);if(q10)throw g([0,f,t0],1);return q10}var m10=a10[2];if(-1a10[3]))throw g([0,f,tZ],1);d10[1]=cz(e10);return}throw g([0,f,tY],1)}var h10=c10[1];if(typeof h10!="number"&&h10[0]===1){var r10=c10[4],s10=c10[3],i10=h10[1],w10=c10[2];if(iz(i10)){var l10=fh(a10);return j(a10[4],l10)[1+l10]=h10,j(a10[5],l10)[1+l10]=[0,c10,0],h10[1]=iD(l10),fi(s10),fi(r10)}if(!iA(i10)){if(iB(i10)){var o10=i10>>>2|0,x10=[0,c10,j(a10[5],o10)[1+o10]];j(a10[5],o10)[1+o10]=x10;return}var t10=b2(i10);if(t10)throw g([0,f,t3],1);return t10}if(-1a10[3])throw g([0,f,t2],1)}h10[1]=cz(i10),iI(a10,s10),c10=r10;continue}throw g([0,f,t1],1)}}function cA(a10,b10){if(typeof b10=="number")return 0;if(b10[0]!==0){var i10=b10[1];if(i10===-1){var l10=fh(a10);b10[1]=0,j(a10[4],l10)[1+l10]=b10;var p10=cA(a10,b10[2]);return[1,b10,0,p10,cA(a10,b10[3])]}if(!b2(i10)){b10[1]=cz(b10[1]);var r10=cA(a10,b10[2]);return[1,b10,0,r10,cA(a10,b10[3])]}var d10=i10>>>2|0,k10=j(a10[5],d10)[1+d10];if(!k10)throw g([0,f,t6],1);var m10=k10[2],q10=k10[1];return j(a10[5],d10)[1+d10]=m10,m10===0&&(b10[1]=0),q10}var e10=b10[1];if(fe(e10)&&b2(e10)){var c10=e10>>>2|0,h10=j(a10[5],c10)[1+c10];if(!h10)return[0,b10,0];var n10=h10[2],o10=h10[1];return j(a10[5],c10)[1+c10]=n10,o10}return b10[1]=0,[0,b10,0]}var fj=[0,0,[0],0,0];function tN(a10){return a10[1]}function tS(a10){return a10[1]}function tT(a10){return a10[2]}function tU(a10,b10){var c10=iG(0),d10=iG(0),e10=eC(0),f10=eC(0);return du(c10,e10,fc,a10),du(d10,f10,fd,b10),tR(c10,d10,e10,f10),[0,c10,d10]}function tV(a10){if(typeof a10!="number"){if(a10[0]===0){a10[1]=0;return}var b10=dq(a10[3]);a10[1]=(ix(dq(a10[2]),b10)+1|0)<<2}}function t4(a10){var e10=a10[6]-1|0,h10=0;if(e10>=0)for(var b10=h10;;){var c10=j(a10[4],b10)[1+b10];typeof c10!="number"&&(c10[0],c10[1]=iC(c10[1]));var d10=j(a10[5],b10)[1+b10];if(!d10)throw g([0,f,t5],1);if(d10[2]){var i10=ck(d10);j(a10[5],b10)[1+b10]=i10}var k10=b10+1|0;if(e10===b10)break;b10=k10}}function iJ(a10,b10,c10){if(typeof b10=="number"){if(typeof c10=="number")return[0,fj,0]}else if(b10[1]===c10)return[0,fj,b10];var t10=typeof b10=="number"?cy:b10[1],m10=tU(t10,c10),i10=tS(m10),n10=tT(m10),u10=iF(n10),v10=iF(i10)+u10|0,o10=tN(i10)-v10|0,w10=iE(n10),p10=iE(i10)+w10|0,x10=0,y10=ap(p10,0),z10=ap(p10,0),A10=a10?o10:-1,B10=a10?0:-1,C2=a10?ap(o10,0):[0],d10=[0,C2,B10,A10,z10,y10,x10];if(iI(d10,b10),d10[2]!==d10[3])throw g([0,f,t7],1);t4(d10);var q10=cA(d10,c10),r10=d10[6]-1|0;if(r10>=0)for(var h10=r10;;){tV(j(d10[4],h10)[1+h10]);var F2=h10-1|0;if(h10===0)break;h10=F2}if(!a10)return[0,fj,q10];var k10=[0,0],l10=[0,0],s10=d10[6]-1|0,D2=0;if(s10>=0)for(var e10=D2;;){a8(function(a11){if(typeof a11!="number")if(a11[0]===0){var b11=a11[2];if(b11)return k10[1]=[0,b11[1],k10[1]],0}else{var c11=a11[2];if(c11)return l10[1]=[0,c11[1],l10[1]],0}return 0},j(d10[5],e10)[1+e10]);var E2=e10+1|0;if(s10===e10)break;e10=E2}return[0,[0,d10[2],d10[1],k10[1],l10[1]],q10]}function t8(d10,b10){if(typeof b10=="number")return 0;function c10(a10){a:if(typeof a10!="number"){b:{if(a10[0]===0){var b11=a10[1];if(typeof b11!="number"&&b11[0]===0){var e10=a10[2];if(e10){var j10=e10[1];break b}var k10=h(d10[1],b11[2]);return a10[2]=[0,k10],k10}break a}var l10=a10[2];if(!l10){var n10=c10(a10[3]),o10=c10(a10[4]),m10=i(d10[2],n10,o10);return a10[2]=[0,m10],m10}var j10=l10[1]}return j10}throw g([0,f,t9],1)}return[0,c10(b10)]}function dv(a10,b10){return[0,[0,a10,b10],0]}function dw(a10){return t8(a10[1],a10[2])}function t_(a10,b10){var c10=a10[1];return[0,c10,iJ(0,a10[2],b10)[2]]}function fk(a10,b10){var d10=a10[1],c10=iJ(1,a10[2],b10);return[0,c10[1],[0,d10,c10[2]]]}function dx(a10,b10,c10,d10){var e10=[0,d10];if(w===a10)var h10=c10[1],g10=0;else if(ks<=a10)var h10=c10[2].length-1,g10=c10[1];else var h10=c10[2].length-1,g10=0;var k10=h10-1|0;if(k10>=g10)for(var f10=g10;;){var l10=j(c10[2],f10)[1+f10];l10&&(e10[1]=i(b10,l10[1],e10[1]));var m10=f10+1|0;if(k10===f10)break;f10=m10}ks>a10&&a8(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[3]),w!==a10&&a8(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[4])}function fl(a10,b10,c10){if(typeof c10=="number")throw g([0,f,t$],1);if(c10[0]===0)return h(a10,c10[2]);var d10=fl(a10,b10,c10[3]);return i(b10,fl(a10,b10,c10[2]),d10)}function br(a10,b10,c10){var d10=b10[2],e10=b10[1],f10=dk(c10);if(f10){var g10=f10[1];return R(typeof g10=="number"?e10:fl(a10,d10,g10))}var h10=[0,dv(a10,d10)];return k(c10,function(a11){var b11=t_(h10[1],a11);h10[1]=b11;var c11=dw(b11);return c11?c11[1]:e10})}var aT=[0,cy,aE];function ua(a10,b10){return dm(b10,aT,a10)}function dy(a10){return ua(a10,J)}function iK(a10){function e10(a11,b10){for(var c10=a11,d10=b10;;){if(typeof c10=="number")return d10;if(c10[0]===0)return[0,c10[2],d10];var f10=e10(c10[3],d10);c10=c10[2],d10=f10}}return e10(a10,0)}var iL=[0,R(0),function(a10,b10){return bY(a10,b10,aE)}];function fm(c10,b10){return br(function(a10){return J(h(c10,a10))},aT,b10)}function ub(a10,b10){return ih(br(b10,iL,a10))}function bs(a10){return ub(a10,function(a11){return k(a11,J)})}var bt=e;function uc(a10){return a10[kU]}function iM(a10,b10){var c10=a10?a10[1]:bt;return BL(b10).join(c10)}function fn(a10){return uc(a10)===0?1:0}function dz(a10,b10){return lS(a10,b10)}p.Number;var fo=null,ud=void 0;function cB(a10){return a10===fo?1:0}function ue(a10){return a10===ud?1:0}function b3(a10){var b10=cB(a10);return b10||ue(a10)}function iN(a10){return 1-b3(a10)}function dA(a10,b10){return b3(b10)?0:[0,h(a10,b10)]}var l=p;function fp(a10,b10){var c10=a10[b10];return b3(c10)?0:[0,c10]}function fq(a10){return new l[lh](a10)}function iO(a10){return a10[kU]}function iP(c10,b10){return hj(iO(b10),function(a10){return h(c10,b10[a10])})}function iQ(a10,b10){var d10=b10.length-1,e10=fq(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){e10[c10]=h(a10,j(b10,c10)[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function iR(c10,b10){return mZ(iO(b10),function(a10){return h(c10,b10[a10])})}function fr(f10,b10){return function(a10,b11,c10){for(var e10=a10,d10=c10;;){if(!d10)return b11;var g10=d10[2];b11[e10]=h(f10,d10[1]),e10=e10+1|0,d10=g10}}(0,fq(0),b10)}function ui(a10,b10){var c10=new l.Error(b10);return a10&&(c10[bB]=a10[1]),c10}var uk=Symbol.iterator;function um(a10){return a10.next()}function un(a10){var b10=dA(function(a11){return a11|0},a10.done);return b10?b10[1]:0}function uo(a10){return a10[dV]}function iS(i10,g10,c10,d10,e10){return function(a10,b10){for(var d11=b10;;){var e11=um(a10);if(un(e11))return d11;var f10=uo(e11),j10=h(g10,f10[1]);d11=y(c10,h(i10,f10[0]),j10,d11)}}(d10,e10)}l.Promise;function uh(a10){return aw(a10)}function bu(a10,b10,c10){return eg(a10,uh(b10),c10)}function ay(a10){return aw(a10)}function v(a10){return H(a10)}function b4(a10,b10){return a10 instanceof b10?1:0}var uf=!0;function ug(a10,b10){a10[b10]}function uj(a10,b10){return h(function(a11){throw a11},ui(a10,b10))}function ul(a10){return a10[uk]()}l.Event;function dB(a10){return a10[f7]}function iT(a10,b10,c10,d10){var e10=a10?a10[1]:{},f10=bJ(1,c10);return d10.addEventListener(b10,f10,e10),function(a11){return d10.removeEventListener(b10,f10,e10),0}}function iU(a10){return h(a10,0)}var fs="change",cC="click";l.ArrayBuffer,l.DataView;function up(a10){return a10.preventDefault(),0}var uq="DOMContentLoaded",ur=kz,us="scroll",ut="wheel";l.Blob,l.File;var iV=l.JSON;l.encodeURI,l.decodeURI,l.encodeURIComponent,l.decodeURIComponent,l.URL,l.URLSearchParams;function aU(a10,b10){return[0,a10,b10]}var cD=[0,bt,bt];function ft(a10){return[0,a10,bt]}function iW(a10){return a10}var cE=ly,fu=ki,iX=bB,iY=k6,fv="type",fw=dV,iZ=ft(dT),ux="for";function aV(a10){return aU(cE,a10)}function i0(a10){return aU(ux,a10)}var uA=ft("required");function dC(a10){return aU(iY,a10)}function i1(a10){return aU(fv,a10)}var uB=ft("selected"),bv=l.document;function uu(a10){return iV.stringify(a10)}function uv(a10){try{var c10=iV.parse(a10)}catch(f10){var b10=M(f10);if(b10[1]===e2)return[1,b10[2]];throw g(b10,0)}return[0,c10]}function uw(a10,b10){return a10?b10:cD}var uy="placeholder";function uz(a10){return aU(fu,a10)}function uC(a10){return aU(fw,a10)}function uD(a10){return a10.ownerDocument}b3(bv)||bv[ke];function uE(a10,b10){return a10.appendChild(b10),0}function uF(a10,b10,c10,d10){for(var g10=b10,f10=c10,e10=d10;;){if(!e10){g10!==0&&a10.setAttribute(k6,iM([0,";"],ck(g10))),f10!==0&&a10.setAttribute(ly,iM([0,aI],ck(f10)));return}var h10=e10[2],k10=e10[1],i10=k10[2],j10=k10[1];if(fn(j10))e10=h10;else if(dz(j10,iY))g10=[0,i10,g10],e10=h10;else if(dz(j10,cE)){var l10=fn(i10)?f10:[0,i10,f10];f10=l10,e10=h10}else a10.setAttribute(j10,i10),e10=h10}}function i2(a10,b10,c10,d10){var f10=a10?a10[1]:bv,g10=b10?b10[1]:0,e10=f10.createElement(c10);return uF(e10,0,0,g10),a8(function(a11){return uE(e10,a11)},d10),e10}function aW(a10,b10){var c10=a10?a10[1]:bv;return c10.createTextNode(v(b10))}function i3(a10,b10,c10){return fn(a10)?0:b10?(c10.setAttribute(a10,b10[1]),0):(c10.removeAttribute(a10),0)}function i4(a10,b10,c10){return b10?(c10[j7].add(a10),0):(c10[j7].remove(a10),0)}var i5="div";function uP(a10,b10,c10,d10){return i2(b10,c10,a10,d10)}function i6(a10,b10,c10){return uP(i5,a10,b10,c10)}function i7(a10){return a10[ke]}function dD(a10,b10,c10){return eg(a10,b10,c10),0}var dE=l[kV];function dF(a10){return BG(function(a11,b10,c10){for(var e10=b10,d10=c10;;){if(!d10)return a11;var f10=d10[2];a11[e10]=d10[1],e10=e10+1|0,d10=f10}}(fq(0),0,a10))}function aF(a10){return dD(dE,uS,dF(a10))}function b5(a10){return dD(dE,uX,dF(a10))}l[kV],l.navigator;var u0=l.performance,dG=l[lw];ug(l,u1);function uG(a10,b10){eg(a10,kR,c7(b10))}function uH(a10,b10,c10){var e10=a10?a10[1]:l[lw],d10=e10.getComputedStyle(c10)[b10];return b3(d10)?bt:d10}function uI(a10,b10){var c10=a10?a10[1]:lt,d10=lt<=c10?1:0;return b10.scrollIntoView(!!d10),0}var uJ="button",uK="form",uL=kz,uM="label",uN="option",uO="select";function uQ(a10){var b10=a10.body;return iN(b10)?b10:uj(0,"Document body is null. Try to defer your script execution.")}function uR(a10){return dA(function(a11){return a11},a10.activeElement)}function uT(a10){return dD(dE,uU,dF(a10))}function uV(a10){return dD(dE,uW,dF(a10))}function uY(a10){return a10}function uZ(a10){return a10.now()}function u2(a10,b10){return l.setTimeout(bJ(1,b10),a10)}function u3(a10){l.clearTimeout(a10)}function u4(a10){l.requestAnimationFrame(bJ(1,a10))}l.ClipboardItem,l.FormData,l.Headers,l.Request,l.Response,l.fetch,l.MediaStream,l.MediaRecorder,l.MessageChannel,l.BroadcastChannel,l.Notification,l.WebSocket;function u5(a10){return a10.localStorage}function u6(a10,b10){function c10(a11){return a11}return function(a11){return dA(c10,a11)}(a10.getItem(b10))}function u7(a10,b10,c10){try{a10.setItem(b10,c10);return}catch(f10){var d10=M(f10);if(d10[1]===e2)return;throw g(d10,0)}}function az(a10,b10,c10){return[0,a10,b10,c10]}function i8(a10){var b10=a10[1];return b10===82||83<=b10?ha(dk(a10[2])):1}function dH(a10){return c3(dk(a10))}function u8(a10){return et(c4(function(a11){var b10=a11[1];return b10===82?[0,dH(a11[2]),0]:83<=b10?iK(dH(a11[2])):[0,a11[2],0]},a10))}function i9(a10){if(!a10)return u9;var b10=m6(i8,a10),c10=b10[2];return[0,u8(b10[1]),c10]}var i_=kR,fx="before";function va(a10){return[0,a10]}function vb(a10,b10){return[1,fo,a10,b10]}var vc="remove",vd="contains";function i$(a10){var b10=uR(uD(a10));return b10?bu(a10,vd,[0,b10[1]])|0:0}function ja(e10,b10){var c10=[0,dv(va,vb)];return k(b10,function(a10){var b11=fk(c10[1],a10),d10=b11[2],g10=b11[1];c10[1]=d10,dx(w,function(a11,b12){return a11[0]===0?a11[1][dU]=uf:0},g10,0);var h10=i$(e10),i10=dw(d10);if(i10){var f10=function(d11,b12){if(b12[0]!==0){if(!cB(b12[1]))return b12[1];var l10=f10(d11,b12[3]),k10=f10(l10,b12[2]);return b12[1]=k10,k10}var c11=b12[1];if(delete c11[dU],c11.parentNode!==e10)cB(d11)?bu(e10,i_,[0,c11]):bu(d11,fx,[0,c11]);else{var a11=c11.nextSibling!==d11?1:0;if(a11){if(h10)var g11=i$(c11),i11=g11&&function(a12){for(;;){var b13=c11.nextSibling;if(b13===d11)return 1;if(cB(b13))return 0;bu(c11,fx,[0,b13])}}(0);else var i11=h10;var j10=1-i11}else var j10=a11;j10&&(cB(d11)?bu(e10,i_,[0,c11]):bu(d11,fx,[0,c11]))}return c11};f10(fo,i10[1])}return dx(w,function(a11,b12){if(a11[0]!==0)return 0;var c11=a11[1],d11=iN(c11[dU]),e11=d11&&(delete c11[dU],bu(c11,vc,[0]),0);return e11},g10,0),e10})}var dI=R(0),fy=[0,bt,bt];function u_(a10){if(!a10)return u$;var b10=a10[1],c10=b10[1];if(c10===82){if(!a10[2])return[0,0,[0,k(b10[2],J)]]}else if(83<=c10){if(!a10[2])return[0,0,[0,b10[2]]]}else if(!a10[2])return[0,[0,b10[2],0],0];return m2(i8,a10)?[0,et(c4(function(a11){var b11=a11[1];return b11===82?[0,dH(a11[2]),0]:83<=b11?iK(dH(a11[2])):[0,a11[2],0]},a10)),0]:[0,0,[0,dm(function(a11){var b11=a11[1];return b11===82?k(a11[2],J):83<=b11?a11[2]:R(J(a11[2]))},iL,a10)]]}function jb(c10,b10){function d10(a10){var b11=a10[2],d11=a10[1];return dz(d11,cE)?i4(b11,1,c10):i3(d11,[0,b11],c10)}function e10(a10){var b11=a10[1],d11=a10[2];return dz(b11,cE)?i4(d11,0,c10):i3(b11,0,c10)}function h10(a10){var b11=[0,fy];return function(a11){b11[1]!==fy&&e10(b11[1]);var c11=a11;return d10(c11),b11[1]=c11,0}}return dm(function(a10){var b11=a10[1];if(b11===82){var i10=a10[2];return k(i10,h10(0))}if(83>b11)throw g([0,f,ve],1);var j10=a10[2],c11=[0,dv(function(a11){var b12=a11;return d10(b12),b12},function(a11,b12){return fy})];return k(j10,function(a11){var b12=fk(c11[1],a11),d11=b12[2],f10=b12[1];return c11[1]=d11,dx(w,function(a12,b13){return e10(a12)},f10,0),dw(d11),0})},[0,dI,function(a10,b11){return dI}],b10)}function fz(a10,b10){return iT(b10[1],b10[2],b10[3],a10)}function vf(c10,b10){return dm(function(a10){var b11=a10[1];if(b11===82){var d10=[0,0];return k(a10[2],function(a11){var b12=d10[1];return b12&&iU(b12[1]),d10[1]=[0,fz(c10,a11)],0})}if(83>b11)throw g([0,f,vg],1);var h10=a10[2],e10=[0,dv(function(a11){return fz(c10,a11)},function(a11,b12){return a11})];return k(h10,function(a11){var b12=fk(e10[1],a11),c11=b12[2],d11=b12[1];return e10[1]=c11,dx(w,function(a12,b13){return iU(a12)},d11,0),dw(c11),0})},[0,dI,function(a10,b11){return dI}],b10)}function jc(a10,b10,c10,d10,e10,f10){var q10=b10?b10[1]:0,r10=c10?c10[1]:0,s10=d10?d10[1]:function(a11){},m10=i9(q10),l10=m10[2],t10=m10[1],n10=i9(r10),o10=n10[2],u10=n10[1],p10=u_(f10),i10=p10[2],g10=i2(a10,[0,t10],e10,p10[1]);if(h(s10,g10),l10)if(i10)var v10=ja(g10,i10[1]),j10=bY(jb(g10,l10),v10,function(a11,b11){return b11});else var j10=k(jb(g10,l10),function(a11){return g10});else var j10=i10?ja(g10,i10[1]):R(g10);a8(function(a11){return fz(g10,a11),0},u10);var w10=o10?bY(vf(g10,o10),j10,function(a11,b11){return b11}):j10;return w10}function b6(a10,b10,c10,d10,e10,f10){return jc(b10,c10,d10,e10,a10,f10)}function vh(a10,b10,c10,d10,e10,f10){return jc(b10,c10,d10,e10,a10,0)}function fA(a10,b10,c10,d10,e10){return b6(uJ,a10,b10,c10,d10,e10)}function K(a10,b10,c10,d10,e10){return b6(i5,a10,b10,c10,d10,e10)}function fB(a10,b10,c10,d10,e10){return vh(uL,a10,b10,c10,d10,e10)}function jd(a10,b10,c10,d10,e10){return b6(uM,a10,b10,c10,d10,e10)}function vi(a10,b10,c10,d10,e10){return b6(uK,a10,b10,c10,d10,e10)}function vj(a10,b10,c10,d10,e10){return b6(uN,a10,b10,c10,d10,e10)}function vk(a10,b10,c10,d10,e10){return b6(uO,a10,b10,c10,d10,e10)}function dJ(a10,b10){return b10=c10)return vB;if(b10===kY)return vA;if(b10==="cyan")return vz;if(b10===lm)return vy;if(b10==="magenta")return vx;if(b10===lq)return vw;if(b10==="reset")return vv;if(b10==="white")return vu;if(b10==="yellow")return vt}else{if(b10==="Black")return vK;if(b10==="Blue")return vJ;if(b10==="Cyan")return vI;if(b10==="Green")return vH;if(b10==="Magenta")return vG;if(b10==="Red")return vF;if(b10==="White")return vE;if(b10==="Yellow")return vD;if(b10==="black")return vC}throw g(fD,1)}function jg(a10,b10){return a9(b10,a10),vM}function jh(a10){try{nM(a10),nN(a10)}catch(f10){var b10=M(f10);if(b10!==eB)throw g(b10,0)}return vN}var ji=[q,vO,ag(0)],vL=0;function vP(a10,b10,c10){if(c10[1]===ji)return jg(a10,c10[2]);if(c10[1]!==cs)return h(b10,c10);var e10=c10[2];try{var f10=jg(a10,jf(e10));return f10}catch(f11){var d10=M(f11);if(d10===fD)return h(b10,c10);throw g(d10,0)}}function vQ(a10,b10,c10){if(c10[1]===ji)return jh(a10);if(c10[1]!==cs)return h(b10,c10);var e10=c10[2];try{jf(e10)}catch(f10){var d10=M(f10);if(d10===fD)return h(b10,c10);throw g(d10,0)}return jh(a10)}function vR(a10){var c10=bO(0);ry(a10,1);var b10=rz(a10,0),d10=b10[2],e10=b10[1];return rA(a10,[0,function(a11){return vP(c10,e10,a11)},function(a11){return vQ(c10,d10,a11)},b10[3],b10[4]])}function vS(a10,b10){var d10=bo(64),c10=df(d10),e10=a10&&vL;return e10&&vR(c10),r1(function(a11){return a$(c10,0),co(d10)},c10,b10)}function vT(a10){return vS(1,a10)}function vU(a10,b10){return m8(a10,b10)}function vV(a10){try{var c10=[0,l4(a10)];return c10}catch(f10){var b10=M(f10);if(b10[1]===cc)return 0;throw g(b10,0)}}function vW(a10){return a10|0}function fE(a10,b10){return b10?[0,h(a10,b10[1])]:0}function vX(a10,b10,c10){return c10?h(b10,c10[1]):a10}function vY(a10,b10){if(b10)return h(a10,b10[1])}function vZ(a10,b10){return b10?b10[1]:a10}function v0(a10,b10){return a10?a10[1]:b10}function v1(a10){return a10?[0,a10[1],0]:0}function v2(a10,b10){return b10[0]===0?h(a10,b10[1]):[1,b10[1]]}function v3(a10,b10){return v2(b10,a10)}function v4(a10){var b10=nE(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[38],,,,,,,,,,,b10[10]]}function v5(a10){var b10=v4(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[40],,,,,,,,,,,,,,,,,,,,b10[51]]}function v6(e10,b10){var d10=n(e10);if(dJ(d10,n(b10)))return 0;var f10=n(b10)-d10|0;return function(a10){for(var c10=a10;;){if(vl(c10,d10))return 1;if(_(b10,f10+c10|0)!==_(e10,c10))return 0;c10=c10+1|0}}(0)}function fF(a10,b10){return v6(a10,b10)?[0,ex(b10,0,n(b10)-n(a10)|0)]:0}var jj=[q,v8,ag(0)];function jk(a10){return[0,[0,a10]]}function bw(a10,b10,c10,d10){return[1,a10,b10,c10,d10]}function v_(a10){return a10[0]===0&&typeof a10[1]=="number"?1:0}function jl(a10,b10){if(b10[0]===0){var c10=b10[1];if(typeof c10=="number")return jk(a10);switch(c10[0]){case 0:return[0,[1,a10,c10[1]]];case 1:return[0,[2,a10,c10[1],c10[2]]];default:return bw(4,[1,a10,c10[1]],v9,[1,c10[2],c10[3]])}}var d10=b10[2],f10=b10[1];if(typeof d10!="number")switch(d10[0]){case 0:break;case 1:return bw(f10+1|0,[2,a10,d10[1],d10[2]],b10[3],b10[4]);default:var e10=b10[3],i10=d10[3],j10=d10[2],k10=d10[1],g10=aN(e10);a:if(aZ===g10)var h10=e10[1];else{if(bg!==g10&&bE!==g10){var h10=e10;break a}var h10=er(e10)}return bw(f10+1|0,[1,a10,k10],[bg,function(a11){return jl([0,j10,i10],h10)}],b10[4])}return bw(f10+1|0,[1,a10,d10[1]],b10[3],b10[4])}function jm(a10){if(a10[0]===0){var b10=a10[1];if(typeof b10=="number")throw g(jj,1);switch(b10[0]){case 0:return[0,v7,b10[1]];case 1:var n10=b10[2];return[0,jk(b10[1]),n10];default:return[0,[0,[1,b10[1],b10[2]]],b10[3]]}}var d10=a10[3],e10=a10[2],h10=a10[1],i10=aN(d10);a:if(aZ===i10)var f10=d10[1];else{if(bg!==i10&&bE!==i10){var f10=d10;break a}var f10=er(d10)}var j10=a10[4];if(typeof j10!="number"&&j10[0]!==0){var c10=a10[4];if(typeof c10!="number"&&c10[0]===2){var q10=c10[3];return[0,bw(h10-1|0,e10,d10,[1,c10[1],c10[2]]),q10]}var p10=c10[2];return[0,bw(h10-1|0,e10,d10,[0,c10[1]]),p10]}var k10=j10[1];if(v_(f10))return[0,[0,e10],k10];var l10=jm(f10),m10=l10[2],o10=[1,m10[1],m10[2]];return[0,bw(h10-1|0,e10,mI(l10[1]),o10),k10]}function wa(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return 1;case 1:return 2;default:return 3}}function v$(a10){try{var c10=[0,jm(a10)];return c10}catch(f10){var b10=M(f10);if(b10===jj)return 0;throw g(b10,0)}}function wb(a10){return a10[0]===0?wa(a10[1]):a10[1]}function wc(a10){return a10.height}function wd(a10){return a10}function wg(a10){switch(a10){case 0:return wh;case 1:return wi;default:return wj}}function we(a10){return a10.contentRect}function wf(a10){a10[f7]}function wk(a10,b10,c10){var d10=b10?[0,c10,{box:v(wg(b10[1]))}]:[0,c10];return eg(a10,"observe",d10),0}function wl(c10){return new l.ResizeObserver(function(a10,b10){return i(c10,iR(function(a11){return a11},a10),b10)})}var wm=kc,wn="pattern",jn=v5([0,ey]);function wo(a10,b10){return h(a10,b10),b10}function wp(a10){var b10=fF(wq,a10);if(b10){var c10=b10[1],d10=vV(c10);if(d10)return[0,[0,d10[1]]];var g10=function(a11){return[0,a11]};return function(a11){return fE(g10,a11)}(fC(c10))}var e10=fF(wr,a10);if(e10){var h10=function(a11){return[1,a11]};return function(a11){return fE(h10,a11)}(fC(e10[1]))}var f10=fF(ws,a10);if(!f10)return 0;function i10(a11){return[1,a11]}return function(a11){return fE(i10,a11)}(fC(f10[1]))}function jo(a10){switch(a10[0]){case 0:var b10=a10[1];return h(A(wt),b10);case 1:var c10=a10[1];return h(A(wu),c10);default:var d10=a10[1];return h(A(wv),d10)}}function jp(a10){var c10=a10?a10[1]:i7(bv);function b10(a11){var b11=wp(aw(uH(0,"font-size",a11)));if(!b11)return 16;var c11=b11[1];return c11[0]===0?c11[1]:a7(ww)}return function(a11){switch(a11[0]){case 0:return a11[1];case 1:var d10=a11[1];return d10*b10(i7(bv));default:var e10=a11[1];return e10*b10(c10)}}}function wx(e10,b10,c10,d10){function f10(a10,b11){return y(e10,b11[1],b11[2],a10)}function g10(a10,b11){return bY(d10,a10,b11)}return function(a10){return g10(a10,f10)}(bY(b10,c10,function(a10,b11){return[0,a10,b11]}))}var wA=[q,wz,ag(0)],wC=[q,wB,ag(0)];function fG(a10){return[0,0]}function fH(a10,b10){if(a10[1])throw g(wC,1);return a10[1]=[0,b10],0}function fI(a10){var b10=a10[1];if(b10)return b10[1];throw g(wA,1)}function wy(a10,b10,c10){return wx(function(a11,b11,c11){return[0,a11,b11,c11]},a10,b10,c10)}function wD(a10){return uu(a10)}function wE(a10){var b10=uv(a10);return b10[0]===0?[0,b10[1]]:(uT([0,b10[1],0]),wF)}var jq=u5(dG);function jr(c10,b10){return function(a10){return u7(jq,c10,a10)}(wD(b10))}function wG(a10){var b10=u6(jq,a10);function c10(a11){return wE(a11)}var d10=b10?[0,b10[1]]:wH;return v3(d10,c10)}function wI(a10,b10){var c10=wG(a10);if(c10[0]===0)return c10[1];var d10=c10[1];return typeof d10=="number"||uV([0,d10[2],0]),h(b10,0)}function wJ(d10,b10){jr(d10,b10);var a10=ae(b10),c10=e6(0,a10);return e7(c10,function(a11){return jr(d10,b0(c10)),0}),b0(c10),a10}function wK(a10,b10){var c10=H(a10);return wJ(c10,wI(c10,b10))}function js(a10,b10){return wK(a10,function(a11){return b10})}var wM=jn[49],wL=jn[29];function wN(a10){return c4(function(a11){return[0,80,aV(H(a11))]},wM(a10))}var wO=0;function bc(d10,b10,c10){var a10=b10[1],e10=a10===82?[0,82,k(b10[2],function(a11){return function(a12){return aU(d10,a12)}(H(a11))})]:83<=a10?a7(wR):[0,80,function(a11){return aU(d10,a11)}(H(b10[2]))];return[0,e10,c10]}function fJ(d10,b10,c10){return b10?[0,[0,80,function(a10){return aU(d10,a10)}(H(b10[1]))],c10]:c10}function jt(a10,b10){var c10=b10[1];return c10===82?[0,82,k(b10[2],a10)]:83<=c10?[0,83,fm(a10,b10[2])]:[0,80,h(a10,b10[2])]}function wT(a10){return a10[0]===0?aV(H(a10[1])):a10[1]}function fK(a10,b10){return[0,jt(wT,a10),b10]}function al(a10){return fK(a10,0)}function cF(a10,b10){return fK(a10,b10)}function wP(a10,b10){var d10=wN(b10[1]),e10=b10[2],c10=function(a11){return bN(e10,a11)}(d10);return a10?[0,[0,80,uz(H(a10[1]))],c10]:c10}function wQ(a10){return[0,wL(a10),wO]}function wS(a10,b10,c10){return b10?[0,[0,80,a10],c10]:c10}function wU(a10){return fK(jt(function(a11){return[0,a11]},a10),0)}function wV(a10,b10){return b10[0]===0?(a10.scroll(0,b10[1]),0):uI(0,b10[1])}function wW(a10,b10,c10,d10,e10){var g10=a10?a10[1]:0,h10=b10?b10[1]:0,f10=ae(1),i10=cF(wX,cF([0,82,k(f10,function(a11){return a11?[1,aV("locked")]:[1,cD]})],g10)),j10=wU(wY),l10=[0,[0,80,az(0,cC,function(a11){return ab(f10,1)})],0],m10=K(0,[0,j10],[0,l10],0,[0,[0,82,fA(0,0,0,0,[0,[0,80,aW(0,wZ)],0])],0]),n10=az(0,ut,function(a11){var b11=bq(f10);return b11&&ab(f10,0)});return K(0,[0,i10],[0,[0,[0,80,n10],h10]],c10,[0,[0,82,k(wy(e10,f10,d10),function(a11){var b11=a11[1],c11=a11[3];return a11[2]&&vY(function(a12){return wV(b11,a12)},c11),b11})],[0,[0,82,m10],0]])}function dK(a10,b10){return typeof b10=="number"?0:b10[0]===0?[0,h(a10,b10[1])]:[1,b10[1]]}function w0(e10,b10,c10){var d10=ae(c10);return[0,az(0,b10,function(a10){return ab(d10,h(e10,dB(a10)[dV]))}),d10]}function ju(a10,b10,c10,d10,e10,f10,g10,h10,i10,j10){var l10=d10?d10[1]:0,m10=f10?f10[1]:0,n10=function(a11){return fJ(wn,h10,a11)}(function(a11){return wS(uA,m10,a11)}([0,[0,80,i1(H(i10))],l10])),o10=v0(b10,function(a11){return[0,a11]}),k10=w0(a10,g10,j10),p10=k10[2],q10=k10[1];return[0,fB(c10,[0,n10],[0,[0,[0,80,q10],v1(e10)]],0,0),p10,o10]}function dL(a10,b10,c10,d10,e10,f10,g10,h10){var i10=c10?c10[1]:0,j10=function(a11){return fJ(fw,h10,a11)}(function(a11){return fJ(uy,g10,a11)}(i10));return ju(ay,a10,b10,[0,j10],d10,e10,ur,f10,w2,vZ(w1,h10))}function dM(a10,b10,c10,d10){var e10=b10?b10[1]:0;return ju(function(a11){return 0},0,a10,[0,bc(fw,d10,e10)],c10,0,fs,0,w3,0)}function aG(a10,b10){return k(a10,function(a11){return[0,a11,b10]})}function dN(a10,b10,c10,d10,e10){var i10=[0,[0,cy,function(a11){return a11}],function(a11,b11){var c11=b11[2],d11=a11[2];return[0,aE(a11[1],b11[1]),function(a12){return h(c11,h(d11,a12))}]}];function j10(a11){var b11=a11[1],c11=a11[2];function d11(a12){var c12=bq(b11[2]);return h(b11[3],c12)}return[0,J(b11[1]),function(a12){var b12=d11(0);return h(h(c11,a12),b12)}]}var f10=function(a11){return br(j10,i10,a11)}(bs(d10[2])),g10=[0,82,k(f10,function(a11){var b11=a11[2];return az(0,wm,function(a12){return h(e10,h(b11,d10[1])),up(a12)})})],l10=k(f10,function(a11){return a11[1]}),m10=vX([0,g10,0],function(a11){return mU(g10,a11)},c10);return vi(a10,b10,[0,m10],0,[0,[0,83,bs(l10)],0])}function jv(a10,b10){return a10?h(A(w4),b10):b10}function w5(a10,b10,c10,d10,e10,f10){var m10=a10?a10[1]:1,n10=b10?b10[1]:0,o10=c10?c10[1]:0,l10=d10?d10[1]:function(a11){return function(a12){return 0}},j10=jv(1,e10[1]),p10=jv(0,e10[1]),g10=m10?js(j10,e10[2]):ae(e10[2]),q10=bq(g10);h(h(l10,1),q10);var r10=e10[3];jd(0,[0,[0,[0,80,i0(H(j10))],0]],0,0,r10);var s10=[0,80,p10],t10=function(a11){return bc(fv,w6,a11)}(function(a11){return bc(iX,s10,a11)}(bc(fu,[0,80,j10],n10))),u10=[0,[0,80,az(0,fs,function(a11){var b11=ay(dB(a11)[dV]);return i(l10,0,b11),ab(g10,b11)})],o10];return[0,vk(0,[0,t10],[0,u10],0,[0,[0,83,bs(fm(function(a11){var b11=a11[1],c11=a11[2],d11=al([0,80,[1,uC(H(b11))]]),e11=cF([0,82,k(g10,function(a12){return[1,uw(vp(a12,b11),uB)]})],d11);return vj(0,[0,e11],0,0,[0,[0,80,aW(0,c11)],0])},f10))],0]),,g10]}function w7(a10,b10,c10,d10,e10,f10,g10){var m10=b10?b10[1]:0,n10=c10?c10[1]:function(a11){},j10=h(vT(w8),d10);function l10(a11){return a11?[0,e10]:0}a:{if(a10&&a10[1]){var o10=js(j10,l10(g10)),i10=o10;break a}var i10=ae(l10(g10))}var p10=jd(0,[0,[0,[0,80,i0(H(j10))],0]],0,0,f10),q10=[0,80,d10],r10=function(a11){return bc(fv,w9,a11)}(function(a11){return bc(iX,q10,a11)}(bc(fu,[0,80,j10],0))),s10=[0,[0,82,k(i10,function(a11){return a11?iZ:cD})],r10];return[0,K(0,0,0,0,[0,[0,82,fB(0,[0,s10],[0,[0,[0,80,az(0,fs,function(a11){var b11=l10(dB(a11)[dT]|0);return h(n10,b11),ab(i10,b11)})],m10]],0,0)],[0,[0,82,p10],0]]),i10]}function w_(a10){var d10=eA(a10);return[0,,function(a11){return wb(a11[1])},function(a11){},,function(a11,b10,c10){var e10=d10[2].call(null,b10,c10,a11[2]);return[0,jl(b10,a11[1]),e10]},function(a11){var c10=v$(a11[1]);if(!c10)return[0,a11,0];var e10=c10[1],b10=e10[2],f10=e10[1],g10=[0,[0,b10,d10[17].call(null,b10,a11[2])]];return[0,[0,f10,d10[6].call(null,b10,a11[2])],g10]},function(a11,b10){return d10[18].call(null,b10,a11[2])}]}function w$(a10){var b10=w_(a10);return[0,function(a11){b10[3].call(null,0),b10[3].call(null,0)}]}function xb(a10){return br(function(a11){return J(K(0,0,0,0,a11[3]))},aT,a10)}function xc(a10){return e8(br(function(a11){return a11[2]},[0,xg,function(a11,b10){return i(A(xf),a11,b10)}],a10),function(a11){return i(A(xe),xd,a11)})}jp(0)(xk);function xa(a10,b10,c10){return[0,a10,b10,c10]}function xh(a10){return xc(a10[1][1])}function xi(a10){var b10=jo(a10[2]),c10=[0,[0,80,aV(k0)],0],d10=[0,[0,80,aV("lwdui-lazy-table-header")],c10],e10=[0,[0,80,dC(H(h(A(xj),b10)))],d10];return K(0,[0,e10],0,0,[0,[0,83,bs(xb(a10[1][1]))],0])}var xl=w$([0,vU]),dO=Cb(0);function xm(e10,b10,c10,d10){var s10=d10[3],t10=d10[2],l10=fG(0),m10=fG(0),n10=jo(e10[2]),v10=h(A(xo),n10),w10=cx(function(a11,b11){return J([0,e$(a11),a11,s10])},aT,t10);hL(0,2048),function(a11){return xl[1].call(null,50)}(0);var f10=ae(0),a10=R(function(a11){return a11}),g10=e6(0,sa(a10,f10));e7(g10,function(a11){var b11=b0(g10);return b11[2]?h(b11[1],0):0}),b0(g10);function u10(a11){return i(A(xn),n10,a11)}function j10(a11){var b11=[0,aV("row_spacer"),0];return i6(0,[0,[0,dC(H(u10(a11))),b11]],0)}var x10=k(br(function(a11){var b11=a11[1],c11=a11[3],d11=a11[2],e11=bc(cE,xp,0),f11=[0,80,dC(H(v10))];return b11?[0,0,J(K(0,[0,[0,f11,e11]],0,0,[0,[0,83,bs(i(c11,d11,b11[1]))],0])),0]:[0,1,cy,0]},[0,[0,0,cy,0],function(a11,b11){var f11=b11[3],g11=b11[2],c11=b11[1],d11=a11[3],e11=a11[2],h10=a11[1],k10=iy(e11),i10=iy(g11);if(typeof k10=="number")return typeof i10=="number"?[0,((h10+d11|0)+c11|0)+f11|0,e11,0]:[0,(h10+d11|0)+c11|0,g11,f11];if(typeof i10=="number")return[0,h10,e11,(d11+c11|0)+f11|0];var l11=dJ(d11+c11|0,0)?function(a12){return aE(e11,a12)}(aE(J(R(j10(d11+c11|0))),g11)):aE(e11,g11);return[0,h10,l11,f11]}],w10),function(a11){var b11=a11[3],c11=a11[2],d11=a11[1],e11=dJ(d11,0)?aE(J(R(j10(d11))),c11):c11;return dJ(b11,0)?aE(e11,J(R(j10(b11)))):e11}),y10=xi(e10),z10=wl(function(a11,b11){var d11=mV(a11);wf(d11);var c11=wc(we(d11)),e11=bq(f10);return e11?vm(e11[1],c11)?ab(f10,[0,c11]):0:ab(f10,[0,c11])}),B10=al(xq),o10=K(0,[0,B10],0,[0,function(a11){return fH(l10,a11)}],[0,[0,83,bs(x10)],0]),p10=al(xr),q10=[0,[0,82,k(a10,function(c11){return az(0,us,function(a11){var d11=[0,0],b11=[0,-1];function e11(e12){var a12=800,f11=uZ(u0);vn(b11[1],0)&&u3(b11[1]),b11[1]=u2(a12,function(a13){return h(c11,e12)});var g11=vo(f11-d11[1],a12);return g11&&(d11[1]=f11,h(c11,e12))}return fI(m10),function(a12){return e11(a12)}(0),0})})],0];function r10(a11){return fH(m10,a11)}var C2=c10?wW([0,p10],[0,q10],[0,r10],k(c10[1],function(a11){var b11=fI(l10),c11=e10[2];return[0,[0,cZ(a11,vW(jp([0,b11])(c11)))]]}),o10):K(0,[0,p10],[0,q10],[0,r10],[0,[0,82,o10],0]);function D2(a11){return wk(z10,0,a11)}function E2(a11){return wo(D2,a11)}var F2=function(a11){return k(a11,E2)}(C2),G2=wP(0,wQ(xs));return K(0,[0,[0,[0,82,k(xh(e10),function(a11){return dC(H(a11))})],G2]],0,0,[0,[0,82,y10],[0,[0,82,F2],0]])}var fL=eA([0,ey]),fM=dO.Text,fN=dO[lh],fO=dO.Map,b7=id2(xx,xw),bd=id2(xz,xy);function xt(a10,b10){return[0,a10,b10]}function jw(a10){return b4(a10,fN)?[0,a0,a10]:b4(a10,fO)?[0,w,a10]:b4(a10,fM)?[0,bD,a10]:[0,U,a10]}function xA(a10){var b10=fp(a10,xB);if(b10)return[0,b10[1]];var c10=fp(a10,xC);if(c10)return[1,iP(jw,c10[1])];var d10=fp(a10,xD);if(d10)return[2,d10[1]];throw g([0,f,xE],1)}ig(xF,b7,[0,function(a10){return new fN},function(a10,b10,c10){return a10.insert(b10,iQ(function(a11){var b11=a11[1];return bD<=b11?(a0<=b11,a11[2]):(w<=b11,a11[2])},c10)),0},function(a10,b10,c10){return a10.delete(b10,c10),0},function(a10,b10){return a10.push(iQ(function(a11){var b11=a11[1];return bD<=b11?(a0<=b11,a11[2]):(w<=b11,a11[2])},b10)),0},function(a10,d10){return a10.forEach(function(a11,b10,c10){return y(d10,b10,jw(a11),c10)}),0},function(a10,b10){function c10(a11){return h(b10,xt(xA,a11))}return a10.observe(c10),c10}]);function fP(a10){return b4(a10,fN)?[0,a0,a10]:b4(a10,fO)?[0,w,a10]:b4(a10,fM)?[0,bD,a10]:[0,U,a10]}function jx(a10,b10){return function(a11){return dA(fP,a11)}(a10.get(v(b10)))}function xG(a10){return a10}function xH(a10){return a10[f7]}function xI(a10){var b10=ay(a10.action);if(b10!=="add")if(b10!==la){if(b10!=="update")throw g([0,cb,h(A(xJ),b10)],1);var c10=1}else var c10=2;else var c10=0;var d10=a10.oldValue,e10=b3(d10)?0:[0,fP(d10)];return[0,c10,0,e10]}function jy(a10){return ul(a10.entries())}ig(xK,bd,[0,function(a10){return new fO},[0,function(d10){var a10=d10[kh].keys.entries();return iS(ay,xI,function(a11,b10,c10){var e10=jx(xH(d10),a11);return fL[2].call(null,a11,[0,b10[1],e10,b10[3]],c10)},a10,fL[1])}],jx,function(a10,b10,c10){var d10=c10[1],e10=bD<=d10?(a0<=d10,c10[2]):(w<=d10,c10[2]);return a10.set(v(b10),e10),0},function(a10,b10){return a10.delete(v(b10)),0},jy,function(a10,d10,c10){return iS(ay,fP,function(a11,b10,c11){return y(d10,a11,b10,c11)},jy(a10),c10)},function(a10,b10){function c10(a11){return h(b10,a11)}return a10.observe(c10),c10}]);var xL=dO.Doc;function jz(a10,b10){return a10.getArray(v(b10))}function bx(a10,b10){return a10.transact(bJ(1,b10)),0}function fQ(a10){return a10}var am=bd[4],aX=bd[3],cG=bd[1],dP=b7[5],fR=b7[4],jA=b7[3],jB=b7[1];function xu(a10){var b10=a10[1];return[0,function(a11){return iP(b10,a11)}(a10[2][kh].delta)]}function xv(a10,b10){var c10=a10?[0,v(a10[1])]:[0];return l6(fM,c10)}function xM(a10){return new xL}var xN=bd[8],xO=bd[7],xP=bd[5],xQ=bd[2][1],xR=b7[6];function xS(a10){return a10}var xT=B7(0).Awareness;function xV(a10,b10,c10){a10.setLocalStateField(v(b10),c10)}function jC(a10){return a10}function xU(a10){return new xT(a10)}function xW(a10,b10,c10,d10){if(c10)var f10=[0,xX,v(c10[1])],e10=[0,[0,xY,v(b10)],f10];else var e10=[0,[0,x0,v(b10)]];return xV(a10,xZ,gU(e10))}var x1=B8(0);function x2(a10,b10){var c10=b10;new x1(v(a10),c10)}var x3=B$(0);function fS(a10,b10,c10){switch(b10){case 0:a10.on(v(x_),bJ(1,function(a11){return h(c10,[0,a11.connected|0])}));return;case 1:a10.on(v(x$),bJ(1,function(a11){return h(c10,[0,a11[lo]|0])}));return;default:a10.on(v(ye),bJ(1,function(b11){function a11(a12){return function(a13){return iR(ay,a13)}(b11[a12])}var d10=a11(ya),e10=a11(yb),f10=a11(yc);return h(c10,[0,a11(yd),f10,e10,d10])}));return}}function x4(a10,b10,c10,d10){var f10=cj(function(a11){return[0,x5,fr(v,a11)]},b10),e10=[0,[0,x8,{config:{iceServers:fr(function(a11){return a11},c4(function(a11){return{urls:v(h(A(x7),a11))}},x6))}}]];aF([0,e10,0]);function g10(a11){return a11}var i10=gU(c7(function(a11){return hc(g10,a11)}([0,f10,[0,e10,[0,cj(function(a11){return[0,x9,a11]},c10),0]]]))),j10=d10;return new x3(v(a10),j10,i10)}var jD=B9(0),yf=B_(0);function yh(a10){switch(a10){case 0:var b10=yi;break;case 1:var b10=yj;break;case 2:var b10=yk;break;case 3:var b10=yl;break;default:var b10=ym}return v(b10)}function yg(a10,b10){jD.register(v(a10),b10)}function yn(a10,b10,c10,d10){var e10=a10?a10[1]:0,f10=e10?yo:yr,g10=cj(function(a11){return[0,yp,!!a11]},b10),h10=gU(c7(hc(function(a11){return a11},[0,g10,[0,cj(function(a11){return[0,yq,fr(yh,a11[1])]},c10),0]])));return{theme:v(f10),modules:h10}}function ys(a10,b10){return new jD(a10,b10)}function yt(a10){return a10}var yu=Ca(0).QuillBinding;function yv(a10,b10,c10){var d10=mK(cj(jC,a10)),e10=[0,c10,d10];function f10(a11,b11){l6(a11,b11)}return function(a11){return f10(yu,a11)}(c7([0,b10,e10]))}function yw(a10,b10,c10){return y(eN(s,yx),b10,c10,a10)}function jE(a10,b10,c10){var d10=0<=c10?1:0;if(d10)var e10=0<=b10?1:0,f10=e10&&((b10+c10|0)<=a10?1:0);else var f10=d10;var g10=1-f10;return g10&&yw(a10,b10,c10)}var yy=[0];function yz(a10,b10,c10,d10){var e10=ap(a10,b10);return cm(c10,0,e10,0,d10),e10}function jF(a10,b10){return b10<=a10?a10:b10}function jG(a10){return eN(s,a10)}function yA(a10,b10){var c10=a10[1];return i(jG(yB),b10,c10)}function yC(a10,b10){return i(jG(yD),a10,b10.length-1)}function cH(a10,b10){var c10=1-(a10<=b10.length-1?1:0);return c10&&yC(a10,b10)}function jH(a10){return[0,0,0,yy]}function cI(a10){return a10[1]}function yE(a10,b10){return a10[3][1+b10]}function jI(a10){var b10=a10[1],c10=a10[3];if(cH(b10,c10),0>>4|0));var f11=b11+1|0;function i11(a11,b12,c12){at(a11,b12,c12)}return function(a11){return i11(d11,f11,a11)}(h10(g10,c11&15))}for(;!(4<=d10[1]);){var n10=D(b10,d10[1]);f10(e10,c10[1],n10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(6<=d10[1]);){var m10=D(b10,d10[1]);f10(e10,c10[1],m10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(8<=d10[1]);){var l10=D(b10,d10[1]);f10(e10,c10[1],l10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(10<=d10[1]);){var k10=D(b10,d10[1]);f10(e10,c10[1],k10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;;){if(16<=d10[1])return $(e10);var j10=D(b10,d10[1]);f10(e10,c10[1],j10),c10[1]=c10[1]+2|0,d10[1]++}}var yR=hG(0),an=xM(0),fU=xU(an);yg(yT,yf),xW(fU,yU,0,0);var dQ=x4(yW,yV,[0,fU],an);x2(yX,an),dG.yjsdoc=an,dG.yjsprovider=dQ;var fV=ae(0),jL=ae(0),jM=ae(0);fS(dQ,0,function(a10){var b10=a10[1];return b5([0,yY,[0,!!b10,0]]),ab(jL,b10)}),fS(dQ,1,function(a10){var b10=a10[1];return b5([0,yZ,[0,!!b10,0]]),ab(jM,b10)});var dR=[0,0];fS(dQ,2,function(a10){b5([0,y0,[0,a10,0]]);function c10(b11){return m3(function(a11){return ez(b11,a11)},a10[3])}function d10(b11){var c11=[0,0];return dR[1]=hb(function(a11){return ez(b11,a11)?(c11[1]=[0,b11],1):0},dR[1]),c11[1]}var b10=eu(function(a11,b11){return d10(b11)?a11:(c10(b11)&&(dR[1]=[0,b11,dR[1]]),a11+1|0)},0,a10[1]),e10=es(a10[2]);return function(a11){return ab(fV,a11)}((bq(fV)+b10|0)-e10|0)});var y4=jM,y6=cF(y5,al([0,82,bY(jL,y4,function(a10,b10){var c10=a10?b10?y1:y2:y3;return[0,c10]})])),y8=K(0,[0,y6],0,0,[0,[0,80,aW(0,y7)],0]),y9=[0,[0,82,y8],[0,[0,82,k(fV,function(a10){return aW(0,ms(a10))})],0]];function yS(a10){return yO(yR,0)}function za(a10,b10){var c10=a10?a10[1]:64,d10=ip(0);return[0,d10,hL(0,c10)]}function jN(a10,b10,c10){var e10=hM(a10[2],b10);if(e10)var d10=e10[1];else{var g10=e_(0,a10[1]);hN(a10[2],b10,g10);var d10=g10}var f10=e$(d10);return f10?ab(f10[1][2],[0,c10]):s2(d10,[0,b10,ae([0,c10])])}function fW(a10,b10){var c10=hM(a10[2],b10);if(c10)var d10=c10[1];else{var f10=a10[1],e10=e_([0,[0,b10,ae(0)]],f10);hN(a10[2],b10,e10);var d10=e10}return c3(e$(d10))[2]}function fX(a10,b10){return k(fW(a10,b10),function(a11){if(!a11)return 0;var b11=a11[1];if(typeof b11!="number"&&U===b11[1])return[0,ay(b11[2])];throw g([0,f,zb],1)})}function zc(a10){var b10=ip(0);return[0,b10,jH(0)]}function zd(a10){try{var c10=[0,jK(a10[2],0)];return c10}catch(f10){var b10=M(f10);if(b10[1]===cb)return 0;throw g(b10,0)}}function jO(a10,b10){var c10=e_(a10,b10[1]);return yH(b10[2],c10)}function jP(a10,b10,c10,d10){var e10=[0,b10,[0,c10,[0,cI(d10),0]]];b5([0,ze,[0,cI(a10),e10]]);var f10=cI(d10),g10=jK(a10,0);return fT(d10,hj(c10,function(a11){return g10})),yL(a10,b10,d10,f10,c10)}function zf(i10,b10,c10){var e10=[0,0],j10=i10[2],d10=jH(0);hk(function(a11){switch(a11[0]){case 0:var m10=a11[1];return jP(j10,e10[1],m10,d10),e10[1]=e10[1]+m10|0,0;case 1:var c11=a11[1];if(cI(d10)!==0){var o10=[0,jI(d10)];return fT(d10,hl(function(a12){var d11=h(b10,a12),c12=sY([0,d11],o10[1]);return o10[1]=c12,c12},c11))}var n10=zd(i10);if(!n10)return hk(function(a12){var c12=h(b10,a12);return jO([0,c12],[0,i10[1],d10])},c11);var s10=n10[1];return fT(d10,hl(function(a12){return sW([0,h(b10,a12)],s10)},c11));default:var k11=a11[1],t10=e10[1]===0?tE(i10[1]):iw(jI(d10)),p10=[0,t10],u10=1;if(k11>=1)for(var l10=u10;;){var q10=p10[1];if(!q10)throw g([0,f,zg],1);var r10=q10[1];p10[1]=iw(r10),s5(r10);var v10=l10+1|0;if(k11===l10)break;l10=v10}return e10[1]=e10[1]+k11|0,0}},c10);var k10=e10[1],a10=cI(j10)-k10|0;return 0 ",zM=[0,0],zK=[0,0],zL=[0,80,"Update"],zG=e,zH=e,zI=[0,80,[0,"cell-edit-btn"]],zJ="\xE2\x9C\x8F\xEF\xB8\x8F",zP=[0,80,[0,"cell-edit-overlay"]],zQ=[0,80,[0,gm]],zr="GET",zq=[0,B,479,17],zp=[0,B,494,11],zu=[0,B,509,19],zt=[0,B,519,13],zs=[0,B,kE,13],zv=[0,B,526,11],zB=[0,B,k$,19],zA=[0,B,539,19],zw=[0,B,532,13],zy=[0,B,548,15],zz=[0,B,552,15],zx=[0,B,kz,11],zD=e,zE=[0,B,565,17],zC=[0,B,568,11],zk=bx,zl=ki,ze="New column kind:",zc=[0,B,354,13],y_=dZ,y$=b4,za=dV,zb=cL,y6="Old value:",y7="Action: delete",y8="Key:",y9=[0,B,279,15],y5="On_change",y4=[0,B,204,22],y2="[blit v(%i) %i %i v'(%i)]",yZ=[0,B,147,18],yN=lf,yO="orange",yP=lj,yM="Received peers",yL="Received synced",yK="Received connected",yF="modules/cursors",yG="Narines",yH=[0,[0,"wss://p2p.u31.fr",0]],yI="testroom5267564",yJ="zedoc",yR=[0,80,[0,"p2p_status_icon"]],yT="\xE2\x99\xBC",yW=[0,80,[0,"p2p_status"]],zh=bx,zi=ki,AC=[0,80,"Add table"],AF=[0,80,[0,kX]];function y(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return[0,y(a10[1])];case 1:return[1,y(a10[1])];case 2:return[2,y(a10[1])];case 3:return[3,y(a10[1])];case 4:return[4,y(a10[1])];case 5:return[5,y(a10[1])];case 6:return[6,y(a10[1])];case 7:return[7,y(a10[1])];case 8:var c10=a10[1];return[8,c10,y(a10[2])];case 9:var b10=a10[1];return[9,b10,b10,y(a10[3])];case 10:return[10,y(a10[1])];case 11:return[11,y(a10[1])];case 12:return[12,y(a10[1])];case 13:return[13,y(a10[1])];default:return[14,y(a10[1])]}}function X(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,X(a10[1],b10)];case 1:return[1,X(a10[1],b10)];case 2:return[2,X(a10[1],b10)];case 3:return[3,X(a10[1],b10)];case 4:return[4,X(a10[1],b10)];case 5:return[5,X(a10[1],b10)];case 6:return[6,X(a10[1],b10)];case 7:return[7,X(a10[1],b10)];case 8:var c10=a10[1];return[8,c10,X(a10[2],b10)];case 9:var d10=a10[2],e10=a10[1];return[9,e10,d10,X(a10[3],b10)];case 10:return[10,X(a10[1],b10)];case 11:return[11,X(a10[1],b10)];case 12:return[12,X(a10[1],b10)];case 13:return[13,X(a10[1],b10)];default:return[14,X(a10[1],b10)]}}function w(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,w(a10[1],b10)];case 1:return[1,w(a10[1],b10)];case 2:var c10=a10[1];return[2,c10,w(a10[2],b10)];case 3:var d10=a10[1];return[3,d10,w(a10[2],b10)];case 4:var e10=a10[3],f10=a10[2],g10=a10[1];return[4,g10,f10,e10,w(a10[4],b10)];case 5:var h10=a10[3],i10=a10[2],j10=a10[1];return[5,j10,i10,h10,w(a10[4],b10)];case 6:var k10=a10[3],l10=a10[2],m10=a10[1];return[6,m10,l10,k10,w(a10[4],b10)];case 7:var n10=a10[3],o10=a10[2],p10=a10[1];return[7,p10,o10,n10,w(a10[4],b10)];case 8:var q10=a10[3],r10=a10[2],s10=a10[1];return[8,s10,r10,q10,w(a10[4],b10)];case 9:var t10=a10[1];return[9,t10,w(a10[2],b10)];case 10:return[10,w(a10[1],b10)];case 11:var u10=a10[1];return[11,u10,w(a10[2],b10)];case 12:var v10=a10[1];return[12,v10,w(a10[2],b10)];case 13:var x10=a10[2],y10=a10[1];return[13,y10,x10,w(a10[3],b10)];case 14:var z10=a10[2],A10=a10[1];return[14,A10,z10,w(a10[3],b10)];case 15:return[15,w(a10[1],b10)];case 16:return[16,w(a10[1],b10)];case 17:var B10=a10[1];return[17,B10,w(a10[2],b10)];case 18:var C2=a10[1];return[18,C2,w(a10[2],b10)];case 19:return[19,w(a10[1],b10)];case 20:var D2=a10[2],E2=a10[1];return[20,E2,D2,w(a10[3],b10)];case 21:var F2=a10[1];return[21,F2,w(a10[2],b10)];case 22:return[22,w(a10[1],b10)];case 23:var G2=a10[1];return[23,G2,w(a10[2],b10)];default:var H2=a10[2],I2=a10[1];return[24,I2,H2,w(a10[3],b10)]}}function a4(a10){throw g([0,b_,a10],1)}function s(a10){throw g([0,b9,a10],1)}function c0(a10){return 0<=a10?a10:-a10|0}var g4=kG;function aM(a10,b10){return a10+b10}function mn(b10){var e10=n(b10);return function(a10){for(var c10=a10;;){if(e10<=c10)return aM(b10,mo);var d10=D(b10,c10);a:{if(48<=d10){if(58>d10)break a}else if(d10===45)break a;return b10}c10=c10+1|0}}(0)}function mr(a10,b10,c10,d10){for(var f10=a10,e10=b10,g10=c10;;){if(!g10){f10[1+e10]=d10;return}var h10=g10[2],i10=g10[1];if(!h10){f10[1+e10]=[0,i10,d10];return}var j10=h10[2],k10=h10[1];if(!j10){f10[1+e10]=[0,i10,[0,k10,d10]];return}var l10=[0,j10[1],aJ],m10=j10[2];f10[1+e10]=[0,i10,[0,k10,l10]],f10=l10,e10=1,g10=m10}}BF(0);var en=l3(1),ah=l3(2);function ca(a10,b10){gT(a10,b10,0,n(b10))}function g5(a10,b10,c10,d10){return 0<=c10&&0<=d10&&(n(b10)-d10|0)>=c10?gT(a10,b10,c10,d10):s(ms)}function g6(a10){return ca(ah,a10),l4(ah,10),bF(ah)}var eo=[0,function(a10){return function(a11){for(var b10=a11;;){if(!b10)return 0;var d10=b10[2],e10=b10[1];try{bF(e10)}catch(f10){var c10=P(f10);if(c10[1]!==g3)throw g(c10,0)}b10=d10}}(BG(0))}],g7=[0,function(a10){}];function ep(a10){return h(g7[1],0),h(gD(eo),0)}gX(le,ep);function cb(a10){return bF(a10)}function mi(a10){return a10^-1}function mj(a10){return a10?mk:ml}function mm(a10){return e+a10}function mp(a10){return mn(gI("%.12g",a10))}function mq(a10,b10){if(!a10)return b10;var c10=a10[2],d10=a10[1];if(!c10)return[0,d10,b10];var e10=c10[2],f10=c10[1];if(!e10)return[0,d10,[0,f10,b10]];var g10=[0,e10[1],aJ];return mr(g10,1,e10[2],b10),[0,d10,[0,f10,g10]]}function mt(c10){for(;;){var a10=gD(eo);let d10=[0,1],e10=a10;var b10=1-gC(eo,a10,function(a11){return gC(d10,1,0)&&h(c10,0),h(e10,0)});if(!b10)return b10}}function mu(a10,b10){l4(a10,b10)}var eq2=BS(0),cc=(4*eq2|0)-1|0;function mv(a10){return 1-(typeof a10=="number"?1:0)}function g8(a10,b10,c10){return gC(a10,b10,c10)}function cd(a10){return gD(a10)}function ce(a10){return[0,a10]}function mw(a10,b10){return AR(a10,b10)}var my=[r,mx,an(0)];function mz(a10){var d10=a10[1];a10[1]=0;try{var c10=h(d10,0);return a10[1]=c10,l0(a10),c10}catch(f10){var b10=P(f10);throw a10[1]=function(a11){throw g(b10,0)},Bu(a10),g(b10,0)}}function mA(a10){var c10=a10[1];a10[1]=0;var b10=h(c10,0);return a10[1]=b10,l0(a10),b10}function mB(a10,b10){if(Bv(b10)===0)return a10?mA(b10):mz(b10);throw g(my,1)}function mC(a10){return mB(0,a10)}function c1(a10){return a10?a10[1]:s(mD)}function cf(a10,b10){return b10?[0,h(a10,b10[1])]:0}function g9(a10){return a10?1:0}function mE(a10){return a10?[0,a10[1],0]:0}function mF(a10){a:{if(40<=a10){if(a10===92)return mG;if(gg>a10)break a}else{if(32<=a10){if(39<=a10)return mH;break a}if(14>a10)switch(a10){case 8:return mI;case 9:return mJ;case 10:return mK;case 13:return mL}}var b10=C(4);return A(b10,0,92),A(b10,1,48+(a10/gp|0)|0),A(b10,2,48+((a10/10|0)%10|0)|0),A(b10,3,48+(a10%10|0)|0),ej(b10)}var c10=C(1);return A(c10,0,a10),ej(c10)}function mM(a10){return 25>>0?a10:a10-32|0}function mN(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function er(a10){return mN(0,a10)}function bJ(a10,b10){for(var c10=a10,d10=b10;;){if(!c10)return d10;var e10=[0,c10[1],d10];c10=c10[2],d10=e10}}function cg(a10){return bJ(a10,0)}function mR(a10,b10,c10){if(b10>1,s10=p10(r10,b11),D2=s10[1],t10=p10(a11-r10|0,s10[2]),E2=t10[2];return[0,B10(D2,t10[1],0),E2]}function p10(a11,b11){if(a11===2){if(b11){var j10=b11[2];if(j10){var k10=j10[1],g10=b11[1],B11=j10[2],q10=i(d10,g10,k10),C2=q10===0?[0,g10,0]:0>1,s10=h10(r10,b11),D2=s10[1],t10=h10(a11-r10|0,s10[2]),E2=t10[2];return[0,A10(D2,t10[1],0),E2]}var a10=er(b10);return 2<=a10?h10(a10,b10)[1]:b10}function m2(a10,b10){return lW(a10,b10)}function m3(a10,b10){return a10<=b10?a10:b10}function m4(a10,b10){return b10<=a10?a10:b10}function m5(a10){return e+a10}function bk(a10,b10){var c10=C(a10);return A5(c10,0,a10,b10),c10}var m6=C(0);function m7(a10){var b10=av(a10),c10=C(b10);return a1(a10,0,c10,0,b10),c10}function eu(a10,b10,c10){if(0<=b10&&0<=c10&&(av(a10)-c10|0)>=b10){var d10=C(c10);return a1(a10,b10,d10,0,c10),d10}return s(m9)}function ev(a10,b10,c10){return ej(eu(a10,b10,c10))}function ha(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(av(a10)-e10|0)>=b10&&0<=d10&&(av(c10)-e10|0)>=d10){a1(a10,b10,c10,d10,e10);return}return s(m_)}function ax(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(n(a10)-e10|0)>=b10&&0<=d10&&(av(c10)-e10|0)>=d10){cR(a10,b10,c10,d10,e10);return}return s(m$)}function hb(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function nc(a10,b10){var d10=av(b10);if(d10===0)return b10;var e10=C(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){A(e10,c10,h(a10,bB(b10,c10)));var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function hc(a10,b10,c10){lH(a10,b10,Bg(c10))}function hd(a10,b10,c10){au(a10,b10,c10)}function he(a10,b10){return AX(a10,b10)}function ch(a10){return bg(a10)}function $(a10){return ej(a10)}function m8(a10){return m7(bg(a10))}function na(a10){for(var d10=av(a10),b10=[0,0];!(b10[1]>=d10||!hb(bB(a10,b10[1])));)b10[1]++;for(var c10=[0,d10-1|0];;){if(b10[1]<=c10[1]&&hb(bB(a10,c10[1]))){c10[1]--;continue}return b10[1]<=c10[1]?eu(a10,b10[1],(c10[1]-b10[1]|0)+1|0):m6}}function nb(a10){var b10=[0,0],j10=av(a10)-1|0,l10=0;if(j10>=0)for(var g10=l10;;){var e10=bB(a10,g10);a:{b:{c:{if(32<=e10){var h10=e10-34|0;if(58>>0){if(93<=h10)break c}else if(56>>0)break b;var i10=1;break a}if(11<=e10){if(e10===13)break b}else if(8<=e10)break b}var i10=4;break a}var i10=2}b10[1]=b10[1]+i10|0;var o10=g10+1|0;if(j10===g10)break;g10=o10}if(b10[1]===av(a10))return a10;var c10=C(b10[1]);b10[1]=0;var k10=av(a10)-1|0,m10=0;if(k10>=0)for(var f10=m10;;){var d10=bB(a10,f10);a:{b:{c:{if(35<=d10){if(d10!==92){if(gg<=d10)break c;break b}}else{if(32>d10){if(14<=d10)break c;switch(d10){case 8:A(c10,b10[1],92),b10[1]++,A(c10,b10[1],98);break a;case 9:A(c10,b10[1],92),b10[1]++,A(c10,b10[1],116);break a;case 10:A(c10,b10[1],92),b10[1]++,A(c10,b10[1],110);break a;case 13:A(c10,b10[1],92),b10[1]++,A(c10,b10[1],114);break a;default:break c}}if(34>d10)break b}A(c10,b10[1],92),b10[1]++,A(c10,b10[1],d10);break a}A(c10,b10[1],92),b10[1]++,A(c10,b10[1],48+(d10/gp|0)|0),b10[1]++,A(c10,b10[1],48+((d10/10|0)%10|0)|0),b10[1]++,A(c10,b10[1],48+(d10%10|0)|0);break a}A(c10,b10[1],d10)}b10[1]++;var n10=f10+1|0;if(k10===f10)break;f10=n10}return c10}function nd(a10){return nc(mM,a10)}function ne(a10,b10){return AY(a10,b10)}function nf(a10,b10,c10){lH(a10,b10,c10)}function c3(a10,b10){return $(bk(a10,b10))}function ew(a10,b10,c10){return $(eu(ch(a10),b10,c10))}function hf(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function ni(a10,b10,c10,d10){for(var e10=c10;;){if(b10<=e10)throw g(a5,1);if(_(a10,e10)===d10)return e10;e10=e10+1|0}}function nj(a10,b10,c10){var d10=n(a10);if(0<=b10&&d10>=b10)try{ni(a10,d10,b10,c10);var f10=1;return f10}catch(f11){var e10=P(f11);if(e10===a5)return 0;throw g(e10,0)}return s(nk)}function ex(a10,b10){return l_(a10,b10)}function c4(a10,b10){return ne(ch(a10),b10)}function ey(a10,b10){return a10===b10?1:0}function ng(a10){return a10===e||!hf(_(a10,0))&&!hf(_(a10,n(a10)-1|0))?a10:$(na(ch(a10)))}function nh(a10){return $(nb(ch(a10)))}function nl(a10,b10){return nj(a10,0,b10)}function nm(a10){return $(nd(ch(a10)))}function hg(a10,b10){if(a10===0)return[0];if(0>a10)return s(nn);var d10=ap(a10,h(b10,0)),e10=a10-1|0,f10=1;if(e10>=1)for(var c10=f10;;){d10[1+c10]=h(b10,c10);var g10=c10+1|0;if(e10===c10)break;c10=g10}return d10}function ci(a10,b10,c10,d10,e10){return 0<=e10&&0<=b10&&(a10.length-1-e10|0)>=b10&&0<=d10&&(c10.length-1-e10|0)>=d10?AO(a10,b10,c10,d10,e10):s(nq)}function hh(a10,b10){var d10=b10.length-2|0,e10=0;if(d10>=0)for(var c10=e10;;){h(a10,b10[1+c10]);var f10=c10+1|0;if(d10===c10)break;c10=f10}return 0}function hi(a10,b10){var d10=b10.length-1;if(d10===0)return[0];var e10=ap(d10,h(a10,b10[1])),f10=d10-1|0,g10=1;if(f10>=1)for(var c10=g10;;){e10[1+c10]=h(a10,b10[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function nr(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function c5(a10){if(!a10)return[0];var b10=a10[2],c10=a10[1],e10=ap(nr(0,a10),c10);return function(a11,b11){for(var d10=a11,c11=b11;;){if(!c11)return e10;var f10=c11[2];e10[1+d10]=c11[1],d10=d10+1|0,c11=f10}}(1,b10)}function no(a10,b10,c10){return 0<=b10&&0<=c10&&(a10.length-1-c10|0)>=b10?AQ(a10,b10,c10):s(np)}function ns(k10){function h10(a10){return a10?a10[4]:0}function d10(a10,b11,c11){var d11=a10?a10[4]:0,e11=c11?c11[4]:0,f10=e11<=d11?d11+1|0:e11+1|0;return[0,a10,b11,c11,f10]}function j10(a10,b11,c11){var g10=a10?a10[4]:0,i10=c11?c11[4]:0;if((i10+2|0)=i10){var w10=i10<=g10?g10+1|0:i10+1|0;return[0,a10,b11,c11,w10]}if(!c11)return s(nw);var k11=c11[3],m11=c11[2],f10=c11[1],r10=h10(f10);if(r10<=h10(k11))return d10(d10(a10,b11,f10),m11,k11);if(!f10)return s(nv);var t10=f10[2],u10=f10[1],v10=d10(f10[3],m11,k11);return d10(d10(a10,b11,u10),t10,v10)}function c10(a10,b11){if(!b11)return[0,0,a10,0,1];var d11=b11[3],e11=b11[2],f10=b11[1],g10=i(k10[1],a10,e11);if(g10===0)return b11;if(0<=g10){var h11=c10(a10,d11);return d11===h11?b11:j10(f10,e11,h11)}var l10=c10(a10,f10);return f10===l10?b11:j10(l10,e11,d11)}function b10(a10){return[0,0,a10,0,1]}var m10=0;function e10(a10,b11){for(var d11=a10,c11=b11;;){if(!c11)return d11;var f10=c11[2],g10=c11[1];d11=[0,f10,e10(d11,c11[3])],c11=g10}}function n10(a10){function c11(a11,b11){if(3>=a11>>>0)switch(a11){case 0:return[0,0,b11];case 1:if(b11)return[0,[0,0,b11[1],0,1],b11[2]];break;case 2:if(b11){var h11=b11[2];if(h11)return[0,[0,[0,0,b11[1],0,1],h11[1],0,2],h11[2]]}break;default:if(b11){var i10=b11[2];if(i10){var j11=i10[2];if(j11)return[0,[0,[0,0,b11[1],0,1],i10[1],[0,0,j11[1],0,1],2],j11[2]]}}}var k11=a11/2|0,l10=c11(k11,b11),e11=l10[2],n11=l10[1];if(!e11)throw g([0,f,nx],1);var o10=e11[1],m11=c11((a11-k11|0)-1|0,e11[2]),p10=m11[2];return[0,d10(n11,o10,m11[1]),p10]}return c11(er(a10),a10)[1]}return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a10){return e10(0,a10)},,,,,,,,,,,,,,,,,,,function(a10){if(!a10)return m10;var f10=a10[2],d11=a10[1];if(!f10)return b10(d11);var g10=f10[2],e11=f10[1];if(!g10)return c10(e11,b10(d11));var h11=g10[2],i10=g10[1];if(!h11)return c10(i10,c10(e11,b10(d11)));var j11=h11[2],l10=h11[1];if(!j11)return c10(l10,c10(i10,c10(e11,b10(d11))));if(j11[2])return n10(m1(k10[1],a10));var o10=j11[1];return c10(o10,c10(l10,c10(i10,c10(e11,b10(d11)))))}]}function ny(a10){var b10=ns(a10);return[0,,,,,,,,,,b10[39],,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[58]]}function nz(n10){function h10(a10){return a10?a10[5]:0}function e10(a10,b10,c10,d11){var e11=h10(a10),f11=h10(d11),g11=f11<=e11?e11+1|0:f11+1|0;return[0,a10,b10,c10,d11,g11]}function j10(a10,b10,c10,d11){var i10=a10?a10[5]:0,j11=d11?d11[5]:0;if((j11+2|0)=j11){var B10=j11<=i10?i10+1|0:j11+1|0;return[0,a10,b10,c10,d11,B10]}if(!d11)return s(nD);var l10=d11[4],o10=d11[3],p10=d11[2],g11=d11[1],w10=h10(g11);if(w10<=h10(l10))return e10(e10(a10,b10,c10,g11),p10,o10,l10);if(!g11)return s(nC);var x10=g11[3],y10=g11[2],z10=g11[1],A10=e10(g11[4],p10,o10,l10);return e10(e10(a10,b10,c10,z10),y10,x10,A10)}function f10(a10,b10,c10){if(!c10)return[0,0,a10,b10,0,1];var d11=c10[4],g11=c10[3],h11=c10[2],e11=c10[1],o10=c10[5],k10=i(n10[1],a10,h11);if(k10===0)return g11===b10?c10:[0,e11,a10,b10,d11,o10];if(0<=k10){var l10=f10(a10,b10,d11);return d11===l10?c10:j10(e11,h11,g11,l10)}var m10=f10(a10,b10,e11);return e11===m10?c10:j10(m10,h11,g11,d11)}function d10(a10,b10){for(var c10=b10;;){if(!c10)return 0;var e11=c10[4],f11=c10[3],g11=c10[2];d10(a10,c10[1]),i(a10,g11,f11),c10=e11}}function g10(a10,b10,c10){for(var d11=b10,e11=c10;;){if(!d11)return e11;var f11=d11[4],h11=d11[3],i10=d11[2],j11=x(a10,i10,h11,g10(a10,d11[1],e11));d11=f11,e11=j11}}return[0,,,,,0,,f10,,,,,,,,,,,,,,,,,,,,d10,,,g10]}function hj(a10){var b10=nz(a10);return[0,b10[5],b10[7],,,,,,,,,,,,,,,,,,,,,b10[27],b10[30]]}var ez=[r,nE,an(0)];function bK(a10){return[0,0,0]}function cj(a10){a10[1]=0,a10[2]=0}function a7(a10,b10){return b10[1]=[0,a10,b10[1]],b10[2]=b10[2]+1|0,0}function bL(a10){var b10=a10[1];if(!b10)return 0;var c10=b10[1];return a10[1]=b10[2],a10[2]=a10[2]-1|0,[0,c10]}function bM(a10){var b10=a10[1];return b10?[0,b10[1]]:0}function nF(a10){var b10=a10[1];if(!b10)throw g(ez,1);a10[1]=b10[2],a10[2]=a10[2]-1|0}function nG(a10){if(!a10[1])throw g(ez,1)}function nH(a10,b10){return a6(a10,b10[1])}var nJ=[r,nI,an(0)];function eA(a10){return[0,0,0,0]}function eB(a10){a10[1]=0,a10[2]=0,a10[3]=0}function eC(a10,b10){var c10=[0,a10,0],d10=b10[3];return d10?(b10[1]=b10[1]+1|0,d10[2]=c10,b10[3]=c10,0):(b10[1]=1,b10[2]=c10,b10[3]=c10,0)}function hk(a10){var b10=a10[2];if(!b10)throw g(nJ,1);var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,c10}return eB(a10),c10}function eD(a10){return a10[1]===0?1:0}function nK(a10){var b10=a10[2];return b10?[0,b10[1]]:0}function nL(a10){var b10=a10[2];if(!b10)return 0;var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,[0,c10]}return eB(a10),[0,c10]}function bl(a10){var b10=1<=a10?a10:1,c10=cc=(d10+b10|0));)c10[1]=2*c10[1]|0;cc=b10?ev(a10[1][1],b10,c10):s(nN)}function nO(a10){return a10[2]=0,0}function nQ(a10,b10){var c10=a10[2],d10=a10[1],e10=d10[1];d10[2]<=c10?(eE(a10,1),au(a10[1][1],a10[2],b10)):A(e10,c10,b10),a10[2]=c10+1|0}var eF=[0,0];function hn(a10){return a10}function ho(a10){return a10!==eF?1:0}function hp(a10){return a10}(function(a10){A3(ap(8,eF))})(0);var nS=ce(0),hq=ce(0);function nT(a10){for(;;){var b10=cd(hq),c10=1-g8(hq,b10,[0,a10,b10]);if(!c10)return c10}}function aN(a10,b10){var c10=[0,mw(nS,1),b10];return a10&&nT([0,c10,a10[1]]),c10}function hr(d10){for(;;){var a10=lK(0),b10=a10.length-1;if(d10e10){if(e10!==32){if(43>e10)break a;switch(e10-43|0){case 5:c:if(c10<(d10+2|0)&&1=(d10+1|0))break a;var f10=bk(d10+1|0,48);return au(f10,0,e10),ax(b10,1,f10,(d10-c10|0)+2|0,c10-1|0),$(f10)}if(71<=e10){if(5>>0)break a}else if(65>e10)break a}if(c10a10)return b10;var h10=[0,0],i10=n(b10)-1|0,o10=0;if(i10>=0)for(var d10=o10;;){9>=_(b10,d10)+lk>>>0&&h10[1]++;var r10=d10+1|0;if(i10===d10)break;d10=r10}var j10=h10[1],k10=C(n(b10)+((j10-1|0)/3|0)|0),l10=[0,0];function e10(a11){au(k10,l10[1],a11),l10[1]++}var f10=[0,((j10-1|0)%3|0)+1|0],m10=n(b10)-1|0,p10=0;if(m10>=0)for(var c10=p10;;){var g10=_(b10,c10);9>>0||(f10[1]===0&&(e10(95),f10[1]=3),f10[1]--),e10(g10);var q10=c10+1|0;if(m10===c10)break;c10=q10}return $(k10)}function pD(a10,b10){return c7(a10,eb(oK(a10),b10))}function pE(a10,b10){return c7(a10,eb(pa(a10),b10))}function pF(a10,b10){return c7(a10,eb(po(a10),b10))}function pG(a10,b10){return c7(a10,Bj(oY(a10),b10))}function aO(d10,b10,c10){function a10(a11){switch(d10[1]){case 0:var e11=45;break;case 1:var e11=43;break;default:var e11=32}return Be(c10,b10,e11)}function e10(a11){var b11=AZ(c10);return b11===3?c10<0?pI:pJ:4<=b11?pK:a11}function f10(b11){var e11=n(b11);return function(a11){for(var c11=a11;;){if(c11===e11)return 0;var d11=D(b11,c11)-46|0;a:{if(23>>0){if(d11===55)break a}else if(21>>0)break a;c11=c11+1|0;continue}return 1}}(0)?b11:aM(b11,pH)}switch(d10[2]){case 5:return e10(f10(gI(hx(d10,b10),c10)));case 6:return a10(0);case 7:return nm(a10(0));case 8:return e10(a10(0));default:return gI(hx(d10,b10),c10)}}function pL(a10){var b10=mF(a10),c10=n(b10),d10=bk(c10+2|0,39);return cR(b10,0,d10,1,c10),$(d10)}function pM(a10){var b10=ht(16);return eI(b10,a10),hv(b10)}function cF(a10,b10,c10,d10){for(var k10=b10,j10=c10,e10=d10;;){if(typeof e10=="number")return h(k10,j10);switch(e10[0]){case 0:var t10=e10[1];return function(a11){return o(k10,[5,j10,a11],t10)};case 1:var u10=e10[1];return function(a11){return o(k10,[4,j10,pL(a11)],u10)};case 2:return eJ(k10,j10,e10[2],e10[1],function(a11){return a11});case 3:return eJ(k10,j10,e10[2],e10[1],oJ);case 4:return c8(k10,j10,e10[4],e10[2],e10[3],pD,e10[1]);case 5:return c8(k10,j10,e10[4],e10[2],e10[3],pE,e10[1]);case 6:return c8(k10,j10,e10[4],e10[2],e10[3],pF,e10[1]);case 7:return c8(k10,j10,e10[4],e10[2],e10[3],pG,e10[1]);case 8:return pN(k10,j10,e10[4],e10[2],e10[3],e10[1]);case 9:return eJ(k10,j10,e10[2],e10[1],mj);case 10:j10=[7,j10],e10=e10[1];break;case 11:j10=[2,j10,e10[1]],e10=e10[2];break;case 12:j10=[3,j10,e10[1]],e10=e10[2];break;case 13:var v10=e10[3],x10=pM(e10[2]);return function(a11){return o(k10,[4,j10,x10],v10)};case 14:var y10=e10[3],z10=e10[2];return function(a11){return o(k10,j10,w(oI(a11[1],z10),y10))};case 15:var A10=e10[1];return function(c11,b11){return o(k10,[6,j10,function(a11){return i(c11,a11,b11)}],A10)};case 16:var B10=e10[1];return function(a11){return o(k10,[6,j10,a11],B10)};case 17:j10=[0,j10,e10[1]],e10=e10[2];break;case 18:var l10=e10[1];if(l10[0]===0){let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[0,a11]],d11)},j10=0,e10=l10[1][1]}else{let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[1,a11]],d11)},j10=0,e10=l10[1][1]}break;case 19:throw g([0,f,pP],1);case 20:var C2=e10[3],D2=[8,j10,pQ];return function(a11){return o(k10,D2,C2)};case 21:var E2=e10[2];return function(a11){return o(k10,[4,j10,eb(kq,a11)],E2)};case 22:var F2=e10[1];return function(a11){return o(k10,[5,j10,a11],F2)};case 23:var m10=e10[2],n10=e10[1];return a10<50?jV(a10+1|0,k10,j10,n10,m10):p(jV,[0,k10,j10,n10,m10]);default:var q10=e10[3],r10=e10[1],s10=h(e10[2],0);return a10<50?f0(a10+1|0,k10,j10,q10,r10,s10):p(f0,[0,k10,j10,q10,r10,s10])}}}function o(a10,b10,c10){return bI(cF(0,a10,b10,c10))}function jV(a10,b10,c10,d10,e10){if(typeof d10=="number")switch(d10){case 0:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 1:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 2:throw g([0,f,pR],1);default:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10])}switch(d10[0]){case 0:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 1:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 2:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 3:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 4:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 5:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 6:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 7:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 8:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);case 9:var h10=d10[2];return a10<50?f1(a10+1|0,b10,c10,h10,e10):p(f1,[0,b10,c10,h10,e10]);case 10:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10]);default:return a10<50?q(a10+1|0,b10,c10,e10):p(q,[0,b10,c10,e10])}}function f1(a10,h10,c10,d10,e10){if(typeof d10=="number")return a10<50?q(a10+1|0,h10,c10,e10):p(q,[0,h10,c10,e10]);switch(d10[0]){case 0:var b10=d10[1];return function(a11){return ai(h10,c10,b10,e10)};case 1:var i10=d10[1];return function(a11){return ai(h10,c10,i10,e10)};case 2:var j10=d10[1];return function(a11){return ai(h10,c10,j10,e10)};case 3:var k10=d10[1];return function(a11){return ai(h10,c10,k10,e10)};case 4:var l10=d10[1];return function(a11){return ai(h10,c10,l10,e10)};case 5:var m10=d10[1];return function(a11){return ai(h10,c10,m10,e10)};case 6:var n10=d10[1];return function(a11){return ai(h10,c10,n10,e10)};case 7:var o10=d10[1];return function(a11){return ai(h10,c10,o10,e10)};case 8:var r10=d10[2];return function(a11){return ai(h10,c10,r10,e10)};case 9:var s10=d10[3],t10=d10[2],u10=I(E(d10[1]),t10);return function(a11){return ai(h10,c10,X(u10,s10),e10)};case 10:var v10=d10[1];return function(a11,b11){return ai(h10,c10,v10,e10)};case 11:var w10=d10[1];return function(a11){return ai(h10,c10,w10,e10)};case 12:var x10=d10[1];return function(a11){return ai(h10,c10,x10,e10)};case 13:throw g([0,f,pS],1);default:throw g([0,f,pT],1)}}function ai(a10,b10,c10,d10){return bI(f1(0,a10,b10,c10,d10))}function q(a10,b10,c10,d10){var e10=[8,c10,pU];return a10<50?cF(a10+1|0,b10,e10,d10):p(cF,[0,b10,e10,d10])}function eJ(g10,f10,c10,d10,e10){if(typeof d10=="number")return function(a10){return o(g10,[4,f10,h(e10,a10)],c10)};if(d10[0]===0){var b10=d10[2],i10=d10[1];return function(a10){return o(g10,[4,f10,ad(i10,b10,h(e10,a10))],c10)}}var j10=d10[1];return function(a10,b11){return o(g10,[4,f10,ad(j10,a10,h(e10,b11))],c10)}}function c8(k10,j10,h10,d10,e10,f10,g10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,bO(a10,i(f10,g10,b11))],h10)}:function(a10){return o(k10,[4,j10,i(f10,g10,a10)],h10)};var b10=e10[1];return function(a10){return o(k10,[4,j10,bO(b10,i(f10,g10,a10))],h10)}}if(d10[0]===0){var c10=d10[2],l10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,ad(l10,c10,bO(a10,i(f10,g10,b11)))],h10)}:function(a10){return o(k10,[4,j10,ad(l10,c10,i(f10,g10,a10))],h10)};var n10=e10[1];return function(a10){return o(k10,[4,j10,ad(l10,c10,bO(n10,i(f10,g10,a10)))],h10)}}var m10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(k10,[4,j10,ad(m10,a10,bO(b11,i(f10,g10,c11)))],h10)}:function(a10,b11){return o(k10,[4,j10,ad(m10,a10,i(f10,g10,b11))],h10)};var p10=e10[1];return function(a10,b11){return o(k10,[4,j10,ad(m10,a10,bO(p10,i(f10,g10,b11)))],h10)}}function pN(i10,h10,g10,d10,e10,f10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,aO(f10,a10,b11)],g10)}:function(a10){return o(i10,[4,h10,aO(f10,eH(f10),a10)],g10)};var b10=e10[1];return function(a10){return o(i10,[4,h10,aO(f10,b10,a10)],g10)}}if(d10[0]===0){var c10=d10[2],j10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,ad(j10,c10,aO(f10,a10,b11))],g10)}:function(a10){return o(i10,[4,h10,ad(j10,c10,aO(f10,eH(f10),a10))],g10)};var l10=e10[1];return function(a10){return o(i10,[4,h10,ad(j10,c10,aO(f10,l10,a10))],g10)}}var k10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(i10,[4,h10,ad(k10,a10,aO(f10,b11,c11))],g10)}:function(a10,b11){return o(i10,[4,h10,ad(k10,a10,aO(f10,eH(f10),b11))],g10)};var m10=e10[1];return function(a10,b11){return o(i10,[4,h10,ad(k10,a10,aO(f10,m10,b11))],g10)}}function f0(a10,b10,c10,d10,e10,f10){if(e10){var i10=e10[1];return function(a11){return pO(b10,c10,d10,i10,h(f10,a11))}}var g10=[4,c10,f10];return a10<50?cF(a10+1|0,b10,g10,d10):p(cF,[0,b10,g10,d10])}function pO(a10,b10,c10,d10,e10){return bI(f0(0,a10,b10,c10,d10,e10))}function aP(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=hw(c10[2]);return aP(a10,f10),ca(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aP(a10,e10),ca(a10,pV),c10=i10}else{var j10=d10[1];aP(a10,e10),ca(a10,pW),c10=j10}break;case 6:var m10=c10[2];return aP(a10,c10[1]),h(m10,a10);case 7:return aP(a10,c10[1]),cb(a10);case 8:var n10=c10[2];return aP(a10,c10[1]),s(n10);case 2:case 4:var k10=c10[2];return aP(a10,c10[1]),ca(a10,k10);default:var l10=c10[2];return aP(a10,c10[1]),mu(a10,l10)}}}function aQ(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=hw(c10[2]);return aQ(a10,f10),cl(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aQ(a10,e10),cl(a10,pX),c10=i10}else{var j10=d10[1];aQ(a10,e10),cl(a10,pY),c10=j10}break;case 6:var m10=c10[2];return aQ(a10,c10[1]),cl(a10,h(m10,0));case 7:c10=c10[1];break;case 8:var n10=c10[2];return aQ(a10,c10[1]),s(n10);case 2:case 4:var k10=c10[2];return aQ(a10,c10[1]),cl(a10,k10);default:var l10=c10[2];return aQ(a10,c10[1]),nQ(a10,l10)}}}function pZ(a10){var c10=a10[1],b10=bl(cJ);return o(function(a11){return aQ(b10,a11),a4(ck(b10))},0,c10)}function p0(c10){if(c10===e)return p1;var f10=n(c10);function j10(a11){return h(pZ(p2),c10)}function k10(a11){for(var b11=a11;;){if(b11===f10)return b11;var d11=D(c10,b11);if(d11!==9&&d11!==32)return b11;b11=b11+1|0}}var i10=k10(0),o10=function(a11,b11){for(var d11=b11;;){if(d11===f10||25>>0)return d11;d11=d11+1|0}}(i10,i10),a10=ew(c10,i10,o10-i10|0),d10=k10(o10),l10=function(a11,b11){for(var d11=b11;;){if(d11===f10)return d11;var e10=D(c10,d11);a:{if(48<=e10){if(58>e10)break a}else if(e10===45)break a;return d11}d11=d11+1|0}}(d10,d10);if(d10===l10)var m10=0;else try{var r10=lX(ew(c10,d10,l10-d10|0)),m10=r10}catch(f11){var p10=P(f11);if(p10[1]!==b_)throw g(p10,0);var q10=j10(0),m10=q10}k10(l10)!==f10&&j10(0);a:{if(a10!==e&&a10!==j4){if(a10==="h"){var b10=0;break a}if(a10==="hov"){var b10=3;break a}if(a10==="hv"){var b10=2;break a}if(a10!=="v"){var b10=j10(0);break a}var b10=1;break a}var b10=4}return[0,m10,b10]}function p3(d10,b10,c10){return o(function(a10){return aP(b10,a10),h(d10,b10)},0,c10[1])}function c9(a10,b10){return p3(function(a11){return 0},a10,b10)}function eK(a10){return c9(ah,a10)}function eL(c10,b10){return o(function(a10){var b11=bl(64);return aQ(b11,a10),h(c10,ck(b11))},0,b10[1])}function z(a10){return eL(function(a11){return a11},a10)}var eM=ce(0);function eO(a10,b10){var c10=a10[1+b10];return mv(c10)?bH(c10)===d2?h(z(p4),c10):bH(c10)===253?mp(c10):p5:h(z(p6),c10)}function hy(a10,b10){if(a10.length-1<=b10)return p7;var c10=hy(a10,b10+1|0),d10=eO(a10,b10);return i(z(p8),d10,c10)}function p9(a10){var b10=a10.length-1;if(2>=b10>>>0)switch(b10){case 0:return p$;case 1:return qa;default:var e10=eO(a10,1);return h(z(qb),e10)}var c10=hy(a10,2),d10=eO(a10,1);return i(z(p_),d10,c10)}function qc(d10){return function(a10){for(var b10=a10;;){if(!b10)return 0;var e10=b10[2],f10=b10[1];a:{try{var c10=h(f10,d10)}catch{break a}if(c10)return[0,c10[1]]}b10=e10}}(cd(eM))}function qd(a10){if(bH(a10)!==0)return[0,a10[1],0];var b10=a10[1][1];return[0,b10,[0,p9(a10)]]}function qe(a10){var b10=qd(a10),c10=b10[2],d10=b10[1];return c10?aM(d10,c10[1]):d10}function qf(a10){if(a10===em)return qg;if(a10===g2)return qh;if(a10[1]===g1){var b10=a10[2],e10=b10[3],i10=b10[2],j10=b10[1];return f4(z(eN),j10,i10,e10,e10+5|0,qi)}if(a10[1]===f){var c10=a10[2],g10=c10[3],k10=c10[2],l10=c10[1];return f4(z(eN),l10,k10,g10,g10+6|0,qj)}if(a10[1]!==b$)return qe(a10);var d10=a10[2],h10=d10[3],m10=d10[2],n10=d10[1];return f4(z(eN),n10,m10,h10,h10+6|0,qk)}function c_(a10){var b10=qc(a10);return b10?b10[1]:qf(a10)}function ql(a10){var b10=[0,A0(a10)];return b10}function qm(c10,b10){function a10(a11){return a11?c10===0?qn:qo:c10===0?qp:qq}if(b10[0]!==0){if(b10[1])return 0;var p10=a10(0);return[0,h(z(qw),p10)]}if(b10[3]===b10[6])var e10=b10[3],d10=h(z(qr),e10);else var n10=b10[6],o10=b10[3],d10=i(z(qv),o10,n10);var f10=b10[7],g10=b10[4],j10=b10[8]?qs:qu,k10=b10[2],l10=b10[9],m10=a10(b10[1]);return[0,AK(z(qt),m10,l10,k10,j10,d10,g10,f10)]}function qx(a10,b10){if(!b10)return c9(a10,qz);var d10=b10[1],e10=d10.length-2|0,g10=0;if(e10>=0)for(var c10=g10;;){var f10=qm(c10,j(d10,c10)[1+c10]);if(f10){var i10=f10[1];h(c9(a10,qy),i10)}var k10=c10+1|0;if(e10===c10)break;c10=k10}return 0}function c$(a10,b10){return qx(a10,ql(b10))}var qC=qB.slice();function qD(a10,b10){var e10=c_(a10);h(eK(qE),e10),c$(ah,b10);var c10=BE(0);if(c10<0){var d10=c0(c10);g6(j(qC,d10)[1+d10])}return cb(ah)}var qF=[0];function hz(a10){var b10=lN(0);return b10}function qG(a10,b10){try{var d10=b10?qF:hz(0);try{ep(0)}catch{}try{var f10=qD(a10,d10),e10=f10}catch(f11){var i10=P(f11),j10=hz(0),k10=c_(a10);h(eK(qI),k10),c$(ah,d10);var l10=c_(i10);h(eK(qJ),l10),c$(ah,j10);var e10=cb(ah)}return e10}catch(f11){var c10=P(f11);if(c10===em)return g6(qH);throw g(c10,0)}}gX(ls,function(a10,b10){try{var c10=qG(a10,b10);return c10}catch{return 0}});function qA(a10){for(;;){var b10=cd(eM),c10=1-g8(eM,b10,[0,a10,b10]);if(!c10)return c10}}function qK(a10){return lN(a10)}var qM=[r,qL,an(0)];qA(function(a10){return a10[1]===qM?[0,aM(qN,c_(a10[2]))]:0});function eP(a10){var b10=a10[1]<1?1:0,c10=b10||(64=0)for(var c10=i10;;){nf(d10,c10*8|0,cW(j(b10,c10)[1+c10]));var n10=c10+1|0;if(f10===c10)break;c10=n10}au(d10,e10*8|0,1);var g10=hA(d10);au(d10,e10*8|0,2);var h10=hA(d10),k10=c4(h10,8),l10=c4(h10,0),m10=c4(g10,8);return hC(a10,c4(g10,0),m10,l10,k10)}function qX(a10){var b10=hB(0);return qW(b10,a10),b10}function hE(a10){return qX(BU(0))}function bP(a10){return l1(a10)}function qY(a10){return lV(l1(a10))&1073741823}aN([0,function(a10){var b10=bP(a10),c10=bP(a10),d10=bP(a10);return hD(b10,c10,d10,bP(a10))}],function(a10){return hD(q2,q1,q0,qZ)});function q3(a10){var b10=a10.length-1<4?1:0,c10=b10||(a10[4]<0?1:0);return c10}try{var AI=l$(ln),hI=AI}catch(f10){var hF=P(f10);if(hF!==a5)throw g(hF,0);try{var AH=l$("CAMLRUNPARAM"),hH=AH}catch(f11){var hG=P(f11);if(hG!==a5)throw g(hG,0);var hH=q4}var hI=hH}var q5=ce(nl(hI,82)),q6=aN(0,hE);function q7(a10,b10){for(var c10=a10;;){if(b10<=c10||eq2<(c10*2|0))return c10;c10=c10*2|0}}function hJ(a10,b10){var d10=a10?a10[1]:cd(q5),c10=q7(16,b10),e10=d10?qY(a8(q6)):0;return[0,0,ap(c10,0),e10,c10]}function q8(m10,b10,c10,d10){var g10=d10.length-1,f10=ap(g10,0),i10=c10.length-2|0;function n10(a11){for(var c11=a11;;){if(!c11)return;var i11=c11[1],l11=c11[2],n11=c11[3],g11=b10?c11:[0,i11,l11,0],e11=h(m10,i11),k11=j(f10,e11)[1+e11];k11?k11[3]=g11:j(d10,e11)[1+e11]=g11,j(f10,e11)[1+e11]=g11,c11=n11}}var o10=0;if(i10>=0)for(var e10=o10;;){n10(j(c10,e10)[1+e10]);var r10=e10+1|0;if(i10===e10)break;e10=r10}if(b10){var k10=g10-1|0,p10=0;if(k10>=0)for(var a10=p10;;){var l10=j(f10,a10)[1+a10];l10&&(l10[3]=0);var q10=a10+1|0;if(k10===a10)break;a10=q10}}}function q9(a10,b10){var c10=b10[2],d10=(c10.length-1)*2|0,e10=d10>>0))return hQ(a10,d10)}function rh(a10){var b10=nL(a10[28]);if(b10){var c10=b10[1],d10=c10[1];a10[12]=a10[12]-c10[3]|0;var e10=d10;a10[9]=a10[9]+e10|0}}function ri(a10,b10,c10){if(typeof c10=="number")switch(c10){case 0:var j10=bM(a10[3]);if(!j10)return;var k10=j10[1][1],l10=function(a11,b11){if(!b11)return[0,a11,0];var c11=b11[1],d11=b11[2];return Bw(a11,c11)?[0,a11,b11]:[0,c11,l10(a11,d11)]};k10[1]=l10(a10[6]-a10[9]|0,k10[1]);return;case 1:bL(a10[2]);return;case 2:bL(a10[3]);return;case 3:var m10=bM(a10[2]);return m10?hQ(a10,m10[1][2]):db(a10);case 4:var o10=a10[10]!==(a10[6]-a10[9]|0)?1:0;return o10&&rh(a10);default:var p10=bL(a10[5]);return p10?eR(a10,h(a10[25],p10[1])):void 0}switch(c10[0]){case 0:return hP(a10,b10,c10[1]);case 1:var d10=c10[2],f10=c10[1],q10=d10[1],z10=d10[2],r10=bM(a10[2]);if(!r10)return;var s10=r10[1],e10=s10[2];switch(s10[1]){case 0:return bQ(a10,f10);case 1:return bm(a10,d10,e10);case 2:return bm(a10,d10,e10);case 3:return a10[9]<(b10+n(q10)|0)?bm(a10,d10,e10):bQ(a10,f10);case 4:return a10[11]?bQ(a10,f10):a10[9]<(b10+n(q10)|0)||((a10[6]-e10|0)+z10|0)=a10[14])return a10[13]=hO,hR(a10),b10&&db(a10),ru(a10);hW(a10,0)}}function eU(a10,b10,c10){var d10=a10[14]=c10)return x(a10[17],h2,0,c10);x(a10[17],h2,0,80),c10=c10-80|0}}function rG(a10){return a10[1]===co?aM(rI,aM(a10[2],rH)):rJ}function rK(a10){return a10[1]===co?aM(rM,aM(a10[2],rL)):rN}function rO(a10){return 0}function rP(a10){return 0}function eW(a10,b10,c10,d10,e10){var g10=eA(0),h10=[0,hM,rQ,0];eC(h10,g10);var f10=bK(0);eS(f10),a7([0,1,h10],f10);var i10=78,j10=bK(0),k10=bK(0),l10=bK(0);return[0,f10,bK(0),l10,k10,j10,i10,10,68,i10,0,1,1,1,1,g4,rR,a10,b10,c10,d10,e10,0,0,rG,rK,rO,rP,g10]}function h3(a10,b10){var c10=eW(a10,b10,function(a11){return 0},function(a11){return 0},function(a11){return 0});return c10[19]=function(a11){return eV(c10,a11)},c10[20]=function(a11){return bR(c10,a11)},c10[21]=function(a11){return bR(c10,a11)},c10}function h4(d10){return h3(function(a10,b10,c10){return g5(d10,a10,b10,c10)},function(a10){return cb(d10)})}function dd(d10){return h3(function(a10,b10,c10){return hm(d10,a10,b10,c10)},function(a10){return 0})}var eX=dU;function h5(a10){return bl(eX)}var h6=h5(0),eY=h4(en),eZ=h4(ah),rS=dd(h6),h7=aN(0,h5);cm(h7,h6),cm(aN(0,function(a10){return dd(a8(h7))}),rS);function de(a10,b10,c10,d10){return hm(a8(a10),b10,c10,d10)}function df(a10,b10,c10){var d10=a8(b10),e10=hl(d10);return g5(a10,ck(d10),0,e10),cb(a10),nO(d10)}var dg=aN(0,function(a10){return bl(eX)}),dh=aN(0,function(a10){return bl(eX)}),h8=aN(0,function(a10){var b10=eW(function(a11,b11,c10){return de(dg,a11,b11,c10)},function(a11){return df(en,dg,a11)},function(a11){return 0},function(a11){return 0},function(a11){return 0});return b10[19]=function(a11){return eV(b10,a11)},b10[20]=function(a11){return bR(b10,a11)},b10[21]=function(a11){return bR(b10,a11)},hs(function(a11){return a9(b10,a11)}),b10});cm(h8,eY);var h9=aN(0,function(a10){var b10=eW(function(a11,b11,c10){return de(dh,a11,b11,c10)},function(a11){return df(ah,dh,a11)},function(a11){return 0},function(a11){return 0},function(a11){return 0});return b10[19]=function(a11){return eV(b10,a11)},b10[20]=function(a11){return bR(b10,a11)},b10[21]=function(a11){return bR(b10,a11)},hs(function(a11){return a9(b10,a11)}),b10});cm(h9,eZ);function rq(a10,b10){a10[22]&&(a7(b10,a10[4]),h(a10[26],b10));var c10=a10[23];return c10&&cp(a10,[0,da,[5,b10],0])}function rw(a10,b10){return hZ(a10,n(b10),b10)}function rx(a10,b10){return hY(a10,1),h(a10[18],0)}function ry(a10,b10){var c10=a10[14]=0)for(var c10=g10;;){rX(e10,c10,a10,j(b10,c10)[1+c10]);var h10=c10+1|0;if(f10===c10)break;c10=h10}return e10}function ib(a10,b10){return typeof b10!="number"&&b10[0]===0?ia(a10,b10[1]):a4(rY)}function rZ(a10,b10,c10,d10){if(typeof c10!="number")return c10[0]===0?ic(c10[1],a10[1+b10],d10):void 0;if(c10!==2){a10[1+b10]=d10;return}if(bH(d10)===0&&d10.length-1===4)for(var e10=0,h10=a10[1+b10];;){h10[1+e10]=d10[1+e10];var i10=e10+1|0;if(e10===3)return;e10=i10}throw g([0,f,r0],1)}function ic(a10,b10,c10){if(bH(c10)===0&&a10.length-1<=c10.length-1){var e10=a10.length-2|0,h10=0;if(e10>=0)for(var d10=h10;;){var i10=c10[1+d10];rZ(b10,d10,j(a10,d10)[1+d10],i10);var k10=d10+1|0;if(e10===d10)break;d10=k10}return}throw g([0,f,r1],1)}function id2(a10,b10,c10){return typeof a10!="number"&&a10[0]===0?ic(a10[1],b10,c10):a4(r2)}var e0=[r,r3,an(0)];rV(r4,[0,e0,[0]]);function e1(a10){return[0,a10]}function S(a10){return[0,a10]}function di(a10){return a10[0]===0?[0,a10[1]]:0}var bS=[0,function(a10){return a10}(0)];function bT(a10){return[1,0,0,0,a10]}function k(a10,b10){return a10[0]===0?[0,h(b10,a10[1])]:bT([0,a10,b10])}function bU(a10,b10,c10){if(a10[0]===0){var d10=a10[1];if(b10[0]===0)return[0,i(c10,d10,b10[1])]}return bT([1,a10,b10,c10])}function ie(a10){return a10[0]===0?a10[1]:bT([4,a10,0])}function ig(a10,b10,c10){switch(c10[0]){case 0:throw g([0,f,r7],1);case 1:c10[3]=[0,b10,a10,c10[3]];return;default:c10[2]=[0,b10,a10,c10[2]];return}}function e2(a10,b10){if(!b10)throw g([0,f,r8],1);if(b10[2]===a10)return[0,b10[1],b10[3]];var c10=e2(a10,b10[3]),d10=c10[1];return b10[3]=c10[2],[0,d10,b10]}function cr(a10,b10){switch(b10[0]){case 0:throw g([0,f,r9],1);case 1:var c10=e2(a10,b10[3]),e10=c10[1];return b10[3]=c10[2],e10;default:var d10=e2(a10,b10[2]),h10=d10[1];return b10[2]=d10[2],h10}}function ih(a10,b10,c10,d10){for(var e10=d10;;){if(!e10)throw g([0,f,r_],1);if(e10[1]===b10&&e10[2]===a10){e10[1]=c10;return}e10=e10[3]}}function e3(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,r$],1);case 1:return ih(a10,b10,c10,d10[3]);default:return ih(a10,b10,c10,d10[2])}}function ii(a10,b10){for(var c10=b10;;){if(!c10)throw g([0,f,sa],1);if(c10[2]===a10)return c10[1];c10=c10[3]}}function sb(a10,b10){switch(b10[0]){case 0:throw g([0,f,sc],1);case 1:return ii(a10,b10[3]);default:return ii(a10,b10[2])}}function aW(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,sd],1);case 1:var j10=d10[1];if(typeof j10=="number"&&!j10){if(!c10||b10[1])return;b10[1]=1;return}var k10=d10[4];if(k10[0]===7){var n10=k10[2];if(n10[0]===1){var o10=n10[1];if(typeof o10=="number"){if(!o10&&c10){if(b10[1])return;b10[1]=1;return}}else if(c10)return}}var l10=d10[1];a:{if(typeof l10=="number"&&l10){var e10=1;break a}var e10=c10}d10[1]=0;var m10=d10[2];return a10<50?jW(a10+1|0,b10,e10,m10):p(jW,[0,b10,e10,m10]);default:var i10=d10[1];if(d10[1]=0,typeof i10=="number"){if(!i10)return;b10[1]=2;return}var q10=i10[1];return c10&&(b10[1]=2),h(d10[3],q10)}}function a_(a10,b10,c10){return bI(aW(0,a10,b10,c10))}function jW(a10,b10,c10,d10){if(typeof d10!="number")switch(d10[0]){case 0:var f10=d10[1];return a10<50?aW(a10+1|0,b10,c10,f10):p(aW,[0,b10,c10,f10]);case 1:var g10=d10[2];return a_(b10,c10,d10[1]),a10<50?aW(a10+1|0,b10,c10,g10):p(aW,[0,b10,c10,g10]);case 2:var h10=d10[3],l10=d10[2];return a_(b10,c10,d10[1]),a_(b10,c10,l10),a10<50?aW(a10+1|0,b10,c10,h10):p(aW,[0,b10,c10,h10]);case 3:var i10=d10[4],m10=d10[3],n10=d10[2];return a_(b10,c10,d10[1]),a_(b10,c10,n10),a_(b10,c10,m10),a10<50?aW(a10+1|0,b10,c10,i10):p(aW,[0,b10,c10,i10]);default:var o10=d10[1];d10[1]=0;var k10=o10-1|0,q10=0;if(k10>=0)for(var e10=q10;;){a_(b10,c10,j(d10[3],e10)[1+e10]);var r10=e10+1|0;if(k10===e10)break;e10=r10}return}}function se(a10){return i(c9(ah,sf),c$,A9(20))}function dj(a10,b10){var c10=[0,0];a_(c10,a10,b10);var d10=2<=c10[1]?1:0;return d10&&se(0)}function ae(a10){return bT([5,a10])}function as(a10){return a10}function ab(a10,b10){if(a10[0]===1){var c10=a10[4];if(c10[0]===5)return c10[1]=b10,dj(0,a10)}throw g([0,f,sg],1)}function bn(a10){if(a10[0]===1){var b10=a10[4];if(b10[0]===5)return b10[1]}throw g([0,f,sh],1)}function bV(a10,b10,c10){for(var k10=a10,h10=b10,d10=c10;;)switch(d10[0]){case 0:return k10;case 1:var e10=d10[2];if(typeof e10=="number")throw g([0,f,sm],1);switch(e10[0]){case 0:if(e10[1]!==h10)throw g([0,f,sn],1);var o10=0;break;case 1:var B10=e10[2],C2=e10[1];if(C2===h10)var D2=[0,B10];else{if(B10!==h10)throw g([0,f,so],1);var D2=[0,C2]}var o10=D2;break;case 2:var u10=e10[3],v10=e10[2],w10=e10[1];if(w10===h10)var x10=[1,v10,u10];else if(v10===h10)var x10=[1,w10,u10];else{if(u10!==h10)throw g([0,f,sp],1);var x10=[1,w10,v10]}var o10=x10;break;case 3:var p10=e10[4],q10=e10[3],r10=e10[2],s10=e10[1];if(s10===h10)var t10=[2,r10,q10,p10];else if(r10===h10)var t10=[2,s10,q10,p10];else if(q10===h10)var t10=[2,s10,r10,p10];else{if(p10!==h10)throw g([0,f,sq],1);var t10=[2,s10,r10,q10]}var o10=t10;break;default:var n10=cr(d10,h10);if(j(e10[3],n10)[1+n10]!==h10)throw g([0,f,sr],1);var m10=e10[2]-1|0;if(e10[2]=m10,n10>>2|0))var U2=no(e10[3],0,K2>>>1|0),L2=[4,e10[1],e10[2],U2];else var L2=e10;var J2=L2}var o10=J2}if(d10[2]=o10,typeof o10!="number")return k10;var y10=d10[1];d10[1]=1;var l10=d10[4];switch(l10[0]){case 0:h10=d10,d10=l10[1];break;case 1:var M2=l10[2];k10=bV(k10,d10,l10[1]),h10=d10,d10=M2;break;case 2:var N2=l10[2];k10=bV(k10,d10,l10[1]),h10=d10,d10=N2;break;case 3:var O2=l10[2];k10=bV(k10,d10,l10[1]),h10=d10,d10=O2;break;case 4:var z10=l10[2],A10=bV(k10,d10,l10[1]);if(!z10)return A10;var Q2=z10[1];l10[2]=0,k10=A10,h10=d10,d10=Q2;break;case 5:return k10;case 6:if(typeof y10=="number")return k10;var R2=y10[1];try{return i(l10[2],d10,R2),k10}catch(f10){var S2=P(f10);return[0,[0,S2,qK(0)],k10]}default:var T2=l10[1];k10=bV(k10,d10,l10[2]),h10=d10,d10=T2}break;default:throw g([0,f,ss],1)}}function a$(a10,b10){for(var e10=a10,c10=b10;;)switch(c10[0]){case 0:return;case 1:var n10=typeof c10[2]=="number"?1:0,d10=c10[2];if(typeof d10=="number")var k10=[0,e10];else switch(d10[0]){case 0:var k10=[1,e10,d10[1]];break;case 1:var k10=[2,e10,d10[1],d10[2]];break;case 2:var k10=[3,e10,d10[1],d10[2],d10[3]];break;case 3:for(var o10=[0,d10[1],d10[2],d10[3],d10[4],e10,bS,bS,bS],l10=0;;){ig(c10,l10,j(o10,l10)[1+l10]);var w10=l10+1|0;if(l10===4)break;l10=w10}var k10=[4,5,5,o10];break;default:var i10=d10[2];if(i10>>1|0)}function iq(a10,b10,c10){if(typeof a10!="number"){if(a10[0]!==0){if(a10[2]!==b10)throw g([0,f,s2],1);a10[2]=c10;return}if(a10[2]===b10){a10[2]=c10;return}if(a10[4]===b10){a10[4]=c10;return}}throw g([0,f,s1],1)}function f3(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[2];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,s6],1);e10[5]=c10;var i10=e10}return d10[2]=c10,c10[4]=i10,c10[5]=d10,d10[5]=h10,iq(h10,c10,d10),e$(b10,c10),a10<50?cG(a10+1|0,b10,d10):p(cG,[0,b10,d10])}}throw g([0,f,s5],1)}function s3(a10,b10){return bI(f3(0,a10,b10))}function f2(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[4];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,s8],1);e10[5]=c10;var i10=e10}return d10[4]=c10,c10[2]=i10,c10[5]=d10,d10[5]=h10,iq(h10,c10,d10),e$(b10,c10),a10<50?cG(a10+1|0,b10,d10):p(cG,[0,b10,d10])}}throw g([0,f,s7],1)}function s4(a10,b10){return bI(f2(0,a10,b10))}function jY(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];a:if(typeof d10!="number"&&d10[0]===0){var e10=bX(d10[2]);if(e_(bX(d10[4]),e10)){s4(b10,d10);break a}}return a10<50?f3(a10+1|0,b10,c10):p(f3,[0,b10,c10])}throw g([0,f,s9],1)}function jX(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];a:if(typeof d10!="number"&&d10[0]===0){var e10=bX(d10[4]);if(e_(bX(d10[2]),e10)){s3(b10,d10);break a}}return a10<50?f2(a10+1|0,b10,c10):p(f2,[0,b10,c10])}throw g([0,f,s_],1)}function cG(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=bX(c10[2]),e10=bX(c10[4]);return d10>>2|0)}function aD(a10,b10){if(typeof a10=="number")var c10=b10;else{if(typeof b10!="number"){var d10=dn(b10);return[1,(iv(dn(a10),d10)+1|0)<<2,a10,b10]}var c10=a10}return c10}function iw(a10){return typeof a10=="number"?0:a10[0]===0?[0,a10[2]]:[1,a10[2],a10[3]]}var fa=1,fb=2,tE=3;function ix(a10){return a10===-1?1:0}function fc(a10){return a10!==-1?1:0}function bY(a10){return(a10&3)===3?1:0}function iy(a10){return(a10&3)===1?1:0}function iz(a10){return(a10&3)===2?1:0}function iA(a10){return a10|3}function tF(a10){return a10>>>2|0}function iB(a10){return a10<<2|2}function cv(a10){return a10&mi(tE)}function iC(a10){return a10[2]}function iD(a10){return a10[3]}function iE(a10){return[0,0,0,0]}function dp(a10){a10[1]=a10[1]+1|0}function dq(a10){a10[2]=a10[2]+1|0}function dr(a10){a10[3]=a10[3]+1|0}function fd(a10,b10,c10){for(var d10=c10;;){if(typeof d10=="number")return;if(d10[0]===0){var e10=d10[1],i10=(e10&3)!==3?1:0,l10=i10&&(e10&3?1:0);if(l10){if(e10&b10)throw g([0,f,tH],1);dp(a10),dr(a10),d10[1]=e10|3}return}var h10=d10[1],j10=(h10&3)!==3?1:0,k10=j10&&(h10&3?1:0);if(!k10)return k10;if(h10&b10)throw g([0,f,tI],1);dp(a10),dr(a10),d10[1]=h10|3,fd(a10,b10,d10[2]),d10=d10[3]}}function ds(a10,b10,c10,d10){if(typeof d10!="number"){if(d10[0]===0){var e10=d10[1];e10&c10||(dp(a10),e10&3?(d10[1]=-1,dr(a10),dq(a10)):d10[1]=e10|c10);var g10=e10!==-1?1:0,h10=g10&&((e10&3)===3?1:0);return h10&&(d10[1]=-1,dq(a10))}var f10=d10[1];f10&c10||(dp(a10),f10&3?(d10[1]=-1,dr(a10),dq(a10),fd(a10,c10,d10[2]),fd(a10,c10,d10[3])):(d10[1]=f10|c10,eC(d10,b10)));var i10=f10!==-1?1:0,j10=i10&&((f10&3)===3?1:0);return j10&&(d10[1]=-1,dq(a10))}}function fe(a10,b10,c10){var d10=hk(b10);if(typeof d10!="number"&&d10[0]===1){var e10=(d10[1]&3)===c10?1:0;return e10&&(ds(a10,b10,c10,d10[2]),ds(a10,b10,c10,d10[3]))}throw g([0,f,tJ],1)}function iF(a10,b10,c10){for(;;){if(eD(b10))return;fe(a10,b10,c10)}}function tK(a10,b10,c10,d10){for(;;){if(eD(c10))return iF(b10,d10,fb);if(eD(d10))return iF(a10,c10,fa);fe(a10,c10,fa),fe(b10,d10,fb)}}function ff(a10){var b10=a10[6];return a10[6]=b10+1|0,b10}function fg(a10){for(var b10=a10;;){if(typeof b10=="number")return;if(b10[0]===0){var c10=b10[1];if(typeof c10!="number"&&c10[0]===0){var e10=c10[1],i10=fc(e10),l10=i10&&bY(e10);l10&&(c10[1]=cv(e10));return}throw g([0,f,tP],1)}var d10=b10[1];if(typeof d10!="number"&&d10[0]===1){var h10=d10[1],m10=b10[4],n10=b10[3],j10=fc(h10),k10=j10&&bY(h10);if(!k10)return k10;d10[1]=cv(h10),fg(n10),b10=m10;continue}throw g([0,f,tQ],1)}}function iG(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;if(c10[0]===0){var d10=c10[1];if(typeof d10!="number"&&d10[0]===0){var e10=d10[1],u10=c10[2];if(!iy(e10)){if(ix(e10)){var k10=ff(a10);j(a10[4],k10)[1+k10]=d10,j(a10[5],k10)[1+k10]=[0,c10,0],d10[1]=iB(k10);return}if(iz(e10)){var n10=tF(e10),v10=[0,c10,j(a10[5],n10)[1+n10]];j(a10[5],n10)[1+n10]=v10;return}var q10=bY(e10);if(q10)throw g([0,f,tT],1);return q10}var m10=a10[2];if(-1a10[3]))throw g([0,f,tS],1);d10[1]=cv(e10);return}throw g([0,f,tR],1)}var h10=c10[1];if(typeof h10!="number"&&h10[0]===1){var r10=c10[4],s10=c10[3],i10=h10[1],w10=c10[2];if(ix(i10)){var l10=ff(a10);return j(a10[4],l10)[1+l10]=h10,j(a10[5],l10)[1+l10]=[0,c10,0],h10[1]=iB(l10),fg(s10),fg(r10)}if(!iy(i10)){if(iz(i10)){var o10=i10>>>2|0,x10=[0,c10,j(a10[5],o10)[1+o10]];j(a10[5],o10)[1+o10]=x10;return}var t10=bY(i10);if(t10)throw g([0,f,tW],1);return t10}if(-1a10[3])throw g([0,f,tV],1)}h10[1]=cv(i10),iG(a10,s10),c10=r10;continue}throw g([0,f,tU],1)}}function cw(a10,b10){if(typeof b10=="number")return 0;if(b10[0]!==0){var i10=b10[1];if(i10===-1){var l10=ff(a10);b10[1]=0,j(a10[4],l10)[1+l10]=b10;var p10=cw(a10,b10[2]);return[1,b10,0,p10,cw(a10,b10[3])]}if(!bY(i10)){b10[1]=cv(b10[1]);var r10=cw(a10,b10[2]);return[1,b10,0,r10,cw(a10,b10[3])]}var d10=i10>>>2|0,k10=j(a10[5],d10)[1+d10];if(!k10)throw g([0,f,tZ],1);var m10=k10[2],q10=k10[1];return j(a10[5],d10)[1+d10]=m10,m10===0&&(b10[1]=0),q10}var e10=b10[1];if(fc(e10)&&bY(e10)){var c10=e10>>>2|0,h10=j(a10[5],c10)[1+c10];if(!h10)return[0,b10,0];var n10=h10[2],o10=h10[1];return j(a10[5],c10)[1+c10]=n10,o10}return b10[1]=0,[0,b10,0]}var fh=[0,0,[0],0,0];function tG(a10){return a10[1]}function tL(a10){return a10[1]}function tM(a10){return a10[2]}function tN(a10,b10){var c10=iE(0),d10=iE(0),e10=eA(0),f10=eA(0);return ds(c10,e10,fa,a10),ds(d10,f10,fb,b10),tK(c10,d10,e10,f10),[0,c10,d10]}function tO(a10){if(typeof a10!="number"){if(a10[0]===0){a10[1]=0;return}var b10=dn(a10[3]);a10[1]=(iv(dn(a10[2]),b10)+1|0)<<2}}function tX(a10){var e10=a10[6]-1|0,h10=0;if(e10>=0)for(var b10=h10;;){var c10=j(a10[4],b10)[1+b10];typeof c10!="number"&&(c10[0],c10[1]=iA(c10[1]));var d10=j(a10[5],b10)[1+b10];if(!d10)throw g([0,f,tY],1);if(d10[2]){var i10=cg(d10);j(a10[5],b10)[1+b10]=i10}var k10=b10+1|0;if(e10===b10)break;b10=k10}}function iH(a10,b10,c10){if(typeof b10=="number"){if(typeof c10=="number")return[0,fh,0]}else if(b10[1]===c10)return[0,fh,b10];var t10=typeof b10=="number"?cu:b10[1],m10=tN(t10,c10),i10=tL(m10),n10=tM(m10),u10=iD(n10),v10=iD(i10)+u10|0,o10=tG(i10)-v10|0,w10=iC(n10),p10=iC(i10)+w10|0,x10=0,y10=ap(p10,0),z10=ap(p10,0),A10=a10?o10:-1,B10=a10?0:-1,C2=a10?ap(o10,0):[0],d10=[0,C2,B10,A10,z10,y10,x10];if(iG(d10,b10),d10[2]!==d10[3])throw g([0,f,t0],1);tX(d10);var q10=cw(d10,c10),r10=d10[6]-1|0;if(r10>=0)for(var h10=r10;;){tO(j(d10[4],h10)[1+h10]);var F2=h10-1|0;if(h10===0)break;h10=F2}if(!a10)return[0,fh,q10];var k10=[0,0],l10=[0,0],s10=d10[6]-1|0,D2=0;if(s10>=0)for(var e10=D2;;){a6(function(a11){if(typeof a11!="number")if(a11[0]===0){var b11=a11[2];if(b11)return k10[1]=[0,b11[1],k10[1]],0}else{var c11=a11[2];if(c11)return l10[1]=[0,c11[1],l10[1]],0}return 0},j(d10[5],e10)[1+e10]);var E2=e10+1|0;if(s10===e10)break;e10=E2}return[0,[0,d10[2],d10[1],k10[1],l10[1]],q10]}function t1(d10,b10){if(typeof b10=="number")return 0;function c10(a10){a:if(typeof a10!="number"){b:{if(a10[0]===0){var b11=a10[1];if(typeof b11!="number"&&b11[0]===0){var e10=a10[2];if(e10){var j10=e10[1];break b}var k10=h(d10[1],b11[2]);return a10[2]=[0,k10],k10}break a}var l10=a10[2];if(!l10){var n10=c10(a10[3]),o10=c10(a10[4]),m10=i(d10[2],n10,o10);return a10[2]=[0,m10],m10}var j10=l10[1]}return j10}throw g([0,f,t2],1)}return[0,c10(b10)]}function dt(a10,b10){return[0,[0,a10,b10],0]}function du(a10){return t1(a10[1],a10[2])}function t3(a10,b10){var c10=a10[1];return[0,c10,iH(0,a10[2],b10)[2]]}function fi(a10,b10){var d10=a10[1],c10=iH(1,a10[2],b10);return[0,c10[1],[0,d10,c10[2]]]}function dv(a10,b10,c10,d10){var e10=[0,d10];if(v===a10)var h10=c10[1],g10=0;else if(km<=a10)var h10=c10[2].length-1,g10=c10[1];else var h10=c10[2].length-1,g10=0;var k10=h10-1|0;if(k10>=g10)for(var f10=g10;;){var l10=j(c10[2],f10)[1+f10];l10&&(e10[1]=i(b10,l10[1],e10[1]));var m10=f10+1|0;if(k10===f10)break;f10=m10}km>a10&&a6(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[3]),v!==a10&&a6(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[4])}function fj(a10,b10,c10){if(typeof c10=="number")throw g([0,f,t4],1);if(c10[0]===0)return h(a10,c10[2]);var d10=fj(a10,b10,c10[3]);return i(b10,fj(a10,b10,c10[2]),d10)}function bo(a10,b10,c10){var d10=b10[2],e10=b10[1],f10=di(c10);if(f10){var g10=f10[1];return S(typeof g10=="number"?e10:fj(a10,d10,g10))}var h10=[0,dt(a10,d10)];return k(c10,function(a11){var b11=t3(h10[1],a11);h10[1]=b11;var c11=du(b11);return c11?c11[1]:e10})}var aR=[0,cu,aD];function t5(a10,b10){return dk(b10,aR,a10)}function dw(a10){return t5(a10,J)}function iI(a10){function e10(a11,b10){for(var c10=a11,d10=b10;;){if(typeof c10=="number")return d10;if(c10[0]===0)return[0,c10[2],d10];var f10=e10(c10[3],d10);c10=c10[2],d10=f10}}return e10(a10,0)}var iJ=[0,S(0),function(a10,b10){return bU(a10,b10,aD)}];function fk(c10,b10){return bo(function(a10){return J(h(c10,a10))},aR,b10)}function t6(a10,b10){return ie(bo(b10,iJ,a10))}function bp(a10){return t6(a10,function(a11){return k(a11,J)})}var bq=e;function t7(a10){return a10[kN]}function iK(a10,b10){var c10=a10?a10[1]:bq;return Bx(b10).join(c10)}function fl(a10){return t7(a10)===0?1:0}function dx(a10,b10){return lL(a10,b10)}c.Number;var fm=null,t8=void 0;function cx(a10){return a10===fm?1:0}function t9(a10){return a10===t8?1:0}function bZ(a10){var b10=cx(a10);return b10||t9(a10)}function iL(a10){return 1-bZ(a10)}function dy(a10,b10){return bZ(b10)?0:[0,h(a10,b10)]}var m=c;function fn(a10,b10){var c10=a10[b10];return bZ(c10)?0:[0,c10]}function fo(a10){return new m[la](a10)}function iM(a10){return a10[kN]}function iN(c10,b10){return hg(iM(b10),function(a10){return h(c10,b10[a10])})}function iO(a10,b10){var d10=b10.length-1,e10=fo(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){e10[c10]=h(a10,j(b10,c10)[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function iP(c10,b10){return mT(iM(b10),function(a10){return h(c10,b10[a10])})}function fp(f10,b10){return function(a10,b11,c10){for(var e10=a10,d10=c10;;){if(!d10)return b11;var g10=d10[2];b11[e10]=h(f10,d10[1]),e10=e10+1|0,d10=g10}}(0,fo(0),b10)}function ub(a10,b10){var c10=new m.Error(b10);return a10&&(c10[bx]=a10[1]),c10}var ud=Symbol.iterator;function uf(a10){return a10.next()}function ug(a10){var b10=dy(function(a11){return a11|0},a10.done);return b10?b10[1]:0}function uh(a10){return a10[dT]}function iQ(i10,g10,c10,d10,e10){return function(a10,b10){for(var d11=b10;;){var e11=uf(a10);if(ug(e11))return d11;var f10=uh(e11),j10=h(g10,f10[1]);d11=x(c10,h(i10,f10[0]),j10,d11)}}(d10,e10)}m.Promise;function ua(a10){return ag(a10)}function br(a10,b10,c10){return ef(a10,ua(b10),c10)}function ay(a10){return ag(a10)}function u(a10){return H(a10)}function b0(a10,b10){return a10 instanceof b10?1:0}var t_=!0;function t$(a10,b10){a10[b10]}function uc(a10,b10){return h(function(a11){throw a11},ub(a10,b10))}function ue(a10){return a10[ud]()}m.Event;function dz(a10){return a10[f5]}function iR(a10,b10,c10,d10){var e10=a10?a10[1]:{},f10=bE(1,c10);return d10.addEventListener(b10,f10,e10),function(a11){return d10.removeEventListener(b10,f10,e10),0}}function iS(a10){return h(a10,0)}var fq="change",cy="click";m.ArrayBuffer,m.DataView;function ui(a10){return a10.preventDefault(),0}var uj="DOMContentLoaded",uk=kt,ul="scroll",um="wheel";m.Blob,m.File;var iT=m.JSON;m.encodeURI,m.decodeURI,m.encodeURIComponent,m.decodeURIComponent,m.URL,m.URLSearchParams;function aS(a10,b10){return[0,a10,b10]}var cz=[0,bq,bq];function fr(a10){return[0,a10,bq]}function iU(a10){return a10}var cA=lr,fs=kc,iV=bx,iW=kZ,ft="type",fu=dT,iX=fr(dR),uq="for";function aT(a10){return aS(cA,a10)}function iY(a10){return aS(uq,a10)}var ut=fr("required");function dA(a10){return aS(iW,a10)}function iZ(a10){return aS(ft,a10)}var uu=fr("selected"),bs=m.document;function un(a10){return iT.stringify(a10)}function uo(a10){try{var c10=iT.parse(a10)}catch(f10){var b10=P(f10);if(b10[1]===e0)return[1,b10[2]];throw g(b10,0)}return[0,c10]}function up(a10,b10){return a10?b10:cz}var ur="placeholder";function us(a10){return aS(fs,a10)}function uv(a10){return aS(fu,a10)}function uw(a10){return a10.ownerDocument}bZ(bs)||bs[j_];function ux(a10,b10){return a10.appendChild(b10),0}function uy(a10,b10,c10,d10){for(var g10=b10,f10=c10,e10=d10;;){if(!e10){g10!==0&&a10.setAttribute(kZ,iK([0,";"],cg(g10))),f10!==0&&a10.setAttribute(lr,iK([0,aH],cg(f10)));return}var h10=e10[2],k10=e10[1],i10=k10[2],j10=k10[1];if(fl(j10))e10=h10;else if(dx(j10,iW))g10=[0,i10,g10],e10=h10;else if(dx(j10,cA)){var l10=fl(i10)?f10:[0,i10,f10];f10=l10,e10=h10}else a10.setAttribute(j10,i10),e10=h10}}function i0(a10,b10,c10,d10){var f10=a10?a10[1]:bs,g10=b10?b10[1]:0,e10=f10.createElement(c10);return uy(e10,0,0,g10),a6(function(a11){return ux(e10,a11)},d10),e10}function aU(a10,b10){var c10=a10?a10[1]:bs;return c10.createTextNode(u(b10))}function i1(a10,b10,c10){return fl(a10)?0:b10?(c10.setAttribute(a10,b10[1]),0):(c10.removeAttribute(a10),0)}function i2(a10,b10,c10){return b10?(c10[j1].add(a10),0):(c10[j1].remove(a10),0)}var i3="div";function uI(a10,b10,c10,d10){return i0(b10,c10,a10,d10)}function i4(a10,b10,c10){return uI(i3,a10,b10,c10)}function i5(a10){return a10[j_]}function dB(a10,b10,c10){return ef(a10,b10,c10),0}var dC=m[kO];function dD(a10){return Bt(function(a11,b10,c10){for(var e10=b10,d10=c10;;){if(!d10)return a11;var f10=d10[2];a11[e10]=d10[1],e10=e10+1|0,d10=f10}}(fo(0),0,a10))}function aE(a10){return dB(dC,uL,dD(a10))}function b1(a10){return dB(dC,uQ,dD(a10))}m[kO],m.navigator;var uT=m.performance,dE=m[lp];t$(m,uU);function uz(a10,b10){ef(a10,kK,c5(b10))}function uA(a10,b10,c10){var e10=a10?a10[1]:m[lp],d10=e10.getComputedStyle(c10)[b10];return bZ(d10)?bq:d10}function uB(a10,b10){var c10=a10?a10[1]:lm,d10=lm<=c10?1:0;return b10.scrollIntoView(!!d10),0}var uC="button",uD="form",uE=kt,uF="label",uG="option",uH="select";function uJ(a10){var b10=a10.body;return iL(b10)?b10:uc(0,"Document body is null. Try to defer your script execution.")}function uK(a10){return dy(function(a11){return a11},a10.activeElement)}function uM(a10){return dB(dC,uN,dD(a10))}function uO(a10){return dB(dC,uP,dD(a10))}function uR(a10){return a10}function uS(a10){return a10.now()}function uV(a10,b10){return m.setTimeout(bE(1,b10),a10)}function uW(a10){m.clearTimeout(a10)}function uX(a10){m.requestAnimationFrame(bE(1,a10))}m.ClipboardItem,m.FormData,m.Headers,m.Request,m.Response,m.fetch,m.MediaStream,m.MediaRecorder,m.MessageChannel,m.BroadcastChannel,m.Notification,m.WebSocket;function uY(a10){return a10.localStorage}function uZ(a10,b10){function c10(a11){return a11}return function(a11){return dy(c10,a11)}(a10.getItem(b10))}function u0(a10,b10,c10){try{a10.setItem(b10,c10);return}catch(f10){var d10=P(f10);if(d10[1]===e0)return;throw g(d10,0)}}function az(a10,b10,c10){return[0,a10,b10,c10]}function i6(a10){var b10=a10[1];return b10===82||83<=b10?g9(di(a10[2])):1}function dF(a10){return c1(di(a10))}function u1(a10){return es(c2(function(a11){var b10=a11[1];return b10===82?[0,dF(a11[2]),0]:83<=b10?iI(dF(a11[2])):[0,a11[2],0]},a10))}function i7(a10){if(!a10)return u2;var b10=m0(i6,a10),c10=b10[2];return[0,u1(b10[1]),c10]}var i8=kK,fv="before";function u5(a10){return[0,a10]}function u6(a10,b10){return[1,fm,a10,b10]}var u7="remove",u8="contains";function i9(a10){var b10=uK(uw(a10));return b10?br(a10,u8,[0,b10[1]])|0:0}function i_(e10,b10){var c10=[0,dt(u5,u6)];return k(b10,function(a10){var b11=fi(c10[1],a10),d10=b11[2],g10=b11[1];c10[1]=d10,dv(v,function(a11,b12){return a11[0]===0?a11[1][dS]=t_:0},g10,0);var h10=i9(e10),i10=du(d10);if(i10){var f10=function(d11,b12){if(b12[0]!==0){if(!cx(b12[1]))return b12[1];var l10=f10(d11,b12[3]),k10=f10(l10,b12[2]);return b12[1]=k10,k10}var c11=b12[1];if(delete c11[dS],c11.parentNode!==e10)cx(d11)?br(e10,i8,[0,c11]):br(d11,fv,[0,c11]);else{var a11=c11.nextSibling!==d11?1:0;if(a11){if(h10)var g11=i9(c11),i11=g11&&function(a12){for(;;){var b13=c11.nextSibling;if(b13===d11)return 1;if(cx(b13))return 0;br(c11,fv,[0,b13])}}(0);else var i11=h10;var j10=1-i11}else var j10=a11;j10&&(cx(d11)?br(e10,i8,[0,c11]):br(d11,fv,[0,c11]))}return c11};f10(fm,i10[1])}return dv(v,function(a11,b12){if(a11[0]!==0)return 0;var c11=a11[1],d11=iL(c11[dS]),e11=d11&&(delete c11[dS],br(c11,u7,[0]),0);return e11},g10,0),e10})}var dG=S(0),fw=[0,bq,bq];function u3(a10){if(!a10)return u4;var b10=a10[1],c10=b10[1];if(c10===82){if(!a10[2])return[0,0,[0,k(b10[2],J)]]}else if(83<=c10){if(!a10[2])return[0,0,[0,b10[2]]]}else if(!a10[2])return[0,[0,b10[2],0],0];return mW(i6,a10)?[0,es(c2(function(a11){var b11=a11[1];return b11===82?[0,dF(a11[2]),0]:83<=b11?iI(dF(a11[2])):[0,a11[2],0]},a10)),0]:[0,0,[0,dk(function(a11){var b11=a11[1];return b11===82?k(a11[2],J):83<=b11?a11[2]:S(J(a11[2]))},iJ,a10)]]}function i$(c10,b10){function d10(a10){var b11=a10[2],d11=a10[1];return dx(d11,cA)?i2(b11,1,c10):i1(d11,[0,b11],c10)}function e10(a10){var b11=a10[1],d11=a10[2];return dx(b11,cA)?i2(d11,0,c10):i1(b11,0,c10)}function h10(a10){var b11=[0,fw];return function(a11){b11[1]!==fw&&e10(b11[1]);var c11=a11;return d10(c11),b11[1]=c11,0}}return dk(function(a10){var b11=a10[1];if(b11===82){var i10=a10[2];return k(i10,h10(0))}if(83>b11)throw g([0,f,u9],1);var j10=a10[2],c11=[0,dt(function(a11){var b12=a11;return d10(b12),b12},function(a11,b12){return fw})];return k(j10,function(a11){var b12=fi(c11[1],a11),d11=b12[2],f10=b12[1];return c11[1]=d11,dv(v,function(a12,b13){return e10(a12)},f10,0),du(d11),0})},[0,dG,function(a10,b11){return dG}],b10)}function fx(a10,b10){return iR(b10[1],b10[2],b10[3],a10)}function u_(c10,b10){return dk(function(a10){var b11=a10[1];if(b11===82){var d10=[0,0];return k(a10[2],function(a11){var b12=d10[1];return b12&&iS(b12[1]),d10[1]=[0,fx(c10,a11)],0})}if(83>b11)throw g([0,f,u$],1);var h10=a10[2],e10=[0,dt(function(a11){return fx(c10,a11)},function(a11,b12){return a11})];return k(h10,function(a11){var b12=fi(e10[1],a11),c11=b12[2],d11=b12[1];return e10[1]=c11,dv(v,function(a12,b13){return iS(a12)},d11,0),du(c11),0})},[0,dG,function(a10,b11){return dG}],b10)}function ja(a10,b10,c10,d10,e10,f10){var q10=b10?b10[1]:0,r10=c10?c10[1]:0,s10=d10?d10[1]:function(a11){},m10=i7(q10),l10=m10[2],t10=m10[1],n10=i7(r10),o10=n10[2],u10=n10[1],p10=u3(f10),i10=p10[2],g10=i0(a10,[0,t10],e10,p10[1]);if(h(s10,g10),l10)if(i10)var v10=i_(g10,i10[1]),j10=bU(i$(g10,l10),v10,function(a11,b11){return b11});else var j10=k(i$(g10,l10),function(a11){return g10});else var j10=i10?i_(g10,i10[1]):S(g10);a6(function(a11){return fx(g10,a11),0},u10);var w10=o10?bU(u_(g10,o10),j10,function(a11,b11){return b11}):j10;return w10}function b2(a10,b10,c10,d10,e10,f10){return ja(b10,c10,d10,e10,a10,f10)}function va(a10,b10,c10,d10,e10,f10){return ja(b10,c10,d10,e10,a10,0)}function fy(a10,b10,c10,d10,e10){return b2(uC,a10,b10,c10,d10,e10)}function K(a10,b10,c10,d10,e10){return b2(i3,a10,b10,c10,d10,e10)}function fz(a10,b10,c10,d10,e10){return va(uE,a10,b10,c10,d10,e10)}function jb(a10,b10,c10,d10,e10){return b2(uF,a10,b10,c10,d10,e10)}function vb(a10,b10,c10,d10,e10){return b2(uD,a10,b10,c10,d10,e10)}function vc(a10,b10,c10,d10,e10){return b2(uG,a10,b10,c10,d10,e10)}function vd(a10,b10,c10,d10,e10){return b2(uH,a10,b10,c10,d10,e10)}function dH(a10,b10){return b10=c10)return vu;if(b10===kR)return vt;if(b10==="cyan")return vs;if(b10===lf)return vr;if(b10==="magenta")return vq;if(b10===lj)return vp;if(b10==="reset")return vo;if(b10==="white")return vn;if(b10==="yellow")return vm}else{if(b10==="Black")return vD;if(b10==="Blue")return vC;if(b10==="Cyan")return vB;if(b10==="Green")return vA;if(b10==="Magenta")return vz;if(b10==="Red")return vy;if(b10==="White")return vx;if(b10==="Yellow")return vw;if(b10==="black")return vv}throw g(fB,1)}function je(a10,b10){return a7(b10,a10),vF}function jf(a10){try{nF(a10),nG(a10)}catch(f10){var b10=P(f10);if(b10!==ez)throw g(b10,0)}return vG}var jg=[r,vH,an(0)],vE=0;function vI(a10,b10,c10){if(c10[1]===jg)return je(a10,c10[2]);if(c10[1]!==co)return h(b10,c10);var e10=c10[2];try{var f10=je(a10,jd(e10));return f10}catch(f11){var d10=P(f11);if(d10===fB)return h(b10,c10);throw g(d10,0)}}function vJ(a10,b10,c10){if(c10[1]===jg)return jf(a10);if(c10[1]!==co)return h(b10,c10);var e10=c10[2];try{jd(e10)}catch(f10){var d10=P(f10);if(d10===fB)return h(b10,c10);throw g(d10,0)}return jf(a10)}function vK(a10){var c10=bK(0);rr(a10,1);var b10=rs(a10,0),d10=b10[2],e10=b10[1];return rt(a10,[0,function(a11){return vI(c10,e10,a11)},function(a11){return vJ(c10,d10,a11)},b10[3],b10[4]])}function vL(a10,b10){var d10=bl(64),c10=dd(d10),e10=a10&&vE;return e10&&vK(c10),rU(function(a11){return a9(c10,0),ck(d10)},c10,b10)}function vM(a10){return vL(1,a10)}function vN(a10,b10){return m2(a10,b10)}function vO(a10){try{var c10=[0,lX(a10)];return c10}catch(f10){var b10=P(f10);if(b10[1]===b_)return 0;throw g(b10,0)}}function vP(a10){return a10|0}function fC(a10,b10){return b10?[0,h(a10,b10[1])]:0}function vQ(a10,b10,c10){return c10?h(b10,c10[1]):a10}function vR(a10,b10){if(b10)return h(a10,b10[1])}function vS(a10,b10){return b10?b10[1]:a10}function vT(a10,b10){return a10?a10[1]:b10}function vU(a10){return a10?[0,a10[1],0]:0}function vV(a10,b10){return b10[0]===0?h(a10,b10[1]):[1,b10[1]]}function vW(a10,b10){return vV(b10,a10)}function vX(a10){var b10=ny(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[38],,,,,,,,,,,b10[10]]}function vY(a10){var b10=vX(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[40],,,,,,,,,,,,,,,,,,,,b10[51]]}function vZ(e10,b10){var d10=n(e10);if(dH(d10,n(b10)))return 0;var f10=n(b10)-d10|0;return function(a10){for(var c10=a10;;){if(ve(c10,d10))return 1;if(_(b10,f10+c10|0)!==_(e10,c10))return 0;c10=c10+1|0}}(0)}function fD(a10,b10){return vZ(a10,b10)?[0,ew(b10,0,n(b10)-n(a10)|0)]:0}function v0(a10){return a10.height}function v1(a10){return a10}function v4(a10){switch(a10){case 0:return v5;case 1:return v6;default:return v7}}function v2(a10){return a10.contentRect}function v3(a10){a10[f5]}function v8(a10,b10,c10){var d10=b10?[0,c10,{box:u(v4(b10[1]))}]:[0,c10];return ef(a10,"observe",d10),0}function v9(c10){return new m.ResizeObserver(function(a10,b10){return i(c10,iP(function(a11){return a11},a10),b10)})}var v_=j8,v$="pattern",jh=vY([0,ex]);function wa(a10,b10){return h(a10,b10),b10}function wb(a10){var b10=fD(wc,a10);if(b10){var c10=b10[1],d10=vO(c10);if(d10)return[0,[0,d10[1]]];var g10=function(a11){return[0,a11]};return function(a11){return fC(g10,a11)}(fA(c10))}var e10=fD(wd,a10);if(e10){var h10=function(a11){return[1,a11]};return function(a11){return fC(h10,a11)}(fA(e10[1]))}var f10=fD(we,a10);if(!f10)return 0;function i10(a11){return[1,a11]}return function(a11){return fC(i10,a11)}(fA(f10[1]))}function ji(a10){switch(a10[0]){case 0:var b10=a10[1];return h(z(wf),b10);case 1:var c10=a10[1];return h(z(wg),c10);default:var d10=a10[1];return h(z(wh),d10)}}function jj(a10){var c10=a10?a10[1]:i5(bs);function b10(a11){var b11=wb(ag(uA(0,"font-size",a11)));if(!b11)return 16;var c11=b11[1];return c11[0]===0?c11[1]:a4(wi)}return function(a11){switch(a11[0]){case 0:return a11[1];case 1:var d10=a11[1];return d10*b10(i5(bs));default:var e10=a11[1];return e10*b10(c10)}}}function wj(e10,b10,c10,d10){function f10(a10,b11){return x(e10,b11[1],b11[2],a10)}function g10(a10,b11){return bU(d10,a10,b11)}return function(a10){return g10(a10,f10)}(bU(b10,c10,function(a10,b11){return[0,a10,b11]}))}var wm=[r,wl,an(0)],wo=[r,wn,an(0)];function fE(a10){return[0,0]}function fF(a10,b10){if(a10[1])throw g(wo,1);return a10[1]=[0,b10],0}function fG(a10){var b10=a10[1];if(b10)return b10[1];throw g(wm,1)}function wk(a10,b10,c10){return wj(function(a11,b11,c11){return[0,a11,b11,c11]},a10,b10,c10)}function wp(a10){return un(a10)}function wq(a10){var b10=uo(a10);return b10[0]===0?[0,b10[1]]:(uM([0,b10[1],0]),wr)}var jk=uY(dE);function jl(c10,b10){return function(a10){return u0(jk,c10,a10)}(wp(b10))}function ws(a10){var b10=uZ(jk,a10);function c10(a11){return wq(a11)}var d10=b10?[0,b10[1]]:wt;return vW(d10,c10)}function wu(a10,b10){var c10=ws(a10);if(c10[0]===0)return c10[1];var d10=c10[1];return typeof d10=="number"||uO([0,d10[2],0]),h(b10,0)}function wv(d10,b10){jl(d10,b10);var a10=ae(b10),c10=e4(0,a10);return e5(c10,function(a11){return jl(d10,bW(c10)),0}),bW(c10),a10}function ww(a10,b10){var c10=H(a10);return wv(c10,wu(c10,b10))}function jm(a10,b10){return ww(a10,function(a11){return b10})}var wy=jh[49],wx=jh[29];function wz(a10){return c2(function(a11){return[0,80,aT(H(a11))]},wy(a10))}var wA=0;function ba(d10,b10,c10){var a10=b10[1],e10=a10===82?[0,82,k(b10[2],function(a11){return function(a12){return aS(d10,a12)}(H(a11))})]:83<=a10?a4(wD):[0,80,function(a11){return aS(d10,a11)}(H(b10[2]))];return[0,e10,c10]}function fH(d10,b10,c10){return b10?[0,[0,80,function(a10){return aS(d10,a10)}(H(b10[1]))],c10]:c10}function jn(a10,b10){var c10=b10[1];return c10===82?[0,82,k(b10[2],a10)]:83<=c10?[0,83,fk(a10,b10[2])]:[0,80,h(a10,b10[2])]}function wF(a10){return a10[0]===0?aT(H(a10[1])):a10[1]}function fI(a10,b10){return[0,jn(wF,a10),b10]}function ak(a10){return fI(a10,0)}function cB(a10,b10){return fI(a10,b10)}function wB(a10,b10){var d10=wz(b10[1]),e10=b10[2],c10=function(a11){return bJ(e10,a11)}(d10);return a10?[0,[0,80,us(H(a10[1]))],c10]:c10}function wC(a10){return[0,wx(a10),wA]}function wE(a10,b10,c10){return b10?[0,[0,80,a10],c10]:c10}function wG(a10){return fI(jn(function(a11){return[0,a11]},a10),0)}function wH(a10,b10){return b10[0]===0?(a10.scroll(0,b10[1]),0):uB(0,b10[1])}function wI(a10,b10,c10,d10,e10){var g10=a10?a10[1]:0,h10=b10?b10[1]:0,f10=ae(1),i10=cB(wJ,cB([0,82,k(f10,function(a11){return a11?[1,aT("locked")]:[1,cz]})],g10)),j10=wG(wK),l10=[0,[0,80,az(0,cy,function(a11){return ab(f10,1)})],0],m10=K(0,[0,j10],[0,l10],0,[0,[0,82,fy(0,0,0,0,[0,[0,80,aU(0,wL)],0])],0]),n10=az(0,um,function(a11){var b11=bn(f10);return b11&&ab(f10,0)});return K(0,[0,i10],[0,[0,[0,80,n10],h10]],c10,[0,[0,82,k(wk(e10,f10,d10),function(a11){var b11=a11[1],c11=a11[3];return a11[2]&&vR(function(a12){return wH(b11,a12)},c11),b11})],[0,[0,82,m10],0]])}function dI(a10,b10){return typeof b10=="number"?0:b10[0]===0?[0,h(a10,b10[1])]:[1,b10[1]]}function wM(e10,b10,c10){var d10=ae(c10);return[0,az(0,b10,function(a10){return ab(d10,h(e10,dz(a10)[dT]))}),d10]}function jo(a10,b10,c10,d10,e10,f10,g10,h10,i10,j10){var l10=d10?d10[1]:0,m10=f10?f10[1]:0,n10=function(a11){return fH(v$,h10,a11)}(function(a11){return wE(ut,m10,a11)}([0,[0,80,iZ(H(i10))],l10])),o10=vT(b10,function(a11){return[0,a11]}),k10=wM(a10,g10,j10),p10=k10[2],q10=k10[1];return[0,fz(c10,[0,n10],[0,[0,[0,80,q10],vU(e10)]],0,0),p10,o10]}function dJ(a10,b10,c10,d10,e10,f10,g10,h10){var i10=c10?c10[1]:0,j10=function(a11){return fH(fu,h10,a11)}(function(a11){return fH(ur,g10,a11)}(i10));return jo(ay,a10,b10,[0,j10],d10,e10,uk,f10,wO,vS(wN,h10))}function dK(a10,b10,c10,d10){var e10=b10?b10[1]:0;return jo(function(a11){return 0},0,a10,[0,ba(fu,d10,e10)],c10,0,fq,0,wP,0)}function aF(a10,b10){return k(a10,function(a11){return[0,a11,b10]})}function dL(a10,b10,c10,d10,e10){var i10=[0,[0,cu,function(a11){return a11}],function(a11,b11){var c11=b11[2],d11=a11[2];return[0,aD(a11[1],b11[1]),function(a12){return h(c11,h(d11,a12))}]}];function j10(a11){var b11=a11[1],c11=a11[2];function d11(a12){var c12=bn(b11[2]);return h(b11[3],c12)}return[0,J(b11[1]),function(a12){var b12=d11(0);return h(h(c11,a12),b12)}]}var f10=function(a11){return bo(j10,i10,a11)}(bp(d10[2])),g10=[0,82,k(f10,function(a11){var b11=a11[2];return az(0,v_,function(a12){return h(e10,h(b11,d10[1])),ui(a12)})})],l10=k(f10,function(a11){return a11[1]}),m10=vQ([0,g10,0],function(a11){return mO(g10,a11)},c10);return vb(a10,b10,[0,m10],0,[0,[0,83,bp(l10)],0])}function jp(a10,b10){return a10?h(z(wQ),b10):b10}function wR(a10,b10,c10,d10,e10,f10){var m10=a10?a10[1]:1,n10=b10?b10[1]:0,o10=c10?c10[1]:0,l10=d10?d10[1]:function(a11){return function(a12){return 0}},j10=jp(1,e10[1]),p10=jp(0,e10[1]),g10=m10?jm(j10,e10[2]):ae(e10[2]),q10=bn(g10);h(h(l10,1),q10);var r10=e10[3];jb(0,[0,[0,[0,80,iY(H(j10))],0]],0,0,r10);var s10=[0,80,p10],t10=function(a11){return ba(ft,wS,a11)}(function(a11){return ba(iV,s10,a11)}(ba(fs,[0,80,j10],n10))),u10=[0,[0,80,az(0,fq,function(a11){var b11=ay(dz(a11)[dT]);return i(l10,0,b11),ab(g10,b11)})],o10];return[0,vd(0,[0,t10],[0,u10],0,[0,[0,83,bp(fk(function(a11){var b11=a11[1],c11=a11[2],d11=ak([0,80,[1,uv(H(b11))]]),e11=cB([0,82,k(g10,function(a12){return[1,up(vi(a12,b11),uu)]})],d11);return vc(0,[0,e11],0,0,[0,[0,80,aU(0,c11)],0])},f10))],0]),,g10]}function wT(a10,b10,c10,d10,e10,f10,g10){var m10=b10?b10[1]:0,n10=c10?c10[1]:function(a11){},j10=h(vM(wU),d10);function l10(a11){return a11?[0,e10]:0}a:{if(a10&&a10[1]){var o10=jm(j10,l10(g10)),i10=o10;break a}var i10=ae(l10(g10))}var p10=jb(0,[0,[0,[0,80,iY(H(j10))],0]],0,0,f10),q10=[0,80,d10],r10=function(a11){return ba(ft,wV,a11)}(function(a11){return ba(iV,q10,a11)}(ba(fs,[0,80,j10],0))),s10=[0,[0,82,k(i10,function(a11){return a11?iX:cz})],r10];return[0,K(0,0,0,0,[0,[0,82,fz(0,[0,s10],[0,[0,[0,80,az(0,fq,function(a11){var b11=l10(dz(a11)[dR]|0);return h(n10,b11),ab(i10,b11)})],m10]],0,0)],[0,[0,82,p10],0]]),i10]}function wW(a10){return[0,,,function(a11){}]}function wX(a10){var b10=wW(a10);return[0,function(a11){b10[3].call(null,0),b10[3].call(null,0)}]}function wZ(a10){return bo(function(a11){return J(K(0,0,0,0,a11[3]))},aR,a10)}function w0(a10){return e6(bo(function(a11){return a11[2]},[0,w4,function(a11,b10){return i(z(w3),a11,b10)}],a10),function(a11){return i(z(w2),w1,a11)})}jj(0)(w8);function wY(a10,b10,c10){return[0,a10,b10,c10]}function w5(a10){return w0(a10[1][1])}function w6(a10){var b10=ji(a10[2]),c10=[0,[0,80,aT(kT)],0],d10=[0,[0,80,aT("lwdui-lazy-table-header")],c10],e10=[0,[0,80,dA(H(h(z(w7),b10)))],d10];return K(0,[0,e10],0,0,[0,[0,83,bp(wZ(a10[1][1]))],0])}var w9=wX([0,vN]),dM=B2(0);function w_(e10,b10,c10,d10){var s10=d10[3],t10=d10[2],l10=fE(0),m10=fE(0),n10=ji(e10[2]),v10=h(z(xa),n10),w10=ct(function(a11,b11){return J([0,e9(a11),a11,s10])},aR,t10);hJ(0,2048),function(a11){return w9[1].call(null,50)}(0);var f10=ae(0),a10=S(function(a11){return a11}),g10=e4(0,r5(a10,f10));e5(g10,function(a11){var b11=bW(g10);return b11[2]?h(b11[1],0):0}),bW(g10);function u10(a11){return i(z(w$),n10,a11)}function j10(a11){var b11=[0,aT("row_spacer"),0];return i4(0,[0,[0,dA(H(u10(a11))),b11]],0)}var x10=k(bo(function(a11){var b11=a11[1],c11=a11[3],d11=a11[2],e11=ba(cA,xb,0),f11=[0,80,dA(H(v10))];return b11?[0,0,J(K(0,[0,[0,f11,e11]],0,0,[0,[0,83,bp(i(c11,d11,b11[1]))],0])),0]:[0,1,cu,0]},[0,[0,0,cu,0],function(a11,b11){var f11=b11[3],g11=b11[2],c11=b11[1],d11=a11[3],e11=a11[2],h10=a11[1],k10=iw(e11),i10=iw(g11);if(typeof k10=="number")return typeof i10=="number"?[0,((h10+d11|0)+c11|0)+f11|0,e11,0]:[0,(h10+d11|0)+c11|0,g11,f11];if(typeof i10=="number")return[0,h10,e11,(d11+c11|0)+f11|0];var l11=dH(d11+c11|0,0)?function(a12){return aD(e11,a12)}(aD(J(S(j10(d11+c11|0))),g11)):aD(e11,g11);return[0,h10,l11,f11]}],w10),function(a11){var b11=a11[3],c11=a11[2],d11=a11[1],e11=dH(d11,0)?aD(J(S(j10(d11))),c11):c11;return dH(b11,0)?aD(e11,J(S(j10(b11)))):e11}),y10=w6(e10),A10=v9(function(a11,b11){var d11=mP(a11);v3(d11);var c11=v0(v2(d11)),e11=bn(f10);return e11?vf(e11[1],c11)?ab(f10,[0,c11]):0:ab(f10,[0,c11])}),B10=ak(xc),o10=K(0,[0,B10],0,[0,function(a11){return fF(l10,a11)}],[0,[0,83,bp(x10)],0]),p10=ak(xd),q10=[0,[0,82,k(a10,function(c11){return az(0,ul,function(a11){var d11=[0,0],b11=[0,-1];function e11(e12){var a12=800,f11=uS(uT);vg(b11[1],0)&&uW(b11[1]),b11[1]=uV(a12,function(a13){return h(c11,e12)});var g11=vh(f11-d11[1],a12);return g11&&(d11[1]=f11,h(c11,e12))}return fG(m10),function(a12){return e11(a12)}(0),0})})],0];function r10(a11){return fF(m10,a11)}var C2=c10?wI([0,p10],[0,q10],[0,r10],k(c10[1],function(a11){var b11=fG(l10),c11=e10[2];return[0,[0,cX(a11,vP(jj([0,b11])(c11)))]]}),o10):K(0,[0,p10],[0,q10],[0,r10],[0,[0,82,o10],0]);function D2(a11){return v8(A10,0,a11)}function E2(a11){return wa(D2,a11)}var F2=function(a11){return k(a11,E2)}(C2),G2=wB(0,wC(xe));return K(0,[0,[0,[0,82,k(w5(e10),function(a11){return dA(H(a11))})],G2]],0,0,[0,[0,82,y10],[0,[0,82,F2],0]])}var fJ=hj([0,ex]),fK=dM.Text,fL=dM[la],fM=dM.Map,b3=ib(xj,xi),bb=ib(xl,xk);function xf(a10,b10){return[0,a10,b10]}function jq(a10){return b0(a10,fL)?[0,aX,a10]:b0(a10,fM)?[0,v,a10]:b0(a10,fK)?[0,bz,a10]:[0,U,a10]}function xm(a10){var b10=fn(a10,xn);if(b10)return[0,b10[1]];var c10=fn(a10,xo);if(c10)return[1,iN(jq,c10[1])];var d10=fn(a10,xp);if(d10)return[2,d10[1]];throw g([0,f,xq],1)}id2(xr,b3,[0,function(a10){return new fL},function(a10,b10,c10){return a10.insert(b10,iO(function(a11){var b11=a11[1];return bz<=b11?(aX<=b11,a11[2]):(v<=b11,a11[2])},c10)),0},function(a10,b10,c10){return a10.delete(b10,c10),0},function(a10,b10){return a10.push(iO(function(a11){var b11=a11[1];return bz<=b11?(aX<=b11,a11[2]):(v<=b11,a11[2])},b10)),0},function(a10,d10){return a10.forEach(function(a11,b10,c10){return x(d10,b10,jq(a11),c10)}),0},function(a10,b10){function c10(a11){return h(b10,xf(xm,a11))}return a10.observe(c10),c10}]);function fN(a10){return b0(a10,fL)?[0,aX,a10]:b0(a10,fM)?[0,v,a10]:b0(a10,fK)?[0,bz,a10]:[0,U,a10]}function jr(a10,b10){return function(a11){return dy(fN,a11)}(a10.get(u(b10)))}function xs(a10){return a10}function xt(a10){return a10[f5]}function xu(a10){var b10=ay(a10.action);if(b10!=="add")if(b10!==k5){if(b10!=="update")throw g([0,b9,h(z(xv),b10)],1);var c10=1}else var c10=2;else var c10=0;var d10=a10.oldValue,e10=bZ(d10)?0:[0,fN(d10)];return[0,c10,0,e10]}function js(a10){return ue(a10.entries())}id2(xw,bb,[0,function(a10){return new fM},[0,function(d10){var a10=d10[kb].keys.entries();return iQ(ay,xu,function(a11,b10,c10){var e10=jr(xt(d10),a11);return fJ[2].call(null,a11,[0,b10[1],e10,b10[3]],c10)},a10,fJ[1])}],jr,function(a10,b10,c10){var d10=c10[1],e10=bz<=d10?(aX<=d10,c10[2]):(v<=d10,c10[2]);return a10.set(u(b10),e10),0},function(a10,b10){return a10.delete(u(b10)),0},js,function(a10,d10,c10){return iQ(ay,fN,function(a11,b10,c11){return x(d10,a11,b10,c11)},js(a10),c10)},function(a10,b10){function c10(a11){return h(b10,a11)}return a10.observe(c10),c10}]);var xx=dM.Doc;function jt(a10,b10){return a10.getArray(u(b10))}function bt(a10,b10){return a10.transact(bE(1,b10)),0}function fO(a10){return a10}var al=bb[4],aV=bb[3],cC=bb[1],dN=b3[5],fP=b3[4],ju=b3[3],jv=b3[1];function xg(a10){var b10=a10[1];return[0,function(a11){return iN(b10,a11)}(a10[2][kb].delta)]}function xh(a10,b10){var c10=a10?[0,u(a10[1])]:[0];return lZ(fK,c10)}function xy(a10){return new xx}var xz=bb[8],xA=bb[7],xB=bb[5],xC=bb[2][1],xD=b3[6];function xE(a10){return a10}var xF=BW(0).Awareness;function xH(a10,b10,c10){a10.setLocalStateField(u(b10),c10)}function jw(a10){return a10}function xG(a10){return new xF(a10)}function xI(a10,b10,c10,d10){if(c10)var f10=[0,xJ,u(c10[1])],e10=[0,[0,xK,u(b10)],f10];else var e10=[0,[0,xM,u(b10)]];return xH(a10,xL,gS(e10))}var xN=BX(0);function xO(a10,b10){var c10=b10;new xN(u(a10),c10)}var xP=B0(0);function fQ(a10,b10,c10){switch(b10){case 0:a10.on(u(xW),bE(1,function(a11){return h(c10,[0,a11.connected|0])}));return;case 1:a10.on(u(xX),bE(1,function(a11){return h(c10,[0,a11[lh]|0])}));return;default:a10.on(u(x2),bE(1,function(b11){function a11(a12){return function(a13){return iP(ay,a13)}(b11[a12])}var d10=a11(xY),e10=a11(xZ),f10=a11(x0);return h(c10,[0,a11(x1),f10,e10,d10])}));return}}function xQ(a10,b10,c10,d10){var f10=cf(function(a11){return[0,xR,fp(u,a11)]},b10),e10=[0,[0,xU,{config:{iceServers:fp(function(a11){return a11},c2(function(a11){return{urls:u(h(z(xT),a11))}},xS))}}]];aE([0,e10,0]);function g10(a11){return a11}var i10=gS(c5(function(a11){return g$(g10,a11)}([0,f10,[0,e10,[0,cf(function(a11){return[0,xV,a11]},c10),0]]]))),j10=d10;return new xP(u(a10),j10,i10)}var jx=BY(0),x3=BZ(0);function x5(a10){switch(a10){case 0:var b10=x6;break;case 1:var b10=x7;break;case 2:var b10=x8;break;case 3:var b10=x9;break;default:var b10=x_}return u(b10)}function x4(a10,b10){jx.register(u(a10),b10)}function x$(a10,b10,c10,d10){var e10=a10?a10[1]:0,f10=e10?ya:yd,g10=cf(function(a11){return[0,yb,!!a11]},b10),h10=gS(c5(g$(function(a11){return a11},[0,g10,[0,cf(function(a11){return[0,yc,fp(x5,a11[1])]},c10),0]])));return{theme:u(f10),modules:h10}}function ye(a10,b10){return new jx(a10,b10)}function yf(a10){return a10}var yg=B1(0).QuillBinding;function yh(a10,b10,c10){var d10=mE(cf(jw,a10)),e10=[0,c10,d10];function f10(a11,b11){lZ(a11,b11)}return function(a11){return f10(yg,a11)}(c5([0,b10,e10]))}function yi(a10,b10,c10){return x(eL(s,yj),b10,c10,a10)}function jy(a10,b10,c10){var d10=0<=c10?1:0;if(d10)var e10=0<=b10?1:0,f10=e10&&((b10+c10|0)<=a10?1:0);else var f10=d10;var g10=1-f10;return g10&&yi(a10,b10,c10)}var yk=[0];function yl(a10,b10,c10,d10){var e10=ap(a10,b10);return ci(c10,0,e10,0,d10),e10}function jz(a10,b10){return b10<=a10?a10:b10}function jA(a10){return eL(s,a10)}function ym(a10,b10){var c10=a10[1];return i(jA(yn),b10,c10)}function yo(a10,b10){return i(jA(yp),a10,b10.length-1)}function cD(a10,b10){var c10=1-(a10<=b10.length-1?1:0);return c10&&yo(a10,b10)}function jB(a10){return[0,0,0,yk]}function cE(a10){return a10[1]}function yq(a10,b10){return a10[3][1+b10]}function jC(a10){var b10=a10[1],c10=a10[3];if(cD(b10,c10),0>>4|0));var f11=b11+1|0;function i11(a11,b12,c12){au(a11,b12,c12)}return function(a11){return i11(d11,f11,a11)}(h10(g10,c11&15))}for(;!(4<=d10[1]);){var n10=D(b10,d10[1]);f10(e10,c10[1],n10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(6<=d10[1]);){var m10=D(b10,d10[1]);f10(e10,c10[1],m10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(8<=d10[1]);){var l10=D(b10,d10[1]);f10(e10,c10[1],l10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(10<=d10[1]);){var k10=D(b10,d10[1]);f10(e10,c10[1],k10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;;){if(16<=d10[1])return $(e10);var j10=D(b10,d10[1]);f10(e10,c10[1],j10),c10[1]=c10[1]+2|0,d10[1]++}}var yD=hE(0),am=xy(0),fS=xG(am);x4(yF,x3),xI(fS,yG,0,0);var dO=xQ(yI,yH,[0,fS],am);xO(yJ,am),dE.yjsdoc=am,dE.yjsprovider=dO;var fT=ae(0),jF=ae(0),jG=ae(0);fQ(dO,0,function(a10){var b10=a10[1];return b1([0,yK,[0,!!b10,0]]),ab(jF,b10)}),fQ(dO,1,function(a10){var b10=a10[1];return b1([0,yL,[0,!!b10,0]]),ab(jG,b10)});var dP=[0,0];fQ(dO,2,function(a10){b1([0,yM,[0,a10,0]]);function c10(b11){return mX(function(a11){return ey(b11,a11)},a10[3])}function d10(b11){var c11=[0,0];return dP[1]=g_(function(a11){return ey(b11,a11)?(c11[1]=[0,b11],1):0},dP[1]),c11[1]}var b10=et(function(a11,b11){return d10(b11)?a11:(c10(b11)&&(dP[1]=[0,b11,dP[1]]),a11+1|0)},0,a10[1]),e10=er(a10[2]);return function(a11){return ab(fT,a11)}((bn(fT)+b10|0)-e10|0)});var yQ=jG,yS=cB(yR,ak([0,82,bU(jF,yQ,function(a10,b10){var c10=a10?b10?yN:yO:yP;return[0,c10]})])),yU=K(0,[0,yS],0,0,[0,[0,80,aU(0,yT)],0]),yV=[0,[0,82,yU],[0,[0,82,k(fT,function(a10){return aU(0,mm(a10))})],0]];function yE(a10){return yA(yD,0)}function yY(a10,b10){var c10=a10?a10[1]:64,d10=im(0);return[0,d10,hJ(0,c10)]}function jH(a10,b10,c10){var e10=hK(a10[2],b10);if(e10)var d10=e10[1];else{var g10=e8(0,a10[1]);hL(a10[2],b10,g10);var d10=g10}var f10=e9(d10);return f10?ab(f10[1][2],[0,c10]):sV(d10,[0,b10,ae([0,c10])])}function fU(a10,b10){var c10=hK(a10[2],b10);if(c10)var d10=c10[1];else{var f10=a10[1],e10=e8([0,[0,b10,ae(0)]],f10);hL(a10[2],b10,e10);var d10=e10}return c1(e9(d10))[2]}function fV(a10,b10){return k(fU(a10,b10),function(a11){if(!a11)return 0;var b11=a11[1];if(typeof b11!="number"&&U===b11[1])return[0,ay(b11[2])];throw g([0,f,yZ],1)})}function y0(a10){var b10=im(0);return[0,b10,jB(0)]}function y1(a10){try{var c10=[0,jE(a10[2],0)];return c10}catch(f10){var b10=P(f10);if(b10[1]===b9)return 0;throw g(b10,0)}}function jI(a10,b10){var c10=e8(a10,b10[1]);return yt(b10[2],c10)}function jJ(a10,b10,c10,d10){var e10=[0,b10,[0,c10,[0,cE(d10),0]]];b1([0,y2,[0,cE(a10),e10]]);var f10=cE(d10),g10=jE(a10,0);return fR(d10,hg(c10,function(a11){return g10})),yx(a10,b10,d10,f10,c10)}function y3(i10,b10,c10){var e10=[0,0],j10=i10[2],d10=jB(0);hh(function(a11){switch(a11[0]){case 0:var m10=a11[1];return jJ(j10,e10[1],m10,d10),e10[1]=e10[1]+m10|0,0;case 1:var c11=a11[1];if(cE(d10)!==0){var o10=[0,jC(d10)];return fR(d10,hi(function(a12){var d11=h(b10,a12),c12=sR([0,d11],o10[1]);return o10[1]=c12,c12},c11))}var n10=y1(i10);if(!n10)return hh(function(a12){var c12=h(b10,a12);return jI([0,c12],[0,i10[1],d10])},c11);var s10=n10[1];return fR(d10,hi(function(a12){return sP([0,h(b10,a12)],s10)},c11));default:var k11=a11[1],t10=e10[1]===0?tx(i10[1]):iu(jC(d10)),p10=[0,t10],u10=1;if(k11>=1)for(var l10=u10;;){var q10=p10[1];if(!q10)throw g([0,f,y4],1);var r10=q10[1];p10[1]=iu(r10),sY(r10);var v10=l10+1|0;if(k11===l10)break;l10=v10}return e10[1]=e10[1]+k11|0,0}},c10);var k10=e10[1],a10=cE(j10)-k10|0;return 0 .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}\n\n/*# sourceMappingURL=quill.core.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-bubble.ql-toolbar:after,.ql-bubble .ql-toolbar:after{clear:both;content:'';display:table}.ql-bubble.ql-toolbar button,.ql-bubble .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-bubble.ql-toolbar button svg,.ql-bubble .ql-toolbar button svg{float:left;height:100%}.ql-bubble.ql-toolbar button:active:hover,.ql-bubble .ql-toolbar button:active:hover{outline:none}.ql-bubble.ql-toolbar input.ql-image[type=file],.ql-bubble .ql-toolbar input.ql-image[type=file]{display:none}.ql-bubble.ql-toolbar button:hover,.ql-bubble .ql-toolbar button:hover,.ql-bubble.ql-toolbar button:focus,.ql-bubble .ql-toolbar button:focus,.ql-bubble.ql-toolbar button.ql-active,.ql-bubble .ql-toolbar button.ql-active,.ql-bubble.ql-toolbar .ql-picker-label:hover,.ql-bubble .ql-toolbar .ql-picker-label:hover,.ql-bubble.ql-toolbar .ql-picker-label.ql-active,.ql-bubble .ql-toolbar .ql-picker-label.ql-active,.ql-bubble.ql-toolbar .ql-picker-item:hover,.ql-bubble .ql-toolbar .ql-picker-item:hover,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected{color:#fff}.ql-bubble.ql-toolbar button:hover .ql-fill,.ql-bubble .ql-toolbar button:hover .ql-fill,.ql-bubble.ql-toolbar button:focus .ql-fill,.ql-bubble .ql-toolbar button:focus .ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#fff}.ql-bubble.ql-toolbar button:hover .ql-stroke,.ql-bubble .ql-toolbar button:hover .ql-stroke,.ql-bubble.ql-toolbar button:focus .ql-stroke,.ql-bubble .ql-toolbar button:focus .ql-stroke,.ql-bubble.ql-toolbar button.ql-active .ql-stroke,.ql-bubble .ql-toolbar button.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble.ql-toolbar button:hover .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover .ql-stroke-miter,.ql-bubble.ql-toolbar button:focus .ql-stroke-miter,.ql-bubble .ql-toolbar button:focus .ql-stroke-miter,.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#fff}@media (pointer:coarse){.ql-bubble.ql-toolbar button:hover:not(.ql-active),.ql-bubble .ql-toolbar button:hover:not(.ql-active){color:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#ccc}}.ql-bubble{box-sizing:border-box}.ql-bubble *{box-sizing:border-box}.ql-bubble .ql-hidden{display:none}.ql-bubble .ql-out-bottom,.ql-bubble .ql-out-top{visibility:hidden}.ql-bubble .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-bubble .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-bubble .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-bubble .ql-formats{display:inline-block;vertical-align:middle}.ql-bubble .ql-formats:after{clear:both;content:'';display:table}.ql-bubble .ql-stroke{fill:none;stroke:#ccc;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-bubble .ql-stroke-miter{fill:none;stroke:#ccc;stroke-miterlimit:10;stroke-width:2}.ql-bubble .ql-fill,.ql-bubble .ql-stroke.ql-fill{fill:#ccc}.ql-bubble .ql-empty{fill:none}.ql-bubble .ql-even{fill-rule:evenodd}.ql-bubble .ql-thin,.ql-bubble .ql-stroke.ql-thin{stroke-width:1}.ql-bubble .ql-transparent{opacity:.4}.ql-bubble .ql-direction svg:last-child{display:none}.ql-bubble .ql-direction.ql-active svg:last-child{display:inline}.ql-bubble .ql-direction.ql-active svg:first-child{display:none}.ql-bubble .ql-editor h1{font-size:2em}.ql-bubble .ql-editor h2{font-size:1.5em}.ql-bubble .ql-editor h3{font-size:1.17em}.ql-bubble .ql-editor h4{font-size:1em}.ql-bubble .ql-editor h5{font-size:.83em}.ql-bubble .ql-editor h6{font-size:.67em}.ql-bubble .ql-editor a{text-decoration:underline}.ql-bubble .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-bubble .ql-editor code,.ql-bubble .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-bubble .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-bubble .ql-editor code{font-size:85%;padding:2px 4px}.ql-bubble .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-bubble .ql-editor img{max-width:100%}.ql-bubble .ql-picker{color:#ccc;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-bubble .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-bubble .ql-picker-label::before{display:inline-block;line-height:22px}.ql-bubble .ql-picker-options{background-color:#444;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-bubble .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-bubble .ql-picker.ql-expanded .ql-picker-label{color:#777;z-index:2}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-bubble .ql-color-picker,.ql-bubble .ql-icon-picker{width:28px}.ql-bubble .ql-color-picker .ql-picker-label,.ql-bubble .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-label svg,.ql-bubble .ql-icon-picker .ql-picker-label svg{right:4px}.ql-bubble .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-bubble .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-bubble .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-bubble .ql-picker.ql-header{width:98px}.ql-bubble .ql-picker.ql-header .ql-picker-label::before,.ql-bubble .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-bubble .ql-picker.ql-font{width:108px}.ql-bubble .ql-picker.ql-font .ql-picker-label::before,.ql-bubble .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-bubble .ql-picker.ql-size{width:98px}.ql-bubble .ql-picker.ql-size .ql-picker-label::before,.ql-bubble .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-bubble .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-bubble .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-bubble .ql-toolbar .ql-formats{margin:8px 12px 8px 0}.ql-bubble .ql-toolbar .ql-formats:first-child{margin-left:12px}.ql-bubble .ql-color-picker svg{margin:1px}.ql-bubble .ql-color-picker .ql-picker-item.ql-selected,.ql-bubble .ql-color-picker .ql-picker-item:hover{border-color:#fff}.ql-bubble .ql-tooltip{background-color:#444;border-radius:25px;color:#fff}.ql-bubble .ql-tooltip-arrow{border-left:6px solid transparent;border-right:6px solid transparent;content:\" \";display:block;left:50%;margin-left:-6px;position:absolute}.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow{border-bottom:6px solid #444;top:-6px}.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow{border-top:6px solid #444;bottom:-6px}.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor{display:block}.ql-bubble .ql-tooltip.ql-editing .ql-formats{visibility:hidden}.ql-bubble .ql-tooltip-editor{display:none}.ql-bubble .ql-tooltip-editor input[type=text]{background:transparent;border:none;color:#fff;font-size:13px;height:100%;outline:none;padding:10px 20px;position:absolute;width:100%}.ql-bubble .ql-tooltip-editor a{top:10px;position:absolute;right:20px}.ql-bubble .ql-tooltip-editor a:before{color:#ccc;content:\"\\00D7\";font-size:16px;font-weight:bold}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close){position:relative;white-space:nowrap}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before{background-color:#444;border-radius:15px;top:-5px;font-size:12px;color:#fff;content:attr(href);font-weight:normal;overflow:hidden;padding:5px 15px;text-decoration:none;z-index:1}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{border-top:6px solid #444;border-left:6px solid transparent;border-right:6px solid transparent;top:0;content:\" \";height:0;width:0}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{left:0;margin-left:50%;position:absolute;transform:translate(-50%,-100%);transition:visibility 0s ease 200ms;visibility:hidden}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::after{visibility:visible}\n\n/*# sourceMappingURL=quill.bubble.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow + .ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}\n\n/*# sourceMappingURL=quill.snow.css.map*/", "/**\n * Common Math expressions.\n *\n * @module math\n */\n\nexport const floor = Math.floor\nexport const ceil = Math.ceil\nexport const abs = Math.abs\nexport const imul = Math.imul\nexport const round = Math.round\nexport const log10 = Math.log10\nexport const log2 = Math.log2\nexport const log = Math.log\nexport const sqrt = Math.sqrt\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The sum of a and b\n */\nexport const add = (a, b) => a + b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The smaller element of a and b\n */\nexport const min = (a, b) => a < b ? a : b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The bigger element of a and b\n */\nexport const max = (a, b) => a > b ? a : b\n\nexport const isNaN = Number.isNaN\n\nexport const pow = Math.pow\n/**\n * Base 10 exponential function. Returns the value of 10 raised to the power of pow.\n *\n * @param {number} exp\n * @return {number}\n */\nexport const exp10 = exp => Math.pow(10, exp)\n\nexport const sign = Math.sign\n\n/**\n * @param {number} n\n * @return {boolean} Wether n is negative. This function also differentiates between -0 and +0\n */\nexport const isNegativeZero = n => n !== 0 ? n < 0 : 1 / n < 0\n", "/**\n * Utility helpers for working with numbers.\n *\n * @module number\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\n\nexport const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER\nexport const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER\n\nexport const LOWEST_INT32 = 1 << 31\nexport const HIGHEST_INT32 = binary.BITS31\nexport const HIGHEST_UINT32 = binary.BITS32\n\n/* c8 ignore next */\nexport const isInteger = Number.isInteger || (num => typeof num === 'number' && isFinite(num) && math.floor(num) === num)\nexport const isNaN = Number.isNaN\nexport const parseInt = Number.parseInt\n\n/**\n * Count the number of \"1\" bits in an unsigned 32bit number.\n *\n * Super fun bitcount algorithm by Brian Kernighan.\n *\n * @param {number} n\n */\nexport const countBits = n => {\n n &= binary.BITS32\n let count = 0\n while (n) {\n n &= (n - 1)\n count++\n }\n return count\n}\n", "/**\n * Utility module to work with sets.\n *\n * @module set\n */\n\nexport const create = () => new Set()\n\n/**\n * @template T\n * @param {Set} set\n * @return {Array}\n */\nexport const toArray = set => Array.from(set)\n\n/**\n * @template T\n * @param {Set} set\n * @return {T}\n */\nexport const first = set =>\n set.values().next().value ?? undefined\n\n/**\n * @template T\n * @param {Iterable} entries\n * @return {Set}\n */\nexport const from = entries => new Set(entries)\n", "/**\n * Utility module to work with Arrays.\n *\n * @module array\n */\n\nimport * as set from './set.js'\n\n/**\n * Return the last element of an array. The element must exist\n *\n * @template L\n * @param {ArrayLike} arr\n * @return {L}\n */\nexport const last = arr => arr[arr.length - 1]\n\n/**\n * @template C\n * @return {Array}\n */\nexport const create = () => /** @type {Array} */ ([])\n\n/**\n * @template D\n * @param {Array} a\n * @return {Array}\n */\nexport const copy = a => /** @type {Array} */ (a.slice())\n\n/**\n * Append elements from src to dest\n *\n * @template M\n * @param {Array} dest\n * @param {Array} src\n */\nexport const appendTo = (dest, src) => {\n for (let i = 0; i < src.length; i++) {\n dest.push(src[i])\n }\n}\n\n/**\n * Transforms something array-like to an actual Array.\n *\n * @function\n * @template T\n * @param {ArrayLike|Iterable} arraylike\n * @return {T}\n */\nexport const from = Array.from\n\n/**\n * True iff condition holds on every element in the Array.\n *\n * @function\n * @template ITEM\n * @template {ArrayLike} ARR\n *\n * @param {ARR} arr\n * @param {function(ITEM, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const every = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (!f(arr[i], i, arr)) {\n return false\n }\n }\n return true\n}\n\n/**\n * True iff condition holds on some element in the Array.\n *\n * @function\n * @template S\n * @template {ArrayLike} ARR\n * @param {ARR} arr\n * @param {function(S, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const some = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (f(arr[i], i, arr)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @template ELEM\n *\n * @param {ArrayLike} a\n * @param {ArrayLike} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index])\n\n/**\n * @template ELEM\n * @param {Array>} arr\n * @return {Array}\n */\nexport const flatten = arr => fold(arr, /** @type {Array} */ ([]), (acc, val) => acc.concat(val))\n\n/**\n * @template T\n * @param {number} len\n * @param {function(number, Array):T} f\n * @return {Array}\n */\nexport const unfold = (len, f) => {\n const array = new Array(len)\n for (let i = 0; i < len; i++) {\n array[i] = f(i, array)\n }\n return array\n}\n\n/**\n * @template T\n * @template RESULT\n * @param {Array} arr\n * @param {RESULT} seed\n * @param {function(RESULT, T, number):RESULT} folder\n */\nexport const fold = (arr, seed, folder) => arr.reduce(folder, seed)\n\nexport const isArray = Array.isArray\n\n/**\n * @template T\n * @param {Array} arr\n * @return {Array}\n */\nexport const unique = arr => from(set.from(arr))\n\n/**\n * @template T\n * @template M\n * @param {ArrayLike} arr\n * @param {function(T):M} mapper\n * @return {Array}\n */\nexport const uniqueBy = (arr, mapper) => {\n /**\n * @type {Set}\n */\n const happened = set.create()\n /**\n * @type {Array}\n */\n const result = []\n for (let i = 0; i < arr.length; i++) {\n const el = arr[i]\n const mapped = mapper(el)\n if (!happened.has(mapped)) {\n happened.add(mapped)\n result.push(el)\n }\n }\n return result\n}\n\n/**\n * @template {ArrayLike} ARR\n * @template {function(ARR extends ArrayLike ? T : never, number, ARR):any} MAPPER\n * @param {ARR} arr\n * @param {MAPPER} mapper\n * @return {Array}\n */\nexport const map = (arr, mapper) => {\n /**\n * @type {Array}\n */\n const res = Array(arr.length)\n for (let i = 0; i < arr.length; i++) {\n res[i] = mapper(/** @type {any} */ (arr[i]), i, /** @type {any} */ (arr))\n }\n return /** @type {any} */ (res)\n}\n", "import * as array from './array.js'\n\n/**\n * Utility module to work with strings.\n *\n * @module string\n */\n\nexport const fromCharCode = String.fromCharCode\nexport const fromCodePoint = String.fromCodePoint\n\n/**\n * The largest utf16 character.\n * Corresponds to Uint8Array([255, 255]) or charcodeof(2x2^8)\n */\nexport const MAX_UTF16_CHARACTER = fromCharCode(65535)\n\n/**\n * @param {string} s\n * @return {string}\n */\nconst toLowerCase = s => s.toLowerCase()\n\nconst trimLeftRegex = /^\\s*/g\n\n/**\n * @param {string} s\n * @return {string}\n */\nexport const trimLeft = s => s.replace(trimLeftRegex, '')\n\nconst fromCamelCaseRegex = /([A-Z])/g\n\n/**\n * @param {string} s\n * @param {string} separator\n * @return {string}\n */\nexport const fromCamelCase = (s, separator) => trimLeft(s.replace(fromCamelCaseRegex, match => `${separator}${toLowerCase(match)}`))\n\n/**\n * Compute the utf8ByteLength\n * @param {string} str\n * @return {number}\n */\nexport const utf8ByteLength = str => unescape(encodeURIComponent(str)).length\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Polyfill = str => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n const buf = new Uint8Array(len)\n for (let i = 0; i < len; i++) {\n buf[i] = /** @type {number} */ (encodedString.codePointAt(i))\n }\n return buf\n}\n\n/* c8 ignore next */\nexport const utf8TextEncoder = /** @type {TextEncoder} */ (typeof TextEncoder !== 'undefined' ? new TextEncoder() : null)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Native = str => utf8TextEncoder.encode(str)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\n/* c8 ignore next */\nexport const encodeUtf8 = utf8TextEncoder ? _encodeUtf8Native : _encodeUtf8Polyfill\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Polyfill = buf => {\n let remainingLen = buf.length\n let encodedString = ''\n let bufPos = 0\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n const bytes = buf.subarray(bufPos, bufPos + nextLen)\n bufPos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n return decodeURIComponent(escape(encodedString))\n}\n\n/* c8 ignore next */\nexport let utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8', { fatal: true, ignoreBOM: true })\n\n/* c8 ignore start */\nif (utf8TextDecoder && utf8TextDecoder.decode(new Uint8Array()).length === 1) {\n // Safari doesn't handle BOM correctly.\n // This fixes a bug in Safari 13.0.5 where it produces a BOM the first time it is called.\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the first call and\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the second call\n // Another issue is that from then on no BOM chars are recognized anymore\n /* c8 ignore next */\n utf8TextDecoder = null\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Native = buf => /** @type {TextDecoder} */ (utf8TextDecoder).decode(buf)\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\n/* c8 ignore next */\nexport const decodeUtf8 = utf8TextDecoder ? _decodeUtf8Native : _decodeUtf8Polyfill\n\n/**\n * @param {string} str The initial string\n * @param {number} index Starting position\n * @param {number} remove Number of characters to remove\n * @param {string} insert New content to insert\n */\nexport const splice = (str, index, remove, insert = '') => str.slice(0, index) + insert + str.slice(index + remove)\n\n/**\n * @param {string} source\n * @param {number} n\n */\nexport const repeat = (source, n) => array.unfold(n, () => source).join('')\n", "/**\n * Efficient schema-less binary encoding with support for variable length encoding.\n *\n * Use [lib0/encoding] with [lib0/decoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module encoding\n */\n\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as binary from './binary.js'\nimport * as string from './string.js'\nimport * as array from './array.js'\n\n/**\n * A BinaryEncoder handles the encoding to an Uint8Array.\n */\nexport class Encoder {\n constructor () {\n this.cpos = 0\n this.cbuf = new Uint8Array(100)\n /**\n * @type {Array}\n */\n this.bufs = []\n }\n}\n\n/**\n * @function\n * @return {Encoder}\n */\nexport const createEncoder = () => new Encoder()\n\n/**\n * @param {function(Encoder):void} f\n */\nexport const encode = (f) => {\n const encoder = createEncoder()\n f(encoder)\n return toUint8Array(encoder)\n}\n\n/**\n * The current length of the encoded data.\n *\n * @function\n * @param {Encoder} encoder\n * @return {number}\n */\nexport const length = encoder => {\n let len = encoder.cpos\n for (let i = 0; i < encoder.bufs.length; i++) {\n len += encoder.bufs[i].length\n }\n return len\n}\n\n/**\n * Check whether encoder is empty.\n *\n * @function\n * @param {Encoder} encoder\n * @return {boolean}\n */\nexport const hasContent = encoder => encoder.cpos > 0 || encoder.bufs.length > 0\n\n/**\n * Transform to Uint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @return {Uint8Array} The created ArrayBuffer.\n */\nexport const toUint8Array = encoder => {\n const uint8arr = new Uint8Array(length(encoder))\n let curPos = 0\n for (let i = 0; i < encoder.bufs.length; i++) {\n const d = encoder.bufs[i]\n uint8arr.set(d, curPos)\n curPos += d.length\n }\n uint8arr.set(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos), curPos)\n return uint8arr\n}\n\n/**\n * Verify that it is possible to write `len` bytes wtihout checking. If\n * necessary, a new Buffer with the required length is attached.\n *\n * @param {Encoder} encoder\n * @param {number} len\n */\nexport const verifyLen = (encoder, len) => {\n const bufferLen = encoder.cbuf.length\n if (bufferLen - encoder.cpos < len) {\n encoder.bufs.push(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos))\n encoder.cbuf = new Uint8Array(math.max(bufferLen, len) * 2)\n encoder.cpos = 0\n }\n}\n\n/**\n * Write one byte to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The byte that is to be encoded.\n */\nexport const write = (encoder, num) => {\n const bufferLen = encoder.cbuf.length\n if (encoder.cpos === bufferLen) {\n encoder.bufs.push(encoder.cbuf)\n encoder.cbuf = new Uint8Array(bufferLen * 2)\n encoder.cpos = 0\n }\n encoder.cbuf[encoder.cpos++] = num\n}\n\n/**\n * Write one byte at a specific position.\n * Position must already be written (i.e. encoder.length > pos)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos Position to which to write data\n * @param {number} num Unsigned 8-bit integer\n */\nexport const set = (encoder, pos, num) => {\n let buffer = null\n // iterate all buffers and adjust position\n for (let i = 0; i < encoder.bufs.length && buffer === null; i++) {\n const b = encoder.bufs[i]\n if (pos < b.length) {\n buffer = b // found buffer\n } else {\n pos -= b.length\n }\n }\n if (buffer === null) {\n // use current buffer\n buffer = encoder.cbuf\n }\n buffer[pos] = num\n}\n\n/**\n * Write one byte as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint8 = write\n\n/**\n * Write one byte as an unsigned Integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint8 = set\n\n/**\n * Write two bytes as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint16 = (encoder, num) => {\n write(encoder, num & binary.BITS8)\n write(encoder, (num >>> 8) & binary.BITS8)\n}\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint16 = (encoder, pos, num) => {\n set(encoder, pos, num & binary.BITS8)\n set(encoder, pos + 1, (num >>> 8) & binary.BITS8)\n}\n\n/**\n * Write two bytes as an unsigned integer\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32 = (encoder, num) => {\n for (let i = 0; i < 4; i++) {\n write(encoder, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write two bytes as an unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32BigEndian = (encoder, num) => {\n for (let i = 3; i >= 0; i--) {\n write(encoder, (num >>> (8 * i)) & binary.BITS8)\n }\n}\n\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint32 = (encoder, pos, num) => {\n for (let i = 0; i < 4; i++) {\n set(encoder, pos + i, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write a variable length unsigned integer. Max encodable integer is 2^53.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarUint = (encoder, num) => {\n while (num > binary.BITS7) {\n write(encoder, binary.BIT8 | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n write(encoder, binary.BITS7 & num)\n}\n\n/**\n * Write a variable length integer.\n *\n * We use the 7th bit instead for signaling that this is a negative number.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarInt = (encoder, num) => {\n const isNegative = math.isNegativeZero(num)\n if (isNegative) {\n num = -num\n }\n // |- whether to continue reading |- whether is negative |- number\n write(encoder, (num > binary.BITS6 ? binary.BIT8 : 0) | (isNegative ? binary.BIT7 : 0) | (binary.BITS6 & num))\n num = math.floor(num / 64) // shift >>> 6\n // We don't need to consider the case of num === 0 so we can use a different\n // pattern here than above.\n while (num > 0) {\n write(encoder, (num > binary.BITS7 ? binary.BIT8 : 0) | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n}\n\n/**\n * A cache to store strings temporarily\n */\nconst _strBuffer = new Uint8Array(30000)\nconst _maxStrBSize = _strBuffer.length / 3\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringNative = (encoder, str) => {\n if (str.length < _maxStrBSize) {\n // We can encode the string into the existing buffer\n /* c8 ignore next */\n const written = string.utf8TextEncoder.encodeInto(str, _strBuffer).written || 0\n writeVarUint(encoder, written)\n for (let i = 0; i < written; i++) {\n write(encoder, _strBuffer[i])\n }\n } else {\n writeVarUint8Array(encoder, string.encodeUtf8(str))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringPolyfill = (encoder, str) => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n write(encoder, /** @type {number} */ (encodedString.codePointAt(i)))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\n/* c8 ignore next */\nexport const writeVarString = (string.utf8TextEncoder && /** @type {any} */ (string.utf8TextEncoder).encodeInto) ? _writeVarStringNative : _writeVarStringPolyfill\n\n/**\n * Write a string terminated by a special byte sequence. This is not very performant and is\n * generally discouraged. However, the resulting byte arrays are lexiographically ordered which\n * makes this a nice feature for databases.\n *\n * The string will be encoded using utf8 and then terminated and escaped using writeTerminatingUint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const writeTerminatedString = (encoder, str) =>\n writeTerminatedUint8Array(encoder, string.encodeUtf8(str))\n\n/**\n * Write a terminating Uint8Array. Note that this is not performant and is generally\n * discouraged. There are few situations when this is needed.\n *\n * We use 0x0 as a terminating character. 0x1 serves as an escape character for 0x0 and 0x1.\n *\n * Example: [0,1,2] is encoded to [1,0,1,1,2,0]. 0x0, and 0x1 needed to be escaped using 0x1. Then\n * the result is terminated using the 0x0 character.\n *\n * This is basically how many systems implement null terminated strings. However, we use an escape\n * character 0x1 to avoid issues and potenial attacks on our database (if this is used as a key\n * encoder for NoSql databases).\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} buf The string that is to be encoded.\n */\nexport const writeTerminatedUint8Array = (encoder, buf) => {\n for (let i = 0; i < buf.length; i++) {\n const b = buf[i]\n if (b === 0 || b === 1) {\n write(encoder, 1)\n }\n write(encoder, buf[i])\n }\n write(encoder, 0)\n}\n\n/**\n * Write the content of another Encoder.\n *\n * @TODO: can be improved!\n * - Note: Should consider that when appending a lot of small Encoders, we should rather clone than referencing the old structure.\n * Encoders start with a rather big initial buffer.\n *\n * @function\n * @param {Encoder} encoder The enUint8Arr\n * @param {Encoder} append The BinaryEncoder to be written.\n */\nexport const writeBinaryEncoder = (encoder, append) => writeUint8Array(encoder, toUint8Array(append))\n\n/**\n * Append fixed-length Uint8Array to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeUint8Array = (encoder, uint8Array) => {\n const bufferLen = encoder.cbuf.length\n const cpos = encoder.cpos\n const leftCopyLen = math.min(bufferLen - cpos, uint8Array.length)\n const rightCopyLen = uint8Array.length - leftCopyLen\n encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos)\n encoder.cpos += leftCopyLen\n if (rightCopyLen > 0) {\n // Still something to write, write right half..\n // Append new buffer\n encoder.bufs.push(encoder.cbuf)\n // must have at least size of remaining buffer\n encoder.cbuf = new Uint8Array(math.max(bufferLen * 2, rightCopyLen))\n // copy array\n encoder.cbuf.set(uint8Array.subarray(leftCopyLen))\n encoder.cpos = rightCopyLen\n }\n}\n\n/**\n * Append an Uint8Array to Encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeVarUint8Array = (encoder, uint8Array) => {\n writeVarUint(encoder, uint8Array.byteLength)\n writeUint8Array(encoder, uint8Array)\n}\n\n/**\n * Create an DataView of the next `len` bytes. Use it to write data after\n * calling this function.\n *\n * ```js\n * // write float32 using DataView\n * const dv = writeOnDataView(encoder, 4)\n * dv.setFloat32(0, 1.1)\n * // read float32 using DataView\n * const dv = readFromDataView(encoder, 4)\n * dv.getFloat32(0) // => 1.100000023841858 (leaving it to the reader to find out why this is the correct result)\n * ```\n *\n * @param {Encoder} encoder\n * @param {number} len\n * @return {DataView}\n */\nexport const writeOnDataView = (encoder, len) => {\n verifyLen(encoder, len)\n const dview = new DataView(encoder.cbuf.buffer, encoder.cpos, len)\n encoder.cpos += len\n return dview\n}\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat32 = (encoder, num) => writeOnDataView(encoder, 4).setFloat32(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat64 = (encoder, num) => writeOnDataView(encoder, 8).setFloat64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigInt64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigInt64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigUint64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigUint64(0, num, false)\n\nconst floatTestBed = new DataView(new ArrayBuffer(4))\n/**\n * Check if a number can be encoded as a 32 bit float.\n *\n * @param {number} num\n * @return {boolean}\n */\nconst isFloat32 = num => {\n floatTestBed.setFloat32(0, num)\n return floatTestBed.getFloat32(0) === num\n}\n\n/**\n * Encode data with efficient binary format.\n *\n * Differences to JSON:\n * \u2022 Transforms data to a binary format (not to a string)\n * \u2022 Encodes undefined, NaN, and ArrayBuffer (these can't be represented in JSON)\n * \u2022 Numbers are efficiently encoded either as a variable length integer, as a\n * 32 bit float, as a 64 bit float, or as a 64 bit bigint.\n *\n * Encoding table:\n *\n * | Data Type | Prefix | Encoding Method | Comment |\n * | ------------------- | -------- | ------------------ | ------- |\n * | undefined | 127 | | Functions, symbol, and everything that cannot be identified is encoded as undefined |\n * | null | 126 | | |\n * | integer | 125 | writeVarInt | Only encodes 32 bit signed integers |\n * | float32 | 124 | writeFloat32 | |\n * | float64 | 123 | writeFloat64 | |\n * | bigint | 122 | writeBigInt64 | |\n * | boolean (false) | 121 | | True and false are different data types so we save the following byte |\n * | boolean (true) | 120 | | - 0b01111000 so the last bit determines whether true or false |\n * | string | 119 | writeVarString | |\n * | object | 118 | custom | Writes {length} then {length} key-value pairs |\n * | array | 117 | custom | Writes {length} then {length} json values |\n * | Uint8Array | 116 | writeVarUint8Array | We use Uint8Array for any kind of binary data |\n *\n * Reasons for the decreasing prefix:\n * We need the first bit for extendability (later we may want to encode the\n * prefix with writeVarUint). The remaining 7 bits are divided as follows:\n * [0-30] the beginning of the data range is used for custom purposes\n * (defined by the function that uses this library)\n * [31-127] the end of the data range is used for data encoding by\n * lib0/encoding.js\n *\n * @param {Encoder} encoder\n * @param {undefined|null|number|bigint|boolean|string|Object|Array|Uint8Array} data\n */\nexport const writeAny = (encoder, data) => {\n switch (typeof data) {\n case 'string':\n // TYPE 119: STRING\n write(encoder, 119)\n writeVarString(encoder, data)\n break\n case 'number':\n if (number.isInteger(data) && math.abs(data) <= binary.BITS31) {\n // TYPE 125: INTEGER\n write(encoder, 125)\n writeVarInt(encoder, data)\n } else if (isFloat32(data)) {\n // TYPE 124: FLOAT32\n write(encoder, 124)\n writeFloat32(encoder, data)\n } else {\n // TYPE 123: FLOAT64\n write(encoder, 123)\n writeFloat64(encoder, data)\n }\n break\n case 'bigint':\n // TYPE 122: BigInt\n write(encoder, 122)\n writeBigInt64(encoder, data)\n break\n case 'object':\n if (data === null) {\n // TYPE 126: null\n write(encoder, 126)\n } else if (array.isArray(data)) {\n // TYPE 117: Array\n write(encoder, 117)\n writeVarUint(encoder, data.length)\n for (let i = 0; i < data.length; i++) {\n writeAny(encoder, data[i])\n }\n } else if (data instanceof Uint8Array) {\n // TYPE 116: ArrayBuffer\n write(encoder, 116)\n writeVarUint8Array(encoder, data)\n } else {\n // TYPE 118: Object\n write(encoder, 118)\n const keys = Object.keys(data)\n writeVarUint(encoder, keys.length)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n writeVarString(encoder, key)\n writeAny(encoder, data[key])\n }\n }\n break\n case 'boolean':\n // TYPE 120/121: boolean (true/false)\n write(encoder, data ? 120 : 121)\n break\n default:\n // TYPE 127: undefined\n write(encoder, 127)\n }\n}\n\n/**\n * Now come a few stateful encoder that have their own classes.\n */\n\n/**\n * Basic Run Length Encoder - a basic compression implementation.\n *\n * Encodes [1,1,1,7] to [1,3,7,1] (3 times 1, 1 time 7). This encoder might do more harm than good if there are a lot of values that are not repeated.\n *\n * It was originally used for image compression. Cool .. article http://csbruce.com/cbm/transactor/pdfs/trans_v7_i06.pdf\n *\n * @note T must not be null!\n *\n * @template T\n */\nexport class RleEncoder extends Encoder {\n /**\n * @param {function(Encoder, T):void} writer\n */\n constructor (writer) {\n super()\n /**\n * The writer\n */\n this.w = writer\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n /**\n * @param {T} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n this.w(this, v)\n this.s = v\n }\n }\n}\n\n/**\n * Basic diff decoder using variable length encoding.\n *\n * Encodes the values [3, 1100, 1101, 1050, 0] to [3, 1097, 1, -51, -1050] using writeVarInt.\n */\nexport class IntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n writeVarInt(this, v - this.s)\n this.s = v\n }\n}\n\n/**\n * A combination of IntDiffEncoder and RleEncoder.\n *\n * Basically first writes the IntDiffEncoder and then counts duplicate diffs using RleEncoding.\n *\n * Encodes the values [1,1,1,2,3,4,5,6] as [1,1,0,2,1,5] (RLE([1,0,0,1,1,1,1,1]) \u21D2 RleIntDiff[1,1,0,2,1,5])\n */\nexport class RleIntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v && this.count > 0) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n writeVarInt(this, v - this.s)\n this.s = v\n }\n }\n}\n\n/**\n * @param {UintOptRleEncoder} encoder\n */\nconst flushUintOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set sign to positive\n // case 2: write several values. set sign to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encoder.count === 1 ? encoder.s : -encoder.s)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * Optimized Rle encoder that does not suffer from the mentioned problem of the basic Rle encoder.\n *\n * Internally uses VarInt encoder to write unsigned integers. If the input occurs multiple times, we write\n * write it as a negative number. The UintOptRleDecoder then understands that it needs to read a count.\n *\n * Encodes [1,2,3,3,3] as [1,2,-3,3] (once 1, once 2, three times 3)\n */\nexport class UintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Increasing Uint Optimized RLE Encoder\n *\n * The RLE encoder counts the number of same occurences of the same value.\n * The IncUintOptRle encoder counts if the value increases.\n * I.e. 7, 8, 9, 10 will be encoded as [-7, 4]. 1, 3, 5 will be encoded\n * as [1, 3, 5].\n */\nexport class IncUintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s + this.count === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * @param {IntDiffOptRleEncoder} encoder\n */\nconst flushIntDiffOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // 31 bit making up the diff | wether to write the counter\n // const encodedDiff = encoder.diff << 1 | (encoder.count === 1 ? 0 : 1)\n const encodedDiff = encoder.diff * 2 + (encoder.count === 1 ? 0 : 1)\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set first bit to positive\n // case 2: write several values. set first bit to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encodedDiff)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * A combination of the IntDiffEncoder and the UintOptRleEncoder.\n *\n * The count approach is similar to the UintDiffOptRleEncoder, but instead of using the negative bitflag, it encodes\n * in the LSB whether a count is to be read. Therefore this Encoder only supports 31 bit integers!\n *\n * Encodes [1, 2, 3, 2] as [3, 1, 6, -1] (more specifically [(1 << 1) | 1, (3 << 0) | 0, -1])\n *\n * Internally uses variable length encoding. Contrary to normal UintVar encoding, the first byte contains:\n * * 1 bit that denotes whether the next value is a count (LSB)\n * * 1 bit that denotes whether this value is negative (MSB - 1)\n * * 1 bit that denotes whether to continue reading the variable length integer (MSB)\n *\n * Therefore, only five bits remain to encode diff ranges.\n *\n * Use this Encoder only when appropriate. In most cases, this is probably a bad idea.\n */\nexport class IntDiffOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.diff === v - this.s) {\n this.s = v\n this.count++\n } else {\n flushIntDiffOptRleEncoder(this)\n this.count = 1\n this.diff = v - this.s\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushIntDiffOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Optimized String Encoder.\n *\n * Encoding many small strings in a simple Encoder is not very efficient. The function call to decode a string takes some time and creates references that must be eventually deleted.\n * In practice, when decoding several million small strings, the GC will kick in more and more often to collect orphaned string objects (or maybe there is another reason?).\n *\n * This string encoder solves the above problem. All strings are concatenated and written as a single string using a single encoding call.\n *\n * The lengths are encoded using a UintOptRleEncoder.\n */\nexport class StringEncoder {\n constructor () {\n /**\n * @type {Array}\n */\n this.sarr = []\n this.s = ''\n this.lensE = new UintOptRleEncoder()\n }\n\n /**\n * @param {string} string\n */\n write (string) {\n this.s += string\n if (this.s.length > 19) {\n this.sarr.push(this.s)\n this.s = ''\n }\n this.lensE.write(string.length)\n }\n\n toUint8Array () {\n const encoder = new Encoder()\n this.sarr.push(this.s)\n this.s = ''\n writeVarString(encoder, this.sarr.join(''))\n writeUint8Array(encoder, this.lensE.toUint8Array())\n return toUint8Array(encoder)\n }\n}\n", "/**\n * Error helpers.\n *\n * @module error\n */\n\n/**\n * @param {string} s\n * @return {Error}\n */\n/* c8 ignore next */\nexport const create = s => new Error(s)\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const methodUnimplemented = () => {\n throw create('Method unimplemented')\n}\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const unexpectedCase = () => {\n throw create('Unexpected case')\n}\n", "/**\n * Efficient schema-less binary decoding with support for variable length encoding.\n *\n * Use [lib0/decoding] with [lib0/encoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module decoding\n */\n\nimport * as binary from './binary.js'\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as string from './string.js'\nimport * as error from './error.js'\nimport * as encoding from './encoding.js'\n\nconst errorUnexpectedEndOfArray = error.create('Unexpected end of array')\nconst errorIntegerOutOfRange = error.create('Integer out of Range')\n\n/**\n * A Decoder handles the decoding of an Uint8Array.\n */\nexport class Decoder {\n /**\n * @param {Uint8Array} uint8Array Binary data to decode\n */\n constructor (uint8Array) {\n /**\n * Decoding target.\n *\n * @type {Uint8Array}\n */\n this.arr = uint8Array\n /**\n * Current decoding position.\n *\n * @type {number}\n */\n this.pos = 0\n }\n}\n\n/**\n * @function\n * @param {Uint8Array} uint8Array\n * @return {Decoder}\n */\nexport const createDecoder = uint8Array => new Decoder(uint8Array)\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {boolean}\n */\nexport const hasContent = decoder => decoder.pos !== decoder.arr.length\n\n/**\n * Clone a decoder instance.\n * Optionally set a new position parameter.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} [newPos] Defaults to current position\n * @return {Decoder} A clone of `decoder`\n */\nexport const clone = (decoder, newPos = decoder.pos) => {\n const _decoder = createDecoder(decoder.arr)\n _decoder.pos = newPos\n return _decoder\n}\n\n/**\n * Create an Uint8Array view of the next `len` bytes and advance the position by `len`.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} len The length of bytes to read\n * @return {Uint8Array}\n */\nexport const readUint8Array = (decoder, len) => {\n const view = new Uint8Array(decoder.arr.buffer, decoder.pos + decoder.arr.byteOffset, len)\n decoder.pos += len\n return view\n}\n\n/**\n * Read variable length Uint8Array.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readVarUint8Array = decoder => readUint8Array(decoder, readVarUint(decoder))\n\n/**\n * Read the rest of the content as an ArrayBuffer\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTailAsUint8Array = decoder => readUint8Array(decoder, decoder.arr.length - decoder.pos)\n\n/**\n * Skip one byte, jump to the next position.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} The next position\n */\nexport const skip8 = decoder => decoder.pos++\n\n/**\n * Read one byte as unsigned integer.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} Unsigned 8-bit integer\n */\nexport const readUint8 = decoder => decoder.arr[decoder.pos++]\n\n/**\n * Read 2 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint16 = decoder => {\n const uint =\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n decoder.pos += 2\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32 = decoder => {\n const uint =\n (decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32BigEndian = decoder => {\n const uint =\n (decoder.arr[decoder.pos + 3] +\n (decoder.arr[decoder.pos + 2] << 8) +\n (decoder.arr[decoder.pos + 1] << 16) +\n (decoder.arr[decoder.pos] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint8 = decoder => decoder.arr[decoder.pos]\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint16 = decoder =>\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint32 = decoder => (\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)\n) >>> 0\n\n/**\n * Read unsigned integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarUint = decoder => {\n let num = 0\n let mult = 1\n const len = decoder.arr.length\n while (decoder.pos < len) {\n const r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult // shift $r << (7*#iterations) and add it to num\n mult *= 128 // next iteration, shift 7 \"more\" to the left\n if (r < binary.BIT8) {\n return num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Read signed integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n * @todo This should probably create the inverse ~num if number is negative - but this would be a breaking change.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarInt = decoder => {\n let r = decoder.arr[decoder.pos++]\n let num = r & binary.BITS6\n let mult = 64\n const sign = (r & binary.BIT7) > 0 ? -1 : 1\n if ((r & binary.BIT8) === 0) {\n // don't continue reading\n return sign * num\n }\n const len = decoder.arr.length\n while (decoder.pos < len) {\n r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult\n mult *= 128\n if (r < binary.BIT8) {\n return sign * num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarUint = decoder => {\n const pos = decoder.pos\n const s = readVarUint(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarInt = decoder => {\n const pos = decoder.pos\n const s = readVarInt(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * We don't test this function anymore as we use native decoding/encoding by default now.\n * Better not modify this anymore..\n *\n * Transforming utf8 to a string is pretty expensive. The code performs 10x better\n * when String.fromCodePoint is fed with all characters as arguments.\n * But most environments have a maximum number of arguments per functions.\n * For effiency reasons we apply a maximum of 10000 characters at once.\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String.\n */\n/* c8 ignore start */\nexport const _readVarStringPolyfill = decoder => {\n let remainingLen = readVarUint(decoder)\n if (remainingLen === 0) {\n return ''\n } else {\n let encodedString = String.fromCodePoint(readUint8(decoder)) // remember to decrease remainingLen\n if (--remainingLen < 100) { // do not create a Uint8Array for small strings\n while (remainingLen--) {\n encodedString += String.fromCodePoint(readUint8(decoder))\n }\n } else {\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n // this is dangerous, we create a fresh array view from the existing buffer\n const bytes = decoder.arr.subarray(decoder.pos, decoder.pos + nextLen)\n decoder.pos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n }\n return decodeURIComponent(escape(encodedString))\n }\n}\n/* c8 ignore stop */\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n */\nexport const _readVarStringNative = decoder =>\n /** @type any */ (string.utf8TextDecoder).decode(readVarUint8Array(decoder))\n\n/**\n * Read string of variable length\n * * varUint is used to store the length of the string\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n *\n */\n/* c8 ignore next */\nexport const readVarString = string.utf8TextDecoder ? _readVarStringNative : _readVarStringPolyfill\n\n/**\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTerminatedUint8Array = decoder => {\n const encoder = encoding.createEncoder()\n let b\n while (true) {\n b = readUint8(decoder)\n if (b === 0) {\n return encoding.toUint8Array(encoder)\n }\n if (b === 1) {\n b = readUint8(decoder)\n }\n encoding.write(encoder, b)\n }\n}\n\n/**\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const readTerminatedString = decoder => string.decodeUtf8(readTerminatedUint8Array(decoder))\n\n/**\n * Look ahead and read varString without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const peekVarString = decoder => {\n const pos = decoder.pos\n const s = readVarString(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * @param {Decoder} decoder\n * @param {number} len\n * @return {DataView}\n */\nexport const readFromDataView = (decoder, len) => {\n const dv = new DataView(decoder.arr.buffer, decoder.arr.byteOffset + decoder.pos, len)\n decoder.pos += len\n return dv\n}\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat32 = decoder => readFromDataView(decoder, 4).getFloat32(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat64 = decoder => readFromDataView(decoder, 8).getFloat64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigInt64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigInt64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigUint64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigUint64(0, false)\n\n/**\n * @type {Array}\n */\nconst readAnyLookupTable = [\n decoder => undefined, // CASE 127: undefined\n decoder => null, // CASE 126: null\n readVarInt, // CASE 125: integer\n readFloat32, // CASE 124: float32\n readFloat64, // CASE 123: float64\n readBigInt64, // CASE 122: bigint\n decoder => false, // CASE 121: boolean (false)\n decoder => true, // CASE 120: boolean (true)\n readVarString, // CASE 119: string\n decoder => { // CASE 118: object\n const len = readVarUint(decoder)\n /**\n * @type {Object}\n */\n const obj = {}\n for (let i = 0; i < len; i++) {\n const key = readVarString(decoder)\n obj[key] = readAny(decoder)\n }\n return obj\n },\n decoder => { // CASE 117: array\n const len = readVarUint(decoder)\n const arr = []\n for (let i = 0; i < len; i++) {\n arr.push(readAny(decoder))\n }\n return arr\n },\n readVarUint8Array // CASE 116: Uint8Array\n]\n\n/**\n * @param {Decoder} decoder\n */\nexport const readAny = decoder => readAnyLookupTable[127 - readUint8(decoder)](decoder)\n\n/**\n * T must not be null.\n *\n * @template T\n */\nexport class RleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {function(Decoder):T} reader\n */\n constructor (uint8Array, reader) {\n super(uint8Array)\n /**\n * The reader\n */\n this.reader = reader\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = this.reader(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {T} */ (this.s)\n }\n}\n\nexport class IntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @return {number}\n */\n read () {\n this.s += readVarInt(this)\n return this.s\n }\n}\n\nexport class RleIntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n this.s += readVarInt(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class UintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class IncUintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s++)\n }\n}\n\nexport class IntDiffOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n const diff = readVarInt(this)\n // if the first bit is set, we read more data\n const hasCount = diff & 1\n this.diff = math.floor(diff / 2) // shift >> 1\n this.count = 1\n if (hasCount) {\n this.count = readVarUint(this) + 2\n }\n }\n this.s += this.diff\n this.count--\n return this.s\n }\n}\n\nexport class StringDecoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n this.decoder = new UintOptRleDecoder(uint8Array)\n this.str = readVarString(this.decoder)\n /**\n * @type {number}\n */\n this.spos = 0\n }\n\n /**\n * @return {string}\n */\n read () {\n const end = this.spos + this.decoder.read()\n const res = this.str.slice(this.spos, end)\n this.spos = end\n return res\n }\n}\n", "/**\n * Utility module to work with time.\n *\n * @module time\n */\n\nimport * as metric from './metric.js'\nimport * as math from './math.js'\n\n/**\n * Return current time.\n *\n * @return {Date}\n */\nexport const getDate = () => new Date()\n\n/**\n * Return current unix time.\n *\n * @return {number}\n */\nexport const getUnixTime = Date.now\n\n/**\n * Transform time (in ms) to a human readable format. E.g. 1100 => 1.1s. 60s => 1min. .001 => 10\u03BCs.\n *\n * @param {number} d duration in milliseconds\n * @return {string} humanized approximation of time\n */\nexport const humanizeDuration = d => {\n if (d < 60000) {\n const p = metric.prefix(d, -1)\n return math.round(p.n * 100) / 100 + p.prefix + 's'\n }\n d = math.floor(d / 1000)\n const seconds = d % 60\n const minutes = math.floor(d / 60) % 60\n const hours = math.floor(d / 3600) % 24\n const days = math.floor(d / 86400)\n if (days > 0) {\n return days + 'd' + ((hours > 0 || minutes > 30) ? ' ' + (minutes > 30 ? hours + 1 : hours) + 'h' : '')\n }\n if (hours > 0) {\n /* c8 ignore next */\n return hours + 'h' + ((minutes > 0 || seconds > 30) ? ' ' + (seconds > 30 ? minutes + 1 : minutes) + 'min' : '')\n }\n return minutes + 'min' + (seconds > 0 ? ' ' + seconds + 's' : '')\n}\n", "/**\n * Utility module to work with key-value stores.\n *\n * @module map\n */\n\n/**\n * Creates a new Map instance.\n *\n * @function\n * @return {Map}\n *\n * @function\n */\nexport const create = () => new Map()\n\n/**\n * Copy a Map object into a fresh Map object.\n *\n * @function\n * @template K,V\n * @param {Map} m\n * @return {Map}\n */\nexport const copy = m => {\n const r = create()\n m.forEach((v, k) => { r.set(k, v) })\n return r\n}\n\n/**\n * Get map property. Create T if property is undefined and set T on map.\n *\n * ```js\n * const listeners = map.setIfUndefined(events, 'eventName', set.create)\n * listeners.add(listener)\n * ```\n *\n * @function\n * @template {Map} MAP\n * @template {MAP extends Map ? function():V : unknown} CF\n * @param {MAP} map\n * @param {MAP extends Map ? K : unknown} key\n * @param {CF} createT\n * @return {ReturnType}\n */\nexport const setIfUndefined = (map, key, createT) => {\n let set = map.get(key)\n if (set === undefined) {\n map.set(key, set = createT())\n }\n return set\n}\n\n/**\n * Creates an Array and populates it with the content of all key-value pairs using the `f(value, key)` function.\n *\n * @function\n * @template K\n * @template V\n * @template R\n * @param {Map} m\n * @param {function(V,K):R} f\n * @return {Array}\n */\nexport const map = (m, f) => {\n const res = []\n for (const [key, value] of m) {\n res.push(f(value, key))\n }\n return res\n}\n\n/**\n * Tests whether any key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @todo should rename to some - similarly to Array.some\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const any = (m, f) => {\n for (const [key, value] of m) {\n if (f(value, key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * Tests whether all key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const all = (m, f) => {\n for (const [key, value] of m) {\n if (!f(value, key)) {\n return false\n }\n }\n return true\n}\n", "/**\n * Observable class prototype.\n *\n * @module observable\n */\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as array from './array.js'\n\n/**\n * Handles named events.\n * @experimental\n *\n * This is basically a (better typed) duplicate of Observable, which will replace Observable in the\n * next release.\n *\n * @template {{[key in keyof EVENTS]: function(...any):void}} EVENTS\n */\nexport class ObservableV2 {\n constructor () {\n /**\n * Some desc.\n * @type {Map>}\n */\n this._observers = map.create()\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, /** @type {string} */ (name), set.create).add(f)\n return f\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, /** @type {any} */ (_f))\n f(...args)\n }\n this.on(name, /** @type {any} */ (_f))\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name The event name.\n * @param {Parameters} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n\n/* c8 ignore start */\n/**\n * Handles named events.\n *\n * @deprecated\n * @template N\n */\nexport class Observable {\n constructor () {\n /**\n * Some desc.\n * @type {Map}\n */\n this._observers = map.create()\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, name, set.create).add(f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, _f)\n f(...args)\n }\n this.on(name, _f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @param {N} name The event name.\n * @param {Array} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n/* c8 ignore end */\n", "/**\n * Utility functions for working with EcmaScript objects.\n *\n * @module object\n */\n\n/**\n * @return {Object} obj\n */\nexport const create = () => Object.create(null)\n\n/**\n * Object.assign\n */\nexport const assign = Object.assign\n\n/**\n * @param {Object} obj\n */\nexport const keys = Object.keys\n\n/**\n * @template V\n * @param {{[k:string]:V}} obj\n * @param {function(V,string):any} f\n */\nexport const forEach = (obj, f) => {\n for (const key in obj) {\n f(obj[key], key)\n }\n}\n\n/**\n * @todo implement mapToArray & map\n *\n * @template R\n * @param {Object} obj\n * @param {function(any,string):R} f\n * @return {Array}\n */\nexport const map = (obj, f) => {\n const results = []\n for (const key in obj) {\n results.push(f(obj[key], key))\n }\n return results\n}\n\n/**\n * @deprecated use object.size instead\n * @param {Object} obj\n * @return {number}\n */\nexport const length = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @return {number}\n */\nexport const size = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const some = (obj, f) => {\n for (const key in obj) {\n if (f(obj[key], key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @param {Object|undefined} obj\n */\nexport const isEmpty = obj => {\n // eslint-disable-next-line\n for (const _k in obj) {\n return false\n }\n return true\n}\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const every = (obj, f) => {\n for (const key in obj) {\n if (!f(obj[key], key)) {\n return false\n }\n }\n return true\n}\n\n/**\n * Calls `Object.prototype.hasOwnProperty`.\n *\n * @param {any} obj\n * @param {string|symbol} key\n * @return {boolean}\n */\nexport const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key)\n\n/**\n * @param {Object} a\n * @param {Object} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a === b || (size(a) === size(b) && every(a, (val, key) => (val !== undefined || hasProperty(b, key)) && b[key] === val))\n\n/**\n * Make an object immutable. This hurts performance and is usually not needed if you perform good\n * coding practices.\n */\nexport const freeze = Object.freeze\n\n/**\n * Make an object and all its children immutable.\n * This *really* hurts performance and is usually not needed if you perform good coding practices.\n *\n * @template {any} T\n * @param {T} o\n * @return {Readonly}\n */\nexport const deepFreeze = (o) => {\n for (const key in o) {\n const c = o[key]\n if (typeof c === 'object' || typeof c === 'function') {\n deepFreeze(o[key])\n }\n }\n return freeze(o)\n}\n", "/**\n * Common functions and function call helpers.\n *\n * @module function\n */\n\nimport * as array from './array.js'\nimport * as object from './object.js'\n\n/**\n * Calls all functions in `fs` with args. Only throws after all functions were called.\n *\n * @param {Array} fs\n * @param {Array} args\n */\nexport const callAll = (fs, args, i = 0) => {\n try {\n for (; i < fs.length; i++) {\n fs[i](...args)\n }\n } finally {\n if (i < fs.length) {\n callAll(fs, args, i + 1)\n }\n }\n}\n\nexport const nop = () => {}\n\n/**\n * @template T\n * @param {function():T} f\n * @return {T}\n */\nexport const apply = f => f()\n\n/**\n * @template A\n *\n * @param {A} a\n * @return {A}\n */\nexport const id = a => a\n\n/**\n * @template T\n *\n * @param {T} a\n * @param {T} b\n * @return {boolean}\n */\nexport const equalityStrict = (a, b) => a === b\n\n/**\n * @template T\n *\n * @param {Array|object} a\n * @param {Array|object} b\n * @return {boolean}\n */\nexport const equalityFlat = (a, b) => a === b || (a != null && b != null && a.constructor === b.constructor && ((array.isArray(a) && array.equalFlat(a, /** @type {Array} */ (b))) || (typeof a === 'object' && object.equalFlat(a, b))))\n\n/* c8 ignore start */\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nexport const equalityDeep = (a, b) => {\n if (a == null || b == null) {\n return equalityStrict(a, b)\n }\n if (a.constructor !== b.constructor) {\n return false\n }\n if (a === b) {\n return true\n }\n switch (a.constructor) {\n case ArrayBuffer:\n a = new Uint8Array(a)\n b = new Uint8Array(b)\n // eslint-disable-next-line no-fallthrough\n case Uint8Array: {\n if (a.byteLength !== b.byteLength) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n break\n }\n case Set: {\n if (a.size !== b.size) {\n return false\n }\n for (const value of a) {\n if (!b.has(value)) {\n return false\n }\n }\n break\n }\n case Map: {\n if (a.size !== b.size) {\n return false\n }\n for (const key of a.keys()) {\n if (!b.has(key) || !equalityDeep(a.get(key), b.get(key))) {\n return false\n }\n }\n break\n }\n case Object:\n if (object.length(a) !== object.length(b)) {\n return false\n }\n for (const key in a) {\n if (!object.hasProperty(a, key) || !equalityDeep(a[key], b[key])) {\n return false\n }\n }\n break\n case Array:\n if (a.length !== b.length) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (!equalityDeep(a[i], b[i])) {\n return false\n }\n }\n break\n default:\n return false\n }\n return true\n}\n\n/**\n * @template V\n * @template {V} OPTS\n *\n * @param {V} value\n * @param {Array} options\n */\n// @ts-ignore\nexport const isOneOf = (value, options) => options.includes(value)\n/* c8 ignore stop */\n\nexport const isArray = array.isArray\n\n/**\n * @param {any} s\n * @return {s is String}\n */\nexport const isString = (s) => s && s.constructor === String\n\n/**\n * @param {any} n\n * @return {n is Number}\n */\nexport const isNumber = n => n != null && n.constructor === Number\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {any} n\n * @param {TYPE} T\n * @return {n is InstanceType}\n */\nexport const is = (n, T) => n && n.constructor === T\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {TYPE} T\n */\nexport const isTemplate = (T) =>\n /**\n * @param {any} n\n * @return {n is InstanceType}\n **/\n n => n && n.constructor === T\n", "/* eslint-env browser */\n\nexport const subtle = crypto.subtle\nexport const getRandomValues = crypto.getRandomValues.bind(crypto)\n", "/**\n * Isomorphic module for true random numbers / buffers / uuids.\n *\n * Attention: falls back to Math.random if the browser does not support crypto.\n *\n * @module random\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\nimport { getRandomValues } from 'lib0/webcrypto'\n\nexport const rand = Math.random\n\nexport const uint32 = () => getRandomValues(new Uint32Array(1))[0]\n\nexport const uint53 = () => {\n const arr = getRandomValues(new Uint32Array(8))\n return (arr[0] & binary.BITS21) * (binary.BITS32 + 1) + (arr[1] >>> 0)\n}\n\n/**\n * @template T\n * @param {Array} arr\n * @return {T}\n */\nexport const oneOf = arr => arr[math.floor(rand() * arr.length)]\n\n// @ts-ignore\nconst uuidv4Template = [1e7] + -1e3 + -4e3 + -8e3 + -1e11\n\n/**\n * @return {string}\n */\nexport const uuidv4 = () => uuidv4Template.replace(/[018]/g, /** @param {number} c */ c =>\n (c ^ uint32() & 15 >> c / 4).toString(16)\n)\n", "/**\n * Utility helpers to work with promises.\n *\n * @module promise\n */\n\nimport * as time from './time.js'\n\n/**\n * @template T\n * @callback PromiseResolve\n * @param {T|PromiseLike} [result]\n */\n\n/**\n * @template T\n * @param {function(PromiseResolve,function(Error):void):any} f\n * @return {Promise}\n */\nexport const create = f => /** @type {Promise} */ (new Promise(f))\n\n/**\n * @param {function(function():void,function(Error):void):void} f\n * @return {Promise}\n */\nexport const createEmpty = f => new Promise(f)\n\n/**\n * `Promise.all` wait for all promises in the array to resolve and return the result\n * @template {unknown[] | []} PS\n *\n * @param {PS} ps\n * @return {Promise<{ -readonly [P in keyof PS]: Awaited }>}\n */\nexport const all = Promise.all.bind(Promise)\n\n/**\n * @param {Error} [reason]\n * @return {Promise}\n */\nexport const reject = reason => Promise.reject(reason)\n\n/**\n * @template T\n * @param {T|void} res\n * @return {Promise}\n */\nexport const resolve = res => Promise.resolve(res)\n\n/**\n * @template T\n * @param {T} res\n * @return {Promise}\n */\nexport const resolveWith = res => Promise.resolve(res)\n\n/**\n * @todo Next version, reorder parameters: check, [timeout, [intervalResolution]]\n * @deprecated use untilAsync instead\n *\n * @param {number} timeout\n * @param {function():boolean} check\n * @param {number} [intervalResolution]\n * @return {Promise}\n */\nexport const until = (timeout, check, intervalResolution = 10) => create((resolve, reject) => {\n const startTime = time.getUnixTime()\n const hasTimeout = timeout > 0\n const untilInterval = () => {\n if (check()) {\n clearInterval(intervalHandle)\n resolve()\n } else if (hasTimeout) {\n /* c8 ignore else */\n if (time.getUnixTime() - startTime > timeout) {\n clearInterval(intervalHandle)\n reject(new Error('Timeout'))\n }\n }\n }\n const intervalHandle = setInterval(untilInterval, intervalResolution)\n})\n\n/**\n * @param {()=>Promise|boolean} check\n * @param {number} timeout\n * @param {number} intervalResolution\n * @return {Promise}\n */\nexport const untilAsync = async (check, timeout = 0, intervalResolution = 10) => {\n const startTime = time.getUnixTime()\n const noTimeout = timeout <= 0\n // eslint-disable-next-line no-unmodified-loop-condition\n while (noTimeout || time.getUnixTime() - startTime <= timeout) {\n if (await check()) return\n await wait(intervalResolution)\n }\n throw new Error('Timeout')\n}\n\n/**\n * @param {number} timeout\n * @return {Promise}\n */\nexport const wait = timeout => create((resolve, _reject) => setTimeout(resolve, timeout))\n\n/**\n * Checks if an object is a promise using ducktyping.\n *\n * Promises are often polyfilled, so it makes sense to add some additional guarantees if the user of this\n * library has some insane environment where global Promise objects are overwritten.\n *\n * @param {any} p\n * @return {boolean}\n */\nexport const isPromise = p => p instanceof Promise || (p && p.then && p.catch && p.finally)\n", "/**\n * Often used conditions.\n *\n * @module conditions\n */\n\n/**\n * @template T\n * @param {T|null|undefined} v\n * @return {T|null}\n */\n/* c8 ignore next */\nexport const undefinedToNull = v => v === undefined ? null : v\n", "/* eslint-env browser */\n\n/**\n * Isomorphic variable storage.\n *\n * Uses LocalStorage in the browser and falls back to in-memory storage.\n *\n * @module storage\n */\n\n/* c8 ignore start */\nclass VarStoragePolyfill {\n constructor () {\n this.map = new Map()\n }\n\n /**\n * @param {string} key\n * @param {any} newValue\n */\n setItem (key, newValue) {\n this.map.set(key, newValue)\n }\n\n /**\n * @param {string} key\n */\n getItem (key) {\n return this.map.get(key)\n }\n}\n/* c8 ignore stop */\n\n/**\n * @type {any}\n */\nlet _localStorage = new VarStoragePolyfill()\nlet usePolyfill = true\n\n/* c8 ignore start */\ntry {\n // if the same-origin rule is violated, accessing localStorage might thrown an error\n if (typeof localStorage !== 'undefined' && localStorage) {\n _localStorage = localStorage\n usePolyfill = false\n }\n} catch (e) { }\n/* c8 ignore stop */\n\n/**\n * This is basically localStorage in browser, or a polyfill in nodejs\n */\n/* c8 ignore next */\nexport const varStorage = _localStorage\n\n/**\n * A polyfill for `addEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const onChange = eventHandler => usePolyfill || addEventListener('storage', /** @type {any} */ (eventHandler))\n\n/**\n * A polyfill for `removeEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const offChange = eventHandler => usePolyfill || removeEventListener('storage', /** @type {any} */ (eventHandler))\n", "/**\n * Isomorphic module to work access the environment (query params, env variables).\n *\n * @module environment\n */\n\nimport * as map from './map.js'\nimport * as string from './string.js'\nimport * as conditions from './conditions.js'\nimport * as storage from './storage.js'\nimport * as f from './function.js'\n\n/* c8 ignore next 2 */\n// @ts-ignore\nexport const isNode = typeof process !== 'undefined' && process.release && /node|io\\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n\n/* c8 ignore next */\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && !isNode\n/* c8 ignore next 3 */\nexport const isMac = typeof navigator !== 'undefined'\n ? /Mac/.test(navigator.platform)\n : false\n\n/**\n * @type {Map}\n */\nlet params\nconst args = []\n\n/* c8 ignore start */\nconst computeParams = () => {\n if (params === undefined) {\n if (isNode) {\n params = map.create()\n const pargs = process.argv\n let currParamName = null\n for (let i = 0; i < pargs.length; i++) {\n const parg = pargs[i]\n if (parg[0] === '-') {\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n currParamName = parg\n } else {\n if (currParamName !== null) {\n params.set(currParamName, parg)\n currParamName = null\n } else {\n args.push(parg)\n }\n }\n }\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n // in ReactNative for example this would not be true (unless connected to the Remote Debugger)\n } else if (typeof location === 'object') {\n params = map.create(); // eslint-disable-next-line no-undef\n (location.search || '?').slice(1).split('&').forEach((kv) => {\n if (kv.length !== 0) {\n const [key, value] = kv.split('=')\n params.set(`--${string.fromCamelCase(key, '-')}`, value)\n params.set(`-${string.fromCamelCase(key, '-')}`, value)\n }\n })\n } else {\n params = map.create()\n }\n }\n return params\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next */\nexport const hasParam = (name) => computeParams().has(name)\n\n/**\n * @param {string} name\n * @param {string} defaultVal\n * @return {string}\n */\n/* c8 ignore next 2 */\nexport const getParam = (name, defaultVal) =>\n computeParams().get(name) || defaultVal\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 4 */\nexport const getVariable = (name) =>\n isNode\n ? conditions.undefinedToNull(process.env[name.toUpperCase().replaceAll('-', '_')])\n : conditions.undefinedToNull(storage.varStorage.getItem(name))\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 2 */\nexport const getConf = (name) =>\n computeParams().get('--' + name) || getVariable(name)\n\n/**\n * @param {string} name\n * @return {string}\n */\n/* c8 ignore next 5 */\nexport const ensureConf = (name) => {\n const c = getConf(name)\n if (c == null) throw new Error(`Expected configuration \"${name.toUpperCase().replaceAll('-', '_')}\"`)\n return c\n}\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next 2 */\nexport const hasConf = (name) =>\n hasParam('--' + name) || getVariable(name) !== null\n\n/* c8 ignore next */\nexport const production = hasConf('production')\n\n/* c8 ignore next 2 */\nconst forceColor = isNode &&\n f.isOneOf(process.env.FORCE_COLOR, ['true', '1', '2'])\n\n/* c8 ignore start */\n/**\n * Color is enabled by default if the terminal supports it.\n *\n * Explicitly enable color using `--color` parameter\n * Disable color using `--no-color` parameter or using `NO_COLOR=1` environment variable.\n * `FORCE_COLOR=1` enables color and takes precedence over all.\n */\nexport const supportsColor = forceColor || (\n !hasParam('--no-colors') && // @todo deprecate --no-colors\n !hasConf('no-color') &&\n (!isNode || process.stdout.isTTY) && (\n !isNode ||\n hasParam('--color') ||\n getVariable('COLORTERM') !== null ||\n (getVariable('TERM') || '').includes('color')\n )\n)\n/* c8 ignore stop */\n", "/**\n * Utility functions to work with buffers (Uint8Array).\n *\n * @module buffer\n */\n\nimport * as string from './string.js'\nimport * as env from './environment.js'\nimport * as array from './array.js'\nimport * as math from './math.js'\nimport * as encoding from './encoding.js'\nimport * as decoding from './decoding.js'\n\n/**\n * @param {number} len\n */\nexport const createUint8ArrayFromLen = len => new Uint8Array(len)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n * @param {number} byteOffset\n * @param {number} length\n */\nexport const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n */\nexport const createUint8ArrayFromArrayBuffer = buffer => new Uint8Array(buffer)\n\n/* c8 ignore start */\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Browser = bytes => {\n let s = ''\n for (let i = 0; i < bytes.byteLength; i++) {\n s += string.fromCharCode(bytes[i])\n }\n // eslint-disable-next-line no-undef\n return btoa(s)\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Node = bytes => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('base64')\n\n/* c8 ignore start */\n/**\n * @param {string} s\n * @return {Uint8Array}\n */\nconst fromBase64Browser = s => {\n // eslint-disable-next-line no-undef\n const a = atob(s)\n const bytes = createUint8ArrayFromLen(a.length)\n for (let i = 0; i < a.length; i++) {\n bytes[i] = a.charCodeAt(i)\n }\n return bytes\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} s\n */\nconst fromBase64Node = s => {\n const buf = Buffer.from(s, 'base64')\n return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength)\n}\n\n/* c8 ignore next */\nexport const toBase64 = env.isBrowser ? toBase64Browser : toBase64Node\n\n/* c8 ignore next */\nexport const fromBase64 = env.isBrowser ? fromBase64Browser : fromBase64Node\n\n/**\n * Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5\n * @param {Uint8Array} buf\n */\nexport const toBase64UrlEncoded = buf => toBase64(buf).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')\n\n/**\n * @param {string} base64\n */\nexport const fromBase64UrlEncoded = base64 => fromBase64(base64.replaceAll('-', '+').replaceAll('_', '/'))\n\n/**\n * Base64 is always a more efficient choice. This exists for utility purposes only.\n *\n * @param {Uint8Array} buf\n */\nexport const toHexString = buf => array.map(buf, b => b.toString(16).padStart(2, '0')).join('')\n\n/**\n * Note: This function expects that the hex doesn't start with 0x..\n *\n * @param {string} hex\n */\nexport const fromHexString = hex => {\n const hlen = hex.length\n const buf = new Uint8Array(math.ceil(hlen / 2))\n for (let i = 0; i < hlen; i += 2) {\n buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16)\n }\n return buf\n}\n\n/**\n * Copy the content of an Uint8Array view to a new ArrayBuffer.\n *\n * @param {Uint8Array} uint8Array\n * @return {Uint8Array}\n */\nexport const copyUint8Array = uint8Array => {\n const newBuf = createUint8ArrayFromLen(uint8Array.byteLength)\n newBuf.set(uint8Array)\n return newBuf\n}\n\n/**\n * Encode anything as a UInt8Array. It's a pun on typescripts's `any` type.\n * See encoding.writeAny for more information.\n *\n * @param {any} data\n * @return {Uint8Array}\n */\nexport const encodeAny = data =>\n encoding.encode(encoder => encoding.writeAny(encoder, data))\n\n/**\n * Decode an any-encoded value.\n *\n * @param {Uint8Array} buf\n * @return {any}\n */\nexport const decodeAny = buf => decoding.readAny(decoding.createDecoder(buf))\n\n/**\n * Shift Byte Array {N} bits to the left. Does not expand byte array.\n *\n * @param {Uint8Array} bs\n * @param {number} N should be in the range of [0-7]\n */\nexport const shiftNBitsLeft = (bs, N) => {\n if (N === 0) return bs\n bs = new Uint8Array(bs)\n bs[0] <<= N\n for (let i = 1; i < bs.length; i++) {\n bs[i - 1] |= bs[i] >>> (8 - N)\n bs[i] <<= N\n }\n return bs\n}\n", "/**\n * Working with value pairs.\n *\n * @module pair\n */\n\n/**\n * @template L,R\n */\nexport class Pair {\n /**\n * @param {L} left\n * @param {R} right\n */\n constructor (left, right) {\n this.left = left\n this.right = right\n }\n}\n\n/**\n * @template L,R\n * @param {L} left\n * @param {R} right\n * @return {Pair}\n */\nexport const create = (left, right) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {R} right\n * @param {L} left\n * @return {Pair}\n */\nexport const createReversed = (right, left) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {Array>} arr\n * @param {function(L, R):any} f\n */\nexport const forEach = (arr, f) => arr.forEach(p => f(p.left, p.right))\n\n/**\n * @template L,R,X\n * @param {Array>} arr\n * @param {function(L, R):X} f\n * @return {Array}\n */\nexport const map = (arr, f) => arr.map(p => f(p.left, p.right))\n", "/* eslint-env browser */\n\n/**\n * Utility module to work with the DOM.\n *\n * @module dom\n */\n\nimport * as pair from './pair.js'\nimport * as map from './map.js'\n\n/* c8 ignore start */\n/**\n * @type {Document}\n */\nexport const doc = /** @type {Document} */ (typeof document !== 'undefined' ? document : {})\n\n/**\n * @param {string} name\n * @return {HTMLElement}\n */\nexport const createElement = name => doc.createElement(name)\n\n/**\n * @return {DocumentFragment}\n */\nexport const createDocumentFragment = () => doc.createDocumentFragment()\n\n/**\n * @param {string} text\n * @return {Text}\n */\nexport const createTextNode = text => doc.createTextNode(text)\n\nexport const domParser = /** @type {DOMParser} */ (typeof DOMParser !== 'undefined' ? new DOMParser() : null)\n\n/**\n * @param {HTMLElement} el\n * @param {string} name\n * @param {Object} opts\n */\nexport const emitCustomEvent = (el, name, opts) => el.dispatchEvent(new CustomEvent(name, opts))\n\n/**\n * @param {Element} el\n * @param {Array>} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributes = (el, attrs) => {\n pair.forEach(attrs, (key, value) => {\n if (value === false) {\n el.removeAttribute(key)\n } else if (value === true) {\n el.setAttribute(key, '')\n } else {\n // @ts-ignore\n el.setAttribute(key, value)\n }\n })\n return el\n}\n\n/**\n * @param {Element} el\n * @param {Map} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributesMap = (el, attrs) => {\n attrs.forEach((value, key) => { el.setAttribute(key, value) })\n return el\n}\n\n/**\n * @param {Array|HTMLCollection} children\n * @return {DocumentFragment}\n */\nexport const fragment = children => {\n const fragment = createDocumentFragment()\n for (let i = 0; i < children.length; i++) {\n appendChild(fragment, children[i])\n }\n return fragment\n}\n\n/**\n * @param {Element} parent\n * @param {Array} nodes\n * @return {Element}\n */\nexport const append = (parent, nodes) => {\n appendChild(parent, fragment(nodes))\n return parent\n}\n\n/**\n * @param {HTMLElement} el\n */\nexport const remove = el => el.remove()\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const addEventListener = (el, name, f) => el.addEventListener(name, f)\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const removeEventListener = (el, name, f) => el.removeEventListener(name, f)\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const addEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => addEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const removeEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => removeEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {string} name\n * @param {Array|pair.Pair>} attrs Array of key-value pairs\n * @param {Array} children\n * @return {Element}\n */\nexport const element = (name, attrs = [], children = []) =>\n append(setAttributes(createElement(name), attrs), children)\n\n/**\n * @param {number} width\n * @param {number} height\n */\nexport const canvas = (width, height) => {\n const c = /** @type {HTMLCanvasElement} */ (createElement('canvas'))\n c.height = height\n c.width = width\n return c\n}\n\n/**\n * @param {string} t\n * @return {Text}\n */\nexport const text = createTextNode\n\n/**\n * @param {pair.Pair} pair\n */\nexport const pairToStyleString = pair => `${pair.left}:${pair.right};`\n\n/**\n * @param {Array>} pairs\n * @return {string}\n */\nexport const pairsToStyleString = pairs => pairs.map(pairToStyleString).join('')\n\n/**\n * @param {Map} m\n * @return {string}\n */\nexport const mapToStyleString = m => map.map(m, (value, key) => `${key}:${value};`).join('')\n\n/**\n * @todo should always query on a dom element\n *\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {HTMLElement | null}\n */\nexport const querySelector = (el, query) => el.querySelector(query)\n\n/**\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {NodeListOf}\n */\nexport const querySelectorAll = (el, query) => el.querySelectorAll(query)\n\n/**\n * @param {string} id\n * @return {HTMLElement}\n */\nexport const getElementById = id => /** @type {HTMLElement} */ (doc.getElementById(id))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nconst _parse = html => domParser.parseFromString(`${html}`, 'text/html').body\n\n/**\n * @param {string} html\n * @return {DocumentFragment}\n */\nexport const parseFragment = html => fragment(/** @type {any} */ (_parse(html).childNodes))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nexport const parseElement = html => /** @type HTMLElement */ (_parse(html).firstElementChild)\n\n/**\n * @param {HTMLElement} oldEl\n * @param {HTMLElement|DocumentFragment} newEl\n */\nexport const replaceWith = (oldEl, newEl) => oldEl.replaceWith(newEl)\n\n/**\n * @param {HTMLElement} parent\n * @param {HTMLElement} el\n * @param {Node|null} ref\n * @return {HTMLElement}\n */\nexport const insertBefore = (parent, el, ref) => parent.insertBefore(el, ref)\n\n/**\n * @param {Node} parent\n * @param {Node} child\n * @return {Node}\n */\nexport const appendChild = (parent, child) => parent.appendChild(child)\n\nexport const ELEMENT_NODE = doc.ELEMENT_NODE\nexport const TEXT_NODE = doc.TEXT_NODE\nexport const CDATA_SECTION_NODE = doc.CDATA_SECTION_NODE\nexport const COMMENT_NODE = doc.COMMENT_NODE\nexport const DOCUMENT_NODE = doc.DOCUMENT_NODE\nexport const DOCUMENT_TYPE_NODE = doc.DOCUMENT_TYPE_NODE\nexport const DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE\n\n/**\n * @param {any} node\n * @param {number} type\n */\nexport const checkNodeType = (node, type) => node.nodeType === type\n\n/**\n * @param {Node} parent\n * @param {HTMLElement} child\n */\nexport const isParentOf = (parent, child) => {\n let p = child.parentNode\n while (p && p !== parent) {\n p = p.parentNode\n }\n return p === parent\n}\n/* c8 ignore stop */\n", "/**\n * JSON utility functions.\n *\n * @module json\n */\n\n/**\n * Transform JavaScript object to JSON.\n *\n * @param {any} object\n * @return {string}\n */\nexport const stringify = JSON.stringify\n\n/**\n * Parse JSON object.\n *\n * @param {string} json\n * @return {any}\n */\nexport const parse = JSON.parse\n", "/**\n * Utility module to work with EcmaScript Symbols.\n *\n * @module symbol\n */\n\n/**\n * Return fresh symbol.\n *\n * @return {Symbol}\n */\nexport const create = Symbol\n\n/**\n * @param {any} s\n * @return {boolean}\n */\nexport const isSymbol = s => typeof s === 'symbol'\n", "import * as symbol from './symbol.js'\nimport * as time from './time.js'\nimport * as env from './environment.js'\nimport * as func from './function.js'\nimport * as json from './json.js'\n\nexport const BOLD = symbol.create()\nexport const UNBOLD = symbol.create()\nexport const BLUE = symbol.create()\nexport const GREY = symbol.create()\nexport const GREEN = symbol.create()\nexport const RED = symbol.create()\nexport const PURPLE = symbol.create()\nexport const ORANGE = symbol.create()\nexport const UNCOLOR = symbol.create()\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n * @return {Array}\n */\nexport const computeNoColorLoggingArgs = args => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n if (arg === undefined) {\n break\n } else if (arg.constructor === String || arg.constructor === Number) {\n strBuilder.push(arg)\n } else if (arg.constructor === Object) {\n break\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs.push(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\nconst loggingColors = [GREEN, PURPLE, ORANGE, BLUE]\nlet nextColor = 0\nlet lastLoggingTime = time.getUnixTime()\n\n/* c8 ignore start */\n/**\n * @param {function(...any):void} _print\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (_print, moduleName) => {\n const color = loggingColors[nextColor]\n const debugRegexVar = env.getVariable('log')\n const doLogging = debugRegexVar !== null &&\n (debugRegexVar === '*' || debugRegexVar === 'true' ||\n new RegExp(debugRegexVar, 'gi').test(moduleName))\n nextColor = (nextColor + 1) % loggingColors.length\n moduleName += ': '\n return !doLogging\n ? func.nop\n : (...args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = args[0]()\n }\n const timeNow = time.getUnixTime()\n const timeDiff = timeNow - lastLoggingTime\n lastLoggingTime = timeNow\n _print(\n color,\n moduleName,\n UNCOLOR,\n ...args.map((arg) => {\n if (arg != null && arg.constructor === Uint8Array) {\n arg = Array.from(arg)\n }\n const t = typeof arg\n switch (t) {\n case 'string':\n case 'symbol':\n return arg\n default: {\n return json.stringify(arg)\n }\n }\n }),\n color,\n ' +' + timeDiff + 'ms'\n )\n }\n}\n/* c8 ignore stop */\n", "/**\n * Isomorphic logging module with support for colors!\n *\n * @module logging\n */\n\nimport * as env from './environment.js'\nimport * as set from './set.js'\nimport * as pair from './pair.js'\nimport * as dom from './dom.js'\nimport * as json from './json.js'\nimport * as map from './map.js'\nimport * as eventloop from './eventloop.js'\nimport * as math from './math.js'\nimport * as common from './logging.common.js'\n\nexport { BOLD, UNBOLD, BLUE, GREY, GREEN, RED, PURPLE, ORANGE, UNCOLOR } from './logging.common.js'\n\n/**\n * @type {Object>}\n */\nconst _browserStyleMap = {\n [common.BOLD]: pair.create('font-weight', 'bold'),\n [common.UNBOLD]: pair.create('font-weight', 'normal'),\n [common.BLUE]: pair.create('color', 'blue'),\n [common.GREEN]: pair.create('color', 'green'),\n [common.GREY]: pair.create('color', 'grey'),\n [common.RED]: pair.create('color', 'red'),\n [common.PURPLE]: pair.create('color', 'purple'),\n [common.ORANGE]: pair.create('color', 'orange'), // not well supported in chrome when debugging node with inspector - TODO: deprecate\n [common.UNCOLOR]: pair.create('color', 'black')\n}\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst computeBrowserLoggingArgs = (args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const styles = []\n const currentStyle = map.create()\n /**\n * @type {Array}\n */\n let logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n break\n }\n if (arg.constructor === String || arg.constructor === Number) {\n const style = dom.mapToStyleString(currentStyle)\n if (i > 0 || style.length > 0) {\n strBuilder.push('%c' + arg)\n styles.push(style)\n } else {\n strBuilder.push(arg)\n }\n } else {\n break\n }\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs = styles\n logArgs.unshift(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst computeLoggingArgs = env.supportsColor\n ? computeBrowserLoggingArgs\n : common.computeNoColorLoggingArgs\n/* c8 ignore stop */\n\n/**\n * @param {Array} args\n */\nexport const print = (...args) => {\n console.log(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.print(args))\n}\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n */\nexport const warn = (...args) => {\n console.warn(...computeLoggingArgs(args))\n args.unshift(common.ORANGE)\n vconsoles.forEach((vc) => vc.print(args))\n}\n/* c8 ignore stop */\n\n/**\n * @param {Error} err\n */\n/* c8 ignore start */\nexport const printError = (err) => {\n console.error(err)\n vconsoles.forEach((vc) => vc.printError(err))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} url image location\n * @param {number} height height of the image in pixel\n */\n/* c8 ignore start */\nexport const printImg = (url, height) => {\n if (env.isBrowser) {\n console.log(\n '%c ',\n `font-size: ${height}px; background-size: contain; background-repeat: no-repeat; background-image: url(${url})`\n )\n // console.log('%c ', `font-size: ${height}x; background: url(${url}) no-repeat;`)\n }\n vconsoles.forEach((vc) => vc.printImg(url, height))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} base64\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printImgBase64 = (base64, height) =>\n printImg(`data:image/gif;base64,${base64}`, height)\n\n/**\n * @param {Array} args\n */\nexport const group = (...args) => {\n console.group(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.group(args))\n}\n\n/**\n * @param {Array} args\n */\nexport const groupCollapsed = (...args) => {\n console.groupCollapsed(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupCollapsed(args))\n}\n\nexport const groupEnd = () => {\n console.groupEnd()\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupEnd())\n}\n\n/**\n * @param {function():Node} createNode\n */\n/* c8 ignore next 2 */\nexport const printDom = (createNode) =>\n vconsoles.forEach((vc) => vc.printDom(createNode()))\n\n/**\n * @param {HTMLCanvasElement} canvas\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printCanvas = (canvas, height) =>\n printImg(canvas.toDataURL(), height)\n\nexport const vconsoles = set.create()\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst _computeLineSpans = (args) => {\n const spans = []\n const currentStyle = new Map()\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n let arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n arg = 'undefined '\n }\n if (arg.constructor === String || arg.constructor === Number) {\n // @ts-ignore\n const span = dom.element('span', [\n pair.create('style', dom.mapToStyleString(currentStyle))\n ], [dom.text(arg.toString())])\n if (span.innerHTML === '') {\n span.innerHTML = ' '\n }\n spans.push(span)\n } else {\n break\n }\n }\n }\n // append the rest\n for (; i < args.length; i++) {\n let content = args[i]\n if (!(content instanceof Symbol)) {\n if (content.constructor !== String && content.constructor !== Number) {\n content = ' ' + json.stringify(content) + ' '\n }\n spans.push(\n dom.element('span', [], [dom.text(/** @type {string} */ (content))])\n )\n }\n }\n return spans\n}\n/* c8 ignore stop */\n\nconst lineStyle =\n 'font-family:monospace;border-bottom:1px solid #e2e2e2;padding:2px;'\n\n/* c8 ignore start */\nexport class VConsole {\n /**\n * @param {Element} dom\n */\n constructor (dom) {\n this.dom = dom\n /**\n * @type {Element}\n */\n this.ccontainer = this.dom\n this.depth = 0\n vconsoles.add(this)\n }\n\n /**\n * @param {Array} args\n * @param {boolean} collapsed\n */\n group (args, collapsed = false) {\n eventloop.enqueue(() => {\n const triangleDown = dom.element('span', [\n pair.create('hidden', collapsed),\n pair.create('style', 'color:grey;font-size:120%;')\n ], [dom.text('\u25BC')])\n const triangleRight = dom.element('span', [\n pair.create('hidden', !collapsed),\n pair.create('style', 'color:grey;font-size:125%;')\n ], [dom.text('\u25B6')])\n const content = dom.element(\n 'div',\n [pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )],\n [triangleDown, triangleRight, dom.text(' ')].concat(\n _computeLineSpans(args)\n )\n )\n const nextContainer = dom.element('div', [\n pair.create('hidden', collapsed)\n ])\n const nextLine = dom.element('div', [], [content, nextContainer])\n dom.append(this.ccontainer, [nextLine])\n this.ccontainer = nextContainer\n this.depth++\n // when header is clicked, collapse/uncollapse container\n dom.addEventListener(content, 'click', (_event) => {\n nextContainer.toggleAttribute('hidden')\n triangleDown.toggleAttribute('hidden')\n triangleRight.toggleAttribute('hidden')\n })\n })\n }\n\n /**\n * @param {Array} args\n */\n groupCollapsed (args) {\n this.group(args, true)\n }\n\n groupEnd () {\n eventloop.enqueue(() => {\n if (this.depth > 0) {\n this.depth--\n // @ts-ignore\n this.ccontainer = this.ccontainer.parentElement.parentElement\n }\n })\n }\n\n /**\n * @param {Array} args\n */\n print (args) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('div', [\n pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )\n ], _computeLineSpans(args))\n ])\n })\n }\n\n /**\n * @param {Error} err\n */\n printError (err) {\n this.print([common.RED, common.BOLD, err.toString()])\n }\n\n /**\n * @param {string} url\n * @param {number} height\n */\n printImg (url, height) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('img', [\n pair.create('src', url),\n pair.create('height', `${math.round(height * 1.5)}px`)\n ])\n ])\n })\n }\n\n /**\n * @param {Node} node\n */\n printDom (node) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [node])\n })\n }\n\n destroy () {\n eventloop.enqueue(() => {\n vconsoles.delete(this)\n })\n }\n}\n/* c8 ignore stop */\n\n/**\n * @param {Element} dom\n */\n/* c8 ignore next */\nexport const createVConsole = (dom) => new VConsole(dom)\n\n/**\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (moduleName) => common.createModuleLogger(print, moduleName)\n", "/**\n * Utility module to create and manipulate Iterators.\n *\n * @module iterator\n */\n\n/**\n * @template T,R\n * @param {Iterator} iterator\n * @param {function(T):R} f\n * @return {IterableIterator}\n */\nexport const mapIterator = (iterator, f) => ({\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next () {\n const r = iterator.next()\n return { value: r.done ? undefined : f(r.value), done: r.done }\n }\n})\n\n/**\n * @template T\n * @param {function():IteratorResult} next\n * @return {IterableIterator}\n */\nexport const createIterator = next => ({\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next\n})\n\n/**\n * @template T\n * @param {Iterator} iterator\n * @param {function(T):boolean} filter\n */\nexport const iteratorFilter = (iterator, filter) => createIterator(() => {\n let res\n do {\n res = iterator.next()\n } while (!res.done && !filter(res.value))\n return res\n})\n\n/**\n * @template T,M\n * @param {Iterator} iterator\n * @param {function(T):M} fmap\n */\nexport const iteratorMap = (iterator, fmap) => createIterator(() => {\n const { done, value } = iterator.next()\n return { done, value: done ? undefined : fmap(value) }\n})\n", "import { ObservableV2 } from 'lib0/observable'\n\nimport {\n Doc // eslint-disable-line\n} from '../internals.js'\n\n/**\n * This is an abstract interface that all Connectors should implement to keep them interchangeable.\n *\n * @note This interface is experimental and it is not advised to actually inherit this class.\n * It just serves as typing information.\n *\n * @extends {ObservableV2}\n */\nexport class AbstractConnector extends ObservableV2 {\n /**\n * @param {Doc} ydoc\n * @param {any} awareness\n */\n constructor (ydoc, awareness) {\n super()\n this.doc = ydoc\n this.awareness = awareness\n }\n}\n", "import {\n findIndexSS,\n getState,\n splitItem,\n iterateStructs,\n UpdateEncoderV2,\n DSDecoderV1, DSEncoderV1, DSDecoderV2, DSEncoderV2, Item, GC, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nimport * as array from 'lib0/array'\nimport * as math from 'lib0/math'\nimport * as map from 'lib0/map'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\n\nexport class DeleteItem {\n /**\n * @param {number} clock\n * @param {number} len\n */\n constructor (clock, len) {\n /**\n * @type {number}\n */\n this.clock = clock\n /**\n * @type {number}\n */\n this.len = len\n }\n}\n\n/**\n * We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed.\n * - When created in a transaction, it must only be accessed after sorting, and merging\n * - This DeleteSet is send to other clients\n * - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore\n * - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.\n */\nexport class DeleteSet {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n }\n}\n\n/**\n * Iterate over all structs that the DeleteSet gc's.\n *\n * @param {Transaction} transaction\n * @param {DeleteSet} ds\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateDeletedStructs = (transaction, ds, f) =>\n ds.clients.forEach((deletes, clientid) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(clientid))\n for (let i = 0; i < deletes.length; i++) {\n const del = deletes[i]\n iterateStructs(transaction, structs, del.clock, del.len, f)\n }\n })\n\n/**\n * @param {Array} dis\n * @param {number} clock\n * @return {number|null}\n *\n * @private\n * @function\n */\nexport const findIndexDS = (dis, clock) => {\n let left = 0\n let right = dis.length - 1\n while (left <= right) {\n const midindex = math.floor((left + right) / 2)\n const mid = dis[midindex]\n const midclock = mid.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.len) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {ID} id\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const isDeleted = (ds, id) => {\n const dis = ds.clients.get(id.client)\n return dis !== undefined && findIndexDS(dis, id.clock) !== null\n}\n\n/**\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const sortAndMergeDeleteSet = ds => {\n ds.clients.forEach(dels => {\n dels.sort((a, b) => a.clock - b.clock)\n // merge items without filtering or splicing the array\n // i is the current pointer\n // j refers to the current insert position for the pointed item\n // try to merge dels[i] into dels[j-1] or set dels[j]=dels[i]\n let i, j\n for (i = 1, j = 1; i < dels.length; i++) {\n const left = dels[j - 1]\n const right = dels[i]\n if (left.clock + left.len >= right.clock) {\n left.len = math.max(left.len, right.clock + right.len - left.clock)\n } else {\n if (j < i) {\n dels[j] = right\n }\n j++\n }\n }\n dels.length = j\n })\n}\n\n/**\n * @param {Array} dss\n * @return {DeleteSet} A fresh DeleteSet\n */\nexport const mergeDeleteSets = dss => {\n const merged = new DeleteSet()\n for (let dssI = 0; dssI < dss.length; dssI++) {\n dss[dssI].clients.forEach((delsLeft, client) => {\n if (!merged.clients.has(client)) {\n // Write all missing keys from current ds and all following.\n // If merged already contains `client` current ds has already been added.\n /**\n * @type {Array}\n */\n const dels = delsLeft.slice()\n for (let i = dssI + 1; i < dss.length; i++) {\n array.appendTo(dels, dss[i].clients.get(client) || [])\n }\n merged.clients.set(client, dels)\n }\n })\n }\n sortAndMergeDeleteSet(merged)\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {number} client\n * @param {number} clock\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const addToDeleteSet = (ds, client, clock, length) => {\n map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([])).push(new DeleteItem(clock, length))\n}\n\nexport const createDeleteSet = () => new DeleteSet()\n\n/**\n * @param {StructStore} ss\n * @return {DeleteSet} Merged and sorted DeleteSet\n *\n * @private\n * @function\n */\nexport const createDeleteSetFromStructStore = ss => {\n const ds = createDeleteSet()\n ss.clients.forEach((structs, client) => {\n /**\n * @type {Array}\n */\n const dsitems = []\n for (let i = 0; i < structs.length; i++) {\n const struct = structs[i]\n if (struct.deleted) {\n const clock = struct.id.clock\n let len = struct.length\n if (i + 1 < structs.length) {\n for (let next = structs[i + 1]; i + 1 < structs.length && next.deleted; next = structs[++i + 1]) {\n len += next.length\n }\n }\n dsitems.push(new DeleteItem(clock, len))\n }\n }\n if (dsitems.length > 0) {\n ds.clients.set(client, dsitems)\n }\n })\n return ds\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const writeDeleteSet = (encoder, ds) => {\n encoding.writeVarUint(encoder.restEncoder, ds.clients.size)\n\n // Ensure that the delete set is written in a deterministic order\n array.from(ds.clients.entries())\n .sort((a, b) => b[0] - a[0])\n .forEach(([client, dsitems]) => {\n encoder.resetDsCurVal()\n encoding.writeVarUint(encoder.restEncoder, client)\n const len = dsitems.length\n encoding.writeVarUint(encoder.restEncoder, len)\n for (let i = 0; i < len; i++) {\n const item = dsitems[i]\n encoder.writeDsClock(item.clock)\n encoder.writeDsLen(item.len)\n }\n })\n}\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {DeleteSet}\n *\n * @private\n * @function\n */\nexport const readDeleteSet = decoder => {\n const ds = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n if (numberOfDeletes > 0) {\n const dsField = map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([]))\n for (let i = 0; i < numberOfDeletes; i++) {\n dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()))\n }\n }\n }\n return ds\n}\n\n/**\n * @todo YDecoder also contains references to String and other Decoders. Would make sense to exchange YDecoder.toUint8Array for YDecoder.DsToUint8Array()..\n */\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {Uint8Array|null} Returns a v2 update containing all deletes that couldn't be applied yet; or null if all deletes were applied successfully.\n *\n * @private\n * @function\n */\nexport const readAndApplyDeleteSet = (decoder, transaction, store) => {\n const unappliedDS = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n const structs = store.clients.get(client) || []\n const state = getState(store, client)\n for (let i = 0; i < numberOfDeletes; i++) {\n const clock = decoder.readDsClock()\n const clockEnd = clock + decoder.readDsLen()\n if (clock < state) {\n if (state < clockEnd) {\n addToDeleteSet(unappliedDS, client, state, clockEnd - state)\n }\n let index = findIndexSS(structs, clock)\n /**\n * We can ignore the case of GC and Delete structs, because we are going to skip them\n * @type {Item}\n */\n // @ts-ignore\n let struct = structs[index]\n // split the first item if necessary\n if (!struct.deleted && struct.id.clock < clock) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n index++ // increase we now want to use the next struct\n }\n while (index < structs.length) {\n // @ts-ignore\n struct = structs[index++]\n if (struct.id.clock < clockEnd) {\n if (!struct.deleted) {\n if (clockEnd < struct.id.clock + struct.length) {\n structs.splice(index, 0, splitItem(transaction, struct, clockEnd - struct.id.clock))\n }\n struct.delete(transaction)\n }\n } else {\n break\n }\n }\n } else {\n addToDeleteSet(unappliedDS, client, clock, clockEnd - clock)\n }\n }\n }\n if (unappliedDS.clients.size > 0) {\n const ds = new UpdateEncoderV2()\n encoding.writeVarUint(ds.restEncoder, 0) // encode 0 structs\n writeDeleteSet(ds, unappliedDS)\n return ds.toUint8Array()\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds1\n * @param {DeleteSet} ds2\n */\nexport const equalDeleteSets = (ds1, ds2) => {\n if (ds1.clients.size !== ds2.clients.size) return false\n for (const [client, deleteItems1] of ds1.clients.entries()) {\n const deleteItems2 = /** @type {Array} */ (ds2.clients.get(client))\n if (deleteItems2 === undefined || deleteItems1.length !== deleteItems2.length) return false\n for (let i = 0; i < deleteItems1.length; i++) {\n const di1 = deleteItems1[i]\n const di2 = deleteItems2[i]\n if (di1.clock !== di2.clock || di1.len !== di2.len) {\n return false\n }\n }\n }\n return true\n}\n", "/**\n * @module Y\n */\n\nimport {\n StructStore,\n AbstractType,\n YArray,\n YText,\n YMap,\n YXmlElement,\n YXmlFragment,\n transact,\n ContentDoc, Item, Transaction, YEvent // eslint-disable-line\n} from '../internals.js'\n\nimport { ObservableV2 } from 'lib0/observable'\nimport * as random from 'lib0/random'\nimport * as map from 'lib0/map'\nimport * as array from 'lib0/array'\nimport * as promise from 'lib0/promise'\n\nexport const generateNewClientId = random.uint32\n\n/**\n * @typedef {Object} DocOpts\n * @property {boolean} [DocOpts.gc=true] Disable garbage collection (default: gc=true)\n * @property {function(Item):boolean} [DocOpts.gcFilter] Will be called before an Item is garbage collected. Return false to keep the Item.\n * @property {string} [DocOpts.guid] Define a globally unique identifier for this document\n * @property {string | null} [DocOpts.collectionid] Associate this document with a collection. This only plays a role if your provider has a concept of collection.\n * @property {any} [DocOpts.meta] Any kind of meta information you want to associate with this document. If this is a subdocument, remote peers will store the meta information as well.\n * @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.\n * @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()\n */\n\n/**\n * @typedef {Object} DocEvents\n * @property {function(Doc):void} DocEvents.destroy\n * @property {function(Doc):void} DocEvents.load\n * @property {function(boolean, Doc):void} DocEvents.sync\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.update\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.updateV2\n * @property {function(Doc):void} DocEvents.beforeAllTransactions\n * @property {function(Transaction, Doc):void} DocEvents.beforeTransaction\n * @property {function(Transaction, Doc):void} DocEvents.beforeObserverCalls\n * @property {function(Transaction, Doc):void} DocEvents.afterTransaction\n * @property {function(Transaction, Doc):void} DocEvents.afterTransactionCleanup\n * @property {function(Doc, Array):void} DocEvents.afterAllTransactions\n * @property {function({ loaded: Set, added: Set, removed: Set }, Doc, Transaction):void} DocEvents.subdocs\n */\n\n/**\n * A Yjs instance handles the state of shared data.\n * @extends ObservableV2\n */\nexport class Doc extends ObservableV2 {\n /**\n * @param {DocOpts} opts configuration\n */\n constructor ({ guid = random.uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false, shouldLoad = true } = {}) {\n super()\n this.gc = gc\n this.gcFilter = gcFilter\n this.clientID = generateNewClientId()\n this.guid = guid\n this.collectionid = collectionid\n /**\n * @type {Map>>}\n */\n this.share = new Map()\n this.store = new StructStore()\n /**\n * @type {Transaction | null}\n */\n this._transaction = null\n /**\n * @type {Array}\n */\n this._transactionCleanups = []\n /**\n * @type {Set}\n */\n this.subdocs = new Set()\n /**\n * If this document is a subdocument - a document integrated into another document - then _item is defined.\n * @type {Item?}\n */\n this._item = null\n this.shouldLoad = shouldLoad\n this.autoLoad = autoLoad\n this.meta = meta\n /**\n * This is set to true when the persistence provider loaded the document from the database or when the `sync` event fires.\n * Note that not all providers implement this feature. Provider authors are encouraged to fire the `load` event when the doc content is loaded from the database.\n *\n * @type {boolean}\n */\n this.isLoaded = false\n /**\n * This is set to true when the connection provider has successfully synced with a backend.\n * Note that when using peer-to-peer providers this event may not provide very useful.\n * Also note that not all providers implement this feature. Provider authors are encouraged to fire\n * the `sync` event when the doc has been synced (with `true` as a parameter) or if connection is\n * lost (with false as a parameter).\n */\n this.isSynced = false\n this.isDestroyed = false\n /**\n * Promise that resolves once the document has been loaded from a presistence provider.\n */\n this.whenLoaded = promise.create(resolve => {\n this.on('load', () => {\n this.isLoaded = true\n resolve(this)\n })\n })\n const provideSyncedPromise = () => promise.create(resolve => {\n /**\n * @param {boolean} isSynced\n */\n const eventHandler = (isSynced) => {\n if (isSynced === undefined || isSynced === true) {\n this.off('sync', eventHandler)\n resolve()\n }\n }\n this.on('sync', eventHandler)\n })\n this.on('sync', isSynced => {\n if (isSynced === false && this.isSynced) {\n this.whenSynced = provideSyncedPromise()\n }\n this.isSynced = isSynced === undefined || isSynced === true\n if (this.isSynced && !this.isLoaded) {\n this.emit('load', [this])\n }\n })\n /**\n * Promise that resolves once the document has been synced with a backend.\n * This promise is recreated when the connection is lost.\n * Note the documentation about the `isSynced` property.\n */\n this.whenSynced = provideSyncedPromise()\n }\n\n /**\n * Notify the parent document that you request to load data into this subdocument (if it is a subdocument).\n *\n * `load()` might be used in the future to request any provider to load the most current data.\n *\n * It is safe to call `load()` multiple times.\n */\n load () {\n const item = this._item\n if (item !== null && !this.shouldLoad) {\n transact(/** @type {any} */ (item.parent).doc, transaction => {\n transaction.subdocsLoaded.add(this)\n }, null, true)\n }\n this.shouldLoad = true\n }\n\n getSubdocs () {\n return this.subdocs\n }\n\n getSubdocGuids () {\n return new Set(array.from(this.subdocs).map(doc => doc.guid))\n }\n\n /**\n * Changes that happen inside of a transaction are bundled. This means that\n * the observer fires _after_ the transaction is finished and that all changes\n * that happened inside of the transaction are sent as one message to the\n * other peers.\n *\n * @template T\n * @param {function(Transaction):T} f The function that should be executed as a transaction\n * @param {any} [origin] Origin of who started the transaction. Will be stored on transaction.origin\n * @return T\n *\n * @public\n */\n transact (f, origin = null) {\n return transact(this, f, origin)\n }\n\n /**\n * Define a shared data type.\n *\n * Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result\n * and do not overwrite each other. I.e.\n * `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)`\n *\n * After this method is called, the type is also available on `ydoc.share.get(name)`.\n *\n * *Best Practices:*\n * Define all types right after the Y.Doc instance is created and store them in a separate object.\n * Also use the typed methods `getText(name)`, `getArray(name)`, ..\n *\n * @template {typeof AbstractType} Type\n * @example\n * const ydoc = new Y.Doc(..)\n * const appState = {\n * document: ydoc.getText('document')\n * comments: ydoc.getArray('comments')\n * }\n *\n * @param {string} name\n * @param {Type} TypeConstructor The constructor of the type definition. E.g. Y.Text, Y.Array, Y.Map, ...\n * @return {InstanceType} The created type. Constructed with TypeConstructor\n *\n * @public\n */\n get (name, TypeConstructor = /** @type {any} */ (AbstractType)) {\n const type = map.setIfUndefined(this.share, name, () => {\n // @ts-ignore\n const t = new TypeConstructor()\n t._integrate(this, null)\n return t\n })\n const Constr = type.constructor\n if (TypeConstructor !== AbstractType && Constr !== TypeConstructor) {\n if (Constr === AbstractType) {\n // @ts-ignore\n const t = new TypeConstructor()\n t._map = type._map\n type._map.forEach(/** @param {Item?} n */ n => {\n for (; n !== null; n = n.left) {\n // @ts-ignore\n n.parent = t\n }\n })\n t._start = type._start\n for (let n = t._start; n !== null; n = n.right) {\n n.parent = t\n }\n t._length = type._length\n this.share.set(name, t)\n t._integrate(this, null)\n return /** @type {InstanceType} */ (t)\n } else {\n throw new Error(`Type with the name ${name} has already been defined with a different constructor`)\n }\n }\n return /** @type {InstanceType} */ (type)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YArray}\n *\n * @public\n */\n getArray (name = '') {\n return /** @type {YArray} */ (this.get(name, YArray))\n }\n\n /**\n * @param {string} [name]\n * @return {YText}\n *\n * @public\n */\n getText (name = '') {\n return this.get(name, YText)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YMap}\n *\n * @public\n */\n getMap (name = '') {\n return /** @type {YMap} */ (this.get(name, YMap))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlElement}\n *\n * @public\n */\n getXmlElement (name = '') {\n return /** @type {YXmlElement<{[key:string]:string}>} */ (this.get(name, YXmlElement))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlFragment}\n *\n * @public\n */\n getXmlFragment (name = '') {\n return this.get(name, YXmlFragment)\n }\n\n /**\n * Converts the entire document into a js object, recursively traversing each yjs type\n * Doesn't log types that have not been defined (using ydoc.getType(..)).\n *\n * @deprecated Do not use this method and rather call toJSON directly on the shared types.\n *\n * @return {Object}\n */\n toJSON () {\n /**\n * @type {Object}\n */\n const doc = {}\n\n this.share.forEach((value, key) => {\n doc[key] = value.toJSON()\n })\n\n return doc\n }\n\n /**\n * Emit `destroy` event and unregister all event handlers.\n */\n destroy () {\n this.isDestroyed = true\n array.from(this.subdocs).forEach(subdoc => subdoc.destroy())\n const item = this._item\n if (item !== null) {\n this._item = null\n const content = /** @type {ContentDoc} */ (item.content)\n content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })\n content.doc._item = item\n transact(/** @type {any} */ (item).parent.doc, transaction => {\n const doc = content.doc\n if (!item.deleted) {\n transaction.subdocsAdded.add(doc)\n }\n transaction.subdocsRemoved.add(this)\n }, null, true)\n }\n // @ts-ignore\n this.emit('destroyed', [true]) // DEPRECATED!\n this.emit('destroy', [this])\n super.destroy()\n }\n}\n", "import * as buffer from 'lib0/buffer'\nimport * as decoding from 'lib0/decoding'\nimport {\n ID, createID\n} from '../internals.js'\n\nexport class DSDecoderV1 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n}\n\nexport class UpdateDecoderV1 extends DSDecoderV1 {\n /**\n * @return {ID}\n */\n readLeftID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return decoding.readUint8(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readString () {\n return decoding.readVarString(this.restDecoder)\n }\n\n /**\n * @return {boolean} isKey\n */\n readParentInfo () {\n return decoding.readVarUint(this.restDecoder) === 1\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readTypeRef () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number} len\n */\n readLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return buffer.copyUint8Array(decoding.readVarUint8Array(this.restDecoder))\n }\n\n /**\n * Legacy implementation uses JSON parse. We use any-decoding in v2.\n *\n * @return {any}\n */\n readJSON () {\n return JSON.parse(decoding.readVarString(this.restDecoder))\n }\n\n /**\n * @return {string}\n */\n readKey () {\n return decoding.readVarString(this.restDecoder)\n }\n}\n\nexport class DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n /**\n * @private\n */\n this.dsCurrVal = 0\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n this.dsCurrVal += decoding.readVarUint(this.restDecoder)\n return this.dsCurrVal\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n const diff = decoding.readVarUint(this.restDecoder) + 1\n this.dsCurrVal += diff\n return diff\n }\n}\n\nexport class UpdateDecoderV2 extends DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n super(decoder)\n /**\n * List of cached keys. If the keys[id] does not exist, we read a new key\n * from stringEncoder and push it to keys.\n *\n * @type {Array}\n */\n this.keys = []\n decoding.readVarUint(decoder) // read feature flag - currently unused\n this.keyClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.clientDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.leftClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.rightClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.infoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.stringDecoder = new decoding.StringDecoder(decoding.readVarUint8Array(decoder))\n this.parentInfoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.typeRefDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.lenDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n }\n\n /**\n * @return {ID}\n */\n readLeftID () {\n return new ID(this.clientDecoder.read(), this.leftClockDecoder.read())\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return new ID(this.clientDecoder.read(), this.rightClockDecoder.read())\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return this.clientDecoder.read()\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return /** @type {number} */ (this.infoDecoder.read())\n }\n\n /**\n * @return {string}\n */\n readString () {\n return this.stringDecoder.read()\n }\n\n /**\n * @return {boolean}\n */\n readParentInfo () {\n return this.parentInfoDecoder.read() === 1\n }\n\n /**\n * @return {number} An unsigned 8-bit integer\n */\n readTypeRef () {\n return this.typeRefDecoder.read()\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number}\n */\n readLen () {\n return this.lenDecoder.read()\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return decoding.readVarUint8Array(this.restDecoder)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @return {any}\n */\n readJSON () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readKey () {\n const keyClock = this.keyClockDecoder.read()\n if (keyClock < this.keys.length) {\n return this.keys[keyClock]\n } else {\n const key = this.stringDecoder.read()\n this.keys.push(key)\n return key\n }\n }\n}\n", "import * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nimport {\n ID // eslint-disable-line\n} from '../internals.js'\n\nexport class DSEncoderV1 {\n constructor () {\n this.restEncoder = encoding.createEncoder()\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n encoding.writeVarUint(this.restEncoder, clock)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n}\n\nexport class UpdateEncoderV1 extends DSEncoderV1 {\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * Use writeClient and writeClock instead of writeID if possible.\n * @param {number} client\n */\n writeClient (client) {\n encoding.writeVarUint(this.restEncoder, client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n encoding.writeUint8(this.restEncoder, info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n encoding.writeVarString(this.restEncoder, s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n encoding.writeVarUint(this.restEncoder, isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n encoding.writeVarUint(this.restEncoder, info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeVarString(this.restEncoder, JSON.stringify(embed))\n }\n\n /**\n * @param {string} key\n */\n writeKey (key) {\n encoding.writeVarString(this.restEncoder, key)\n }\n}\n\nexport class DSEncoderV2 {\n constructor () {\n this.restEncoder = encoding.createEncoder() // encodes all the rest / non-optimized\n this.dsCurrVal = 0\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n const diff = clock - this.dsCurrVal\n this.dsCurrVal = clock\n encoding.writeVarUint(this.restEncoder, diff)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n if (len === 0) {\n error.unexpectedCase()\n }\n encoding.writeVarUint(this.restEncoder, len - 1)\n this.dsCurrVal += len\n }\n}\n\nexport class UpdateEncoderV2 extends DSEncoderV2 {\n constructor () {\n super()\n /**\n * @type {Map}\n */\n this.keyMap = new Map()\n /**\n * Refers to the next uniqe key-identifier to me used.\n * See writeKey method for more information.\n *\n * @type {number}\n */\n this.keyClock = 0\n this.keyClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.clientEncoder = new encoding.UintOptRleEncoder()\n this.leftClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.rightClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.infoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.stringEncoder = new encoding.StringEncoder()\n this.parentInfoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.typeRefEncoder = new encoding.UintOptRleEncoder()\n this.lenEncoder = new encoding.UintOptRleEncoder()\n }\n\n toUint8Array () {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, 0) // this is a feature flag that we might use in the future\n encoding.writeVarUint8Array(encoder, this.keyClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.clientEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.leftClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.rightClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.infoEncoder))\n encoding.writeVarUint8Array(encoder, this.stringEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.parentInfoEncoder))\n encoding.writeVarUint8Array(encoder, this.typeRefEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.lenEncoder.toUint8Array())\n // @note The rest encoder is appended! (note the missing var)\n encoding.writeUint8Array(encoder, encoding.toUint8Array(this.restEncoder))\n return encoding.toUint8Array(encoder)\n }\n\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n this.clientEncoder.write(id.client)\n this.leftClockEncoder.write(id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n this.clientEncoder.write(id.client)\n this.rightClockEncoder.write(id.clock)\n }\n\n /**\n * @param {number} client\n */\n writeClient (client) {\n this.clientEncoder.write(client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n this.infoEncoder.write(info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n this.stringEncoder.write(s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n this.parentInfoEncoder.write(isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n this.typeRefEncoder.write(info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n this.lenEncoder.write(len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeAny(this.restEncoder, embed)\n }\n\n /**\n * Property keys are often reused. For example, in y-prosemirror the key `bold` might\n * occur very often. For a 3d application, the key `position` might occur very often.\n *\n * We cache these keys in a Map and refer to them via a unique number.\n *\n * @param {string} key\n */\n writeKey (key) {\n const clock = this.keyMap.get(key)\n if (clock === undefined) {\n /**\n * @todo uncomment to introduce this feature finally\n *\n * Background. The ContentFormat object was always encoded using writeKey, but the decoder used to use readString.\n * Furthermore, I forgot to set the keyclock. So everything was working fine.\n *\n * However, this feature here is basically useless as it is not being used (it actually only consumes extra memory).\n *\n * I don't know yet how to reintroduce this feature..\n *\n * Older clients won't be able to read updates when we reintroduce this feature. So this should probably be done using a flag.\n *\n */\n // this.keyMap.set(key, this.keyClock)\n this.keyClockEncoder.write(this.keyClock++)\n this.stringEncoder.write(key)\n } else {\n this.keyClockEncoder.write(clock)\n }\n }\n}\n", "/**\n * @module encoding\n */\n/*\n * We use the first five bits in the info flag for determining the type of the struct.\n *\n * 0: GC\n * 1: Item with Deleted content\n * 2: Item with JSON content\n * 3: Item with Binary content\n * 4: Item with String content\n * 5: Item with Embed content (for richtext content)\n * 6: Item with Format content (a formatting marker for richtext content)\n * 7: Item with Type\n */\n\nimport {\n findIndexSS,\n getState,\n createID,\n getStateVector,\n readAndApplyDeleteSet,\n writeDeleteSet,\n createDeleteSetFromStructStore,\n transact,\n readItemContent,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n DSEncoderV2,\n DSDecoderV1,\n DSEncoderV1,\n mergeUpdates,\n mergeUpdatesV2,\n Skip,\n diffUpdateV2,\n convertUpdateFormatV2ToV1,\n DSDecoderV2, Doc, Transaction, GC, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as binary from 'lib0/binary'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as array from 'lib0/array'\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Array} structs All structs by `client`\n * @param {number} client\n * @param {number} clock write structs starting with `ID(client,clock)`\n *\n * @function\n */\nconst writeStructs = (encoder, structs, client, clock) => {\n // write first id\n clock = math.max(clock, structs[0].id.clock) // make sure the first id exists\n const startNewStructs = findIndexSS(structs, clock)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, structs.length - startNewStructs)\n encoder.writeClient(client)\n encoding.writeVarUint(encoder.restEncoder, clock)\n const firstStruct = structs[startNewStructs]\n // write first struct with an offset\n firstStruct.write(encoder, clock - firstStruct.id.clock)\n for (let i = startNewStructs + 1; i < structs.length; i++) {\n structs[i].write(encoder, 0)\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {StructStore} store\n * @param {Map} _sm\n *\n * @private\n * @function\n */\nexport const writeClientsStructs = (encoder, store, _sm) => {\n // we filter all valid _sm entries into sm\n const sm = new Map()\n _sm.forEach((clock, client) => {\n // only write if new structs are available\n if (getState(store, client) > clock) {\n sm.set(client, clock)\n }\n })\n getStateVector(store).forEach((_clock, client) => {\n if (!_sm.has(client)) {\n sm.set(client, 0)\n }\n })\n // write # states that were updated\n encoding.writeVarUint(encoder.restEncoder, sm.size)\n // Write items with higher client ids first\n // This heavily improves the conflict algorithm.\n array.from(sm.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n writeStructs(encoder, /** @type {Array} */ (store.clients.get(client)), client, clock)\n })\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder The decoder object to read data from.\n * @param {Doc} doc\n * @return {Map }>}\n *\n * @private\n * @function\n */\nexport const readClientsStructRefs = (decoder, doc) => {\n /**\n * @type {Map }>}\n */\n const clientRefs = map.create()\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n /**\n * @type {Array}\n */\n const refs = new Array(numberOfStructs)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n // const start = performance.now()\n clientRefs.set(client, { i: 0, refs })\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n switch (binary.BITS5 & info) {\n case 0: { // GC\n const len = decoder.readLen()\n refs[i] = new GC(createID(client, clock), len)\n clock += len\n break\n }\n case 10: { // Skip Struct (nothing to apply)\n // @todo we could reduce the amount of checks by adding Skip struct to clientRefs so we know that something is missing.\n const len = decoding.readVarUint(decoder.restDecoder)\n refs[i] = new Skip(createID(client, clock), len)\n clock += len\n break\n }\n default: { // Item with content\n /**\n * The optimized implementation doesn't use any variables because inlining variables is faster.\n * Below a non-optimized version is shown that implements the basic algorithm with\n * a few comments\n */\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n cantCopyParentInfo ? (decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n /* A non-optimized implementation of the above algorithm:\n\n // The item that was originally to the left of this item.\n const origin = (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null\n // The item that was originally to the right of this item.\n const rightOrigin = (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n const hasParentYKey = cantCopyParentInfo ? decoder.readParentInfo() : false\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const parentYKey = cantCopyParentInfo && hasParentYKey ? decoder.readString() : null\n\n const struct = new Item(\n createID(client, clock),\n null, // left\n origin, // origin\n null, // right\n rightOrigin, // right origin\n cantCopyParentInfo && !hasParentYKey ? decoder.readLeftID() : (parentYKey !== null ? doc.get(parentYKey) : null), // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n */\n refs[i] = struct\n clock += struct.length\n }\n }\n }\n // console.log('time to read: ', performance.now() - start) // @todo remove\n }\n return clientRefs\n}\n\n/**\n * Resume computing structs generated by struct readers.\n *\n * While there is something to do, we integrate structs in this order\n * 1. top element on stack, if stack is not empty\n * 2. next element from current struct reader (if empty, use next struct reader)\n *\n * If struct causally depends on another struct (ref.missing), we put next reader of\n * `ref.id.client` on top of stack.\n *\n * At some point we find a struct that has no causal dependencies,\n * then we start emptying the stack.\n *\n * It is not possible to have circles: i.e. struct1 (from client1) depends on struct2 (from client2)\n * depends on struct3 (from client1). Therefore the max stack size is eqaul to `structReaders.length`.\n *\n * This method is implemented in a way so that we can resume computation if this update\n * causally depends on another update.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {Map} clientsStructRefs\n * @return { null | { update: Uint8Array, missing: Map } }\n *\n * @private\n * @function\n */\nconst integrateStructs = (transaction, store, clientsStructRefs) => {\n /**\n * @type {Array}\n */\n const stack = []\n // sort them so that we take the higher id first, in case of conflicts the lower id will probably not conflict with the id from the higher user.\n let clientsStructRefsIds = array.from(clientsStructRefs.keys()).sort((a, b) => a - b)\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n const getNextStructTarget = () => {\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n let nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n while (nextStructsTarget.refs.length === nextStructsTarget.i) {\n clientsStructRefsIds.pop()\n if (clientsStructRefsIds.length > 0) {\n nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n } else {\n return null\n }\n }\n return nextStructsTarget\n }\n let curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n return null\n }\n\n /**\n * @type {StructStore}\n */\n const restStructs = new StructStore()\n const missingSV = new Map()\n /**\n * @param {number} client\n * @param {number} clock\n */\n const updateMissingSv = (client, clock) => {\n const mclock = missingSV.get(client)\n if (mclock == null || mclock > clock) {\n missingSV.set(client, clock)\n }\n }\n /**\n * @type {GC|Item}\n */\n let stackHead = /** @type {any} */ (curStructsTarget).refs[/** @type {any} */ (curStructsTarget).i++]\n // caching the state because it is used very often\n const state = new Map()\n\n const addStackToRestSS = () => {\n for (const item of stack) {\n const client = item.id.client\n const unapplicableItems = clientsStructRefs.get(client)\n if (unapplicableItems) {\n // decrement because we weren't able to apply previous operation\n unapplicableItems.i--\n restStructs.clients.set(client, unapplicableItems.refs.slice(unapplicableItems.i))\n clientsStructRefs.delete(client)\n unapplicableItems.i = 0\n unapplicableItems.refs = []\n } else {\n // item was the last item on clientsStructRefs and the field was already cleared. Add item to restStructs and continue\n restStructs.clients.set(client, [item])\n }\n // remove client from clientsStructRefsIds to prevent users from applying the same update again\n clientsStructRefsIds = clientsStructRefsIds.filter(c => c !== client)\n }\n stack.length = 0\n }\n\n // iterate over all struct readers until we are done\n while (true) {\n if (stackHead.constructor !== Skip) {\n const localClock = map.setIfUndefined(state, stackHead.id.client, () => getState(store, stackHead.id.client))\n const offset = localClock - stackHead.id.clock\n if (offset < 0) {\n // update from the same client is missing\n stack.push(stackHead)\n updateMissingSv(stackHead.id.client, stackHead.id.clock - 1)\n // hid a dead wall, add all items from stack to restSS\n addStackToRestSS()\n } else {\n const missing = stackHead.getMissing(transaction, store)\n if (missing !== null) {\n stack.push(stackHead)\n // get the struct reader that has the missing struct\n /**\n * @type {{ refs: Array, i: number }}\n */\n const structRefs = clientsStructRefs.get(/** @type {number} */ (missing)) || { refs: [], i: 0 }\n if (structRefs.refs.length === structRefs.i) {\n // This update message causally depends on another update message that doesn't exist yet\n updateMissingSv(/** @type {number} */ (missing), getState(store, missing))\n addStackToRestSS()\n } else {\n stackHead = structRefs.refs[structRefs.i++]\n continue\n }\n } else if (offset === 0 || offset < stackHead.length) {\n // all fine, apply the stackhead\n stackHead.integrate(transaction, offset)\n state.set(stackHead.id.client, stackHead.id.clock + stackHead.length)\n }\n }\n }\n // iterate to next stackHead\n if (stack.length > 0) {\n stackHead = /** @type {GC|Item} */ (stack.pop())\n } else if (curStructsTarget !== null && curStructsTarget.i < curStructsTarget.refs.length) {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n } else {\n curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n // we are done!\n break\n } else {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n }\n }\n }\n if (restStructs.clients.size > 0) {\n const encoder = new UpdateEncoderV2()\n writeClientsStructs(encoder, restStructs, new Map())\n // write empty deleteset\n // writeDeleteSet(encoder, new DeleteSet())\n encoding.writeVarUint(encoder.restEncoder, 0) // => no need for an extra function call, just write 0 deletes\n return { missing: missingSV, update: encoder.toUint8Array() }\n }\n return null\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(encoder, transaction.doc.store, transaction.beforeState)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {UpdateDecoderV1 | UpdateDecoderV2} [structDecoder]\n *\n * @function\n */\nexport const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) =>\n transact(ydoc, transaction => {\n // force that transaction.local is set to non-local\n transaction.local = false\n let retry = false\n const doc = transaction.doc\n const store = doc.store\n // let start = performance.now()\n const ss = readClientsStructRefs(structDecoder, doc)\n // console.log('time to read structs: ', performance.now() - start) // @todo remove\n // start = performance.now()\n // console.log('time to merge: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const restStructs = integrateStructs(transaction, store, ss)\n const pending = store.pendingStructs\n if (pending) {\n // check if we can apply something\n for (const [client, clock] of pending.missing) {\n if (clock < getState(store, client)) {\n retry = true\n break\n }\n }\n if (restStructs) {\n // merge restStructs into store.pending\n for (const [client, clock] of restStructs.missing) {\n const mclock = pending.missing.get(client)\n if (mclock == null || mclock > clock) {\n pending.missing.set(client, clock)\n }\n }\n pending.update = mergeUpdatesV2([pending.update, restStructs.update])\n }\n } else {\n store.pendingStructs = restStructs\n }\n // console.log('time to integrate: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const dsRest = readAndApplyDeleteSet(structDecoder, transaction, store)\n if (store.pendingDs) {\n // @todo we could make a lower-bound state-vector check as we do above\n const pendingDSUpdate = new UpdateDecoderV2(decoding.createDecoder(store.pendingDs))\n decoding.readVarUint(pendingDSUpdate.restDecoder) // read 0 structs, because we only encode deletes in pendingdsupdate\n const dsRest2 = readAndApplyDeleteSet(pendingDSUpdate, transaction, store)\n if (dsRest && dsRest2) {\n // case 1: ds1 != null && ds2 != null\n store.pendingDs = mergeUpdatesV2([dsRest, dsRest2])\n } else {\n // case 2: ds1 != null\n // case 3: ds2 != null\n // case 4: ds1 == null && ds2 == null\n store.pendingDs = dsRest || dsRest2\n }\n } else {\n // Either dsRest == null && pendingDs == null OR dsRest != null\n store.pendingDs = dsRest\n }\n // console.log('time to cleanup: ', performance.now() - start) // @todo remove\n // start = performance.now()\n\n // console.log('time to resume delete readers: ', performance.now() - start) // @todo remove\n // start = performance.now()\n if (retry) {\n const update = /** @type {{update: Uint8Array}} */ (store.pendingStructs).update\n store.pendingStructs = null\n applyUpdateV2(transaction.doc, update)\n }\n }, transactionOrigin, false)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const readUpdate = (decoder, ydoc, transactionOrigin) => readUpdateV2(decoder, ydoc, transactionOrigin, new UpdateDecoderV1(decoder))\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n *\n * @function\n */\nexport const applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2) => {\n const decoder = decoding.createDecoder(update)\n readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder))\n}\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1)\n\n/**\n * Write all the document as a single update message. If you specify the state of the remote client (`targetStateVector`) it will\n * only write the operations that are missing.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Doc} doc\n * @param {Map} [targetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n *\n * @function\n */\nexport const writeStateAsUpdate = (encoder, doc, targetStateVector = new Map()) => {\n writeClientsStructs(encoder, doc.store, targetStateVector)\n writeDeleteSet(encoder, createDeleteSetFromStructStore(doc.store))\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2()) => {\n const targetStateVector = decodeStateVector(encodedTargetStateVector)\n writeStateAsUpdate(encoder, doc, targetStateVector)\n const updates = [encoder.toUint8Array()]\n // also add the pending updates (if there are any)\n if (doc.store.pendingDs) {\n updates.push(doc.store.pendingDs)\n }\n if (doc.store.pendingStructs) {\n updates.push(diffUpdateV2(doc.store.pendingStructs.update, encodedTargetStateVector))\n }\n if (updates.length > 1) {\n if (encoder.constructor === UpdateEncoderV1) {\n return mergeUpdates(updates.map((update, i) => i === 0 ? update : convertUpdateFormatV2ToV1(update)))\n } else if (encoder.constructor === UpdateEncoderV2) {\n return mergeUpdatesV2(updates)\n }\n }\n return updates[0]\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdate = (doc, encodedTargetStateVector) => encodeStateAsUpdateV2(doc, encodedTargetStateVector, new UpdateEncoderV1())\n\n/**\n * Read state vector from Decoder and return as Map\n *\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const readStateVector = decoder => {\n const ss = new Map()\n const ssLength = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < ssLength; i++) {\n const client = decoding.readVarUint(decoder.restDecoder)\n const clock = decoding.readVarUint(decoder.restDecoder)\n ss.set(client, clock)\n }\n return ss\n}\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\n// export const decodeStateVectorV2 = decodedState => readStateVector(new DSDecoderV2(decoding.createDecoder(decodedState)))\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const decodeStateVector = decodedState => readStateVector(new DSDecoderV1(decoding.createDecoder(decodedState)))\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Map} sv\n * @function\n */\nexport const writeStateVector = (encoder, sv) => {\n encoding.writeVarUint(encoder.restEncoder, sv.size)\n array.from(sv.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n encoding.writeVarUint(encoder.restEncoder, client) // @todo use a special client decoder that is based on mapping\n encoding.writeVarUint(encoder.restEncoder, clock)\n })\n return encoder\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Doc} doc\n *\n * @function\n */\nexport const writeDocumentStateVector = (encoder, doc) => writeStateVector(encoder, getStateVector(doc.store))\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVectorV2 = (doc, encoder = new DSEncoderV2()) => {\n if (doc instanceof Map) {\n writeStateVector(encoder, doc)\n } else {\n writeDocumentStateVector(encoder, doc)\n }\n return encoder.toUint8Array()\n}\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVector = doc => encodeStateVectorV2(doc, new DSEncoderV1())\n", "import * as f from 'lib0/function'\n\n/**\n * General event handler implementation.\n *\n * @template ARG0, ARG1\n *\n * @private\n */\nexport class EventHandler {\n constructor () {\n /**\n * @type {Array}\n */\n this.l = []\n }\n}\n\n/**\n * @template ARG0,ARG1\n * @returns {EventHandler}\n *\n * @private\n * @function\n */\nexport const createEventHandler = () => new EventHandler()\n\n/**\n * Adds an event listener that is called when\n * {@link EventHandler#callEventListeners} is called.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler.\n *\n * @private\n * @function\n */\nexport const addEventHandlerListener = (eventHandler, f) =>\n eventHandler.l.push(f)\n\n/**\n * Removes an event listener.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler that was added with\n * {@link EventHandler#addEventListener}\n *\n * @private\n * @function\n */\nexport const removeEventHandlerListener = (eventHandler, f) => {\n const l = eventHandler.l\n const len = l.length\n eventHandler.l = l.filter(g => f !== g)\n if (len === eventHandler.l.length) {\n console.error('[yjs] Tried to remove event handler that doesn\\'t exist.')\n }\n}\n\n/**\n * Removes all event listeners.\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n *\n * @private\n * @function\n */\nexport const removeAllEventHandlerListeners = eventHandler => {\n eventHandler.l.length = 0\n}\n\n/**\n * Call all event listeners that were added via\n * {@link EventHandler#addEventListener}.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {ARG0} arg0\n * @param {ARG1} arg1\n *\n * @private\n * @function\n */\nexport const callEventHandlerListeners = (eventHandler, arg0, arg1) =>\n f.callAll(eventHandler.l, [arg0, arg1])\n", "import { AbstractType } from '../internals.js' // eslint-disable-line\n\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\n\nexport class ID {\n /**\n * @param {number} client client id\n * @param {number} clock unique per client id, continuous number\n */\n constructor (client, clock) {\n /**\n * Client id\n * @type {number}\n */\n this.client = client\n /**\n * unique per client id, continuous number\n * @type {number}\n */\n this.clock = clock\n }\n}\n\n/**\n * @param {ID | null} a\n * @param {ID | null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareIDs = (a, b) => a === b || (a !== null && b !== null && a.client === b.client && a.clock === b.clock)\n\n/**\n * @param {number} client\n * @param {number} clock\n *\n * @private\n * @function\n */\nexport const createID = (client, clock) => new ID(client, clock)\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {ID} id\n *\n * @private\n * @function\n */\nexport const writeID = (encoder, id) => {\n encoding.writeVarUint(encoder, id.client)\n encoding.writeVarUint(encoder, id.clock)\n}\n\n/**\n * Read ID.\n * * If first varUint read is 0xFFFFFF a RootID is returned.\n * * Otherwise an ID is returned\n *\n * @param {decoding.Decoder} decoder\n * @return {ID}\n *\n * @private\n * @function\n */\nexport const readID = decoder =>\n createID(decoding.readVarUint(decoder), decoding.readVarUint(decoder))\n\n/**\n * The top types are mapped from y.share.get(keyname) => type.\n * `type` does not store any information about the `keyname`.\n * This function finds the correct `keyname` for `type` and throws otherwise.\n *\n * @param {AbstractType} type\n * @return {string}\n *\n * @private\n * @function\n */\nexport const findRootTypeKey = type => {\n // @ts-ignore _y must be defined, otherwise unexpected case\n for (const [key, value] of type.doc.share.entries()) {\n if (value === type) {\n return key\n }\n }\n throw error.unexpectedCase()\n}\n", "import { AbstractType, Item } from '../internals.js' // eslint-disable-line\n\n/**\n * Check if `parent` is a parent of `child`.\n *\n * @param {AbstractType} parent\n * @param {Item|null} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @private\n * @function\n */\nexport const isParentOf = (parent, child) => {\n while (child !== null) {\n if (child.parent === parent) {\n return true\n }\n child = /** @type {AbstractType} */ (child.parent)._item\n }\n return false\n}\n", "import {\n AbstractType // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Convenient helper to log type information.\n *\n * Do not use in productive systems as the output can be immense!\n *\n * @param {AbstractType} type\n */\nexport const logType = type => {\n const res = []\n let n = type._start\n while (n) {\n res.push(n)\n n = n.right\n }\n console.log('Children: ', res)\n console.log('Children content: ', res.filter(m => !m.deleted).map(m => m.content))\n}\n", "import {\n YArray,\n YMap,\n readDeleteSet,\n writeDeleteSet,\n createDeleteSet,\n DSEncoderV1, DSDecoderV1, ID, DeleteSet, YArrayEvent, Transaction, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as decoding from 'lib0/decoding'\n\nimport { mergeDeleteSets, isDeleted } from './DeleteSet.js'\n\nexport class PermanentUserData {\n /**\n * @param {Doc} doc\n * @param {YMap} [storeType]\n */\n constructor (doc, storeType = doc.getMap('users')) {\n /**\n * @type {Map}\n */\n const dss = new Map()\n this.yusers = storeType\n this.doc = doc\n /**\n * Maps from clientid to userDescription\n *\n * @type {Map}\n */\n this.clients = new Map()\n this.dss = dss\n /**\n * @param {YMap} user\n * @param {string} userDescription\n */\n const initUser = (user, userDescription) => {\n /**\n * @type {YArray}\n */\n const ds = user.get('ds')\n const ids = user.get('ids')\n const addClientId = /** @param {number} clientid */ clientid => this.clients.set(clientid, userDescription)\n ds.observe(/** @param {YArrayEvent} event */ event => {\n event.changes.added.forEach(item => {\n item.content.getContent().forEach(encodedDs => {\n if (encodedDs instanceof Uint8Array) {\n this.dss.set(userDescription, mergeDeleteSets([this.dss.get(userDescription) || createDeleteSet(), readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs)))]))\n }\n })\n })\n })\n this.dss.set(userDescription, mergeDeleteSets(ds.map(encodedDs => readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs))))))\n ids.observe(/** @param {YArrayEvent} event */ event =>\n event.changes.added.forEach(item => item.content.getContent().forEach(addClientId))\n )\n ids.forEach(addClientId)\n }\n // observe users\n storeType.observe(event => {\n event.keysChanged.forEach(userDescription =>\n initUser(storeType.get(userDescription), userDescription)\n )\n })\n // add intial data\n storeType.forEach(initUser)\n }\n\n /**\n * @param {Doc} doc\n * @param {number} clientid\n * @param {string} userDescription\n * @param {Object} conf\n * @param {function(Transaction, DeleteSet):boolean} [conf.filter]\n */\n setUserMapping (doc, clientid, userDescription, { filter = () => true } = {}) {\n const users = this.yusers\n let user = users.get(userDescription)\n if (!user) {\n user = new YMap()\n user.set('ids', new YArray())\n user.set('ds', new YArray())\n users.set(userDescription, user)\n }\n user.get('ids').push([clientid])\n users.observe(_event => {\n setTimeout(() => {\n const userOverwrite = users.get(userDescription)\n if (userOverwrite !== user) {\n // user was overwritten, port all data over to the next user object\n // @todo Experiment with Y.Sets here\n user = userOverwrite\n // @todo iterate over old type\n this.clients.forEach((_userDescription, clientid) => {\n if (userDescription === _userDescription) {\n user.get('ids').push([clientid])\n }\n })\n const encoder = new DSEncoderV1()\n const ds = this.dss.get(userDescription)\n if (ds) {\n writeDeleteSet(encoder, ds)\n user.get('ds').push([encoder.toUint8Array()])\n }\n }\n }, 0)\n })\n doc.on('afterTransaction', /** @param {Transaction} transaction */ transaction => {\n setTimeout(() => {\n const yds = user.get('ds')\n const ds = transaction.deleteSet\n if (transaction.local && ds.clients.size > 0 && filter(transaction, ds)) {\n const encoder = new DSEncoderV1()\n writeDeleteSet(encoder, ds)\n yds.push([encoder.toUint8Array()])\n }\n })\n })\n }\n\n /**\n * @param {number} clientid\n * @return {any}\n */\n getUserByClientId (clientid) {\n return this.clients.get(clientid) || null\n }\n\n /**\n * @param {ID} id\n * @return {string | null}\n */\n getUserByDeletedId (id) {\n for (const [userDescription, ds] of this.dss.entries()) {\n if (isDeleted(ds, id)) {\n return userDescription\n }\n }\n return null\n }\n}\n", "import {\n writeID,\n readID,\n compareIDs,\n getState,\n findRootTypeKey,\n Item,\n createID,\n ContentType,\n followRedone,\n getItem,\n ID, Doc, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as error from 'lib0/error'\n\n/**\n * A relative position is based on the Yjs model and is not affected by document changes.\n * E.g. If you place a relative position before a certain character, it will always point to this character.\n * If you place a relative position at the end of a type, it will always point to the end of the type.\n *\n * A numeric position is often unsuited for user selections, because it does not change when content is inserted\n * before or after.\n *\n * ```Insert(0, 'x')('a|bc') = 'xa|bc'``` Where | is the relative position.\n *\n * One of the properties must be defined.\n *\n * @example\n * // Current cursor position is at position 10\n * const relativePosition = createRelativePositionFromIndex(yText, 10)\n * // modify yText\n * yText.insert(0, 'abc')\n * yText.delete(3, 10)\n * // Compute the cursor position\n * const absolutePosition = createAbsolutePositionFromRelativePosition(y, relativePosition)\n * absolutePosition.type === yText // => true\n * console.log('cursor location is ' + absolutePosition.index) // => cursor location is 3\n *\n */\nexport class RelativePosition {\n /**\n * @param {ID|null} type\n * @param {string|null} tname\n * @param {ID|null} item\n * @param {number} assoc\n */\n constructor (type, tname, item, assoc = 0) {\n /**\n * @type {ID|null}\n */\n this.type = type\n /**\n * @type {string|null}\n */\n this.tname = tname\n /**\n * @type {ID | null}\n */\n this.item = item\n /**\n * A relative position is associated to a specific character. By default\n * assoc >= 0, the relative position is associated to the character\n * after the meant position.\n * I.e. position 1 in 'ab' is associated to character 'b'.\n *\n * If assoc < 0, then the relative position is associated to the caharacter\n * before the meant position.\n *\n * @type {number}\n */\n this.assoc = assoc\n }\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {any}\n */\nexport const relativePositionToJSON = rpos => {\n const json = {}\n if (rpos.type) {\n json.type = rpos.type\n }\n if (rpos.tname) {\n json.tname = rpos.tname\n }\n if (rpos.item) {\n json.item = rpos.item\n }\n if (rpos.assoc != null) {\n json.assoc = rpos.assoc\n }\n return json\n}\n\n/**\n * @param {any} json\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromJSON = json => new RelativePosition(json.type == null ? null : createID(json.type.client, json.type.clock), json.tname ?? null, json.item == null ? null : createID(json.item.client, json.item.clock), json.assoc == null ? 0 : json.assoc)\n\nexport class AbsolutePosition {\n /**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n */\n constructor (type, index, assoc = 0) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n /**\n * @type {number}\n */\n this.index = index\n this.assoc = assoc\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createAbsolutePosition = (type, index, assoc = 0) => new AbsolutePosition(type, index, assoc)\n\n/**\n * @param {AbstractType} type\n * @param {ID|null} item\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createRelativePosition = (type, item, assoc) => {\n let typeid = null\n let tname = null\n if (type._item === null) {\n tname = findRootTypeKey(type)\n } else {\n typeid = createID(type._item.id.client, type._item.id.clock)\n }\n return new RelativePosition(typeid, tname, item, assoc)\n}\n\n/**\n * Create a relativePosition based on a absolute position.\n *\n * @param {AbstractType} type The base type (e.g. YText or YArray).\n * @param {number} index The absolute position.\n * @param {number} [assoc]\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {\n let t = type._start\n if (assoc < 0) {\n // associated to the left character or the beginning of a type, increment index if possible.\n if (index === 0) {\n return createRelativePosition(type, null, assoc)\n }\n index--\n }\n while (t !== null) {\n if (!t.deleted && t.countable) {\n if (t.length > index) {\n // case 1: found position somewhere in the linked list\n return createRelativePosition(type, createID(t.id.client, t.id.clock + index), assoc)\n }\n index -= t.length\n }\n if (t.right === null && assoc < 0) {\n // left-associated position, return last available id\n return createRelativePosition(type, t.lastId, assoc)\n }\n t = t.right\n }\n return createRelativePosition(type, null, assoc)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {RelativePosition} rpos\n *\n * @function\n */\nexport const writeRelativePosition = (encoder, rpos) => {\n const { type, tname, item, assoc } = rpos\n if (item !== null) {\n encoding.writeVarUint(encoder, 0)\n writeID(encoder, item)\n } else if (tname !== null) {\n // case 2: found position at the end of the list and type is stored in y.share\n encoding.writeUint8(encoder, 1)\n encoding.writeVarString(encoder, tname)\n } else if (type !== null) {\n // case 3: found position at the end of the list and type is attached to an item\n encoding.writeUint8(encoder, 2)\n writeID(encoder, type)\n } else {\n throw error.unexpectedCase()\n }\n encoding.writeVarInt(encoder, assoc)\n return encoder\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {Uint8Array}\n */\nexport const encodeRelativePosition = rpos => {\n const encoder = encoding.createEncoder()\n writeRelativePosition(encoder, rpos)\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {decoding.Decoder} decoder\n * @return {RelativePosition}\n *\n * @function\n */\nexport const readRelativePosition = decoder => {\n let type = null\n let tname = null\n let itemID = null\n switch (decoding.readVarUint(decoder)) {\n case 0:\n // case 1: found position somewhere in the linked list\n itemID = readID(decoder)\n break\n case 1:\n // case 2: found position at the end of the list and type is stored in y.share\n tname = decoding.readVarString(decoder)\n break\n case 2: {\n // case 3: found position at the end of the list and type is attached to an item\n type = readID(decoder)\n }\n }\n const assoc = decoding.hasContent(decoder) ? decoding.readVarInt(decoder) : 0\n return new RelativePosition(type, tname, itemID, assoc)\n}\n\n/**\n * @param {Uint8Array} uint8Array\n * @return {RelativePosition}\n */\nexport const decodeRelativePosition = uint8Array => readRelativePosition(decoding.createDecoder(uint8Array))\n\n/**\n * Transform a relative position to an absolute position.\n *\n * If you want to share the relative position with other users, you should set\n * `followUndoneDeletions` to false to get consistent results across all clients.\n *\n * When calculating the absolute position, we try to follow the \"undone deletions\". This yields\n * better results for the user who performed undo. However, only the user who performed the undo\n * will get the better results, the other users don't know which operations recreated a deleted\n * range of content. There is more information in this ticket: https://github.com/yjs/yjs/issues/638\n *\n * @param {RelativePosition} rpos\n * @param {Doc} doc\n * @param {boolean} followUndoneDeletions - whether to follow undone deletions - see https://github.com/yjs/yjs/issues/638\n * @return {AbsolutePosition|null}\n *\n * @function\n */\nexport const createAbsolutePositionFromRelativePosition = (rpos, doc, followUndoneDeletions = true) => {\n const store = doc.store\n const rightID = rpos.item\n const typeID = rpos.type\n const tname = rpos.tname\n const assoc = rpos.assoc\n let type = null\n let index = 0\n if (rightID !== null) {\n if (getState(store, rightID.client) <= rightID.clock) {\n return null\n }\n const res = followUndoneDeletions ? followRedone(store, rightID) : { item: getItem(store, rightID), diff: 0 }\n const right = res.item\n if (!(right instanceof Item)) {\n return null\n }\n type = /** @type {AbstractType} */ (right.parent)\n if (type._item === null || !type._item.deleted) {\n index = (right.deleted || !right.countable) ? 0 : (res.diff + (assoc >= 0 ? 0 : 1)) // adjust position based on left association if necessary\n let n = right.left\n while (n !== null) {\n if (!n.deleted && n.countable) {\n index += n.length\n }\n n = n.left\n }\n }\n } else {\n if (tname !== null) {\n type = doc.get(tname)\n } else if (typeID !== null) {\n if (getState(store, typeID.client) <= typeID.clock) {\n // type does not exist yet\n return null\n }\n const { item } = followUndoneDeletions ? followRedone(store, typeID) : { item: getItem(store, typeID) }\n if (item instanceof Item && item.content instanceof ContentType) {\n type = item.content.type\n } else {\n // struct is garbage collected\n return null\n }\n } else {\n throw error.unexpectedCase()\n }\n if (assoc >= 0) {\n index = type._length\n } else {\n index = 0\n }\n }\n return createAbsolutePosition(type, index, rpos.assoc)\n}\n\n/**\n * @param {RelativePosition|null} a\n * @param {RelativePosition|null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareRelativePositions = (a, b) => a === b || (\n a !== null && b !== null && a.tname === b.tname && compareIDs(a.item, b.item) && compareIDs(a.type, b.type) && a.assoc === b.assoc\n)\n", "import {\n isDeleted,\n createDeleteSetFromStructStore,\n getStateVector,\n getItemCleanStart,\n iterateDeletedStructs,\n writeDeleteSet,\n writeStateVector,\n readDeleteSet,\n readStateVector,\n createDeleteSet,\n createID,\n getState,\n findIndexSS,\n UpdateEncoderV2,\n applyUpdateV2,\n LazyStructReader,\n equalDeleteSets,\n UpdateDecoderV1, UpdateDecoderV2, DSEncoderV1, DSEncoderV2, DSDecoderV1, DSDecoderV2, Transaction, Doc, DeleteSet, Item, // eslint-disable-line\n mergeDeleteSets\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as set from 'lib0/set'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\n\nexport class Snapshot {\n /**\n * @param {DeleteSet} ds\n * @param {Map} sv state map\n */\n constructor (ds, sv) {\n /**\n * @type {DeleteSet}\n */\n this.ds = ds\n /**\n * State Map\n * @type {Map}\n */\n this.sv = sv\n }\n}\n\n/**\n * @param {Snapshot} snap1\n * @param {Snapshot} snap2\n * @return {boolean}\n */\nexport const equalSnapshots = (snap1, snap2) => {\n const ds1 = snap1.ds.clients\n const ds2 = snap2.ds.clients\n const sv1 = snap1.sv\n const sv2 = snap2.sv\n if (sv1.size !== sv2.size || ds1.size !== ds2.size) {\n return false\n }\n for (const [key, value] of sv1.entries()) {\n if (sv2.get(key) !== value) {\n return false\n }\n }\n for (const [client, dsitems1] of ds1.entries()) {\n const dsitems2 = ds2.get(client) || []\n if (dsitems1.length !== dsitems2.length) {\n return false\n }\n for (let i = 0; i < dsitems1.length; i++) {\n const dsitem1 = dsitems1[i]\n const dsitem2 = dsitems2[i]\n if (dsitem1.clock !== dsitem2.clock || dsitem1.len !== dsitem2.len) {\n return false\n }\n }\n }\n return true\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n */\nexport const encodeSnapshotV2 = (snapshot, encoder = new DSEncoderV2()) => {\n writeDeleteSet(encoder, snapshot.ds)\n writeStateVector(encoder, snapshot.sv)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Snapshot} snapshot\n * @return {Uint8Array}\n */\nexport const encodeSnapshot = snapshot => encodeSnapshotV2(snapshot, new DSEncoderV1())\n\n/**\n * @param {Uint8Array} buf\n * @param {DSDecoderV1 | DSDecoderV2} [decoder]\n * @return {Snapshot}\n */\nexport const decodeSnapshotV2 = (buf, decoder = new DSDecoderV2(decoding.createDecoder(buf))) => {\n return new Snapshot(readDeleteSet(decoder), readStateVector(decoder))\n}\n\n/**\n * @param {Uint8Array} buf\n * @return {Snapshot}\n */\nexport const decodeSnapshot = buf => decodeSnapshotV2(buf, new DSDecoderV1(decoding.createDecoder(buf)))\n\n/**\n * @param {DeleteSet} ds\n * @param {Map} sm\n * @return {Snapshot}\n */\nexport const createSnapshot = (ds, sm) => new Snapshot(ds, sm)\n\nexport const emptySnapshot = createSnapshot(createDeleteSet(), new Map())\n\n/**\n * @param {Doc} doc\n * @return {Snapshot}\n */\nexport const snapshot = doc => createSnapshot(createDeleteSetFromStructStore(doc.store), getStateVector(doc.store))\n\n/**\n * @param {Item} item\n * @param {Snapshot|undefined} snapshot\n *\n * @protected\n * @function\n */\nexport const isVisible = (item, snapshot) => snapshot === undefined\n ? !item.deleted\n : snapshot.sv.has(item.id.client) && (snapshot.sv.get(item.id.client) || 0) > item.id.clock && !isDeleted(snapshot.ds, item.id)\n\n/**\n * @param {Transaction} transaction\n * @param {Snapshot} snapshot\n */\nexport const splitSnapshotAffectedStructs = (transaction, snapshot) => {\n const meta = map.setIfUndefined(transaction.meta, splitSnapshotAffectedStructs, set.create)\n const store = transaction.doc.store\n // check if we already split for this snapshot\n if (!meta.has(snapshot)) {\n snapshot.sv.forEach((clock, client) => {\n if (clock < getState(store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n })\n iterateDeletedStructs(transaction, snapshot.ds, _item => {})\n meta.add(snapshot)\n }\n}\n\n/**\n * @example\n * const ydoc = new Y.Doc({ gc: false })\n * ydoc.getText().insert(0, 'world!')\n * const snapshot = Y.snapshot(ydoc)\n * ydoc.getText().insert(0, 'hello ')\n * const restored = Y.createDocFromSnapshot(ydoc, snapshot)\n * assert(restored.getText().toString() === 'world!')\n *\n * @param {Doc} originDoc\n * @param {Snapshot} snapshot\n * @param {Doc} [newDoc] Optionally, you may define the Yjs document that receives the data from originDoc\n * @return {Doc}\n */\nexport const createDocFromSnapshot = (originDoc, snapshot, newDoc = new Doc()) => {\n if (originDoc.gc) {\n // we should not try to restore a GC-ed document, because some of the restored items might have their content deleted\n throw new Error('Garbage-collection must be disabled in `originDoc`!')\n }\n const { sv, ds } = snapshot\n\n const encoder = new UpdateEncoderV2()\n originDoc.transact(transaction => {\n let size = 0\n sv.forEach(clock => {\n if (clock > 0) {\n size++\n }\n })\n encoding.writeVarUint(encoder.restEncoder, size)\n // splitting the structs before writing them to the encoder\n for (const [client, clock] of sv) {\n if (clock === 0) {\n continue\n }\n if (clock < getState(originDoc.store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n const structs = originDoc.store.clients.get(client) || []\n const lastStructIndex = findIndexSS(structs, clock - 1)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, lastStructIndex + 1)\n encoder.writeClient(client)\n // first clock written is 0\n encoding.writeVarUint(encoder.restEncoder, 0)\n for (let i = 0; i <= lastStructIndex; i++) {\n structs[i].write(encoder, 0)\n }\n }\n writeDeleteSet(encoder, ds)\n })\n\n applyUpdateV2(newDoc, encoder.toUint8Array(), 'snapshot')\n return newDoc\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n */\nexport const snapshotContainsUpdateV2 = (snapshot, update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n if ((snapshot.sv.get(curr.id.client) || 0) < curr.id.clock + curr.length) {\n return false\n }\n }\n const mergedDS = mergeDeleteSets([snapshot.ds, readDeleteSet(updateDecoder)])\n return equalDeleteSets(snapshot.ds, mergedDS)\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n */\nexport const snapshotContainsUpdate = (snapshot, update) => snapshotContainsUpdateV2(snapshot, update, UpdateDecoderV1)\n", "import {\n GC,\n splitItem,\n Transaction, ID, Item, DSDecoderV2 // eslint-disable-line\n} from '../internals.js'\n\nimport * as math from 'lib0/math'\nimport * as error from 'lib0/error'\n\nexport class StructStore {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n /**\n * @type {null | { missing: Map, update: Uint8Array }}\n */\n this.pendingStructs = null\n /**\n * @type {null | Uint8Array}\n */\n this.pendingDs = null\n }\n}\n\n/**\n * Return the states as a Map.\n * Note that clock refers to the next expected clock id.\n *\n * @param {StructStore} store\n * @return {Map}\n *\n * @public\n * @function\n */\nexport const getStateVector = store => {\n const sm = new Map()\n store.clients.forEach((structs, client) => {\n const struct = structs[structs.length - 1]\n sm.set(client, struct.id.clock + struct.length)\n })\n return sm\n}\n\n/**\n * @param {StructStore} store\n * @param {number} client\n * @return {number}\n *\n * @public\n * @function\n */\nexport const getState = (store, client) => {\n const structs = store.clients.get(client)\n if (structs === undefined) {\n return 0\n }\n const lastStruct = structs[structs.length - 1]\n return lastStruct.id.clock + lastStruct.length\n}\n\n/**\n * @param {StructStore} store\n *\n * @private\n * @function\n */\nexport const integretyCheck = store => {\n store.clients.forEach(structs => {\n for (let i = 1; i < structs.length; i++) {\n const l = structs[i - 1]\n const r = structs[i]\n if (l.id.clock + l.length !== r.id.clock) {\n throw new Error('StructStore failed integrety check')\n }\n }\n })\n}\n\n/**\n * @param {StructStore} store\n * @param {GC|Item} struct\n *\n * @private\n * @function\n */\nexport const addStruct = (store, struct) => {\n let structs = store.clients.get(struct.id.client)\n if (structs === undefined) {\n structs = []\n store.clients.set(struct.id.client, structs)\n } else {\n const lastStruct = structs[structs.length - 1]\n if (lastStruct.id.clock + lastStruct.length !== struct.id.clock) {\n throw error.unexpectedCase()\n }\n }\n structs.push(struct)\n}\n\n/**\n * Perform a binary search on a sorted array\n * @param {Array} structs\n * @param {number} clock\n * @return {number}\n *\n * @private\n * @function\n */\nexport const findIndexSS = (structs, clock) => {\n let left = 0\n let right = structs.length - 1\n let mid = structs[right]\n let midclock = mid.id.clock\n if (midclock === clock) {\n return right\n }\n // @todo does it even make sense to pivot the search?\n // If a good split misses, it might actually increase the time to find the correct item.\n // Currently, the only advantage is that search with pivoting might find the item on the first try.\n let midindex = math.floor((clock / (midclock + mid.length - 1)) * right) // pivoting the search\n while (left <= right) {\n mid = structs[midindex]\n midclock = mid.id.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.length) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n midindex = math.floor((left + right) / 2)\n }\n // Always check state before looking for a struct in StructStore\n // Therefore the case of not finding a struct is unexpected\n throw error.unexpectedCase()\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {GC|Item}\n *\n * @private\n * @function\n */\nexport const find = (store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n return structs[findIndexSS(structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n * @private\n * @function\n */\nexport const getItem = /** @type {function(StructStore,ID):Item} */ (find)\n\n/**\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clock\n */\nexport const findIndexCleanStart = (transaction, structs, clock) => {\n const index = findIndexSS(structs, clock)\n const struct = structs[index]\n if (struct.id.clock < clock && struct instanceof Item) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n return index + 1\n }\n return index\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanStart = (transaction, id) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(id.client))\n return structs[findIndexCleanStart(transaction, structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanEnd = (transaction, store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n const index = findIndexSS(structs, id.clock)\n const struct = structs[index]\n if (id.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, id.clock - struct.id.clock + 1))\n }\n return struct\n}\n\n/**\n * Replace `item` with `newitem` in store\n * @param {StructStore} store\n * @param {GC|Item} struct\n * @param {GC|Item} newStruct\n *\n * @private\n * @function\n */\nexport const replaceStruct = (store, struct, newStruct) => {\n const structs = /** @type {Array} */ (store.clients.get(struct.id.client))\n structs[findIndexSS(structs, struct.id.clock)] = newStruct\n}\n\n/**\n * Iterate over a range of structs\n *\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clockStart Inclusive start\n * @param {number} len\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateStructs = (transaction, structs, clockStart, len, f) => {\n if (len === 0) {\n return\n }\n const clockEnd = clockStart + len\n let index = findIndexCleanStart(transaction, structs, clockStart)\n let struct\n do {\n struct = structs[index++]\n if (clockEnd < struct.id.clock + struct.length) {\n findIndexCleanStart(transaction, structs, clockEnd)\n }\n f(struct)\n } while (index < structs.length && structs[index].id.clock < clockEnd)\n}\n", "import {\n getState,\n writeStructsFromTransaction,\n writeDeleteSet,\n DeleteSet,\n sortAndMergeDeleteSet,\n getStateVector,\n findIndexSS,\n callEventHandlerListeners,\n Item,\n generateNewClientId,\n createID,\n cleanupYTextAfterTransaction,\n UpdateEncoderV1, UpdateEncoderV2, GC, StructStore, AbstractType, AbstractStruct, YEvent, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as set from 'lib0/set'\nimport * as logging from 'lib0/logging'\nimport { callAll } from 'lib0/function'\n\n/**\n * A transaction is created for every change on the Yjs model. It is possible\n * to bundle changes on the Yjs model in a single transaction to\n * minimize the number on messages sent and the number of observer calls.\n * If possible the user of this library should bundle as many changes as\n * possible. Here is an example to illustrate the advantages of bundling:\n *\n * @example\n * const ydoc = new Y.Doc()\n * const map = ydoc.getMap('map')\n * // Log content when change is triggered\n * map.observe(() => {\n * console.log('change triggered')\n * })\n * // Each change on the map type triggers a log message:\n * map.set('a', 0) // => \"change triggered\"\n * map.set('b', 0) // => \"change triggered\"\n * // When put in a transaction, it will trigger the log after the transaction:\n * ydoc.transact(() => {\n * map.set('a', 1)\n * map.set('b', 1)\n * }) // => \"change triggered\"\n *\n * @public\n */\nexport class Transaction {\n /**\n * @param {Doc} doc\n * @param {any} origin\n * @param {boolean} local\n */\n constructor (doc, origin, local) {\n /**\n * The Yjs instance.\n * @type {Doc}\n */\n this.doc = doc\n /**\n * Describes the set of deleted items by ids\n * @type {DeleteSet}\n */\n this.deleteSet = new DeleteSet()\n /**\n * Holds the state before the transaction started.\n * @type {Map}\n */\n this.beforeState = getStateVector(doc.store)\n /**\n * Holds the state after the transaction.\n * @type {Map}\n */\n this.afterState = new Map()\n /**\n * All types that were directly modified (property added or child\n * inserted/deleted). New types are not included in this Set.\n * Maps from type to parentSubs (`item.parentSub = null` for YArray)\n * @type {Map>,Set>}\n */\n this.changed = new Map()\n /**\n * Stores the events for the types that observe also child elements.\n * It is mainly used by `observeDeep`.\n * @type {Map>,Array>>}\n */\n this.changedParentTypes = new Map()\n /**\n * @type {Array}\n */\n this._mergeStructs = []\n /**\n * @type {any}\n */\n this.origin = origin\n /**\n * Stores meta information on the transaction\n * @type {Map}\n */\n this.meta = new Map()\n /**\n * Whether this change originates from this doc.\n * @type {boolean}\n */\n this.local = local\n /**\n * @type {Set}\n */\n this.subdocsAdded = new Set()\n /**\n * @type {Set}\n */\n this.subdocsRemoved = new Set()\n /**\n * @type {Set}\n */\n this.subdocsLoaded = new Set()\n /**\n * @type {boolean}\n */\n this._needFormattingCleanup = false\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n * @return {boolean} Whether data was written.\n */\nexport const writeUpdateMessageFromTransaction = (encoder, transaction) => {\n if (transaction.deleteSet.clients.size === 0 && !map.any(transaction.afterState, (clock, client) => transaction.beforeState.get(client) !== clock)) {\n return false\n }\n sortAndMergeDeleteSet(transaction.deleteSet)\n writeStructsFromTransaction(encoder, transaction)\n writeDeleteSet(encoder, transaction.deleteSet)\n return true\n}\n\n/**\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const nextID = transaction => {\n const y = transaction.doc\n return createID(y.clientID, getState(y.store, y.clientID))\n}\n\n/**\n * If `type.parent` was added in current transaction, `type` technically\n * did not change, it was just added and we should not fire events for `type`.\n *\n * @param {Transaction} transaction\n * @param {AbstractType>} type\n * @param {string|null} parentSub\n */\nexport const addChangedTypeToTransaction = (transaction, type, parentSub) => {\n const item = type._item\n if (item === null || (item.id.clock < (transaction.beforeState.get(item.id.client) || 0) && !item.deleted)) {\n map.setIfUndefined(transaction.changed, type, set.create).add(parentSub)\n }\n}\n\n/**\n * @param {Array} structs\n * @param {number} pos\n * @return {number} # of merged structs\n */\nconst tryToMergeWithLefts = (structs, pos) => {\n let right = structs[pos]\n let left = structs[pos - 1]\n let i = pos\n for (; i > 0; right = left, left = structs[--i - 1]) {\n if (left.deleted === right.deleted && left.constructor === right.constructor) {\n if (left.mergeWith(right)) {\n if (right instanceof Item && right.parentSub !== null && /** @type {AbstractType} */ (right.parent)._map.get(right.parentSub) === right) {\n /** @type {AbstractType} */ (right.parent)._map.set(right.parentSub, /** @type {Item} */ (left))\n }\n continue\n }\n }\n break\n }\n const merged = pos - i\n if (merged) {\n // remove all merged structs from the array\n structs.splice(pos + 1 - merged, merged)\n }\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nconst tryGcDeleteSet = (ds, store, gcFilter) => {\n for (const [client, deleteItems] of ds.clients.entries()) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n const endDeleteItemClock = deleteItem.clock + deleteItem.len\n for (\n let si = findIndexSS(structs, deleteItem.clock), struct = structs[si];\n si < structs.length && struct.id.clock < endDeleteItemClock;\n struct = structs[++si]\n ) {\n const struct = structs[si]\n if (deleteItem.clock + deleteItem.len <= struct.id.clock) {\n break\n }\n if (struct instanceof Item && struct.deleted && !struct.keep && gcFilter(struct)) {\n struct.gc(store, false)\n }\n }\n }\n }\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n */\nconst tryMergeDeleteSet = (ds, store) => {\n // try to merge deleted / gc'd items\n // merge from right to left for better efficiency and so we don't miss any merge targets\n ds.clients.forEach((deleteItems, client) => {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n // start with merging the item next to the last deleted item\n const mostRightIndexToCheck = math.min(structs.length - 1, 1 + findIndexSS(structs, deleteItem.clock + deleteItem.len - 1))\n for (\n let si = mostRightIndexToCheck, struct = structs[si];\n si > 0 && struct.id.clock >= deleteItem.clock;\n struct = structs[si]\n ) {\n si -= 1 + tryToMergeWithLefts(structs, si)\n }\n }\n })\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nexport const tryGc = (ds, store, gcFilter) => {\n tryGcDeleteSet(ds, store, gcFilter)\n tryMergeDeleteSet(ds, store)\n}\n\n/**\n * @param {Array} transactionCleanups\n * @param {number} i\n */\nconst cleanupTransactions = (transactionCleanups, i) => {\n if (i < transactionCleanups.length) {\n const transaction = transactionCleanups[i]\n const doc = transaction.doc\n const store = doc.store\n const ds = transaction.deleteSet\n const mergeStructs = transaction._mergeStructs\n try {\n sortAndMergeDeleteSet(ds)\n transaction.afterState = getStateVector(transaction.doc.store)\n doc.emit('beforeObserverCalls', [transaction, doc])\n /**\n * An array of event callbacks.\n *\n * Each callback is called even if the other ones throw errors.\n *\n * @type {Array}\n */\n const fs = []\n // observe events on changed types\n transaction.changed.forEach((subs, itemtype) =>\n fs.push(() => {\n if (itemtype._item === null || !itemtype._item.deleted) {\n itemtype._callObserver(transaction, subs)\n }\n })\n )\n fs.push(() => {\n // deep observe events\n transaction.changedParentTypes.forEach((events, type) => {\n // We need to think about the possibility that the user transforms the\n // Y.Doc in the event.\n if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) {\n events = events\n .filter(event =>\n event.target._item === null || !event.target._item.deleted\n )\n events\n .forEach(event => {\n event.currentTarget = type\n // path is relative to the current target\n event._path = null\n })\n // sort events by path length so that top-level events are fired first.\n events\n .sort((event1, event2) => event1.path.length - event2.path.length)\n // We don't need to check for events.length\n // because we know it has at least one element\n callEventHandlerListeners(type._dEH, events, transaction)\n }\n })\n })\n fs.push(() => doc.emit('afterTransaction', [transaction, doc]))\n callAll(fs, [])\n if (transaction._needFormattingCleanup) {\n cleanupYTextAfterTransaction(transaction)\n }\n } finally {\n // Replace deleted items with ItemDeleted / GC.\n // This is where content is actually remove from the Yjs Doc.\n if (doc.gc) {\n tryGcDeleteSet(ds, store, doc.gcFilter)\n }\n tryMergeDeleteSet(ds, store)\n\n // on all affected store.clients props, try to merge\n transaction.afterState.forEach((clock, client) => {\n const beforeClock = transaction.beforeState.get(client) || 0\n if (beforeClock !== clock) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n // we iterate from right to left so we can safely remove entries\n const firstChangePos = math.max(findIndexSS(structs, beforeClock), 1)\n for (let i = structs.length - 1; i >= firstChangePos;) {\n i -= 1 + tryToMergeWithLefts(structs, i)\n }\n }\n })\n // try to merge mergeStructs\n // @todo: it makes more sense to transform mergeStructs to a DS, sort it, and merge from right to left\n // but at the moment DS does not handle duplicates\n for (let i = mergeStructs.length - 1; i >= 0; i--) {\n const { client, clock } = mergeStructs[i].id\n const structs = /** @type {Array} */ (store.clients.get(client))\n const replacedStructPos = findIndexSS(structs, clock)\n if (replacedStructPos + 1 < structs.length) {\n if (tryToMergeWithLefts(structs, replacedStructPos + 1) > 1) {\n continue // no need to perform next check, both are already merged\n }\n }\n if (replacedStructPos > 0) {\n tryToMergeWithLefts(structs, replacedStructPos)\n }\n }\n if (!transaction.local && transaction.afterState.get(doc.clientID) !== transaction.beforeState.get(doc.clientID)) {\n logging.print(logging.ORANGE, logging.BOLD, '[yjs] ', logging.UNBOLD, logging.RED, 'Changed the client-id because another client seems to be using it.')\n doc.clientID = generateNewClientId()\n }\n // @todo Merge all the transactions into one and provide send the data as a single update message\n doc.emit('afterTransactionCleanup', [transaction, doc])\n if (doc._observers.has('update')) {\n const encoder = new UpdateEncoderV1()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('update', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n if (doc._observers.has('updateV2')) {\n const encoder = new UpdateEncoderV2()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('updateV2', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction\n if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) {\n subdocsAdded.forEach(subdoc => {\n subdoc.clientID = doc.clientID\n if (subdoc.collectionid == null) {\n subdoc.collectionid = doc.collectionid\n }\n doc.subdocs.add(subdoc)\n })\n subdocsRemoved.forEach(subdoc => doc.subdocs.delete(subdoc))\n doc.emit('subdocs', [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc, transaction])\n subdocsRemoved.forEach(subdoc => subdoc.destroy())\n }\n\n if (transactionCleanups.length <= i + 1) {\n doc._transactionCleanups = []\n doc.emit('afterAllTransactions', [doc, transactionCleanups])\n } else {\n cleanupTransactions(transactionCleanups, i + 1)\n }\n }\n }\n}\n\n/**\n * Implements the functionality of `y.transact(()=>{..})`\n *\n * @template T\n * @param {Doc} doc\n * @param {function(Transaction):T} f\n * @param {any} [origin=true]\n * @return {T}\n *\n * @function\n */\nexport const transact = (doc, f, origin = null, local = true) => {\n const transactionCleanups = doc._transactionCleanups\n let initialCall = false\n /**\n * @type {any}\n */\n let result = null\n if (doc._transaction === null) {\n initialCall = true\n doc._transaction = new Transaction(doc, origin, local)\n transactionCleanups.push(doc._transaction)\n if (transactionCleanups.length === 1) {\n doc.emit('beforeAllTransactions', [doc])\n }\n doc.emit('beforeTransaction', [doc._transaction, doc])\n }\n try {\n result = f(doc._transaction)\n } finally {\n if (initialCall) {\n const finishCleanup = doc._transaction === transactionCleanups[0]\n doc._transaction = null\n if (finishCleanup) {\n // The first transaction ended, now process observer calls.\n // Observer call may create new transactions for which we need to call the observers and do cleanup.\n // We don't want to nest these calls, so we execute these calls one after\n // another.\n // Also we need to ensure that all cleanups are called, even if the\n // observes throw errors.\n // This file is full of hacky try {} finally {} blocks to ensure that an\n // event can throw errors and also that the cleanup is called.\n cleanupTransactions(transactionCleanups, 0)\n }\n }\n }\n return result\n}\n", "import {\n mergeDeleteSets,\n iterateDeletedStructs,\n keepItem,\n transact,\n createID,\n redoItem,\n isParentOf,\n followRedone,\n getItemCleanStart,\n isDeleted,\n addToDeleteSet,\n YEvent, Transaction, Doc, Item, GC, DeleteSet, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as time from 'lib0/time'\nimport * as array from 'lib0/array'\nimport * as logging from 'lib0/logging'\nimport { ObservableV2 } from 'lib0/observable'\n\nexport class StackItem {\n /**\n * @param {DeleteSet} deletions\n * @param {DeleteSet} insertions\n */\n constructor (deletions, insertions) {\n this.insertions = insertions\n this.deletions = deletions\n /**\n * Use this to save and restore metadata like selection range\n */\n this.meta = new Map()\n }\n}\n/**\n * @param {Transaction} tr\n * @param {UndoManager} um\n * @param {StackItem} stackItem\n */\nconst clearUndoManagerStackItem = (tr, um, stackItem) => {\n iterateDeletedStructs(tr, stackItem.deletions, item => {\n if (item instanceof Item && um.scope.some(type => isParentOf(type, item))) {\n keepItem(item, false)\n }\n })\n}\n\n/**\n * @param {UndoManager} undoManager\n * @param {Array} stack\n * @param {'undo'|'redo'} eventType\n * @return {StackItem?}\n */\nconst popStackItem = (undoManager, stack, eventType) => {\n /**\n * Keep a reference to the transaction so we can fire the event with the changedParentTypes\n * @type {any}\n */\n let _tr = null\n const doc = undoManager.doc\n const scope = undoManager.scope\n transact(doc, transaction => {\n while (stack.length > 0 && undoManager.currStackItem === null) {\n const store = doc.store\n const stackItem = /** @type {StackItem} */ (stack.pop())\n /**\n * @type {Set}\n */\n const itemsToRedo = new Set()\n /**\n * @type {Array}\n */\n const itemsToDelete = []\n let performedChange = false\n iterateDeletedStructs(transaction, stackItem.insertions, struct => {\n if (struct instanceof Item) {\n if (struct.redone !== null) {\n let { item, diff } = followRedone(store, struct.id)\n if (diff > 0) {\n item = getItemCleanStart(transaction, createID(item.id.client, item.id.clock + diff))\n }\n struct = item\n }\n if (!struct.deleted && scope.some(type => isParentOf(type, /** @type {Item} */ (struct)))) {\n itemsToDelete.push(struct)\n }\n }\n })\n iterateDeletedStructs(transaction, stackItem.deletions, struct => {\n if (\n struct instanceof Item &&\n scope.some(type => isParentOf(type, struct)) &&\n // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval.\n !isDeleted(stackItem.insertions, struct.id)\n ) {\n itemsToRedo.add(struct)\n }\n })\n itemsToRedo.forEach(struct => {\n performedChange = redoItem(transaction, struct, itemsToRedo, stackItem.insertions, undoManager.ignoreRemoteMapChanges, undoManager) !== null || performedChange\n })\n // We want to delete in reverse order so that children are deleted before\n // parents, so we have more information available when items are filtered.\n for (let i = itemsToDelete.length - 1; i >= 0; i--) {\n const item = itemsToDelete[i]\n if (undoManager.deleteFilter(item)) {\n item.delete(transaction)\n performedChange = true\n }\n }\n undoManager.currStackItem = performedChange ? stackItem : null\n }\n transaction.changed.forEach((subProps, type) => {\n // destroy search marker if necessary\n if (subProps.has(null) && type._searchMarker) {\n type._searchMarker.length = 0\n }\n })\n _tr = transaction\n }, undoManager)\n const res = undoManager.currStackItem\n if (res != null) {\n const changedParentTypes = _tr.changedParentTypes\n undoManager.emit('stack-item-popped', [{ stackItem: res, type: eventType, changedParentTypes, origin: undoManager }, undoManager])\n undoManager.currStackItem = null\n }\n return res\n}\n\n/**\n * @typedef {Object} UndoManagerOptions\n * @property {number} [UndoManagerOptions.captureTimeout=500]\n * @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.\n * @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes\n * it is necessary to filter what an Undo/Redo operation can delete. If this\n * filter returns false, the type/item won't be deleted even it is in the\n * undo/redo scope.\n * @property {Set} [UndoManagerOptions.trackedOrigins=new Set([null])]\n * @property {boolean} [ignoreRemoteMapChanges] Experimental. By default, the UndoManager will never overwrite remote changes. Enable this property to enable overwriting remote changes on key-value changes (Y.Map, properties on Y.Xml, etc..).\n * @property {Doc} [doc] The document that this UndoManager operates on. Only needed if typeScope is empty.\n */\n\n/**\n * @typedef {Object} StackItemEvent\n * @property {StackItem} StackItemEvent.stackItem\n * @property {any} StackItemEvent.origin\n * @property {'undo'|'redo'} StackItemEvent.type\n * @property {Map>,Array>>} StackItemEvent.changedParentTypes\n */\n\n/**\n * Fires 'stack-item-added' event when a stack item was added to either the undo- or\n * the redo-stack. You may store additional stack information via the\n * metadata property on `event.stackItem.meta` (it is a `Map` of metadata properties).\n * Fires 'stack-item-popped' event when a stack item was popped from either the\n * undo- or the redo-stack. You may restore the saved stack information from `event.stackItem.meta`.\n *\n * @extends {ObservableV2<{'stack-item-added':function(StackItemEvent, UndoManager):void, 'stack-item-popped': function(StackItemEvent, UndoManager):void, 'stack-cleared': function({ undoStackCleared: boolean, redoStackCleared: boolean }):void, 'stack-item-updated': function(StackItemEvent, UndoManager):void }>}\n */\nexport class UndoManager extends ObservableV2 {\n /**\n * @param {AbstractType|Array>} typeScope Accepts either a single type, or an array of types\n * @param {UndoManagerOptions} options\n */\n constructor (typeScope, {\n captureTimeout = 500,\n captureTransaction = _tr => true,\n deleteFilter = () => true,\n trackedOrigins = new Set([null]),\n ignoreRemoteMapChanges = false,\n doc = /** @type {Doc} */ (array.isArray(typeScope) ? typeScope[0].doc : typeScope.doc)\n } = {}) {\n super()\n /**\n * @type {Array>}\n */\n this.scope = []\n this.doc = doc\n this.addToScope(typeScope)\n this.deleteFilter = deleteFilter\n trackedOrigins.add(this)\n this.trackedOrigins = trackedOrigins\n this.captureTransaction = captureTransaction\n /**\n * @type {Array}\n */\n this.undoStack = []\n /**\n * @type {Array}\n */\n this.redoStack = []\n /**\n * Whether the client is currently undoing (calling UndoManager.undo)\n *\n * @type {boolean}\n */\n this.undoing = false\n this.redoing = false\n /**\n * The currently popped stack item if UndoManager.undoing or UndoManager.redoing\n *\n * @type {StackItem|null}\n */\n this.currStackItem = null\n this.lastChange = 0\n this.ignoreRemoteMapChanges = ignoreRemoteMapChanges\n this.captureTimeout = captureTimeout\n /**\n * @param {Transaction} transaction\n */\n this.afterTransactionHandler = transaction => {\n // Only track certain transactions\n if (\n !this.captureTransaction(transaction) ||\n !this.scope.some(type => transaction.changedParentTypes.has(type)) ||\n (!this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor)))\n ) {\n return\n }\n const undoing = this.undoing\n const redoing = this.redoing\n const stack = undoing ? this.redoStack : this.undoStack\n if (undoing) {\n this.stopCapturing() // next undo should not be appended to last stack item\n } else if (!redoing) {\n // neither undoing nor redoing: delete redoStack\n this.clear(false, true)\n }\n const insertions = new DeleteSet()\n transaction.afterState.forEach((endClock, client) => {\n const startClock = transaction.beforeState.get(client) || 0\n const len = endClock - startClock\n if (len > 0) {\n addToDeleteSet(insertions, client, startClock, len)\n }\n })\n const now = time.getUnixTime()\n let didAdd = false\n if (this.lastChange > 0 && now - this.lastChange < this.captureTimeout && stack.length > 0 && !undoing && !redoing) {\n // append change to last stack op\n const lastOp = stack[stack.length - 1]\n lastOp.deletions = mergeDeleteSets([lastOp.deletions, transaction.deleteSet])\n lastOp.insertions = mergeDeleteSets([lastOp.insertions, insertions])\n } else {\n // create a new stack op\n stack.push(new StackItem(transaction.deleteSet, insertions))\n didAdd = true\n }\n if (!undoing && !redoing) {\n this.lastChange = now\n }\n // make sure that deleted structs are not gc'd\n iterateDeletedStructs(transaction, transaction.deleteSet, /** @param {Item|GC} item */ item => {\n if (item instanceof Item && this.scope.some(type => isParentOf(type, item))) {\n keepItem(item, true)\n }\n })\n /**\n * @type {[StackItemEvent, UndoManager]}\n */\n const changeEvent = [{ stackItem: stack[stack.length - 1], origin: transaction.origin, type: undoing ? 'redo' : 'undo', changedParentTypes: transaction.changedParentTypes }, this]\n if (didAdd) {\n this.emit('stack-item-added', changeEvent)\n } else {\n this.emit('stack-item-updated', changeEvent)\n }\n }\n this.doc.on('afterTransaction', this.afterTransactionHandler)\n this.doc.on('destroy', () => {\n this.destroy()\n })\n }\n\n /**\n * @param {Array> | AbstractType} ytypes\n */\n addToScope (ytypes) {\n ytypes = array.isArray(ytypes) ? ytypes : [ytypes]\n ytypes.forEach(ytype => {\n if (this.scope.every(yt => yt !== ytype)) {\n if (ytype.doc !== this.doc) logging.warn('[yjs#509] Not same Y.Doc') // use MultiDocUndoManager instead. also see https://github.com/yjs/yjs/issues/509\n this.scope.push(ytype)\n }\n })\n }\n\n /**\n * @param {any} origin\n */\n addTrackedOrigin (origin) {\n this.trackedOrigins.add(origin)\n }\n\n /**\n * @param {any} origin\n */\n removeTrackedOrigin (origin) {\n this.trackedOrigins.delete(origin)\n }\n\n clear (clearUndoStack = true, clearRedoStack = true) {\n if ((clearUndoStack && this.canUndo()) || (clearRedoStack && this.canRedo())) {\n this.doc.transact(tr => {\n if (clearUndoStack) {\n this.undoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.undoStack = []\n }\n if (clearRedoStack) {\n this.redoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.redoStack = []\n }\n this.emit('stack-cleared', [{ undoStackCleared: clearUndoStack, redoStackCleared: clearRedoStack }])\n })\n }\n }\n\n /**\n * UndoManager merges Undo-StackItem if they are created within time-gap\n * smaller than `options.captureTimeout`. Call `um.stopCapturing()` so that the next\n * StackItem won't be merged.\n *\n *\n * @example\n * // without stopCapturing\n * ytext.insert(0, 'a')\n * ytext.insert(1, 'b')\n * um.undo()\n * ytext.toString() // => '' (note that 'ab' was removed)\n * // with stopCapturing\n * ytext.insert(0, 'a')\n * um.stopCapturing()\n * ytext.insert(0, 'b')\n * um.undo()\n * ytext.toString() // => 'a' (note that only 'b' was removed)\n *\n */\n stopCapturing () {\n this.lastChange = 0\n }\n\n /**\n * Undo last changes on type.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n undo () {\n this.undoing = true\n let res\n try {\n res = popStackItem(this, this.undoStack, 'undo')\n } finally {\n this.undoing = false\n }\n return res\n }\n\n /**\n * Redo last undo operation.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n redo () {\n this.redoing = true\n let res\n try {\n res = popStackItem(this, this.redoStack, 'redo')\n } finally {\n this.redoing = false\n }\n return res\n }\n\n /**\n * Are undo steps available?\n *\n * @return {boolean} `true` if undo is possible\n */\n canUndo () {\n return this.undoStack.length > 0\n }\n\n /**\n * Are redo steps available?\n *\n * @return {boolean} `true` if redo is possible\n */\n canRedo () {\n return this.redoStack.length > 0\n }\n\n destroy () {\n this.trackedOrigins.delete(this)\n this.doc.off('afterTransaction', this.afterTransactionHandler)\n super.destroy()\n }\n}\n", "import * as binary from 'lib0/binary'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\nimport * as f from 'lib0/function'\nimport * as logging from 'lib0/logging'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as string from 'lib0/string'\n\nimport {\n ContentAny,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentString,\n ContentType,\n createID,\n decodeStateVector,\n DSEncoderV1,\n DSEncoderV2,\n GC,\n Item,\n mergeDeleteSets,\n readDeleteSet,\n readItemContent,\n Skip,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n writeDeleteSet,\n YXmlElement,\n YXmlHook\n} from '../internals.js'\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n */\nfunction * lazyStructReaderGenerator (decoder) {\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n // @todo use switch instead of ifs\n if (info === 10) {\n const len = decoding.readVarUint(decoder.restDecoder)\n yield new Skip(createID(client, clock), len)\n clock += len\n } else if ((binary.BITS5 & info) !== 0) {\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n // @ts-ignore Force writing a string here.\n cantCopyParentInfo ? (decoder.readParentInfo() ? decoder.readString() : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n yield struct\n clock += struct.length\n } else {\n const len = decoder.readLen()\n yield new GC(createID(client, clock), len)\n clock += len\n }\n }\n }\n}\n\nexport class LazyStructReader {\n /**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {boolean} filterSkips\n */\n constructor (decoder, filterSkips) {\n this.gen = lazyStructReaderGenerator(decoder)\n /**\n * @type {null | Item | Skip | GC}\n */\n this.curr = null\n this.done = false\n this.filterSkips = filterSkips\n this.next()\n }\n\n /**\n * @return {Item | GC | Skip |null}\n */\n next () {\n // ignore \"Skip\" structs\n do {\n this.curr = this.gen.next().value || null\n } while (this.filterSkips && this.curr !== null && this.curr.constructor === Skip)\n return this.curr\n }\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const logUpdate = update => logUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const logUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n logging.print('Structs: ', structs)\n const ds = readDeleteSet(updateDecoder)\n logging.print('DeleteSet: ', ds)\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const decodeUpdate = (update) => decodeUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const decodeUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n return {\n structs,\n ds: readDeleteSet(updateDecoder)\n }\n}\n\nexport class LazyStructWriter {\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n constructor (encoder) {\n this.currClient = 0\n this.startClock = 0\n this.written = 0\n this.encoder = encoder\n /**\n * We want to write operations lazily, but also we need to know beforehand how many operations we want to write for each client.\n *\n * This kind of meta-information (#clients, #structs-per-client-written) is written to the restEncoder.\n *\n * We fragment the restEncoder and store a slice of it per-client until we know how many clients there are.\n * When we flush (toUint8Array) we write the restEncoder using the fragments and the meta-information.\n *\n * @type {Array<{ written: number, restEncoder: Uint8Array }>}\n */\n this.clientStructs = []\n }\n}\n\n/**\n * @param {Array} updates\n * @return {Uint8Array}\n */\nexport const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof DSEncoderV1 | typeof DSEncoderV2} YEncoder\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdateV2 = (update, YEncoder = DSEncoderV2, YDecoder = UpdateDecoderV2) => {\n const encoder = new YEncoder()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let size = 0\n let currClient = curr.id.client\n let stopCounting = curr.id.clock !== 0 // must start at 0\n let currClock = stopCounting ? 0 : curr.id.clock + curr.length\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n if (currClock !== 0) {\n size++\n // We found a new client\n // write what we have to the encoder\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n currClient = curr.id.client\n currClock = 0\n stopCounting = curr.id.clock !== 0\n }\n // we ignore skips\n if (curr.constructor === Skip) {\n stopCounting = true\n }\n if (!stopCounting) {\n currClock = curr.id.clock + curr.length\n }\n }\n // write what we have\n if (currClock !== 0) {\n size++\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n // prepend the size of the state vector\n const enc = encoding.createEncoder()\n encoding.writeVarUint(enc, size)\n encoding.writeBinaryEncoder(enc, encoder.restEncoder)\n encoder.restEncoder = enc\n return encoder.toUint8Array()\n } else {\n encoding.writeVarUint(encoder.restEncoder, 0)\n return encoder.toUint8Array()\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdate = update => encodeStateVectorFromUpdateV2(update, DSEncoderV1, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMetaV2 = (update, YDecoder = UpdateDecoderV2) => {\n /**\n * @type {Map}\n */\n const from = new Map()\n /**\n * @type {Map}\n */\n const to = new Map()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let currClient = curr.id.client\n let currClock = curr.id.clock\n // write the beginning to `from`\n from.set(currClient, currClock)\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n // We found a new client\n // write the end to `to`\n to.set(currClient, currClock)\n // write the beginning to `from`\n from.set(curr.id.client, curr.id.clock)\n // update currClient\n currClient = curr.id.client\n }\n currClock = curr.id.clock + curr.length\n }\n // write the end to `to`\n to.set(currClient, currClock)\n }\n return { from, to }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMeta = update => parseUpdateMetaV2(update, UpdateDecoderV1)\n\n/**\n * This method is intended to slice any kind of struct and retrieve the right part.\n * It does not handle side-effects, so it should only be used by the lazy-encoder.\n *\n * @param {Item | GC | Skip} left\n * @param {number} diff\n * @return {Item | GC}\n */\nconst sliceStruct = (left, diff) => {\n if (left.constructor === GC) {\n const { client, clock } = left.id\n return new GC(createID(client, clock + diff), left.length - diff)\n } else if (left.constructor === Skip) {\n const { client, clock } = left.id\n return new Skip(createID(client, clock + diff), left.length - diff)\n } else {\n const leftItem = /** @type {Item} */ (left)\n const { client, clock } = leftItem.id\n return new Item(\n createID(client, clock + diff),\n null,\n createID(client, clock + diff - 1),\n null,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n }\n}\n\n/**\n *\n * This function works similarly to `readUpdateV2`.\n *\n * @param {Array} updates\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n * @return {Uint8Array}\n */\nexport const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n if (updates.length === 1) {\n return updates[0]\n }\n const updateDecoders = updates.map(update => new YDecoder(decoding.createDecoder(update)))\n let lazyStructDecoders = updateDecoders.map(decoder => new LazyStructReader(decoder, true))\n\n /**\n * @todo we don't need offset because we always slice before\n * @type {null | { struct: Item | GC | Skip, offset: number }}\n */\n let currWrite = null\n\n const updateEncoder = new YEncoder()\n // write structs lazily\n const lazyStructEncoder = new LazyStructWriter(updateEncoder)\n\n // Note: We need to ensure that all lazyStructDecoders are fully consumed\n // Note: Should merge document updates whenever possible - even from different updates\n // Note: Should handle that some operations cannot be applied yet ()\n\n while (true) {\n // Write higher clients first ⇒ sort by clientID & clock and remove decoders without content\n lazyStructDecoders = lazyStructDecoders.filter(dec => dec.curr !== null)\n lazyStructDecoders.sort(\n /** @type {function(any,any):number} */ (dec1, dec2) => {\n if (dec1.curr.id.client === dec2.curr.id.client) {\n const clockDiff = dec1.curr.id.clock - dec2.curr.id.clock\n if (clockDiff === 0) {\n // @todo remove references to skip since the structDecoders must filter Skips.\n return dec1.curr.constructor === dec2.curr.constructor\n ? 0\n : dec1.curr.constructor === Skip ? 1 : -1 // we are filtering skips anyway.\n } else {\n return clockDiff\n }\n } else {\n return dec2.curr.id.client - dec1.curr.id.client\n }\n }\n )\n if (lazyStructDecoders.length === 0) {\n break\n }\n const currDecoder = lazyStructDecoders[0]\n // write from currDecoder until the next operation is from another client or if filler-struct\n // then we need to reorder the decoders and find the next operation to write\n const firstClient = /** @type {Item | GC} */ (currDecoder.curr).id.client\n\n if (currWrite !== null) {\n let curr = /** @type {Item | GC | null} */ (currDecoder.curr)\n let iterated = false\n\n // iterate until we find something that we haven't written already\n // remember: first the high client-ids are written\n while (curr !== null && curr.id.clock + curr.length <= currWrite.struct.id.clock + currWrite.struct.length && curr.id.client >= currWrite.struct.id.client) {\n curr = currDecoder.next()\n iterated = true\n }\n if (\n curr === null || // current decoder is empty\n curr.id.client !== firstClient || // check whether there is another decoder that has has updates from `firstClient`\n (iterated && curr.id.clock > currWrite.struct.id.clock + currWrite.struct.length) // the above while loop was used and we are potentially missing updates\n ) {\n continue\n }\n\n if (firstClient !== currWrite.struct.id.client) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n } else {\n if (currWrite.struct.id.clock + currWrite.struct.length < curr.id.clock) {\n // @todo write currStruct & set currStruct = Skip(clock = currStruct.id.clock + currStruct.length, length = curr.id.clock - self.clock)\n if (currWrite.struct.constructor === Skip) {\n // extend existing skip\n currWrite.struct.length = curr.id.clock + curr.length - currWrite.struct.id.clock\n } else {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n const diff = curr.id.clock - currWrite.struct.id.clock - currWrite.struct.length\n /**\n * @type {Skip}\n */\n const struct = new Skip(createID(firstClient, currWrite.struct.id.clock + currWrite.struct.length), diff)\n currWrite = { struct, offset: 0 }\n }\n } else { // if (currWrite.struct.id.clock + currWrite.struct.length >= curr.id.clock) {\n const diff = currWrite.struct.id.clock + currWrite.struct.length - curr.id.clock\n if (diff > 0) {\n if (currWrite.struct.constructor === Skip) {\n // prefer to slice Skip because the other struct might contain more information\n currWrite.struct.length -= diff\n } else {\n curr = sliceStruct(curr, diff)\n }\n }\n if (!currWrite.struct.mergeWith(/** @type {any} */ (curr))) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n }\n }\n }\n } else {\n currWrite = { struct: /** @type {Item | GC} */ (currDecoder.curr), offset: 0 }\n currDecoder.next()\n }\n for (\n let next = currDecoder.curr;\n next !== null && next.id.client === firstClient && next.id.clock === currWrite.struct.id.clock + currWrite.struct.length && next.constructor !== Skip;\n next = currDecoder.next()\n ) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: next, offset: 0 }\n }\n }\n if (currWrite !== null) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = null\n }\n finishLazyStructWriting(lazyStructEncoder)\n\n const dss = updateDecoders.map(decoder => readDeleteSet(decoder))\n const ds = mergeDeleteSets(dss)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n */\nexport const diffUpdateV2 = (update, sv, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n const state = decodeStateVector(sv)\n const encoder = new YEncoder()\n const lazyStructWriter = new LazyStructWriter(encoder)\n const decoder = new YDecoder(decoding.createDecoder(update))\n const reader = new LazyStructReader(decoder, false)\n while (reader.curr) {\n const curr = reader.curr\n const currClient = curr.id.client\n const svClock = state.get(currClient) || 0\n if (reader.curr.constructor === Skip) {\n // the first written struct shouldn't be a skip\n reader.next()\n continue\n }\n if (curr.id.clock + curr.length > svClock) {\n writeStructToLazyStructWriter(lazyStructWriter, curr, math.max(svClock - curr.id.clock, 0))\n reader.next()\n while (reader.curr && reader.curr.id.client === currClient) {\n writeStructToLazyStructWriter(lazyStructWriter, reader.curr, 0)\n reader.next()\n }\n } else {\n // read until something new comes up\n while (reader.curr && reader.curr.id.client === currClient && reader.curr.id.clock + reader.curr.length <= svClock) {\n reader.next()\n }\n }\n }\n finishLazyStructWriting(lazyStructWriter)\n // write ds\n const ds = readDeleteSet(decoder)\n writeDeleteSet(encoder, ds)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n */\nexport const diffUpdate = (update, sv) => diffUpdateV2(update, sv, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {LazyStructWriter} lazyWriter\n */\nconst flushLazyStructWriter = lazyWriter => {\n if (lazyWriter.written > 0) {\n lazyWriter.clientStructs.push({ written: lazyWriter.written, restEncoder: encoding.toUint8Array(lazyWriter.encoder.restEncoder) })\n lazyWriter.encoder.restEncoder = encoding.createEncoder()\n lazyWriter.written = 0\n }\n}\n\n/**\n * @param {LazyStructWriter} lazyWriter\n * @param {Item | GC} struct\n * @param {number} offset\n */\nconst writeStructToLazyStructWriter = (lazyWriter, struct, offset) => {\n // flush curr if we start another client\n if (lazyWriter.written > 0 && lazyWriter.currClient !== struct.id.client) {\n flushLazyStructWriter(lazyWriter)\n }\n if (lazyWriter.written === 0) {\n lazyWriter.currClient = struct.id.client\n // write next client\n lazyWriter.encoder.writeClient(struct.id.client)\n // write startClock\n encoding.writeVarUint(lazyWriter.encoder.restEncoder, struct.id.clock + offset)\n }\n struct.write(lazyWriter.encoder, offset)\n lazyWriter.written++\n}\n/**\n * Call this function when we collected all parts and want to\n * put all the parts together. After calling this method,\n * you can continue using the UpdateEncoder.\n *\n * @param {LazyStructWriter} lazyWriter\n */\nconst finishLazyStructWriting = (lazyWriter) => {\n flushLazyStructWriter(lazyWriter)\n\n // this is a fresh encoder because we called flushCurr\n const restEncoder = lazyWriter.encoder.restEncoder\n\n /**\n * Now we put all the fragments together.\n * This works similarly to `writeClientsStructs`\n */\n\n // write # states that were updated - i.e. the clients\n encoding.writeVarUint(restEncoder, lazyWriter.clientStructs.length)\n\n for (let i = 0; i < lazyWriter.clientStructs.length; i++) {\n const partStructs = lazyWriter.clientStructs[i]\n /**\n * Works similarly to `writeStructs`\n */\n // write # encoded structs\n encoding.writeVarUint(restEncoder, partStructs.written)\n // write the rest of the fragment\n encoding.writeUint8Array(restEncoder, partStructs.restEncoder)\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @param {function(Item|GC|Skip):Item|GC|Skip} blockTransformer\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} YDecoder\n * @param {typeof UpdateEncoderV2 | typeof UpdateEncoderV1 } YEncoder\n */\nexport const convertUpdateFormat = (update, blockTransformer, YDecoder, YEncoder) => {\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n const updateEncoder = new YEncoder()\n const lazyWriter = new LazyStructWriter(updateEncoder)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n writeStructToLazyStructWriter(lazyWriter, blockTransformer(curr), 0)\n }\n finishLazyStructWriting(lazyWriter)\n const ds = readDeleteSet(updateDecoder)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @typedef {Object} ObfuscatorOptions\n * @property {boolean} [ObfuscatorOptions.formatting=true]\n * @property {boolean} [ObfuscatorOptions.subdocs=true]\n * @property {boolean} [ObfuscatorOptions.yxml=true] Whether to obfuscate nodeName / hookName\n */\n\n/**\n * @param {ObfuscatorOptions} obfuscator\n */\nconst createObfuscator = ({ formatting = true, subdocs = true, yxml = true } = {}) => {\n let i = 0\n const mapKeyCache = map.create()\n const nodeNameCache = map.create()\n const formattingKeyCache = map.create()\n const formattingValueCache = map.create()\n formattingValueCache.set(null, null) // end of a formatting range should always be the end of a formatting range\n /**\n * @param {Item|GC|Skip} block\n * @return {Item|GC|Skip}\n */\n return block => {\n switch (block.constructor) {\n case GC:\n case Skip:\n return block\n case Item: {\n const item = /** @type {Item} */ (block)\n const content = item.content\n switch (content.constructor) {\n case ContentDeleted:\n break\n case ContentType: {\n if (yxml) {\n const type = /** @type {ContentType} */ (content).type\n if (type instanceof YXmlElement) {\n type.nodeName = map.setIfUndefined(nodeNameCache, type.nodeName, () => 'node-' + i)\n }\n if (type instanceof YXmlHook) {\n type.hookName = map.setIfUndefined(nodeNameCache, type.hookName, () => 'hook-' + i)\n }\n }\n break\n }\n case ContentAny: {\n const c = /** @type {ContentAny} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentBinary: {\n const c = /** @type {ContentBinary} */ (content)\n c.content = new Uint8Array([i])\n break\n }\n case ContentDoc: {\n const c = /** @type {ContentDoc} */ (content)\n if (subdocs) {\n c.opts = {}\n c.doc.guid = i + ''\n }\n break\n }\n case ContentEmbed: {\n const c = /** @type {ContentEmbed} */ (content)\n c.embed = {}\n break\n }\n case ContentFormat: {\n const c = /** @type {ContentFormat} */ (content)\n if (formatting) {\n c.key = map.setIfUndefined(formattingKeyCache, c.key, () => i + '')\n c.value = map.setIfUndefined(formattingValueCache, c.value, () => ({ i }))\n }\n break\n }\n case ContentJSON: {\n const c = /** @type {ContentJSON} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentString: {\n const c = /** @type {ContentString} */ (content)\n c.str = string.repeat((i % 10) + '', c.str.length)\n break\n }\n default:\n // unknown content type\n error.unexpectedCase()\n }\n if (item.parentSub) {\n item.parentSub = map.setIfUndefined(mapKeyCache, item.parentSub, () => i + '')\n }\n i++\n return block\n }\n default:\n // unknown block-type\n error.unexpectedCase()\n }\n }\n}\n\n/**\n * This function obfuscates the content of a Yjs update. This is useful to share\n * buggy Yjs documents while significantly limiting the possibility that a\n * developer can on the user. Note that it might still be possible to deduce\n * some information by analyzing the \"structure\" of the document or by analyzing\n * the typing behavior using the CRDT-related metadata that is still kept fully\n * intact.\n *\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdate = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdateV2 = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV2, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV1ToV2 = update => convertUpdateFormat(update, f.id, UpdateDecoderV1, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV2ToV1 = update => convertUpdateFormat(update, f.id, UpdateDecoderV2, UpdateEncoderV1)\n", "import {\n isDeleted,\n Item, AbstractType, Transaction, AbstractStruct // eslint-disable-line\n} from '../internals.js'\n\nimport * as set from 'lib0/set'\nimport * as array from 'lib0/array'\nimport * as error from 'lib0/error'\n\nconst errorComputeChanges = 'You must not compute changes after the event-handler fired.'\n\n/**\n * @template {AbstractType} T\n * YEvent describes the changes on a YType.\n */\nexport class YEvent {\n /**\n * @param {T} target The changed type.\n * @param {Transaction} transaction\n */\n constructor (target, transaction) {\n /**\n * The type on which this event was created on.\n * @type {T}\n */\n this.target = target\n /**\n * The current target on which the observe callback is called.\n * @type {AbstractType}\n */\n this.currentTarget = target\n /**\n * The transaction that triggered this event.\n * @type {Transaction}\n */\n this.transaction = transaction\n /**\n * @type {Object|null}\n */\n this._changes = null\n /**\n * @type {null | Map}\n */\n this._keys = null\n /**\n * @type {null | Array<{ insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object }>}\n */\n this._delta = null\n /**\n * @type {Array|null}\n */\n this._path = null\n }\n\n /**\n * Computes the path from `y` to the changed type.\n *\n * @todo v14 should standardize on path: Array<{parent, index}> because that is easier to work with.\n *\n * The following property holds:\n * @example\n * let type = y\n * event.path.forEach(dir => {\n * type = type.get(dir)\n * })\n * type === event.target // => true\n */\n get path () {\n return this._path || (this._path = getPathTo(this.currentTarget, this.target))\n }\n\n /**\n * Check if a struct is deleted by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n deletes (struct) {\n return isDeleted(this.transaction.deleteSet, struct.id)\n }\n\n /**\n * @type {Map}\n */\n get keys () {\n if (this._keys === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const keys = new Map()\n const target = this.target\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n changed.forEach(key => {\n if (key !== null) {\n const item = /** @type {Item} */ (target._map.get(key))\n /**\n * @type {'delete' | 'add' | 'update'}\n */\n let action\n let oldValue\n if (this.adds(item)) {\n let prev = item.left\n while (prev !== null && this.adds(prev)) {\n prev = prev.left\n }\n if (this.deletes(item)) {\n if (prev !== null && this.deletes(prev)) {\n action = 'delete'\n oldValue = array.last(prev.content.getContent())\n } else {\n return\n }\n } else {\n if (prev !== null && this.deletes(prev)) {\n action = 'update'\n oldValue = array.last(prev.content.getContent())\n } else {\n action = 'add'\n oldValue = undefined\n }\n }\n } else {\n if (this.deletes(item)) {\n action = 'delete'\n oldValue = array.last(/** @type {Item} */ item.content.getContent())\n } else {\n return // nop\n }\n }\n keys.set(key, { action, oldValue })\n }\n })\n this._keys = keys\n }\n return this._keys\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {Array<{insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object}>}\n */\n get delta () {\n return this.changes.delta\n }\n\n /**\n * Check if a struct is added by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n adds (struct) {\n return struct.id.clock >= (this.transaction.beforeState.get(struct.id.client) || 0)\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n let changes = this._changes\n if (changes === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const target = this.target\n const added = set.create()\n const deleted = set.create()\n /**\n * @type {Array<{insert:Array}|{delete:number}|{retain:number}>}\n */\n const delta = []\n changes = {\n added,\n deleted,\n delta,\n keys: this.keys\n }\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n if (changed.has(null)) {\n /**\n * @type {any}\n */\n let lastOp = null\n const packOp = () => {\n if (lastOp) {\n delta.push(lastOp)\n }\n }\n for (let item = target._start; item !== null; item = item.right) {\n if (item.deleted) {\n if (this.deletes(item) && !this.adds(item)) {\n if (lastOp === null || lastOp.delete === undefined) {\n packOp()\n lastOp = { delete: 0 }\n }\n lastOp.delete += item.length\n deleted.add(item)\n } // else nop\n } else {\n if (this.adds(item)) {\n if (lastOp === null || lastOp.insert === undefined) {\n packOp()\n lastOp = { insert: [] }\n }\n lastOp.insert = lastOp.insert.concat(item.content.getContent())\n added.add(item)\n } else {\n if (lastOp === null || lastOp.retain === undefined) {\n packOp()\n lastOp = { retain: 0 }\n }\n lastOp.retain += item.length\n }\n }\n }\n if (lastOp !== null && lastOp.retain === undefined) {\n packOp()\n }\n }\n this._changes = changes\n }\n return /** @type {any} */ (changes)\n }\n}\n\n/**\n * Compute the path from this type to the specified target.\n *\n * @example\n * // `child` should be accessible via `type.get(path[0]).get(path[1])..`\n * const path = type.getPathTo(child)\n * // assuming `type instanceof YArray`\n * console.log(path) // might look like => [2, 'key1']\n * child === type.get(path[0]).get(path[1])\n *\n * @param {AbstractType} parent\n * @param {AbstractType} child target\n * @return {Array} Path to the target\n *\n * @private\n * @function\n */\nconst getPathTo = (parent, child) => {\n const path = []\n while (child._item !== null && child !== parent) {\n if (child._item.parentSub !== null) {\n // parent is map-ish\n path.unshift(child._item.parentSub)\n } else {\n // parent is array-ish\n let i = 0\n let c = /** @type {AbstractType} */ (child._item.parent)._start\n while (c !== child._item && c !== null) {\n if (!c.deleted && c.countable) {\n i += c.length\n }\n c = c.right\n }\n path.unshift(i)\n }\n child = /** @type {AbstractType} */ (child._item.parent)\n }\n return path\n}\n", "import {\n removeEventHandlerListener,\n callEventHandlerListeners,\n addEventHandlerListener,\n createEventHandler,\n getState,\n isVisible,\n ContentType,\n createID,\n ContentAny,\n ContentBinary,\n getItemCleanStart,\n ContentDoc, YText, YArray, UpdateEncoderV1, UpdateEncoderV2, Doc, Snapshot, Transaction, EventHandler, YEvent, Item, // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as iterator from 'lib0/iterator'\nimport * as error from 'lib0/error'\nimport * as math from 'lib0/math'\nimport * as log from 'lib0/logging'\n\n/**\n * https://docs.yjs.dev/getting-started/working-with-shared-types#caveats\n */\nexport const warnPrematureAccess = () => { log.warn('Invalid access: Add Yjs type to a document before reading data.') }\n\nconst maxSearchMarker = 80\n\n/**\n * A unique timestamp that identifies each marker.\n *\n * Time is relative,.. this is more like an ever-increasing clock.\n *\n * @type {number}\n */\nlet globalSearchMarkerTimestamp = 0\n\nexport class ArraySearchMarker {\n /**\n * @param {Item} p\n * @param {number} index\n */\n constructor (p, index) {\n p.marker = true\n this.p = p\n this.index = index\n this.timestamp = globalSearchMarkerTimestamp++\n }\n}\n\n/**\n * @param {ArraySearchMarker} marker\n */\nconst refreshMarkerTimestamp = marker => { marker.timestamp = globalSearchMarkerTimestamp++ }\n\n/**\n * This is rather complex so this function is the only thing that should overwrite a marker\n *\n * @param {ArraySearchMarker} marker\n * @param {Item} p\n * @param {number} index\n */\nconst overwriteMarker = (marker, p, index) => {\n marker.p.marker = false\n marker.p = p\n p.marker = true\n marker.index = index\n marker.timestamp = globalSearchMarkerTimestamp++\n}\n\n/**\n * @param {Array} searchMarker\n * @param {Item} p\n * @param {number} index\n */\nconst markPosition = (searchMarker, p, index) => {\n if (searchMarker.length >= maxSearchMarker) {\n // override oldest marker (we don't want to create more objects)\n const marker = searchMarker.reduce((a, b) => a.timestamp < b.timestamp ? a : b)\n overwriteMarker(marker, p, index)\n return marker\n } else {\n // create new marker\n const pm = new ArraySearchMarker(p, index)\n searchMarker.push(pm)\n return pm\n }\n}\n\n/**\n * Search marker help us to find positions in the associative array faster.\n *\n * They speed up the process of finding a position without much bookkeeping.\n *\n * A maximum of `maxSearchMarker` objects are created.\n *\n * This function always returns a refreshed marker (updated timestamp)\n *\n * @param {AbstractType} yarray\n * @param {number} index\n */\nexport const findMarker = (yarray, index) => {\n if (yarray._start === null || index === 0 || yarray._searchMarker === null) {\n return null\n }\n const marker = yarray._searchMarker.length === 0 ? null : yarray._searchMarker.reduce((a, b) => math.abs(index - a.index) < math.abs(index - b.index) ? a : b)\n let p = yarray._start\n let pindex = 0\n if (marker !== null) {\n p = marker.p\n pindex = marker.index\n refreshMarkerTimestamp(marker) // we used it, we might need to use it again\n }\n // iterate to right if possible\n while (p.right !== null && pindex < index) {\n if (!p.deleted && p.countable) {\n if (index < pindex + p.length) {\n break\n }\n pindex += p.length\n }\n p = p.right\n }\n // iterate to left if necessary (might be that pindex > index)\n while (p.left !== null && pindex > index) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n // we want to make sure that p can't be merged with left, because that would screw up everything\n // in that cas just return what we have (it is most likely the best marker anyway)\n // iterate to left until p can't be merged with left\n while (p.left !== null && p.left.id.client === p.id.client && p.left.id.clock + p.left.length === p.id.clock) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n\n // @todo remove!\n // assure position\n // {\n // let start = yarray._start\n // let pos = 0\n // while (start !== p) {\n // if (!start.deleted && start.countable) {\n // pos += start.length\n // }\n // start = /** @type {Item} */ (start.right)\n // }\n // if (pos !== pindex) {\n // debugger\n // throw new Error('Gotcha position fail!')\n // }\n // }\n // if (marker) {\n // if (window.lengthes == null) {\n // window.lengthes = []\n // window.getLengthes = () => window.lengthes.sort((a, b) => a - b)\n // }\n // window.lengthes.push(marker.index - pindex)\n // console.log('distance', marker.index - pindex, 'len', p && p.parent.length)\n // }\n if (marker !== null && math.abs(marker.index - pindex) < /** @type {YText|YArray} */ (p.parent).length / maxSearchMarker) {\n // adjust existing marker\n overwriteMarker(marker, p, pindex)\n return marker\n } else {\n // create new marker\n return markPosition(yarray._searchMarker, p, pindex)\n }\n}\n\n/**\n * Update markers when a change happened.\n *\n * This should be called before doing a deletion!\n *\n * @param {Array} searchMarker\n * @param {number} index\n * @param {number} len If insertion, len is positive. If deletion, len is negative.\n */\nexport const updateMarkerChanges = (searchMarker, index, len) => {\n for (let i = searchMarker.length - 1; i >= 0; i--) {\n const m = searchMarker[i]\n if (len > 0) {\n /**\n * @type {Item|null}\n */\n let p = m.p\n p.marker = false\n // Ideally we just want to do a simple position comparison, but this will only work if\n // search markers don't point to deleted items for formats.\n // Iterate marker to prev undeleted countable position so we know what to do when updating a position\n while (p && (p.deleted || !p.countable)) {\n p = p.left\n if (p && !p.deleted && p.countable) {\n // adjust position. the loop should break now\n m.index -= p.length\n }\n }\n if (p === null || p.marker === true) {\n // remove search marker if updated position is null or if position is already marked\n searchMarker.splice(i, 1)\n continue\n }\n m.p = p\n p.marker = true\n }\n if (index < m.index || (len > 0 && index === m.index)) { // a simple index <= m.index check would actually suffice\n m.index = math.max(index, m.index + len)\n }\n }\n}\n\n/**\n * Accumulate all (list) children of a type and return them as an Array.\n *\n * @param {AbstractType} t\n * @return {Array}\n */\nexport const getTypeChildren = t => {\n t.doc ?? warnPrematureAccess()\n let s = t._start\n const arr = []\n while (s) {\n arr.push(s)\n s = s.right\n }\n return arr\n}\n\n/**\n * Call event listeners with an event. This will also add an event to all\n * parents (for `.observeDeep` handlers).\n *\n * @template EventType\n * @param {AbstractType} type\n * @param {Transaction} transaction\n * @param {EventType} event\n */\nexport const callTypeObservers = (type, transaction, event) => {\n const changedType = type\n const changedParentTypes = transaction.changedParentTypes\n while (true) {\n // @ts-ignore\n map.setIfUndefined(changedParentTypes, type, () => []).push(event)\n if (type._item === null) {\n break\n }\n type = /** @type {AbstractType} */ (type._item.parent)\n }\n callEventHandlerListeners(changedType._eH, event, transaction)\n}\n\n/**\n * @template EventType\n * Abstract Yjs Type class\n */\nexport class AbstractType {\n constructor () {\n /**\n * @type {Item|null}\n */\n this._item = null\n /**\n * @type {Map}\n */\n this._map = new Map()\n /**\n * @type {Item|null}\n */\n this._start = null\n /**\n * @type {Doc|null}\n */\n this.doc = null\n this._length = 0\n /**\n * Event handlers\n * @type {EventHandler}\n */\n this._eH = createEventHandler()\n /**\n * Deep event handlers\n * @type {EventHandler>,Transaction>}\n */\n this._dEH = createEventHandler()\n /**\n * @type {null | Array}\n */\n this._searchMarker = null\n }\n\n /**\n * @return {AbstractType|null}\n */\n get parent () {\n return this._item ? /** @type {AbstractType} */ (this._item.parent) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item|null} item\n */\n _integrate (y, item) {\n this.doc = y\n this._item = item\n }\n\n /**\n * @return {AbstractType}\n */\n _copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {AbstractType}\n */\n clone () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n */\n _write (_encoder) { }\n\n /**\n * The first non-deleted item\n */\n get _first () {\n let n = this._start\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Creates YEvent and calls all type observers.\n * Must be implemented by each type.\n *\n * @param {Transaction} transaction\n * @param {Set} _parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, _parentSubs) {\n if (!transaction.local && this._searchMarker) {\n this._searchMarker.length = 0\n }\n }\n\n /**\n * Observe all events that are created on this type.\n *\n * @param {function(EventType, Transaction):void} f Observer function\n */\n observe (f) {\n addEventHandlerListener(this._eH, f)\n }\n\n /**\n * Observe all events that are created by this type and its children.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n observeDeep (f) {\n addEventHandlerListener(this._dEH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(EventType,Transaction):void} f Observer function\n */\n unobserve (f) {\n removeEventHandlerListener(this._eH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n unobserveDeep (f) {\n removeEventHandlerListener(this._dEH, f)\n }\n\n /**\n * @abstract\n * @return {any}\n */\n toJSON () {}\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} start\n * @param {number} end\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListSlice = (type, start, end) => {\n type.doc ?? warnPrematureAccess()\n if (start < 0) {\n start = type._length + start\n }\n if (end < 0) {\n end = type._length + end\n }\n let len = end - start\n const cs = []\n let n = type._start\n while (n !== null && len > 0) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n if (c.length <= start) {\n start -= c.length\n } else {\n for (let i = start; i < c.length && len > 0; i++) {\n cs.push(c[i])\n len--\n }\n start = 0\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArray = type => {\n type.doc ?? warnPrematureAccess()\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @param {Snapshot} snapshot\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArraySnapshot = (type, snapshot) => {\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n *\n * @param {AbstractType} type\n * @param {function(any,number,any):void} f A function to execute on every element of this YArray.\n *\n * @private\n * @function\n */\nexport const typeListForEach = (type, f) => {\n let index = 0\n let n = type._start\n type.doc ?? warnPrematureAccess()\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @template C,R\n * @param {AbstractType} type\n * @param {function(C,number,AbstractType):R} f\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListMap = (type, f) => {\n /**\n * @type {Array}\n */\n const result = []\n typeListForEach(type, (c, i) => {\n result.push(f(c, i, type))\n })\n return result\n}\n\n/**\n * @param {AbstractType} type\n * @return {IterableIterator}\n *\n * @private\n * @function\n */\nexport const typeListCreateIterator = type => {\n let n = type._start\n /**\n * @type {Array|null}\n */\n let currentContent = null\n let currentContentIndex = 0\n return {\n [Symbol.iterator] () {\n return this\n },\n next: () => {\n // find some content\n if (currentContent === null) {\n while (n !== null && n.deleted) {\n n = n.right\n }\n // check if we reached the end, no need to check currentContent, because it does not exist\n if (n === null) {\n return {\n done: true,\n value: undefined\n }\n }\n // we found n, so we can set currentContent\n currentContent = n.content.getContent()\n currentContentIndex = 0\n n = n.right // we used the content of n, now iterate to next\n }\n const value = currentContent[currentContentIndex++]\n // check if we need to empty currentContent\n if (currentContent.length <= currentContentIndex) {\n currentContent = null\n }\n return {\n done: false,\n value\n }\n }\n }\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n * Operates on a snapshotted state of the document.\n *\n * @param {AbstractType} type\n * @param {function(any,number,AbstractType):void} f A function to execute on every element of this YArray.\n * @param {Snapshot} snapshot\n *\n * @private\n * @function\n */\nexport const typeListForEachSnapshot = (type, f, snapshot) => {\n let index = 0\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @return {any}\n *\n * @private\n * @function\n */\nexport const typeListGet = (type, index) => {\n type.doc ?? warnPrematureAccess()\n const marker = findMarker(type, index)\n let n = type._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n return n.content.getContent()[index]\n }\n index -= n.length\n }\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Item?} referenceItem\n * @param {Array|Array|boolean|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => {\n let left = referenceItem\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const store = doc.store\n const right = referenceItem === null ? parent._start : referenceItem.right\n /**\n * @type {Array|number|null>}\n */\n let jsonContent = []\n const packJsonContent = () => {\n if (jsonContent.length > 0) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentAny(jsonContent))\n left.integrate(transaction, 0)\n jsonContent = []\n }\n }\n content.forEach(c => {\n if (c === null) {\n jsonContent.push(c)\n } else {\n switch (c.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n jsonContent.push(c)\n break\n default:\n packJsonContent()\n switch (c.constructor) {\n case Uint8Array:\n case ArrayBuffer:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentBinary(new Uint8Array(/** @type {Uint8Array} */ (c))))\n left.integrate(transaction, 0)\n break\n case Doc:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentDoc(/** @type {Doc} */ (c)))\n left.integrate(transaction, 0)\n break\n default:\n if (c instanceof AbstractType) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentType(c))\n left.integrate(transaction, 0)\n } else {\n throw new Error('Unexpected content type in insert operation')\n }\n }\n }\n }\n })\n packJsonContent()\n}\n\nconst lengthExceeded = () => error.create('Length exceeded!')\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenerics = (transaction, parent, index, content) => {\n if (index > parent._length) {\n throw lengthExceeded()\n }\n if (index === 0) {\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, index, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, null, content)\n }\n const startIndex = index\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n // we need to iterate one to the left so that the algorithm works\n if (index === 0) {\n // @todo refactor this as it actually doesn't consider formats\n n = n.prev // important! get the left undeleted item so that we can actually decrease index\n index += (n && n.countable && !n.deleted) ? n.length : 0\n }\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index <= n.length) {\n if (index < n.length) {\n // insert in-between\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n break\n }\n index -= n.length\n }\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * Pushing content is special as we generally want to push after the last item. So we don't have to update\n * the serach marker.\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListPushGenerics = (transaction, parent, content) => {\n // Use the marker with the highest index and iterate to the right.\n const marker = (parent._searchMarker || []).reduce((maxMarker, currMarker) => currMarker.index > maxMarker.index ? currMarker : maxMarker, { index: 0, p: parent._start })\n let n = marker.p\n if (n) {\n while (n.right) {\n n = n.right\n }\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const typeListDelete = (transaction, parent, index, length) => {\n if (length === 0) { return }\n const startIndex = index\n const startLength = length\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n // compute the first item to be deleted\n for (; n !== null && index > 0; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n index -= n.length\n }\n }\n // delete all items until done\n while (length > 0 && n !== null) {\n if (!n.deleted) {\n if (length < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length))\n }\n n.delete(transaction)\n length -= n.length\n }\n n = n.right\n }\n if (length > 0) {\n throw lengthExceeded()\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length /* in case we remove the above exception */)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n *\n * @private\n * @function\n */\nexport const typeMapDelete = (transaction, parent, key) => {\n const c = parent._map.get(key)\n if (c !== undefined) {\n c.delete(transaction)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Object|number|null|Array|string|Uint8Array|AbstractType} value\n *\n * @private\n * @function\n */\nexport const typeMapSet = (transaction, parent, key, value) => {\n const left = parent._map.get(key) || null\n const doc = transaction.doc\n const ownClientId = doc.clientID\n let content\n if (value == null) {\n content = new ContentAny([value])\n } else {\n switch (value.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n content = new ContentAny([value])\n break\n case Uint8Array:\n content = new ContentBinary(/** @type {Uint8Array} */ (value))\n break\n case Doc:\n content = new ContentDoc(/** @type {Doc} */ (value))\n break\n default:\n if (value instanceof AbstractType) {\n content = new ContentType(value)\n } else {\n throw new Error('Unexpected content type')\n }\n }\n }\n new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0)\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGet = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted ? val.content.getContent()[val.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAll = (parent) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent.doc ?? warnPrematureAccess()\n parent._map.forEach((value, key) => {\n if (!value.deleted) {\n res[key] = value.content.getContent()[value.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const typeMapHas = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGetSnapshot = (parent, key, snapshot) => {\n let v = parent._map.get(key) || null\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n return v !== null && isVisible(v, snapshot) ? v.content.getContent()[v.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAllSnapshot = (parent, snapshot) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent._map.forEach((value, key) => {\n /**\n * @type {Item|null}\n */\n let v = value\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n if (v !== null && isVisible(v, snapshot)) {\n res[key] = v.content.getContent()[v.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType & { _map: Map }} type\n * @return {IterableIterator>}\n *\n * @private\n * @function\n */\nexport const createMapIterator = type => {\n type.doc ?? warnPrematureAccess()\n return iterator.iteratorFilter(type._map.entries(), /** @param {any} entry */ entry => !entry[1].deleted)\n}\n", "/**\n * @module YArray\n */\n\nimport {\n YEvent,\n AbstractType,\n typeListGet,\n typeListToArray,\n typeListForEach,\n typeListCreateIterator,\n typeListInsertGenerics,\n typeListPushGenerics,\n typeListDelete,\n typeListMap,\n YArrayRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\nimport { typeListSlice } from './AbstractType.js'\n\n/**\n * Event that describes the changes on a YArray\n * @template T\n * @extends YEvent>\n */\nexport class YArrayEvent extends YEvent {}\n\n/**\n * A shared Array implementation.\n * @template T\n * @extends AbstractType>\n * @implements {Iterable}\n */\nexport class YArray extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array?}\n * @private\n */\n this._prelimContent = []\n /**\n * @type {Array}\n */\n this._searchMarker = []\n }\n\n /**\n * Construct a new YArray containing the specified items.\n * @template {Object|Array|number|null|string|Uint8Array} T\n * @param {Array} items\n * @return {YArray}\n */\n static from (items) {\n /**\n * @type {YArray}\n */\n const a = new YArray()\n a.push(items)\n return a\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n /**\n * @return {YArray}\n */\n _copy () {\n return new YArray()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YArray}\n */\n clone () {\n /**\n * @type {YArray}\n */\n const arr = new YArray()\n arr.insert(0, this.toArray().map(el =>\n el instanceof AbstractType ? /** @type {typeof el} */ (el.clone()) : el\n ))\n return arr\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * Creates YArrayEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n callTypeObservers(this, transaction, new YArrayEvent(this, transaction))\n }\n\n /**\n * Inserts new content at an index.\n *\n * Important: This function expects an array of content. Not just a content\n * object. The reason for this \"weirdness\" is that inserting several elements\n * is very efficient when it is done as a single operation.\n *\n * @example\n * // Insert character 'a' at position 0\n * yarray.insert(0, ['a'])\n * // Insert numbers 1, 2 at position 1\n * yarray.insert(1, [1, 2])\n *\n * @param {number} index The index to insert content at.\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, 0, ...content)\n }\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n *\n * @todo Use the following implementation in all types.\n */\n push (content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListPushGenerics(transaction, this, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).push(...content)\n }\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} length The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, length)\n }\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {T}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Returns a portion of this YArray into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Array}\n */\n toJSON () {\n return this.map(c => c instanceof AbstractType ? c.toJSON() : c)\n }\n\n /**\n * Returns an Array with the result of calling a provided function on every\n * element of this YArray.\n *\n * @template M\n * @param {function(T,number,YArray):M} f Function that produces an element of the new Array\n * @return {Array} A new array with each element being the result of the\n * callback function\n */\n map (f) {\n return typeListMap(this, /** @type {any} */ (f))\n }\n\n /**\n * Executes a provided function once on every element of this YArray.\n *\n * @param {function(T,number,YArray):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return typeListCreateIterator(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YArrayRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYArray = _decoder => new YArray()\n", "/**\n * @module YMap\n */\n\nimport {\n YEvent,\n AbstractType,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapHas,\n createMapIterator,\n YMapRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as iterator from 'lib0/iterator'\n\n/**\n * @template T\n * @extends YEvent>\n * Event that describes the changes on a YMap.\n */\nexport class YMapEvent extends YEvent {\n /**\n * @param {YMap} ymap The YArray that changed.\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed.\n */\n constructor (ymap, transaction, subs) {\n super(ymap, transaction)\n this.keysChanged = subs\n }\n}\n\n/**\n * @template MapType\n * A shared Map implementation.\n *\n * @extends AbstractType>\n * @implements {Iterable<[string, MapType]>}\n */\nexport class YMap extends AbstractType {\n /**\n *\n * @param {Iterable=} entries - an optional iterable to initialize the YMap\n */\n constructor (entries) {\n super()\n /**\n * @type {Map?}\n * @private\n */\n this._prelimContent = null\n\n if (entries === undefined) {\n this._prelimContent = new Map()\n } else {\n this._prelimContent = new Map(entries)\n }\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;/** @type {Map} */ (this._prelimContent).forEach((value, key) => {\n this.set(key, value)\n })\n this._prelimContent = null\n }\n\n /**\n * @return {YMap}\n */\n _copy () {\n return new YMap()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YMap}\n */\n clone () {\n /**\n * @type {YMap}\n */\n const map = new YMap()\n this.forEach((value, key) => {\n map.set(key, value instanceof AbstractType ? /** @type {typeof value} */ (value.clone()) : value)\n })\n return map\n }\n\n /**\n * Creates YMapEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs))\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Object}\n */\n toJSON () {\n this.doc ?? warnPrematureAccess()\n /**\n * @type {Object}\n */\n const map = {}\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n const v = item.content.getContent()[item.length - 1]\n map[key] = v instanceof AbstractType ? v.toJSON() : v\n }\n })\n return map\n }\n\n /**\n * Returns the size of the YMap (count of key/value pairs)\n *\n * @return {number}\n */\n get size () {\n return [...createMapIterator(this)].length\n }\n\n /**\n * Returns the keys for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n keys () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[0])\n }\n\n /**\n * Returns the values for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n values () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n entries () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => /** @type {any} */ ([v[0], v[1].content.getContent()[v[1].length - 1]]))\n }\n\n /**\n * Executes a provided function on once on every key-value pair.\n *\n * @param {function(MapType,string,YMap):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n this.doc ?? warnPrematureAccess()\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n f(item.content.getContent()[item.length - 1], key, this)\n }\n })\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n [Symbol.iterator] () {\n return this.entries()\n }\n\n /**\n * Remove a specified element from this YMap.\n *\n * @param {string} key The key of the element to remove.\n */\n delete (key) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, key)\n })\n } else {\n /** @type {Map} */ (this._prelimContent).delete(key)\n }\n }\n\n /**\n * Adds or updates an element with a specified key and value.\n * @template {MapType} VAL\n *\n * @param {string} key The key of the element to add to this YMap\n * @param {VAL} value The value of the element to add\n * @return {VAL}\n */\n set (key, value) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, key, /** @type {any} */ (value))\n })\n } else {\n /** @type {Map} */ (this._prelimContent).set(key, value)\n }\n return value\n }\n\n /**\n * Returns a specified element from this YMap.\n *\n * @param {string} key\n * @return {MapType|undefined}\n */\n get (key) {\n return /** @type {any} */ (typeMapGet(this, key))\n }\n\n /**\n * Returns a boolean indicating whether the specified key exists or not.\n *\n * @param {string} key The key to test.\n * @return {boolean}\n */\n has (key) {\n return typeMapHas(this, key)\n }\n\n /**\n * Removes all elements from this YMap.\n */\n clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map} */ (this._prelimContent).clear()\n }\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YMapRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYMap = _decoder => new YMap()\n", "/**\n * @module YText\n */\n\nimport {\n YEvent,\n AbstractType,\n getItemCleanStart,\n getState,\n isVisible,\n createID,\n YTextRefID,\n callTypeObservers,\n transact,\n ContentEmbed,\n GC,\n ContentFormat,\n ContentString,\n splitSnapshotAffectedStructs,\n iterateDeletedStructs,\n iterateStructs,\n findMarker,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n updateMarkerChanges,\n ContentType,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ID, Doc, Item, Snapshot, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as object from 'lib0/object'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nconst equalAttrs = (a, b) => a === b || (typeof a === 'object' && typeof b === 'object' && a && b && object.equalFlat(a, b))\n\nexport class ItemTextListPosition {\n /**\n * @param {Item|null} left\n * @param {Item|null} right\n * @param {number} index\n * @param {Map} currentAttributes\n */\n constructor (left, right, index, currentAttributes) {\n this.left = left\n this.right = right\n this.index = index\n this.currentAttributes = currentAttributes\n }\n\n /**\n * Only call this if you know that this.right is defined\n */\n forward () {\n if (this.right === null) {\n error.unexpectedCase()\n }\n switch (this.right.content.constructor) {\n case ContentFormat:\n if (!this.right.deleted) {\n updateCurrentAttributes(this.currentAttributes, /** @type {ContentFormat} */ (this.right.content))\n }\n break\n default:\n if (!this.right.deleted) {\n this.index += this.right.length\n }\n break\n }\n this.left = this.right\n this.right = this.right.right\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} pos\n * @param {number} count steps to move forward\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findNextPosition = (transaction, pos, count) => {\n while (pos.right !== null && count > 0) {\n switch (pos.right.content.constructor) {\n case ContentFormat:\n if (!pos.right.deleted) {\n updateCurrentAttributes(pos.currentAttributes, /** @type {ContentFormat} */ (pos.right.content))\n }\n break\n default:\n if (!pos.right.deleted) {\n if (count < pos.right.length) {\n // split right\n getItemCleanStart(transaction, createID(pos.right.id.client, pos.right.id.clock + count))\n }\n pos.index += pos.right.length\n count -= pos.right.length\n }\n break\n }\n pos.left = pos.right\n pos.right = pos.right.right\n // pos.forward() - we don't forward because that would halve the performance because we already do the checks above\n }\n return pos\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {boolean} useSearchMarker\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findPosition = (transaction, parent, index, useSearchMarker) => {\n const currentAttributes = new Map()\n const marker = useSearchMarker ? findMarker(parent, index) : null\n if (marker) {\n const pos = new ItemTextListPosition(marker.p.left, marker.p, marker.index, currentAttributes)\n return findNextPosition(transaction, pos, index - marker.index)\n } else {\n const pos = new ItemTextListPosition(null, parent._start, 0, currentAttributes)\n return findNextPosition(transaction, pos, index)\n }\n}\n\n/**\n * Negate applied formats\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Map} negatedAttributes\n *\n * @private\n * @function\n */\nconst insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes) => {\n // check if we really need to remove attributes\n while (\n currPos.right !== null && (\n currPos.right.deleted === true || (\n currPos.right.content.constructor === ContentFormat &&\n equalAttrs(negatedAttributes.get(/** @type {ContentFormat} */ (currPos.right.content).key), /** @type {ContentFormat} */ (currPos.right.content).value)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n negatedAttributes.delete(/** @type {ContentFormat} */ (currPos.right.content).key)\n }\n currPos.forward()\n }\n const doc = transaction.doc\n const ownClientId = doc.clientID\n negatedAttributes.forEach((val, key) => {\n const left = currPos.left\n const right = currPos.right\n const nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n nextFormat.integrate(transaction, 0)\n currPos.right = nextFormat\n currPos.forward()\n })\n}\n\n/**\n * @param {Map} currentAttributes\n * @param {ContentFormat} format\n *\n * @private\n * @function\n */\nconst updateCurrentAttributes = (currentAttributes, format) => {\n const { key, value } = format\n if (value === null) {\n currentAttributes.delete(key)\n } else {\n currentAttributes.set(key, value)\n }\n}\n\n/**\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst minimizeAttributeChanges = (currPos, attributes) => {\n // go right while attributes[right.key] === right.value (or right is deleted)\n while (true) {\n if (currPos.right === null) {\n break\n } else if (currPos.right.deleted || (currPos.right.content.constructor === ContentFormat && equalAttrs(attributes[(/** @type {ContentFormat} */ (currPos.right.content)).key] ?? null, /** @type {ContentFormat} */ (currPos.right.content).value))) {\n //\n } else {\n break\n }\n currPos.forward()\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n * @return {Map}\n *\n * @private\n * @function\n **/\nconst insertAttributes = (transaction, parent, currPos, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const negatedAttributes = new Map()\n // insert format-start items\n for (const key in attributes) {\n const val = attributes[key]\n const currentVal = currPos.currentAttributes.get(key) ?? null\n if (!equalAttrs(currentVal, val)) {\n // save negated attribute (set null if currentVal undefined)\n negatedAttributes.set(key, currentVal)\n const { left, right } = currPos\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n }\n return negatedAttributes\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {string|object|AbstractType} text\n * @param {Object} attributes\n *\n * @private\n * @function\n **/\nconst insertText = (transaction, parent, currPos, text, attributes) => {\n currPos.currentAttributes.forEach((_val, key) => {\n if (attributes[key] === undefined) {\n attributes[key] = null\n }\n })\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // insert content\n const content = text.constructor === String ? new ContentString(/** @type {string} */ (text)) : (text instanceof AbstractType ? new ContentType(text) : new ContentEmbed(text))\n let { left, right, index } = currPos\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength())\n }\n right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content)\n right.integrate(transaction, 0)\n currPos.right = right\n currPos.index = index\n currPos.forward()\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst formatText = (transaction, parent, currPos, length, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // iterate until first non-format or null is found\n // delete all formats with attributes[format.key] != null\n // also check the attributes after the first non-format as we do not want to insert redundant negated attributes there\n // eslint-disable-next-line no-labels\n iterationLoop: while (\n currPos.right !== null &&\n (length > 0 ||\n (\n negatedAttributes.size > 0 &&\n (currPos.right.deleted || currPos.right.content.constructor === ContentFormat)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n switch (currPos.right.content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (currPos.right.content)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (equalAttrs(attr, value)) {\n negatedAttributes.delete(key)\n } else {\n if (length === 0) {\n // no need to further extend negatedAttributes\n // eslint-disable-next-line no-labels\n break iterationLoop\n }\n negatedAttributes.set(key, value)\n }\n currPos.right.delete(transaction)\n } else {\n currPos.currentAttributes.set(key, value)\n }\n break\n }\n default:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n break\n }\n }\n currPos.forward()\n }\n // Quill just assumes that the editor starts with a newline and that it always\n // ends with a newline. We only insert that newline when a new newline is\n // inserted - i.e when length is bigger than type.length\n if (length > 0) {\n let newlines = ''\n for (; length > 0; length--) {\n newlines += '\\n'\n }\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * Call this function after string content has been deleted in order to\n * clean up formatting Items.\n *\n * @param {Transaction} transaction\n * @param {Item} start\n * @param {Item|null} curr exclusive end, automatically iterates to the next Content Item\n * @param {Map} startAttributes\n * @param {Map} currAttributes\n * @return {number} The amount of formatting Items deleted.\n *\n * @function\n */\nconst cleanupFormattingGap = (transaction, start, curr, startAttributes, currAttributes) => {\n /**\n * @type {Item|null}\n */\n let end = start\n /**\n * @type {Map}\n */\n const endFormats = map.create()\n while (end && (!end.countable || end.deleted)) {\n if (!end.deleted && end.content.constructor === ContentFormat) {\n const cf = /** @type {ContentFormat} */ (end.content)\n endFormats.set(cf.key, cf)\n }\n end = end.right\n }\n let cleanups = 0\n let reachedCurr = false\n while (start !== end) {\n if (curr === start) {\n reachedCurr = true\n }\n if (!start.deleted) {\n const content = start.content\n switch (content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (content)\n const startAttrValue = startAttributes.get(key) ?? null\n if (endFormats.get(key) !== content || startAttrValue === value) {\n // Either this format is overwritten or it is not necessary because the attribute already existed.\n start.delete(transaction)\n cleanups++\n if (!reachedCurr && (currAttributes.get(key) ?? null) === value && startAttrValue !== value) {\n if (startAttrValue === null) {\n currAttributes.delete(key)\n } else {\n currAttributes.set(key, startAttrValue)\n }\n }\n }\n if (!reachedCurr && !start.deleted) {\n updateCurrentAttributes(currAttributes, /** @type {ContentFormat} */ (content))\n }\n break\n }\n }\n }\n start = /** @type {Item} */ (start.right)\n }\n return cleanups\n}\n\n/**\n * @param {Transaction} transaction\n * @param {Item | null} item\n */\nconst cleanupContextlessFormattingGap = (transaction, item) => {\n // iterate until item.right is null or content\n while (item && item.right && (item.right.deleted || !item.right.countable)) {\n item = item.right\n }\n const attrs = new Set()\n // iterate back until a content item is found\n while (item && (item.deleted || !item.countable)) {\n if (!item.deleted && item.content.constructor === ContentFormat) {\n const key = /** @type {ContentFormat} */ (item.content).key\n if (attrs.has(key)) {\n item.delete(transaction)\n } else {\n attrs.add(key)\n }\n }\n item = item.left\n }\n}\n\n/**\n * This function is experimental and subject to change / be removed.\n *\n * Ideally, we don't need this function at all. Formatting attributes should be cleaned up\n * automatically after each change. This function iterates twice over the complete YText type\n * and removes unnecessary formatting attributes. This is also helpful for testing.\n *\n * This function won't be exported anymore as soon as there is confidence that the YText type works as intended.\n *\n * @param {YText} type\n * @return {number} How many formatting attributes have been cleaned up.\n */\nexport const cleanupYTextFormatting = type => {\n let res = 0\n transact(/** @type {Doc} */ (type.doc), transaction => {\n let start = /** @type {Item} */ (type._start)\n let end = type._start\n let startAttributes = map.create()\n const currentAttributes = map.copy(startAttributes)\n while (end) {\n if (end.deleted === false) {\n switch (end.content.constructor) {\n case ContentFormat:\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (end.content))\n break\n default:\n res += cleanupFormattingGap(transaction, start, end, startAttributes, currentAttributes)\n startAttributes = map.copy(currentAttributes)\n start = end\n break\n }\n }\n end = end.right\n }\n })\n return res\n}\n\n/**\n * This will be called by the transction once the event handlers are called to potentially cleanup\n * formatting attributes.\n *\n * @param {Transaction} transaction\n */\nexport const cleanupYTextAfterTransaction = transaction => {\n /**\n * @type {Set}\n */\n const needFullCleanup = new Set()\n // check if another formatting item was inserted\n const doc = transaction.doc\n for (const [client, afterClock] of transaction.afterState.entries()) {\n const clock = transaction.beforeState.get(client) || 0\n if (afterClock === clock) {\n continue\n }\n iterateStructs(transaction, /** @type {Array} */ (doc.store.clients.get(client)), clock, afterClock, item => {\n if (\n !item.deleted && /** @type {Item} */ (item).content.constructor === ContentFormat && item.constructor !== GC\n ) {\n needFullCleanup.add(/** @type {any} */ (item).parent)\n }\n })\n }\n // cleanup in a new transaction\n transact(doc, (t) => {\n iterateDeletedStructs(transaction, transaction.deleteSet, item => {\n if (item instanceof GC || !(/** @type {YText} */ (item.parent)._hasFormatting) || needFullCleanup.has(/** @type {YText} */ (item.parent))) {\n return\n }\n const parent = /** @type {YText} */ (item.parent)\n if (item.content.constructor === ContentFormat) {\n needFullCleanup.add(parent)\n } else {\n // If no formatting attribute was inserted or deleted, we can make due with contextless\n // formatting cleanups.\n // Contextless: it is not necessary to compute currentAttributes for the affected position.\n cleanupContextlessFormattingGap(t, item)\n }\n })\n // If a formatting item was inserted, we simply clean the whole type.\n // We need to compute currentAttributes for the current position anyway.\n for (const yText of needFullCleanup) {\n cleanupYTextFormatting(yText)\n }\n })\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst deleteText = (transaction, currPos, length) => {\n const startLength = length\n const startAttrs = map.copy(currPos.currentAttributes)\n const start = currPos.right\n while (length > 0 && currPos.right !== null) {\n if (currPos.right.deleted === false) {\n switch (currPos.right.content.constructor) {\n case ContentType:\n case ContentEmbed:\n case ContentString:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n currPos.right.delete(transaction)\n break\n }\n }\n currPos.forward()\n }\n if (start) {\n cleanupFormattingGap(transaction, start, currPos.right, startAttrs, currPos.currentAttributes)\n }\n const parent = /** @type {AbstractType} */ (/** @type {Item} */ (currPos.left || currPos.right).parent)\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length)\n }\n return currPos\n}\n\n/**\n * The Quill Delta format represents changes on a text document with\n * formatting information. For mor information visit {@link https://quilljs.com/docs/delta/|Quill Delta}\n *\n * @example\n * {\n * ops: [\n * { insert: 'Gandalf', attributes: { bold: true } },\n * { insert: ' the ' },\n * { insert: 'Grey', attributes: { color: '#cccccc' } }\n * ]\n * }\n *\n */\n\n/**\n * Attributes that can be assigned to a selection of text.\n *\n * @example\n * {\n * bold: true,\n * font-size: '40px'\n * }\n *\n * @typedef {Object} TextAttributes\n */\n\n/**\n * @extends YEvent\n * Event that describes the changes on a YText type.\n */\nexport class YTextEvent extends YEvent {\n /**\n * @param {YText} ytext\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed\n */\n constructor (ytext, transaction, subs) {\n super(ytext, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.keysChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.keysChanged.add(sub)\n }\n })\n }\n\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n if (this._changes === null) {\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string|AbstractType|object, delete?:number, retain?:number}>}}\n */\n const changes = {\n keys: this.keys,\n delta: this.delta,\n added: new Set(),\n deleted: new Set()\n }\n this._changes = changes\n }\n return /** @type {any} */ (this._changes)\n }\n\n /**\n * Compute the changes in the delta format.\n * A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document.\n *\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n *\n * @public\n */\n get delta () {\n if (this._delta === null) {\n const y = /** @type {Doc} */ (this.target.doc)\n /**\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n */\n const delta = []\n transact(y, transaction => {\n const currentAttributes = new Map() // saves all current attributes for insert\n const oldAttributes = new Map()\n let item = this.target._start\n /**\n * @type {string?}\n */\n let action = null\n /**\n * @type {Object}\n */\n const attributes = {} // counts added or removed new attributes for retain\n /**\n * @type {string|object}\n */\n let insert = ''\n let retain = 0\n let deleteLen = 0\n const addOp = () => {\n if (action !== null) {\n /**\n * @type {any}\n */\n let op = null\n switch (action) {\n case 'delete':\n if (deleteLen > 0) {\n op = { delete: deleteLen }\n }\n deleteLen = 0\n break\n case 'insert':\n if (typeof insert === 'object' || insert.length > 0) {\n op = { insert }\n if (currentAttributes.size > 0) {\n op.attributes = {}\n currentAttributes.forEach((value, key) => {\n if (value !== null) {\n op.attributes[key] = value\n }\n })\n }\n }\n insert = ''\n break\n case 'retain':\n if (retain > 0) {\n op = { retain }\n if (!object.isEmpty(attributes)) {\n op.attributes = object.assign({}, attributes)\n }\n }\n retain = 0\n break\n }\n if (op) delta.push(op)\n action = null\n }\n }\n while (item !== null) {\n switch (item.content.constructor) {\n case ContentType:\n case ContentEmbed:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n addOp()\n action = 'insert'\n insert = item.content.getContent()[0]\n addOp()\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += 1\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += 1\n }\n break\n case ContentString:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n if (action !== 'insert') {\n addOp()\n action = 'insert'\n }\n insert += /** @type {ContentString} */ (item.content).str\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += item.length\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += item.length\n }\n break\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (item.content)\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (equalAttrs(value, (oldAttributes.get(key) ?? null))) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (value !== null) {\n item.delete(transaction)\n }\n }\n } else if (this.deletes(item)) {\n oldAttributes.set(key, value)\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n attributes[key] = curVal\n }\n } else if (!item.deleted) {\n oldAttributes.set(key, value)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (!equalAttrs(attr, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (value === null) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (attr !== null) { // this will be cleaned up automatically by the contextless cleanup function\n item.delete(transaction)\n }\n }\n }\n if (!item.deleted) {\n if (action === 'insert') {\n addOp()\n }\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (item.content))\n }\n break\n }\n }\n item = item.right\n }\n addOp()\n while (delta.length > 0) {\n const lastOp = delta[delta.length - 1]\n if (lastOp.retain !== undefined && lastOp.attributes === undefined) {\n // retain delta's if they don't assign attributes\n delta.pop()\n } else {\n break\n }\n }\n })\n this._delta = delta\n }\n return /** @type {any} */ (this._delta)\n }\n}\n\n/**\n * Type that represents text with formatting information.\n *\n * This type replaces y-richtext as this implementation is able to handle\n * block formats (format information on a paragraph), embeds (complex elements\n * like pictures and videos), and text formats (**bold**, *italic*).\n *\n * @extends AbstractType\n */\nexport class YText extends AbstractType {\n /**\n * @param {String} [string] The initial value of the YText.\n */\n constructor (string) {\n super()\n /**\n * Array of pending operations on this type\n * @type {Array?}\n */\n this._pending = string !== undefined ? [() => this.insert(0, string)] : []\n /**\n * @type {Array|null}\n */\n this._searchMarker = []\n /**\n * Whether this YText contains formatting attributes.\n * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)\n */\n this._hasFormatting = false\n }\n\n /**\n * Number of characters of this text type.\n *\n * @type {number}\n */\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * @param {Doc} y\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n try {\n /** @type {Array} */ (this._pending).forEach(f => f())\n } catch (e) {\n console.error(e)\n }\n this._pending = null\n }\n\n _copy () {\n return new YText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YText}\n */\n clone () {\n const text = new YText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates YTextEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n const event = new YTextEvent(this, transaction, parentSubs)\n callTypeObservers(this, transaction, event)\n // If a remote change happened, we try to cleanup potential formatting duplicates.\n if (!transaction.local && this._hasFormatting) {\n transaction._needFormattingCleanup = true\n }\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @public\n */\n toString () {\n this.doc ?? warnPrematureAccess()\n let str = ''\n /**\n * @type {Item|null}\n */\n let n = this._start\n while (n !== null) {\n if (!n.deleted && n.countable && n.content.constructor === ContentString) {\n str += /** @type {ContentString} */ (n.content).str\n }\n n = n.right\n }\n return str\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @return {string}\n * @public\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Apply a {@link Delta} on this shared YText type.\n *\n * @param {any} delta The changes to apply on this element.\n * @param {object} opts\n * @param {boolean} [opts.sanitize] Sanitize input delta. Removes ending newlines if set to true.\n *\n *\n * @public\n */\n applyDelta (delta, { sanitize = true } = {}) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const currPos = new ItemTextListPosition(null, this._start, 0, new Map())\n for (let i = 0; i < delta.length; i++) {\n const op = delta[i]\n if (op.insert !== undefined) {\n // Quill assumes that the content starts with an empty paragraph.\n // Yjs/Y.Text assumes that it starts empty. We always hide that\n // there is a newline at the end of the content.\n // If we omit this step, clients will see a different number of\n // paragraphs, but nothing bad will happen.\n const ins = (!sanitize && typeof op.insert === 'string' && i === delta.length - 1 && currPos.right === null && op.insert.slice(-1) === '\\n') ? op.insert.slice(0, -1) : op.insert\n if (typeof ins !== 'string' || ins.length > 0) {\n insertText(transaction, this, currPos, ins, op.attributes || {})\n }\n } else if (op.retain !== undefined) {\n formatText(transaction, this, currPos, op.retain, op.attributes || {})\n } else if (op.delete !== undefined) {\n deleteText(transaction, currPos, op.delete)\n }\n }\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.applyDelta(delta))\n }\n }\n\n /**\n * Returns the Delta representation of this YText type.\n *\n * @param {Snapshot} [snapshot]\n * @param {Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', ID):any} [computeYChange]\n * @return {any} The Delta representation of this type.\n *\n * @public\n */\n toDelta (snapshot, prevSnapshot, computeYChange) {\n this.doc ?? warnPrematureAccess()\n /**\n * @type{Array}\n */\n const ops = []\n const currentAttributes = new Map()\n const doc = /** @type {Doc} */ (this.doc)\n let str = ''\n let n = this._start\n function packStr () {\n if (str.length > 0) {\n // pack str with attributes to ops\n /**\n * @type {Object}\n */\n const attributes = {}\n let addAttributes = false\n currentAttributes.forEach((value, key) => {\n addAttributes = true\n attributes[key] = value\n })\n /**\n * @type {Object}\n */\n const op = { insert: str }\n if (addAttributes) {\n op.attributes = attributes\n }\n ops.push(op)\n str = ''\n }\n }\n const computeDelta = () => {\n while (n !== null) {\n if (isVisible(n, snapshot) || (prevSnapshot !== undefined && isVisible(n, prevSnapshot))) {\n switch (n.content.constructor) {\n case ContentString: {\n const cur = currentAttributes.get('ychange')\n if (snapshot !== undefined && !isVisible(n, snapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'removed') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('removed', n.id) : { type: 'removed' })\n }\n } else if (prevSnapshot !== undefined && !isVisible(n, prevSnapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'added') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('added', n.id) : { type: 'added' })\n }\n } else if (cur !== undefined) {\n packStr()\n currentAttributes.delete('ychange')\n }\n str += /** @type {ContentString} */ (n.content).str\n break\n }\n case ContentType:\n case ContentEmbed: {\n packStr()\n /**\n * @type {Object}\n */\n const op = {\n insert: n.content.getContent()[0]\n }\n if (currentAttributes.size > 0) {\n const attrs = /** @type {Object} */ ({})\n op.attributes = attrs\n currentAttributes.forEach((value, key) => {\n attrs[key] = value\n })\n }\n ops.push(op)\n break\n }\n case ContentFormat:\n if (isVisible(n, snapshot)) {\n packStr()\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (n.content))\n }\n break\n }\n }\n n = n.right\n }\n packStr()\n }\n if (snapshot || prevSnapshot) {\n // snapshots are merged again after the transaction, so we need to keep the\n // transaction alive until we are done\n transact(doc, transaction => {\n if (snapshot) {\n splitSnapshotAffectedStructs(transaction, snapshot)\n }\n if (prevSnapshot) {\n splitSnapshotAffectedStructs(transaction, prevSnapshot)\n }\n computeDelta()\n }, 'cleanup')\n } else {\n computeDelta()\n }\n return ops\n }\n\n /**\n * Insert text at a given index.\n *\n * @param {number} index The index at which to start inserting.\n * @param {String} text The text to insert at the specified position.\n * @param {TextAttributes} [attributes] Optionally define some formatting\n * information to apply on the inserted\n * Text.\n * @public\n */\n insert (index, text, attributes) {\n if (text.length <= 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n if (!attributes) {\n attributes = {}\n // @ts-ignore\n pos.currentAttributes.forEach((v, k) => { attributes[k] = v })\n }\n insertText(transaction, this, pos, text, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insert(index, text, attributes))\n }\n }\n\n /**\n * Inserts an embed at a index.\n *\n * @param {number} index The index to insert the embed at.\n * @param {Object | AbstractType} embed The Object that represents the embed.\n * @param {TextAttributes} [attributes] Attribute information to apply on the\n * embed\n *\n * @public\n */\n insertEmbed (index, embed, attributes) {\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n insertText(transaction, this, pos, embed, attributes || {})\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insertEmbed(index, embed, attributes || {}))\n }\n }\n\n /**\n * Deletes text starting from an index.\n *\n * @param {number} index Index at which to start deleting.\n * @param {number} length The number of characters to remove. Defaults to 1.\n *\n * @public\n */\n delete (index, length) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n deleteText(transaction, findPosition(transaction, this, index, true), length)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.delete(index, length))\n }\n }\n\n /**\n * Assigns properties to a range of text.\n *\n * @param {number} index The position where to start formatting.\n * @param {number} length The amount of characters to assign properties to.\n * @param {TextAttributes} attributes Attribute information to apply on the\n * text.\n *\n * @public\n */\n format (index, length, attributes) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, false)\n if (pos.right === null) {\n return\n }\n formatText(transaction, this, pos, length, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.format(index, length, attributes))\n }\n }\n\n /**\n * Removes an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.removeAttribute(attributeName))\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be set.\n * @param {any} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.setAttribute(attributeName, attributeValue))\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that identifies the\n * queried value.\n * @return {any} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @return {Object} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes () {\n return typeMapGetAll(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YText}\n *\n * @private\n * @function\n */\nexport const readYText = _decoder => new YText()\n", "/**\n * @module YXml\n */\n\nimport {\n YXmlEvent,\n YXmlElement,\n AbstractType,\n typeListMap,\n typeListForEach,\n typeListInsertGenerics,\n typeListInsertGenericsAfter,\n typeListDelete,\n typeListToArray,\n YXmlFragmentRefID,\n callTypeObservers,\n transact,\n typeListGet,\n typeListSlice,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, ContentType, Transaction, Item, YXmlText, YXmlHook // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as array from 'lib0/array'\n\n/**\n * Define the elements to which a set of CSS queries apply.\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|CSS_Selectors}\n *\n * @example\n * query = '.classSelector'\n * query = 'nodeSelector'\n * query = '#idSelector'\n *\n * @typedef {string} CSS_Selector\n */\n\n/**\n * Dom filter function.\n *\n * @callback domFilter\n * @param {string} nodeName The nodeName of the element\n * @param {Map} attributes The map of attributes.\n * @return {boolean} Whether to include the Dom node in the YXmlElement.\n */\n\n/**\n * Represents a subset of the nodes of a YXmlElement / YXmlFragment and a\n * position within them.\n *\n * Can be created with {@link YXmlFragment#createTreeWalker}\n *\n * @public\n * @implements {Iterable}\n */\nexport class YXmlTreeWalker {\n /**\n * @param {YXmlFragment | YXmlElement} root\n * @param {function(AbstractType):boolean} [f]\n */\n constructor (root, f = () => true) {\n this._filter = f\n this._root = root\n /**\n * @type {Item}\n */\n this._currentNode = /** @type {Item} */ (root._start)\n this._firstCall = true\n root.doc ?? warnPrematureAccess()\n }\n\n [Symbol.iterator] () {\n return this\n }\n\n /**\n * Get the next node.\n *\n * @return {IteratorResult} The next node.\n *\n * @public\n */\n next () {\n /**\n * @type {Item|null}\n */\n let n = this._currentNode\n let type = n && n.content && /** @type {any} */ (n.content).type\n if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { // if first call, we check if we can use the first item\n do {\n type = /** @type {any} */ (n.content).type\n if (!n.deleted && (type.constructor === YXmlElement || type.constructor === YXmlFragment) && type._start !== null) {\n // walk down in the tree\n n = type._start\n } else {\n // walk right or up in the tree\n while (n !== null) {\n if (n.right !== null) {\n n = n.right\n break\n } else if (n.parent === this._root) {\n n = null\n } else {\n n = /** @type {AbstractType} */ (n.parent)._item\n }\n }\n }\n } while (n !== null && (n.deleted || !this._filter(/** @type {ContentType} */ (n.content).type)))\n }\n this._firstCall = false\n if (n === null) {\n // @ts-ignore\n return { value: undefined, done: true }\n }\n this._currentNode = n\n return { value: /** @type {any} */ (n.content).type, done: false }\n }\n}\n\n/**\n * Represents a list of {@link YXmlElement}.and {@link YXmlText} types.\n * A YxmlFragment is similar to a {@link YXmlElement}, but it does not have a\n * nodeName and it does not have attributes. Though it can be bound to a DOM\n * element - in this case the attributes and the nodeName are not shared.\n *\n * @public\n * @extends AbstractType\n */\nexport class YXmlFragment extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array|null}\n */\n this._prelimContent = []\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get firstChild () {\n const first = this._first\n return first ? first.content.getContent()[0] : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n _copy () {\n return new YXmlFragment()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlFragment}\n */\n clone () {\n const el = new YXmlFragment()\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._prelimContent === null ? this._length : this._prelimContent.length\n }\n\n /**\n * Create a subtree of childNodes.\n *\n * @example\n * const walker = elem.createTreeWalker(dom => dom.nodeName === 'div')\n * for (let node in walker) {\n * // `node` is a div node\n * nop(node)\n * }\n *\n * @param {function(AbstractType):boolean} filter Function that is called on each child element and\n * returns a Boolean indicating whether the child\n * is to be included in the subtree.\n * @return {YXmlTreeWalker} A subtree and a position within it.\n *\n * @public\n */\n createTreeWalker (filter) {\n return new YXmlTreeWalker(this, filter)\n }\n\n /**\n * Returns the first YXmlElement that matches the query.\n * Similar to DOM's {@link querySelector}.\n *\n * Query support:\n * - tagname\n * TODO:\n * - id\n * - attribute\n *\n * @param {CSS_Selector} query The query on the children.\n * @return {YXmlElement|YXmlText|YXmlHook|null} The first element that matches the query or null.\n *\n * @public\n */\n querySelector (query) {\n query = query.toUpperCase()\n // @ts-ignore\n const iterator = new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query)\n const next = iterator.next()\n if (next.done) {\n return null\n } else {\n return next.value\n }\n }\n\n /**\n * Returns all YXmlElements that match the query.\n * Similar to Dom's {@link querySelectorAll}.\n *\n * @todo Does not yet support all queries. Currently only query by tagName.\n *\n * @param {CSS_Selector} query The query on the children\n * @return {Array} The elements that match this query.\n *\n * @public\n */\n querySelectorAll (query) {\n query = query.toUpperCase()\n // @ts-ignore\n return array.from(new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query))\n }\n\n /**\n * Creates YXmlEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction))\n }\n\n /**\n * Get the string representation of all the children of this YXmlFragment.\n *\n * @return {string} The string representation of all children.\n */\n toString () {\n return typeListMap(this, xml => xml.toString()).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const fragment = _document.createDocumentFragment()\n if (binding !== undefined) {\n binding._createAssociation(fragment, this)\n }\n typeListForEach(this, xmlType => {\n fragment.insertBefore(xmlType.toDOM(_document, hooks, binding), null)\n })\n return fragment\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {number} index The index to insert content at\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, content)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, 0, ...content)\n }\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {null|Item|YXmlElement|YXmlText} ref The index to insert content at\n * @param {Array} content The array of content\n */\n insertAfter (ref, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const refItem = (ref && ref instanceof AbstractType) ? ref._item : ref\n typeListInsertGenericsAfter(transaction, this, refItem, content)\n })\n } else {\n const pc = /** @type {Array} */ (this._prelimContent)\n const index = ref === null ? 0 : pc.findIndex(el => el === ref) + 1\n if (index === 0 && ref !== null) {\n throw error.create('Reference item not found')\n }\n pc.splice(index, 0, ...content)\n }\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} [length=1] The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, length)\n }\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n */\n push (content) {\n this.insert(this.length, content)\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {YXmlElement|YXmlText}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Returns a portion of this YXmlFragment into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Executes a provided function on once on every child element.\n *\n * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlFragmentRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YXmlFragment}\n *\n * @private\n * @function\n */\nexport const readYXmlFragment = _decoder => new YXmlFragment()\n", "import * as object from 'lib0/object'\n\nimport {\n YXmlFragment,\n transact,\n typeMapDelete,\n typeMapHas,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n typeMapGetAllSnapshot,\n typeListForEach,\n YXmlElementRefID,\n Snapshot, YXmlText, ContentType, AbstractType, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Item // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @typedef {Object|number|null|Array|string|Uint8Array|AbstractType} ValueTypes\n */\n\n/**\n * An YXmlElement imitates the behavior of a\n * https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element\n *\n * * An YXmlElement has attributes (key value pairs)\n * * An YXmlElement has childElements that must inherit from YXmlElement\n *\n * @template {{ [key: string]: ValueTypes }} [KV={ [key: string]: string }]\n */\nexport class YXmlElement extends YXmlFragment {\n constructor (nodeName = 'UNDEFINED') {\n super()\n this.nodeName = nodeName\n /**\n * @type {Map|null}\n */\n this._prelimAttrs = new Map()\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;(/** @type {Map} */ (this._prelimAttrs)).forEach((value, key) => {\n this.setAttribute(key, value)\n })\n this._prelimAttrs = null\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n *\n * @return {YXmlElement}\n */\n _copy () {\n return new YXmlElement(this.nodeName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlElement}\n */\n clone () {\n /**\n * @type {YXmlElement}\n */\n const el = new YXmlElement(this.nodeName)\n const attrs = this.getAttributes()\n object.forEach(attrs, (value, key) => {\n if (typeof value === 'string') {\n el.setAttribute(key, value)\n }\n })\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n /**\n * Returns the XML serialization of this YXmlElement.\n * The attributes are ordered by attribute-name, so you can easily use this\n * method to compare YXmlElements\n *\n * @return {string} The string representation of this type.\n *\n * @public\n */\n toString () {\n const attrs = this.getAttributes()\n const stringBuilder = []\n const keys = []\n for (const key in attrs) {\n keys.push(key)\n }\n keys.sort()\n const keysLen = keys.length\n for (let i = 0; i < keysLen; i++) {\n const key = keys[i]\n stringBuilder.push(key + '=\"' + attrs[key] + '\"')\n }\n const nodeName = this.nodeName.toLocaleLowerCase()\n const attrsString = stringBuilder.length > 0 ? ' ' + stringBuilder.join(' ') : ''\n return `<${nodeName}${attrsString}>${super.toString()}`\n }\n\n /**\n * Removes an attribute from this YXmlElement.\n *\n * @param {string} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).delete(attributeName)\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that is to be set.\n * @param {KV[KEY]} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).set(attributeName, attributeValue)\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that identifies the\n * queried value.\n * @return {KV[KEY]|undefined} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns whether an attribute exists\n *\n * @param {string} attributeName The attribute name to check for existence.\n * @return {boolean} whether the attribute exists.\n *\n * @public\n */\n hasAttribute (attributeName) {\n return /** @type {any} */ (typeMapHas(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @param {Snapshot} [snapshot]\n * @return {{ [Key in Extract]?: KV[Key]}} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes (snapshot) {\n return /** @type {any} */ (snapshot ? typeMapGetAllSnapshot(this, snapshot) : typeMapGetAll(this))\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const dom = _document.createElement(this.nodeName)\n const attrs = this.getAttributes()\n for (const key in attrs) {\n const value = attrs[key]\n if (typeof value === 'string') {\n dom.setAttribute(key, value)\n }\n }\n typeListForEach(this, yxml => {\n dom.appendChild(yxml.toDOM(_document, hooks, binding))\n })\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlElementRefID)\n encoder.writeKey(this.nodeName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlElement}\n *\n * @function\n */\nexport const readYXmlElement = decoder => new YXmlElement(decoder.readKey())\n", "import {\n YEvent,\n YXmlText, YXmlElement, YXmlFragment, Transaction // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @extends YEvent\n * An Event that describes changes on a YXml Element or Yxml Fragment\n */\nexport class YXmlEvent extends YEvent {\n /**\n * @param {YXmlElement|YXmlText|YXmlFragment} target The target on which the event is created.\n * @param {Set} subs The set of changed attributes. `null` is included if the\n * child list changed.\n * @param {Transaction} transaction The transaction instance with wich the\n * change was created.\n */\n constructor (target, subs, transaction) {\n super(target, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.attributesChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.attributesChanged.add(sub)\n }\n })\n }\n}\n", "import {\n YMap,\n YXmlHookRefID,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2 // eslint-disable-line\n} from '../internals.js'\n\n/**\n * You can manage binding to a custom type with YXmlHook.\n *\n * @extends {YMap}\n */\nexport class YXmlHook extends YMap {\n /**\n * @param {string} hookName nodeName of the Dom Node.\n */\n constructor (hookName) {\n super()\n /**\n * @type {string}\n */\n this.hookName = hookName\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n */\n _copy () {\n return new YXmlHook(this.hookName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlHook}\n */\n clone () {\n const el = new YXmlHook(this.hookName)\n this.forEach((value, key) => {\n el.set(key, value)\n })\n return el\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object.} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type\n * @return {Element} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const hook = hooks[this.hookName]\n let dom\n if (hook !== undefined) {\n dom = hook.createDom(this)\n } else {\n dom = document.createElement(this.hookName)\n }\n dom.setAttribute('data-yjs-hook', this.hookName)\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlHookRefID)\n encoder.writeKey(this.hookName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlHook}\n *\n * @private\n * @function\n */\nexport const readYXmlHook = decoder =>\n new YXmlHook(decoder.readKey())\n", "import {\n YText,\n YXmlTextRefID,\n ContentType, YXmlElement, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Represents text in a Dom Element. In the future this type will also handle\n * simple formatting information like bold and italic.\n */\nexport class YXmlText extends YText {\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n _copy () {\n return new YXmlText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlText}\n */\n clone () {\n const text = new YXmlText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlText.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Text} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks, binding) {\n const dom = _document.createTextNode(this.toString())\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n toString () {\n // @ts-ignore\n return this.toDelta().map(delta => {\n const nestedNodes = []\n for (const nodeName in delta.attributes) {\n const attrs = []\n for (const key in delta.attributes[nodeName]) {\n attrs.push({ key, value: delta.attributes[nodeName][key] })\n }\n // sort attributes to get a unique order\n attrs.sort((a, b) => a.key < b.key ? -1 : 1)\n nestedNodes.push({ nodeName, attrs })\n }\n // sort node order to get a unique order\n nestedNodes.sort((a, b) => a.nodeName < b.nodeName ? -1 : 1)\n // now convert to dom string\n let str = ''\n for (let i = 0; i < nestedNodes.length; i++) {\n const node = nestedNodes[i]\n str += `<${node.nodeName}`\n for (let j = 0; j < node.attrs.length; j++) {\n const attr = node.attrs[j]\n str += ` ${attr.key}=\"${attr.value}\"`\n }\n str += '>'\n }\n str += delta.insert\n for (let i = nestedNodes.length - 1; i >= 0; i--) {\n str += ``\n }\n return str\n }).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlText}\n *\n * @private\n * @function\n */\nexport const readYXmlText = decoder => new YXmlText()\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, ID, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class AbstractStruct {\n /**\n * @param {ID} id\n * @param {number} length\n */\n constructor (id, length) {\n this.id = id\n this.length = length\n }\n\n /**\n * @type {boolean}\n */\n get deleted () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Merge this struct with the item to the right.\n * This method is already assuming that `this.id.clock + this.length === this.id.clock`.\n * Also this method does *not* remove right from StructStore!\n * @param {AbstractStruct} right\n * @return {boolean} wether this merged with right\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n * @param {number} encodingRef\n */\n write (encoder, offset, encodingRef) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n addStruct,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nexport const structGCRefNumber = 0\n\n/**\n * @private\n */\nexport class GC extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {GC} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.length -= offset\n }\n addStruct(transaction.doc.store, this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structGCRefNumber)\n encoder.writeLen(this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class ContentBinary {\n /**\n * @param {Uint8Array} content\n */\n constructor (content) {\n this.content = content\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.content]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentBinary}\n */\n copy () {\n return new ContentBinary(this.content)\n }\n\n /**\n * @param {number} offset\n * @return {ContentBinary}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentBinary} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeBuf(this.content)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 3\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentBinary}\n */\nexport const readContentBinary = decoder => new ContentBinary(decoder.readBuf())\n", "import {\n addToDeleteSet,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nexport class ContentDeleted {\n /**\n * @param {number} len\n */\n constructor (len) {\n this.len = len\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.len\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentDeleted}\n */\n copy () {\n return new ContentDeleted(this.len)\n }\n\n /**\n * @param {number} offset\n * @return {ContentDeleted}\n */\n splice (offset) {\n const right = new ContentDeleted(this.len - offset)\n this.len = offset\n return right\n }\n\n /**\n * @param {ContentDeleted} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.len += right.len\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n addToDeleteSet(transaction.deleteSet, item.id.client, item.id.clock, this.len)\n item.markDeleted()\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeLen(this.len - offset)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 1\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentDeleted}\n */\nexport const readContentDeleted = decoder => new ContentDeleted(decoder.readLen())\n", "import {\n Doc, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @param {string} guid\n * @param {Object} opts\n */\nconst createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false })\n\n/**\n * @private\n */\nexport class ContentDoc {\n /**\n * @param {Doc} doc\n */\n constructor (doc) {\n if (doc._item) {\n console.error('This document was already integrated as a sub-document. You should create a second instance instead with the same guid.')\n }\n /**\n * @type {Doc}\n */\n this.doc = doc\n /**\n * @type {any}\n */\n const opts = {}\n this.opts = opts\n if (!doc.gc) {\n opts.gc = false\n }\n if (doc.autoLoad) {\n opts.autoLoad = true\n }\n if (doc.meta !== null) {\n opts.meta = doc.meta\n }\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.doc]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentDoc}\n */\n copy () {\n return new ContentDoc(createDocFromOpts(this.doc.guid, this.opts))\n }\n\n /**\n * @param {number} offset\n * @return {ContentDoc}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentDoc} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n // this needs to be reflected in doc.destroy as well\n this.doc._item = item\n transaction.subdocsAdded.add(this.doc)\n if (this.doc.shouldLoad) {\n transaction.subdocsLoaded.add(this.doc)\n }\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (transaction.subdocsAdded.has(this.doc)) {\n transaction.subdocsAdded.delete(this.doc)\n } else {\n transaction.subdocsRemoved.add(this.doc)\n }\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) { }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(this.doc.guid)\n encoder.writeAny(this.opts)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 9\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentDoc}\n */\nexport const readContentDoc = decoder => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny()))\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentEmbed {\n /**\n * @param {Object} embed\n */\n constructor (embed) {\n this.embed = embed\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.embed]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentEmbed}\n */\n copy () {\n return new ContentEmbed(this.embed)\n }\n\n /**\n * @param {number} offset\n * @return {ContentEmbed}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentEmbed} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeJSON(this.embed)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 5\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentEmbed}\n */\nexport const readContentEmbed = decoder => new ContentEmbed(decoder.readJSON())\n", "import {\n YText, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Item, StructStore, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentFormat {\n /**\n * @param {string} key\n * @param {Object} value\n */\n constructor (key, value) {\n this.key = key\n this.value = value\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentFormat}\n */\n copy () {\n return new ContentFormat(this.key, this.value)\n }\n\n /**\n * @param {number} _offset\n * @return {ContentFormat}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentFormat} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n return false\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} item\n */\n integrate (_transaction, item) {\n // @todo searchmarker are currently unsupported for rich text documents\n const p = /** @type {YText} */ (item.parent)\n p._searchMarker = null\n p._hasFormatting = true\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeKey(this.key)\n encoder.writeJSON(this.value)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 6\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentFormat}\n */\nexport const readContentFormat = decoder => new ContentFormat(decoder.readKey(), decoder.readJSON())\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentJSON {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentJSON}\n */\n copy () {\n return new ContentJSON(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentJSON}\n */\n splice (offset) {\n const right = new ContentJSON(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentJSON} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeString(c === undefined ? 'undefined' : JSON.stringify(c))\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 2\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentJSON}\n */\nexport const readContentJSON = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n const c = decoder.readString()\n if (c === 'undefined') {\n cs.push(undefined)\n } else {\n cs.push(JSON.parse(c))\n }\n }\n return new ContentJSON(cs)\n}\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, UpdateDecoderV1, UpdateDecoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as env from 'lib0/environment'\nimport * as object from 'lib0/object'\n\nconst isDevMode = env.getVariable('node_env') === 'development'\n\nexport class ContentAny {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n isDevMode && object.deepFreeze(arr)\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentAny}\n */\n copy () {\n return new ContentAny(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentAny}\n */\n splice (offset) {\n const right = new ContentAny(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentAny} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeAny(c)\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 8\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentAny}\n */\nexport const readContentAny = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n cs.push(decoder.readAny())\n }\n return new ContentAny(cs)\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentString {\n /**\n * @param {string} str\n */\n constructor (str) {\n /**\n * @type {string}\n */\n this.str = str\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.str.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.str.split('')\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentString}\n */\n copy () {\n return new ContentString(this.str)\n }\n\n /**\n * @param {number} offset\n * @return {ContentString}\n */\n splice (offset) {\n const right = new ContentString(this.str.slice(offset))\n this.str = this.str.slice(0, offset)\n\n // Prevent encoding invalid documents because of splitting of surrogate pairs: https://github.com/yjs/yjs/issues/248\n const firstCharCode = this.str.charCodeAt(offset - 1)\n if (firstCharCode >= 0xD800 && firstCharCode <= 0xDBFF) {\n // Last character of the left split is the start of a surrogate utf16/ucs2 pair.\n // We don't support splitting of surrogate pairs because this may lead to invalid documents.\n // Replace the invalid character with a unicode replacement character (� / U+FFFD)\n this.str = this.str.slice(0, offset - 1) + '�'\n // replace right as well\n right.str = '�' + right.str.slice(1)\n }\n return right\n }\n\n /**\n * @param {ContentString} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.str += right.str\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(offset === 0 ? this.str : this.str.slice(offset))\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 4\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentString}\n */\nexport const readContentString = decoder => new ContentString(decoder.readString())\n", "import {\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item, YEvent, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @type {Array>}\n * @private\n */\nexport const typeRefs = [\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText\n]\n\nexport const YArrayRefID = 0\nexport const YMapRefID = 1\nexport const YTextRefID = 2\nexport const YXmlElementRefID = 3\nexport const YXmlFragmentRefID = 4\nexport const YXmlHookRefID = 5\nexport const YXmlTextRefID = 6\n\n/**\n * @private\n */\nexport class ContentType {\n /**\n * @param {AbstractType} type\n */\n constructor (type) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.type]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentType}\n */\n copy () {\n return new ContentType(this.type._copy())\n }\n\n /**\n * @param {number} offset\n * @return {ContentType}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentType} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n this.type._integrate(transaction.doc, item)\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n let item = this.type._start\n while (item !== null) {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // This will be gc'd later and we want to merge it if possible\n // We try to merge all deleted items after each transaction,\n // but we have no knowledge about that this needs to be merged\n // since it is not in transaction.ds. Hence we add it to transaction._mergeStructs\n transaction._mergeStructs.push(item)\n }\n item = item.right\n }\n this.type._map.forEach(item => {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // same as above\n transaction._mergeStructs.push(item)\n }\n })\n transaction.changed.delete(this.type)\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) {\n let item = this.type._start\n while (item !== null) {\n item.gc(store, true)\n item = item.right\n }\n this.type._start = null\n this.type._map.forEach(/** @param {Item | null} item */ (item) => {\n while (item !== null) {\n item.gc(store, true)\n item = item.left\n }\n })\n this.type._map = new Map()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n this.type._write(encoder)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 7\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentType}\n */\nexport const readContentType = decoder => new ContentType(typeRefs[decoder.readTypeRef()](decoder))\n", "import {\n GC,\n getState,\n AbstractStruct,\n replaceStruct,\n addStruct,\n addToDeleteSet,\n findRootTypeKey,\n compareIDs,\n getItem,\n getItemCleanEnd,\n getItemCleanStart,\n readContentDeleted,\n readContentBinary,\n readContentJSON,\n readContentAny,\n readContentString,\n readContentEmbed,\n readContentDoc,\n createID,\n readContentFormat,\n readContentType,\n addChangedTypeToTransaction,\n isDeleted,\n StackItem, DeleteSet, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ContentType, ContentDeleted, StructStore, ID, AbstractType, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as binary from 'lib0/binary'\nimport * as array from 'lib0/array'\n\n/**\n * @todo This should return several items\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {{item:Item, diff:number}}\n */\nexport const followRedone = (store, id) => {\n /**\n * @type {ID|null}\n */\n let nextID = id\n let diff = 0\n let item\n do {\n if (diff > 0) {\n nextID = createID(nextID.client, nextID.clock + diff)\n }\n item = getItem(store, nextID)\n diff = nextID.clock - item.id.clock\n nextID = item.redone\n } while (nextID !== null && item instanceof Item)\n return {\n item, diff\n }\n}\n\n/**\n * Make sure that neither item nor any of its parents is ever deleted.\n *\n * This property does not persist when storing it into a database or when\n * sending it to other peers\n *\n * @param {Item|null} item\n * @param {boolean} keep\n */\nexport const keepItem = (item, keep) => {\n while (item !== null && item.keep !== keep) {\n item.keep = keep\n item = /** @type {AbstractType} */ (item.parent)._item\n }\n}\n\n/**\n * Split leftItem into two items\n * @param {Transaction} transaction\n * @param {Item} leftItem\n * @param {number} diff\n * @return {Item}\n *\n * @function\n * @private\n */\nexport const splitItem = (transaction, leftItem, diff) => {\n // create rightItem\n const { client, clock } = leftItem.id\n const rightItem = new Item(\n createID(client, clock + diff),\n leftItem,\n createID(client, clock + diff - 1),\n leftItem.right,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n if (leftItem.deleted) {\n rightItem.markDeleted()\n }\n if (leftItem.keep) {\n rightItem.keep = true\n }\n if (leftItem.redone !== null) {\n rightItem.redone = createID(leftItem.redone.client, leftItem.redone.clock + diff)\n }\n // update left (do not set leftItem.rightOrigin as it will lead to problems when syncing)\n leftItem.right = rightItem\n // update right\n if (rightItem.right !== null) {\n rightItem.right.left = rightItem\n }\n // right is more specific.\n transaction._mergeStructs.push(rightItem)\n // update parent._map\n if (rightItem.parentSub !== null && rightItem.right === null) {\n /** @type {AbstractType} */ (rightItem.parent)._map.set(rightItem.parentSub, rightItem)\n }\n leftItem.length = diff\n return rightItem\n}\n\n/**\n * @param {Array} stack\n * @param {ID} id\n */\nconst isDeletedByUndoStack = (stack, id) => array.some(stack, /** @param {StackItem} s */ s => isDeleted(s.deletions, id))\n\n/**\n * Redoes the effect of this operation.\n *\n * @param {Transaction} transaction The Yjs instance.\n * @param {Item} item\n * @param {Set} redoitems\n * @param {DeleteSet} itemsToDelete\n * @param {boolean} ignoreRemoteMapChanges\n * @param {import('../utils/UndoManager.js').UndoManager} um\n *\n * @return {Item|null}\n *\n * @private\n */\nexport const redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => {\n const doc = transaction.doc\n const store = doc.store\n const ownClientID = doc.clientID\n const redone = item.redone\n if (redone !== null) {\n return getItemCleanStart(transaction, redone)\n }\n let parentItem = /** @type {AbstractType} */ (item.parent)._item\n /**\n * @type {Item|null}\n */\n let left = null\n /**\n * @type {Item|null}\n */\n let right\n // make sure that parent is redone\n if (parentItem !== null && parentItem.deleted === true) {\n // try to undo parent if it will be undone anyway\n if (parentItem.redone === null && (!redoitems.has(parentItem) || redoItem(transaction, parentItem, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) === null)) {\n return null\n }\n while (parentItem.redone !== null) {\n parentItem = getItemCleanStart(transaction, parentItem.redone)\n }\n }\n const parentType = parentItem === null ? /** @type {AbstractType} */ (item.parent) : /** @type {ContentType} */ (parentItem.content).type\n\n if (item.parentSub === null) {\n // Is an array item. Insert at the old position\n left = item.left\n right = item\n // find next cloned_redo items\n while (left !== null) {\n /**\n * @type {Item|null}\n */\n let leftTrace = left\n // trace redone until parent matches\n while (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item !== parentItem) {\n leftTrace = leftTrace.redone === null ? null : getItemCleanStart(transaction, leftTrace.redone)\n }\n if (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item === parentItem) {\n left = leftTrace\n break\n }\n left = left.left\n }\n while (right !== null) {\n /**\n * @type {Item|null}\n */\n let rightTrace = right\n // trace redone until parent matches\n while (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item !== parentItem) {\n rightTrace = rightTrace.redone === null ? null : getItemCleanStart(transaction, rightTrace.redone)\n }\n if (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item === parentItem) {\n right = rightTrace\n break\n }\n right = right.right\n }\n } else {\n right = null\n if (item.right && !ignoreRemoteMapChanges) {\n left = item\n // Iterate right while right is in itemsToDelete\n // If it is intended to delete right while item is redone, we can expect that item should replace right.\n while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) {\n left = left.right\n // follow redone\n while (left.redone) left = getItemCleanStart(transaction, left.redone)\n }\n if (left && left.right !== null) {\n // It is not possible to redo this item because it conflicts with a\n // change from another client\n return null\n }\n } else {\n left = parentType._map.get(item.parentSub) || null\n }\n }\n const nextClock = getState(store, ownClientID)\n const nextId = createID(ownClientID, nextClock)\n const redoneItem = new Item(\n nextId,\n left, left && left.lastId,\n right, right && right.id,\n parentType,\n item.parentSub,\n item.content.copy()\n )\n item.redone = nextId\n keepItem(redoneItem, true)\n redoneItem.integrate(transaction, 0)\n return redoneItem\n}\n\n/**\n * Abstract class that represents any content.\n */\nexport class Item extends AbstractStruct {\n /**\n * @param {ID} id\n * @param {Item | null} left\n * @param {ID | null} origin\n * @param {Item | null} right\n * @param {ID | null} rightOrigin\n * @param {AbstractType|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it.\n * @param {string | null} parentSub\n * @param {AbstractContent} content\n */\n constructor (id, left, origin, right, rightOrigin, parent, parentSub, content) {\n super(id, content.getLength())\n /**\n * The item that was originally to the left of this item.\n * @type {ID | null}\n */\n this.origin = origin\n /**\n * The item that is currently to the left of this item.\n * @type {Item | null}\n */\n this.left = left\n /**\n * The item that is currently to the right of this item.\n * @type {Item | null}\n */\n this.right = right\n /**\n * The item that was originally to the right of this item.\n * @type {ID | null}\n */\n this.rightOrigin = rightOrigin\n /**\n * @type {AbstractType|ID|null}\n */\n this.parent = parent\n /**\n * If the parent refers to this item with some kind of key (e.g. YMap, the\n * key is specified here. The key is then used to refer to the list in which\n * to insert this item. If `parentSub = null` type._start is the list in\n * which to insert to. Otherwise it is `parent._map`.\n * @type {String | null}\n */\n this.parentSub = parentSub\n /**\n * If this type's effect is redone this type refers to the type that undid\n * this operation.\n * @type {ID | null}\n */\n this.redone = null\n /**\n * @type {AbstractContent}\n */\n this.content = content\n /**\n * bit1: keep\n * bit2: countable\n * bit3: deleted\n * bit4: mark - mark node as fast-search-marker\n * @type {number} byte\n */\n this.info = this.content.isCountable() ? binary.BIT2 : 0\n }\n\n /**\n * This is used to mark the item as an indexed fast-search marker\n *\n * @type {boolean}\n */\n set marker (isMarked) {\n if (((this.info & binary.BIT4) > 0) !== isMarked) {\n this.info ^= binary.BIT4\n }\n }\n\n get marker () {\n return (this.info & binary.BIT4) > 0\n }\n\n /**\n * If true, do not garbage collect this Item.\n */\n get keep () {\n return (this.info & binary.BIT1) > 0\n }\n\n set keep (doKeep) {\n if (this.keep !== doKeep) {\n this.info ^= binary.BIT1\n }\n }\n\n get countable () {\n return (this.info & binary.BIT2) > 0\n }\n\n /**\n * Whether this item was deleted or not.\n * @type {Boolean}\n */\n get deleted () {\n return (this.info & binary.BIT3) > 0\n }\n\n set deleted (doDelete) {\n if (this.deleted !== doDelete) {\n this.info ^= binary.BIT3\n }\n }\n\n markDeleted () {\n this.info |= binary.BIT3\n }\n\n /**\n * Return the creator clientID of the missing op or define missing items and return null.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= getState(store, this.origin.client)) {\n return this.origin.client\n }\n if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= getState(store, this.rightOrigin.client)) {\n return this.rightOrigin.client\n }\n if (this.parent && this.parent.constructor === ID && this.id.client !== this.parent.client && this.parent.clock >= getState(store, this.parent.client)) {\n return this.parent.client\n }\n\n // We have all missing ids, now find the items\n\n if (this.origin) {\n this.left = getItemCleanEnd(transaction, store, this.origin)\n this.origin = this.left.lastId\n }\n if (this.rightOrigin) {\n this.right = getItemCleanStart(transaction, this.rightOrigin)\n this.rightOrigin = this.right.id\n }\n if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) {\n this.parent = null\n } else if (!this.parent) {\n // only set parent if this shouldn't be garbage collected\n if (this.left && this.left.constructor === Item) {\n this.parent = this.left.parent\n this.parentSub = this.left.parentSub\n }\n if (this.right && this.right.constructor === Item) {\n this.parent = this.right.parent\n this.parentSub = this.right.parentSub\n }\n } else if (this.parent.constructor === ID) {\n const parentItem = getItem(store, this.parent)\n if (parentItem.constructor === GC) {\n this.parent = null\n } else {\n this.parent = /** @type {ContentType} */ (parentItem.content).type\n }\n }\n return null\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.left = getItemCleanEnd(transaction, transaction.doc.store, createID(this.id.client, this.id.clock - 1))\n this.origin = this.left.lastId\n this.content = this.content.splice(offset)\n this.length -= offset\n }\n\n if (this.parent) {\n if ((!this.left && (!this.right || this.right.left !== null)) || (this.left && this.left.right !== this.right)) {\n /**\n * @type {Item|null}\n */\n let left = this.left\n\n /**\n * @type {Item|null}\n */\n let o\n // set o to the first conflicting item\n if (left !== null) {\n o = left.right\n } else if (this.parentSub !== null) {\n o = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (o !== null && o.left !== null) {\n o = o.left\n }\n } else {\n o = /** @type {AbstractType} */ (this.parent)._start\n }\n // TODO: use something like DeleteSet here (a tree implementation would be best)\n // @todo use global set definitions\n /**\n * @type {Set}\n */\n const conflictingItems = new Set()\n /**\n * @type {Set}\n */\n const itemsBeforeOrigin = new Set()\n // Let c in conflictingItems, b in itemsBeforeOrigin\n // ***{origin}bbbb{this}{c,b}{c,b}{o}***\n // Note that conflictingItems is a subset of itemsBeforeOrigin\n while (o !== null && o !== this.right) {\n itemsBeforeOrigin.add(o)\n conflictingItems.add(o)\n if (compareIDs(this.origin, o.origin)) {\n // case 1\n if (o.id.client < this.id.client) {\n left = o\n conflictingItems.clear()\n } else if (compareIDs(this.rightOrigin, o.rightOrigin)) {\n // this and o are conflicting and point to the same integration points. The id decides which item comes first.\n // Since this is to the left of o, we can break here\n break\n } // else, o might be integrated before an item that this conflicts with. If so, we will find it in the next iterations\n } else if (o.origin !== null && itemsBeforeOrigin.has(getItem(transaction.doc.store, o.origin))) { // use getItem instead of getItemCleanEnd because we don't want / need to split items.\n // case 2\n if (!conflictingItems.has(getItem(transaction.doc.store, o.origin))) {\n left = o\n conflictingItems.clear()\n }\n } else {\n break\n }\n o = o.right\n }\n this.left = left\n }\n // reconnect left/right + update parent map/start if necessary\n if (this.left !== null) {\n const right = this.left.right\n this.right = right\n this.left.right = this\n } else {\n let r\n if (this.parentSub !== null) {\n r = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (r !== null && r.left !== null) {\n r = r.left\n }\n } else {\n r = /** @type {AbstractType} */ (this.parent)._start\n ;/** @type {AbstractType} */ (this.parent)._start = this\n }\n this.right = r\n }\n if (this.right !== null) {\n this.right.left = this\n } else if (this.parentSub !== null) {\n // set as current parent value if right === null and this is parentSub\n /** @type {AbstractType} */ (this.parent)._map.set(this.parentSub, this)\n if (this.left !== null) {\n // this is the current attribute value of parent. delete right\n this.left.delete(transaction)\n }\n }\n // adjust length of parent\n if (this.parentSub === null && this.countable && !this.deleted) {\n /** @type {AbstractType} */ (this.parent)._length += this.length\n }\n addStruct(transaction.doc.store, this)\n this.content.integrate(transaction, this)\n // add parent to transaction.changed\n addChangedTypeToTransaction(transaction, /** @type {AbstractType} */ (this.parent), this.parentSub)\n if ((/** @type {AbstractType} */ (this.parent)._item !== null && /** @type {AbstractType} */ (this.parent)._item.deleted) || (this.parentSub !== null && this.right !== null)) {\n // delete if parent is deleted or if this is not the current attribute value of parent\n this.delete(transaction)\n }\n } else {\n // parent is not defined. Integrate GC struct instead\n new GC(this.id, this.length).integrate(transaction, 0)\n }\n }\n\n /**\n * Returns the next non-deleted item\n */\n get next () {\n let n = this.right\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Returns the previous non-deleted item\n */\n get prev () {\n let n = this.left\n while (n !== null && n.deleted) {\n n = n.left\n }\n return n\n }\n\n /**\n * Computes the last content address of this Item.\n */\n get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }\n\n /**\n * Try to merge two items\n *\n * @param {Item} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (\n this.constructor === right.constructor &&\n compareIDs(right.origin, this.lastId) &&\n this.right === right &&\n compareIDs(this.rightOrigin, right.rightOrigin) &&\n this.id.client === right.id.client &&\n this.id.clock + this.length === right.id.clock &&\n this.deleted === right.deleted &&\n this.redone === null &&\n right.redone === null &&\n this.content.constructor === right.content.constructor &&\n this.content.mergeWith(right.content)\n ) {\n const searchMarker = /** @type {AbstractType} */ (this.parent)._searchMarker\n if (searchMarker) {\n searchMarker.forEach(marker => {\n if (marker.p === right) {\n // right is going to be \"forgotten\" so we need to update the marker\n marker.p = this\n // adjust marker index\n if (!this.deleted && this.countable) {\n marker.index -= this.length\n }\n }\n })\n }\n if (right.keep) {\n this.keep = true\n }\n this.right = right.right\n if (this.right !== null) {\n this.right.left = this\n }\n this.length += right.length\n return true\n }\n return false\n }\n\n /**\n * Mark this Item as deleted.\n *\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (!this.deleted) {\n const parent = /** @type {AbstractType} */ (this.parent)\n // adjust the length of parent\n if (this.countable && this.parentSub === null) {\n parent._length -= this.length\n }\n this.markDeleted()\n addToDeleteSet(transaction.deleteSet, this.id.client, this.id.clock, this.length)\n addChangedTypeToTransaction(transaction, parent, this.parentSub)\n this.content.delete(transaction)\n }\n }\n\n /**\n * @param {StructStore} store\n * @param {boolean} parentGCd\n */\n gc (store, parentGCd) {\n if (!this.deleted) {\n throw error.unexpectedCase()\n }\n this.content.gc(store)\n if (parentGCd) {\n replaceStruct(store, this, new GC(this.id, this.length))\n } else {\n this.content = new ContentDeleted(this.length)\n }\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n */\n write (encoder, offset) {\n const origin = offset > 0 ? createID(this.id.client, this.id.clock + offset - 1) : this.origin\n const rightOrigin = this.rightOrigin\n const parentSub = this.parentSub\n const info = (this.content.getRef() & binary.BITS5) |\n (origin === null ? 0 : binary.BIT8) | // origin is defined\n (rightOrigin === null ? 0 : binary.BIT7) | // right origin is defined\n (parentSub === null ? 0 : binary.BIT6) // parentSub is non-null\n encoder.writeInfo(info)\n if (origin !== null) {\n encoder.writeLeftID(origin)\n }\n if (rightOrigin !== null) {\n encoder.writeRightID(rightOrigin)\n }\n if (origin === null && rightOrigin === null) {\n const parent = /** @type {AbstractType} */ (this.parent)\n if (parent._item !== undefined) {\n const parentItem = parent._item\n if (parentItem === null) {\n // parent type on y._map\n // find the correct key\n const ykey = findRootTypeKey(parent)\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(ykey)\n } else {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parentItem.id)\n }\n } else if (parent.constructor === String) { // this edge case was added by differential updates\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(parent)\n } else if (parent.constructor === ID) {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parent)\n } else {\n error.unexpectedCase()\n }\n if (parentSub !== null) {\n encoder.writeString(parentSub)\n }\n }\n this.content.write(encoder, offset)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {number} info\n */\nexport const readItemContent = (decoder, info) => contentRefs[info & binary.BITS5](decoder)\n\n/**\n * A lookup map for reading Item content.\n *\n * @type {Array}\n */\nexport const contentRefs = [\n () => { error.unexpectedCase() }, // GC is not ItemContent\n readContentDeleted, // 1\n readContentJSON, // 2\n readContentBinary, // 3\n readContentString, // 4\n readContentEmbed, // 5\n readContentFormat, // 6\n readContentType, // 7\n readContentAny, // 8\n readContentDoc, // 9\n () => { error.unexpectedCase() } // 10 - Skip is not ItemContent\n]\n\n/**\n * Do not implement this class!\n */\nexport class AbstractContent {\n /**\n * @return {number}\n */\n getLength () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Should return false if this Item is some kind of meta information\n * (e.g. format information).\n *\n * * Whether this Item should be addressable via `yarray.get(i)`\n * * Whether this Item should be counted when computing yarray.length\n *\n * @return {boolean}\n */\n isCountable () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {AbstractContent}\n */\n copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {number} _offset\n * @return {AbstractContent}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {AbstractContent} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} _item\n */\n integrate (_transaction, _item) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n */\n delete (_transaction) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {StructStore} _store\n */\n gc (_store) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n * @param {number} _offset\n */\n write (_encoder, _offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {number}\n */\n getRef () {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\nimport * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nexport const structSkipRefNumber = 10\n\n/**\n * @private\n */\nexport class Skip extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {Skip} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n // skip structs cannot be integrated\n error.unexpectedCase()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structSkipRefNumber)\n // write as VarUint because Skips can't make use of predictable length-encoding\n encoding.writeVarUint(encoder.restEncoder, this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "/** eslint-env browser */\n\nexport {\n Doc,\n Transaction,\n YArray as Array,\n YMap as Map,\n YText as Text,\n YXmlText as XmlText,\n YXmlHook as XmlHook,\n YXmlElement as XmlElement,\n YXmlFragment as XmlFragment,\n YXmlEvent,\n YMapEvent,\n YArrayEvent,\n YTextEvent,\n YEvent,\n Item,\n AbstractStruct,\n GC,\n Skip,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentAny,\n ContentString,\n ContentType,\n AbstractType,\n getTypeChildren,\n createRelativePositionFromTypeIndex,\n createRelativePositionFromJSON,\n createAbsolutePositionFromRelativePosition,\n compareRelativePositions,\n AbsolutePosition,\n RelativePosition,\n ID,\n createID,\n compareIDs,\n getState,\n Snapshot,\n createSnapshot,\n createDeleteSet,\n createDeleteSetFromStructStore,\n cleanupYTextFormatting,\n snapshot,\n emptySnapshot,\n findRootTypeKey,\n findIndexSS,\n getItem,\n typeListToArraySnapshot,\n typeMapGetSnapshot,\n typeMapGetAllSnapshot,\n createDocFromSnapshot,\n iterateDeletedStructs,\n applyUpdate,\n applyUpdateV2,\n readUpdate,\n readUpdateV2,\n encodeStateAsUpdate,\n encodeStateAsUpdateV2,\n encodeStateVector,\n UndoManager,\n decodeSnapshot,\n encodeSnapshot,\n decodeSnapshotV2,\n encodeSnapshotV2,\n decodeStateVector,\n logUpdate,\n logUpdateV2,\n decodeUpdate,\n decodeUpdateV2,\n relativePositionToJSON,\n isDeleted,\n isParentOf,\n equalSnapshots,\n PermanentUserData, // @TODO experimental\n tryGc,\n transact,\n AbstractConnector,\n logType,\n mergeUpdates,\n mergeUpdatesV2,\n parseUpdateMeta,\n parseUpdateMetaV2,\n encodeStateVectorFromUpdate,\n encodeStateVectorFromUpdateV2,\n encodeRelativePosition,\n decodeRelativePosition,\n diffUpdate,\n diffUpdateV2,\n convertUpdateFormatV1ToV2,\n convertUpdateFormatV2ToV1,\n obfuscateUpdate,\n obfuscateUpdateV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n UpdateDecoderV1,\n UpdateDecoderV2,\n equalDeleteSets,\n mergeDeleteSets,\n snapshotContainsUpdate\n} from './internals.js'\n\nconst glo = /** @type {any} */ (typeof globalThis !== 'undefined'\n ? globalThis\n : typeof window !== 'undefined'\n ? window\n // @ts-ignore\n : typeof global !== 'undefined' ? global : {})\n\nconst importIdentifier = '__ $YJS$ __'\n\nif (glo[importIdentifier] === true) {\n /**\n * Dear reader of this message. Please take this seriously.\n *\n * If you see this message, make sure that you only import one version of Yjs. In many cases,\n * your package manager installs two versions of Yjs that are used by different packages within your project.\n * Another reason for this message is that some parts of your project use the commonjs version of Yjs\n * and others use the EcmaScript version of Yjs.\n *\n * This often leads to issues that are hard to debug. We often need to perform constructor checks,\n * e.g. `struct instanceof GC`. If you imported different versions of Yjs, it is impossible for us to\n * do the constructor checks anymore - which might break the CRDT algorithm.\n *\n * https://github.com/yjs/yjs/issues/438\n */\n console.error('Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438')\n}\nglo[importIdentifier] = true\n", "/**\n * @module awareness-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as time from 'lib0/time'\nimport * as math from 'lib0/math'\nimport { Observable } from 'lib0/observable'\nimport * as f from 'lib0/function'\nimport * as Y from 'yjs' // eslint-disable-line\n\nexport const outdatedTimeout = 30000\n\n/**\n * @typedef {Object} MetaClientState\n * @property {number} MetaClientState.clock\n * @property {number} MetaClientState.lastUpdated unix timestamp\n */\n\n/**\n * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information\n * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of\n * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.\n *\n * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override\n * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is\n * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that\n * a remote client is offline, it may propagate a message with\n * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a\n * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.\n *\n * Before a client disconnects, it should propagate a `null` state with an updated clock.\n *\n * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.\n *\n * @extends {Observable}\n */\nexport class Awareness extends Observable {\n /**\n * @param {Y.Doc} doc\n */\n constructor (doc) {\n super()\n this.doc = doc\n /**\n * @type {number}\n */\n this.clientID = doc.clientID\n /**\n * Maps from client id to client state\n * @type {Map>}\n */\n this.states = new Map()\n /**\n * @type {Map}\n */\n this.meta = new Map()\n this._checkInterval = /** @type {any} */ (setInterval(() => {\n const now = time.getUnixTime()\n if (this.getLocalState() !== null && (outdatedTimeout / 2 <= now - /** @type {{lastUpdated:number}} */ (this.meta.get(this.clientID)).lastUpdated)) {\n // renew local clock\n this.setLocalState(this.getLocalState())\n }\n /**\n * @type {Array}\n */\n const remove = []\n this.meta.forEach((meta, clientid) => {\n if (clientid !== this.clientID && outdatedTimeout <= now - meta.lastUpdated && this.states.has(clientid)) {\n remove.push(clientid)\n }\n })\n if (remove.length > 0) {\n removeAwarenessStates(this, remove, 'timeout')\n }\n }, math.floor(outdatedTimeout / 10)))\n doc.on('destroy', () => {\n this.destroy()\n })\n this.setLocalState({})\n }\n\n destroy () {\n this.emit('destroy', [this])\n this.setLocalState(null)\n super.destroy()\n clearInterval(this._checkInterval)\n }\n\n /**\n * @return {Object|null}\n */\n getLocalState () {\n return this.states.get(this.clientID) || null\n }\n\n /**\n * @param {Object|null} state\n */\n setLocalState (state) {\n const clientID = this.clientID\n const currLocalMeta = this.meta.get(clientID)\n const clock = currLocalMeta === undefined ? 0 : currLocalMeta.clock + 1\n const prevState = this.states.get(clientID)\n if (state === null) {\n this.states.delete(clientID)\n } else {\n this.states.set(clientID, state)\n }\n this.meta.set(clientID, {\n clock,\n lastUpdated: time.getUnixTime()\n })\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n if (state === null) {\n removed.push(clientID)\n } else if (prevState == null) {\n if (state != null) {\n added.push(clientID)\n }\n } else {\n updated.push(clientID)\n if (!f.equalityDeep(prevState, state)) {\n filteredUpdated.push(clientID)\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n this.emit('change', [{ added, updated: filteredUpdated, removed }, 'local'])\n }\n this.emit('update', [{ added, updated, removed }, 'local'])\n }\n\n /**\n * @param {string} field\n * @param {any} value\n */\n setLocalStateField (field, value) {\n const state = this.getLocalState()\n if (state !== null) {\n this.setLocalState({\n ...state,\n [field]: value\n })\n }\n }\n\n /**\n * @return {Map>}\n */\n getStates () {\n return this.states\n }\n}\n\n/**\n * Mark (remote) clients as inactive and remove them from the list of active peers.\n * This change will be propagated to remote clients.\n *\n * @param {Awareness} awareness\n * @param {Array} clients\n * @param {any} origin\n */\nexport const removeAwarenessStates = (awareness, clients, origin) => {\n const removed = []\n for (let i = 0; i < clients.length; i++) {\n const clientID = clients[i]\n if (awareness.states.has(clientID)) {\n awareness.states.delete(clientID)\n if (clientID === awareness.clientID) {\n const curMeta = /** @type {MetaClientState} */ (awareness.meta.get(clientID))\n awareness.meta.set(clientID, {\n clock: curMeta.clock + 1,\n lastUpdated: time.getUnixTime()\n })\n }\n removed.push(clientID)\n }\n }\n if (removed.length > 0) {\n awareness.emit('change', [{ added: [], updated: [], removed }, origin])\n awareness.emit('update', [{ added: [], updated: [], removed }, origin])\n }\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Array} clients\n * @return {Uint8Array}\n */\nexport const encodeAwarenessUpdate = (awareness, clients, states = awareness.states) => {\n const len = clients.length\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = clients[i]\n const state = states.get(clientID) || null\n const clock = /** @type {MetaClientState} */ (awareness.meta.get(clientID)).clock\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(state))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * Modify the content of an awareness update before re-encoding it to an awareness update.\n *\n * This might be useful when you have a central server that wants to ensure that clients\n * cant hijack somebody elses identity.\n *\n * @param {Uint8Array} update\n * @param {function(any):any} modify\n * @return {Uint8Array}\n */\nexport const modifyAwarenessUpdate = (update, modify) => {\n const decoder = decoding.createDecoder(update)\n const encoder = encoding.createEncoder()\n const len = decoding.readVarUint(decoder)\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n const clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const modifiedState = modify(state)\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(modifiedState))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Uint8Array} update\n * @param {any} origin This will be added to the emitted change event\n */\nexport const applyAwarenessUpdate = (awareness, update, origin) => {\n const decoder = decoding.createDecoder(update)\n const timestamp = time.getUnixTime()\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n const len = decoding.readVarUint(decoder)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n let clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const clientMeta = awareness.meta.get(clientID)\n const prevState = awareness.states.get(clientID)\n const currClock = clientMeta === undefined ? 0 : clientMeta.clock\n if (currClock < clock || (currClock === clock && state === null && awareness.states.has(clientID))) {\n if (state === null) {\n // never let a remote client remove this local state\n if (clientID === awareness.clientID && awareness.getLocalState() != null) {\n // remote client removed the local state. Do not remote state. Broadcast a message indicating\n // that this client still exists by increasing the clock\n clock++\n } else {\n awareness.states.delete(clientID)\n }\n } else {\n awareness.states.set(clientID, state)\n }\n awareness.meta.set(clientID, {\n clock,\n lastUpdated: timestamp\n })\n if (clientMeta === undefined && state !== null) {\n added.push(clientID)\n } else if (clientMeta !== undefined && state === null) {\n removed.push(clientID)\n } else if (state !== null) {\n if (!f.equalityDeep(state, prevState)) {\n filteredUpdated.push(clientID)\n }\n updated.push(clientID)\n }\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n awareness.emit('change', [{\n added, updated: filteredUpdated, removed\n }, origin])\n }\n if (added.length > 0 || updated.length > 0 || removed.length > 0) {\n awareness.emit('update', [{\n added, updated, removed\n }, origin])\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers to work with IndexedDB.\n *\n * @module indexeddb\n */\n\nimport * as promise from './promise.js'\nimport * as error from './error.js'\n\n/* c8 ignore start */\n\n/**\n * IDB Request to Promise transformer\n *\n * @param {IDBRequest} request\n * @return {Promise}\n */\nexport const rtop = request => promise.create((resolve, reject) => {\n // @ts-ignore\n request.onerror = event => reject(new Error(event.target.error))\n // @ts-ignore\n request.onsuccess = event => resolve(event.target.result)\n})\n\n/**\n * @param {string} name\n * @param {function(IDBDatabase):any} initDB Called when the database is first created\n * @return {Promise}\n */\nexport const openDB = (name, initDB) => promise.create((resolve, reject) => {\n const request = indexedDB.open(name)\n /**\n * @param {any} event\n */\n request.onupgradeneeded = event => initDB(event.target.result)\n /**\n * @param {any} event\n */\n request.onerror = event => reject(error.create(event.target.error))\n /**\n * @param {any} event\n */\n request.onsuccess = event => {\n /**\n * @type {IDBDatabase}\n */\n const db = event.target.result\n db.onversionchange = () => { db.close() }\n resolve(db)\n }\n})\n\n/**\n * @param {string} name\n */\nexport const deleteDB = name => rtop(indexedDB.deleteDatabase(name))\n\n/**\n * @param {IDBDatabase} db\n * @param {Array|Array>} definitions\n */\nexport const createStores = (db, definitions) => definitions.forEach(d =>\n // @ts-ignore\n db.createObjectStore.apply(db, d)\n)\n\n/**\n * @param {IDBDatabase} db\n * @param {Array} stores\n * @param {\"readwrite\"|\"readonly\"} [access]\n * @return {Array}\n */\nexport const transact = (db, stores, access = 'readwrite') => {\n const transaction = db.transaction(stores, access)\n return stores.map(store => getStore(transaction, store))\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @return {Promise}\n */\nexport const count = (store, range) =>\n rtop(store.count(range))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | Array } key\n * @return {Promise>}\n */\nexport const get = (store, key) =>\n rtop(store.get(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | IDBKeyRange | Array } key\n */\nexport const del = (store, key) =>\n rtop(store.delete(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} [key]\n */\nexport const put = (store, item, key) =>\n rtop(store.put(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} key\n * @return {Promise}\n */\nexport const add = (store, item, key) =>\n rtop(store.add(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date} item\n * @return {Promise} Returns the generated key\n */\nexport const addAutoKey = (store, item) =>\n rtop(store.add(item))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAll = (store, range, limit) =>\n rtop(store.getAll(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeys = (store, range, limit) =>\n rtop(store.getAllKeys(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} query\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n * @return {Promise}\n */\nexport const queryFirst = (store, query, direction) => {\n /**\n * @type {any}\n */\n let first = null\n return iterateKeys(store, query, key => {\n first = key\n return false\n }, direction).then(() => first)\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getLastKey = (store, range = null) => queryFirst(store, range, 'prev')\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getFirstKey = (store, range = null) => queryFirst(store, range, 'next')\n\n/**\n * @typedef KeyValuePair\n * @type {Object}\n * @property {any} k key\n * @property {any} v Value\n */\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeysValues = (store, range, limit) =>\n // @ts-ignore\n promise.all([getAllKeys(store, range, limit), getAll(store, range, limit)]).then(([ks, vs]) => ks.map((k, i) => ({ k, v: vs[i] })))\n\n/**\n * @param {any} request\n * @param {function(IDBCursorWithValue):void|boolean|Promise} f\n * @return {Promise}\n */\nconst iterateOnRequest = (request, f) => promise.create((resolve, reject) => {\n request.onerror = reject\n /**\n * @param {any} event\n */\n request.onsuccess = async event => {\n const cursor = event.target.result\n if (cursor === null || (await f(cursor)) === false) {\n return resolve()\n }\n cursor.continue()\n }\n})\n\n/**\n * Iterate on keys and values\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any,any):void|boolean|Promise} f Callback that receives (value, key)\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterate = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openCursor(keyrange, direction), cursor => f(cursor.value, cursor.key))\n\n/**\n * Iterate on the keys (no values)\n *\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any):void|boolean|Promise} f callback that receives the key\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterateKeys = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openKeyCursor(keyrange, direction), cursor => f(cursor.key))\n\n/**\n * Open store from transaction\n * @param {IDBTransaction} t\n * @param {String} store\n * @returns {IDBObjectStore}\n */\nexport const getStore = (t, store) => t.objectStore(store)\n\n/**\n * @param {any} lower\n * @param {any} upper\n * @param {boolean} lowerOpen\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeBound = (lower, upper, lowerOpen, upperOpen) => IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen)\n\n/**\n * @param {any} upper\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeUpperBound = (upper, upperOpen) => IDBKeyRange.upperBound(upper, upperOpen)\n\n/**\n * @param {any} lower\n * @param {boolean} lowerOpen\n */\nexport const createIDBKeyRangeLowerBound = (lower, lowerOpen) => IDBKeyRange.lowerBound(lower, lowerOpen)\n\n/* c8 ignore stop */\n", "import * as Y from 'yjs'\nimport * as idb from 'lib0/indexeddb'\nimport * as promise from 'lib0/promise'\nimport { Observable } from 'lib0/observable'\n\nconst customStoreName = 'custom'\nconst updatesStoreName = 'updates'\n\nexport const PREFERRED_TRIM_SIZE = 500\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {function(IDBObjectStore):void} [beforeApplyUpdatesCallback]\n * @param {function(IDBObjectStore):void} [afterApplyUpdatesCallback]\n */\nexport const fetchUpdates = (idbPersistence, beforeApplyUpdatesCallback = () => {}, afterApplyUpdatesCallback = () => {}) => {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (idbPersistence.db), [updatesStoreName]) // , 'readonly')\n return idb.getAll(updatesStore, idb.createIDBKeyRangeLowerBound(idbPersistence._dbref, false)).then(updates => {\n if (!idbPersistence._destroyed) {\n beforeApplyUpdatesCallback(updatesStore)\n Y.transact(idbPersistence.doc, () => {\n updates.forEach(val => Y.applyUpdate(idbPersistence.doc, val))\n }, idbPersistence, false)\n afterApplyUpdatesCallback(updatesStore)\n }\n })\n .then(() => idb.getLastKey(updatesStore).then(lastKey => { idbPersistence._dbref = lastKey + 1 }))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n .then(() => updatesStore)\n}\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {boolean} forceStore\n */\nexport const storeState = (idbPersistence, forceStore = true) =>\n fetchUpdates(idbPersistence)\n .then(updatesStore => {\n if (forceStore || idbPersistence._dbsize >= PREFERRED_TRIM_SIZE) {\n idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(idbPersistence.doc))\n .then(() => idb.del(updatesStore, idb.createIDBKeyRangeUpperBound(idbPersistence._dbref, true)))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n }\n })\n\n/**\n * @param {string} name\n */\nexport const clearDocument = name => idb.deleteDB(name)\n\n/**\n * @extends Observable\n */\nexport class IndexeddbPersistence extends Observable {\n /**\n * @param {string} name\n * @param {Y.Doc} doc\n */\n constructor (name, doc) {\n super()\n this.doc = doc\n this.name = name\n this._dbref = 0\n this._dbsize = 0\n this._destroyed = false\n /**\n * @type {IDBDatabase|null}\n */\n this.db = null\n this.synced = false\n this._db = idb.openDB(name, db =>\n idb.createStores(db, [\n ['updates', { autoIncrement: true }],\n ['custom']\n ])\n )\n /**\n * @type {Promise}\n */\n this.whenSynced = promise.create(resolve => this.on('synced', () => resolve(this)))\n\n this._db.then(db => {\n this.db = db\n /**\n * @param {IDBObjectStore} updatesStore\n */\n const beforeApplyUpdatesCallback = (updatesStore) => idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(doc))\n const afterApplyUpdatesCallback = () => {\n if (this._destroyed) return this\n this.synced = true\n this.emit('synced', [this])\n }\n fetchUpdates(this, beforeApplyUpdatesCallback, afterApplyUpdatesCallback)\n })\n /**\n * Timeout in ms untill data is merged and persisted in idb.\n */\n this._storeTimeout = 1000\n /**\n * @type {any}\n */\n this._storeTimeoutId = null\n /**\n * @param {Uint8Array} update\n * @param {any} origin\n */\n this._storeUpdate = (update, origin) => {\n if (this.db && origin !== this) {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (this.db), [updatesStoreName])\n idb.addAutoKey(updatesStore, update)\n if (++this._dbsize >= PREFERRED_TRIM_SIZE) {\n // debounce store call\n if (this._storeTimeoutId !== null) {\n clearTimeout(this._storeTimeoutId)\n }\n this._storeTimeoutId = setTimeout(() => {\n storeState(this, false)\n this._storeTimeoutId = null\n }, this._storeTimeout)\n }\n }\n }\n doc.on('update', this._storeUpdate)\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n destroy () {\n if (this._storeTimeoutId) {\n clearTimeout(this._storeTimeoutId)\n }\n this.doc.off('update', this._storeUpdate)\n this.doc.off('destroy', this.destroy)\n this._destroyed = true\n return this._db.then(db => {\n db.close()\n })\n }\n\n /**\n * Destroys this instance and removes all data from indexeddb.\n *\n * @return {Promise}\n */\n clearData () {\n return this.destroy().then(() => {\n idb.deleteDB(this.name)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n get (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName], 'readonly')\n return idb.get(custom, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @param {String | number | ArrayBuffer | Date} value\n * @return {Promise}\n */\n set (key, value) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.put(custom, value, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n del (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.del(custom, key)\n })\n }\n}\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", "import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n", "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n", "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", "import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n", "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n", "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", "import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n", "import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n", "import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n", "import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n", "import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n", "import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n", "import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n", "import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n", "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n", "import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n", "import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n", "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n", "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n", "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n", "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n", "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n", "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n", "import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n", "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", "import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n", "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n", "import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n", "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n", "import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n", "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n", "import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n", "import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n", "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", "import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n", "import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", "import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n", "import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n", "import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n", "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", "import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n", "import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n", "import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n", "import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n", "import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n", "import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n", "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n", "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n", "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n", "import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n", "import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n", "import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n", "import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n", "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n", "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n", "/**\n * @license\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"es\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\nexport { default as add } from './add.js';\nexport { default as after } from './after.js';\nexport { default as ary } from './ary.js';\nexport { default as assign } from './assign.js';\nexport { default as assignIn } from './assignIn.js';\nexport { default as assignInWith } from './assignInWith.js';\nexport { default as assignWith } from './assignWith.js';\nexport { default as at } from './at.js';\nexport { default as attempt } from './attempt.js';\nexport { default as before } from './before.js';\nexport { default as bind } from './bind.js';\nexport { default as bindAll } from './bindAll.js';\nexport { default as bindKey } from './bindKey.js';\nexport { default as camelCase } from './camelCase.js';\nexport { default as capitalize } from './capitalize.js';\nexport { default as castArray } from './castArray.js';\nexport { default as ceil } from './ceil.js';\nexport { default as chain } from './chain.js';\nexport { default as chunk } from './chunk.js';\nexport { default as clamp } from './clamp.js';\nexport { default as clone } from './clone.js';\nexport { default as cloneDeep } from './cloneDeep.js';\nexport { default as cloneDeepWith } from './cloneDeepWith.js';\nexport { default as cloneWith } from './cloneWith.js';\nexport { default as commit } from './commit.js';\nexport { default as compact } from './compact.js';\nexport { default as concat } from './concat.js';\nexport { default as cond } from './cond.js';\nexport { default as conforms } from './conforms.js';\nexport { default as conformsTo } from './conformsTo.js';\nexport { default as constant } from './constant.js';\nexport { default as countBy } from './countBy.js';\nexport { default as create } from './create.js';\nexport { default as curry } from './curry.js';\nexport { default as curryRight } from './curryRight.js';\nexport { default as debounce } from './debounce.js';\nexport { default as deburr } from './deburr.js';\nexport { default as defaultTo } from './defaultTo.js';\nexport { default as defaults } from './defaults.js';\nexport { default as defaultsDeep } from './defaultsDeep.js';\nexport { default as defer } from './defer.js';\nexport { default as delay } from './delay.js';\nexport { default as difference } from './difference.js';\nexport { default as differenceBy } from './differenceBy.js';\nexport { default as differenceWith } from './differenceWith.js';\nexport { default as divide } from './divide.js';\nexport { default as drop } from './drop.js';\nexport { default as dropRight } from './dropRight.js';\nexport { default as dropRightWhile } from './dropRightWhile.js';\nexport { default as dropWhile } from './dropWhile.js';\nexport { default as each } from './each.js';\nexport { default as eachRight } from './eachRight.js';\nexport { default as endsWith } from './endsWith.js';\nexport { default as entries } from './entries.js';\nexport { default as entriesIn } from './entriesIn.js';\nexport { default as eq } from './eq.js';\nexport { default as escape } from './escape.js';\nexport { default as escapeRegExp } from './escapeRegExp.js';\nexport { default as every } from './every.js';\nexport { default as extend } from './extend.js';\nexport { default as extendWith } from './extendWith.js';\nexport { default as fill } from './fill.js';\nexport { default as filter } from './filter.js';\nexport { default as find } from './find.js';\nexport { default as findIndex } from './findIndex.js';\nexport { default as findKey } from './findKey.js';\nexport { default as findLast } from './findLast.js';\nexport { default as findLastIndex } from './findLastIndex.js';\nexport { default as findLastKey } from './findLastKey.js';\nexport { default as first } from './first.js';\nexport { default as flatMap } from './flatMap.js';\nexport { default as flatMapDeep } from './flatMapDeep.js';\nexport { default as flatMapDepth } from './flatMapDepth.js';\nexport { default as flatten } from './flatten.js';\nexport { default as flattenDeep } from './flattenDeep.js';\nexport { default as flattenDepth } from './flattenDepth.js';\nexport { default as flip } from './flip.js';\nexport { default as floor } from './floor.js';\nexport { default as flow } from './flow.js';\nexport { default as flowRight } from './flowRight.js';\nexport { default as forEach } from './forEach.js';\nexport { default as forEachRight } from './forEachRight.js';\nexport { default as forIn } from './forIn.js';\nexport { default as forInRight } from './forInRight.js';\nexport { default as forOwn } from './forOwn.js';\nexport { default as forOwnRight } from './forOwnRight.js';\nexport { default as fromPairs } from './fromPairs.js';\nexport { default as functions } from './functions.js';\nexport { default as functionsIn } from './functionsIn.js';\nexport { default as get } from './get.js';\nexport { default as groupBy } from './groupBy.js';\nexport { default as gt } from './gt.js';\nexport { default as gte } from './gte.js';\nexport { default as has } from './has.js';\nexport { default as hasIn } from './hasIn.js';\nexport { default as head } from './head.js';\nexport { default as identity } from './identity.js';\nexport { default as inRange } from './inRange.js';\nexport { default as includes } from './includes.js';\nexport { default as indexOf } from './indexOf.js';\nexport { default as initial } from './initial.js';\nexport { default as intersection } from './intersection.js';\nexport { default as intersectionBy } from './intersectionBy.js';\nexport { default as intersectionWith } from './intersectionWith.js';\nexport { default as invert } from './invert.js';\nexport { default as invertBy } from './invertBy.js';\nexport { default as invoke } from './invoke.js';\nexport { default as invokeMap } from './invokeMap.js';\nexport { default as isArguments } from './isArguments.js';\nexport { default as isArray } from './isArray.js';\nexport { default as isArrayBuffer } from './isArrayBuffer.js';\nexport { default as isArrayLike } from './isArrayLike.js';\nexport { default as isArrayLikeObject } from './isArrayLikeObject.js';\nexport { default as isBoolean } from './isBoolean.js';\nexport { default as isBuffer } from './isBuffer.js';\nexport { default as isDate } from './isDate.js';\nexport { default as isElement } from './isElement.js';\nexport { default as isEmpty } from './isEmpty.js';\nexport { default as isEqual } from './isEqual.js';\nexport { default as isEqualWith } from './isEqualWith.js';\nexport { default as isError } from './isError.js';\nexport { default as isFinite } from './isFinite.js';\nexport { default as isFunction } from './isFunction.js';\nexport { default as isInteger } from './isInteger.js';\nexport { default as isLength } from './isLength.js';\nexport { default as isMap } from './isMap.js';\nexport { default as isMatch } from './isMatch.js';\nexport { default as isMatchWith } from './isMatchWith.js';\nexport { default as isNaN } from './isNaN.js';\nexport { default as isNative } from './isNative.js';\nexport { default as isNil } from './isNil.js';\nexport { default as isNull } from './isNull.js';\nexport { default as isNumber } from './isNumber.js';\nexport { default as isObject } from './isObject.js';\nexport { default as isObjectLike } from './isObjectLike.js';\nexport { default as isPlainObject } from './isPlainObject.js';\nexport { default as isRegExp } from './isRegExp.js';\nexport { default as isSafeInteger } from './isSafeInteger.js';\nexport { default as isSet } from './isSet.js';\nexport { default as isString } from './isString.js';\nexport { default as isSymbol } from './isSymbol.js';\nexport { default as isTypedArray } from './isTypedArray.js';\nexport { default as isUndefined } from './isUndefined.js';\nexport { default as isWeakMap } from './isWeakMap.js';\nexport { default as isWeakSet } from './isWeakSet.js';\nexport { default as iteratee } from './iteratee.js';\nexport { default as join } from './join.js';\nexport { default as kebabCase } from './kebabCase.js';\nexport { default as keyBy } from './keyBy.js';\nexport { default as keys } from './keys.js';\nexport { default as keysIn } from './keysIn.js';\nexport { default as last } from './last.js';\nexport { default as lastIndexOf } from './lastIndexOf.js';\nexport { default as lodash } from './wrapperLodash.js';\nexport { default as lowerCase } from './lowerCase.js';\nexport { default as lowerFirst } from './lowerFirst.js';\nexport { default as lt } from './lt.js';\nexport { default as lte } from './lte.js';\nexport { default as map } from './map.js';\nexport { default as mapKeys } from './mapKeys.js';\nexport { default as mapValues } from './mapValues.js';\nexport { default as matches } from './matches.js';\nexport { default as matchesProperty } from './matchesProperty.js';\nexport { default as max } from './max.js';\nexport { default as maxBy } from './maxBy.js';\nexport { default as mean } from './mean.js';\nexport { default as meanBy } from './meanBy.js';\nexport { default as memoize } from './memoize.js';\nexport { default as merge } from './merge.js';\nexport { default as mergeWith } from './mergeWith.js';\nexport { default as method } from './method.js';\nexport { default as methodOf } from './methodOf.js';\nexport { default as min } from './min.js';\nexport { default as minBy } from './minBy.js';\nexport { default as mixin } from './mixin.js';\nexport { default as multiply } from './multiply.js';\nexport { default as negate } from './negate.js';\nexport { default as next } from './next.js';\nexport { default as noop } from './noop.js';\nexport { default as now } from './now.js';\nexport { default as nth } from './nth.js';\nexport { default as nthArg } from './nthArg.js';\nexport { default as omit } from './omit.js';\nexport { default as omitBy } from './omitBy.js';\nexport { default as once } from './once.js';\nexport { default as orderBy } from './orderBy.js';\nexport { default as over } from './over.js';\nexport { default as overArgs } from './overArgs.js';\nexport { default as overEvery } from './overEvery.js';\nexport { default as overSome } from './overSome.js';\nexport { default as pad } from './pad.js';\nexport { default as padEnd } from './padEnd.js';\nexport { default as padStart } from './padStart.js';\nexport { default as parseInt } from './parseInt.js';\nexport { default as partial } from './partial.js';\nexport { default as partialRight } from './partialRight.js';\nexport { default as partition } from './partition.js';\nexport { default as pick } from './pick.js';\nexport { default as pickBy } from './pickBy.js';\nexport { default as plant } from './plant.js';\nexport { default as property } from './property.js';\nexport { default as propertyOf } from './propertyOf.js';\nexport { default as pull } from './pull.js';\nexport { default as pullAll } from './pullAll.js';\nexport { default as pullAllBy } from './pullAllBy.js';\nexport { default as pullAllWith } from './pullAllWith.js';\nexport { default as pullAt } from './pullAt.js';\nexport { default as random } from './random.js';\nexport { default as range } from './range.js';\nexport { default as rangeRight } from './rangeRight.js';\nexport { default as rearg } from './rearg.js';\nexport { default as reduce } from './reduce.js';\nexport { default as reduceRight } from './reduceRight.js';\nexport { default as reject } from './reject.js';\nexport { default as remove } from './remove.js';\nexport { default as repeat } from './repeat.js';\nexport { default as replace } from './replace.js';\nexport { default as rest } from './rest.js';\nexport { default as result } from './result.js';\nexport { default as reverse } from './reverse.js';\nexport { default as round } from './round.js';\nexport { default as sample } from './sample.js';\nexport { default as sampleSize } from './sampleSize.js';\nexport { default as set } from './set.js';\nexport { default as setWith } from './setWith.js';\nexport { default as shuffle } from './shuffle.js';\nexport { default as size } from './size.js';\nexport { default as slice } from './slice.js';\nexport { default as snakeCase } from './snakeCase.js';\nexport { default as some } from './some.js';\nexport { default as sortBy } from './sortBy.js';\nexport { default as sortedIndex } from './sortedIndex.js';\nexport { default as sortedIndexBy } from './sortedIndexBy.js';\nexport { default as sortedIndexOf } from './sortedIndexOf.js';\nexport { default as sortedLastIndex } from './sortedLastIndex.js';\nexport { default as sortedLastIndexBy } from './sortedLastIndexBy.js';\nexport { default as sortedLastIndexOf } from './sortedLastIndexOf.js';\nexport { default as sortedUniq } from './sortedUniq.js';\nexport { default as sortedUniqBy } from './sortedUniqBy.js';\nexport { default as split } from './split.js';\nexport { default as spread } from './spread.js';\nexport { default as startCase } from './startCase.js';\nexport { default as startsWith } from './startsWith.js';\nexport { default as stubArray } from './stubArray.js';\nexport { default as stubFalse } from './stubFalse.js';\nexport { default as stubObject } from './stubObject.js';\nexport { default as stubString } from './stubString.js';\nexport { default as stubTrue } from './stubTrue.js';\nexport { default as subtract } from './subtract.js';\nexport { default as sum } from './sum.js';\nexport { default as sumBy } from './sumBy.js';\nexport { default as tail } from './tail.js';\nexport { default as take } from './take.js';\nexport { default as takeRight } from './takeRight.js';\nexport { default as takeRightWhile } from './takeRightWhile.js';\nexport { default as takeWhile } from './takeWhile.js';\nexport { default as tap } from './tap.js';\nexport { default as template } from './template.js';\nexport { default as templateSettings } from './templateSettings.js';\nexport { default as throttle } from './throttle.js';\nexport { default as thru } from './thru.js';\nexport { default as times } from './times.js';\nexport { default as toArray } from './toArray.js';\nexport { default as toFinite } from './toFinite.js';\nexport { default as toInteger } from './toInteger.js';\nexport { default as toIterator } from './toIterator.js';\nexport { default as toJSON } from './toJSON.js';\nexport { default as toLength } from './toLength.js';\nexport { default as toLower } from './toLower.js';\nexport { default as toNumber } from './toNumber.js';\nexport { default as toPairs } from './toPairs.js';\nexport { default as toPairsIn } from './toPairsIn.js';\nexport { default as toPath } from './toPath.js';\nexport { default as toPlainObject } from './toPlainObject.js';\nexport { default as toSafeInteger } from './toSafeInteger.js';\nexport { default as toString } from './toString.js';\nexport { default as toUpper } from './toUpper.js';\nexport { default as transform } from './transform.js';\nexport { default as trim } from './trim.js';\nexport { default as trimEnd } from './trimEnd.js';\nexport { default as trimStart } from './trimStart.js';\nexport { default as truncate } from './truncate.js';\nexport { default as unary } from './unary.js';\nexport { default as unescape } from './unescape.js';\nexport { default as union } from './union.js';\nexport { default as unionBy } from './unionBy.js';\nexport { default as unionWith } from './unionWith.js';\nexport { default as uniq } from './uniq.js';\nexport { default as uniqBy } from './uniqBy.js';\nexport { default as uniqWith } from './uniqWith.js';\nexport { default as uniqueId } from './uniqueId.js';\nexport { default as unset } from './unset.js';\nexport { default as unzip } from './unzip.js';\nexport { default as unzipWith } from './unzipWith.js';\nexport { default as update } from './update.js';\nexport { default as updateWith } from './updateWith.js';\nexport { default as upperCase } from './upperCase.js';\nexport { default as upperFirst } from './upperFirst.js';\nexport { default as value } from './value.js';\nexport { default as valueOf } from './valueOf.js';\nexport { default as values } from './values.js';\nexport { default as valuesIn } from './valuesIn.js';\nexport { default as without } from './without.js';\nexport { default as words } from './words.js';\nexport { default as wrap } from './wrap.js';\nexport { default as wrapperAt } from './wrapperAt.js';\nexport { default as wrapperChain } from './wrapperChain.js';\nexport { default as wrapperCommit } from './commit.js';\nexport { default as wrapperLodash } from './wrapperLodash.js';\nexport { default as wrapperNext } from './next.js';\nexport { default as wrapperPlant } from './plant.js';\nexport { default as wrapperReverse } from './wrapperReverse.js';\nexport { default as wrapperToIterator } from './toIterator.js';\nexport { default as wrapperValue } from './wrapperValue.js';\nexport { default as xor } from './xor.js';\nexport { default as xorBy } from './xorBy.js';\nexport { default as xorWith } from './xorWith.js';\nexport { default as zip } from './zip.js';\nexport { default as zipObject } from './zipObject.js';\nexport { default as zipObjectDeep } from './zipObjectDeep.js';\nexport { default as zipWith } from './zipWith.js';\nexport { default } from './lodash.default.js';\n", "enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n", "import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n", "export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n", "import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n", "import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n", "import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n", "import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n", "import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n", "import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n", "import type LinkedNode from './linked-node.js';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n", "import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot | null): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record,\n obj2: Record,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n", "import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n", "import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n", "import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n", "import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n", "/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @param {boolean} [cleanup] Apply semantic cleanup before returning.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n if (cleanup) {\n diff_cleanupSemantic(diffs);\n }\n return diffs;\n}\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)],\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n}\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = delta % 2 !== 0;\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length &&\n y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length &&\n y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ===\n text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n}\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n}\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\nfunction diff_commonOverlap_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (\n found == 0 ||\n text1.substring(text_length - length) == text2.substring(0, length)\n ) {\n best = length;\n length++;\n }\n }\n}\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = \"\";\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i),\n shorttext.substring(j)\n );\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i),\n shorttext.substring(0, j)\n );\n if (best_common.length < suffixLength + prefixLength) {\n best_common =\n shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a,\n best_longtext_b,\n best_shorttext_a,\n best_shorttext_b,\n best_common,\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 4)\n );\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 2)\n );\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n}\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemantic(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) {\n // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else {\n // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (\n lastequality &&\n lastequality.length <=\n Math.max(length_insertions1, length_deletions1) &&\n lastequality.length <= Math.max(length_insertions2, length_deletions2)\n ) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0, [\n DIFF_DELETE,\n lastequality,\n ]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (\n diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT\n ) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (\n overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2\n ) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n insertion.substring(0, overlap_length1),\n ]);\n diffs[pointer - 1][1] = deletion.substring(\n 0,\n deletion.length - overlap_length1\n );\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (\n overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2\n ) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n deletion.substring(0, overlap_length2),\n ]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] = insertion.substring(\n 0,\n insertion.length - overlap_length2\n );\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] = deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n}\n\nvar nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\nvar whitespaceRegex_ = /\\s/;\nvar linebreakRegex_ = /[\\r\\n]/;\nvar blanklineEndRegex_ = /\\n\\r?\\n$/;\nvar blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemanticLossless(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);\n var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);\n var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);\n var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);\n var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n}\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, \"\"]); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = \"\";\n var text_insert = \"\";\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (\n previous_equality >= 0 &&\n ends_with_pair_start(diffs[previous_equality][1])\n ) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(\n 0,\n -1\n );\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(\n 0,\n commonlength\n );\n } else {\n diffs.splice(0, 0, [\n DIFF_EQUAL,\n text_insert.substring(0, commonlength),\n ]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) +\n diffs[pointer][1];\n text_insert = text_insert.substring(\n 0,\n text_insert.length - commonlength\n );\n text_delete = text_delete.substring(\n 0,\n text_delete.length - commonlength\n );\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(\n pointer - n,\n n,\n [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]\n );\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = \"\";\n text_insert = \"\";\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === \"\") {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n if (\n diffs[pointer][1].substring(\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n ) === diffs[pointer - 1][1]\n ) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] =\n diffs[pointer - 1][1] +\n diffs[pointer][1].substring(\n 0,\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n );\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (\n diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]\n ) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n}\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xd800 && charCode <= 0xdbff;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xdc00 && charCode <= 0xdfff;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after],\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange =\n typeof cursor_pos === \"number\"\n ? { index: cursor_pos, length: 0 }\n : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === \"number\" ? null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos, cleanup) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, cleanup, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n", "/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n", "/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n", "import cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\n\ninterface AttributeMap {\n [key: string]: unknown;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n", "import AttributeMap from './AttributeMap';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | Record;\n delete?: number;\n retain?: number | Record;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n return 1;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n", "import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (\n typeof nextOp.retain === 'object' &&\n nextOp.retain !== null\n ) {\n // offset should === 0, length should === 1\n retOp.retain = nextOp.retain;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n const op = this.ops[this.index];\n if (op) {\n if (typeof op.delete === 'number') {\n return 'delete';\n } else if (\n typeof op.retain === 'number' ||\n (typeof op.retain === 'object' && op.retain !== null)\n ) {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n", "import * as diff from 'fast-diff';\nimport cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\nimport OpIterator from './OpIterator';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\ninterface EmbedHandler {\n compose(a: T, b: T, keepNull: boolean): T;\n invert(a: T, b: T): T;\n transform(a: T, b: T, priority: boolean): T;\n}\n\nconst getEmbedTypeAndData = (\n a: Op['insert'] | Op['retain'],\n b: Op['insert'],\n): [string, unknown, unknown] => {\n if (typeof a !== 'object' || a === null) {\n throw new Error(`cannot retain a ${typeof a}`);\n }\n if (typeof b !== 'object' || b === null) {\n throw new Error(`cannot retain a ${typeof b}`);\n }\n const embedType = Object.keys(a)[0];\n if (!embedType || embedType !== Object.keys(b)[0]) {\n throw new Error(\n `embed types not matched: ${embedType} != ${Object.keys(b)[0]}`,\n );\n }\n return [embedType, a[embedType], b[embedType]];\n};\n\nclass Delta {\n static Op = Op;\n static OpIterator = OpIterator;\n static AttributeMap = AttributeMap;\n private static handlers: { [embedType: string]: EmbedHandler } = {};\n\n static registerEmbed(embedType: string, handler: EmbedHandler): void {\n this.handlers[embedType] = handler;\n }\n\n static unregisterEmbed(embedType: string): void {\n delete this.handlers[embedType];\n }\n\n private static getHandler(embedType: string): EmbedHandler {\n const handler = this.handlers[embedType];\n if (!handler) {\n throw new Error(`no handlers for embed type \"${embedType}\"`);\n }\n return handler;\n }\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(\n arg: string | Record,\n attributes?: AttributeMap | null,\n ): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(\n length: number | Record,\n attributes?: AttributeMap | null,\n ): this {\n if (typeof length === 'number' && length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = new OpIterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (otherOp.retain) {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain =\n typeof otherOp.retain === 'number' ? length : otherOp.retain;\n } else {\n if (typeof otherOp.retain === 'number') {\n if (thisOp.retain == null) {\n newOp.insert = thisOp.insert;\n } else {\n newOp.retain = thisOp.retain;\n }\n } else {\n const action = thisOp.retain == null ? 'insert' : 'retain';\n const [embedType, thisData, otherData] = getEmbedTypeAndData(\n thisOp[action],\n otherOp.retain,\n );\n const handler = Delta.getHandler(embedType);\n newOp[action] = {\n [embedType]: handler.compose(\n thisData,\n otherData,\n action === 'retain',\n ),\n };\n }\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n (typeof thisOp.retain === 'number' ||\n (typeof thisOp.retain === 'object' && thisOp.retain !== null))\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor, true);\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = new OpIterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (typeof op.retain === 'number' && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || typeof op.retain === 'number') {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n const slice = base.slice(baseIndex, baseIndex + 1);\n const baseOp = new OpIterator(slice.ops).next();\n const [embedType, opData, baseOpData] = getEmbedTypeAndData(\n op.retain,\n baseOp.insert,\n );\n const handler = Delta.getHandler(embedType);\n inverted.retain(\n { [embedType]: handler.invert(opData, baseOpData) },\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n return baseIndex + 1;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n const thisData = thisOp.retain;\n const otherData = otherOp.retain;\n let transformedData: Op['retain'] =\n typeof otherData === 'object' && otherData !== null\n ? otherData\n : length;\n if (\n typeof thisData === 'object' &&\n thisData !== null &&\n typeof otherData === 'object' &&\n otherData !== null\n ) {\n const embedType = Object.keys(thisData)[0];\n if (embedType === Object.keys(otherData)[0]) {\n const handler = Delta.getHandler(embedType);\n if (handler) {\n transformedData = {\n [embedType]: handler.transform(\n thisData[embedType],\n otherData[embedType],\n priority,\n ),\n };\n }\n }\n }\n\n // We retain either their retain or insert\n delta.retain(\n transformedData,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = new OpIterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport default Delta;\n\nexport { Op, OpIterator, AttributeMap };\n\nif (typeof module === 'object') {\n module.exports = Delta;\n module.exports.default = Delta;\n}\n", "import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n", "import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text: string) {\n return text.replace(/[&<>\"']/g, (s) => {\n // https://lodash.com/docs#escape\n const entityMap: Record = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n", "import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport type { BlotConstructor } from 'parchment';\nimport Break from './break.js';\nimport Text from './text.js';\n\nclass Inline extends InlineBlot {\n static allowedChildren: BlotConstructor[] = [Inline, Break, EmbedBlot, Text];\n // Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n static order = [\n 'cursor',\n 'inline', // Must be lower\n 'link', // Chrome wants to be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'code', // Must be higher\n ];\n\n static compare(self: string, other: string) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n // @ts-expect-error TODO: make isolate generic\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\n\nexport default Inline;\n", "import {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport type { Blot, Parent } from 'parchment';\nimport Delta from 'quill-delta';\nimport Break from './break.js';\nimport Inline from './inline.js';\nimport TextBlot from './text.js';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n cache: { delta?: Delta | null; length?: number } = {};\n\n delta(): Delta {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index: number, length: number) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift() as string;\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block: Blot | this = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target: Parent, ref?: Blot | null) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index: number) {\n return super.path(index, true);\n }\n\n removeChild(child: Blot) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index: number, force: boolean | undefined = false): Blot | null {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attributes: AttributorStore;\n domNode: HTMLElement;\n\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), {\n ...this.formats(),\n ...this.attributes.values(),\n });\n }\n\n format(name: string, value: unknown) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n this.format(name, value);\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map((line) => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach((block) => {\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot: BlockBlot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(\n blot: Blot | null,\n formats: Record = {},\n filter = true,\n): Record {\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = {\n ...formats,\n ...blot.formats(),\n };\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n", "import { EmbedBlot, Scope } from 'parchment';\nimport type { Parent, ScrollBlot } from 'parchment';\nimport type Selection from '../core/selection.js';\nimport TextBlot from './text.js';\nimport type { EmbedContextRange } from './embed.js';\n\nclass Cursor extends EmbedBlot {\n static blotName = 'cursor';\n static className = 'ql-cursor';\n static tagName = 'span';\n static CONTENTS = '\\uFEFF'; // Zero width no break space\n\n static value() {\n return undefined;\n }\n\n selection: Selection;\n textNode: Text;\n savedLength: number;\n\n constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name: string, value: unknown) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let target: Parent | this = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: allow empty context in Parchment\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node: Node, offset: number) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position(): [Text, number] {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n // @ts-expect-error Fix me later\n this.parent = null;\n }\n\n restore(): EmbedContextRange | null {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Browser may push down styles/nodes inside the cursor blot.\n // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n // @ts-expect-error Fix me later\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n // @ts-expect-error TODO: make TextBlot.text public\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node: Node, offset: number) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n // Avoid .ql-cursor being a descendant of ``.\n // The reason is Safari pushes down `` on text insertion.\n // That will cause DOM nodes not sync with the model.\n //\n // For example ({I} is the caret), given the markup:\n // \\uFEFF{I}\n // When typing a char \"x\", `` will be pushed down inside the `` first:\n // \\uFEFF{I}\n // And then \"x\" will be inserted after ``:\n // \\uFEFFd{I}\n optimize(context?: unknown) {\n // @ts-expect-error Fix me later\n super.optimize(context);\n\n let { parent } = this;\n while (parent) {\n if (parent.domNode.tagName === 'A') {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: make isolate generic\n parent.isolate(this.offset(parent), this.length()).unwrap();\n this.savedLength = 0;\n break;\n }\n parent = parent.parent;\n }\n }\n\n value() {\n return '';\n }\n}\n\nexport default Cursor;\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n", "import type Quill from '../core.js';\n\nexport default new WeakMap();\n", "const levels = ['error', 'warn', 'log', 'info'] as const;\nexport type DebugLevel = (typeof levels)[number];\nlet level: DebugLevel | false = 'warn';\n\nfunction debug(method: DebugLevel, ...args: unknown[]) {\n if (level) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n\nfunction namespace(\n ns: string,\n): Record void> {\n return levels.reduce(\n (logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n },\n {} as Record void>,\n );\n}\n\nnamespace.level = (newLevel: DebugLevel | false) => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n", "import { EventEmitter } from 'eventemitter3';\nimport instances from './instances.js';\nimport logger from './logger.js';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach((eventName) => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach((node) => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n static events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SCROLL_EMBED_UPDATE: 'scroll-embed-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n COMPOSITION_BEFORE_START: 'composition-before-start',\n COMPOSITION_START: 'composition-start',\n COMPOSITION_BEFORE_END: 'composition-before-end',\n COMPOSITION_END: 'composition-end',\n } as const;\n\n static sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n } as const;\n\n protected domListeners: Record;\n\n constructor() {\n super();\n this.domListeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args: unknown[]): boolean {\n debug.log.call(debug, ...args);\n // @ts-expect-error\n return super.emit(...args);\n }\n\n handleDOM(event: Event, ...args: unknown[]) {\n (this.domListeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target as Node)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName: string, node: Node, handler: EventListener) {\n if (!this.domListeners[eventName]) {\n this.domListeners[eventName] = [];\n }\n this.domListeners[eventName].push({ node, handler });\n }\n}\n\nexport type EmitterSource =\n (typeof Emitter.sources)[keyof typeof Emitter.sources];\n\nexport default Emitter;\n", "import { LeafBlot, Scope } from 'parchment';\nimport { cloneDeep, isEqual } from 'lodash-es';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport logger from './logger.js';\nimport type Cursor from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\n\nconst debug = logger('quill:selection');\n\ntype NativeRange = AbstractRange;\n\ninterface NormalizedRange {\n start: {\n node: NativeRange['startContainer'];\n offset: NativeRange['startOffset'];\n };\n end: { node: NativeRange['endContainer']; offset: NativeRange['endOffset'] };\n native: NativeRange;\n}\n\nexport interface Bounds {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n}\n\nexport class Range {\n constructor(\n public index: number,\n public length = 0,\n ) {}\n}\n\nclass Selection {\n scroll: Scroll;\n emitter: Emitter;\n composing: boolean;\n mouseDown: boolean;\n\n root: HTMLElement;\n cursor: Cursor;\n savedRange: Range;\n lastRange: Range | null;\n lastNative: NormalizedRange | null;\n\n constructor(scroll: Scroll, emitter: Emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n // @ts-expect-error\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.lastNative = null;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(\n Emitter.events.SCROLL_UPDATE,\n (source, mutations: MutationRecord[]) => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n const triggeredByTyping = mutations.some(\n (mutation) =>\n mutation.type === 'characterData' ||\n mutation.type === 'childList' ||\n (mutation.type === 'attributes' &&\n mutation.target === this.root),\n );\n this.update(triggeredByTyping ? Emitter.sources.SILENT : source);\n } catch (ignored) {\n // ignore\n }\n },\n );\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.emitter.on(Emitter.events.COMPOSITION_BEFORE_START, () => {\n this.composing = true;\n });\n this.emitter.on(Emitter.events.COMPOSITION_END, () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus({ preventScroll: true });\n this.setRange(this.savedRange);\n }\n\n format(format: string, value: unknown) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index: number, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node: Node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n if (length > 0 && offset === leaf.length()) {\n const [next] = this.scroll.leaf(index + 1);\n if (next) {\n const [line] = this.scroll.line(index);\n const [nextLine] = this.scroll.line(index + 1);\n if (line === nextLine) {\n leaf = next;\n offset = 0;\n }\n }\n }\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side: 'left' | 'right' = 'left';\n let rect: DOMRect;\n if (node instanceof Text) {\n // Return null if the text node is empty because it is\n // not able to get a useful client rect:\n // https://github.com/w3c/csswg-drafts/issues/2514.\n // Empty text nodes are most likely caused by TextBlot#optimize()\n // not getting called when editor content changes.\n if (!node.data.length) {\n return null;\n }\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n if (!(leaf.domNode instanceof Element)) return null;\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange(): NormalizedRange | null {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange(): [Range, NormalizedRange] | [null, null] {\n const root = this.scroll.domNode;\n if ('isConnected' in root && !root.isConnected) {\n // document.getSelection() forces layout on Blink, so we trend to\n // not calling it.\n return [null, null];\n }\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus(): boolean {\n return (\n document.activeElement === this.root ||\n (document.activeElement != null &&\n contains(this.root, document.activeElement))\n );\n }\n\n normalizedToRange(range: NormalizedRange) {\n const positions: [Node, number][] = [\n [range.start.node, range.start.offset],\n ];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map((position) => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n // @ts-expect-error Fix me later\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n // @ts-expect-error Fix me later\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange: NativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach((position) => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n // @ts-expect-error Fix me later\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range: Range): [Node | null, number, Node | null, number] {\n const scrollLength = this.scroll.length();\n\n const getPosition = (\n index: number,\n inclusive: boolean,\n ): [Node | null, number] => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n return leaf ? leaf.position(leafOffset, inclusive) : [null, -1];\n };\n return [\n ...getPosition(range.index, false),\n ...getPosition(range.index + range.length, true),\n ];\n }\n\n setNativeRange(\n startNode: Node | null,\n startOffset?: number,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n // @ts-expect-error Fix me later\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus({ preventScroll: true });\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode instanceof Element && startNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode instanceof Element && endNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n // @ts-expect-error Fix me later\n range.setStart(startNode, startOffset);\n // @ts-expect-error Fix me later\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range: Range | null, force: boolean, source?: EmitterSource): void;\n setRange(range: Range | null, source?: EmitterSource): void;\n setRange(\n range: Range | null,\n force: boolean | EmitterSource = false,\n source: EmitterSource = Emitter.sources.API,\n ): void {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n this.lastNative = nativeRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n cloneDeep(this.lastRange),\n cloneDeep(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent: Node, descendant: Node) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport default Selection;\n", "import { cloneDeep, isEqual, merge } from 'lodash-es';\nimport { LeafBlot, EmbedBlot, Scope, ParentBlot } from 'parchment';\nimport type { Blot } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport { Range } from './selection.js';\n\nconst ASCII = /^[ -~]*$/;\n\ntype SelectionInfo = {\n newRange: Range;\n oldRange: Range;\n};\n\nclass Editor {\n scroll: Scroll;\n delta: Delta;\n\n constructor(scroll: Scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta: Delta): Delta {\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n const deleteDelta = new Delta();\n const normalizedOps = splitOpLines(normalizedDelta.ops.slice());\n normalizedOps.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n let isImplicitNewlinePrepended = false;\n let isImplicitNewlineAppended = false;\n if (op.insert != null) {\n deleteDelta.retain(length);\n if (typeof op.insert === 'string') {\n const text = op.insert;\n isImplicitNewlineAppended =\n !text.endsWith('\\n') &&\n (scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]);\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n if (leaf) {\n formats = merge(formats, bubbleFormats(leaf));\n }\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n const isInlineEmbed = this.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n if (\n scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]\n ) {\n isImplicitNewlineAppended = true;\n }\n } else if (index > 0) {\n const [leaf, offset] = this.scroll.descendant(LeafBlot, index - 1);\n if (leaf instanceof TextBlot) {\n const text = leaf.value();\n if (text[offset] !== '\\n') {\n isImplicitNewlinePrepended = true;\n }\n } else if (\n leaf instanceof EmbedBlot &&\n leaf.statics.scope === Scope.INLINE_BLOT\n ) {\n isImplicitNewlinePrepended = true;\n }\n }\n this.scroll.insertAt(index, key, op.insert[key]);\n\n if (isInlineEmbed) {\n const [leaf] = this.scroll.descendant(LeafBlot, index);\n if (leaf) {\n const formats = merge({}, bubbleFormats(leaf));\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n scrollLength += length;\n } else {\n deleteDelta.push(op);\n\n if (op.retain !== null && typeof op.retain === 'object') {\n const key = Object.keys(op.retain)[0];\n if (key == null) return index;\n this.scroll.updateEmbedAt(index, key, op.retain[key]);\n }\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n const prependedLength = isImplicitNewlinePrepended ? 1 : 0;\n const addedLength = isImplicitNewlineAppended ? 1 : 0;\n scrollLength += prependedLength + addedLength;\n deleteDelta.retain(prependedLength);\n deleteDelta.delete(addedLength);\n return index + length + prependedLength + addedLength;\n }, 0);\n deleteDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + Op.length(op);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index: number, length: number): Delta {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n this.scroll.lines(index, Math.max(length, 1)).forEach((line) => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n formatText(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n getContents(index: number, length: number): Delta {\n return this.delta.slice(index, index + length);\n }\n\n getDelta(): Delta {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index: number, length = 0): Record {\n let lines: (Block | BlockEmbed)[] = [];\n let leaves: LeafBlot[] = [];\n if (length === 0) {\n this.scroll.path(index).forEach((path) => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map((blots) => {\n const blot = blots.shift();\n if (blot == null) return {};\n let formats = bubbleFormats(blot);\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getHTML(index: number, length: number): string {\n const [line, lineOffset] = this.scroll.line(index);\n if (line) {\n const lineLength = line.length();\n const isWithinLine = line.length() >= lineOffset + length;\n if (isWithinLine && !(lineOffset === 0 && length === lineLength)) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n return '';\n }\n\n getText(index: number, length: number): string {\n return this.getContents(index, length)\n .filter((op) => typeof op.insert === 'string')\n .map((op) => op.insert)\n .join('');\n }\n\n insertContents(index: number, contents: Delta): Delta {\n const normalizedDelta = normalizeDelta(contents);\n const change = new Delta().retain(index).concat(normalizedDelta);\n this.scroll.insertContents(index, normalizedDelta);\n return this.update(change);\n }\n\n insertEmbed(index: number, embed: string, value: unknown): Delta {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(\n index: number,\n text: string,\n formats: Record = {},\n ): Delta {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(\n new Delta().retain(index).insert(text, cloneDeep(formats)),\n );\n }\n\n isBlank(): boolean {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const blot = this.scroll.children.head;\n if (blot?.statics.blotName !== Block.blotName) return false;\n const block = blot as Block;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index: number, length: number): Delta {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(\n change: Delta | null,\n mutations: MutationRecord[] = [],\n selectionInfo: SelectionInfo | undefined = undefined,\n ): Delta {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n // @ts-expect-error Fix me later\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target) as Blot;\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n // @ts-expect-error Fix me later\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n // @ts-expect-error\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\ninterface ListItem {\n child: Blot;\n offset: number;\n length: number;\n indent: number;\n type: string;\n}\nfunction convertListHTML(\n items: ListItem[],\n lastIndent: number,\n types: string[],\n): string {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(\n blot: Blot,\n index: number,\n length: number,\n isRoot = false,\n): string {\n if ('html' in blot && typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot instanceof ParentBlot) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items: any[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats =\n 'formats' in child && typeof child.formats === 'function'\n ? child.formats()\n : {};\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts: string[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode as Element;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode instanceof Element ? blot.domNode.outerHTML : '';\n}\n\nfunction combineFormats(\n formats: Record,\n combined: Record,\n): Record {\n return Object.keys(combined).reduce(\n (merged, name) => {\n if (formats[name] == null) return merged;\n const combinedValue = combined[name];\n if (combinedValue === formats[name]) {\n merged[name] = combinedValue;\n } else if (Array.isArray(combinedValue)) {\n if (combinedValue.indexOf(formats[name]) < 0) {\n merged[name] = combinedValue.concat([formats[name]]);\n } else {\n // If style already exists, don't add to an array, but don't lose other styles\n merged[name] = combinedValue;\n }\n } else {\n merged[name] = [combinedValue, formats[name]];\n }\n return merged;\n },\n {} as Record,\n );\n}\n\nfunction getListType(type: string | undefined) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta: Delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }: Range, amount: number) {\n return new Range(index + amount, length);\n}\n\nfunction splitOpLines(ops: Op[]) {\n const split: Op[] = [];\n ops.forEach((op) => {\n if (typeof op.insert === 'string') {\n const lines = op.insert.split('\\n');\n lines.forEach((line, index) => {\n if (index) split.push({ insert: '\\n', attributes: op.attributes });\n if (line) split.push({ insert: line, attributes: op.attributes });\n });\n } else {\n split.push(op);\n }\n });\n\n return split;\n}\n\nexport default Editor;\n", "import type Quill from './quill.js';\n\nabstract class Module {\n static DEFAULTS = {};\n\n constructor(\n public quill: Quill,\n protected options: Partial = {},\n ) {}\n}\n\nexport default Module;\n", "import type { ScrollBlot } from 'parchment';\nimport { EmbedBlot } from 'parchment';\nimport TextBlot from './text.js';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nexport interface EmbedContextRange {\n startNode: Node | Text;\n startOffset: number;\n endNode?: Node | Text;\n endOffset?: number;\n}\n\nclass Embed extends EmbedBlot {\n contentNode: HTMLSpanElement;\n leftGuard: Text;\n rightGuard: Text;\n\n constructor(scroll: ScrollBlot, node: Node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', 'false');\n Array.from(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node: Node, offset: number) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node: Text): EmbedContextRange | null {\n let range: EmbedContextRange | null = null;\n let textNode: Text;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n mutations.forEach((mutation) => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target as Text);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n", "import Embed from '../blots/embed.js';\nimport type Scroll from '../blots/scroll.js';\nimport Emitter from './emitter.js';\n\nclass Composition {\n isComposing = false;\n\n constructor(\n private scroll: Scroll,\n private emitter: Emitter,\n ) {\n this.setupListeners();\n }\n\n private setupListeners() {\n this.scroll.domNode.addEventListener('compositionstart', (event) => {\n if (!this.isComposing) {\n this.handleCompositionStart(event);\n }\n });\n\n this.scroll.domNode.addEventListener('compositionend', (event) => {\n if (this.isComposing) {\n // Webkit makes DOM changes after compositionend, so we use microtask to\n // ensure the order.\n // https://bugs.webkit.org/show_bug.cgi?id=31902\n queueMicrotask(() => {\n this.handleCompositionEnd(event);\n });\n }\n });\n }\n\n private handleCompositionStart(event: CompositionEvent) {\n const blot =\n event.target instanceof Node\n ? this.scroll.find(event.target, true)\n : null;\n\n if (blot && !(blot instanceof Embed)) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START, event);\n this.scroll.batchStart();\n this.emitter.emit(Emitter.events.COMPOSITION_START, event);\n this.isComposing = true;\n }\n }\n\n private handleCompositionEnd(event: CompositionEvent) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END, event);\n this.scroll.batchEnd();\n this.emitter.emit(Emitter.events.COMPOSITION_END, event);\n this.isComposing = false;\n }\n}\n\nexport default Composition;\n", "import type Quill from '../core.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type { ToolbarProps } from '../modules/toolbar.js';\nimport type Uploader from '../modules/uploader.js';\n\nexport interface ThemeOptions {\n modules: Record & {\n toolbar?: null | ToolbarProps;\n };\n}\n\nclass Theme {\n static DEFAULTS: ThemeOptions = {\n modules: {},\n };\n\n static themes = {\n default: Theme,\n };\n\n modules: ThemeOptions['modules'] = {};\n\n constructor(\n protected quill: Quill,\n protected options: ThemeOptions,\n ) {}\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: string): unknown;\n addModule(name: string) {\n // @ts-expect-error\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\n\nexport interface ThemeConstructor {\n new (quill: Quill, options: unknown): Theme;\n DEFAULTS: ThemeOptions;\n}\n\nexport default Theme;\n", "export type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getParentElement = (element: Node): Element | null =>\n element.parentElement || (element.getRootNode() as ShadowRoot).host || null;\n\nconst getElementRect = (element: Element): Rect => {\n const rect = element.getBoundingClientRect();\n const scaleX =\n ('offsetWidth' in element &&\n Math.abs(rect.width) / (element as HTMLElement).offsetWidth) ||\n 1;\n const scaleY =\n ('offsetHeight' in element &&\n Math.abs(rect.height) / (element as HTMLElement).offsetHeight) ||\n 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left,\n };\n};\n\nconst paddingValueToInt = (value: string) => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (\n targetStart: number,\n targetEnd: number,\n scrollStart: number,\n scrollEnd: number,\n scrollPaddingStart: number,\n scrollPaddingEnd: number,\n) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart\n ? targetStart + scrollPaddingStart - scrollStart\n : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\n\nconst scrollRectIntoView = (root: HTMLElement, targetRect: Rect) => {\n const document = root.ownerDocument;\n\n let rect = targetRect;\n\n let current: Element | null = root;\n while (current) {\n const isDocumentBody: boolean = current === document.body;\n const bounding = isDocumentBody\n ? {\n top: 0,\n right:\n window.visualViewport?.width ??\n document.documentElement.clientWidth,\n bottom:\n window.visualViewport?.height ??\n document.documentElement.clientHeight,\n left: 0,\n }\n : getElementRect(current);\n\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(\n rect.left,\n rect.right,\n bounding.left,\n bounding.right,\n paddingValueToInt(style.scrollPaddingLeft),\n paddingValueToInt(style.scrollPaddingRight),\n );\n const scrollDistanceY = getScrollDistance(\n rect.top,\n rect.bottom,\n bounding.top,\n bounding.bottom,\n paddingValueToInt(style.scrollPaddingTop),\n paddingValueToInt(style.scrollPaddingBottom),\n );\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n document.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const { scrollLeft, scrollTop } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop,\n };\n }\n }\n\n current =\n isDocumentBody || style.position === 'fixed'\n ? null\n : getParentElement(current);\n }\n};\n\nexport default scrollRectIntoView;\n", "import { Registry } from 'parchment';\n\nconst MAX_REGISTER_ITERATIONS = 100;\nconst CORE_FORMATS = ['block', 'break', 'cursor', 'inline', 'scroll', 'text'];\n\nconst createRegistryWithFormats = (\n formats: string[],\n sourceRegistry: Registry,\n debug: { error: (errorMessage: string) => void },\n) => {\n const registry = new Registry();\n CORE_FORMATS.forEach((name) => {\n const coreBlot = sourceRegistry.query(name);\n if (coreBlot) registry.register(coreBlot);\n });\n\n formats.forEach((name) => {\n let format = sourceRegistry.query(name);\n if (!format) {\n debug.error(\n `Cannot register \"${name}\" specified in \"formats\" config. Are you sure it was registered?`,\n );\n }\n let iterations = 0;\n while (format) {\n registry.register(format);\n format = 'blotName' in format ? format.requiredContainer ?? null : null;\n\n iterations += 1;\n if (iterations > MAX_REGISTER_ITERATIONS) {\n debug.error(\n `Cycle detected in registering blot requiredContainer: \"${name}\"`,\n );\n break;\n }\n }\n });\n\n return registry;\n};\n\nexport default createRegistryWithFormats;\n", "import { merge } from 'lodash-es';\nimport * as Parchment from 'parchment';\nimport type { Op } from 'quill-delta';\nimport Delta from 'quill-delta';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type Block from '../blots/block.js';\nimport type Scroll from '../blots/scroll.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport Editor from './editor.js';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport instances from './instances.js';\nimport logger from './logger.js';\nimport type { DebugLevel } from './logger.js';\nimport Module from './module.js';\nimport Selection, { Range } from './selection.js';\nimport type { Bounds } from './selection.js';\nimport Composition from './composition.js';\nimport Theme from './theme.js';\nimport type { ThemeConstructor } from './theme.js';\nimport scrollRectIntoView from './utils/scrollRectIntoView.js';\nimport type { Rect } from './utils/scrollRectIntoView.js';\nimport createRegistryWithFormats from './utils/createRegistryWithFormats.js';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\n/**\n * Options for initializing a Quill instance\n */\nexport interface QuillOptions {\n theme?: string;\n debug?: DebugLevel | boolean;\n registry?: Parchment.Registry;\n /**\n * Whether to disable the editing\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * Placeholder text to display when the editor is empty\n * @default \"\"\n */\n placeholder?: string;\n bounds?: HTMLElement | string | null;\n modules?: Record;\n\n /**\n * A list of formats that are recognized and can exist within the editor contents.\n * `null` means all formats are allowed.\n * @default null\n */\n formats?: string[] | null;\n}\n\n/**\n * Similar to QuillOptions, but with all properties expanded to their default values,\n * and all selectors resolved to HTMLElements.\n */\nexport interface ExpandedQuillOptions\n extends Omit {\n theme: ThemeConstructor;\n registry: Parchment.Registry;\n container: HTMLElement;\n modules: Record;\n bounds?: HTMLElement | null;\n readOnly: boolean;\n}\n\nclass Quill {\n static DEFAULTS = {\n bounds: null,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n theme: 'default',\n } satisfies Partial;\n static events = Emitter.events;\n static sources = Emitter.sources;\n static version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\n static imports: Record = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n };\n\n static debug(limit: DebugLevel | boolean) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node: Node, bubble = false) {\n return instances.get(node) || globalRegistry.find(node, bubble);\n }\n\n static import(name: 'core/module'): typeof Module;\n static import(name: `themes/${string}`): typeof Theme;\n static import(name: 'parchment'): typeof Parchment;\n static import(name: 'delta'): typeof Delta;\n static import(name: string): unknown;\n static import(name: string) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(\n targets: Record<\n string,\n | Parchment.RegistryDefinition\n | Record // any objects\n | Theme\n | Module\n | Function // ES5 constructors\n >,\n overwrite?: boolean,\n ): void;\n static register(\n target: Parchment.RegistryDefinition,\n overwrite?: boolean,\n ): void;\n static register(path: string, target: any, overwrite?: boolean): void;\n static register(...args: any[]): void {\n if (typeof args[0] !== 'string') {\n const target = args[0];\n const overwrite = !!args[1];\n\n const name = 'attrName' in target ? target.attrName : target.blotName;\n if (typeof name === 'string') {\n // Shortcut for formats:\n // register(Blot | Attributor, overwrite)\n this.register(`formats/${name}`, target, overwrite);\n } else {\n Object.keys(target).forEach((key) => {\n this.register(key, target[key], overwrite);\n });\n }\n } else {\n const path = args[0];\n const target = args[1];\n const overwrite = !!args[2];\n\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target &&\n typeof target !== 'boolean' &&\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n container: HTMLElement;\n root: HTMLDivElement;\n scroll: Scroll;\n emitter: Emitter;\n protected allowReadOnlyEdits: boolean;\n editor: Editor;\n composition: Composition;\n selection: Selection;\n\n theme: Theme;\n keyboard: Keyboard;\n clipboard: Clipboard;\n history: History;\n uploader: Uploader;\n\n options: ExpandedQuillOptions;\n\n constructor(container: HTMLElement | string, options: QuillOptions = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n debug.error('Invalid Quill container', container);\n return;\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n const scrollBlotName = Parchment.ScrollBlot.blotName;\n const ScrollBlot = this.options.registry.query(scrollBlotName);\n if (!ScrollBlot || !('blotName' in ScrollBlot)) {\n throw new Error(\n `Cannot initialize Quill without \"${scrollBlotName}\" blot`,\n );\n }\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n }) as Scroll;\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.composition = new Composition(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.addModule('input');\n this.theme.addModule('uiNode');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n this.emitter.on(Emitter.events.SCROLL_EMBED_UPDATE, (blot, delta) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => {\n const change = new Delta()\n .retain(blot.offset(this))\n .retain({ [blot.statics.blotName]: delta });\n return this.editor.update(change, [], selectionInfo);\n },\n Quill.sources.USER,\n );\n });\n if (html) {\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n }\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container: string, refNode?: Node | null): HTMLDivElement;\n addContainer(container: HTMLElement, refNode?: Node | null): HTMLElement;\n addContainer(\n container: string | HTMLElement,\n refNode: Node | null = null,\n ): HTMLDivElement | HTMLElement {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(range: Range, source?: EmitterSource): Delta;\n deleteText(index: number, length: number, source?: EmitterSource): Delta;\n deleteText(\n index: number | Range,\n length?: number | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier: () => T): T {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus(options: { preventScroll?: boolean } = {}) {\n this.selection.focus();\n if (!options.preventScroll) {\n this.scrollSelectionIntoView();\n }\n }\n\n format(\n name: string,\n value: unknown,\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string,\n value?: unknown,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string | Record,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n // @ts-expect-error\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(\n range: Range,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number | Range,\n length: number | string,\n name: string | unknown,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n // @ts-expect-error\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index: number | Range, length = 0): Bounds | null {\n let bounds: Bounds | null = null;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n if (!bounds) return null;\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index?: number, length?: number): { [format: string]: unknown };\n getFormat(range?: Range): {\n [format: string]: unknown;\n };\n getFormat(\n index: Range | number = this.getSelection(true),\n length = 0,\n ): { [format: string]: unknown } {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot: Parchment.Blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index: number) {\n return this.scroll.leaf(index);\n }\n\n getLine(index: number) {\n return this.scroll.line(index);\n }\n\n getLines(range: Range): (Block | BlockEmbed)[];\n getLines(index?: number, length?: number): (Block | BlockEmbed)[];\n getLines(\n index: Range | number = 0,\n length = Number.MAX_VALUE,\n ): (Block | BlockEmbed)[] {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name: string) {\n return this.theme.modules[name];\n }\n\n getSelection(focus: true): Range;\n getSelection(focus?: boolean): Range | null;\n getSelection(focus = false): Range | null {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(range: Range): string;\n getSemanticHTML(index?: number, length?: number): string;\n getSemanticHTML(index: Range | number = 0, length?: number) {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(range?: Range): string;\n getText(index?: number, length?: number): string;\n getText(index: Range | number = 0, length?: number): string {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(\n index: number,\n embed: string,\n value: unknown,\n source: EmitterSource = Quill.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index: number, text: string, source?: EmitterSource): Delta;\n insertText(\n index: number,\n text: string,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name?: string | Record | EmitterSource,\n value?: unknown,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n // @ts-expect-error\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args: Parameters<(typeof Emitter)['prototype']['off']>) {\n return this.emitter.off(...args);\n }\n\n on(\n event: (typeof Emitter)['events']['TEXT_CHANGE'],\n handler: (delta: Delta, oldContent: Delta, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['SELECTION_CHANGE'],\n handler: (range: Range, oldRange: Range, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['EDITOR_CHANGE'],\n handler: (\n ...args:\n | [\n (typeof Emitter)['events']['TEXT_CHANGE'],\n Delta,\n Delta,\n EmitterSource,\n ]\n | [\n (typeof Emitter)['events']['SELECTION_CHANGE'],\n Range,\n Range,\n EmitterSource,\n ]\n ) => void,\n ): Emitter;\n on(event: string, ...args: unknown[]): Emitter;\n on(...args: Parameters<(typeof Emitter)['prototype']['on']>): Emitter {\n return this.emitter.on(...args);\n }\n\n once(...args: Parameters<(typeof Emitter)['prototype']['once']>) {\n return this.emitter.once(...args);\n }\n\n removeFormat(index: number, length: number, source?: EmitterSource): Delta {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollRectIntoView(rect: Rect) {\n scrollRectIntoView(this.root, rect);\n }\n\n /**\n * @deprecated Use Quill#scrollSelectionIntoView() instead.\n */\n scrollIntoView() {\n console.warn(\n 'Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.',\n );\n this.scrollSelectionIntoView();\n }\n\n /**\n * Scroll the current selection into the visible area.\n * If the selection is already visible, no scrolling will occur.\n */\n scrollSelectionIntoView() {\n const range = this.selection.lastRange;\n const bounds = range && this.selection.getBounds(range.index, range.length);\n if (bounds) {\n this.scrollRectIntoView(bounds);\n }\n }\n\n setContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n // Quill will set empty editor to \\n\n const delete1 = this.editor.deleteText(0, length);\n const applied = this.editor.insertContents(0, delta);\n // Remove extra \\n from empty editor initialization\n const delete2 = this.editor.deleteText(this.getLength() - 1, 1);\n return delete1.compose(applied).compose(delete2);\n },\n source,\n );\n }\n setSelection(range: Range | null, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(index: number, length?: number, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(\n index: Range | null | number,\n length?: EmitterSource | number,\n source?: EmitterSource,\n ): void {\n if (index == null) {\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.scrollSelectionIntoView();\n }\n }\n }\n\n setText(text: string, source: EmitterSource = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta);\n },\n source,\n true,\n );\n }\n}\n\nfunction resolveSelector(selector: string | HTMLElement | null | undefined) {\n return typeof selector === 'string'\n ? document.querySelector(selector)\n : selector;\n}\n\nfunction expandModuleConfig(config: Record | undefined) {\n return Object.entries(config ?? {}).reduce(\n (expanded, [key, value]) => ({\n ...expanded,\n [key]: value === true ? {} : value,\n }),\n {} as Record,\n );\n}\n\nfunction omitUndefinedValuesFromOptions(obj: QuillOptions) {\n return Object.fromEntries(\n Object.entries(obj).filter((entry) => entry[1] !== undefined),\n );\n}\n\nfunction expandConfig(\n containerOrSelector: HTMLElement | string,\n options: QuillOptions,\n): ExpandedQuillOptions {\n const container = resolveSelector(containerOrSelector);\n if (!container) {\n throw new Error('Invalid Quill container');\n }\n\n const shouldUseDefaultTheme =\n !options.theme || options.theme === Quill.DEFAULTS.theme;\n const theme = shouldUseDefaultTheme\n ? Theme\n : Quill.import(`themes/${options.theme}`);\n if (!theme) {\n throw new Error(`Invalid theme ${options.theme}. Did you register it?`);\n }\n\n const { modules: quillModuleDefaults, ...quillDefaults } = Quill.DEFAULTS;\n const { modules: themeModuleDefaults, ...themeDefaults } = theme.DEFAULTS;\n\n let userModuleOptions = expandModuleConfig(options.modules);\n // Special case toolbar shorthand\n if (\n userModuleOptions != null &&\n userModuleOptions.toolbar &&\n userModuleOptions.toolbar.constructor !== Object\n ) {\n userModuleOptions = {\n ...userModuleOptions,\n toolbar: { container: userModuleOptions.toolbar },\n };\n }\n\n const modules: ExpandedQuillOptions['modules'] = merge(\n {},\n expandModuleConfig(quillModuleDefaults),\n expandModuleConfig(themeModuleDefaults),\n userModuleOptions,\n );\n\n const config = {\n ...quillDefaults,\n ...omitUndefinedValuesFromOptions(themeDefaults),\n ...omitUndefinedValuesFromOptions(options),\n };\n\n let registry = options.registry;\n if (registry) {\n if (options.formats) {\n debug.warn('Ignoring \"formats\" option because \"registry\" is specified');\n }\n } else {\n registry = options.formats\n ? createRegistryWithFormats(options.formats, config.registry, debug)\n : config.registry;\n }\n\n return {\n ...config,\n registry,\n container,\n theme,\n modules: Object.entries(modules).reduce(\n (modulesWithDefaults, [name, value]) => {\n if (!value) return modulesWithDefaults;\n\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n return modulesWithDefaults;\n }\n return {\n ...modulesWithDefaults,\n // @ts-expect-error\n [name]: merge({}, moduleClass.DEFAULTS || {}, value),\n };\n },\n {},\n ),\n bounds: resolveSelector(config.bounds),\n };\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(\n modifier: () => Delta,\n source: EmitterSource,\n index: number | boolean,\n shift: number | null,\n) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n // @ts-expect-error index should always be number\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\ntype NormalizedIndexLength = [\n number,\n number,\n Record,\n EmitterSource,\n];\nfunction overload(index: number, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(range: Range, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: Range | number,\n length?: number | string | Record | EmitterSource,\n name?: string | unknown | Record | EmitterSource,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n): NormalizedIndexLength {\n let formats: Record = {};\n // @ts-expect-error\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n // @ts-expect-error Fix me later\n formats = name;\n // @ts-expect-error\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n // @ts-expect-error\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n // @ts-expect-error\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range: Range, change: Delta, source?: EmitterSource): Range;\nfunction shiftRange(\n range: Range,\n index: number,\n length?: number,\n source?: EmitterSource,\n): Range;\nfunction shiftRange(\n range: Range,\n index: number | Delta,\n lengthOrSource?: number | EmitterSource,\n source?: EmitterSource,\n) {\n const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0;\n if (range == null) return null;\n let start;\n let end;\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (index && typeof index.transformPosition === 'function') {\n [start, end] = [range.index, range.index + range.length].map((pos) =>\n // @ts-expect-error -- TODO: add a better type guard around `index`\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map((pos) => {\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n // @ts-expect-error -- TODO: add a better type guard around `index`\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport type { Bounds, DebugLevel, EmitterSource };\nexport { Parchment, Range };\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n", "import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n", "import { ContainerBlot, LeafBlot, Scope, ScrollBlot } from 'parchment';\nimport type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Emitter from '../core/emitter.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport Block, { BlockEmbed, bubbleFormats } from './block.js';\nimport Break from './break.js';\nimport Container from './container.js';\n\ntype RenderBlock =\n | {\n type: 'blockEmbed';\n attributes: AttributeMap;\n key: string;\n value: unknown;\n }\n | { type: 'block'; attributes: AttributeMap; delta: Delta };\n\nfunction isLine(blot: unknown): blot is Block | BlockEmbed {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\ninterface UpdatableEmbed {\n updateContent(change: unknown): void;\n}\n\nfunction isUpdatable(blot: Blot): blot is Blot & UpdatableEmbed {\n return typeof (blot as unknown as any).updateContent === 'function';\n}\n\nclass Scroll extends ScrollBlot {\n static blotName = 'scroll';\n static className = 'ql-editor';\n static tagName = 'DIV';\n static defaultChild = Block;\n static allowedChildren = [Block, BlockEmbed, Container];\n\n emitter: Emitter;\n batch: false | MutationRecord[];\n\n constructor(\n registry: Registry,\n domNode: HTMLDivElement,\n { emitter }: { emitter: Emitter },\n ) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', (e) => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n emitEmbedUpdate(blot: Blot, change: unknown) {\n this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE, blot, change);\n }\n\n deleteAt(index: number, length: number) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n\n formatAt(index: number, length: number, format: string, value: unknown) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(\n this.statics.defaultChild.blotName,\n ) as Parent;\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n insertContents(index: number, delta: Delta) {\n const renderBlocks = this.deltaToRenderBlocks(\n delta.concat(new Delta().insert('\\n')),\n );\n const last = renderBlocks.pop();\n if (last == null) return;\n\n this.batchStart();\n\n const first = renderBlocks.shift();\n if (first) {\n const shouldInsertNewlineChar =\n first.type === 'block' &&\n (first.delta.length() === 0 ||\n (!this.descendant(BlockEmbed, index)[0] && index < this.length()));\n const delta =\n first.type === 'block'\n ? first.delta\n : new Delta().insert({ [first.key]: first.value });\n insertInlineContents(this, index, delta);\n const newlineCharLength = first.type === 'block' ? 1 : 0;\n const lineEndIndex = index + delta.length() + newlineCharLength;\n if (shouldInsertNewlineChar) {\n this.insertAt(lineEndIndex - 1, '\\n');\n }\n\n const formats = bubbleFormats(this.line(index)[0]);\n const attributes = AttributeMap.diff(formats, first.attributes) || {};\n Object.keys(attributes).forEach((name) => {\n this.formatAt(lineEndIndex - 1, 1, name, attributes[name]);\n });\n\n index = lineEndIndex;\n }\n\n let [refBlot, refBlotOffset] = this.children.find(index);\n if (renderBlocks.length) {\n if (refBlot) {\n refBlot = refBlot.split(refBlotOffset);\n refBlotOffset = 0;\n }\n\n renderBlocks.forEach((renderBlock) => {\n if (renderBlock.type === 'block') {\n const block = this.createBlock(\n renderBlock.attributes,\n refBlot || undefined,\n );\n insertInlineContents(block, 0, renderBlock.delta);\n } else {\n const blockEmbed = this.create(\n renderBlock.key,\n renderBlock.value,\n ) as EmbedBlot;\n this.insertBefore(blockEmbed, refBlot || undefined);\n Object.keys(renderBlock.attributes).forEach((name) => {\n blockEmbed.format(name, renderBlock.attributes[name]);\n });\n }\n });\n }\n\n if (last.type === 'block' && last.delta.length()) {\n const offset = refBlot\n ? refBlot.offset(refBlot.scroll) + refBlotOffset\n : this.length();\n insertInlineContents(this, offset, last.delta);\n }\n\n this.batchEnd();\n this.optimize();\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index: number): [LeafBlot | null, number] {\n const last = this.path(index).pop();\n if (!last) {\n return [null, -1];\n }\n\n const [blot, offset] = last;\n return blot instanceof LeafBlot ? [blot, offset] : [null, -1];\n }\n\n line(index: number): [Block | BlockEmbed | null, number] {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n // @ts-expect-error TODO: make descendant() generic\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE): (Block | BlockEmbed)[] {\n const getLines = (\n blot: ParentBlot,\n blotIndex: number,\n blotLength: number,\n ) => {\n let lines: (Block | BlockEmbed)[] = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(context?: { [key: string]: any }): void;\n optimize(\n mutations?: MutationRecord[],\n context?: { [key: string]: any },\n ): void;\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index: number) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(source?: EmitterSource): void;\n update(mutations?: MutationRecord[]): void;\n update(mutations?: MutationRecord[] | EmitterSource): void {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source: EmitterSource = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n mutations = mutations.filter(({ target }) => {\n const blot = this.find(target, true);\n return blot && !isUpdatable(blot);\n });\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n\n updateEmbedAt(index: number, key: string, change: unknown) {\n // Currently it only supports top-level embeds (BlockEmbed).\n // We can update `ParentBlot` in parchment to support inline embeds.\n const [blot] = this.descendant((b: Blot) => b instanceof BlockEmbed, index);\n if (blot && blot.statics.blotName === key && isUpdatable(blot)) {\n blot.updateContent(change);\n }\n }\n\n protected handleDragStart(event: DragEvent) {\n event.preventDefault();\n }\n\n private deltaToRenderBlocks(delta: Delta) {\n const renderBlocks: RenderBlock[] = [];\n\n let currentBlockDelta = new Delta();\n delta.forEach((op) => {\n const insert = op?.insert;\n if (!insert) return;\n if (typeof insert === 'string') {\n const splitted = insert.split('\\n');\n splitted.slice(0, -1).forEach((text) => {\n currentBlockDelta.insert(text, op.attributes);\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: op.attributes ?? {},\n });\n currentBlockDelta = new Delta();\n });\n const last = splitted[splitted.length - 1];\n if (last) {\n currentBlockDelta.insert(last, op.attributes);\n }\n } else {\n const key = Object.keys(insert)[0];\n if (!key) return;\n if (this.query(key, Scope.INLINE)) {\n currentBlockDelta.push(op);\n } else {\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n currentBlockDelta = new Delta();\n renderBlocks.push({\n type: 'blockEmbed',\n key,\n value: insert[key],\n attributes: op.attributes ?? {},\n });\n }\n }\n });\n\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n\n return renderBlocks;\n }\n\n private createBlock(attributes: AttributeMap, refBlot?: Blot) {\n let blotName: string | undefined;\n const formats: AttributeMap = {};\n\n Object.entries(attributes).forEach(([key, value]) => {\n const isBlockBlot = this.query(key, Scope.BLOCK & Scope.BLOT) != null;\n if (isBlockBlot) {\n blotName = key;\n } else {\n formats[key] = value;\n }\n });\n\n const block = this.create(\n blotName || this.statics.defaultChild.blotName,\n blotName ? attributes[blotName] : undefined,\n ) as ParentBlot;\n\n this.insertBefore(block, refBlot || undefined);\n\n const length = block.length();\n Object.entries(formats).forEach(([key, value]) => {\n block.formatAt(0, length, key, value);\n });\n\n return block;\n }\n}\n\nfunction insertInlineContents(\n parent: ParentBlot,\n index: number,\n inlineContents: Delta,\n) {\n inlineContents.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n const text = op.insert;\n parent.insertAt(index, text);\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n parent.insertAt(index, key, op.insert[key]);\n const isInlineEmbed = parent.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n Object.keys(attributes).forEach((key) => {\n parent.formatAt(index, length, key, attributes[key]);\n });\n return index + length;\n }, index);\n}\n\nexport default Scroll;\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode: HTMLElement) {\n let value = super.value(domNode) as string;\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map((component) => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n", "import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color.js';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n", "import Block from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport Cursor from '../blots/cursor.js';\nimport Inline from '../blots/inline.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport Container from '../blots/container.js';\nimport Quill from '../core/quill.js';\n\nclass CodeBlockContainer extends Container {\n static create(value: string) {\n const domNode = super.create(value) as Element;\n domNode.setAttribute('spellcheck', 'false');\n return domNode;\n }\n\n code(index: number, length: number) {\n return (\n this.children\n // @ts-expect-error\n .map((child) => (child.length() <= 1 ? '' : child.domNode.innerText))\n .join('\\n')\n .slice(index, index + length)\n );\n }\n\n html(index: number, length: number) {\n // `\\n`s are needed in order to support empty lines at the beginning and the end.\n // https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\n return `
    \\n${escapeText(this.code(index, length))}\\n
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static TAB = ' ';\n\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node: HTMLElement) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n", "import { cloneDeep, isEqual } from 'lodash-es';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport type { Blot, BlockBlot } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nexport interface Context {\n collapsed: boolean;\n empty: boolean;\n offset: number;\n prefix: string;\n suffix: string;\n format: Record;\n event: KeyboardEvent;\n line: BlockEmbed | BlockBlot;\n}\n\ninterface BindingObject\n extends Partial> {\n key: number | string | string[];\n shortKey?: boolean | null;\n shiftKey?: boolean | null;\n altKey?: boolean | null;\n metaKey?: boolean | null;\n ctrlKey?: boolean | null;\n prefix?: RegExp;\n suffix?: RegExp;\n format?: Record | string[];\n handler?: (\n this: { quill: Quill },\n range: Range,\n curContext: Context,\n // eslint-disable-next-line no-use-before-define\n binding: NormalizedBinding,\n ) => boolean | void;\n}\n\ntype Binding = BindingObject | string | number;\n\ninterface NormalizedBinding extends Omit {\n key: string | number;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\nclass Keyboard extends Module {\n static DEFAULTS: KeyboardOptions;\n\n static match(evt: KeyboardEvent, binding: BindingObject) {\n if (\n (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'] as const).some((key) => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n bindings: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.bindings = {};\n // @ts-expect-error Fix me later\n Object.keys(this.options.bindings).forEach((name) => {\n // @ts-expect-error Fix me later\n if (this.options.bindings[name]) {\n // @ts-expect-error Fix me later\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(\n keyBinding: Binding,\n context:\n | Required\n | Partial> = {},\n handler:\n | Required\n | Partial> = {},\n ) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach((key) => {\n const singleBinding = {\n ...binding,\n key,\n ...context,\n ...handler,\n };\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented || evt.isComposing) return;\n\n // evt.isComposing is false when pressing Enter/Backspace when composing in Safari\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n const isComposing =\n evt.keyCode === 229 && (evt.key === 'Enter' || evt.key === 'Backspace');\n if (isComposing) return;\n\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter((binding) =>\n Keyboard.match(evt, binding),\n );\n if (matches.length === 0) return;\n // @ts-expect-error\n const blot = Quill.find(evt.target, true);\n if (blot && blot.scroll !== this.quill.scroll) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n // @ts-expect-error Fix me later\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some((binding) => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every((name) => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every((name) => {\n // @ts-expect-error Fix me later\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n // @ts-expect-error Fix me later\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n // @ts-expect-error Fix me later\n return isEqual(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n // @ts-expect-error Fix me later\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range: Range, context: Context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const isPrevLineEmpty =\n prev.statics.blotName === 'block' && prev.length() <= 1;\n if (!isPrevLineEmpty) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range: Range, context: Context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n // @ts-expect-error Fix me later\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n this.quill.focus();\n }\n\n handleEnter(range: Range, context: Context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats: Record, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n }\n}\n\nconst defaultOptions: KeyboardOptions = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats: Record = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = {\n // @ts-expect-error Fix me later\n ...line.formats(),\n list: 'checked',\n };\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n // @ts-expect-error\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n 'code-block': false,\n blockquote: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n // @ts-expect-error Fix me later\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n // @ts-expect-error\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nKeyboard.DEFAULTS = defaultOptions;\n\nfunction makeCodeBlockHandler(indent: boolean): BindingObject {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range, { event }) {\n const CodeBlock = this.quill.scroll.query('code-block');\n // @ts-expect-error\n const { TAB } = CodeBlock;\n if (range.length === 0 && !event.shiftKey) {\n this.quill.insertText(range.index, TAB, Quill.sources.USER);\n this.quill.setSelection(range.index + TAB.length, Quill.sources.SILENT);\n return;\n }\n\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, TAB);\n if (i === 0) {\n index += TAB.length;\n } else {\n length += TAB.length;\n }\n // @ts-expect-error Fix me later\n } else if (line.domNode.textContent.startsWith(TAB)) {\n line.deleteAt(0, TAB.length);\n if (i === 0) {\n index -= TAB.length;\n } else {\n length -= TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(\n key: string,\n shiftKey: boolean | null,\n): BindingObject {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format: string): BindingObject {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up: boolean): BindingObject {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n // @ts-expect-error\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n // @ts-expect-error\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n // @ts-expect-error\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding: Binding): BindingObject | null {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = cloneDeep(binding);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n// TODO: Move into quill.ts or editor.ts\nfunction deleteRange({ quill, range }: { quill: Quill; range: Range }) {\n const lines = quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n quill.setSelection(range.index, Quill.sources.SILENT);\n}\n\nfunction tableSide(_table: unknown, row: Blot, cell: Blot, offset: number) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize, deleteRange };\n", "const normalWeightRegexp = /font-weight:\\s*normal/;\nconst blockTagNames = ['P', 'OL', 'UL'];\n\nconst isBlockElement = (element: Element | null) => {\n return element && blockTagNames.includes(element.tagName);\n};\n\nconst normalizeEmptyLines = (doc: Document) => {\n Array.from(doc.querySelectorAll('br'))\n .filter(\n (br) =>\n isBlockElement(br.previousElementSibling) &&\n isBlockElement(br.nextElementSibling),\n )\n .forEach((br) => {\n br.parentNode?.removeChild(br);\n });\n};\n\nconst normalizeFontWeight = (doc: Document) => {\n Array.from(doc.querySelectorAll('b[style*=\"font-weight\"]'))\n .filter((node) => node.getAttribute('style')?.match(normalWeightRegexp))\n .forEach((node) => {\n const fragment = doc.createDocumentFragment();\n fragment.append(...node.childNodes);\n node.parentNode?.replaceChild(fragment, node);\n });\n};\n\nexport default function normalize(doc: Document) {\n if (doc.querySelector('[id^=\"docs-internal-guid-\"]')) {\n normalizeFontWeight(doc);\n normalizeEmptyLines(doc);\n }\n}\n", "const ignoreRegexp = /\\bmso-list:[^;]*ignore/i;\nconst idRegexp = /\\bmso-list:[^;]*\\bl(\\d+)/i;\nconst indentRegexp = /\\bmso-list:[^;]*\\blevel(\\d+)/i;\n\nconst parseListItem = (element: Element, html: string) => {\n const style = element.getAttribute('style');\n const idMatch = style?.match(idRegexp);\n if (!idMatch) {\n return null;\n }\n const id = Number(idMatch[1]);\n\n const indentMatch = style?.match(indentRegexp);\n const indent = indentMatch ? Number(indentMatch[1]) : 1;\n\n const typeRegexp = new RegExp(\n `@list l${id}:level${indent}\\\\s*\\\\{[^\\\\}]*mso-level-number-format:\\\\s*([\\\\w-]+)`,\n 'i',\n );\n const typeMatch = html.match(typeRegexp);\n const type = typeMatch && typeMatch[1] === 'bullet' ? 'bullet' : 'ordered';\n\n return { id, indent, type, element };\n};\n\n// list items are represented as `p` tags with styles like `mso-list: l0 level1` where:\n// 1. \"0\" in \"l0\" means the list item id;\n// 2. \"1\" in \"level1\" means the indent level, starting from 1.\nconst normalizeListItem = (doc: Document) => {\n const msoList = Array.from(doc.querySelectorAll('[style*=mso-list]'));\n const ignored: Element[] = [];\n const others: Element[] = [];\n msoList.forEach((node) => {\n const shouldIgnore = (node.getAttribute('style') || '').match(ignoreRegexp);\n if (shouldIgnore) {\n ignored.push(node);\n } else {\n others.push(node);\n }\n });\n\n // Each list item contains a marker wrapped with \"mso-list: Ignore\".\n ignored.forEach((node) => node.parentNode?.removeChild(node));\n\n // The list stype is not defined inline with the tag, instead, it's in the\n // style tag so we need to pass the html as a string.\n const html = doc.documentElement.innerHTML;\n const listItems = others\n .map((element) => parseListItem(element, html))\n .filter((parsed) => parsed);\n\n while (listItems.length) {\n const childListItems = [];\n\n let current = listItems.shift();\n // Group continuous items into the same group (aka \"ul\")\n while (current) {\n childListItems.push(current);\n current =\n listItems.length &&\n listItems[0]?.element === current.element.nextElementSibling &&\n // Different id means the next item doesn't belong to this group.\n listItems[0].id === current.id\n ? listItems.shift()\n : null;\n }\n\n const ul = document.createElement('ul');\n childListItems.forEach((listItem) => {\n const li = document.createElement('li');\n li.setAttribute('data-list', listItem.type);\n if (listItem.indent > 1) {\n li.setAttribute('class', `ql-indent-${listItem.indent - 1}`);\n }\n li.innerHTML = listItem.element.innerHTML;\n ul.appendChild(li);\n });\n\n const element = childListItems[0]?.element;\n const { parentNode } = element ?? {};\n if (element) {\n parentNode?.replaceChild(ul, element);\n }\n childListItems.slice(1).forEach(({ element: e }) => {\n parentNode?.removeChild(e);\n });\n }\n};\n\nexport default function normalize(doc: Document) {\n if (\n doc.documentElement.getAttribute('xmlns:w') ===\n 'urn:schemas-microsoft-com:office:word'\n ) {\n normalizeListItem(doc);\n }\n}\n", "import googleDocs from './normalizers/googleDocs.js';\nimport msWord from './normalizers/msWord.js';\n\nconst NORMALIZERS = [msWord, googleDocs];\n\nconst normalizeExternalHTML = (doc: Document) => {\n if (doc.documentElement) {\n NORMALIZERS.forEach((normalize) => {\n normalize(doc);\n });\n }\n};\n\nexport default normalizeExternalHTML;\n", "import type { ScrollBlot } from 'parchment';\nimport {\n Attributor,\n BlockBlot,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n} from 'parchment';\nimport Delta from 'quill-delta';\nimport { BlockEmbed } from '../blots/block.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { AlignAttribute, AlignStyle } from '../formats/align.js';\nimport { BackgroundStyle } from '../formats/background.js';\nimport CodeBlock from '../formats/code.js';\nimport { ColorStyle } from '../formats/color.js';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction.js';\nimport { FontStyle } from '../formats/font.js';\nimport { SizeStyle } from '../formats/size.js';\nimport { deleteRange } from './keyboard.js';\nimport normalizeExternalHTML from './normalizeExternalHTML/index.js';\n\nconst debug = logger('quill:clipboard');\n\ntype Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];\ntype Matcher = (node: Node, delta: Delta, scroll: ScrollBlot) => Delta;\n\nconst CLIPBOARD_CONFIG: [Selector, Matcher][] = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', createMatchAlias('bold')],\n ['i', createMatchAlias('italic')],\n ['strike', createMatchAlias('strike')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\ninterface ClipboardOptions {\n matchers: [Selector, Matcher][];\n}\n\nclass Clipboard extends Module {\n static DEFAULTS: ClipboardOptions = {\n matchers: [],\n };\n\n matchers: [Selector, Matcher][];\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.root.addEventListener('copy', (e) =>\n this.onCaptureCopy(e, false),\n );\n this.quill.root.addEventListener('cut', (e) => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers ?? []).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector: Selector, matcher: Matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(\n { html, text }: { html?: string; text?: string },\n formats: Record = {},\n ) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text || '', {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '', formats);\n }\n const delta = this.convertHTML(html);\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n protected normalizeHTML(doc: Document) {\n normalizeExternalHTML(doc);\n }\n\n protected convertHTML(html: string) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n this.normalizeHTML(doc);\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n return traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n }\n\n dangerouslyPasteHTML(html: string, source?: EmitterSource): void;\n dangerouslyPasteHTML(\n index: number,\n html: string,\n source?: EmitterSource,\n ): void;\n dangerouslyPasteHTML(\n index: number | string,\n html?: string,\n source: EmitterSource = Quill.sources.API,\n ) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n // @ts-expect-error\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e: ClipboardEvent, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData?.setData('text/plain', text);\n e.clipboardData?.setData('text/html', html);\n if (isCut) {\n deleteRange({ range, quill: this.quill });\n }\n }\n\n /*\n * https://www.iana.org/assignments/media-types/text/uri-list\n */\n private normalizeURIList(urlList: string) {\n return (\n urlList\n .split(/\\r?\\n/)\n // Ignore all comments\n .filter((url) => url[0] !== '#')\n .join('\\n')\n );\n }\n\n onCapturePaste(e: ClipboardEvent) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData?.getData('text/html');\n let text = e.clipboardData?.getData('text/plain');\n if (!html && !text) {\n const urlList = e.clipboardData?.getData('text/uri-list');\n if (urlList) {\n text = this.normalizeURIList(urlList);\n }\n }\n const files = Array.from(e.clipboardData?.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n return;\n }\n if (html && files.length > 0) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n if (\n doc.body.childElementCount === 1 &&\n doc.body.firstElementChild?.tagName === 'IMG'\n ) {\n this.quill.uploader.upload(range, files);\n return;\n }\n }\n this.onPaste(range, { html, text });\n }\n\n onCopy(range: Range, isCut: boolean): { html: string; text: string };\n onCopy(range: Range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range: Range, { text, html }: { text?: string; html?: string }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollSelectionIntoView();\n }\n\n prepareMatching(container: Element, nodeMatches: WeakMap) {\n const elementMatchers: Matcher[] = [];\n const textMatchers: Matcher[] = [];\n this.matchers.forEach((pair) => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach((node) => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches?.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\n\nfunction applyFormat(\n delta: Delta,\n format: string,\n value: unknown,\n scroll: ScrollBlot,\n): Delta {\n if (!scroll.query(format)) {\n return delta;\n }\n\n return delta.reduce((newDelta, op) => {\n if (!op.insert) return newDelta;\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n const formats = value ? { [format]: value } : {};\n return newDelta.insert(op.insert, { ...formats, ...op.attributes });\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta: Delta, text: string) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node: Node, scroll: ScrollBlot) {\n if (!(node instanceof Element)) return false;\n const match = scroll.query(node);\n // @ts-expect-error\n if (match && match.prototype instanceof EmbedBlot) return false;\n\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nfunction isBetweenInlineElements(node: HTMLElement, scroll: ScrollBlot) {\n return (\n node.previousElementSibling &&\n node.nextElementSibling &&\n !isLine(node.previousElementSibling, scroll) &&\n !isLine(node.nextElementSibling, scroll)\n );\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node: Node | null) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n // @ts-expect-error\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(\n scroll: ScrollBlot,\n node: ChildNode,\n elementMatchers: Matcher[],\n textMatchers: Matcher[],\n nodeMatches: WeakMap,\n): Delta {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta: Delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode as HTMLElement, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction createMatchAlias(format: string) {\n return (_node: Element, delta: Delta, scroll: ScrollBlot) => {\n return applyFormat(delta, format, true, scroll);\n };\n}\n\nfunction matchAttributor(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats: Record = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n let attr = scroll.query(name, Scope.ATTRIBUTE) as Attributor;\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n\n return Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n}\n\nfunction matchBlot(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (match == null) return delta;\n // @ts-expect-error\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n // @ts-expect-error\n const value = match.value(node);\n if (value != null) {\n // @ts-expect-error\n embed[match.blotName] = value;\n // @ts-expect-error\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n // @ts-expect-error\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (\n 'blotName' in match &&\n 'formats' in match &&\n typeof match.formats === 'function'\n ) {\n return applyFormat(\n delta,\n match.blotName,\n match.formats(node, scroll),\n scroll,\n );\n }\n }\n return delta;\n}\n\nfunction matchBreak(node: Node, delta: Delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query('code-block');\n const language =\n match && 'formats' in match && typeof match.formats === 'function'\n ? match.formats(node, scroll)\n : true;\n return applyFormat(delta, 'code-block', language, scroll);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (\n match == null ||\n // @ts-expect-error\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n // @ts-expect-error\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (!op.insert) return composed;\n if (op.attributes && typeof op.attributes.indent === 'number') {\n return composed.push(op);\n }\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node: Node, delta: Delta, scroll: ScrollBlot) {\n const element = node as Element;\n let list = element.tagName === 'OL' ? 'ordered' : 'bullet';\n\n const checkedAttr = element.getAttribute('data-checked');\n if (checkedAttr) {\n list = checkedAttr === 'true' ? 'checked' : 'unchecked';\n }\n\n return applyFormat(delta, 'list', list, scroll);\n}\n\nfunction matchNewline(node: Node, delta: Delta, scroll: ScrollBlot) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (\n isLine(node, scroll) &&\n (node.childNodes.length > 0 || node instanceof HTMLParagraphElement)\n ) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let nextSibling: Node | null = node.nextSibling;\n while (nextSibling != null) {\n if (isLine(nextSibling, scroll)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n // @ts-expect-error\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const formats: Record = {};\n const style: Partial = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight?.startsWith('bold') ||\n // @ts-expect-error Fix me later\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n delta = Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n // @ts-expect-error\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(\n node: HTMLTableRowElement,\n delta: Delta,\n scroll: ScrollBlot,\n) {\n const table =\n node.parentElement?.tagName === 'TABLE'\n ? node.parentElement\n : node.parentElement?.parentElement;\n if (table != null) {\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row, scroll);\n }\n return delta;\n}\n\nfunction matchText(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n // @ts-expect-error\n let text = node.data;\n // Word represents empty line with  \n if (node.parentElement?.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!isPre(node)) {\n if (\n text.trim().length === 0 &&\n text.includes('\\n') &&\n !isBetweenInlineElements(node, scroll)\n ) {\n return delta;\n }\n const replacer = (collapse: unknown, match: string) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.previousSibling instanceof Element &&\n isLine(node.previousSibling, scroll))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.nextSibling instanceof Element && isLine(node.nextSibling, scroll))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n", "import { Scope } from 'parchment';\nimport type Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type Scroll from '../blots/scroll.js';\nimport type { Range } from '../core/selection.js';\n\nexport interface HistoryOptions {\n userOnly: boolean;\n delay: number;\n maxStack: number;\n}\n\nexport interface StackItem {\n delta: Delta;\n range: Range | null;\n}\n\ninterface Stack {\n undo: StackItem[];\n redo: StackItem[];\n}\n\nclass History extends Module {\n static DEFAULTS: HistoryOptions = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n };\n\n lastRecorded = 0;\n ignoreChange = false;\n stack: Stack = { undo: [], redo: [] };\n currentRange: Range | null = null;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, value, oldValue, source) => {\n if (eventName === Quill.events.SELECTION_CHANGE) {\n if (value && source !== Quill.sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === Quill.events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n\n this.currentRange = transformRange(this.currentRange, value);\n }\n },\n );\n\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: ['z', 'Z'], shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n\n this.quill.root.addEventListener('beforeinput', (event) => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n\n change(source: 'undo' | 'redo', dest: 'redo' | 'undo') {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta),\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, Quill.sources.USER);\n this.ignoreChange = false;\n\n this.restoreSelection(item);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta: Delta, oldDelta: Delta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({ delta: undoDelta, range: undoRange });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta: Delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n\n protected restoreSelection(stackItem: StackItem) {\n if (stackItem.range) {\n this.quill.setSelection(stackItem.range, Quill.sources.USER);\n } else {\n const index = getLastChangeIndex(this.quill.scroll, stackItem.delta);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n}\n\nfunction transformStack(stack: StackItem[], delta: Delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldItem = stack[i];\n stack[i] = {\n delta: remoteDelta.transform(oldItem.delta, true),\n range: oldItem.range && transformRange(oldItem.range, remoteDelta),\n };\n remoteDelta = oldItem.delta.transform(remoteDelta);\n if (stack[i].delta.length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll: Scroll, delta: Delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some((attr) => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll: Scroll, delta: Delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nfunction transformRange(range: Range | null, delta: Delta) {\n if (!range) return range;\n const start = delta.transformPosition(range.index);\n const end = delta.transformPosition(range.index + range.length);\n return { index: start, length: end - start };\n}\n\nexport { History as default, getLastChangeIndex };\n", "import Delta from 'quill-delta';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\ninterface UploaderOptions {\n mimetypes: string[];\n handler: (this: { quill: Quill }, range: Range, files: File[]) => void;\n}\n\nclass Uploader extends Module {\n static DEFAULTS: UploaderOptions;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n quill.root.addEventListener('drop', (e) => {\n e.preventDefault();\n let native: ReturnType | null = null;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n // @ts-expect-error\n } else if (document.caretPositionFromPoint) {\n // @ts-expect-error\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n }\n\n const normalized = native && quill.selection.normalizeNative(native);\n if (normalized) {\n const range = quill.selection.normalizedToRange(normalized);\n if (e.dataTransfer?.files) {\n this.upload(range, e.dataTransfer.files);\n }\n }\n });\n }\n\n upload(range: Range, files: FileList | File[]) {\n const uploads: File[] = [];\n Array.from(files).forEach((file) => {\n if (file && this.options.mimetypes?.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n // @ts-expect-error Fix me later\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range: Range, files: File[]) {\n if (!this.quill.scroll.query('image')) {\n return;\n }\n const promises = files.map>((file) => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then((images) => {\n const update = images.reduce((delta: Delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length)) as Delta;\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n", "import Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { deleteRange } from './keyboard.js';\n\nconst INSERT_TYPES = ['insertText', 'insertReplacementText'];\n\nclass Input extends Module {\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n quill.root.addEventListener('beforeinput', (event) => {\n this.handleBeforeInput(event);\n });\n\n // Gboard with English input on Android triggers `compositionstart` sometimes even\n // users are not going to type anything.\n if (!/Android/i.test(navigator.userAgent)) {\n quill.on(Quill.events.COMPOSITION_BEFORE_START, () => {\n this.handleCompositionStart();\n });\n }\n }\n\n private deleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n }\n\n private replaceText(range: Range, text = '') {\n if (range.length === 0) return false;\n\n if (text) {\n // Follow the native behavior that inherits the formats of the first character\n const formats = this.quill.getFormat(range.index, 1);\n this.deleteRange(range);\n this.quill.updateContents(\n new Delta().retain(range.index).insert(text, formats),\n Quill.sources.USER,\n );\n } else {\n this.deleteRange(range);\n }\n\n this.quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT);\n return true;\n }\n\n private handleBeforeInput(event: InputEvent) {\n if (\n this.quill.composition.isComposing ||\n event.defaultPrevented ||\n !INSERT_TYPES.includes(event.inputType)\n ) {\n return;\n }\n\n const staticRange = event.getTargetRanges\n ? event.getTargetRanges()[0]\n : null;\n if (!staticRange || staticRange.collapsed === true) {\n return;\n }\n\n const text = getPlainTextFromInputEvent(event);\n if (text == null) {\n return;\n }\n const normalized = this.quill.selection.normalizeNative(staticRange);\n const range = normalized\n ? this.quill.selection.normalizedToRange(normalized)\n : null;\n if (range && this.replaceText(range, text)) {\n event.preventDefault();\n }\n }\n\n private handleCompositionStart() {\n const range = this.quill.getSelection();\n if (range) {\n this.replaceText(range);\n }\n }\n}\n\nfunction getPlainTextFromInputEvent(event: InputEvent) {\n // When `inputType` is \"insertText\":\n // - `event.data` should be string (Safari uses `event.dataTransfer`).\n // - `event.dataTransfer` should be null.\n // When `inputType` is \"insertReplacementText\":\n // - `event.data` should be null.\n // - `event.dataTransfer` should contain \"text/plain\" data.\n\n if (typeof event.data === 'string') {\n return event.data;\n }\n if (event.dataTransfer?.types.includes('text/plain')) {\n return event.dataTransfer.getData('text/plain');\n }\n return null;\n}\n\nexport default Input;\n", "import { ParentBlot } from 'parchment';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\n\nconst isMac = /Mac/i.test(navigator.platform);\n\n// Export for testing\nexport const TTL_FOR_VALID_SELECTION_CHANGE = 100;\n\n// A loose check to determine if the shortcut can move the caret before a UI node:\n// [CARET]
    [CONTENT]
    \nconst canMoveCaretBeforeUINode = (event: KeyboardEvent) => {\n if (\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' || // RTL scripts or moving from the end of the previous line\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n event.key === 'Home'\n ) {\n return true;\n }\n\n if (isMac && event.key === 'a' && event.ctrlKey === true) {\n return true;\n }\n\n return false;\n};\n\nclass UINode extends Module {\n isListening = false;\n selectionChangeDeadline = 0;\n\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n this.handleArrowKeys();\n this.handleNavigationShortcuts();\n }\n\n private handleArrowKeys() {\n this.quill.keyboard.addBinding({\n key: ['ArrowLeft', 'ArrowRight'],\n offset: 0,\n shiftKey: null,\n handler(range, { line, event }) {\n if (!(line instanceof ParentBlot) || !line.uiNode) {\n return true;\n }\n\n const isRTL = getComputedStyle(line.domNode)['direction'] === 'rtl';\n if (\n (isRTL && event.key !== 'ArrowRight') ||\n (!isRTL && event.key !== 'ArrowLeft')\n ) {\n return true;\n }\n\n this.quill.setSelection(\n range.index - 1,\n range.length + (event.shiftKey ? 1 : 0),\n Quill.sources.USER,\n );\n return false;\n },\n });\n }\n\n private handleNavigationShortcuts() {\n this.quill.root.addEventListener('keydown', (event) => {\n if (!event.defaultPrevented && canMoveCaretBeforeUINode(event)) {\n this.ensureListeningToSelectionChange();\n }\n });\n }\n\n /**\n * We only listen to the `selectionchange` event when\n * there is an intention of moving the caret to the beginning using shortcuts.\n * This is primarily implemented to prevent infinite loops, as we are changing\n * the selection within the handler of a `selectionchange` event.\n */\n private ensureListeningToSelectionChange() {\n this.selectionChangeDeadline = Date.now() + TTL_FOR_VALID_SELECTION_CHANGE;\n\n if (this.isListening) return;\n this.isListening = true;\n\n const listener = () => {\n this.isListening = false;\n\n if (Date.now() <= this.selectionChangeDeadline) {\n this.handleSelectionChange();\n }\n };\n\n document.addEventListener('selectionchange', listener, {\n once: true,\n });\n }\n\n private handleSelectionChange() {\n const selection = document.getSelection();\n if (!selection) return;\n const range = selection.getRangeAt(0);\n if (range.collapsed !== true || range.startOffset !== 0) return;\n\n const line = this.quill.scroll.find(range.startContainer);\n if (!(line instanceof ParentBlot) || !line.uiNode) return;\n\n const newRange = document.createRange();\n newRange.setStartAfter(line.uiNode);\n newRange.setEndAfter(line.uiNode);\n selection.removeAllRanges();\n selection.addRange(newRange);\n }\n}\n\nexport default UINode;\n", "import Quill, { Parchment, Range } from './core/quill.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core/quill.js';\n\nimport Block, { BlockEmbed } from './blots/block.js';\nimport Break from './blots/break.js';\nimport Container from './blots/container.js';\nimport Cursor from './blots/cursor.js';\nimport Embed from './blots/embed.js';\nimport Inline from './blots/inline.js';\nimport Scroll from './blots/scroll.js';\nimport TextBlot from './blots/text.js';\n\nimport Clipboard from './modules/clipboard.js';\nimport History from './modules/history.js';\nimport Keyboard from './modules/keyboard.js';\nimport Uploader from './modules/uploader.js';\nimport Delta, { Op, OpIterator, AttributeMap } from 'quill-delta';\nimport Input from './modules/input.js';\nimport UINode from './modules/uiNode.js';\n\nexport { default as Module } from './core/module.js';\nexport { Delta, Op, OpIterator, AttributeMap, Parchment, Range };\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n 'modules/input': Input,\n 'modules/uiNode': UINode,\n});\n\nexport default Quill;\n", "import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node: HTMLElement, value: string | number) {\n let normalizedValue = 0;\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n normalizedValue = value === '+1' ? indent + 1 : indent - 1;\n } else if (typeof value === 'number') {\n normalizedValue = value;\n }\n if (normalizedValue === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, normalizedValue.toString());\n }\n\n canAdd(node: HTMLElement, value: string) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node: HTMLElement) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n // @ts-expect-error\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n", "import Block from '../blots/block.js';\n\nclass Blockquote extends Block {\n static blotName = 'blockquote';\n static tagName = 'blockquote';\n}\n\nexport default Blockquote;\n", "import Block from '../blots/block.js';\n\nclass Header extends Block {\n static blotName = 'header';\n static tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n static formats(domNode: Element) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\n\nexport default Header;\n", "import Block from '../blots/block.js';\nimport Container from '../blots/container.js';\nimport type Scroll from '../blots/scroll.js';\nimport Quill from '../core/quill.js';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value: string) {\n const node = super.create() as HTMLElement;\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll: Scroll, domNode: HTMLElement) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = (e: Event) => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name: string, value: string) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n", "import Inline from '../blots/inline.js';\n\nclass Bold extends Inline {\n static blotName = 'bold';\n static tagName = ['STRONG', 'B'];\n\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\n\nexport default Bold;\n", "import Bold from './bold.js';\n\nclass Italic extends Bold {\n static blotName = 'italic';\n static tagName = ['EM', 'I'];\n}\n\nexport default Italic;\n", "import Inline from '../blots/inline.js';\n\nclass Link extends Inline {\n static blotName = 'link';\n static tagName = 'A';\n static SANITIZED_URL = 'about:blank';\n static PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms'];\n\n static create(value: string) {\n const node = super.create(value) as HTMLElement;\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url: string) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name: string, value: unknown) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n // @ts-expect-error\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\n\nfunction sanitize(url: string, protocols: string[]) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n", "import Inline from '../blots/inline.js';\n\nclass Script extends Inline {\n static blotName = 'script';\n static tagName = ['SUB', 'SUP'];\n\n static create(value: 'super' | 'sub' | (string & {})) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\n\nexport default Script;\n", "import Bold from './bold.js';\n\nclass Strike extends Bold {\n static blotName = 'strike';\n static tagName = ['S', 'STRIKE'];\n}\n\nexport default Strike;\n", "import Inline from '../blots/inline.js';\n\nclass Underline extends Inline {\n static blotName = 'underline';\n static tagName = 'U';\n}\n\nexport default Underline;\n", "import Embed from '../blots/embed.js';\n\nclass Formula extends Embed {\n static blotName = 'formula';\n static className = 'ql-formula';\n static tagName = 'SPAN';\n\n static create(value: string) {\n // @ts-expect-error\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n // @ts-expect-error\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\n\nexport default Formula;\n", "import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link.js';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static blotName = 'image';\n static tagName = 'IMG';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static match(url: string) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url: string) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLImageElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\n\nexport default Image;\n", "import { BlockEmbed } from '../blots/block.js';\nimport Link from './link.js';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static blotName = 'video';\n static className = 'ql-video';\n static tagName = 'IFRAME';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static sanitize(url: string) {\n return Link.sanitize(url);\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLVideoElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `${video}`;\n }\n}\n\nexport default Video;\n", "import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport type { Blot, ScrollBlot } from 'parchment';\nimport Inline from '../blots/inline.js';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport { blockDelta } from '../blots/block.js';\nimport BreakBlot from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code.js';\nimport { traverse } from './clipboard.js';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node: Element, scroll: ScrollBlot) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList && node.classList.contains(CodeBlock.className)) {\n // @ts-expect-error\n return super.formats(node, scroll);\n }\n // @ts-expect-error\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll: ScrollBlot, domNode: Node, value: unknown) {\n // @ts-expect-error\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format: string, value: unknown) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args: unknown[]) {\n // @ts-expect-error\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value: unknown) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode: Node) {\n // @ts-expect-error\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name: string, value: unknown) {\n if (name === this.statics.blotName && value) {\n // @ts-expect-error\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name: string | Blot, value?: any) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n forceNext?: boolean;\n cachedText?: string | null;\n\n attach() {\n super.attach();\n this.forceNext = false;\n // @ts-expect-error\n this.scroll.emitMount(this);\n }\n\n format(name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach((child) => {\n // @ts-expect-error\n child.format(name, value);\n });\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(\n highlight: (text: string, language: string) => Delta,\n forced = false,\n ) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n (node) => node !== this.uiNode,\n );\n const text = `${nodes.map((node) => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n // @ts-expect-error\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach((format) => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n // @ts-expect-error\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n // @ts-expect-error\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n html(index: number, length: number) {\n const [codeBlock] = this.children.find(index);\n const language = codeBlock\n ? SyntaxCodeBlock.formats(codeBlock.domNode)\n : 'plain';\n\n return `
    \\n${escapeText(\n      this.code(index, length),\n    )}\\n
    `;\n }\n\n optimize(context: Record) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n // @ts-expect-error\n if (language !== this.uiNode.value) {\n // @ts-expect-error\n this.uiNode.value = language;\n }\n }\n }\n}\n\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\ninterface SyntaxOptions {\n interval: number;\n languages: { key: string; label: string }[];\n hljs: any;\n}\n\nconst highlight = (lib: any, language: string, text: string) => {\n if (typeof lib.versionString === 'string') {\n const majorVersion = lib.versionString.split('.')[0];\n if (parseInt(majorVersion, 10) >= 11) {\n return lib.highlight(text, { language }).value;\n }\n }\n return lib.highlight(language, text).value;\n};\n\nclass Syntax extends Module {\n static DEFAULTS: SyntaxOptions & { hljs: any };\n\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n languages: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n // @ts-expect-error Fix me later\n this.languages = this.options.languages.reduce(\n (memo: Record, { key }) => {\n memo[key] = true;\n return memo;\n },\n {},\n );\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, (blot: Blot) => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n // @ts-expect-error Fix me later\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer: ReturnType | null = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot: SyntaxCodeBlockContainer | null = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach((container) => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text: string, language = 'plain') {\n language = this.languages[language] ? language : 'plain';\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = highlight(this.options.hljs, language, text);\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n // @ts-expect-error\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n // @ts-expect-error\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'JavaScript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n", "import type { LinkedList } from 'parchment';\nimport Block from '../blots/block.js';\nimport Container from '../blots/container.js';\n\nclass TableCell extends Block {\n static blotName = 'table';\n static tagName = 'TD';\n\n static create(value: string) {\n const node = super.create() as HTMLElement;\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n next: this | null;\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name: string, value: string) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row(): TableRow {\n return this.parent as TableRow;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\n\nclass TableRow extends Container {\n static blotName = 'table-row';\n static tagName = 'TR';\n\n children: LinkedList;\n next: this | null;\n\n checkMerge() {\n // @ts-expect-error\n if (super.checkMerge() && this.next.children.head != null) {\n // @ts-expect-error\n const thisHead = this.children.head.formats();\n // @ts-expect-error\n const thisTail = this.children.tail.formats();\n // @ts-expect-error\n const nextHead = this.next.children.head.formats();\n // @ts-expect-error\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.children.forEach((child) => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\n\nclass TableBody extends Container {\n static blotName = 'table-body';\n static tagName = 'TBODY';\n\n children: LinkedList;\n}\n\nclass TableContainer extends Container {\n static blotName = 'table-container';\n static tagName = 'TABLE';\n\n children: LinkedList;\n\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach((row) => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column: number) {\n return this.rows().map((row) => row.children.at(column));\n }\n\n deleteColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const ref = row.children.at(index);\n // @ts-expect-error\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName) as TableRow;\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map((row) => row);\n }\n}\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random().toString(36).slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n", "import Delta from 'quill-delta';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table.js';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach((table) => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n // @ts-expect-error\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n // @ts-expect-error\n const offset = table.offset();\n // @ts-expect-error\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(\n range = this.quill.getSelection(),\n ): [null, null, null, -1] | [Table, TableRow, TableCell, number] {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n // @ts-expect-error\n return [table, row, cell, offset];\n }\n\n insertColumn(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows: number, columns: number) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce((memo) => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(\n Quill.events.SCROLL_OPTIMIZE,\n (mutations: MutationRecord[]) => {\n mutations.some((mutation) => {\n if (\n ['TD', 'TR', 'TBODY', 'TABLE'].includes(\n (mutation.target as HTMLElement).tagName,\n )\n ) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n },\n );\n }\n}\n\nexport default Table;\n", "import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:toolbar');\n\ntype Handler = (this: Toolbar, value: any) => void;\n\nexport type ToolbarConfig = Array<\n string[] | Array>\n>;\nexport interface ToolbarProps {\n container?: HTMLElement | ToolbarConfig | null;\n handlers?: Record;\n option?: number;\n module?: boolean;\n theme?: boolean;\n}\n\nclass Toolbar extends Module {\n static DEFAULTS: ToolbarProps;\n\n container?: HTMLElement | null;\n controls: [string, HTMLElement][];\n handlers: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n container.setAttribute('role', 'toolbar');\n addControls(container, this.options.container);\n quill.container?.parentNode?.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n debug.error('Container required for toolbar', this.options);\n return;\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n if (this.options.handlers) {\n Object.keys(this.options.handlers).forEach((format) => {\n const handler = this.options.handlers?.[format];\n if (handler) {\n this.addHandler(format, handler);\n }\n });\n }\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n (input) => {\n // @ts-expect-error\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format: string, handler: Handler) {\n this.handlers[format] = handler;\n }\n\n attach(input: HTMLElement) {\n let format = Array.from(input.classList).find((className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n // @ts-expect-error\n if (input.selectedIndex < 0) return;\n // @ts-expect-error\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n // @ts-expect-error\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n // @ts-expect-error\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index)\n // @ts-expect-error Fix me later\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range: Range | null) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach((pair) => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option: HTMLOptionElement | null = null;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n // @ts-expect-error TODO fix me later\n input.value = ''; // TODO make configurable?\n // @ts-expect-error TODO fix me later\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n input.setAttribute('aria-pressed', 'false');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const value = formats[format] as boolean | number | string | object;\n const isActive =\n value === input.getAttribute('value') ||\n (value != null && value.toString() === input.getAttribute('value')) ||\n (value == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n } else {\n const isActive = formats[format] != null;\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container: HTMLElement, format: string, value?: string) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n input.setAttribute('aria-pressed', 'false');\n if (value != null) {\n input.value = value;\n input.setAttribute('aria-label', `${format}: ${value}`);\n } else {\n input.setAttribute('aria-label', format);\n }\n container.appendChild(input);\n}\n\nfunction addControls(\n container: HTMLElement,\n groups:\n | (string | Record)[][]\n | (string | Record)[],\n) {\n if (!Array.isArray(groups[0])) {\n // @ts-expect-error\n groups = [groups];\n }\n groups.forEach((controls: any) => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach((control: any) => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(\n container: HTMLElement,\n format: string,\n values: Array,\n) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', String(value));\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range.index, range.length, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n // @ts-expect-error\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n", "import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport header3Icon from '../assets/icons/header-3.svg';\nimport header4Icon from '../assets/icons/header-4.svg';\nimport header5Icon from '../assets/icons/header-5.svg';\nimport header6Icon from '../assets/icons/header-6.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n '3': header3Icon,\n '4': header4Icon,\n '5': header5Icon,\n '6': header6Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n", "import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element: HTMLElement, attribute: string) {\n element.setAttribute(\n attribute,\n `${!(element.getAttribute(attribute) === 'true')}`,\n );\n}\n\nclass Picker {\n select: HTMLSelectElement;\n container: HTMLElement;\n label: HTMLElement;\n\n constructor(select: HTMLSelectElement) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n // @ts-expect-error Fix me later\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n // @ts-expect-error\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = document.createElement('span');\n // @ts-expect-error\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n const value = option.getAttribute('value');\n if (value) {\n item.setAttribute('data-value', value);\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n // @ts-expect-error\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n // @ts-expect-error\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n // @ts-expect-error\n this.options = options;\n\n Array.from(this.select.options).forEach((option) => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n // @ts-expect-error\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item: HTMLElement | null, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n // @ts-expect-error Fix me later\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item =\n // @ts-expect-error Fix me later\n this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n // @ts-expect-error\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n", "import Picker from './picker.js';\n\nclass ColorPicker extends Picker {\n constructor(select: HTMLSelectElement, label: string) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach((item) => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item: HTMLElement | null, trigger?: boolean) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n", "import Picker from './picker.js';\n\nclass IconPicker extends Picker {\n defaultItem: HTMLElement | null;\n\n constructor(select: HTMLSelectElement, icons: Record) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target: HTMLElement | null, trigger?: boolean) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n\nexport default IconPicker;\n", "import type Quill from '../core.js';\nimport type { Bounds } from '../core/selection.js';\n\nconst isScrollable = (el: Element) => {\n const { overflowY } = getComputedStyle(el, null);\n return overflowY !== 'visible' && overflowY !== 'clip';\n};\n\nclass Tooltip {\n quill: Quill;\n boundsContainer: HTMLElement;\n root: HTMLDivElement;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n // @ts-expect-error\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (isScrollable(this.quill.root)) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference: Bounds) {\n const left =\n reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n", "import { merge } from 'lodash-es';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Theme from '../core/theme.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport ColorPicker from '../ui/color-picker.js';\nimport IconPicker from '../ui/icon-picker.js';\nimport Picker from '../ui/picker.js';\nimport Tooltip from '../ui/tooltip.js';\nimport type { Range } from '../core/selection.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport type Selection from '../core/selection.js';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n pickers: Picker[];\n tooltip?: Tooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n super(quill, options);\n const listener = (e: MouseEvent) => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n // @ts-expect-error\n !this.tooltip.root.contains(e.target) &&\n // @ts-expect-error\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach((picker) => {\n // @ts-expect-error\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: 'selection'): Selection;\n addModule(name: string): unknown;\n addModule(name: string) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n // @ts-expect-error\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(\n buttons: NodeListOf,\n icons: Record | string>,\n ) {\n Array.from(buttons).forEach((button) => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n // @ts-expect-error\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n // @ts-expect-error\n button.innerHTML = icons[name];\n } else {\n // @ts-expect-error\n const value = button.value || '';\n // @ts-expect-error\n if (value != null && icons[name][value]) {\n // @ts-expect-error\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(\n selects: NodeListOf,\n icons: Record>,\n ) {\n this.pickers = Array.from(selects).map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n if (typeof icons.align === 'object') {\n return new IconPicker(select, icons.align);\n }\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format] as string);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach((picker) => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = merge({}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n textbox: HTMLInputElement | null;\n linkRange?: Range;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n // @ts-expect-error Fix me later\n this.textbox.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n this.restoreFocus();\n }\n\n edit(mode = 'link', preview: string | null = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (this.textbox == null) return;\n\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n const bounds = this.quill.getBounds(this.quill.selection.savedRange);\n if (bounds != null) {\n this.position(bounds);\n }\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n this.quill.focus({ preventScroll: true });\n }\n\n save() {\n // @ts-expect-error Fix me later\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n // @ts-expect-error Fix me later\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n // @ts-expect-error Fix me later\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url: string) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(\n select: HTMLSelectElement,\n values: Array,\n defaultValue: unknown = false,\n) {\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', String(value));\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport { Range } from '../core/selection.js';\nimport type { Bounds } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n ].join('');\n\n constructor(quill: Quill, bounds?: HTMLElement) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n if (indexBounds != null) {\n this.position(indexBounds);\n }\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference: Bounds) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n // @ts-expect-error\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n // @ts-expect-error\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\n\nclass BubbleTheme extends BaseTheme {\n tooltip: BubbleTooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar: Toolbar) {\n // @ts-expect-error\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n if (toolbar.container != null) {\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n }\n}\nBubbleTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (!value) {\n this.quill.format('link', false, Quill.sources.USER);\n } else {\n // @ts-expect-error\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport { BubbleTooltip, BubbleTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport LinkBlot from '../formats/link.js';\nimport { Range } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { Context } from '../modules/keyboard.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\nimport type { ThemeOptions } from '../core/theme.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '',\n '',\n '',\n ].join('');\n\n preview = this.root.querySelector('a.ql-preview');\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-action')\n .addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n // @ts-expect-error Fix me later\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-remove')\n .addEventListener('click', (event) => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n // @ts-expect-error Fix me later\n this.preview.textContent = preview;\n // @ts-expect-error Fix me later\n this.preview.setAttribute('href', preview);\n this.show();\n const bounds = this.quill.getBounds(this.linkRange);\n if (bounds != null) {\n this.position(bounds);\n }\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\n\nclass SnowTheme extends BaseTheme {\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar: Toolbar) {\n if (toolbar.container != null) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n // @ts-expect-error\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (_range: Range, context: Context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n }\n}\nSnowTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n // @ts-expect-error\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false, Quill.sources.USER);\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport default SnowTheme;\n", "import Quill, { Parchment, Range } from './core.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core.js';\n\nimport { AlignClass, AlignStyle } from './formats/align.js';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction.js';\nimport Indent from './formats/indent.js';\n\nimport Blockquote from './formats/blockquote.js';\nimport Header from './formats/header.js';\nimport List from './formats/list.js';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background.js';\nimport { ColorClass, ColorStyle } from './formats/color.js';\nimport { FontClass, FontStyle } from './formats/font.js';\nimport { SizeClass, SizeStyle } from './formats/size.js';\n\nimport Bold from './formats/bold.js';\nimport Italic from './formats/italic.js';\nimport Link from './formats/link.js';\nimport Script from './formats/script.js';\nimport Strike from './formats/strike.js';\nimport Underline from './formats/underline.js';\n\nimport Formula from './formats/formula.js';\nimport Image from './formats/image.js';\nimport Video from './formats/video.js';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code.js';\n\nimport Syntax from './modules/syntax.js';\nimport Table from './modules/table.js';\nimport Toolbar from './modules/toolbar.js';\n\nimport Icons from './ui/icons.js';\nimport Picker from './ui/picker.js';\nimport ColorPicker from './ui/color-picker.js';\nimport IconPicker from './ui/icon-picker.js';\nimport Tooltip from './ui/tooltip.js';\n\nimport BubbleTheme from './themes/bubble.js';\nimport SnowTheme from './themes/snow.js';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport { Module } from './core.js';\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\nexport { Parchment, Range };\n\nexport default Quill;\n", "/*! For license information please see quill-cursors.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.QuillCursors=e():t.QuillCursors=e()}(self,(()=>(()=>{var t={582:(t,e,r)=>{\"use strict\";r.d(e,{Z:()=>s});var n=r(81),i=r.n(n),o=r(645),a=r.n(o)()(i());a.push([t.id,\".ql-container{position:relative;overflow:hidden}@media(pointer: coarse){.ql-cursor-caret-container{z-index:-1}}.ql-cursor.hidden{display:none}.ql-cursor .ql-cursor-caret-container,.ql-cursor .ql-cursor-flag{position:absolute}.ql-cursor .ql-cursor-flag{z-index:1;transform:translate3d(-1px, -100%, 0);opacity:0;visibility:hidden;color:#fff;padding-bottom:2px;border-radius:0 3px 3px 0}.ql-cursor .ql-cursor-flag.flag-flipped{border-radius:3px 0 0 3px;transform:translate3d(calc(-100% + 1px ), -100%, 0)}@media screen{.ql-cursor .ql-cursor-flag{transition:opacity 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms,visibility 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms}}.ql-cursor .ql-cursor-flag .ql-cursor-name{margin-left:5px;margin-right:5px;display:inline-block;margin-top:-2px;white-space:nowrap}.ql-cursor .ql-cursor-flag.no-delay[style]{transition-delay:unset !important}.ql-cursor .ql-cursor-caret-container{cursor:text;margin-left:-9px;padding:0 9px}.ql-cursor .ql-cursor-caret-container.hover+.ql-cursor-flag{opacity:1;visibility:visible;transition:none}.ql-cursor .ql-cursor-caret-container.no-pointer{pointer-events:none}.ql-cursor .ql-cursor-caret-container .ql-cursor-caret{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background-color:attr(data-color)}.ql-cursor .ql-cursor-selection-block{position:absolute;pointer-events:none}\",\"\"]);const s=a},645:t=>{\"use strict\";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=\"\",n=void 0!==e[5];return e[4]&&(r+=\"@supports (\".concat(e[4],\") {\")),e[2]&&(r+=\"@media \".concat(e[2],\" {\")),n&&(r+=\"@layer\".concat(e[5].length>0?\" \".concat(e[5]):\"\",\" {\")),r+=t(e),n&&(r+=\"}\"),e[2]&&(r+=\"}\"),e[4]&&(r+=\"}\"),r})).join(\"\")},e.i=function(t,r,n,i,o){\"string\"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var s=0;s0?\" \".concat(l[5]):\"\",\" {\").concat(l[1],\"}\")),l[5]=o),r&&(l[2]?(l[1]=\"@media \".concat(l[2],\" {\").concat(l[1],\"}\"),l[2]=r):l[2]=r),i&&(l[4]?(l[1]=\"@supports (\".concat(l[4],\") {\").concat(l[1],\"}\"),l[4]=i):l[4]=\"\".concat(i)),e.push(l))}},e}},81:t=>{\"use strict\";t.exports=function(t){return t[1]}},529:t=>{var e=-1;function r(t,s,u,c){if(t===s)return t?[[0,t]]:[];if(null!=u){var l=function(t,e,r){var n=\"number\"==typeof r?{index:r,length:0}:r.oldRange,i=\"number\"==typeof r?null:r.newRange,o=t.length,a=e.length;if(0===n.length&&(null===i||0===i.length)){var s=n.index,u=t.slice(0,s),c=t.slice(s),l=i?i.index:null,h=s+a-o;if((null===l||l===h)&&!(h<0||h>a)){var d=e.slice(0,h);if((_=e.slice(h))===c){var p=Math.min(s,h);if((b=u.slice(0,p))===(m=d.slice(0,p)))return f(b,u.slice(p),d.slice(p),c)}}if(null===l||l===s){var g=s,_=(d=e.slice(0,g),e.slice(g));if(d===u){var v=Math.min(o-g,a-g);if((y=c.slice(c.length-v))===(A=_.slice(_.length-v)))return f(u,c.slice(0,c.length-v),_.slice(0,_.length-v),y)}}}if(n.length>0&&i&&0===i.length){var b=t.slice(0,n.index),y=t.slice(n.index+n.length);if(!(a<(p=b.length)+(v=y.length))){var m=e.slice(0,p),A=e.slice(a-v);if(b===m&&y===A)return f(b,t.slice(p,o-v),e.slice(p,a-v),y)}}return null}(t,s,u);if(l)return l}var h=i(t,s),d=t.substring(0,h);h=o(t=t.substring(h),s=s.substring(h));var p=t.substring(t.length-h),g=function(t,a){var s;if(!t)return[[1,a]];if(!a)return[[e,t]];var u=t.length>a.length?t:a,c=t.length>a.length?a:t,l=u.indexOf(c);if(-1!==l)return s=[[1,u.substring(0,l)],[0,c],[1,u.substring(l+c.length)]],t.length>a.length&&(s[0][0]=s[2][0]=e),s;if(1===c.length)return[[e,t],[1,a]];var f=function(t,e){var r=t.length>e.length?t:e,n=t.length>e.length?e:t;if(r.length<4||2*n.length=t.length?[n,a,s,u,f]:null}var s,u,c,l,f,h=a(r,n,Math.ceil(r.length/4)),d=a(r,n,Math.ceil(r.length/2));return h||d?(s=d?h&&h[4].length>d[4].length?h:d:h,t.length>e.length?(u=s[0],c=s[1],l=s[2],f=s[3]):(l=s[0],f=s[1],u=s[2],c=s[3]),[u,c,l,f,s[4]]):null}(t,a);if(f){var h=f[0],d=f[1],p=f[2],g=f[3],_=f[4],v=r(h,p),b=r(d,g);return v.concat([[0,_]],b)}return function(t,r){for(var i=t.length,o=r.length,a=Math.ceil((i+o)/2),s=a,u=2*a,c=new Array(u),l=new Array(u),f=0;fi)g+=2;else if(A>o)p+=2;else if(d&&(w=s+h-y)>=0&&w=(C=i-l[w]))return n(t,r,S,A)}for(var x=-b+_;x<=b-v;x+=2){for(var C,w=s+x,E=(C=x===-b||x!==b&&l[w-1]i)v+=2;else if(E>o)_+=2;else if(!d){var S;if((m=s+h-x)>=0&&m=(C=i-C))return n(t,r,S,A)}}}return[[e,t],[1,r]]}(t,a)}(t=t.substring(0,t.length-h),s=s.substring(0,s.length-h));return d&&g.unshift([0,d]),p&&g.push([0,p]),a(g,c),g}function n(t,e,n,i){var o=t.substring(0,n),a=e.substring(0,i),s=t.substring(n),u=e.substring(i),c=r(o,a),l=r(s,u);return c.concat(l)}function i(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var r=0,n=Math.min(t.length,e.length),i=n,o=0;r=0&&l(t[p][1])){var g=t[p][1].slice(-1);if(t[p][1]=t[p][1].slice(0,-1),h=g+h,d=g+d,!t[p][1]){t.splice(p,1),s--;var _=p-1;t[_]&&1===t[_][0]&&(f++,d=t[_][1]+d,_--),t[_]&&t[_][0]===e&&(u++,h=t[_][1]+h,_--),p=_}}c(t[s][1])&&(g=t[s][1].charAt(0),t[s][1]=t[s][1].slice(1),h+=g,d+=g)}if(s0||d.length>0){h.length>0&&d.length>0&&(0!==(n=i(d,h))&&(p>=0?t[p][1]+=d.substring(0,n):(t.splice(0,0,[0,d.substring(0,n)]),s++),d=d.substring(n),h=h.substring(n)),0!==(n=o(d,h))&&(t[s][1]=d.substring(d.length-n)+t[s][1],d=d.substring(0,d.length-n),h=h.substring(0,h.length-n)));var v=f+u;0===h.length&&0===d.length?(t.splice(s-v,v),s-=v):0===h.length?(t.splice(s-v,v,[1,d]),s=s-v+1):0===d.length?(t.splice(s-v,v,[e,h]),s=s-v+1):(t.splice(s-v,v,[e,h],[1,d]),s=s-v+2)}0!==s&&0===t[s-1][0]?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,f=0,u=0,h=\"\",d=\"\"}\"\"===t[t.length-1][1]&&t.pop();var b=!1;for(s=1;s=55296&&t<=56319}function u(t){return t>=56320&&t<=57343}function c(t){return u(t.charCodeAt(0))}function l(t){return s(t.charCodeAt(t.length-1))}function f(t,r,n,i){return l(t)||c(i)?null:function(t){for(var e=[],r=0;r0&&e.push(t[r]);return e}([[0,t],[e,r],[1,n],[0,i]])}function h(t,e,n){return r(t,e,n,!0)}h.INSERT=1,h.DELETE=e,h.EQUAL=0,t.exports=h},465:(t,e,r)=>{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Boolean]\",s=\"[object Date]\",u=\"[object Function]\",c=\"[object GeneratorFunction]\",l=\"[object Map]\",f=\"[object Number]\",h=\"[object Object]\",d=\"[object Promise]\",p=\"[object RegExp]\",g=\"[object Set]\",_=\"[object String]\",v=\"[object Symbol]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=\"[object Float32Array]\",x=\"[object Float64Array]\",C=\"[object Int8Array]\",w=\"[object Int16Array]\",E=\"[object Int32Array]\",S=\"[object Uint8Array]\",M=\"[object Uint8ClampedArray]\",O=\"[object Uint16Array]\",j=\"[object Uint32Array]\",L=/\\w*$/,k=/^\\[object .+?Constructor\\]$/,T=/^(?:0|[1-9]\\d*)$/,R={};R[o]=R[\"[object Array]\"]=R[y]=R[m]=R[a]=R[s]=R[A]=R[x]=R[C]=R[w]=R[E]=R[l]=R[f]=R[h]=R[p]=R[g]=R[_]=R[v]=R[S]=R[M]=R[O]=R[j]=!0,R[\"[object Error]\"]=R[u]=R[b]=!1;var N=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,q=\"object\"==typeof self&&self&&self.Object===Object&&self,D=N||q||Function(\"return this\")(),F=e&&!e.nodeType&&e,I=F&&t&&!t.nodeType&&t,P=I&&I.exports===F;function B(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function H(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=kt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new St,map:new(pt||Mt),string:new St}},Ot.prototype.delete=function(t){return qt(this,t).delete(t)},Ot.prototype.get=function(t){return qt(this,t).get(t)},Ot.prototype.has=function(t){return qt(this,t).has(t)},Ot.prototype.set=function(t,e){return qt(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Mt},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Ot(n)}return r.set(t,e),this};var Ft=lt?$(lt,Object):function(){return[]},It=function(t){return et.call(t)};function Pt(t,e){return!!(e=null==e?i:e)&&(\"number\"==typeof t||T.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!Vt(t)}var $t=ft||function(){return!1};function Vt(t){var e=Wt(t)?et.call(t):\"\";return e==u||e==c}function Wt(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function Xt(t){return Gt(t)?function(t,e){var r=Ut(t)||function(t){return function(t){return function(t){return!!t&&\"object\"==typeof t}(t)&&Gt(t)}(t)&&tt.call(t,\"callee\")&&(!ut.call(t,\"callee\")||et.call(t)==o)}(t)?function(t,e){for(var r=-1,n=Array(t);++r{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Array]\",s=\"[object Boolean]\",u=\"[object Date]\",c=\"[object Error]\",l=\"[object Function]\",f=\"[object Map]\",h=\"[object Number]\",d=\"[object Object]\",p=\"[object Promise]\",g=\"[object RegExp]\",_=\"[object Set]\",v=\"[object String]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=/^\\[object .+?Constructor\\]$/,x=/^(?:0|[1-9]\\d*)$/,C={};C[\"[object Float32Array]\"]=C[\"[object Float64Array]\"]=C[\"[object Int8Array]\"]=C[\"[object Int16Array]\"]=C[\"[object Int32Array]\"]=C[\"[object Uint8Array]\"]=C[\"[object Uint8ClampedArray]\"]=C[\"[object Uint16Array]\"]=C[\"[object Uint32Array]\"]=!0,C[o]=C[a]=C[y]=C[s]=C[m]=C[u]=C[c]=C[l]=C[f]=C[h]=C[d]=C[g]=C[_]=C[v]=C[b]=!1;var w=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E=\"object\"==typeof self&&self&&self.Object===Object&&self,S=w||E||Function(\"return this\")(),M=e&&!e.nodeType&&e,O=M&&t&&!t.nodeType&&t,j=O&&O.exports===M,L=j&&w.process,k=function(){try{return L&&L.binding&&L.binding(\"util\")}catch(t){}}(),T=k&&k.isTypedArray;function R(t,e){for(var r=-1,n=null==t?0:t.length;++rs))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var l=-1,f=!0,h=2&r?new yt:void 0;for(o.set(t,e),o.set(e,t);++l-1},vt.prototype.set=function(t,e){var r=this.__data__,n=At(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bt.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(it||vt),string:new _t}},bt.prototype.delete=function(t){var e=Mt(this,t).delete(t);return this.size-=e?1:0,e},bt.prototype.get=function(t){return Mt(this,t).get(t)},bt.prototype.has=function(t){return Mt(this,t).has(t)},bt.prototype.set=function(t,e){var r=Mt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},yt.prototype.add=yt.prototype.push=function(t){return this.__data__.set(t,n),this},yt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.clear=function(){this.__data__=new vt,this.size=0},mt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},mt.prototype.get=function(t){return this.__data__.get(t)},mt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(n)}return r.set(t,e),this.size=r.size,this};var jt=tt?function(t){return null==t?[]:(t=Object(t),function(e,r){for(var n=-1,i=null==e?0:e.length,o=0,a=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=i}function Pt(t){var e=typeof t;return null!=t&&(\"object\"==e||\"function\"==e)}function Bt(t){return null!=t&&\"object\"==typeof t}var zt=T?function(t){return function(e){return t(e)}}(T):function(t){return Bt(t)&&It(t.length)&&!!C[xt(t)]};function Ht(t){return null!=(e=t)&&It(e.length)&&!Ft(e)?function(t,e){var r=qt(t),n=!r&&Nt(t),i=!r&&!n&&Dt(t),o=!r&&!n&&!i&&zt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++r0?n:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),\"object\"!=typeof t&&(t={}),\"object\"!=typeof e&&(e={});var r=Object.keys(t).concat(Object.keys(e)).reduce((function(r,n){return a.default(t[n],e[n])||(r[n]=void 0===e[n]?null:e[n]),r}),{});return Object.keys(r).length>0?r:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var r=Object.keys(e).reduce((function(r,n){return e[n]!==t[n]&&void 0!==t[n]&&(r[n]=e[n]),r}),{});return Object.keys(t).reduce((function(r,n){return t[n]!==e[n]&&void 0===e[n]&&(r[n]=null),r}),r)},t.transform=function(t,e,r){if(void 0===r&&(r=!1),\"object\"!=typeof t)return e;if(\"object\"==typeof e){if(!r)return e;var n=Object.keys(e).reduce((function(r,n){return void 0===t[n]&&(r[n]=e[n]),r}),{});return Object.keys(n).length>0?n:void 0}}}(i||(i={})),e.default=i},895:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=n(r(529)),o=n(r(465)),a=n(r(307)),s=n(r(210)),u=n(r(430)),c=String.fromCharCode(0),l=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var r={};return\"string\"==typeof t&&0===t.length?this:(r.insert=t,null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var r={retain:t};return null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r)},t.prototype.push=function(t){var e=this.ops.length,r=this.ops[e-1];if(t=o.default(t),\"object\"==typeof r){if(\"number\"==typeof t.delete&&\"number\"==typeof r.delete)return this.ops[e-1]={delete:r.delete+t.delete},this;if(\"number\"==typeof r.delete&&null!=t.insert&&(e-=1,\"object\"!=typeof(r=this.ops[e-1])))return this.ops.unshift(t),this;if(a.default(t.attributes,r.attributes)){if(\"string\"==typeof t.insert&&\"string\"==typeof r.insert)return this.ops[e-1]={insert:r.insert+t.insert},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if(\"number\"==typeof t.retain&&\"number\"==typeof r.retain)return this.ops[e-1]={retain:r.retain+t.retain},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],r=[];return this.forEach((function(n){(t(n)?e:r).push(n)})),[e,r]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+u.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+u.default.length(e)}),0)},t.prototype.slice=function(e,r){void 0===e&&(e=0),void 0===r&&(r=1/0);for(var n=[],i=u.default.iterator(this.ops),o=0;o0&&n.next(o.retain-c)}for(var l=new t(i);r.hasNext()||n.hasNext();)if(\"insert\"===n.peekType())l.push(n.next());else if(\"delete\"===r.peekType())l.push(r.next());else{var f=Math.min(r.peekLength(),n.peekLength()),h=r.next(f),d=n.next(f);if(\"number\"==typeof d.retain){var p={};\"number\"==typeof h.retain?p.retain=f:p.insert=h.insert;var g=s.default.compose(h.attributes,d.attributes,\"number\"==typeof h.retain);if(g&&(p.attributes=g),l.push(p),!n.hasNext()&&a.default(l.ops[l.ops.length-1],p)){var _=new t(r.rest());return l.concat(_).chop()}}else\"number\"==typeof d.delete&&\"number\"==typeof h.retain&&l.push(d)}return l.chop()},t.prototype.concat=function(e){var r=new t(this.ops.slice());return e.ops.length>0&&(r.push(e.ops[0]),r.ops=r.ops.concat(e.ops.slice(1))),r},t.prototype.diff=function(e,r){if(this.ops===e.ops)return new t;var n=[this,e].map((function(t){return t.map((function(r){if(null!=r.insert)return\"string\"==typeof r.insert?r.insert:c;throw new Error(\"diff() called \"+(t===e?\"on\":\"with\")+\" non-document\")})).join(\"\")})),o=new t,l=i.default(n[0],n[1],r),f=u.default.iterator(this.ops),h=u.default.iterator(e.ops);return l.forEach((function(t){for(var e=t[1].length;e>0;){var r=0;switch(t[0]){case i.default.INSERT:r=Math.min(h.peekLength(),e),o.push(h.next(r));break;case i.default.DELETE:r=Math.min(e,f.peekLength()),f.next(r),o.delete(r);break;case i.default.EQUAL:r=Math.min(f.peekLength(),h.peekLength(),e);var n=f.next(r),u=h.next(r);a.default(n.insert,u.insert)?o.retain(r,s.default.diff(n.attributes,u.attributes)):o.push(u).delete(r)}e-=r}})),o.chop()},t.prototype.eachLine=function(e,r){void 0===r&&(r=\"\\n\");for(var n=u.default.iterator(this.ops),i=new t,o=0;n.hasNext();){if(\"insert\"!==n.peekType())return;var a=n.peek(),s=u.default.length(a)-n.peekLength(),c=\"string\"==typeof a.insert?a.insert.indexOf(r,s)-s:-1;if(c<0)i.push(n.next());else if(c>0)i.push(n.next(c));else{if(!1===e(i,n.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var r=new t;return this.reduce((function(t,n){if(n.insert)r.delete(u.default.length(n));else{if(n.retain&&null==n.attributes)return r.retain(n.retain),t+n.retain;if(n.delete||n.retain&&n.attributes){var i=n.delete||n.retain;return e.slice(t,t+i).forEach((function(t){n.delete?r.push(t):n.retain&&n.attributes&&r.retain(u.default.length(t),s.default.invert(n.attributes,t.attributes))})),t+i}}return t}),0),r.chop()},t.prototype.transform=function(e,r){if(void 0===r&&(r=!1),r=!!r,\"number\"==typeof e)return this.transformPosition(e,r);for(var n=e,i=u.default.iterator(this.ops),o=u.default.iterator(n.ops),a=new t;i.hasNext()||o.hasNext();)if(\"insert\"!==i.peekType()||!r&&\"insert\"===o.peekType())if(\"insert\"===o.peekType())a.push(o.next());else{var c=Math.min(i.peekLength(),o.peekLength()),l=i.next(c),f=o.next(c);if(l.delete)continue;f.delete?a.push(f):a.retain(c,s.default.transform(l.attributes,f.attributes,r))}else a.retain(u.default.length(i.next()));return a.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var r=u.default.iterator(this.ops),n=0;r.hasNext()&&n<=t;){var i=r.peekLength(),o=r.peekType();r.next(),\"delete\"!==o?(\"insert\"===o&&(n=n-r?(t=n-r,this.index+=1,this.offset=0):this.offset+=t,\"number\"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),\"number\"==typeof e.retain?o.retain=t:\"string\"==typeof e.insert?o.insert=e.insert.substr(r,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?\"number\"==typeof this.ops[this.index].delete?\"delete\":\"number\"==typeof this.ops[this.index].retain?\"retain\":\"insert\":\"retain\"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[r].concat(n)}return[]},t}();e.default=o},430:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i,o=n(r(977));!function(t){t.iterator=function(t){return new o.default(t)},t.length=function(t){return\"number\"==typeof t.delete?t.delete:\"number\"==typeof t.retain?t.retain:\"string\"==typeof t.insert?t.insert.length:1}}(i||(i={})),e.default=i},165:function(t,e,r){var n,i;void 0===(i=\"function\"==typeof(n=function(){var t,e={};function r(t,e,r){var n=t.getClientRects();if(2===n.length){var i=t.getBoundingClientRect();return n[e][r]=e.length)return Array.prototype.push.apply(t,e);for(;n1,t.getClientRects||(s.setEnd(o,1),t.getClientRects=t.getBoundingClientRect=2===s.getClientRects().length),!t.getBoundingClientRect){s.setEnd(s.startContainer,s.startOffset);var u=s.getBoundingClientRect();t.getBoundingClientRect=0===u.top&&0===u.left}if(document.body.removeChild(e),!t.getBoundingClientRect){var c=document.createElement(\"p\");c.style.width=\"0px\",c.style.fontSize=\"20px\",c.style.whiteSpace=\"normal\",c.style.wordBreak=\"normal\";var l=document.createTextNode(\"m mm\");c.appendChild(l),document.body.appendChild(c),s.setStart(l,1),s.setEnd(l,2),r(s,1,\"left\")?t.getBoundingClientRect=!0:(s.setStart(l,1),s.setEnd(l,3),r(s,0,\"top\")&&(t.getBoundingClientRect=!0)),document.body.removeChild(c)}var f=window.ActiveXObject&&new Function(\"/*@cc_on return @_jscript_version; @*/\")();t.ieZoom=!!f&&f<=10}return t},e.getClientRects=function(t){var e=this.isBroken();if(e.ieZoom)return n(t.getClientRects());if(!e.getClientRects)return t.getClientRects();var r=[],o=[],a=t.endContainer,s=t.endOffset,u=document.createRange();function c(t){for(var e=0;t=t.previousSibling;)e++;return e}for(;a!==t.commonAncestorContainer;)u.setStart(a,0),u.setEnd(a,s),i(o,u.getClientRects()),s=c(a),a=a.parentNode;return(u=t.cloneRange()).setEnd(a,s),i(r,u.getClientRects()),i(r,o),r},e.getBoundingClientRect=function(t){var e=this.getClientRects(t);if(0===e.length)return null;var r,i=t.getBoundingClientRect(),o=this.isBroken();if(o.ieZoom)return n(i);if(!o.getBoundingClientRect)return i;if(0===i.width&&0===i.height)return e[0];for(var a=0,s=e.length;a{\"use strict\";r.r(e),r.d(e,{default:()=>C});var n=function(){if(\"undefined\"!=typeof Map)return Map;function t(t,e){var r=-1;return t.some((function(t,n){return t[0]===e&&(r=n,!0)})),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,\"size\",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var r=t(this.__entries__,e),n=this.__entries__[r];return n&&n[1]},e.prototype.set=function(e,r){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=r:this.__entries__.push([e,r])},e.prototype.delete=function(e){var r=this.__entries__,n=t(r,e);~n&&r.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var r=0,n=this.__entries__;r0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener(\"transitionend\",this.onTransitionEnd_),window.addEventListener(\"resize\",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener(\"transitionend\",this.onTransitionEnd_),window.removeEventListener(\"resize\",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,r=void 0===e?\"\":e;s.some((function(t){return!!~r.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var r=0,n=Object.keys(e);r0},t}(),A=\"undefined\"!=typeof WeakMap?new WeakMap:new n,x=function t(e){if(!(this instanceof t))throw new TypeError(\"Cannot call a class as a function.\");if(!arguments.length)throw new TypeError(\"1 argument required, but only 0 present.\");var r=c.getInstance(),n=new m(e,r,this);A.set(this,n)};[\"observe\",\"unobserve\",\"disconnect\"].forEach((function(t){x.prototype[t]=function(){var e;return(e=A.get(this))[t].apply(e,arguments)}}));const C=void 0!==o.ResizeObserver?o.ResizeObserver:x},413:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{default:()=>v});var n=r(379),i=r.n(n),o=r(795),a=r.n(o),s=r(569),u=r.n(s),c=r(565),l=r.n(c),f=r(216),h=r.n(f),d=r(589),p=r.n(d),g=r(582),_={};_.styleTagTransform=p(),_.setAttributes=l(),_.insert=u().bind(null,\"head\"),_.domAPI=a(),_.insertStyleElement=h(),i()(g.Z,_);const v=g.Z&&g.Z.locals?g.Z.locals:void 0},379:t=>{\"use strict\";var e=[];function r(t){for(var r=-1,n=0;n{\"use strict\";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");n.appendChild(r)}},216:t=>{\"use strict\";t.exports=function(t){var e=document.createElement(\"style\");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,r)=>{\"use strict\";t.exports=function(t){var e=r.nc;e&&t.setAttribute(\"nonce\",e)}},795:t=>{\"use strict\";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n=\"\";r.supports&&(n+=\"@supports (\".concat(r.supports,\") {\")),r.media&&(n+=\"@media \".concat(r.media,\" {\"));var i=void 0!==r.layer;i&&(n+=\"@layer\".concat(r.layer.length>0?\" \".concat(r.layer):\"\",\" {\")),n+=r.css,i&&(n+=\"}\"),r.media&&(n+=\"}\"),r.supports&&(n+=\"}\");var o=r.sourceMap;o&&\"undefined\"!=typeof btoa&&(n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o)))),\" */\")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{\"use strict\";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},607:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.Cursor=e.default=void 0;var i=n(r(678));e.default=i.default;var o=n(r(353));e.Cursor=o.default,r(413)},353:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(207),i=function(){function t(t,e,r){this.id=t,this.name=e,this.color=r,this.toggleNearCursor=this.toggleNearCursor.bind(this),this._toggleOpenedCursor=this._toggleOpenedCursor.bind(this),this._setHoverState=this._setHoverState.bind(this)}return t.prototype.build=function(e){var r=document.createElement(t.CONTAINER_ELEMENT_TAG);r.classList.add(t.CURSOR_CLASS),r.id=\"ql-cursor-\".concat(this.id),r.innerHTML=e.template;var n=r.getElementsByClassName(t.SELECTION_CLASS)[0],i=r.getElementsByClassName(t.CARET_CONTAINER_CLASS)[0],o=i.getElementsByClassName(t.CARET_CLASS)[0],a=r.getElementsByClassName(t.FLAG_CLASS)[0];return a.style.backgroundColor=this.color,o.style.backgroundColor=this.color,r.getElementsByClassName(t.NAME_CLASS)[0].textContent=this.name,this._hideDelay=\"\".concat(e.hideDelayMs,\"ms\"),this._hideSpeedMs=e.hideSpeedMs,this._positionFlag=e.positionFlag,a.style.transitionDelay=this._hideDelay,a.style.transitionDuration=\"\".concat(this._hideSpeedMs,\"ms\"),this._el=r,this._selectionEl=n,this._caretEl=i,this._flagEl=a,i.addEventListener(\"mouseover\",this._setHoverState,{passive:!0}),this._el},t.prototype.show=function(){this._el.classList.remove(t.HIDDEN_CLASS)},t.prototype.hide=function(){this._el.classList.add(t.HIDDEN_CLASS)},t.prototype.remove=function(){this._el.parentNode.removeChild(this._el)},t.prototype.toggleNearCursor=function(e,r){var n=this._getCoordinates(),i=n.left,o=n.right,a=n.top,s=n.bottom,u=e>=i&&e<=o&&r>=a&&r<=s;return this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,u),u},t.prototype.toggleFlag=function(e){var r=this;this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,e)||(this._flagEl.classList.add(t.NO_DELAY_CLASS),setTimeout((function(){return r._flagEl.classList.remove(t.NO_DELAY_CLASS)}),this._hideSpeedMs))},t.prototype.updateCaret=function(t,e){this._caretEl.style.top=\"\".concat(t.top,\"px\"),this._caretEl.style.left=\"\".concat(t.left,\"px\"),this._caretEl.style.height=\"\".concat(t.height,\"px\"),this._positionFlag?this._positionFlag(this._flagEl,t,e):this._updateCaretFlag(t,e)},t.prototype.updateSelection=function(t,e){var r=this;this._clearSelection(),t=t||[],t=Array.from(t),t=this._sanitize(t),(t=this._sortByDomPosition(t)).forEach((function(t){return r._addSelection(t,e)}))},t.prototype._setHoverState=function(){document.addEventListener(\"mousemove\",this._toggleOpenedCursor,{passive:!0})},t.prototype._toggleOpenedCursor=function(e){var r=this.toggleNearCursor(e.clientX,e.clientY);this._caretEl.classList.toggle(t.CONTAINER_NO_POINTER_CLASS,r),r||document.removeEventListener(\"mousemove\",this._toggleOpenedCursor)},t.prototype._getCoordinates=function(){return this._caretEl.getBoundingClientRect()},t.prototype._updateCaretFlag=function(e,r){this._flagEl.style.width=\"\";var n=this._flagEl.getBoundingClientRect();this._flagEl.classList.remove(t.FLAG_FLIPPED_CLASS),e.left>r.width-n.width&&this._flagEl.classList.add(t.FLAG_FLIPPED_CLASS),this._flagEl.style.left=\"\".concat(e.left,\"px\"),this._flagEl.style.top=\"\".concat(e.top,\"px\"),this._flagEl.style.width=\"\".concat(Math.ceil(n.width),\"px\")},t.prototype._clearSelection=function(){this._selectionEl.innerHTML=\"\"},t.prototype._addSelection=function(t,e){var r=this._selectionBlock(t,e);this._selectionEl.appendChild(r)},t.prototype._selectionBlock=function(e,r){var i=document.createElement(t.SELECTION_ELEMENT_TAG);return i.classList.add(t.SELECTION_BLOCK_CLASS),i.style.top=\"\".concat(e.top-r.top,\"px\"),i.style.left=\"\".concat(e.left-r.left,\"px\"),i.style.width=\"\".concat(e.width,\"px\"),i.style.height=\"\".concat(e.height,\"px\"),i.style.backgroundColor=n(this.color).setAlpha(.3).toString(),i},t.prototype._sortByDomPosition=function(t){return t.sort((function(t,e){return t.top===e.top?t.left-e.left:t.top-e.top}))},t.prototype._sanitize=function(t){var e=this,r=new Set;return t.filter((function(t){if(!t.width||!t.height)return!1;var n=e._serialize(t);return!r.has(n)&&(r.add(n),!0)}))},t.prototype._serialize=function(t){return[\"top:\".concat(t.top),\"right:\".concat(t.right),\"bottom:\".concat(t.bottom),\"left:\".concat(t.left)].join(\";\")},t.CONTAINER_ELEMENT_TAG=\"SPAN\",t.SELECTION_ELEMENT_TAG=\"SPAN\",t.CURSOR_CLASS=\"ql-cursor\",t.SELECTION_CLASS=\"ql-cursor-selections\",t.SELECTION_BLOCK_CLASS=\"ql-cursor-selection-block\",t.CARET_CLASS=\"ql-cursor-caret\",t.CARET_CONTAINER_CLASS=\"ql-cursor-caret-container\",t.CONTAINER_HOVER_CLASS=\"hover\",t.CONTAINER_NO_POINTER_CLASS=\"no-pointer\",t.FLAG_CLASS=\"ql-cursor-flag\",t.FLAG_FLIPPED_CLASS=\"flag-flipped\",t.NAME_CLASS=\"ql-cursor-name\",t.HIDDEN_CLASS=\"hidden\",t.NO_DELAY_CLASS=\"no-delay\",t}();e.default=i},678:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)\"default\"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var s=a(r(353)),u=o(r(165)),c=a(r(338)),l=a(r(33)),f=r(895),h=function(){function t(t,e){void 0===e&&(e={}),this._cursors={},this._isObserving=!1,this._handleCursorTouch=this._handleCursorTouch.bind(this),this.quill=t,this.options=this._setDefaults(e),this._container=this.quill.addContainer(this.options.containerClass),this._boundsContainer=this.options.boundsContainer||this.quill.container,this._currentSelection=this.quill.getSelection(),this._registerSelectionChangeListeners(),this._registerTextChangeListener(),this._registerDomListeners()}return t.prototype.createCursor=function(t,e,r){var n=this._cursors[t];if(!n){n=new s.default(t,e,r),this._cursors[t]=n;var i=n.build(this.options);this._container.appendChild(i)}return n},t.prototype.moveCursor=function(t,e){var r=this._cursors[t];r&&(r.range=e,this._updateCursor(r))},t.prototype.removeCursor=function(t){var e=this._cursors[t];e&&(e.remove(),delete this._cursors[t])},t.prototype.update=function(){var t=this;this.cursors().forEach((function(e){return t._updateCursor(e)}))},t.prototype.clearCursors=function(){var t=this;this.cursors().forEach((function(e){return t.removeCursor(e.id)}))},t.prototype.toggleFlag=function(t,e){var r=this._cursors[t];r&&r.toggleFlag(e)},t.prototype.cursors=function(){var t=this;return Object.keys(this._cursors).map((function(e){return t._cursors[e]}))},t.prototype._registerSelectionChangeListeners=function(){var t=this;this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,(function(e){t._currentSelection=e}))},t.prototype._registerTextChangeListener=function(){var t=this;this.quill.on(this.quill.constructor.events.TEXT_CHANGE,(function(e){return t._handleTextChange(e)}))},t.prototype._registerDomListeners=function(){var t=this,e=this.quill.container.getElementsByClassName(\"ql-editor\")[0];e.addEventListener(\"scroll\",(function(){return t.update()}),{passive:!0}),e.addEventListener(\"touchstart\",this._handleCursorTouch,{passive:!0})},t.prototype._handleCursorTouch=function(t){var e=this;this.cursors().forEach((function(r){r.toggleNearCursor(t.pageX,t.pageY),setTimeout((function(){return r.toggleFlag(!1)}),e.options.hideDelayMs)}))},t.prototype._registerResizeObserver=function(){var t=this;if(!this._isObserving){var e=this.quill.container.getElementsByClassName(\"ql-editor\")[0],r=new l.default((function(e){if(!e[0].target.isConnected)return r.disconnect(),void(t._isObserving=!1);t.update()}));r.observe(e),this._isObserving=!0}},t.prototype._updateCursor=function(t){if(this._registerResizeObserver(),!t.range)return t.hide();var e=this._indexWithinQuillBounds(t.range.index),r=this._indexWithinQuillBounds(t.range.index+t.range.length),n=this.quill.getLeaf(e),i=this.quill.getLeaf(r);if(!this._leafIsValid(n)||!this._leafIsValid(i))return t.hide();t.show();var o=this._boundsContainer.getBoundingClientRect(),a=this.quill.getBounds(r);t.updateCaret(a,o);var s=this._lineRanges(t,n,i).reduce((function(t,e){return t.concat(Array.from(u.getClientRects(e)))}),[]);t.updateSelection(s,o)},t.prototype._indexWithinQuillBounds=function(t){var e=this.quill.getLength(),r=e?e-1:0;return t=Math.max(t,0),Math.min(t,r)},t.prototype._leafIsValid=function(t){return t&&t[0]&&t[0].domNode&&t[1]>=0},t.prototype._handleTextChange=function(t){var e=this;window.setTimeout((function(){e.options.transformOnTextChange&&e._transformCursors(t),e.options.selectionChangeSource&&(e._emitSelection(),e.update())}))},t.prototype._emitSelection=function(){this.quill.emitter.emit(this.quill.constructor.events.SELECTION_CHANGE,this.quill.getSelection(),this._currentSelection,this.options.selectionChangeSource)},t.prototype._setDefaults=function(e){return(e=Object.assign({},e)).template||(e.template=t.DEFAULTS.template),e.containerClass||(e.containerClass=t.DEFAULTS.containerClass),null!==e.selectionChangeSource&&(e.selectionChangeSource||(e.selectionChangeSource=t.DEFAULTS.selectionChangeSource)),e.hideDelayMs=Number.isInteger(e.hideDelayMs)?e.hideDelayMs:t.DEFAULTS.hideDelayMs,e.hideSpeedMs=Number.isInteger(e.hideSpeedMs)?e.hideSpeedMs:t.DEFAULTS.hideSpeedMs,e.transformOnTextChange=!!e.transformOnTextChange,e},t.prototype._lineRanges=function(t,e,r){var n=this.quill.getLines(t.range);return n.reduce((function(t,i,o){if(!i.children){var a=document.createRange();return a.selectNode(i.domNode),t.concat(a)}var s=0===o?e:i.path(0).pop(),u=s[0],c=s[1],l=o===n.length-1?r:i.path(i.length()-1).pop(),f=l[0],h=l[1],d=document.createRange();return u.domNode.nodeType===Node.TEXT_NODE?d.setStart(u.domNode,c):d.setStartBefore(u.domNode),f.domNode.nodeType===Node.TEXT_NODE?d.setEnd(f.domNode,h):d.setEndAfter(f.domNode),t.concat(d)}),[])},t.prototype._transformCursors=function(t){var e=this;t=new f(t),this.cursors().filter((function(t){return t.range})).forEach((function(r){r.range.index=t.transformPosition(r.range.index),e._updateCursor(r)}))},t.DEFAULTS={template:c.default,containerClass:\"ql-cursors\",selectionChangeSource:\"api\",hideDelayMs:3e3,hideSpeedMs:400},t}();e.default=h},338:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(r(353)),o='\\n \\n \\n \\n \\n
    \\n \\n
    \\n');e.default=o},207:function(t){t.exports=function(){\"use strict\";const t=/^\\s+/,e=/\\s+$/;function r(n,i){if(i=i||{},(n=n||\"\")instanceof r)return n;if(!(this instanceof r))return new r(n,i);var o=function(r){var n={r:0,g:0,b:0},i=1,o=null,a=null,s=null,u=!1,c=!1;return\"string\"==typeof r&&(r=function(r){r=r.replace(t,\"\").replace(e,\"\").toLowerCase();var n,i=!1;if(y[r])r=y[r],i=!0;else if(\"transparent\"==r)return{r:0,g:0,b:0,a:0,format:\"name\"};return(n=T.rgb.exec(r))?{r:n[1],g:n[2],b:n[3]}:(n=T.rgba.exec(r))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=T.hsl.exec(r))?{h:n[1],s:n[2],l:n[3]}:(n=T.hsla.exec(r))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=T.hsv.exec(r))?{h:n[1],s:n[2],v:n[3]}:(n=T.hsva.exec(r))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=T.hex8.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),a:O(n[4]),format:i?\"name\":\"hex8\"}:(n=T.hex6.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),format:i?\"name\":\"hex\"}:(n=T.hex4.exec(r))?{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),a:O(n[4]+\"\"+n[4]),format:i?\"name\":\"hex8\"}:!!(n=T.hex3.exec(r))&&{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),format:i?\"name\":\"hex\"}}(r)),\"object\"==typeof r&&(R(r.r)&&R(r.g)&&R(r.b)?(l=r.r,f=r.g,h=r.b,n={r:255*x(l,255),g:255*x(f,255),b:255*x(h,255)},u=!0,c=\"%\"===String(r.r).substr(-1)?\"prgb\":\"rgb\"):R(r.h)&&R(r.s)&&R(r.v)?(o=S(r.s),a=S(r.v),n=function(t,e,r){t=6*x(t,360),e=x(e,100),r=x(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(r.h,o,a),u=!0,c=\"hsv\"):R(r.h)&&R(r.s)&&R(r.l)&&(o=S(r.s),s=S(r.l),n=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=x(t,360),e=x(e,100),r=x(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(r.h,o,s),u=!0,c=\"hsl\"),r.hasOwnProperty(\"a\")&&(i=r.a)),i=A(i),{ok:u,format:r.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:i};var l,f,h}(n);this._originalInput=n,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||o.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function n(t,e,r){t=x(t,255),e=x(e,255),r=x(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)i.h=(i.h+o)%360,a.push(r(i));return a}function b(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,o=n.s,a=n.v,s=[],u=1/e;e--;)s.push(r({h:i,s:o,v:a})),a=(a+u)%1;return s}r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=A(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?\"hsv(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsva(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),i=Math.round(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+i+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+i+\"%, \"+this._roundA+\")\"},toHex:function(t){return o(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[E(Math.round(t).toString(16)),E(Math.round(e).toString(16)),E(Math.round(r).toString(16)),E(M(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(\"\")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return\"#\"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\")\":\"rgba(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\", \"+this._roundA+\")\"},toPercentageRgb:function(){return{r:Math.round(100*x(this._r,255))+\"%\",g:Math.round(100*x(this._g,255))+\"%\",b:Math.round(100*x(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%)\":\"rgba(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":!(this._a<1)&&(m[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e=\"#\"+a(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?\"GradientType = 1, \":\"\";if(t){var o=r(t);n=\"#\"+a(o._r,o._g,o._b,o._a)}return\"progid:DXImageTransform.Microsoft.gradient(\"+i+\"startColorstr=\"+e+\",endColorstr=\"+n+\")\"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||\"hex\"!==t&&\"hex6\"!==t&&\"hex3\"!==t&&\"hex4\"!==t&&\"hex8\"!==t&&\"name\"!==t?(\"rgb\"===t&&(r=this.toRgbString()),\"prgb\"===t&&(r=this.toPercentageRgbString()),\"hex\"!==t&&\"hex6\"!==t||(r=this.toHexString()),\"hex3\"===t&&(r=this.toHexString(!0)),\"hex4\"===t&&(r=this.toHex8String(!0)),\"hex8\"===t&&(r=this.toHex8String()),\"name\"===t&&(r=this.toName()),\"hsl\"===t&&(r=this.toHslString()),\"hsv\"===t&&(r=this.toHsvString()),r||this.toHexString()):\"name\"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},r.fromRatio=function(t,e){if(\"object\"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=\"a\"===i?t[i]:S(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),o=r(e).toRgb(),a=n/100;return r({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},r.readability=function(t,e){var n=r(t),i=r(e);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,o,a,s,u,c=r.readability(t,e);switch(o=!1,(a=n,\"AA\"!==(s=((a=a||{level:\"AA\",size:\"small\"}).level||\"AA\").toUpperCase())&&\"AAA\"!==s&&(s=\"AA\"),\"small\"!==(u=(a.size||\"small\").toLowerCase())&&\"large\"!==u&&(u=\"small\"),i={level:s,size:u}).level+i.size){case\"AAsmall\":case\"AAAlarge\":o=c>=4.5;break;case\"AAlarge\":o=c>=3;break;case\"AAAsmall\":o=c>=7}return o},r.mostReadable=function(t,e,n){var i,o,a,s,u=null,c=0;o=(n=n||{}).includeFallbackColors,a=n.level,s=n.size;for(var l=0;lc&&(c=i,u=r(e[l]));return r.isReadable(t,u,{level:a,size:s})||!o?u:(n.includeFallbackColors=!1,r.mostReadable(t,[\"#fff\",\"#000\"],n))};var y=r.names={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"0ff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000\",blanchedalmond:\"ffebcd\",blue:\"00f\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",burntsienna:\"ea7e5d\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"0ff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkgrey:\"a9a9a9\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkslategrey:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dimgrey:\"696969\",dodgerblue:\"1e90ff\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"f0f\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",grey:\"808080\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgray:\"d3d3d3\",lightgreen:\"90ee90\",lightgrey:\"d3d3d3\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslategray:\"789\",lightslategrey:\"789\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"0f0\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"f0f\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370db\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"db7093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",rebeccapurple:\"663399\",red:\"f00\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",slategrey:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",wheat:\"f5deb3\",white:\"fff\",whitesmoke:\"f5f5f5\",yellow:\"ff0\",yellowgreen:\"9acd32\"},m=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(y);function A(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function x(t,e){(function(t){return\"string\"==typeof t&&-1!=t.indexOf(\".\")&&1===parseFloat(t)})(t)&&(t=\"100%\");var r=function(t){return\"string\"==typeof t&&-1!=t.indexOf(\"%\")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function C(t){return Math.min(1,Math.max(0,t))}function w(t){return parseInt(t,16)}function E(t){return 1==t.length?\"0\"+t:\"\"+t}function S(t){return t<=1&&(t=100*t+\"%\"),t}function M(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return w(t)/255}var j,L,k,T=(L=\"[\\\\s|\\\\(]+(\"+(j=\"(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)\")+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",k=\"[\\\\s|\\\\(]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",{CSS_UNIT:new RegExp(j),rgb:new RegExp(\"rgb\"+L),rgba:new RegExp(\"rgba\"+k),hsl:new RegExp(\"hsl\"+L),hsla:new RegExp(\"hsla\"+k),hsv:new RegExp(\"hsv\"+L),hsva:new RegExp(\"hsva\"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(t){return!!T.CSS_UNIT.exec(t)}return r}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.nc=void 0;var n=r(607);return n.default})()));", "/* eslint-env browser */\n\n/**\n * Tiny websocket connection handler.\n *\n * Implements exponential backoff reconnects, ping/pong, and a nice event system using [lib0/observable].\n *\n * @module websocket\n */\n\nimport { Observable } from './observable.js'\nimport * as time from './time.js'\nimport * as math from './math.js'\n\nconst reconnectTimeoutBase = 1200\nconst maxReconnectTimeout = 2500\n// @todo - this should depend on awareness.outdatedTime\nconst messageReconnectTimeout = 30000\n\n/**\n * @param {WebsocketClient} wsclient\n */\nconst setupWS = (wsclient) => {\n if (wsclient.shouldConnect && wsclient.ws === null) {\n const websocket = new WebSocket(wsclient.url)\n const binaryType = wsclient.binaryType\n /**\n * @type {any}\n */\n let pingTimeout = null\n if (binaryType) {\n websocket.binaryType = binaryType\n }\n wsclient.ws = websocket\n wsclient.connecting = true\n wsclient.connected = false\n websocket.onmessage = event => {\n wsclient.lastMessageReceived = time.getUnixTime()\n const data = event.data\n const message = typeof data === 'string' ? JSON.parse(data) : data\n if (message && message.type === 'pong') {\n clearTimeout(pingTimeout)\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n wsclient.emit('message', [message, wsclient])\n }\n /**\n * @param {any} error\n */\n const onclose = error => {\n if (wsclient.ws !== null) {\n wsclient.ws = null\n wsclient.connecting = false\n if (wsclient.connected) {\n wsclient.connected = false\n wsclient.emit('disconnect', [{ type: 'disconnect', error }, wsclient])\n } else {\n wsclient.unsuccessfulReconnects++\n }\n // Start with no reconnect timeout and increase timeout by\n // log10(wsUnsuccessfulReconnects).\n // The idea is to increase reconnect timeout slowly and have no reconnect\n // timeout at the beginning (log(1) = 0)\n setTimeout(setupWS, math.min(math.log10(wsclient.unsuccessfulReconnects + 1) * reconnectTimeoutBase, maxReconnectTimeout), wsclient)\n }\n clearTimeout(pingTimeout)\n }\n const sendPing = () => {\n if (wsclient.ws === websocket) {\n wsclient.send({\n type: 'ping'\n })\n }\n }\n websocket.onclose = () => onclose(null)\n websocket.onerror = error => onclose(error)\n websocket.onopen = () => {\n wsclient.lastMessageReceived = time.getUnixTime()\n wsclient.connecting = false\n wsclient.connected = true\n wsclient.unsuccessfulReconnects = 0\n wsclient.emit('connect', [{ type: 'connect' }, wsclient])\n // set ping\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n }\n}\n\n/**\n * @deprecated\n * @extends Observable\n */\nexport class WebsocketClient extends Observable {\n /**\n * @param {string} url\n * @param {object} opts\n * @param {'arraybuffer' | 'blob' | null} [opts.binaryType] Set `ws.binaryType`\n */\n constructor (url, { binaryType } = {}) {\n super()\n this.url = url\n /**\n * @type {WebSocket?}\n */\n this.ws = null\n this.binaryType = binaryType || null\n this.connected = false\n this.connecting = false\n this.unsuccessfulReconnects = 0\n this.lastMessageReceived = 0\n /**\n * Whether to connect to other peers or not\n * @type {boolean}\n */\n this.shouldConnect = true\n this._checkInterval = setInterval(() => {\n if (this.connected && messageReconnectTimeout < time.getUnixTime() - this.lastMessageReceived) {\n // no message received in a long time - not even your own awareness\n // updates (which are updated every 15 seconds)\n /** @type {WebSocket} */ (this.ws).close()\n }\n }, messageReconnectTimeout / 2)\n setupWS(this)\n }\n\n /**\n * @param {any} message\n */\n send (message) {\n if (this.ws) {\n this.ws.send(JSON.stringify(message))\n }\n }\n\n destroy () {\n clearInterval(this._checkInterval)\n this.disconnect()\n super.destroy()\n }\n\n disconnect () {\n this.shouldConnect = false\n if (this.ws !== null) {\n this.ws.close()\n }\n }\n\n connect () {\n this.shouldConnect = true\n if (!this.connected && this.ws === null) {\n setupWS(this)\n }\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers for cross-tab communication using broadcastchannel with LocalStorage fallback.\n *\n * ```js\n * // In browser window A:\n * broadcastchannel.subscribe('my events', data => console.log(data))\n * broadcastchannel.publish('my events', 'Hello world!') // => A: 'Hello world!' fires synchronously in same tab\n *\n * // In browser window B:\n * broadcastchannel.publish('my events', 'hello from tab B') // => A: 'hello from tab B'\n * ```\n *\n * @module broadcastchannel\n */\n\n// @todo before next major: use Uint8Array instead as buffer object\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as buffer from './buffer.js'\nimport * as storage from './storage.js'\n\n/**\n * @typedef {Object} Channel\n * @property {Set} Channel.subs\n * @property {any} Channel.bc\n */\n\n/**\n * @type {Map}\n */\nconst channels = new Map()\n\n/* c8 ignore start */\nclass LocalStoragePolyfill {\n /**\n * @param {string} room\n */\n constructor (room) {\n this.room = room\n /**\n * @type {null|function({data:ArrayBuffer}):void}\n */\n this.onmessage = null\n /**\n * @param {any} e\n */\n this._onChange = e => e.key === room && this.onmessage !== null && this.onmessage({ data: buffer.fromBase64(e.newValue || '') })\n storage.onChange(this._onChange)\n }\n\n /**\n * @param {ArrayBuffer} buf\n */\n postMessage (buf) {\n storage.varStorage.setItem(this.room, buffer.toBase64(buffer.createUint8ArrayFromArrayBuffer(buf)))\n }\n\n close () {\n storage.offChange(this._onChange)\n }\n}\n/* c8 ignore stop */\n\n// Use BroadcastChannel or Polyfill\n/* c8 ignore next */\nconst BC = typeof BroadcastChannel === 'undefined' ? LocalStoragePolyfill : BroadcastChannel\n\n/**\n * @param {string} room\n * @return {Channel}\n */\nconst getChannel = room =>\n map.setIfUndefined(channels, room, () => {\n const subs = set.create()\n const bc = new BC(room)\n /**\n * @param {{data:ArrayBuffer}} e\n */\n /* c8 ignore next */\n bc.onmessage = e => subs.forEach(sub => sub(e.data, 'broadcastchannel'))\n return {\n bc, subs\n }\n })\n\n/**\n * Subscribe to global `publish` events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const subscribe = (room, f) => {\n getChannel(room).subs.add(f)\n return f\n}\n\n/**\n * Unsubscribe from `publish` global events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const unsubscribe = (room, f) => {\n const channel = getChannel(room)\n const unsubscribed = channel.subs.delete(f)\n if (unsubscribed && channel.subs.size === 0) {\n channel.bc.close()\n channels.delete(room)\n }\n return unsubscribed\n}\n\n/**\n * Publish data to all subscribers (including subscribers on this tab)\n *\n * @function\n * @param {string} room\n * @param {any} data\n * @param {any} [origin]\n */\nexport const publish = (room, data, origin = null) => {\n const c = getChannel(room)\n c.bc.postMessage(data)\n c.subs.forEach(sub => sub(data, origin))\n}\n", "/**\n * Mutual exclude for JavaScript.\n *\n * @module mutex\n */\n\n/**\n * @callback mutex\n * @param {function():void} cb Only executed when this mutex is not in the current stack\n * @param {function():void} [elseCb] Executed when this mutex is in the current stack\n */\n\n/**\n * Creates a mutual exclude function with the following property:\n *\n * ```js\n * const mutex = createMutex()\n * mutex(() => {\n * // This function is immediately executed\n * mutex(() => {\n * // This function is not executed, as the mutex is already active.\n * })\n * })\n * ```\n *\n * @return {mutex} A mutual exclude function\n * @public\n */\nexport const createMutex = () => {\n let token = true\n return (f, g) => {\n if (token) {\n token = false\n try {\n f()\n } finally {\n token = true\n }\n } else if (g !== undefined) {\n g()\n }\n }\n}\n", "(function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var t;t=\"undefined\"==typeof window?\"undefined\"==typeof global?\"undefined\"==typeof self?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(s,e,n){function t(o,i){if(!e[o]){if(!s[o]){var l=\"function\"==typeof require&&require;if(!i&&l)return l(o,!0);if(r)return r(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var a=e[o]={exports:{}};s[o][0].call(a.exports,function(e){var r=s[o][1][e];return t(r||e)},a,a.exports,d,s,e,n)}return e[o].exports}for(var r=\"function\"==typeof require&&require,a=0;a>16,l[c++]=255&t>>8,l[c++]=255&t;return 2===s&&(t=u[e.charCodeAt(n)]<<2|u[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===s&&(t=u[e.charCodeAt(n)]<<10|u[e.charCodeAt(n+1)]<<4|u[e.charCodeAt(n+2)]>>2,l[c++]=255&t>>8,l[c++]=255&t),l}function d(e){return c[63&e>>18]+c[63&e>>12]+c[63&e>>6]+c[63&e]}function s(e,t,n){for(var r,a=[],o=t;ol?l:d+o));return 1===r?(t=e[n-1],a.push(c[t>>2]+c[63&t<<4]+\"==\")):2===r&&(t=(e[n-2]<<8)+e[n-1],a.push(c[t>>10]+c[63&t>>4]+c[63&t<<2]+\"=\")),a.join(\"\")}n.byteLength=function(e){var t=r(e),n=t[0],a=t[1];return 3*(n+a)/4-a},n.toByteArray=o,n.fromByteArray=l;for(var c=[],u=[],p=\"undefined\"==typeof Uint8Array?Array:Uint8Array,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",g=0,_=f.length;g<_;++g)c[g]=f[g],u[f.charCodeAt(g)]=g;u[45]=62,u[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){(function(){(function(){/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */'use strict';var t=String.fromCharCode,o=Math.min;function d(e){if(2147483647e)throw new RangeError(\"The value \\\"\"+e+\"\\\" is invalid for option \\\"size\\\"\")}function u(e,t,n){return c(e),0>=e?d(e):void 0===t?d(e):\"string\"==typeof n?d(e).fill(t,n):d(e).fill(t)}function p(e){return c(e),d(0>e?0:0|m(e))}function f(e,t){if((\"string\"!=typeof t||\"\"===t)&&(t=\"utf8\"),!s.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);var n=0|b(e,t),r=d(n),a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function g(e){for(var t=0>e.length?0:0|m(e.length),n=d(t),r=0;rt||e.byteLength=2147483647)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+2147483647 .toString(16)+\" bytes\");return 0|e}function b(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. Received type \"+typeof e);var n=e.length,r=2>>1;case\"base64\":return z(e).length;default:if(a)return r?-1:H(e).length;t=(\"\"+t).toLowerCase(),a=!0;}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return\"\";if(n>>>=0,t>>>=0,n<=t)return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return P(this,t,n);case\"utf8\":case\"utf-8\":return x(this,t,n);case\"ascii\":return D(this,t,n);case\"latin1\":case\"binary\":return I(this,t,n);case\"base64\":return A(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return M(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0;}}function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function R(e,t,n,r,a){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):2147483647n&&(n=-2147483648),n=+n,X(n)&&(n=a?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(0>n)if(a)n=0;else return-1;if(\"string\"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,a);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,a);throw new TypeError(\"val must be string, number or Buffer\")}function E(e,t,n,r,a){function o(e,t){return 1===d?e[t]:e.readUInt16BE(t*d)}var d=1,s=e.length,l=t.length;if(void 0!==r&&(r=(r+\"\").toLowerCase(),\"ucs2\"===r||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(2>e.length||2>t.length)return-1;d=2,s/=2,l/=2,n/=2}var c;if(a){var u=-1;for(c=n;cs&&(n=s-l),c=n;0<=c;c--){for(var p=!0,f=0;fa&&(r=a)):r=a;var o=t.length;r>o/2&&(r=o/2);for(var d,s=0;sd&&(s=d):2===l?(c=e[a+1],128==(192&c)&&(f=(31&d)<<6|63&c,127f||57343f&&(s=f))):void 0}null===s?(s=65533,l=1):65535>>10),s=56320|1023&s),r.push(s),a+=l}return N(r)}function N(e){var n=e.length;if(n<=4096)return t.apply(String,e);for(var r=\"\",a=0;at)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var a=\"\",o=t;oe)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function F(e,t,n,r,a,o){if(!s.isBuffer(e))throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");if(t>a||te.length)throw new RangeError(\"Index out of range\")}function B(e,t,n,r){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(0>n)throw new RangeError(\"Index out of range\")}function U(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,4,34028234663852886e22,-34028234663852886e22),J.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,8,17976931348623157e292,-17976931348623157e292),J.write(e,t,n,r,52,8),n+8}function q(e){if(e=e.split(\"=\")[0],e=e.trim().replace(Q,\"\"),2>e.length)return\"\";for(;0!=e.length%4;)e+=\"=\";return e}function W(e){return 16>e?\"0\"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,r=e.length,a=null,o=[],d=0;dn){if(!a){if(56319n){-1<(t-=3)&&o.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&-1<(t-=3)&&o.push(239,191,189);if(a=null,128>n){if(0>(t-=1))break;o.push(n)}else if(2048>n){if(0>(t-=2))break;o.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;o.push(224|n>>12,128|63&n>>6,128|63&n)}else if(1114112>n){if(0>(t-=4))break;o.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}else throw new Error(\"Invalid code point\")}return o}function Y(e){for(var t=[],n=0;n(t-=2));++d)n=e.charCodeAt(d),r=n>>8,a=n%256,o.push(a),o.push(r);return o}function z(e){return $.toByteArray(q(e))}function G(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}var $=e(\"base64-js\"),J=e(\"ieee754\");n.Buffer=s,n.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},n.INSPECT_MAX_BYTES=50;n.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(s.prototype,\"parent\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,\"offset\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),\"undefined\"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,n){return u(e,t,n)},s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");if(e===t)return 0;for(var n=e.length,r=t.length,d=0,l=o(n,r);dt&&(e+=\" ... \"),\"\"},s.prototype.compare=function(e,t,n,r,a){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. Received type \"+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),0>t||n>e.length||0>r||a>this.length)throw new RangeError(\"out of range index\");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var d=a-r,l=n-t,c=o(d,l),u=this.slice(r,a),p=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0);else throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");var a=this.length-t;if((void 0===n||n>a)&&(n=a),0n||0>t)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");for(var o=!1;;)switch(r){case\"hex\":return w(this,e,t,n);case\"utf8\":case\"utf-8\":return S(this,e,t,n);case\"ascii\":return T(this,e,t,n);case\"latin1\":case\"binary\":return v(this,e,t,n);case\"base64\":return k(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return L(this,e,t,n);default:if(o)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),o=!0;}},s.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],a=1,o=0;++o>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],a=1;0>>=0,t||O(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=this[e],o=1,d=0;++d=o&&(a-=r(2,8*t)),a},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=t,o=1,d=this[e+--a];0=o&&(d-=r(2,8*t)),d},s.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t>>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=n-1,s=1;for(this[t+d]=255&e;0<=--d&&(s*=256);)this[t+d]=255&e/s;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=0,s=1,l=0;for(this[t]=255&e;++de&&0===l&&0!==this[t+d-1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=n-1,s=1,l=0;for(this[t+d]=255&e;0<=--d&&(s*=256);)0>e&&0===l&&0!==this[t+d+1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0t)throw new RangeError(\"targetStart out of bounds\");if(0>n||n>=this.length)throw new RangeError(\"Index out of range\");if(0>r)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-ta||\"latin1\"===r)&&(e=a)}}else\"number\"==typeof e&&(e&=255);if(0>t||this.length>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(\"number\"==typeof e)for(o=t;o{\"%%\"===e||(r++,\"%c\"===e&&(a=r))}),e.splice(a,0,n)},n.save=function(e){try{e?n.storage.setItem(\"debug\",e):n.storage.removeItem(\"debug\")}catch(e){}},n.load=r,n.useColors=function(){return!!(\"undefined\"!=typeof window&&window.process&&(\"renderer\"===window.process.type||window.process.__nwjs))||!(\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&31<=parseInt(RegExp.$1,10)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),n.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],n.log=console.debug||console.log||(()=>{}),t.exports=e(\"./common\")(n);const{formatters:o}=t.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}}).call(this)}).call(this,e(\"_process\"))},{\"./common\":5,_process:12}],5:[function(e,t){t.exports=function(t){function r(e){function t(...e){if(!t.enabled)return;const a=t,o=+new Date,i=o-(n||o);a.diff=i,a.prev=n,a.curr=o,n=o,e[0]=r.coerce(e[0]),\"string\"!=typeof e[0]&&e.unshift(\"%O\");let d=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if(\"%%\"===t)return\"%\";d++;const o=r.formatters[n];if(\"function\"==typeof o){const n=e[d];t=o.call(a,n),e.splice(d,1),d--}return t}),r.formatArgs.call(a,e);const s=a.log||r.log;s.apply(a,e)}let n,o=null;return t.namespace=e,t.useColors=r.useColors(),t.color=r.selectColor(e),t.extend=a,t.destroy=r.destroy,Object.defineProperty(t,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null===o?r.enabled(e):o,set:e=>{o=e}}),\"function\"==typeof r.init&&r.init(t),t}function a(e,t){const n=r(this.namespace+(\"undefined\"==typeof t?\":\":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>\"-\"+e)].join(\",\");return r.enable(\"\"),e},r.enable=function(e){r.save(e),r.names=[],r.skips=[];let t;const n=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),a=n.length;for(t=0;t{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let n=0;nd&&!l.warned){l.warned=!0;var c=new Error(\"Possible EventEmitter memory leak detected. \"+l.length+\" \"+(t+\" listeners added. Use emitter.setMaxListeners() to increase limit\"));c.name=\"MaxListenersExceededWarning\",c.emitter=e,c.type=t,c.count=l.length,n(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=d.bind(r);return a.listener=n,r.wrapFn=a,a}function l(e,t,n){var r=e._events;if(r===void 0)return[];var a=r[t];return void 0===a?[]:\"function\"==typeof a?n?[a.listener||a]:[a]:n?f(a):u(a,a.length)}function c(e){var t=this._events;if(t!==void 0){var n=t[e];if(\"function\"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function u(e,t){for(var n=Array(t),r=0;re||y(e))throw new RangeError(\"The value of \\\"defaultMaxListeners\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");C=e}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||0>e||y(e))throw new RangeError(\"The value of \\\"n\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){for(var t=[],n=1;no)return this;0===o?n.shift():p(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit(\"removeListener\",e,s||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,o=Object.keys(n);for(r=0;r */o.read=function(t,n,a,o,l){var c,u,p=8*l-o-1,f=(1<>1,_=-7,h=a?l-1:0,b=a?-1:1,d=t[n+h];for(h+=b,c=d&(1<<-_)-1,d>>=-_,_+=p;0<_;c=256*c+t[n+h],h+=b,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=o;0<_;u=256*u+t[n+h],h+=b,_-=8);if(0===c)c=1-g;else{if(c===f)return u?NaN:(d?-1:1)*(1/0);u+=r(2,o),c-=g}return(d?-1:1)*u*r(2,c-o)},o.write=function(a,o,l,u,p,f){var h,b,y,g=Math.LN2,_=Math.log,C=8*f-p-1,R=(1<>1,w=23===p?r(2,-24)-r(2,-77):0,S=u?0:f-1,T=u?1:-1,d=0>o||0===o&&0>1/o?1:0;for(o=n(o),isNaN(o)||o===1/0?(b=isNaN(o)?1:0,h=R):(h=t(_(o)/g),1>o*(y=r(2,-h))&&(h--,y*=2),o+=1<=h+E?w/y:w*r(2,1-E),2<=o*y&&(h++,y/=2),h+E>=R?(b=0,h=R):1<=h+E?(b=(o*y-1)*r(2,p),h+=E):(b=o*r(2,E-1)*r(2,p),h=0));8<=p;a[l+S]=255&b,S+=T,b/=256,p-=8);for(h=h<=1.5*a?\"s\":\"\")}var l=24*(60*60000);t.exports=function(e,t){t=t||{};var n=typeof e;if(\"string\"==n&&0 */let n;t.exports=\"function\"==typeof queueMicrotask?queueMicrotask.bind(\"undefined\"==typeof window?e:window):e=>(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this)}).call(this,\"undefined\"==typeof global?\"undefined\"==typeof self?\"undefined\"==typeof window?{}:window:self:global)},{}],14:[function(e,t){(function(n,r){(function(){'use strict';var a=e(\"safe-buffer\").Buffer,o=r.crypto||r.msCrypto;t.exports=o&&o.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError(\"requested too many random bytes\");var r=a.allocUnsafe(e);if(0n?0:+n,t.length)===t}function i(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function d(e,t,n){return\"number\"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}var s={};r(\"ERR_INVALID_OPT_VALUE\",function(e,t){return\"The value \\\"\"+t+\"\\\" is invalid for option \\\"\"+e+\"\\\"\"},TypeError),r(\"ERR_INVALID_ARG_TYPE\",function(e,t,n){var r;\"string\"==typeof t&&o(t,\"not \")?(r=\"must not be\",t=t.replace(/^not /,\"\")):r=\"must be\";var s;if(i(e,\" argument\"))s=\"The \".concat(e,\" \").concat(r,\" \").concat(a(t,\"type\"));else{var l=d(e,\".\")?\"property\":\"argument\";s=\"The \\\"\".concat(e,\"\\\" \").concat(l,\" \").concat(r,\" \").concat(a(t,\"type\"))}return s+=\". Received type \".concat(typeof n),s},TypeError),r(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),r(\"ERR_METHOD_NOT_IMPLEMENTED\",function(e){return\"The \"+e+\" method is not implemented\"}),r(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),r(\"ERR_STREAM_DESTROYED\",function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"}),r(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),r(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),r(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),r(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),r(\"ERR_UNKNOWN_ENCODING\",function(e){return\"Unknown encoding: \"+e},TypeError),r(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=s},{}],16:[function(e,t){(function(n){(function(){'use strict';function r(e){return this instanceof r?void(d.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",a)))):new r(e)}function a(){this._writableState.ended||n.nextTick(o,this)}function o(e){e.end()}var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var d=e(\"./_stream_readable\"),s=e(\"./_stream_writable\");e(\"inherits\")(r,d);for(var l,c=i(s.prototype),u=0;u>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function g(e,t){if(x(\"onEofChunk\"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?_(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,h(e)))}}function _(e){var t=e._readableState;x(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x(\"emitReadable\",t.flowing),t.emittedReadable=!0,n.nextTick(h,e))}function h(e){var t=e._readableState;x(\"emitReadable_\",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,S(e)}function m(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(b,e,t))}function b(e,t){for(;!t.reading&&!t.ended&&(t.length=t.length?(n=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function v(e){var t=e._readableState;x(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){if(x(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark)||t.ended))return x(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?v(this):_(this),null;if(e=f(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var a=t.needReadable;x(\"need readable\",a),(0===t.length||t.length-e>>0),n=this.head,r=0;n;)s(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:\"consume\",value:function(e,t){var n;return eo.length?o.length:e;if(a+=i===o.length?o:o.slice(0,e),e-=i,0===e){i===o.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,a}},{key:\"_getBuffer\",value:function(e){var t=u.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),e-=i,0===e){i===o.length?(++a,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=o.slice(i));break}++a}return this.length-=a,t}},{key:g,value:function(e,t){return f(this,r({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:3,util:2}],23:[function(e,t){(function(e){(function(){'use strict';function n(e,t){a(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function a(e,t){e.emit(\"error\",t)}t.exports={destroy:function(t,o){var i=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(t):t&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(a,this,t)):e.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!o&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(r,i):(i._writableState.errorEmitted=!0,e.nextTick(n,i,t)):e.nextTick(n,i,t):o?(e.nextTick(r,i),o(t)):e.nextTick(r,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}}).call(this)}).call(this,e(\"_process\"))},{_process:12}],24:[function(e,t){'use strict';function n(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),a=0;at.length)throw new u(\"streams\");var a,l=t.map(function(e,n){var d=nd){var s=i?o:\"highWaterMark\";throw new a(s,d)}return t(d)}return e.objectMode?16:16384}}},{\"../../../errors\":15}],28:[function(e,t){t.exports=e(\"events\").EventEmitter},{events:7}],29:[function(e,t,n){n=t.exports=e(\"./lib/_stream_readable.js\"),n.Stream=n,n.Readable=n,n.Writable=e(\"./lib/_stream_writable.js\"),n.Duplex=e(\"./lib/_stream_duplex.js\"),n.Transform=e(\"./lib/_stream_transform.js\"),n.PassThrough=e(\"./lib/_stream_passthrough.js\"),n.finished=e(\"./lib/internal/streams/end-of-stream.js\"),n.pipeline=e(\"./lib/internal/streams/pipeline.js\")},{\"./lib/_stream_duplex.js\":16,\"./lib/_stream_passthrough.js\":17,\"./lib/_stream_readable.js\":18,\"./lib/_stream_transform.js\":19,\"./lib/_stream_writable.js\":20,\"./lib/internal/streams/end-of-stream.js\":24,\"./lib/internal/streams/pipeline.js\":26}],30:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var o=e(\"buffer\"),i=o.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=o:(r(o,n),n.Buffer=a),a.prototype=Object.create(i.prototype),r(i,a),a.from=function(e,t,n){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return i(e,t,n)},a.alloc=function(e,t,n){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var r=i(e);return void 0===t?r.fill(0):\"string\"==typeof n?r.fill(t,n):r.fill(t),r},a.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return i(e)},a.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return o.SlowBuffer(e)}},{buffer:3}],31:[function(e,t,n){'use strict';function r(e){if(!e)return\"utf8\";for(var t;;)switch(e){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0;}}function a(e){var t=r(e);if(\"string\"!=typeof t&&(m.isEncoding===b||!b(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}function o(e){this.encoding=a(e);var t;switch(this.encoding){case\"utf16le\":this.text=u,this.end=p,t=4;break;case\"utf8\":this.fillLast=c,t=4;break;case\"base64\":this.text=f,this.end=g,t=3;break;default:return this.write=_,void(this.end=h);}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t)}function d(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function s(e,t,n){var r=t.length-1;if(r=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,n)}return t}function f(e,t){var r=(e.length-t)%3;return 0==r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function _(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):\"\"}var m=e(\"safe-buffer\").Buffer,b=m.isEncoding||function(e){switch(e=\"\"+e,e&&e.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1;}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return\"\";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return\"\";n=this.lastNeed,this.lastNeed=0}else n=0;return n */const a=e(\"debug\")(\"simple-peer\"),o=e(\"get-browser-rtc\"),i=e(\"randombytes\"),d=e(\"readable-stream\"),s=e(\"queue-microtask\"),l=e(\"err-code\"),{Buffer:c}=e(\"buffer\"),u=65536;class p extends d.Duplex{constructor(e){if(e=Object.assign({allowHalfOpen:!1},e),super(e),this._id=i(4).toString(\"hex\").slice(0,7),this._debug(\"new peer %o\",e),this.channelName=e.initiator?e.channelName||i(20).toString(\"hex\"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||p.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},p.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5000,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&\"object\"==typeof e.wrtc?e.wrtc:o(),!this._wrtc)if(\"undefined\"==typeof window)throw l(new Error(\"No WebRTC support: Specify `opts.wrtc` option in this environment\"),\"ERR_WEBRTC_SUPPORT\");else throw l(new Error(\"No WebRTC support: Not a supported browser\"),\"ERR_WEBRTC_SUPPORT\");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(l(e,\"ERR_PC_CONSTRUCTOR\"))}this._isReactNativeWebrtc=\"number\"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},\"object\"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(e=>{this.destroy(l(e,\"ERR_PC_PEER_IDENTITY\"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach(e=>{this.addStream(e)}),this._pc.ontrack=e=>{this._onTrack(e)},this._debug(\"initial negotiation\"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once(\"finish\",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&\"open\"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot signal after peer is destroyed\"),\"ERR_DESTROYED\");if(\"string\"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug(\"signal()\"),e.renegotiate&&this.initiator&&(this._debug(\"got request to renegotiate\"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug(\"got request for transceiver\"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e=>{this._addIceCandidate(e)}),this._pendingCandidates=[],\"offer\"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(e=>{this.destroy(l(e,\"ERR_SET_REMOTE_DESCRIPTION\"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(l(new Error(\"signal() called with invalid signal data\"),\"ERR_SIGNALING\"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch(e=>{!t.address||t.address.endsWith(\".local\")?r(\"Ignoring unsupported ICE candidate.\"):this.destroy(l(e,\"ERR_ADD_ICE_CANDIDATE\"))})}send(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot send after peer is destroyed\"),\"ERR_DESTROYED\");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addTransceiver after peer is destroyed\"),\"ERR_DESTROYED\");if(this._debug(\"addTransceiver()\"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(l(e,\"ERR_ADD_TRANSCEIVER\"))}else this.emit(\"signal\",{type:\"transceiverRequest\",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addStream()\"),e.getTracks().forEach(t=>{this.addTrack(t,e)})}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot addTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addTrack()\");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(!r)r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation();else if(r.removed)throw l(new Error(\"Track has been removed. You should enable/disable tracks that you want to re-add.\"),\"ERR_SENDER_REMOVED\");else throw l(new Error(\"Track has already been added to that stream.\"),\"ERR_SENDER_ALREADY_ADDED\")}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot replaceTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"replaceTrack()\");const r=this._senderMap.get(e),a=r?r.get(n):null;if(!a)throw l(new Error(\"Cannot replace track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");t&&this._senderMap.set(t,r),null==a.replaceTrack?this.destroy(l(new Error(\"replaceTrack is not supported in this browser\"),\"ERR_UNSUPPORTED_REPLACETRACK\")):a.replaceTrack(t)}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot removeTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSender()\");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw l(new Error(\"Cannot remove track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){\"NS_ERROR_UNEXPECTED\"===e.name?this._sendersAwaitingStable.push(r):this.destroy(l(e,\"ERR_REMOVE_TRACK\"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot removeStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSenders()\"),e.getTracks().forEach(t=>{this.removeTrack(t,e)})}}_needsNegotiation(){this._debug(\"_needsNegotiation\"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug(\"starting batched negotiation\"),this.negotiate()):this._debug(\"non-initiator initial negotiation request discarded\"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot negotiate after peer is destroyed\"),\"ERR_DESTROYED\");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"start negotiation\"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"requesting negotiation from initiator\"),this.emit(\"signal\",{type:\"renegotiate\",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,()=>{})}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug(\"destroying (error: %s)\",e&&(e.message||e)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug(\"destroy (error: %s)\",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener(\"finish\",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit(\"error\",e),this.emit(\"close\"),t()}))}_setupData(e){if(!e.channel)return this.destroy(l(new Error(\"Data channel event is missing `channel` property\"),\"ERR_DATA_CHANNEL\"));this._channel=e.channel,this._channel.binaryType=\"arraybuffer\",\"number\"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(l(t,\"ERR_DATA_CHANNEL\"))};let t=!1;this._closingInterval=setInterval(()=>{this._channel&&\"closing\"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1},5000)}_read(){}_write(e,t,n){if(this.destroyed)return n(l(new Error(\"cannot write after peer is destroyed\"),\"ERR_DATA_CHANNEL\"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._channel.bufferedAmount>u?(this._debug(\"start backpressure: bufferedAmount %d\",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug(\"write before connect\"),this._chunk=e,this._cb=n}_onFinish(){if(!this.destroyed){const e=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e():this.once(\"connect\",e)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug(\"started iceComplete timeout\"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug(\"iceComplete timeout completed\"),this.emit(\"iceTimeout\"),this.emit(\"_iceComplete\"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp})}};this._pc.setLocalDescription(e).then(()=>{this._debug(\"createOffer success\"),this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_OFFER\"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_ANSWER\"))})}_onConnectionStateChange(){this.destroyed||\"failed\"===this._pc.connectionState&&this.destroy(l(new Error(\"Connection failed.\"),\"ERR_CONNECTION_FAILURE\"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug(\"iceStateChange (connection: %s) (gathering: %s)\",e,t),this.emit(\"iceStateChange\",e,t),(\"connected\"===e||\"completed\"===e)&&(this._pcReady=!0,this._maybeReady()),\"failed\"===e&&this.destroy(l(new Error(\"Ice connection failed.\"),\"ERR_ICE_CONNECTION_FAILURE\")),\"closed\"===e&&this.destroy(l(new Error(\"Ice connection closed.\"),\"ERR_ICE_CONNECTION_CLOSED\"))}getStats(e){const t=e=>(\"[object Array]\"===Object.prototype.toString.call(e.values)&&e.values.forEach(t=>{Object.assign(e,t)}),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(e=>{r.push(t(e))}),e(null,r)},t=>e(t)):0{if(this.destroyed)return;const r=[];n.result().forEach(e=>{const n={};e.names().forEach(t=>{n[t]=e.stat(t)}),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))}),e(null,r)},t=>e(t)):e(null,[])}_maybeReady(){if(this._debug(\"maybeReady pc %s channel %s\",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},a={},o={};let i=!1;n.forEach(e=>{(\"remotecandidate\"===e.type||\"remote-candidate\"===e.type)&&(r[e.id]=e),(\"localcandidate\"===e.type||\"local-candidate\"===e.type)&&(a[e.id]=e),(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&(o[e.id]=e)});const d=e=>{i=!0;let t=a[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=+t.port):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=+t.portNumber):\"string\"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(\":\"),this.localAddress=t[0],this.localPort=+t[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(\":\")?\"IPv6\":\"IPv4\");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=+n.port):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=+n.portNumber):\"string\"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(\":\"),this.remoteAddress=n[0],this.remotePort=+n[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(\":\")?\"IPv6\":\"IPv4\"),this._debug(\"connect local: %s:%s remote: %s:%s\",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach(e=>{\"transport\"===e.type&&e.selectedCandidatePairId&&d(o[e.selectedCandidatePairId]),(\"googCandidatePair\"===e.type&&\"true\"===e.googActiveConnection||(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&e.selected)&&d(e)}),!i&&(!Object.keys(o).length||Object.keys(a).length))return void setTimeout(e,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._chunk=null,this._debug(\"sent chunk from \\\"write before connect\\\"\");const e=this._cb;this._cb=null,e(null)}\"number\"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug(\"connect\"),this.emit(\"connect\")})};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(\"stable\"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug(\"flushing sender queue\",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug(\"flushing negotiation queue\"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug(\"negotiated\"),this.emit(\"negotiated\"))),this._debug(\"signalingStateChange %s\",this._pc.signalingState),this.emit(\"signalingStateChange\",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit(\"signal\",{type:\"candidate\",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit(\"_iceComplete\")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug(\"ending backpressure: bufferedAmount %d\",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug(\"on channel open\"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug(\"on channel close\"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach(t=>{this._debug(\"on track\"),this.emit(\"track\",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some(e=>e.id===t.id)||(this._remoteStreams.push(t),s(()=>{this._debug(\"on stream\"),this.emit(\"stream\",t)}))})}_debug(){const e=[].slice.call(arguments);e[0]=\"[\"+this._id+\"] \"+e[0],a.apply(null,e)}}p.WEBRTC_SUPPORT=!!o(),p.config={iceServers:[{urls:[\"stun:stun.l.google.com:19302\",\"stun:global.stun.twilio.com:3478\"]}],sdpSemantics:\"unified-plan\"},p.channelConfig={},t.exports=p},{buffer:3,debug:4,\"err-code\":6,\"get-browser-rtc\":8,\"queue-microtask\":13,randombytes:14,\"readable-stream\":29}]},{},[])(\"/\")});", "/**\n * @module sync-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as Y from 'yjs'\n\n/**\n * @typedef {Map} StateMap\n */\n\n/**\n * Core Yjs defines two message types:\n * \u2022 YjsSyncStep1: Includes the State Set of the sending client. When received, the client should reply with YjsSyncStep2.\n * \u2022 YjsSyncStep2: Includes all missing structs and the complete delete set. When received, the client is assured that it\n * received all information from the remote client.\n *\n * In a peer-to-peer network, you may want to introduce a SyncDone message type. Both parties should initiate the connection\n * with SyncStep1. When a client received SyncStep2, it should reply with SyncDone. When the local client received both\n * SyncStep2 and SyncDone, it is assured that it is synced to the remote client.\n *\n * In a client-server model, you want to handle this differently: The client should initiate the connection with SyncStep1.\n * When the server receives SyncStep1, it should reply with SyncStep2 immediately followed by SyncStep1. The client replies\n * with SyncStep2 when it receives SyncStep1. Optionally the server may send a SyncDone after it received SyncStep2, so the\n * client knows that the sync is finished. There are two reasons for this more elaborated sync model: 1. This protocol can\n * easily be implemented on top of http and websockets. 2. The server should only reply to requests, and not initiate them.\n * Therefore it is necessary that the client initiates the sync.\n *\n * Construction of a message:\n * [messageType : varUint, message definition..]\n *\n * Note: A message does not include information about the room name. This must to be handled by the upper layer protocol!\n *\n * stringify[messageType] stringifies a message definition (messageType is already read from the bufffer)\n */\n\nexport const messageYjsSyncStep1 = 0\nexport const messageYjsSyncStep2 = 1\nexport const messageYjsUpdate = 2\n\n/**\n * Create a sync step 1 message based on the state of the current shared document.\n *\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n */\nexport const writeSyncStep1 = (encoder, doc) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep1)\n const sv = Y.encodeStateVector(doc)\n encoding.writeVarUint8Array(encoder, sv)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n * @param {Uint8Array} [encodedStateVector]\n */\nexport const writeSyncStep2 = (encoder, doc, encodedStateVector) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep2)\n encoding.writeVarUint8Array(encoder, Y.encodeStateAsUpdate(doc, encodedStateVector))\n}\n\n/**\n * Read SyncStep1 message and reply with SyncStep2.\n *\n * @param {decoding.Decoder} decoder The reply to the received message\n * @param {encoding.Encoder} encoder The received message\n * @param {Y.Doc} doc\n */\nexport const readSyncStep1 = (decoder, encoder, doc) =>\n writeSyncStep2(encoder, doc, decoding.readVarUint8Array(decoder))\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncStep2 = (decoder, doc, transactionOrigin) => {\n try {\n Y.applyUpdate(doc, decoding.readVarUint8Array(decoder), transactionOrigin)\n } catch (error) {\n // This catches errors that are thrown by event handlers\n console.error('Caught error while handling a Yjs update', error)\n }\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Uint8Array} update\n */\nexport const writeUpdate = (encoder, update) => {\n encoding.writeVarUint(encoder, messageYjsUpdate)\n encoding.writeVarUint8Array(encoder, update)\n}\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readUpdate = readSyncStep2\n\n/**\n * @param {decoding.Decoder} decoder A message received from another client\n * @param {encoding.Encoder} encoder The reply message. Does not need to be sent if empty.\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {\n const messageType = decoding.readVarUint(decoder)\n switch (messageType) {\n case messageYjsSyncStep1:\n readSyncStep1(decoder, encoder, doc)\n break\n case messageYjsSyncStep2:\n readSyncStep2(decoder, doc, transactionOrigin)\n break\n case messageYjsUpdate:\n readUpdate(decoder, doc, transactionOrigin)\n break\n default:\n throw new Error('Unknown message type')\n }\n return messageType\n}\n", "/* eslint-env browser */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as promise from 'lib0/promise'\nimport * as error from 'lib0/error'\nimport * as string from 'lib0/string'\n\n/**\n * @param {string} secret\n * @param {string} roomName\n * @return {PromiseLike}\n */\nexport const deriveKey = (secret, roomName) => {\n const secretBuffer = string.encodeUtf8(secret).buffer\n const salt = string.encodeUtf8(roomName).buffer\n return crypto.subtle.importKey(\n 'raw',\n secretBuffer,\n 'PBKDF2',\n false,\n ['deriveKey']\n ).then(keyMaterial =>\n crypto.subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt,\n iterations: 100000,\n hash: 'SHA-256'\n },\n keyMaterial,\n {\n name: 'AES-GCM',\n length: 256\n },\n true,\n ['encrypt', 'decrypt']\n )\n )\n}\n\n/**\n * @param {Uint8Array} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted, base64 encoded message\n */\nexport const encrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const iv = crypto.getRandomValues(new Uint8Array(12))\n return crypto.subtle.encrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n data\n ).then(cipher => {\n const encryptedDataEncoder = encoding.createEncoder()\n encoding.writeVarString(encryptedDataEncoder, 'AES-GCM')\n encoding.writeVarUint8Array(encryptedDataEncoder, iv)\n encoding.writeVarUint8Array(encryptedDataEncoder, new Uint8Array(cipher))\n return encoding.toUint8Array(encryptedDataEncoder)\n })\n}\n\n/**\n * @param {Object} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted data, if key is provided\n */\nexport const encryptJson = (data, key) => {\n const dataEncoder = encoding.createEncoder()\n encoding.writeAny(dataEncoder, data)\n return encrypt(encoding.toUint8Array(dataEncoder), key)\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted buffer\n */\nexport const decrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const dataDecoder = decoding.createDecoder(data)\n const algorithm = decoding.readVarString(dataDecoder)\n if (algorithm !== 'AES-GCM') {\n promise.reject(error.create('Unknown encryption algorithm'))\n }\n const iv = decoding.readVarUint8Array(dataDecoder)\n const cipher = decoding.readVarUint8Array(dataDecoder)\n return crypto.subtle.decrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n cipher\n ).then(data => new Uint8Array(data))\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted object\n */\nexport const decryptJson = (data, key) =>\n decrypt(data, key).then(decryptedValue =>\n decoding.readAny(decoding.createDecoder(new Uint8Array(decryptedValue)))\n )\n", "import * as ws from 'lib0/websocket'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\nimport * as random from 'lib0/random'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport { ObservableV2 } from 'lib0/observable'\nimport * as logging from 'lib0/logging'\nimport * as promise from 'lib0/promise'\nimport * as bc from 'lib0/broadcastchannel'\nimport * as buffer from 'lib0/buffer'\nimport * as math from 'lib0/math'\nimport { createMutex } from 'lib0/mutex'\n\nimport * as Y from 'yjs' // eslint-disable-line\nimport Peer from 'simple-peer/simplepeer.min.js'\n\nimport * as syncProtocol from 'y-protocols/sync'\nimport * as awarenessProtocol from 'y-protocols/awareness'\n\nimport * as cryptoutils from './crypto.js'\n\nconst log = logging.createModuleLogger('y-webrtc')\n\nconst messageSync = 0\nconst messageQueryAwareness = 3\nconst messageAwareness = 1\nconst messageBcPeerId = 4\n\n/**\n * @type {Map}\n */\nconst signalingConns = new Map()\n\n/**\n * @type {Map}\n */\nconst rooms = new Map()\n\n/**\n * @param {Room} room\n */\nconst checkIsSynced = room => {\n let synced = true\n room.webrtcConns.forEach(peer => {\n if (!peer.synced) {\n synced = false\n }\n })\n if ((!synced && room.synced) || (synced && !room.synced)) {\n room.synced = synced\n room.provider.emit('synced', [{ synced }])\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with all peers')\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} buf\n * @param {function} syncedCallback\n * @return {encoding.Encoder?}\n */\nconst readMessage = (room, buf, syncedCallback) => {\n const decoder = decoding.createDecoder(buf)\n const encoder = encoding.createEncoder()\n const messageType = decoding.readVarUint(decoder)\n if (room === undefined) {\n return null\n }\n const awareness = room.awareness\n const doc = room.doc\n let sendReply = false\n switch (messageType) {\n case messageSync: {\n encoding.writeVarUint(encoder, messageSync)\n const syncMessageType = syncProtocol.readSyncMessage(decoder, encoder, doc, room)\n if (syncMessageType === syncProtocol.messageYjsSyncStep2 && !room.synced) {\n syncedCallback()\n }\n if (syncMessageType === syncProtocol.messageYjsSyncStep1) {\n sendReply = true\n }\n break\n }\n case messageQueryAwareness:\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awareness.getStates().keys())))\n sendReply = true\n break\n case messageAwareness:\n awarenessProtocol.applyAwarenessUpdate(awareness, decoding.readVarUint8Array(decoder), room)\n break\n case messageBcPeerId: {\n const add = decoding.readUint8(decoder) === 1\n const peerName = decoding.readVarString(decoder)\n if (peerName !== room.peerId && ((room.bcConns.has(peerName) && !add) || (!room.bcConns.has(peerName) && add))) {\n const removed = []\n const added = []\n if (add) {\n room.bcConns.add(peerName)\n added.push(peerName)\n } else {\n room.bcConns.delete(peerName)\n removed.push(peerName)\n }\n room.provider.emit('peers', [{\n added,\n removed,\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n broadcastBcPeerId(room)\n }\n break\n }\n default:\n console.error('Unable to compute message')\n return encoder\n }\n if (!sendReply) {\n // nothing has been written, no answer created\n return null\n }\n return encoder\n}\n\n/**\n * @param {WebrtcConn} peerConn\n * @param {Uint8Array} buf\n * @return {encoding.Encoder?}\n */\nconst readPeerMessage = (peerConn, buf) => {\n const room = peerConn.room\n log('received message from ', logging.BOLD, peerConn.remotePeerId, logging.GREY, ' (', room.name, ')', logging.UNBOLD, logging.UNCOLOR)\n return readMessage(room, buf, () => {\n peerConn.synced = true\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with ', logging.BOLD, peerConn.remotePeerId)\n checkIsSynced(room)\n })\n}\n\n/**\n * @param {WebrtcConn} webrtcConn\n * @param {encoding.Encoder} encoder\n */\nconst sendWebrtcConn = (webrtcConn, encoder) => {\n log('send message to ', logging.BOLD, webrtcConn.remotePeerId, logging.UNBOLD, logging.GREY, ' (', webrtcConn.room.name, ')', logging.UNCOLOR)\n try {\n webrtcConn.peer.send(encoding.toUint8Array(encoder))\n } catch (e) {}\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastWebrtcConn = (room, m) => {\n log('broadcast message in ', logging.BOLD, room.name, logging.UNBOLD)\n room.webrtcConns.forEach(conn => {\n try {\n conn.peer.send(m)\n } catch (e) {}\n })\n}\n\nexport class WebrtcConn {\n /**\n * @param {SignalingConn} signalingConn\n * @param {boolean} initiator\n * @param {string} remotePeerId\n * @param {Room} room\n */\n constructor (signalingConn, initiator, remotePeerId, room) {\n log('establishing connection to ', logging.BOLD, remotePeerId)\n this.room = room\n this.remotePeerId = remotePeerId\n this.glareToken = undefined\n this.closed = false\n this.connected = false\n this.synced = false\n /**\n * @type {any}\n */\n this.peer = new Peer({ initiator, ...room.provider.peerOpts })\n this.peer.on('signal', signal => {\n if (this.glareToken === undefined) {\n // add some randomness to the timestamp of the offer\n this.glareToken = Date.now() + Math.random()\n }\n publishSignalingMessage(signalingConn, room, { to: remotePeerId, from: room.peerId, type: 'signal', token: this.glareToken, signal })\n })\n this.peer.on('connect', () => {\n log('connected to ', logging.BOLD, remotePeerId)\n this.connected = true\n // send sync step 1\n const provider = room.provider\n const doc = provider.doc\n const awareness = room.awareness\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeSyncStep1(encoder, doc)\n sendWebrtcConn(this, encoder)\n const awarenessStates = awareness.getStates()\n if (awarenessStates.size > 0) {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awarenessStates.keys())))\n sendWebrtcConn(this, encoder)\n }\n })\n this.peer.on('close', () => {\n this.connected = false\n this.closed = true\n if (room.webrtcConns.has(this.remotePeerId)) {\n room.webrtcConns.delete(this.remotePeerId)\n room.provider.emit('peers', [{\n removed: [this.remotePeerId],\n added: [],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n }\n checkIsSynced(room)\n this.peer.destroy()\n log('closed connection to ', logging.BOLD, remotePeerId)\n announceSignalingInfo(room)\n })\n this.peer.on('error', err => {\n log('Error in connection to ', logging.BOLD, remotePeerId, ': ', err)\n announceSignalingInfo(room)\n })\n this.peer.on('data', data => {\n const answer = readPeerMessage(this, data)\n if (answer !== null) {\n sendWebrtcConn(this, answer)\n }\n })\n }\n\n destroy () {\n this.peer.destroy()\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastBcMessage = (room, m) => cryptoutils.encrypt(m, room.key).then(data =>\n room.mux(() =>\n bc.publish(room.name, data)\n )\n)\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastRoomMessage = (room, m) => {\n if (room.bcconnected) {\n broadcastBcMessage(room, m)\n }\n broadcastWebrtcConn(room, m)\n}\n\n/**\n * @param {Room} room\n */\nconst announceSignalingInfo = room => {\n signalingConns.forEach(conn => {\n // only subscribe if connection is established, otherwise the conn automatically subscribes to all rooms\n if (conn.connected) {\n conn.send({ type: 'subscribe', topics: [room.name] })\n if (room.webrtcConns.size < room.provider.maxConns) {\n publishSignalingMessage(conn, room, { type: 'announce', from: room.peerId })\n }\n }\n })\n}\n\n/**\n * @param {Room} room\n */\nconst broadcastBcPeerId = room => {\n if (room.provider.filterBcConns) {\n // broadcast peerId via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 1)\n encoding.writeVarString(encoderPeerIdBc, room.peerId)\n broadcastBcMessage(room, encoding.toUint8Array(encoderPeerIdBc))\n }\n}\n\nexport class Room {\n /**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n */\n constructor (doc, provider, name, key) {\n /**\n * Do not assume that peerId is unique. This is only meant for sending signaling messages.\n *\n * @type {string}\n */\n this.peerId = random.uuidv4()\n this.doc = doc\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = provider.awareness\n this.provider = provider\n this.synced = false\n this.name = name\n // @todo make key secret by scoping\n this.key = key\n /**\n * @type {Map}\n */\n this.webrtcConns = new Map()\n /**\n * @type {Set}\n */\n this.bcConns = new Set()\n this.mux = createMutex()\n this.bcconnected = false\n /**\n * @param {ArrayBuffer} data\n */\n this._bcSubscriber = data =>\n cryptoutils.decrypt(new Uint8Array(data), key).then(m =>\n this.mux(() => {\n const reply = readMessage(this, m, () => {})\n if (reply) {\n broadcastBcMessage(this, encoding.toUint8Array(reply))\n }\n })\n )\n /**\n * Listens to Yjs updates and sends them to remote peers\n *\n * @param {Uint8Array} update\n * @param {any} _origin\n */\n this._docUpdateHandler = (update, _origin) => {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeUpdate(encoder, update)\n broadcastRoomMessage(this, encoding.toUint8Array(encoder))\n }\n /**\n * Listens to Awareness updates and sends them to remote peers\n *\n * @param {any} changed\n * @param {any} _origin\n */\n this._awarenessUpdateHandler = ({ added, updated, removed }, _origin) => {\n const changedClients = added.concat(updated).concat(removed)\n const encoderAwareness = encoding.createEncoder()\n encoding.writeVarUint(encoderAwareness, messageAwareness)\n encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))\n broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))\n }\n\n this._beforeUnloadHandler = () => {\n awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')\n rooms.forEach(room => {\n room.disconnect()\n })\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.on('exit', this._beforeUnloadHandler)\n }\n }\n\n connect () {\n this.doc.on('update', this._docUpdateHandler)\n this.awareness.on('update', this._awarenessUpdateHandler)\n // signal through all available signaling connections\n announceSignalingInfo(this)\n const roomName = this.name\n bc.subscribe(roomName, this._bcSubscriber)\n this.bcconnected = true\n // broadcast peerId via broadcastchannel\n broadcastBcPeerId(this)\n // write sync step 1\n const encoderSync = encoding.createEncoder()\n encoding.writeVarUint(encoderSync, messageSync)\n syncProtocol.writeSyncStep1(encoderSync, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderSync))\n // broadcast local state\n const encoderState = encoding.createEncoder()\n encoding.writeVarUint(encoderState, messageSync)\n syncProtocol.writeSyncStep2(encoderState, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderState))\n // write queryAwareness\n const encoderAwarenessQuery = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessQuery, messageQueryAwareness)\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessQuery))\n // broadcast local awareness state\n const encoderAwarenessState = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessState, messageAwareness)\n encoding.writeVarUint8Array(encoderAwarenessState, awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this.doc.clientID]))\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessState))\n }\n\n disconnect () {\n // signal through all available signaling connections\n signalingConns.forEach(conn => {\n if (conn.connected) {\n conn.send({ type: 'unsubscribe', topics: [this.name] })\n }\n })\n awarenessProtocol.removeAwarenessStates(this.awareness, [this.doc.clientID], 'disconnect')\n // broadcast peerId removal via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 0) // remove peerId from other bc peers\n encoding.writeVarString(encoderPeerIdBc, this.peerId)\n broadcastBcMessage(this, encoding.toUint8Array(encoderPeerIdBc))\n\n bc.unsubscribe(this.name, this._bcSubscriber)\n this.bcconnected = false\n this.doc.off('update', this._docUpdateHandler)\n this.awareness.off('update', this._awarenessUpdateHandler)\n this.webrtcConns.forEach(conn => conn.destroy())\n }\n\n destroy () {\n this.disconnect()\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.off('exit', this._beforeUnloadHandler)\n }\n }\n}\n\n/**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n * @return {Room}\n */\nconst openRoom = (doc, provider, name, key) => {\n // there must only be one room\n if (rooms.has(name)) {\n throw error.create(`A Yjs Doc connected to room \"${name}\" already exists!`)\n }\n const room = new Room(doc, provider, name, key)\n rooms.set(name, /** @type {Room} */ (room))\n return room\n}\n\n/**\n * @param {SignalingConn} conn\n * @param {Room} room\n * @param {any} data\n */\nconst publishSignalingMessage = (conn, room, data) => {\n if (room.key) {\n cryptoutils.encryptJson(data, room.key).then(data => {\n conn.send({ type: 'publish', topic: room.name, data: buffer.toBase64(data) })\n })\n } else {\n conn.send({ type: 'publish', topic: room.name, data })\n }\n}\n\nexport class SignalingConn extends ws.WebsocketClient {\n constructor (url) {\n super(url)\n /**\n * @type {Set}\n */\n this.providers = new Set()\n this.on('connect', () => {\n log(`connected (${url})`)\n const topics = Array.from(rooms.keys())\n this.send({ type: 'subscribe', topics })\n rooms.forEach(room =>\n publishSignalingMessage(this, room, { type: 'announce', from: room.peerId })\n )\n })\n this.on('message', m => {\n switch (m.type) {\n case 'publish': {\n const roomName = m.topic\n const room = rooms.get(roomName)\n if (room == null || typeof roomName !== 'string') {\n return\n }\n const execMessage = data => {\n const webrtcConns = room.webrtcConns\n const peerId = room.peerId\n if (data == null || data.from === peerId || (data.to !== undefined && data.to !== peerId) || room.bcConns.has(data.from)) {\n // ignore messages that are not addressed to this conn, or from clients that are connected via broadcastchannel\n return\n }\n const emitPeerChange = webrtcConns.has(data.from)\n ? () => {}\n : () =>\n room.provider.emit('peers', [{\n removed: [],\n added: [data.from],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n switch (data.type) {\n case 'announce':\n if (webrtcConns.size < room.provider.maxConns) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, true, data.from, room))\n emitPeerChange()\n }\n break\n case 'signal':\n if (data.signal.type === 'offer') {\n const existingConn = webrtcConns.get(data.from)\n if (existingConn) {\n const remoteToken = data.token\n const localToken = existingConn.glareToken\n if (localToken && localToken > remoteToken) {\n log('offer rejected: ', data.from)\n return\n }\n // if we don't reject the offer, we will be accepting it and answering it\n existingConn.glareToken = undefined\n }\n }\n if (data.signal.type === 'answer') {\n log('offer answered by: ', data.from)\n const existingConn = webrtcConns.get(data.from)\n existingConn.glareToken = undefined\n }\n if (data.to === peerId) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, false, data.from, room)).peer.signal(data.signal)\n emitPeerChange()\n }\n break\n }\n }\n if (room.key) {\n if (typeof m.data === 'string') {\n cryptoutils.decryptJson(buffer.fromBase64(m.data), room.key).then(execMessage)\n }\n } else {\n execMessage(m.data)\n }\n }\n }\n })\n this.on('disconnect', () => log(`disconnect (${url})`))\n }\n}\n\n/**\n * @typedef {Object} ProviderOptions\n * @property {Array} [signaling]\n * @property {string} [password]\n * @property {awarenessProtocol.Awareness} [awareness]\n * @property {number} [maxConns]\n * @property {boolean} [filterBcConns]\n * @property {any} [peerOpts]\n */\n\n/**\n * @param {WebrtcProvider} provider\n */\nconst emitStatus = provider => {\n provider.emit('status', [{\n connected: provider.connected\n }])\n}\n\n/**\n * @typedef {Object} WebrtcProviderEvents\n * @property {function({connected:boolean}):void} WebrtcProviderEvent.status\n * @property {function({synced:boolean}):void} WebrtcProviderEvent.synced\n * @property {function({added:Array,removed:Array,webrtcPeers:Array,bcPeers:Array}):void} WebrtcProviderEvent.peers\n */\n\n/**\n * @extends ObservableV2\n */\nexport class WebrtcProvider extends ObservableV2 {\n /**\n * @param {string} roomName\n * @param {Y.Doc} doc\n * @param {ProviderOptions?} opts\n */\n constructor (\n roomName,\n doc,\n {\n signaling = ['wss://y-webrtc-eu.fly.dev'],\n password = null,\n awareness = new awarenessProtocol.Awareness(doc),\n maxConns = 20 + math.floor(random.rand() * 15), // the random factor reduces the chance that n clients form a cluster\n filterBcConns = true,\n peerOpts = {} // simple-peer options. See https://github.com/feross/simple-peer#peer--new-peeropts\n } = {}\n ) {\n super()\n this.roomName = roomName\n this.doc = doc\n this.filterBcConns = filterBcConns\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = awareness\n this.shouldConnect = false\n this.signalingUrls = signaling\n this.signalingConns = []\n this.maxConns = maxConns\n this.peerOpts = peerOpts\n /**\n * @type {PromiseLike}\n */\n this.key = password ? cryptoutils.deriveKey(password, roomName) : /** @type {PromiseLike} */ (promise.resolve(null))\n /**\n * @type {Room|null}\n */\n this.room = null\n this.key.then(key => {\n this.room = openRoom(doc, this, roomName, key)\n if (this.shouldConnect) {\n this.room.connect()\n } else {\n this.room.disconnect()\n }\n emitStatus(this)\n })\n this.connect()\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n /**\n * Indicates whether the provider is looking for other peers.\n *\n * Other peers can be found via signaling servers or via broadcastchannel (cross browser-tab\n * communication). You never know when you are connected to all peers. You also don't know if\n * there are other peers. connected doesn't mean that you are connected to any physical peers\n * working on the same resource as you. It does not change unless you call provider.disconnect()\n *\n * `this.on('status', (event) => { console.log(event.connected) })`\n *\n * @type {boolean}\n */\n get connected () {\n return this.room !== null && this.shouldConnect\n }\n\n connect () {\n this.shouldConnect = true\n this.signalingUrls.forEach(url => {\n const signalingConn = map.setIfUndefined(signalingConns, url, () => new SignalingConn(url))\n this.signalingConns.push(signalingConn)\n signalingConn.providers.add(this)\n })\n if (this.room) {\n this.room.connect()\n emitStatus(this)\n }\n }\n\n disconnect () {\n this.shouldConnect = false\n this.signalingConns.forEach(conn => {\n conn.providers.delete(this)\n if (conn.providers.size === 0) {\n conn.destroy()\n signalingConns.delete(conn.url)\n }\n })\n if (this.room) {\n this.room.disconnect()\n emitStatus(this)\n }\n }\n\n destroy () {\n this.doc.off('destroy', this.destroy)\n // need to wait for key before deleting room\n this.key.then(() => {\n /** @type {Room} */ (this.room).destroy()\n rooms.delete(this.roomName)\n })\n super.destroy()\n }\n}\n", "/**\n * @module bindings/quill\n */\n\nimport * as Y from 'yjs' // eslint-disable-line\n\n/**\n * @typedef {import('y-protocols/awareness').Awareness} Awareness\n\n/**\n * Removes the pending '\\n's if it has no attributes.\n */\nexport const normQuillDelta = delta => {\n if (delta.length > 0) {\n const d = delta[delta.length - 1]\n const insert = d.insert\n if (d.attributes === undefined && insert !== undefined && insert.slice(-1) === '\\n') {\n delta = delta.slice()\n let ins = insert.slice(0, -1)\n while (ins.slice(-1) === '\\n') {\n ins = ins.slice(0, -1)\n }\n delta[delta.length - 1] = { insert: ins }\n if (ins.length === 0) {\n delta.pop()\n }\n return delta\n }\n }\n return delta\n}\n\n/**\n * @param {any} quillCursors\n */\nconst updateCursor = (quillCursors, aw, clientId, doc, type) => {\n try {\n if (aw && aw.cursor && clientId !== doc.clientID) {\n const user = aw.user || {}\n const color = user.color || '#ffa500'\n const name = user.name || `User: ${clientId}`\n quillCursors.createCursor(clientId.toString(), name, color)\n const anchor = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.anchor), doc)\n const head = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.head), doc)\n if (anchor && head && anchor.type === type) {\n quillCursors.moveCursor(clientId.toString(), { index: anchor.index, length: head.index - anchor.index })\n }\n } else {\n quillCursors.removeCursor(clientId.toString())\n }\n } catch (err) {\n console.error(err)\n }\n}\n\nexport class QuillBinding {\n /**\n * @param {Y.Text} type\n * @param {any} quill\n * @param {Awareness} [awareness]\n */\n constructor (type, quill, awareness) {\n const doc = /** @type {Y.Doc} */ (type.doc)\n this.type = type\n this.doc = doc\n this.quill = quill\n const quillCursors = quill.getModule('cursors') || null\n this.quillCursors = quillCursors\n // This object contains all attributes used in the quill instance\n this._negatedUsedFormats = {}\n this.awareness = awareness\n this._awarenessChange = ({ added, removed, updated }) => {\n const states = /** @type {Awareness} */ (awareness).getStates()\n added.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n updated.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n removed.forEach(id => {\n quillCursors.removeCursor(id.toString())\n })\n }\n /**\n * @param {Y.YTextEvent} event\n */\n this._typeObserver = event => {\n if (event.transaction.origin !== this) {\n const eventDelta = event.delta\n // We always explicitly set attributes, otherwise concurrent edits may\n // result in quill assuming that a text insertion shall inherit existing\n // attributes.\n const delta = []\n for (let i = 0; i < eventDelta.length; i++) {\n const d = eventDelta[i]\n if (d.insert !== undefined) {\n delta.push(Object.assign({}, d, { attributes: Object.assign({}, this._negatedUsedFormats, d.attributes || {}) }))\n } else {\n delta.push(d)\n }\n }\n quill.updateContents(delta, this)\n }\n }\n type.observe(this._typeObserver)\n this._quillObserver = (eventType, delta, state, origin) => {\n if (delta && delta.ops) {\n // update content\n const ops = delta.ops\n ops.forEach(op => {\n if (op.attributes !== undefined) {\n for (const key in op.attributes) {\n if (this._negatedUsedFormats[key] === undefined) {\n this._negatedUsedFormats[key] = false\n }\n }\n }\n })\n if (origin !== this) {\n doc.transact(() => {\n type.applyDelta(ops)\n }, this)\n }\n }\n // always check selection\n if (awareness && quillCursors) {\n const sel = quill.getSelection()\n const aw = /** @type {any} */ (awareness.getLocalState())\n if (sel === null) {\n if (awareness.getLocalState() !== null) {\n awareness.setLocalStateField('cursor', /** @type {any} */ (null))\n }\n } else {\n const anchor = Y.createRelativePositionFromTypeIndex(type, sel.index)\n const head = Y.createRelativePositionFromTypeIndex(type, sel.index + sel.length)\n if (!aw || !aw.cursor || !Y.compareRelativePositions(anchor, aw.cursor.anchor) || !Y.compareRelativePositions(head, aw.cursor.head)) {\n awareness.setLocalStateField('cursor', {\n anchor,\n head\n })\n }\n }\n // update all remote cursor locations\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n }\n }\n quill.on('editor-change', this._quillObserver)\n // This indirectly initializes _negatedUsedFormats.\n // Make sure that this call this after the _quillObserver is set.\n quill.setContents(type.toDelta(), this)\n // init remote cursors\n if (quillCursors !== null && awareness) {\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n awareness.on('change', this._awarenessChange)\n }\n }\n\n destroy () {\n this.type.unobserve(this._typeObserver)\n this.quill.off('editor-change', this._quillObserver)\n if (this.awareness) {\n this.awareness.off('change', this._awarenessChange)\n }\n }\n}\n", "// Generated by js_of_ocaml\n//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.8.2+5.8.2\n(function(a){typeof\nglobalThis!==\"object\"&&(this?b():(a.defineProperty(a.prototype,\"_T_\",{configurable:true,get:b}),_T_));function\nb(){var\nb=this||self;b.globalThis=b;delete\na.prototype._T_}}(Object));(function(a){require(\"quill/dist/quill.core.css\");require(\"quill/dist/quill.bubble.css\");require(\"quill/dist/quill.snow.css\")}(globalThis));(function(p){\"use strict\";var\nw=3850876,af=\"0\",aI=\" \",gA=\"compare: functional value\",gi=\"mkdir\",lo=\"synced\",cP=1000,la=\"delete\",Y=\"vendor/lwd/lib/lwd/lwd_seq.pp.ml\",kI=\"@[\",kV=\"console\",lw=\"window\",a2=\"int_of_string\",gb=\"fs\",kw=\"%u\",lv=\"/static/\",k$=\"%i\",lF=\"%ni\",a1=0xff,gh=749039939,kH=\"Assert_failure\",kv=\"camlinternalMod.ml\",aJ=737455525,k_=\"0x\",ku=0x7ff0,lE=218,k9=0xdfff,kt=\"End_of_file\",lu=\"OCAMLRUNPARAM\",kG=253,k8=\": closedir failed\",lD=\"Out_of_memory\",kF=553,k7=\"Not_found\",gD=\"Failure\",d6=\"Unix.Unix_error\",k6=\"style\",bE=244,ln=\"^\",b8=\"text\",kU=\"length\",lm=\"green\",gw=\"ENOTDIR\",kE=\"Lwd_seq.rank: node is marked\",bD=936573133,k5=\"%Li\",kd=\"Invalid_argument\",k4=\"flex\",d4=254,b9=\"+\",dY=\"Set.bal\",lC=\", characters \",aH=0xffffff,ks=858694086,kD=120,kC=1027,cL=1024,d1=\"Map.bal\",bg=246,ll=\"Pervasives.do_at_exit\",lt=389604418,kr=65536,kc=\"submit\",c=\"vendor/brr_lwd_ui/examples/yjs/main.ml\",U=16620,gv=0xf,dW=512,ge=-588596599,k3=\", \",kT=\"closedir\",lB=\"Match_failure\",ka=\"%li\",kb=1026,j$=157,j_=\"b\",ga=\"nan\",e=\"\",f$=\"rmdir\",gg=\"Fatal error: exception \",kq=\"infinity\",L=\"camlinternalFormat.ml\",lj=571,lk=\"fd \",kR=\"append\",kS=\": \",j9=174,q=248,kp=\"em\",ko=\"data\",kQ=0xe0,aL=24029,li=0xf0,kn=\"Sys_error\",as=0x80,gu=\"vendor/brr_lwd_ui/bindings/yjs/doc.ml\",ls=\"ENOTEMPTY\",lA=\"EEXIST\",gz=1255,k2=\"checkbox\",dV=\"value\",kP=\"px\",gn=\" : flags Open_text and Open_binary are not compatible\",gt=\"e\",kB=\"Stack_overflow\",gm=\": Not a directory\",gs=\"ENOENT\",gd=-605101559,T=15681,kO=\"Undefined_recursive_module\",lh=\"Array\",kN=2147483647,lg=544,aA=0x8000,dX=\"table\",cO=\"string\",km=0x800,lr=-48,j8=\" : is a directory\",kl=\"@{\",k1=\"error\",lf=\"Division_by_zero\",j7=\"classList\",bf=\".\",kk=\"(Program not linked with -g, cannot print stack backtrace)\\n\",bh=0x3f,bB=\"name\",lq=\"red\",be=737456202,gc=\" : file already exists\",bz=128,d5=\": No such file or directory\",kj=\"vendor/lwd/lib/brr-lwd/elwd.ml\",le=255,dU=\"lwd-to-remove\",cM=256,dT=\"checked\",ki=\"id\",cN=-976970511,gr=100,f_=\"index out of bounds\",lp=-937474657,aK=\"/\",kM=\"height: \",gl=504440814,d3=252,f9=\"%d\",k0=\"lwdui-virtual-table-row\",kY=\"bold\",kZ=\": file descriptor already closed\",bA=\"-\",f8=\"EBADF\",kh=\"changes\",a0=951901561,kg=102,gq=-97,lz=\"Printexc.handle_uncaught_exception\",kX=12520,gC=\" : flags Open_rdonly and Open_wronly are not compatible\",a=\"vendor/lwd/lib/lwd/lwd_table.ml\",kL=499,gy=756711075,kA=\"Fatal error: exception %s\\n\",gp=4100401,ly=\"class\",j6=\"\\xe2\\x9d\\x8c\",aZ=250,kf=199,d0=\"bool\",gk=82908052,gB=\"kind\",bC=611392745,go=\"cell\",kK=\">\",ld=\"([^/]+)\",kz=\"input\",gf=\"jsError\",j5=103,gj=127,d2='\"',aB=0xffff,gx=737308346,ke=\"documentElement\",kJ=\"Sys_blocked_io\",kW=0xdc00,b=\"vendor/lwd/lib/lwd/lwd.ml\",ky=\"not implemented\",lc=\"Form submitted:\",lx=\"_\",f7=\"target\",kx=\"rem\",dZ=\"_bigarr02\",lb=-101336657;function\nA2(a,b,c,d,e){if(d<=b)for(var\nf=1;f<=e;f++)c[d+f]=a[b+f];else\nfor(var\nf=e;f>=1;f--)c[d+f]=a[b+f];return 0}function\nA3(a,b,c){var\nd=new\nArray(c+1);d[0]=0;for(var\ne=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function\ngE(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function\nA4(a,b){var\nc=a[1];a[1]+=b;return c}function\ngF(a){return a[1]}function\nmm(a){var\nb=p.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(p.jsoo_static_env&&p.jsoo_static_env[a])return p.jsoo_static_env[a]}var\ngZ=0;(function(){var\nc=mm(lu);if(c!==undefined){var\nb=c.split(\",\");for(var\na=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new\nd(a,b,c)};d.prototype.add=function(a){var\nb=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.sub=function(a){var\nb=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.mul=function(a){var\nb=this.lo*a.lo,c=(b*l0|0)+this.mi*a.lo+this.lo*a.mi,e=(c*l0|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new\nd(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new\nd(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new\nd(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new\nd(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new\nd(this.lo<>24-a,this.hi<>24-a);if(a<48)return new\nd(0,this.lo<>48-a);return new\nd(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new\nd(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var\nc=this.hi<<16>>16;if(a<24)return new\nd(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var\nb=this.hi<<16>>31;if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&aB);return new\nd(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&aH;this.lo=this.lo<<1&aH};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aH;this.mi=(this.mi>>>1|this.hi<<23)&aH;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var\ne=0,c=this.copy(),b=a.copy(),f=new\nd(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var\nb=this;if(a.isZero())mf();var\nd=b.hi^a.hi;if(b.hi&aA)b=b.neg();if(a.hi&aA)a=a.neg();var\nc=b.udivmod(a).quotient;if(d&aA)c=c.neg();return c};d.prototype.mod=function(a){var\nb=this;if(a.isZero())mf();var\nd=b.hi;if(b.hi&aA)b=b.neg();if(a.hi&aA)a=a.neg();var\nc=b.udivmod(a).modulus;if(d&aA)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&a1,this.mi>>16,this.mi>>8&a1,this.mi&a1,this.lo>>16,this.lo>>8&a1,this.lo&a1]};d.prototype.lo32=function(){return this.lo|(this.mi&a1)<<24};d.prototype.hi32=function(){return this.mi>>>8&aB|this.hi<<16};function\nBv(a,b){return new\nd(a&aH,a>>>24&a1|(b&aB)<<8,b>>>16&aB)}function\ngQ(a){return a.hi32()}function\ngR(a){return a.lo32()}function\ncR(){G(f_)}var\nA6=dZ;function\nbi(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bi.prototype.caml_custom=A6;bi.prototype.offset=function(a){var\nc=0;if(typeof\na===\"number\")a=[a];if(!(a\ninstanceof\nArray))G(\"bigarray.js: invalid offset\");if(this.dims.length!=a.length)G(\"Bigarray.get/set: bad number of dimensions\");if(this.layout==0)for(var\nb=0;b=this.dims[b])cR();c=c*this.dims[b]+a[b]}else\nfor(var\nb=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])cR();c=c*this.dims[b]+(a[b]-1)}return c};bi.prototype.get=function(a){switch(this.kind){case\n7:var\nd=this.data[a*2+0],b=this.data[a*2+1];return Bv(d,b);case\n10:case\n11:var\ne=this.data[a*2+0],c=this.data[a*2+1];return[d4,e,c];default:return this.data[a]}};bi.prototype.set=function(a,b){switch(this.kind){case\n7:this.data[a*2+0]=gR(b);this.data[a*2+1]=gQ(b);break;case\n10:case\n11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};bi.prototype.fill=function(a){switch(this.kind){case\n7:var\nc=gR(a),e=gQ(a);if(c==e)this.data.fill(c);else\nfor(var\nb=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case\n7:for(var\nc=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case\n2:case\n3:case\n4:case\n5:case\n6:case\n8:case\n9:case\n12:for(var\nc=0;ca.data[c])return 1}break}return 0};function\nb_(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}b_.prototype=new\nbi();b_.prototype.offset=function(a){if(typeof\na!==\"number\")if(a\ninstanceof\nArray&&a.length==1)a=a[0];else\nG(\"Ml_Bigarray_c_1_1.offset\");if(a<0||a>=this.dims[0])cR();return a};b_.prototype.get=function(a){return this.data[a]};b_.prototype.set=function(a,b){this.data[a]=b;return 0};b_.prototype.fill=function(a){this.data.fill(a);return 0};function\ngG(a,b,c,d){var\ne=lK(a);if(d8(c)*e!=d.length)G(\"length doesn't match dims\");if(b==0&&c.length==1&&e==1)return new\nb_(a,b,c,d);return new\nbi(a,b,c,d)}function\ngT(a){return a.slice(1)}function\nA5(a,b,c){var\nd=gT(c),e=lI(a,d8(d));return gG(a,b,d,e)}function\ncS(a,b,c){a.set(a.offset(b),c);return 0}function\nc0(a,b,c){var\nd=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var\nf=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?c0(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?c0(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)ea(c);var\ng=a.c,h=c.c;if(a.t==4)if(d<=b)for(var\nf=0;f=0;f--)h[d+f]=g[b+f];else{var\ni=Math.min(e,g.length-b);for(var\nf=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function\ncV(a){if(a.t==2)a.c+=b$(a.l-a.c.length,\"\\0\");else\na.c=c0(a.c,0,a.c.length);a.t=0}function\ng2(a){if(a.length<24){for(var\nb=0;bgj)return false;return true}else\nreturn!/[^\\x00-\\x7f]/.test(a)}function\nmk(a){for(var\nk=e,d=e,h,g,i,b,c=0,j=a.length;cdW){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else\nd+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+=\"\\ufffd\"}else if(b>aB)d+=String.fromCharCode(0xd7c0+(b>>10),kW+(b&0x3FF));else\nd+=String.fromCharCode(b);if(d.length>cL){d.substr(0,1);k+=d;d=e}}return k+d}function\na3(a,b,c){this.t=a;this.c=b;this.l=c}a3.prototype.toString=function(){switch(this.t){case\n9:return this.c;default:cV(this);case\n0:if(g2(this.c)){this.t=9;return this.c}this.t=8;case\n8:return this.c}};a3.prototype.toUtf16=function(){var\na=this.toString();if(this.t==9)return a;return mk(a)};a3.prototype.slice=function(){var\na=this.t==4?this.c.slice():this.c;return new\na3(this.t,a,this.l)};function\nlN(a){return new\na3(0,a,a.length)}function\naM(a){return a}function\nbj(a){return lN(aM(a))}function\ncT(a,b,c,d,e){a4(bj(a),b,c,d,e);return 0}function\nd9(){G(f_)}function\nbG(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case\n0:return a.c.charCodeAt(b);case\n4:return a.c[b]}}function\nA_(a,b){if(b>>>0>=a.l)d9();return bG(a,b)}function\nbH(a){return new\nd(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function\nA$(a,b){if(b>>>0>=a.l-7)d9();var\nd=new\nArray(8);for(var\nc=0;c<8;c++)d[7-c]=bG(a,b+c);return bH(d)}function\nB(a,b,c){c&=a1;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}ea(a)}a.c[b]=c;return 0}function\nat(a,b,c){if(b>>>0>=a.l)d9();return B(a,b,c)}function\nbI(a){return a.toArray()}function\nlO(a,b,c){if(b>>>0>=a.l-7)d9();var\ne=bI(c);for(var\nd=0;d<8;d++)B(a,b+7-d,e[d]);return 0}function\nbk(d,c){var\nf=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var\na=d.apply(null,c.slice(0,f));if(typeof\na!==\"function\")return a;return bk(a,c.slice(f))}else{switch(b){case\n1:{var\na=function(a){var\nf=new\nArray(e+1);for(var\nb=0;b>>0>=a.length-1)cR();return a}function\nBa(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function\nl5(a){return a==245?1:0}var\nCd=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function\nCc(a){if(Cd)return Math.floor(Math.log2(a));var\nb=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else\nwhile(a<1){a*=2;b--}return b}function\ngN(a){var\nb=new\nFloat32Array(1);b[0]=a;var\nc=new\nInt32Array(b.buffer);return c[0]|0}function\nao(a,b,c){return new\nd(a,b,c)}function\ned(a){if(!isFinite(a)){if(isNaN(a))return ao(1,0,ku);return a>0?ao(0,0,ku):ao(0,0,0xfff0)}var\nf=a==0&&1/a==-Infinity?aA:a>=0?0:aA;if(f)a=-a;var\nb=Cc(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-kb)}else{a/=Math.pow(2,b-kC);if(a<16){a*=2;b-=1}if(b==0)a/=2}var\nd=Math.pow(2,24),c=a|0;a=(a-c)*d;var\ne=a|0;a=(a-e)*d;var\ng=a|0;c=c&gv|f|b<<4;return ao(g,e,c)}function\nlM(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==dZ)for(var\nd=0;d>4;if(d==2047)return(f|g|c&gv)==0?c&aA?-Infinity:Infinity:NaN;var\ne=Math.pow(2,-24),b=(f*e+g)*e+(c&gv);if(d>0){b+=16;b*=Math.pow(2,d-kC)}else\nb*=Math.pow(2,-kb);if(c&aA)b=-b;return b}function\nS(a){if(!V.Failure)V.Failure=[q,ah(gD),-3];gY(V.Failure,a)}function\nlJ(a,b,c){var\nk=a.read32s();if(k<0||k>16)S(\"input_value: wrong number of bigarray dimensions\");var\nr=a.read32s(),l=r&a1,q=r>>8&1,j=[];if(c==dZ)for(var\nd=0;d>>32-15;b=cZ(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function\nBp(a,b){a=W(a,gR(b));a=W(a,gQ(b));return a}function\ngL(a,b){return Bp(a,ed(b))}function\nlL(a){var\nc=d8(a.dims),d=0;switch(a.kind){case\n2:case\n3:case\n12:if(c>cM)c=cM;var\ne=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=W(d,e)}e=0;switch(c&3){case\n3:e=a.data[b+2]<<16;case\n2:e|=a.data[b+1]<<8;case\n1:e|=a.data[b+0];d=W(d,e)}break;case\n4:case\n5:if(c>bz)c=bz;var\ne=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=W(d,e)}if((c&1)!=0)d=W(d,a.data[b]);break;case\n6:if(c>64)c=64;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;c*=2;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;for(var\nb=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function\nef(a){return typeof\na===\"string\"&&!/[^\\x00-\\xff]/.test(a)}function\nee(a){return a\ninstanceof\na3}function\nlQ(a){if(typeof\na===\"number\")return cP;else if(ee(a))return d3;else if(ef(a))return 1252;else if(a\ninstanceof\nArray&&a[0]===a[0]>>>0&&a[0]<=le){var\nb=a[0]|0;return b==d4?0:b}else if(a\ninstanceof\nString)return kX;else if(typeof\na==\"string\")return kX;else if(a\ninstanceof\nNumber)return cP;else if(a&&a.caml_custom)return gz;else if(a&&a.compare)return 1256;else if(typeof\na==\"function\")return 1247;else if(typeof\na==\"symbol\")return 1251;return 1001}function\nl3(a,b){if(ab?1:0}function\nA9(a,b){a.t&6&&cV(a);b.t&6&&cV(b);return a.cb.c?1:0}function\nd$(a,b,c){var\nf=[];for(;;){if(!(c&&a===b)){var\ne=lQ(a);if(e==aZ){a=a[1];continue}var\ng=lQ(b);if(g==aZ){b=b[1];continue}if(e!==g){if(e==cP){if(g==gz)return lP(a,b,-1,c);return-1}if(g==cP){if(e==gz)return lP(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case\n1001:if(ab)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case\n1251:if(a!==b){if(!c)return NaN;return 1}break;case\n1252:var\na=aM(a),b=aM(b);if(a!==b){if(ab)return 1}break;case\n12520:var\na=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case\n246:case\n254:default:if(l5(e)){G(\"compare: continuation value\");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var\nh=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=b$(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)ea(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var\nc=/^ *([+-]?)0x([0-9a-f]+)\\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var\nd=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;S(\"float_of_string\")}function\ngX(a){a=aM(a);var\ne=a.length;if(e>31)G(\"format_int: format too long\");var\nb={justify:b9,signstyle:bA,filler:aI,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:\"f\"};for(var\nd=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case\".\":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case\"d\":case\"i\":b.signedconv=true;case\"u\":b.base=10;break;case\"x\":b.base=16;break;case\"X\":b.base=16;b.uppercase=true;break;case\"o\":b.base=8;break;case\"e\":case\"f\":case\"g\":b.signedconv=true;b.conv=c;break;case\"E\":case\"F\":case\"G\":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function\ngJ(a,b){if(a.uppercase)b=b.toUpperCase();var\nf=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=bA))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var\nc=e;if(a.justify==b9&&a.filler==aI)for(var\nd=f;d20){c-=20;a/=Math.pow(10,c);a+=new\nArray(c+1).join(af);if(b>0)a=a+bf+new\nArray(b+1).join(af);return a}else\nreturn a.toFixed(b)}}var\nc,f=gX(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=ga;f.filler=aI}else if(!isFinite(b)){c=\"inf\";f.filler=aI}else\nswitch(f.conv){case\"e\":var\nc=b.toExponential(e),d=c.length;if(c.charAt(d-3)==gt)c=c.slice(0,d-1)+af+c.slice(d-1);break;case\"f\":c=j(b,e);break;case\"g\":e=e?e:1;c=b.toExponential(e-1);var\ni=c.indexOf(gt),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var\nd=i-1;while(c.charAt(d)==af)d--;if(c.charAt(d)==bf)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==gt)c=c.slice(0,d-1)+af+c.slice(d-1);break}else{var\ng=e;if(h<0){g-=h+1;c=b.toFixed(g)}else\nwhile(c=b.toFixed(g),c.length>e+1)g--;if(g){var\nd=c.length-1;while(c.charAt(d)==af)d--;if(c.charAt(d)==bf)d--;c=c.slice(0,d+1)}}break}return gJ(f,c)}function\nec(a,b){if(aM(a)==f9)return ah(e+b);var\nc=gX(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else\nb>>>=0;var\nd=b.toString(c.base);if(c.prec>=0){c.filler=aI;var\nf=c.prec-d.length;if(f>0)d=b$(f,af)+d}return gJ(c,d)}var\nBX=0;function\nag(){return BX++}function\nH(a){if(g2(a))return a;return mk(a)}function\nc1(){return typeof\np.process!==\"undefined\"&&typeof\np.process.versions!==\"undefined\"&&typeof\np.process.versions.node!==\"undefined\"}function\nCe(){function\na(a){if(a.charAt(0)===aK)return[e,a.substring(1)];return}function\nb(a){var\nh=/^([a-zA-Z]:|[\\\\/]{2}[^\\\\/]+[\\\\/]+[^\\\\/]+)?([\\\\/])?([\\s\\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==\":\");if(Boolean(b[2]||f)){var\nd=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return c1()&&p.process&&p.process.platform?p.process.platform===\"win32\"?b:a:a}var\ng3=Ce();function\nmi(a){return a.slice(-1)!==aK?a+aK:a}if(c1()&&p.process&&p.process.cwd)var\ncW=p.process.cwd().replace(/\\\\/g,aK);else\nvar\ncW=\"/static\";cW=mi(cW);function\nBM(a){a=H(a);if(!g3(a))a=cW+a;var\ne=g3(a),d=e[1].split(aK),b=[];for(var\nc=0;c1)b.pop();break;case\".\":break;case\"\":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function\nB6(a){for(var\ng=e,c=g,b,i,d=0,h=a.length;ddW){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else\nc+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(as|b&bh)}else if(b<0xd800||b>=k9)c+=String.fromCharCode(kQ|b>>12,as|b>>6&bh,as|b&bh);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))k9)c+=\"\\xef\\xbf\\xbd\";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(li|b>>18,as|b>>12&bh,as|b>>6&bh,as|b&bh)}if(c.length>cL){c.substr(0,1);g+=c;c=e}}return g+c}function\naw(a){return g2(a)?ah(a):ah(B6(a))}var\nCf=[\"E2BIG\",\"EACCES\",\"EAGAIN\",f8,\"EBUSY\",\"ECHILD\",\"EDEADLK\",\"EDOM\",lA,\"EFAULT\",\"EFBIG\",\"EINTR\",\"EINVAL\",\"EIO\",\"EISDIR\",\"EMFILE\",\"EMLINK\",\"ENAMETOOLONG\",\"ENFILE\",\"ENODEV\",gs,\"ENOEXEC\",\"ENOLCK\",\"ENOMEM\",\"ENOSPC\",\"ENOSYS\",gw,ls,\"ENOTTY\",\"ENXIO\",\"EPERM\",\"EPIPE\",\"ERANGE\",\"EROFS\",\"ESPIPE\",\"ESRCH\",\"EXDEV\",\"EWOULDBLOCK\",\"EINPROGRESS\",\"EALREADY\",\"ENOTSOCK\",\"EDESTADDRREQ\",\"EMSGSIZE\",\"EPROTOTYPE\",\"ENOPROTOOPT\",\"EPROTONOSUPPORT\",\"ESOCKTNOSUPPORT\",\"EOPNOTSUPP\",\"EPFNOSUPPORT\",\"EAFNOSUPPORT\",\"EADDRINUSE\",\"EADDRNOTAVAIL\",\"ENETDOWN\",\"ENETUNREACH\",\"ENETRESET\",\"ECONNABORTED\",\"ECONNRESET\",\"ENOBUFS\",\"EISCONN\",\"ENOTCONN\",\"ESHUTDOWN\",\"ETOOMANYREFS\",\"ETIMEDOUT\",\"ECONNREFUSED\",\"EHOSTDOWN\",\"EHOSTUNREACH\",\"ELOOP\",\"EOVERFLOW\"];function\na6(a,b,c,d){var\nf=Cf.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var\ng=[f,aw(b||e),aw(c||e)];return g}var\nma={};function\nbm(a){return ma[a]}function\na5(a,b){throw g([0,a].concat(b))}function\ngH(a){if(!(a\ninstanceof\nUint8Array))a=new\nUint8Array(a);return new\na3(4,a,a.length)}function\nm(a){gY(V.Sys_error,a)}function\nme(a){m(a+d5)}function\ng1(a){if(a.t!=4)ea(a);return a.c}function\nau(a){return a.l}function\nlG(){}function\nZ(a){this.data=a}Z.prototype=new\nlG();Z.prototype.constructor=Z;Z.prototype.truncate=function(a){var\nb=this.data;this.data=C(a|0);a4(b,0,this.data,0,a)};Z.prototype.length=function(){return au(this.data)};Z.prototype.write=function(a,b,c,d){var\ne=this.length();if(a+d>=e){var\nf=C(a+d),g=this.data;this.data=f;a4(g,0,this.data,0,e)}a4(gH(b),c,this.data,a,d);return 0};Z.prototype.read=function(a,b,c,d){var\ne=this.length();if(a+d>=e)d=e-a;if(d){var\nf=C(d|0);a4(this.data,a,f,0,d);b.set(g1(f),c)}return d};function\nbF(a,b,c){this.file=b;this.name=a;this.flags=c}bF.prototype.err_closed=function(){m(this.name+kZ)};bF.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};bF.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};bF.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};bF.prototype.close=function(){this.file=undefined};function\nO(a,b){this.content={};this.root=a;this.lookupFun=b}O.prototype.nm=function(a){return this.root+a};O.prototype.create_dir_if_needed=function(a){var\nd=a.split(aK),c=e;for(var\nb=0;b>>16;a=cZ(a,0x85ebca6b|0);a^=a>>>13;a=cZ(a,0xc2b2ae35|0);a^=a>>>16;return a}function\nBl(a,b,c,d){var\nj,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cM)h=cM;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(cX[e.caml_custom]&&cX[e.caml_custom].hash){var\nn=cX[e.caml_custom].hash(e);f=W(f,n);g--}}else if(e\ninstanceof\nArray&&e[0]===(e[0]|0))switch(e[0]){case\n248:f=W(f,e[2]);g--;break;case\n250:j[--k]=e[1];break;default:if(l5(e[0]))break;var\no=e.length-1<<10|e[0];f=W(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(ee(e)){f=Bm(f,e);g--}else if(ef(e)){f=Bq(f,e);g--}else if(typeof\ne===\"string\"){f=gM(f,e);g--}else if(e===(e|0)){f=W(f,e+e+1);g--}else if(typeof\ne===\"number\"){f=gL(f,e);g--}}f=Bo(f);return f&0x3FFFFFFF}function\nBr(a,b,c){if(!isFinite(a)){if(isNaN(a))return aw(ga);return aw(a>0?kq:\"-infinity\")}var\nk=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var\nf=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else\nwhile(a>=2){a/=2;f++}var\nl=f<0?e:b9,g=e;if(k)g=bA;else\nswitch(c){case\n43:g=b9;break;case\n32:g=aI;break;default:break}if(b>=0&&b<13){var\ni=Math.pow(2,b*4);a=Math.round(a*i)/i}var\nd=a.toString(16);if(b>=0){var\nj=d.indexOf(bf);if(j<0)d+=bf+b$(b,af);else{var\nh=j+1+b;if(d.length>24&aH,a>>31&aB)}function\nl2(a){return a.toInt()}function\nBy(a){return+a.isNeg()}function\nlY(a){return a.neg()}function\nBw(a,b){var\nc=gX(a);if(c.signedconv&&By(b)){c.sign=-1;b=lY(b)}var\nd=e,i=cY(c.base),h=\"0123456789abcdef\";do{var\ng=b.udivmod(i);b=g.quotient;d=h.charAt(l2(g.modulus))+d}while(!Bz(b));if(c.prec>=0){c.filler=aI;var\nf=c.prec-d.length;if(f>0)d=b$(f,af)+d}return gJ(c,d)}function\nl1(a,b){return a.or(b)}function\nmc(a){var\nb=0,e=n(a),c=10,d=1;if(e>0)switch(_(a,b)){case\n45:b++;d=-1;break;case\n43:b++;d=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function\nl4(a){var\nh=mc(a),d=h[0],i=h[1],e=h[2],g=n(a),j=-1>>>0,f=d=e)S(a2);var\nb=c;for(d++;d=e)break;b=e*b+c;if(b>j)S(a2)}if(d!=g)S(a2);b=i*b;if(e==10&&(b|0)!=b)S(a2);return b|0}function\neg(a,b,c){return a[H(b)].apply(a,gT(c))}function\nl6(a,b){switch(b.length){case\n1:return new\na;case\n2:return new\na(b[1]);case\n3:return new\na(b[1],b[2]);case\n4:return new\na(b[1],b[2],b[3]);case\n5:return new\na(b[1],b[2],b[3],b[4]);case\n6:return new\na(b[1],b[2],b[3],b[4],b[5]);case\n7:return new\na(b[1],b[2],b[3],b[4],b[5],b[6]);case\n8:return new\na(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function\nc(){return a.apply(this,gT(b))}c.prototype=a.prototype;return new\nc}function\ngU(a){var\nc={};for(var\nb=1;b>>0&&gW(a,bg,bE)?0:1}function\nl7(a){gW(a,bE,aZ);return 0}function\nBK(a,b){return+(d$(a,b,false)<0)}function\nBL(a){var\nb=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function\nmb(a){return ah(a)}function\nlW(a,b){return a.add(b)}function\nlX(a,b){return a.mul(b)}function\ngS(a,b){return a.ucompare(b)<0}function\nlZ(a){var\nh=mc(a),g=h[0],j=h[1],e=h[2],i=cY(e),k=new\nd(aH,0xfffffff,aB).udivmod(i).quotient,f=_(a,g),b=eh(f);if(b<0||b>=e)S(a2);var\nc=cY(b);for(;;){g++;f=_(a,g);if(f==95)continue;b=eh(f);if(b<0||b>=e)break;if(gS(k,c))S(a2);b=cY(b);c=lW(lX(i,c),b);if(gS(c,b))S(a2)}if(g!=n(a))S(a2);if(e==10&&gS(new\nd(0,0,aA),c))S(a2);if(j<0)c=lY(c);return c}function\nA7(a,b){return a.get(a.offset(b))}function\nBE(a,b){return a.xor(b)}function\nBC(a,b){return a.shift_right_unsigned(b)}function\nBB(a,b){return a.shift_left(b)}function\nl8(a){function\no(a,b){return BB(a,b)}function\nh(a,b){return BC(a,b)}function\ns(a,b){return l1(a,b)}function\nf(a,b){return BE(a,b)}function\nk(a,b){return lW(a,b)}function\ni(a,b){return lX(a,b)}function\nm(a,b){return s(o(a,b),h(a,64-b))}function\ng(a,b){return A7(a,b)}function\nj(a,b,c){return cS(a,b,c)}var\nq=lZ(mb(\"0xd1342543de82ef95\")),l=lZ(mb(\"0xdaba0b6eb09322e3\")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var\nd=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function\nap(a,b){if(a<0)cR();var\na=a+1|0,c=new\nArray(a);c[0]=0;for(var\nd=1;d>>32-e,c)}function\ng(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function\nh(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function\ni(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function\nj(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var\nc=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function\nA1(a,b,c){var\ne=a.len&bh,d=0;a.len+=c;if(e){var\nf=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);d7(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function\nAZ(a){var\nc=a.len&bh;a.b8[c]=as;c++;if(c>56){for(var\nb=c;b<64;b++)a.b8[b]=0;d7(a.w,a.b32);for(var\nb=0;b<56;b++)a.b8[b]=0}else\nfor(var\nb=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;d7(a.w,a.b32);var\ne=new\nUint8Array(16);for(var\nd=0;d<4;d++)for(var\nb=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function\nB2(a){return ah(c0(a,0,a.length))}function\nBN(a,b,c){var\nd=A0(),e=g1(a);A1(d,e.subarray(b,b+c),c);return B2(AZ(d))}function\nBO(a,b,c){return BN(bj(a),b,c)}function\nBQ(){return 0}var\nbl=new\nArray();function\nl9(a){return bl[a]}function\nbK(a){var\nb=l9(a);if(!b.opened)m(\"Cannot flush a closed channel\");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(c0(b.buffer,0,b.buffer_curr));else\nb.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function\nB4(a,b){if(b.name)try{var\nd=require(gb),c=d.openSync(b.name,\"rs\");return new\naC(c,b)}catch(f){}return new\naC(a,b)}var\nek=new\nArray(3);function\ncQ(a,b){Z.call(this,C(0));this.log=function(a){return 0};if(a==1&&typeof\nconsole.log==\"function\")this.log=console.log;else if(a==2&&typeof\nconsole.error==\"function\")this.log=console.error;else if(typeof\nconsole.log==\"function\")this.log=console.log;this.flags=b}cQ.prototype.length=function(){return 0};cQ.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var\ne=C(d);a4(gH(b),c,e,0,d);this.log(e.toUtf16());return 0}m(this.fd+kZ)};cQ.prototype.read=function(a,b,c,d){m(this.fd+\": file descriptor is write only\")};cQ.prototype.close=function(){this.log=undefined};function\nel(a,b){if(b==undefined)b=ek.length;ek[b]=a;return b|0}function\nCh(a,b,c){var\nd={};while(b){switch(b[1]){case\n0:d.rdonly=1;break;case\n1:d.wronly=1;break;case\n2:d.append=1;break;case\n3:d.create=1;break;case\n4:d.truncate=1;break;case\n5:d.excl=1;break;case\n6:d.binary=1;break;case\n7:d.text=1;break;case\n8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)m(aM(a)+gC);if(d.text&&d.binary)m(aM(a)+gn);var\ne=mn(a),f=e.device.open(e.rest,d);return el(f,undefined)}(function(){function\na(a,b){return c1()?B4(a,b):new\ncQ(a,b)}el(a(0,{rdonly:1,altname:\"/dev/stdin\",isCharacterDevice:true}),0);el(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);el(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function\nBR(a){var\nb=ek[a];if(b.flags.wronly)m(lk+a+\" is writeonly\");var\nd=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new\nUint8Array(kr),refill:d};bl[c.fd]=c;return c.fd}function\nl_(a){var\nb=ek[a];if(b.flags.rdonly)m(lk+a+\" is readonly\");var\nd=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new\nUint8Array(kr),buffered:d};bl[c.fd]=c;return c.fd}function\nBS(){var\nb=0;for(var\na=0;ae.buffer.length){var\ng=new\nUint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case\n0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;bK(a);break;case\n1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bK(a);break;case\n2:var\nf=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bK(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;bK(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function\nBT(a,b,c,d){var\nb=g1(b);return BU(a,b,c,d)}function\ngV(a,b,c,d){return BT(a,bj(b),c,d)}function\nl$(a,b){var\nc=ah(String.fromCharCode(b));gV(a,c,0,1);return 0}function\nbL(a,b){return+(d$(a,b,false)!=0)}function\nBW(a,b){var\nd=new\nArray(b+1);d[0]=a;for(var\nc=1;c<=b;c++)d[c]=0;return d}function\naN(a){if(a\ninstanceof\nArray&&a[0]==a[0]>>>0)return a[0];else if(ee(a))return d3;else if(ef(a))return d3;else if(a\ninstanceof\nFunction||typeof\na==\"function\")return 247;else if(a&&a.caml_custom)return le;else\nreturn cP}function\nA8(a){var\nc={};if(a)for(var\nb=1;b=0)a=e;else\nS(\"caml_register_global: cannot locate \"+d)}}V[a+1]=b;if(c)V[c]=b}function\ng0(a,b){ma[aM(a)]=b;return 0}function\nB1(){G(f_)}function\nD(a,b){if(b>>>0>=n(a))B1();return _(a,b)}function\nej(a){a.t&6&&cV(a);return ah(a.c)}function\nB3(){return 0x7FFFFFFF/4|0}function\nBY(){md(V.Not_found)}function\nmh(a){var\nb=mm(H(a));if(b===undefined)BY();return aw(b)}function\nB5(){if(p.crypto)if(p.crypto.getRandomValues){var\na=p.crypto.getRandomValues(new\nInt32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(p.crypto.randomBytes){var\na=new\nInt32Array(p.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var\nb=new\nDate().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function\nbM(a){var\nb=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function\nr(a,b){return{joo_tramp:a,joo_args:b}}function\nmj(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof\nb===\"function\"){a.fun=b;return 0}var\nc=b.length;while(c--)a[c]=b[c];return 0}function\nM(a){{if(a\ninstanceof\nArray)return a;var\nb;if(p.RangeError&&a\ninstanceof\np.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=V.Stack_overflow;else if(p.InternalError&&a\ninstanceof\np.InternalError&&a.message&&a.message.match(/too much recursion/i))b=V.Stack_overflow;else if(a\ninstanceof\np.Error&&bm(gf))b=[0,bm(gf),a];else\nb=[0,V.Failure,aw(String(a))];if(a\ninstanceof\np.Error)b.js_error=a;return b}}function\nB7(){return require(\"y-protocols/awareness.js\")}function\nB8(){return require(\"y-indexeddb\").IndexeddbPersistence}function\nB9(){return require(\"quill\").default}function\nB_(){return require(\"quill-cursors\")}function\nB$(){return require(\"y-webrtc\").WebrtcProvider}function\nCa(){return require(\"y-quill\")}function\nCb(){return require(\"yjs\")}function\nBF(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function\nBi(a){var\nb=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&BF(a[1]))var\nf=a[2],g=1;else\nvar\ng=2,f=a;b+=\"(\";for(var\nd=g;dg)b+=k3;var\nc=f[d];if(typeof\nc==\"number\")b+=c.toString();else if(c\ninstanceof\na3)b+=d2+c.toString()+d2;else if(typeof\nc==\"string\")b+=d2+c.toString()+d2;else\nb+=lx}b+=\")\"}else if(a[0]==q)b+=a[1];return b}function\nlT(a){if(a\ninstanceof\nArray&&(a[0]==0||a[0]==q)){var\nc=bm(lz);if(c)d_(c,[a,false]);else{var\nd=Bi(a),b=bm(ll);if(b)d_(b,[0]);console.error(gg+d);if(a.js_error)throw a.js_error}}else\nthrow a}function\nB0(){var\nc=p.process;if(c&&c.on)c.on(\"uncaughtException\",function(a,b){lT(a);c.exit(2)});else if(p.addEventListener)p.addEventListener(k1,function(a){if(a.error)lT(a.error)})}B0();function\nh(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):bk(a,[b])}function\ni(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):bk(a,[b,c])}function\ny(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):bk(a,[b,c,d])}function\nf6(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):bk(a,[b,c,d,e,f])}function\nAY(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):bk(a,[b,c,d,e,f,g,h])}var\nCg=undefined;Bj();var\nem=[q,lD,-1],g6=[q,kn,-2],cc=[q,gD,-3],cb=[q,kd,-4],aD=[q,k7,-7],g4=[q,lB,-8],g5=[q,kB,-9],f=[q,kH,-11],cd=[q,kO,-12],AX=[4,0,0,0,[12,45,[4,0,0,0,0]]],eP=[0,[11,'File \"',[2,0,[11,'\", line ',[4,0,0,0,[11,lC,[4,0,0,0,[12,45,[4,0,0,0,[11,kS,[2,0,0]]]]]]]]]],'File \"%s\", line %d, characters %d-%d: %s'],jQ=gB,by=\"content\",jW=\"columns\",jX=\"rows\",f0=ki,f1=gB,jY=bB,jZ=\"page_content\";av(11,cd,kO);av(10,f,kH);av(9,[q,kJ,-10],kJ);av(8,g5,kB);av(7,g4,lB);av(6,aD,k7);av(5,[q,lf,-6],lf);av(4,[q,kt,-5],kt);av(3,cb,kd);av(2,cc,gD);av(1,g6,kn);av(0,em,lD);var\nmy=\"output_substring\",mu=bf,mq=\"true\",mr=\"false\",mD=\"CamlinternalLazy.Undefined\",mJ=\"option is None\",mM=\"\\\\\\\\\",mN=\"\\\\'\",mO=\"\\\\b\",mP=\"\\\\t\",mQ=\"\\\\n\",mR=\"\\\\r\",m0=\"List.init\",mW=\"hd\",nf=\"String.blit / Bytes.blit_string\",ne=\"Bytes.blit\",nd=\"String.sub / Bytes.sub\",nq=\"String.contains_from / Bytes.contains_from\",nw=\"Array.blit\",nv=\"Array.sub\",nt=\"Array.init\",nD=[0,\"set.ml\",lj,18],nz=dY,nA=dY,nB=dY,nC=dY,nK=\"Map.remove_min_elt\",nG=d1,nH=d1,nI=d1,nJ=d1,nL=\"Stdlib.Stack.Empty\",nP=\"Stdlib.Queue.Empty\",nY=\"Buffer.add_substring/add_subbytes\",nW=\"Buffer.add: cannot grow buffer\",nU=\"Buffer.sub\",n5=\"first domain already spawned\",n2=[0,\"domain.ml\",184,13],oe=\"%c\",of=\"%s\",og=k$,oh=ka,oi=lF,oj=k5,ok=\"%f\",ol=\"%B\",om=\"%{\",on=\"%}\",oo=\"%(\",op=\"%)\",oq=\"%a\",or=\"%t\",os=\"%?\",ot=\"%r\",ou=\"%_r\",ov=[0,L,850,23],oG=[0,L,814,21],oy=[0,L,815,21],oH=[0,L,818,21],oz=[0,L,819,21],oI=[0,L,822,19],oA=[0,L,823,19],oJ=[0,L,826,22],oB=[0,L,827,22],oK=[0,L,831,30],oC=[0,L,832,30],oE=[0,L,836,26],ow=[0,L,837,26],oF=[0,L,846,28],ox=[0,L,847,28],oD=[0,L,851,23],pW=[0,L,1558,4],pX=\"Printf: bad conversion %[\",pY=[0,L,1626,39],pZ=[0,L,1649,31],p0=[0,L,1650,31],p1=\"Printf: bad conversion %_\",p2=kl,p3=kI,p4=kl,p5=kI,p9=[0,[11,\"invalid box description \",[3,0,0]],\"invalid box description %S\"],p8=[0,0,4],pR=ga,pP=\"neg_infinity\",pQ=kq,pO=bf,pJ=[0,j5],px=\"%+nd\",py=\"% nd\",pA=\"%+ni\",pB=\"% ni\",pC=\"%nx\",pD=\"%#nx\",pE=\"%nX\",pF=\"%#nX\",pG=\"%no\",pH=\"%#no\",pw=\"%nd\",pz=lF,pI=\"%nu\",pj=\"%+ld\",pk=\"% ld\",pm=\"%+li\",pn=\"% li\",po=\"%lx\",pp=\"%#lx\",pq=\"%lX\",pr=\"%#lX\",ps=\"%lo\",pt=\"%#lo\",pi=\"%ld\",pl=ka,pu=\"%lu\",o7=\"%+Ld\",o8=\"% Ld\",o_=\"%+Li\",o$=\"% Li\",pa=\"%Lx\",pb=\"%#Lx\",pc=\"%LX\",pd=\"%#LX\",pe=\"%Lo\",pf=\"%#Lo\",o6=\"%Ld\",o9=k5,pg=\"%Lu\",oT=\"%+d\",oU=\"% d\",oW=\"%+i\",oX=\"% i\",oY=\"%x\",oZ=\"%#x\",o0=\"%X\",o1=\"%#X\",o2=\"%o\",o3=\"%#o\",oS=f9,oV=k$,o4=kw,n8=\"@]\",n9=\"@}\",n_=\"@?\",n$=\"@\\n\",oa=\"@.\",ob=\"@@\",oc=\"@%\",od=\"@\",oL=\"CamlinternalFormat.Type_mismatch\",qc=e,qd=[0,[11,k3,[2,0,[2,0,0]]],\", %s%s\"],qP=[0,[11,gg,[2,0,[12,10,0]]],kA],qQ=[0,[11,\"Fatal error in uncaught exception handler: exception \",[2,0,[12,10,0]]],\"Fatal error in uncaught exception handler: exception %s\\n\"],qO=\"Fatal error: out of memory in uncaught exception handler\",qL=[0,[11,gg,[2,0,[12,10,0]]],kA],qF=[0,[2,0,[12,10,0]],\"%s\\n\"],qG=[0,[11,kk,0],kk],qu=\"Raised at\",qv=\"Re-raised at\",qw=\"Raised by primitive operation at\",qx=\"Called from\",qy=[0,[12,32,[4,0,0,0,0]],\" %d\"],qC=[0,[11,\"s \",[4,0,0,0,[12,45,[4,0,0,0,0]]]],\"s %d-%d\"],qz=\" (inlined)\",qB=e,qA=[0,[2,0,[12,32,[2,0,[11,' in file \"',[2,0,[12,34,[2,0,[11,\", line\",[2,0,[11,lC,AX]]]]]]]]]],'%s %s in file \"%s\"%s, line%s, characters %d-%d'],qD=[0,[2,0,[11,\" unknown location\",0]],\"%s unknown location\"],qn=\"Out of memory\",qo=\"Stack overflow\",qp=\"Pattern matching failed\",qq=\"Assertion failed\",qr=\"Undefined recursive module\",qf=[0,[12,40,[2,0,[2,0,[12,41,0]]]],\"(%s%s)\"],qg=e,qh=e,qi=[0,[12,40,[2,0,[12,41,0]]],\"(%s)\"],qb=[0,[4,0,0,0,0],f9],p$=[0,[3,0,0],\"%S\"],qa=lx,qI=[0,e,\"(Cannot print locations:\\n bytecode executable program file not found)\",\"(Cannot print locations:\\n bytecode executable program file appears to be corrupt)\",\"(Cannot print locations:\\n bytecode executable program file has wrong magic number)\",\"(Cannot print locations:\\n bytecode executable program file cannot be opened;\\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)\"],qU=\"Fun.Finally_raised: \",qS=\"Stdlib.Fun.Finally_raised\",qV=\"Digest.BLAKE2: wrong hash size\",q6=ao(14371852,15349651,22696),q7=ao(12230193,11438743,35013),q8=ao(1424933,15549263,2083),q9=ao(9492471,4696708,43520),qY=ao(1,0,0),qZ=ao(0,0,0),q2=ao(1,0,0),q0=ao(0,0,0),q1=ao(2,0,0),rf=\"Hashtbl: unsupported hash table format\",q$=e,rX=[3,0,3],rY=bf,rS=kK,rT=\"<\\/\",rU=e,rO=kK,rP=\"<\",rQ=e,rM=\"\\n\",rI=e,rJ=e,rK=e,rL=e,rv=[0,e],rq=e,rr=e,rs=e,rt=e,rm=[0,e,0,e],ri=\"Stdlib.Format.String_tag\",r7=[0,kv,72,5],r8=[0,kv,81,2],r9=\"CamlinternalMod.update_mod: not a module\",r5=\"CamlinternalMod.init_mod: not a module\",r_=\"Jsoo_runtime.Error.Exn\",r$=gf,sd=[0,b,j$,10],sf=[0,b,179,10],sh=[0,b,191,10],sk=[0,b,lE,17],st=[0,b,367,16],su=[0,b,368,18],sv=[0,b,372,15],sw=[0,b,377,15],sx=[0,b,383,15],sy=[0,b,386,10],sz=[0,b,362,16],sA=[0,b,517,12],sB=[0,b,459,14],sM=[0,b,686,27],sL=[0,b,651,27],sF=[0,b,560,16],sC=[0,b,550,23],sD=[0,b,lg,14],ss=[0,b,334,9],so=[0,b,309,9],sn=[0,b,305,9],sm=[0,[11,\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n\",[15,0]],\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n%a\"],sj=[0,b,kf,14],sg=[0,b,186,14],se=[0,b,169,14],sc=[0,b,152,14],sG=\"Lwd.Release_failure\",sU=[0,a,64,12],s4=[0,a,bz,21],tb=[0,a,205,18],ta=[0,a,lE,9],td=[0,a,224,18],tc=[0,a,237,9],te=[0,a,240,21],tf=[0,a,aZ,21],tg=[0,a,260,21],ti=[0,a,296,14],tG=[0,a,kF,18],tH=[0,a,557,12],tI=[0,a,546,14],tF=[0,a,538,21],tD=[0,a,531,14],tC=[0,a,523,14],tA=[0,a,492,29],tz=[0,a,kL,29],ty=[0,a,462,21],tt=[0,a,420,10],tu=[0,a,423,15],tv=[0,a,435,10],tw=[0,a,457,2],to=[0,a,371,24],tp=[0,a,391,16],tq=[0,a,394,2],tl=[0,a,315,18],tk=[0,a,317,9],s9=[0,a,193,4],s8=[0,a,kf,21],s6=[0,a,j9,4],s7=[0,a,177,14],s1=[0,a,113,14],sZ=[0,a,kg,14],sX=[0,a,93,14],sV=[0,a,82,21],sT=[0,a,39,4],sS=[0,a,45,21],sQ=[0,a,32,14],t$=[0,Y,lj,12],tW=[0,Y,321,37],tX=[0,Y,322,37],tZ=[0,Y,346,10],t0=[0,Y,358,8],tY=[0,Y,337,37],t2=[0,Y,375,10],t3=[0,Y,384,8],t1=[0,Y,338,37],t6=[0,Y,425,16],t9=[0,Y,513,50],t7=[0,Y,480,6],t5=[0,Y,395,14],tO=[0,Y,j9,57],tP=[0,Y,182,57],tQ=[0,Y,238,11],tJ=kE,tK=kE,uX=\"debug\",uW=\"warn\",uU=k1,uS=\"log\",u1=\"isSecureContext\",vg=[0,kj,233,16],ve=[0,kj,201,16],u$=[0,0,0],u9=[0,0,0],vN=e,vM=e,vC=[0,[0,T,lp],0],vD=[0,[0,T,gk],[0,aJ,0]],vE=[0,[0,T,ge],[0,aJ,0]],vF=[0,[0,T,gp],[0,aJ,0]],vG=[0,[0,T,gd],[0,aJ,0]],vH=[0,[0,T,gy],[0,aJ,0]],vI=[0,[0,T,gh],[0,aJ,0]],vJ=[0,[0,T,gx],[0,aJ,0]],vK=[0,[0,T,lp],[0,aJ,0]],vt=[0,[0,T,gk],0],vu=[0,[0,T,ge],0],vv=[0,lb,0],vw=[0,[0,T,gp],0],vx=[0,[0,T,gd],0],vy=[0,[0,T,gy],0],vz=[0,[0,T,gh],0],vA=[0,aJ,0],vB=[0,[0,T,gx],0],vr=[0,[11,\"\\x1b[\",[4,0,0,0,[12,109,0]]],\"\\x1b[%dm\"],vs=\"CCFormat.ANSI_codes.No_such_style\",vO=\"CCFormat.Style\",v7=[0,0],v8=\"CCFQueue.Empty\",v9=[0,0],wh=\"content-box\",wi=\"border-box\",wj=\"device-pixel-content-box\",ww=ky,wt=[0,[8,[0,0,0],0,0,[11,kP,0]],\"%fpx\"],wu=[0,[8,[0,0,0],0,0,[11,kx,0]],\"%frem\"],wv=[0,[8,[0,0,0],0,0,[11,kp,0]],\"%fem\"],wq=kP,wr=kx,ws=kp,wz=\"Common.Utils.Forward_ref.Not_set\",wB=\"Common.Utils.Forward_ref.Already_set\",wF=[1,[0,3854881,\"Failed to unmarshal data\"]],wH=[1,-358247754],wR=\"TODO not implemented\",wX=[0,80,[0,\"lwdui-controlled-scroll-wrapper\"]],wY=[0,80,\"lwdui-controlled-scroll-controls\"],wZ=\"Show playing\",w3=kc,w1=e,w2=b8,w6=[0,80,b8],w4=[0,[2,0,[11,\"--id\",0]],\"%s--id\"],w8=[0,[2,0,[11,\"-id\",0]],\"%s-id\"],w9=[0,80,k2],xj=[0,[11,kM,[2,0,0]],\"height: %s\"],xf=[0,[2,0,[12,32,[2,0,0]]],\"%s %s\"],xd=\"grid-template-columns\",xe=[0,[2,0,[11,kS,[2,0,[12,59,0]]]],\"%s: %s;\"],xg=e,xk=[1,4.],xp=[0,80,k0],xn=[0,[11,\"height: calc(\",[2,0,[11,\" * \",[4,3,0,0,[11,\");\",0]]]]],\"height: calc(%s * %i);\"],xo=[0,[11,kM,[2,0,[11,\" !important;\",0]]],\"height: %s !important;\"],xq=[0,80,[0,\"lwdui-lazy-table-content\"]],xr=[0,80,[0,\"lwdui-lazy-table-content-wrapper\"]],xs=[0,\"lwdui-lazy-table\",0],xJ=[0,[3,0,[11,\" is not a valid action\",0]],\"%S is not a valid action\"],xB=\"retain\",xC=\"insert\",xD=la,xE=[0,gu,72,22],xw=[0,[0,0,0,0,0,0,0]],xx=[0,gu,49,6],xy=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],xz=[0,gu,j$,6],xF=[0,[0,0,0,0,0,0,0]],xK=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],xX=\"color\",xY=bB,x0=bB,xZ=\"user\",ya=\"bcPeers\",yb=\"webrtcPeers\",yc=\"removed\",yd=\"added\",x_=\"status\",x$=lo,ye=\"peers\",x9=\"awareness\",x7=[0,[11,\"stun:\",[2,0,0]],\"stun:%s\"],x5=\"signaling\",x6=[0,\"stun.l.google.com:19302\",[0,\"stun2.l.google.com:19302\",[0,\"stun3.l.google.com:19302\",[0,\"stun4.l.google.com:19302\",0]]]],x8=\"peerOpts\",yq=\"toolbar\",yp=\"cursors\",yo=\"bubble\",yr=\"snow\",yi=kY,yj=\"italic\",yk=\"underline\",yl=\"strike\",ym=\"link\",yD=[0,[11,\"vector length is \",[4,0,0,0,[11,\", but data array has length \",[4,0,0,0,[11,\" (racy access?)\",0]]]]],\"vector length is %d, but data array has length %d (racy access?)\"],yB=[0,[11,\"index \",[4,0,0,0,[11,\" is out of range [0, \",[4,0,0,0,[12,41,0]]]]],\"index %d is out of range [0, %d)\"],yx=[0,[11,\"invalid segment (ofs = \",[4,0,0,0,[11,\", len = \",[4,0,0,0,[11,\") in a sequence of length \",[4,0,0,0,0]]]]]],\"invalid segment (ofs = %d, len = %d) in a sequence of length %d\"],yQ=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",AO=\"tbl\",AP=[0,\"Create new table:\",0],AK=ky,AL=[0,80,[0,dX]],AM=[0,80,[0,k4]],AF=\"Found\",AG=j6,AH=\"1fr\",AI=\"a\",AE=[2,5.],AC=[0,c,848,19],AB=[0,80,\"Add row\"],Au=[0,1],At=\"Add map with id \",Av=[0,1],Ay=e,Az=e,Aw=[0,be,1],Ax=[0,be,0],AA=[0,c,829,18],Aq=[0,c,777,25],Ap=e,Ar=[0,c,769,23],An=lc,Ao=\"Form valid:\",Ag=[0,0,0],Ah=[0,80,\"Add column\"],Ai=[0,[0,cO,\"String\"],[0,[0,d0,\"Checkbox\"],[0,[0,b8,\"Richtext\"],0]]],Aj=[0,gB,cO,0],Ak=[0,0],Al=[0,\"demo\"],Am=[0,1],Ad=\"DELETE ROW\",Ae=j6,Ac=[0,c,689,17],z9=[0,80,[0,go]],z_=[0,[0,0,[0,1,[0,2,0]]]],z$=[0,1],Aa=[0,0],z6=dT,z7=[0,80,[0,go]],z1=lc,z2=\" -> \",z0=[0,0],zY=[0,0],zZ=[0,80,\"Update\"],zU=e,zV=e,zW=[0,80,[0,\"cell-edit-btn\"]],zX=\"\\xe2\\x9c\\x8f\\xef\\xb8\\x8f\",z3=[0,80,[0,\"cell-edit-overlay\"]],z4=[0,80,[0,go]],zF=\"GET\",zE=[0,c,479,17],zD=[0,c,494,11],zI=[0,c,509,19],zH=[0,c,519,13],zG=[0,c,kL,13],zJ=[0,c,526,11],zP=[0,c,lg,19],zO=[0,c,539,19],zK=[0,c,532,13],zM=[0,c,548,15],zN=[0,c,552,15],zL=[0,c,kF,11],zR=e,zS=[0,c,565,17],zQ=[0,c,568,11],zy=bB,zz=ko,zs=\"New column kind:\",zq=[0,c,354,13],zm=d0,zn=b8,zo=dX,zp=cO,zi=\"Old value:\",zj=\"Action: delete\",zk=\"Key:\",zl=[0,c,279,15],zh=\"On_change\",zg=[0,c,204,22],ze=\"[blit v(%i) %i %i v'(%i)]\",zb=[0,c,147,18],y1=lm,y2=\"orange\",y3=lq,y0=\"Received peers\",yZ=\"Received synced\",yY=\"Received connected\",yT=\"modules/cursors\",yU=\"Narines\",yV=[0,[0,\"wss://p2p.u31.fr\",0]],yW=\"testroom5267564\",yX=\"zedoc\",y5=[0,80,[0,\"p2p_status_icon\"]],y7=\"\\xe2\\x99\\xbc\",y_=[0,80,[0,\"p2p_status\"]],zv=bB,zw=ko,AQ=[0,80,\"Add table\"],AT=[0,80,[0,k4]];function\nz(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return[0,z(a[1])];case\n1:return[1,z(a[1])];case\n2:return[2,z(a[1])];case\n3:return[3,z(a[1])];case\n4:return[4,z(a[1])];case\n5:return[5,z(a[1])];case\n6:return[6,z(a[1])];case\n7:return[7,z(a[1])];case\n8:var\nc=a[1];return[8,c,z(a[2])];case\n9:var\nb=a[1];return[9,b,b,z(a[3])];case\n10:return[10,z(a[1])];case\n11:return[11,z(a[1])];case\n12:return[12,z(a[1])];case\n13:return[13,z(a[1])];default:return[14,z(a[1])]}}function\nX(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,X(a[1],b)];case\n1:return[1,X(a[1],b)];case\n2:return[2,X(a[1],b)];case\n3:return[3,X(a[1],b)];case\n4:return[4,X(a[1],b)];case\n5:return[5,X(a[1],b)];case\n6:return[6,X(a[1],b)];case\n7:return[7,X(a[1],b)];case\n8:var\nc=a[1];return[8,c,X(a[2],b)];case\n9:var\nd=a[2],e=a[1];return[9,e,d,X(a[3],b)];case\n10:return[10,X(a[1],b)];case\n11:return[11,X(a[1],b)];case\n12:return[12,X(a[1],b)];case\n13:return[13,X(a[1],b)];default:return[14,X(a[1],b)]}}function\nx(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,x(a[1],b)];case\n1:return[1,x(a[1],b)];case\n2:var\nc=a[1];return[2,c,x(a[2],b)];case\n3:var\nd=a[1];return[3,d,x(a[2],b)];case\n4:var\ne=a[3],f=a[2],g=a[1];return[4,g,f,e,x(a[4],b)];case\n5:var\nh=a[3],i=a[2],j=a[1];return[5,j,i,h,x(a[4],b)];case\n6:var\nk=a[3],l=a[2],m=a[1];return[6,m,l,k,x(a[4],b)];case\n7:var\nn=a[3],o=a[2],p=a[1];return[7,p,o,n,x(a[4],b)];case\n8:var\nq=a[3],r=a[2],s=a[1];return[8,s,r,q,x(a[4],b)];case\n9:var\nt=a[1];return[9,t,x(a[2],b)];case\n10:return[10,x(a[1],b)];case\n11:var\nu=a[1];return[11,u,x(a[2],b)];case\n12:var\nv=a[1];return[12,v,x(a[2],b)];case\n13:var\nw=a[2],y=a[1];return[13,y,w,x(a[3],b)];case\n14:var\nz=a[2],A=a[1];return[14,A,z,x(a[3],b)];case\n15:return[15,x(a[1],b)];case\n16:return[16,x(a[1],b)];case\n17:var\nB=a[1];return[17,B,x(a[2],b)];case\n18:var\nC=a[1];return[18,C,x(a[2],b)];case\n19:return[19,x(a[1],b)];case\n20:var\nD=a[2],E=a[1];return[20,E,D,x(a[3],b)];case\n21:var\nF=a[1];return[21,F,x(a[2],b)];case\n22:return[22,x(a[1],b)];case\n23:var\nG=a[1];return[23,G,x(a[2],b)];default:var\nH=a[2],I=a[1];return[24,I,H,x(a[3],b)]}}function\na7(a){throw g([0,cc,a],1)}function\ns(a){throw g([0,cb,a],1)}function\nc2(a){return 0<=a?a:-a|0}var\ng7=kN;function\naO(a,b){return a+b}function\nmt(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(e<=c)return aO(b,mu);var\nd=D(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function\nmx(a,b,c,d){var\nf=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var\nh=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var\nj=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var\nl=[0,j[1],aL],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}BR(0);var\nen=l_(1),ai=l_(2);function\nce(a,b){gV(a,b,0,n(b));return}function\ng8(a,b,c,d){if(0<=c&&0<=d&&(n(b)-d|0)>=c)return gV(a,b,c,d);return s(my)}function\ng9(a){ce(ai,a);l$(ai,10);return bK(ai)}var\neo=[0,function(a){return function(a){var\nb=a;for(;;){if(!b)return 0;var\nd=b[2],e=b[1];try{bK(e)}catch(f){var\nc=M(f);if(c[1]!==g6)throw g(c,0)}b=d}}(BS(0))}],g_=[0,function(a){return}];function\nep(a){h(g_[1],0);return h(gF(eo),0)}g0(ll,ep);function\ncf(a){return bK(a)}function\nmo(a){return a^-1}function\nmp(a){return a?mq:mr}function\nms(a){return e+a}function\nmv(a){return mt(gK(\"%.12g\",a))}function\nmw(a,b){if(!a)return b;var\nc=a[2],d=a[1];if(!c)return[0,d,b];var\ne=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var\ng=[0,e[1],aL];mx(g,1,e[2],b);return[0,d,[0,f,g]]}function\nmz(c){for(;;){var\na=gF(eo);let\nd=[0,1],e=a;var\nb=1-gE(eo,a,function(a){if(gE(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function\nmA(a,b){l$(a,b);return}var\neq=B3(0),cg=(4*eq|0)-1|0;function\nmB(a){return 1-(typeof\na===\"number\"?1:0)}function\ng$(a,b,c){return gE(a,b,c)}function\nch(a){return gF(a)}function\nci(a){return[0,a]}function\nmC(a,b){return A4(a,b)}var\nmE=[q,mD,ag(0)];function\nmF(a){var\nd=a[1];a[1]=0;try{var\nc=h(d,0);a[1]=c;l7(a);return c}catch(f){var\nb=M(f);a[1]=function(a){throw g(b,0)};BI(a);throw g(b,0)}}function\nmG(a){var\nc=a[1];a[1]=0;var\nb=h(c,0);a[1]=b;l7(a);return b}function\nmH(a,b){if(0===BJ(b))return a?mG(b):mF(b);throw g(mE,1)}function\ner(a){return mH(0,a)}function\nmI(a){var\nb=aN(a);if(b!==aZ&&b!==bg&&b!==bE&&b!==kG)return a;return BH(a)}function\nc3(a){return a?a[1]:s(mJ)}function\ncj(a,b){return b?[0,h(a,b[1])]:0}function\nha(a){return a?1:0}function\nmK(a){return a?[0,a[1],0]:0}function\nmL(a){a:{if(40<=a){if(92===a)return mM;if(gj>a)break a}else{if(32<=a){if(39<=a)return mN;break a}if(14>a)switch(a){case\n8:return mO;case\n9:return mP;case\n10:return mQ;case\n13:return mR}}var\nb=C(4);B(b,0,92);B(b,1,48+(a/gr|0)|0);B(b,2,48+((a/10|0)%10|0)|0);B(b,3,48+(a%10|0)|0);return ej(b)}var\nc=C(1);B(c,0,a);return ej(c)}function\nmS(a){return 25>>0?a:a-32|0}function\nmT(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\nes(a){return mT(0,a)}function\nbN(a,b){var\nc=a,d=b;for(;;){if(!c)return d;var\ne=[0,c[1],d];c=c[2];d=e}}function\nck(a){return bN(a,0)}function\nmX(a,b,c){if(b>1,s=p(r,b),D=s[1],t=p(a-r|0,s[2]),E=t[2];return[0,B(D,t[1],0),E]}function\np(a,b){if(2===a){if(b){var\nj=b[2];if(j){var\nk=j[1],g=b[1],B=j[2],q=i(d,g,k),C=0===q?[0,g,0]:0>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var\na=es(b);return 2<=a?h(a,b)[1]:b}function\nm8(a,b){return l3(a,b)}function\nm9(a,b){return a<=b?a:b}function\nm_(a,b){return b<=a?a:b}function\nm$(a){return e+a}function\nbn(a,b){var\nc=C(a);Bg(c,0,a,b);return c}var\nna=C(0);function\nnb(a){var\nb=au(a),c=C(b);a4(a,0,c,0,b);return c}function\nev(a,b,c){if(0<=b&&0<=c&&(au(a)-c|0)>=b){var\nd=C(c);a4(a,b,d,0,c);return d}return s(nd)}function\new(a,b,c){return ej(ev(a,b,c))}function\nhd(a,b,c,d,e){if(0<=e&&0<=b&&(au(a)-e|0)>=b&&0<=d&&(au(c)-e|0)>=d){a4(a,b,c,d,e);return}return s(ne)}function\nax(a,b,c,d,e){if(0<=e&&0<=b&&(n(a)-e|0)>=b&&0<=d&&(au(c)-e|0)>=d){cT(a,b,c,d,e);return}return s(nf)}function\nhe(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nni(a,b){var\nd=au(b);if(0===d)return b;var\ne=C(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){B(e,c,h(a,bG(b,c)));var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nhf(a,b,c){lO(a,b,Bt(c));return}function\nhg(a,b,c){at(a,b,c);return}function\nhh(a,b){return A_(a,b)}function\ncl(a){return bj(a)}function\n$(a){return ej(a)}function\nnc(a){return nb(bj(a))}function\nng(a){var\nd=au(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!he(bG(a,b[1])))break;b[1]++}var\nc=[0,d-1|0];for(;;){if(b[1]<=c[1]&&he(bG(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?ev(a,b[1],(c[1]-b[1]|0)+1|0):na}}function\nnh(a){var\nb=[0,0],j=au(a)-1|0,l=0;if(j>=0){var\ng=l;for(;;){var\ne=bG(a,g);a:{b:{c:{if(32<=e){var\nh=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var\ni=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var\ni=4;break a}var\ni=2}b[1]=b[1]+i|0;var\no=g+1|0;if(j===g)break;g=o}}if(b[1]===au(a))return a;var\nc=C(b[1]);b[1]=0;var\nk=au(a)-1|0,m=0;if(k>=0){var\nf=m;for(;;){var\nd=bG(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(gj<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case\n8:B(c,b[1],92);b[1]++;B(c,b[1],98);break a;case\n9:B(c,b[1],92);b[1]++;B(c,b[1],116);break a;case\n10:B(c,b[1],92);b[1]++;B(c,b[1],110);break a;case\n13:B(c,b[1],92);b[1]++;B(c,b[1],114);break a;default:break c}}if(34>d)break b}B(c,b[1],92);b[1]++;B(c,b[1],d);break a}B(c,b[1],92);b[1]++;B(c,b[1],48+(d/gr|0)|0);b[1]++;B(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;B(c,b[1],48+(d%10|0)|0);break a}B(c,b[1],d)}b[1]++;var\nn=f+1|0;if(k===f)break;f=n}}return c}function\nnj(a){return ni(mS,a)}function\nnk(a,b){return A$(a,b)}function\nnl(a,b,c){lO(a,b,c);return}function\nc5(a,b){return $(bn(a,b))}function\nex(a,b,c){return $(ev(cl(a),b,c))}function\nhi(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nno(a,b,c,d){var\ne=c;for(;;){if(b<=e)throw g(aD,1);if(_(a,e)===d)return e;e=e+1|0}}function\nnp(a,b,c){var\nd=n(a);if(0<=b&&d>=b)try{no(a,d,b,c);var\nf=1;return f}catch(f){var\ne=M(f);if(e===aD)return 0;throw g(e,0)}return s(nq)}function\ney(a,b){return mg(a,b)}function\nc6(a,b){return nk(cl(a),b)}function\nez(a,b){return a==b?1:0}function\nnm(a){if(a==e)return a;if(!hi(_(a,0))&&!hi(_(a,n(a)-1|0)))return a;return $(ng(cl(a)))}function\nnn(a){return $(nh(cl(a)))}function\nnr(a,b){return np(a,0,b)}function\nns(a){return $(nj(cl(a)))}function\nhj(a,b){if(0===a)return[0];if(0>a)return s(nt);var\nd=ap(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var\nc=f;for(;;){d[1+c]=h(b,c);var\ng=c+1|0;if(e===c)break;c=g}}return d}function\ncm(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d)return A2(a,b,c,d,e);return s(nw)}function\nhk(a,b){var\nd=b.length-2|0,e=0;if(d>=0){var\nc=e;for(;;){h(a,b[1+c]);var\nf=c+1|0;if(d===c)break;c=f}}return 0}function\nhl(a,b){var\nd=b.length-1;if(0===d)return[0];var\ne=ap(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var\nc=g;for(;;){e[1+c]=h(a,b[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nnx(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\nc7(a){if(!a)return[0];var\nb=a[2],c=a[1],e=ap(nx(0,a),c);return function(a,b){var\nd=a,c=b;for(;;){if(!c)return e;var\nf=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function\nnu(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return A3(a,b,c);return s(nv)}function\nny(k){function\nj(a){return a?a[4]:0}function\nd(a,b,c){var\nd=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function\nl(a,b,c){var\ng=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var\nw=h<=g?g+1|0:h+1|0;return[0,a,b,c,w]}if(!c)return s(nC);var\nk=c[3],m=c[2],f=c[1],r=j(f);if(r<=j(k))return d(d(a,b,f),m,k);if(!f)return s(nB);var\nt=f[2],u=f[1],v=d(f[3],m,k);return d(d(a,b,u),t,v)}function\nc(a,b){if(!b)return[0,0,a,0,1];var\nd=b[3],e=b[2],f=b[1],g=i(k[1],a,e);if(0===g)return b;if(0<=g){var\nh=c(a,d);return d===h?b:l(f,e,h)}var\nj=c(a,f);return f===j?b:l(j,e,d)}function\nb(a){return[0,0,a,0,1]}var\nm=0;function\ne(a,b){var\nc=b;for(;;){if(!c)return;var\nd=c[3],f=c[2];e(a,c[1]);h(a,f);c=d}}function\nn(a,b){var\nd=a,c=b;for(;;){if(!c)return d;var\ne=c[2],f=c[1];d=[0,e,n(d,c[3])];c=f}}function\no(a,b,c){var\nd=c;for(;;){if(!d)return;var\ne=d[3],f=d[1];d=h(b,d[2])?e:f}}function\np(a){function\nc(a,b){if(3>=a>>>0)switch(a){case\n0:return[0,0,b];case\n1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case\n2:if(b){var\nh=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var\ni=b[2];if(i){var\nj=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var\nk=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,nD],1);var\no=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(es(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,m,,,,,,,,,,,,,,e,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var\nc=b;for(;;){if(!c)return;var\nd=c[2],e=c[3],f=c[1];if(h(a,d))return o(d,a,e);c=f}},,,,,,,,function(a){if(!a)return m;var\nf=a[2],d=a[1];if(!f)return b(d);var\ng=f[2],e=f[1];if(!g)return c(e,b(d));var\nh=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var\nj=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return p(m7(k[1],a));var\nn=j[1];return c(n,c(l,c(i,c(e,b(d)))))}]}function\nnE(a){var\nb=ny(a);return[0,b[17],b[4],,,,,,,,b[39],,,,,,,,,,,,b[50],b[31],,,,,,,,,,,,,,,b[58]]}function\nnF(f){function\nh(a){return a?a[5]:0}function\ne(a,b,c,d){var\ne=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function\nd(a,b,c,d){var\ni=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var\nB=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return s(nJ);var\nl=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return s(nI);var\nx=g[3],y=g[2],z=g[1],A=e(g[4],p,o,l);return e(e(a,b,c,z),y,x,A)}function\nj(a,b,c){if(!c)return[0,0,a,b,0,1];var\ne=c[4],h=c[3],k=c[2],g=c[1],o=c[5],l=i(f[1],a,k);if(0===l)return h===b?c:[0,g,a,b,e,o];if(0<=l){var\nm=j(a,b,e);return e===m?c:d(g,k,h,m)}var\nn=j(a,b,g);return g===n?c:d(n,k,h,e)}function\nn(a){var\nb=a;for(;;){if(!b)throw g(aD,1);var\nc=b[1];if(!c)return[0,b[2],b[3]];b=c}}function\nc(a){if(!a)return s(nK);var\nb=a[1];if(!b)return a[4];var\ne=a[4],f=a[3],g=a[2];return d(c(b),g,f,e)}function\no(a,b){if(!a)return b;if(!b)return a;var\ne=n(b),f=e[2],g=e[1];return d(a,g,f,c(b))}function\nk(a,b){if(!b)return 0;var\nc=b[4],h=b[3],g=b[2],e=b[1],j=i(f[1],a,g);if(0===j)return o(e,c);if(0<=j){var\nl=k(a,c);return c===l?b:d(e,g,h,l)}var\nm=k(a,e);return e===m?b:d(m,g,h,c)}function\nl(a,b){var\nc=b;for(;;){if(!c)return 0;var\nd=c[4],e=c[3],f=c[2];l(a,c[1]);i(a,f,e);c=d}}function\nm(a,b,c){var\nd=b,e=c;for(;;){if(!d)return e;var\nf=d[4],g=d[3],h=d[2],i=y(a,h,g,m(a,d[1],e));d=f;e=i}}return[0,,,,,0,,j,function(a,b){var\nc=b;for(;;){if(!c)throw g(aD,1);var\ne=c[4],h=c[3],j=c[1],d=i(f[1],a,c[2]);if(0===d)return h;var\nk=0<=d?e:j;c=k}},,,,,,,,,function(a,b){var\nc=b;for(;;){if(!c)return 0;var\ne=c[4],g=c[3],h=c[1],d=i(f[1],a,c[2]);if(0===d)return[0,g];var\nj=0<=d?e:h;c=j}},,,,,,,k,,,l,,,m]}function\neA(a){var\nb=nF(a);return[0,b[5],b[7],,,,b[24],,,,,,,,,,,b[8],b[17],,,,,b[27],b[30]]}var\neB=[q,nL,ag(0)];function\nbO(a){return[0,0,0]}function\ncn(a){a[1]=0;a[2]=0;return}function\na9(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function\nbP(a){var\nb=a[1];if(!b)return 0;var\nc=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function\nbQ(a){var\nb=a[1];return b?[0,b[1]]:0}function\nnM(a){var\nb=a[1];if(!b)throw g(eB,1);a[1]=b[2];a[2]=a[2]-1|0;return}function\nnN(a){if(a[1])return;throw g(eB,1)}function\nnO(a,b){return a8(a,b[1])}var\nnQ=[q,nP,ag(0)];function\neC(a){return[0,0,0,0]}function\neD(a){a[1]=0;a[2]=0;a[3]=0;return}function\neE(a,b){var\nc=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function\nhm(a){var\nb=a[2];if(!b)throw g(nQ,1);var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return c}eD(a);return c}function\neF(a){return 0===a[1]?1:0}function\nnR(a){var\nb=a[2];return b?[0,b[1]]:0}function\nnS(a){var\nb=a[2];if(!b)return 0;var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}eD(a);return[0,c]}function\nbo(a){var\nb=1<=a?a:1,c=cg=(d+b|0))break;c[1]=2*c[1]|0}if(cg=b)return ew(a[1][1],b,c);return s(nU)}function\nnV(a){a[2]=0;return 0}function\nnX(a,b){var\nc=a[2],d=a[1],e=d[1];if(d[2]<=c){eG(a,1);at(a[1][1],a[2],b)}else\nB(e,c,b);a[2]=c+1|0;return}var\neH=[0,0];function\nhp(a){return a}function\nhq(a){return a!==eH?1:0}function\nhr(a){return a}(function(a){Be(ap(8,eH));return}(0));var\nnZ=ci(0),hs=ci(0);function\nn0(a){for(;;){var\nb=ch(hs),c=1-g$(hs,b,[0,a,b]);if(!c)return c}}function\naP(a,b){var\nc=[0,mC(nZ,1),b];if(a)n0([0,c,a[1]]);return c}function\nht(d){for(;;){var\na=lR(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e-43|0){case\n5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var\nf=bn(d+1|0,48);at(f,0,e);ax(b,1,f,(d-c|0)+2|0,c-1|0);return $(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(ca)return b;var\nh=[0,0],i=n(b)-1|0,o=0;if(i>=0){var\nd=o;for(;;){if(9>=_(b,d)+lr>>>0)h[1]++;var\nr=d+1|0;if(i===d)break;d=r}}var\nj=h[1],k=C(n(b)+((j-1|0)/3|0)|0),l=[0,0];function\ne(a){at(k,l[1],a);l[1]++;return}var\nf=[0,((j-1|0)%3|0)+1|0],m=n(b)-1|0,p=0;if(m>=0){var\nc=p;for(;;){var\ng=_(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var\nq=c+1|0;if(m===c)break;c=q}}return $(k)}function\npK(a,b){return c9(a,ec(oR(a),b))}function\npL(a,b){return c9(a,ec(ph(a),b))}function\npM(a,b){return c9(a,ec(pv(a),b))}function\npN(a,b){return c9(a,Bw(o5(a),b))}function\naQ(d,b,c){function\na(a){switch(d[1]){case\n0:var\ne=45;break;case\n1:var\ne=43;break;default:var\ne=32}return Br(c,b,e)}function\ne(a){var\nb=Ba(c);return 3===b?c<0.?pP:pQ:4<=b?pR:a}function\nf(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(c===e)return 0;var\nd=D(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:aO(b,pO)}switch(d[2]){case\n5:return e(f(gK(hz(d,b),c)));case\n6:return a(0);case\n7:return ns(a(0));case\n8:return e(a(0));default:return gK(hz(d,b),c)}}function\npS(a){var\nb=mL(a),c=n(b),d=bn(c+2|0,39);cT(b,0,d,1,c);return $(d)}function\npT(a){var\nb=hv(16);eK(b,a);return hx(b)}function\ncJ(a,b,c,d){var\nk=b,j=c,e=d;for(;;){if(typeof\ne===\"number\")return h(k,j);switch(e[0]){case\n0:var\nt=e[1];return function(a){return o(k,[5,j,a],t)};case\n1:var\nu=e[1];return function(a){return o(k,[4,j,pS(a)],u)};case\n2:return eL(k,j,e[2],e[1],function(a){return a});case\n3:return eL(k,j,e[2],e[1],oQ);case\n4:return c_(k,j,e[4],e[2],e[3],pK,e[1]);case\n5:return c_(k,j,e[4],e[2],e[3],pL,e[1]);case\n6:return c_(k,j,e[4],e[2],e[3],pM,e[1]);case\n7:return c_(k,j,e[4],e[2],e[3],pN,e[1]);case\n8:return pU(k,j,e[4],e[2],e[3],e[1]);case\n9:return eL(k,j,e[2],e[1],mp);case\n10:j=[7,j];e=e[1];break;case\n11:j=[2,j,e[1]];e=e[2];break;case\n12:j=[3,j,e[1]];e=e[2];break;case\n13:var\nv=e[3],w=pT(e[2]);return function(a){return o(k,[4,j,w],v)};case\n14:var\ny=e[3],z=e[2];return function(a){return o(k,j,x(oP(a[1],z),y))};case\n15:var\nA=e[1];return function(c,b){return o(k,[6,j,function(a){return i(c,a,b)}],A)};case\n16:var\nB=e[1];return function(a){return o(k,[6,j,a],B)};case\n17:j=[0,j,e[1]];e=e[2];break;case\n18:var\nl=e[1];if(0===l[0]){let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case\n19:throw g([0,f,pW],1);case\n20:var\nC=e[3],D=[8,j,pX];return function(a){return o(k,D,C)};case\n21:var\nE=e[2];return function(a){return o(k,[4,j,ec(kw,a)],E)};case\n22:var\nF=e[1];return function(a){return o(k,[5,j,a],F)};case\n23:var\nm=e[2],n=e[1];return a<50?j1(a+1|0,k,j,n,m):r(j1,[0,k,j,n,m]);default:var\np=e[3],q=e[1],s=h(e[2],0);return a<50?f2(a+1|0,k,j,p,q,s):r(f2,[0,k,j,p,q,s])}}}function\no(a,b,c){return bM(cJ(0,a,b,c))}function\nj1(a,b,c,d,e){if(typeof\nd===\"number\")switch(d){case\n0:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n1:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n2:throw g([0,f,pY],1);default:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e])}switch(d[0]){case\n0:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n1:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n2:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n3:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n4:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n5:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n6:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n7:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n8:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n9:var\nh=d[2];return a<50?f3(a+1|0,b,c,h,e):r(f3,[0,b,c,h,e]);case\n10:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);default:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e])}}function\nf3(a,h,c,d,e){if(typeof\nd===\"number\")return a<50?t(a+1|0,h,c,e):r(t,[0,h,c,e]);switch(d[0]){case\n0:var\nb=d[1];return function(a){return aj(h,c,b,e)};case\n1:var\ni=d[1];return function(a){return aj(h,c,i,e)};case\n2:var\nj=d[1];return function(a){return aj(h,c,j,e)};case\n3:var\nk=d[1];return function(a){return aj(h,c,k,e)};case\n4:var\nl=d[1];return function(a){return aj(h,c,l,e)};case\n5:var\nm=d[1];return function(a){return aj(h,c,m,e)};case\n6:var\nn=d[1];return function(a){return aj(h,c,n,e)};case\n7:var\no=d[1];return function(a){return aj(h,c,o,e)};case\n8:var\np=d[2];return function(a){return aj(h,c,p,e)};case\n9:var\nq=d[3],s=d[2],u=I(E(d[1]),s);return function(a){return aj(h,c,X(u,q),e)};case\n10:var\nv=d[1];return function(a,b){return aj(h,c,v,e)};case\n11:var\nw=d[1];return function(a){return aj(h,c,w,e)};case\n12:var\nx=d[1];return function(a){return aj(h,c,x,e)};case\n13:throw g([0,f,pZ],1);default:throw g([0,f,p0],1)}}function\naj(a,b,c,d){return bM(f3(0,a,b,c,d))}function\nt(a,b,c,d){var\ne=[8,c,p1];return a<50?cJ(a+1|0,b,e,d):r(cJ,[0,b,e,d])}function\neL(g,f,c,d,e){if(typeof\nd===\"number\")return function(a){return o(g,[4,f,h(e,a)],c)};if(0===d[0]){var\nb=d[2],i=d[1];return function(a){return o(g,[4,f,ad(i,b,h(e,a))],c)}}var\nj=d[1];return function(a,b){return o(g,[4,f,ad(j,a,h(e,b))],c)}}function\nc_(k,j,h,d,e,f,g){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,bS(a,i(f,g,b))],h)}:function(a){return o(k,[4,j,i(f,g,a)],h)};var\nb=e[1];return function(a){return o(k,[4,j,bS(b,i(f,g,a))],h)}}if(0===d[0]){var\nc=d[2],l=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,ad(l,c,bS(a,i(f,g,b)))],h)}:function(a){return o(k,[4,j,ad(l,c,i(f,g,a))],h)};var\nn=e[1];return function(a){return o(k,[4,j,ad(l,c,bS(n,i(f,g,a)))],h)}}var\nm=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(k,[4,j,ad(m,a,bS(b,i(f,g,c)))],h)}:function(a,b){return o(k,[4,j,ad(m,a,i(f,g,b))],h)};var\np=e[1];return function(a,b){return o(k,[4,j,ad(m,a,bS(p,i(f,g,b)))],h)}}function\npU(i,h,g,d,e,f){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,aQ(f,a,b)],g)}:function(a){return o(i,[4,h,aQ(f,eJ(f),a)],g)};var\nb=e[1];return function(a){return o(i,[4,h,aQ(f,b,a)],g)}}if(0===d[0]){var\nc=d[2],j=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,ad(j,c,aQ(f,a,b))],g)}:function(a){return o(i,[4,h,ad(j,c,aQ(f,eJ(f),a))],g)};var\nl=e[1];return function(a){return o(i,[4,h,ad(j,c,aQ(f,l,a))],g)}}var\nk=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(i,[4,h,ad(k,a,aQ(f,b,c))],g)}:function(a,b){return o(i,[4,h,ad(k,a,aQ(f,eJ(f),b))],g)};var\nm=e[1];return function(a,b){return o(i,[4,h,ad(k,a,aQ(f,m,b))],g)}}function\nf2(a,b,c,d,e,f){if(e){var\ni=e[1];return function(a){return pV(b,c,d,i,h(f,a))}}var\ng=[4,c,f];return a<50?cJ(a+1|0,b,g,d):r(cJ,[0,b,g,d])}function\npV(a,b,c,d,e){return bM(f2(0,a,b,c,d,e))}function\naR(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=hy(c[2]);aR(a,f);return ce(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aR(a,e);ce(a,p2);c=i}else{var\nj=d[1];aR(a,e);ce(a,p3);c=j}break;case\n6:var\nm=c[2];aR(a,c[1]);return h(m,a);case\n7:aR(a,c[1]);return cf(a);case\n8:var\nn=c[2];aR(a,c[1]);return s(n);case\n2:case\n4:var\nk=c[2];aR(a,c[1]);return ce(a,k);default:var\nl=c[2];aR(a,c[1]);return mA(a,l)}}}function\naS(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=hy(c[2]);aS(a,f);return cp(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aS(a,e);cp(a,p4);c=i}else{var\nj=d[1];aS(a,e);cp(a,p5);c=j}break;case\n6:var\nm=c[2];aS(a,c[1]);return cp(a,h(m,0));case\n7:c=c[1];break;case\n8:var\nn=c[2];aS(a,c[1]);return s(n);case\n2:case\n4:var\nk=c[2];aS(a,c[1]);return cp(a,k);default:var\nl=c[2];aS(a,c[1]);return nX(a,l)}}}function\np6(a){var\nc=a[1],b=bo(cM);return o(function(a){aS(b,a);return a7(co(b))},0,c)}function\np7(c){if(c==e)return p8;var\nf=n(c);function\nj(a){return h(p6(p9),c)}function\nk(a){var\nb=a;for(;;){if(b===f)return b;var\nd=D(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var\ni=k(0),o=function(a,b){var\nd=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=ex(c,i,o-i|0),d=k(o),l=function(a,b){var\nd=b;for(;;){if(d===f)return d;var\ne=D(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var\nm=0;else\ntry{var\nr=l4(ex(c,d,l-d|0)),m=r}catch(f){var\np=M(f);if(p[1]!==cc)throw g(p,0);var\nq=j(0),m=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==j_){if(a===\"h\"){var\nb=0;break a}if(a===\"hov\"){var\nb=3;break a}if(a===\"hv\"){var\nb=2;break a}if(a!==\"v\"){var\nb=j(0);break a}var\nb=1;break a}var\nb=4}return[0,m,b]}function\np_(d,b,c){return o(function(a){aR(b,a);return h(d,b)},0,c[1])}function\nc$(a,b){return p_(function(a){return 0},a,b)}function\neM(a){return c$(ai,a)}function\neN(c,b){return o(function(a){var\nb=bo(64);aS(b,a);return h(c,co(b))},0,b[1])}function\nA(a){return eN(function(a){return a},a)}var\neO=ci(0);function\neQ(a,b){var\nc=a[1+b];return mB(c)?aN(c)===d3?h(A(p$),c):aN(c)===kG?mv(c):qa:h(A(qb),c)}function\nhA(a,b){if(a.length-1<=b)return qc;var\nc=hA(a,b+1|0),d=eQ(a,b);return i(A(qd),d,c)}function\nqe(a){var\nb=a.length-1;if(2>=b>>>0)switch(b){case\n0:return qg;case\n1:return qh;default:var\ne=eQ(a,1);return h(A(qi),e)}var\nc=hA(a,2),d=eQ(a,1);return i(A(qf),d,c)}function\nqj(d){return function(a){var\nb=a;for(;;){if(!b)return 0;var\ne=b[2],f=b[1];a:{try{var\nc=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(ch(eO))}function\nqk(a){if(0!==aN(a))return[0,a[1],0];var\nb=a[1][1];return[0,b,[0,qe(a)]]}function\nql(a){var\nb=qk(a),c=b[2],d=b[1];return c?aO(d,c[1]):d}function\nqm(a){if(a===em)return qn;if(a===g5)return qo;if(a[1]===g4){var\nb=a[2],e=b[3],i=b[2],j=b[1];return f6(A(eP),j,i,e,e+5|0,qp)}if(a[1]===f){var\nc=a[2],g=c[3],k=c[2],l=c[1];return f6(A(eP),l,k,g,g+6|0,qq)}if(a[1]!==cd)return ql(a);var\nd=a[2],h=d[3],m=d[2],n=d[1];return f6(A(eP),n,m,h,h+6|0,qr)}function\nda(a){var\nb=qj(a);return b?b[1]:qm(a)}function\nqs(a){var\nb=[0,Bb(a)];return b}function\nqt(c,b){function\na(a){return a?0===c?qu:qv:0===c?qw:qx}if(0!==b[0]){if(b[1])return 0;var\np=a(0);return[0,h(A(qD),p)]}if(b[3]===b[6])var\ne=b[3],d=h(A(qy),e);else\nvar\nn=b[6],o=b[3],d=i(A(qC),o,n);var\nf=b[7],g=b[4],j=b[8]?qz:qB,k=b[2],l=b[9],m=a(b[1]);return[0,AY(A(qA),m,l,k,j,d,g,f)]}function\nqE(a,b){if(!b)return c$(a,qG);var\nd=b[1],e=d.length-2|0,g=0;if(e>=0){var\nc=g;for(;;){var\nf=qt(c,j(d,c)[1+c]);if(f){var\ni=f[1];h(c$(a,qF),i)}var\nk=c+1|0;if(e===c)break;c=k}}return 0}function\ndb(a,b){return qE(a,qs(b))}var\nqJ=qI.slice();function\nqK(a,b){var\ne=da(a);h(eM(qL),e);db(ai,b);var\nc=BQ(0);if(c<0){var\nd=c2(c);g9(j(qJ,d)[1+d])}return cf(ai)}var\nqM=[0];function\nhB(a){var\nb=lU(0);return b}function\nqN(a,b){try{var\nd=b?qM:hB(0);try{ep(0)}catch(f){}try{var\nf=qK(a,d),e=f}catch(f){var\ni=M(f),j=hB(0),k=da(a);h(eM(qP),k);db(ai,d);var\nl=da(i);h(eM(qQ),l);db(ai,j);var\ne=cf(ai)}return e}catch(f){var\nc=M(f);if(c===em)return g9(qO);throw g(c,0)}}g0(lz,function(a,b){try{var\nc=qN(a,b);return c}catch(f){return 0}});function\nqH(a){for(;;){var\nb=ch(eO),c=1-g$(eO,b,[0,a,b]);if(!c)return c}}function\nqR(a){return lU(a)}var\nqT=[q,qS,ag(0)];qH(function(a){return a[1]===qT?[0,aO(qU,da(a[2]))]:0});function\neR(a){var\nb=a[1]<1?1:0,c=b||(64=0){var\nc=i;for(;;){nl(d,c*8|0,cY(j(b,c)[1+c]));var\nn=c+1|0;if(f===c)break;c=n}}at(d,e*8|0,1);var\ng=hC(d);at(d,e*8|0,2);var\nh=hC(d),k=c6(h,8),l=c6(h,0),m=c6(g,8);return hE(a,c6(g,0),m,l,k)}function\nq4(a){var\nb=hD(0);q3(b,a);return b}function\nhG(a){return q4(B5(0))}function\nbT(a){return l8(a)}function\nq5(a){return l2(l8(a))&1073741823}aP([0,function(a){var\nb=bT(a),c=bT(a),d=bT(a);return hF(b,c,d,bT(a))}],function(a){return hF(q9,q8,q7,q6)});function\nq_(a){var\nb=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var\nAW=mh(lu),hK=AW}catch(f){var\nhH=M(f);if(hH!==aD)throw g(hH,0);try{var\nAV=mh(\"CAMLRUNPARAM\"),hJ=AV}catch(f){var\nhI=M(f);if(hI!==aD)throw g(hI,0);var\nhJ=q$}var\nhK=hJ}var\nra=ci(nr(hK,82)),rb=aP(0,hG);function\nrc(a,b){var\nc=a;for(;;){if(b<=c)return c;if(eq<(c*2|0))return c;c=c*2|0}}function\nhL(a,b){var\nd=a?a[1]:ch(ra),c=rc(16,b),e=d?q5(a_(rb)):0;return[0,0,ap(c,0),e,c]}function\nrd(m,b,c,d){var\ng=d.length-1,f=ap(g,0),i=c.length-2|0;function\nn(a){var\nc=a;for(;;){if(!c)return;var\ni=c[1],l=c[2],n=c[3],g=b?c:[0,i,l,0],e=h(m,i),k=j(f,e)[1+e];if(k)k[3]=g;else\nj(d,e)[1+e]=g;j(f,e)[1+e]=g;c=n}}var\no=0;if(i>=0){var\ne=o;for(;;){n(j(c,e)[1+e]);var\nr=e+1|0;if(i===e)break;e=r}}if(b){var\nk=g-1|0,p=0;if(k>=0){var\na=p;for(;;){var\nl=j(f,a)[1+a];if(l)l[3]=0;var\nq=a+1|0;if(k===a)break;a=q}}}return}function\nre(a,b){var\nc=b[2],d=(c.length-1)*2|0,e=d>>0)return;return hS(a,d)}function\nro(a){var\nb=nS(a[28]);if(!b)return;var\nc=b[1],d=c[1];a[12]=a[12]-c[3]|0;var\ne=aq(d);a[9]=a[9]+e|0;return}function\nrp(a,b,c){if(typeof\nc===\"number\")switch(c){case\n0:var\nj=bQ(a[3]);if(!j)return;var\nk=j[1][1],l=function(a,b){if(!b)return[0,a,0];var\nc=b[1],d=b[2];return BK(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case\n1:bP(a[2]);return;case\n2:bP(a[3]);return;case\n3:var\nm=bQ(a[2]);return m?hS(a,m[1][2]):dd(a);case\n4:var\no=a[10]!==(a[6]-a[9]|0)?1:0;return o?ro(a):o;default:var\np=bP(a[5]);if(p)return eT(a,h(a[25],p[1]));return}switch(c[0]){case\n0:return hR(a,b,c[1]);case\n1:var\nd=c[2],f=c[1],q=d[1],z=d[2],r=bQ(a[2]);if(!r)return;var\ns=r[1],e=s[2];switch(s[1]){case\n0:return bU(a,f);case\n1:return bp(a,d,e);case\n2:return bp(a,d,e);case\n3:return a[9]<(b+n(q)|0)?bp(a,d,e):bU(a,f);case\n4:return a[11]?bU(a,f):a[9]<(b+n(q)|0)?bp(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=hQ;hT(a);if(b)dd(a);return rB(a)}hY(a,0)}}function\neW(a,b,c){var\nd=a[14]=c)return y(a[17],h4,0,c);y(a[17],h4,0,80);c=c-80|0}}function\nrN(a){return a[1]===cs?aO(rP,aO(a[2],rO)):rQ}function\nrR(a){return a[1]===cs?aO(rT,aO(a[2],rS)):rU}function\nrV(a){return 0}function\nrW(a){return 0}function\neY(a,b,c,d,e){var\ng=eC(0),h=[0,hO,rX,0];eE(h,g);var\nf=bO(0);eU(f);a9([0,1,h],f);var\ni=78,j=bO(0),k=bO(0),l=bO(0);return[0,f,bO(0),l,k,j,i,10,68,i,0,1,1,1,1,g7,rY,a,b,c,d,e,0,0,rN,rR,rV,rW,g]}function\nh5(a,b){var\nc=eY(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return eX(c,a)};c[20]=function(a){return bV(c,a)};c[21]=function(a){return bV(c,a)};return c}function\nh6(d){return h5(function(a,b,c){return g8(d,a,b,c)},function(a){return cf(d)})}function\ndf(d){return h5(function(a,b,c){return ho(d,a,b,c)},function(a){return 0})}var\neZ=dW;function\nh7(a){return bo(eZ)}var\nh8=h7(0),e0=h6(en),e1=h6(ai),rZ=df(h8),h9=aP(0,h7);cq(h9,h8);cq(aP(0,function(a){return df(a_(h9))}),rZ);function\ndg(a,b,c,d){return ho(a_(a),b,c,d)}function\ndh(a,b,c){var\nd=a_(b),e=hn(d);g8(a,co(d),0,e);cf(a);return nV(d)}var\ndi=aP(0,function(a){return bo(eZ)}),dj=aP(0,function(a){return bo(eZ)}),h_=aP(0,function(a){var\nb=eY(function(a,b,c){return dg(di,a,b,c)},function(a){return dh(en,di,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return eX(b,a)};b[20]=function(a){return bV(b,a)};b[21]=function(a){return bV(b,a)};hu(function(a){return a$(b,a)});return b});cq(h_,e0);var\nh$=aP(0,function(a){var\nb=eY(function(a,b,c){return dg(dj,a,b,c)},function(a){return dh(ai,dj,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return eX(b,a)};b[20]=function(a){return bV(b,a)};b[21]=function(a){return bV(b,a)};hu(function(a){return a$(b,a)});return b});cq(h$,e1);function\nrx(a,b){if(a[22]){a9(b,a[4]);h(a[26],b)}var\nc=a[23];return c?ct(a,[0,dc,[5,b],0]):c}function\nrD(a,b){return h1(a,n(b),b)}function\nrE(a,b){h0(a,1);return h(a[18],0)}function\nrF(a,b){var\nc=a[14]=0){var\nc=g;for(;;){r4(e,c,a,j(b,c)[1+c]);var\nh=c+1|0;if(f===c)break;c=h}}return e}function\nid(a,b){if(typeof\nb!==\"number\"&&0===b[0])return ic(a,b[1]);return a7(r5)}function\nr6(a,b,c,d){if(typeof\nc!==\"number\"){if(0===c[0])return ie(c[1],a[1+b],d);return}if(2!==c){a[1+b]=d;return}if(0===aN(d)&&4===d.length-1){var\ne=0,h=a[1+b];for(;;){h[1+e]=d[1+e];var\ni=e+1|0;if(3===e)return;e=i}}throw g([0,f,r7],1)}function\nie(a,b,c){if(0===aN(c)&&a.length-1<=c.length-1){var\ne=a.length-2|0,h=0;if(e>=0){var\nd=h;for(;;){var\ni=c[1+d];r6(b,d,j(a,d)[1+d],i);var\nk=d+1|0;if(e===d)break;d=k}}return}throw g([0,f,r8],1)}function\nig(a,b,c){if(typeof\na!==\"number\"&&0===a[0])return ie(a[1],b,c);return a7(r9)}var\ne2=[q,r_,ag(0)];r2(r$,[0,e2,[0]]);(function(a){throw a});function\ne3(a){return[0,a]}function\nR(a){return[0,a]}function\ndk(a){return 0===a[0]?[0,a[1]]:0}var\nbW=[0,function(a){return a}(0)];function\nbX(a){return[1,0,0,0,a]}function\nk(a,b){return 0===a[0]?[0,h(b,a[1])]:bX([0,a,b])}function\nbY(a,b,c){if(0===a[0]){var\nd=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return bX([1,a,b,c])}function\nih(a){return 0===a[0]?a[1]:bX([4,a,0])}function\nii(a,b,c){switch(c[0]){case\n0:throw g([0,f,sc],1);case\n1:c[3]=[0,b,a,c[3]];return;default:c[2]=[0,b,a,c[2]];return}}function\ne4(a,b){if(!b)throw g([0,f,sd],1);if(b[2]===a)return[0,b[1],b[3]];var\nc=e4(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function\ncv(a,b){switch(b[0]){case\n0:throw g([0,f,se],1);case\n1:var\nc=e4(a,b[3]),e=c[1];b[3]=c[2];return e;default:var\nd=e4(a,b[2]),h=d[1];b[2]=d[2];return h}}function\nij(a,b,c,d){var\ne=d;for(;;){if(!e)throw g([0,f,sf],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function\ne5(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,sg],1);case\n1:return ij(a,b,c,d[3]);default:return ij(a,b,c,d[2])}}function\nik(a,b){var\nc=b;for(;;){if(!c)throw g([0,f,sh],1);if(c[2]===a)return c[1];c=c[3]}}function\nsi(a,b){switch(b[0]){case\n0:throw g([0,f,sj],1);case\n1:return ik(a,b[3]);default:return ik(a,b[2])}}function\naY(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,sk],1);case\n1:var\nj=d[1];if(typeof\nj===\"number\"&&!j){if(!c)return;if(b[1])return;b[1]=1;return}var\nk=d[4];if(7===k[0]){var\nn=k[2];if(1===n[0]){var\no=n[1];if(typeof\no===\"number\"){if(!o&&c){if(b[1])return;b[1]=1;return}}else if(c)return}}var\nl=d[1];a:{if(typeof\nl===\"number\"&&l){var\ne=1;break a}var\ne=c}d[1]=0;var\nm=d[2];return a<50?j2(a+1|0,b,e,m):r(j2,[0,b,e,m]);default:var\ni=d[1];d[1]=0;if(typeof\ni===\"number\"){if(!i)return;b[1]=2;return}var\np=i[1];if(c)b[1]=2;return h(d[3],p)}}function\nba(a,b,c){return bM(aY(0,a,b,c))}function\nj2(a,b,c,d){if(typeof\nd===\"number\")return;switch(d[0]){case\n0:var\nf=d[1];return a<50?aY(a+1|0,b,c,f):r(aY,[0,b,c,f]);case\n1:var\ng=d[2];ba(b,c,d[1]);return a<50?aY(a+1|0,b,c,g):r(aY,[0,b,c,g]);case\n2:var\nh=d[3],l=d[2];ba(b,c,d[1]);ba(b,c,l);return a<50?aY(a+1|0,b,c,h):r(aY,[0,b,c,h]);case\n3:var\ni=d[4],m=d[3],n=d[2];ba(b,c,d[1]);ba(b,c,n);ba(b,c,m);return a<50?aY(a+1|0,b,c,i):r(aY,[0,b,c,i]);default:var\no=d[1];d[1]=0;var\nk=o-1|0,p=0;if(k>=0){var\ne=p;for(;;){ba(b,c,j(d[3],e)[1+e]);var\nq=e+1|0;if(k===e)break;e=q}}return}}function\nsl(a){return i(c$(ai,sm),db,Bk(20))}function\ndl(a,b){var\nc=[0,0];ba(c,a,b);var\nd=2<=c[1]?1:0;return d?sl(0):d}function\nae(a){return bX([5,a])}function\nar(a){return a}function\nab(a,b){if(1===a[0]){var\nc=a[4];if(5===c[0]){c[1]=b;return dl(0,a)}}throw g([0,f,sn],1)}function\nbq(a){if(1===a[0]){var\nb=a[4];if(5===b[0])return b[1]}throw g([0,f,so],1)}function\nbZ(a,b,c){var\nk=a,h=b,d=c;for(;;)switch(d[0]){case\n0:return k;case\n1:var\ne=d[2];if(typeof\ne===\"number\")throw g([0,f,st],1);switch(e[0]){case\n0:if(e[1]!==h)throw g([0,f,su],1);var\no=0;break;case\n1:var\nB=e[2],C=e[1];if(C===h)var\nD=[0,B];else{if(B!==h)throw g([0,f,sv],1);var\nD=[0,C]}var\no=D;break;case\n2:var\nu=e[3],v=e[2],w=e[1];if(w===h)var\nx=[1,v,u];else if(v===h)var\nx=[1,w,u];else{if(u!==h)throw g([0,f,sw],1);var\nx=[1,w,v]}var\no=x;break;case\n3:var\np=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var\nt=[2,r,q,p];else if(r===h)var\nt=[2,s,q,p];else if(q===h)var\nt=[2,s,r,p];else{if(p!==h)throw g([0,f,sx],1);var\nt=[2,s,r,q]}var\no=t;break;default:var\nn=cv(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,sy],1);var\nm=e[2]-1|0;e[2]=m;if(n>>2|0))var\nU=nu(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else\nvar\nL=e;var\nJ=L}var\no=J}d[2]=o;if(typeof\no!==\"number\")return k;var\ny=d[1];d[1]=1;var\nl=d[4];switch(l[0]){case\n0:h=d;d=l[1];break;case\n1:var\nN=l[2];k=bZ(k,d,l[1]);h=d;d=N;break;case\n2:var\nO=l[2];k=bZ(k,d,l[1]);h=d;d=O;break;case\n3:var\nP=l[2];k=bZ(k,d,l[1]);h=d;d=P;break;case\n4:var\nz=l[2],A=bZ(k,d,l[1]);if(!z)return A;var\nQ=z[1];l[2]=0;k=A;h=d;d=Q;break;case\n5:return k;case\n6:if(typeof\ny===\"number\")return k;var\nR=y[1];try{i(l[2],d,R);return k}catch(f){var\nS=M(f);return[0,[0,S,qR(0)],k]}default:var\nT=l[1];k=bZ(k,d,l[2]);h=d;d=T}break;default:throw g([0,f,sz],1)}}function\nbb(a,b){var\ne=a,c=b;for(;;)switch(c[0]){case\n0:return;case\n1:var\nn=typeof\nc[2]===\"number\"?1:0,d=c[2];if(typeof\nd===\"number\")var\nk=[0,e];else\nswitch(d[0]){case\n0:var\nk=[1,e,d[1]];break;case\n1:var\nk=[2,e,d[1],d[2]];break;case\n2:var\nk=[3,e,d[1],d[2],d[3]];break;case\n3:var\no=[0,d[1],d[2],d[3],d[4],e,bW,bW,bW],l=0;for(;;){ii(c,l,j(o,l)[1+l]);var\nw=l+1|0;if(4===l)break;l=w}var\nk=[4,5,5,o];break;default:var\ni=d[2];if(i>>1|0)}function\nis(a,b,c){if(typeof\na!==\"number\"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,s9],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,s8],1)}function\nf5(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[2];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,tb],1);e[5]=c;var\ni=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;is(h,c,d);fb(b,c);return a<50?cK(a+1|0,b,d):r(cK,[0,b,d])}}throw g([0,f,ta],1)}function\ns_(a,b){return bM(f5(0,a,b))}function\nf4(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[4];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,td],1);e[5]=c;var\ni=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;is(h,c,d);fb(b,c);return a<50?cK(a+1|0,b,d):r(cK,[0,b,d])}}throw g([0,f,tc],1)}function\ns$(a,b){return bM(f4(0,a,b))}function\nj4(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=b1(d[2]);if(fa(b1(d[4]),e)){s$(b,d);break a}}return a<50?f5(a+1|0,b,c):r(f5,[0,b,c])}throw g([0,f,te],1)}function\nj3(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=b1(d[4]);if(fa(b1(d[2]),e)){s_(b,d);break a}}return a<50?f4(a+1|0,b,c):r(f4,[0,b,c])}throw g([0,f,tf],1)}function\ncK(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=b1(c[2]),e=b1(c[4]);return d>>2|0}function\naE(a,b){if(typeof\na===\"number\")var\nc=b;else{if(typeof\nb!==\"number\"){var\nd=dq(b);return[1,(ix(dq(a),d)+1|0)<<2,a,b]}var\nc=a}return c}function\niy(a){return typeof\na===\"number\"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var\nfc=1,fd=2,tL=3;function\niz(a){return-1===a?1:0}function\nfe(a){return-1!==a?1:0}function\nb2(a){return(a&3)===3?1:0}function\niA(a){return(a&3)===1?1:0}function\niB(a){return(a&3)===2?1:0}function\niC(a){return a|3}function\ntM(a){return a>>>2|0}function\niD(a){return a<<2|2}function\ncz(a){return a&mo(tL)}function\niE(a){return a[2]}function\niF(a){return a[3]}function\niG(a){return[0,0,0,0]}function\ndr(a){a[1]=a[1]+1|0;return}function\nds(a){a[2]=a[2]+1|0;return}function\ndt(a){a[3]=a[3]+1|0;return}function\nff(a,b,c){var\nd=c;for(;;){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,tO],1);dr(a);dt(a);d[1]=e|3}return}var\nh=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,tP],1);dr(a);dt(a);d[1]=h|3;ff(a,b,d[2]);d=d[3]}}function\ndu(a,b,c,d){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1];if(0===(e&c)){dr(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;dt(a);ds(a)}}var\ng=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,ds(a)):h}var\nf=d[1];if(0===(f&c)){dr(a);if(0===(f&3)){d[1]=f|c;eE(d,b)}else{d[1]=-1;dt(a);ds(a);ff(a,c,d[2]);ff(a,c,d[3])}}var\ni=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,ds(a)):j}function\nfg(a,b,c){var\nd=hm(b);if(typeof\nd!==\"number\"&&1===d[0]){var\ne=(d[1]&3)===c?1:0;return e?(du(a,b,c,d[2]),du(a,b,c,d[3])):e}throw g([0,f,tQ],1)}function\niH(a,b,c){for(;;){if(eF(b))return;fg(a,b,c)}}function\ntR(a,b,c,d){for(;;){if(eF(c))return iH(b,d,fd);if(eF(d))return iH(a,c,fc);fg(a,c,fc);fg(b,d,fd)}}function\nfh(a){var\nb=a[6];a[6]=b+1|0;return b}function\nfi(a){var\nb=a;for(;;){if(typeof\nb===\"number\")return;if(0===b[0]){var\nc=b[1];if(typeof\nc!==\"number\"&&0===c[0]){var\ne=c[1],i=fe(e),l=i?b2(e):i;if(l)c[1]=cz(e);return}throw g([0,f,tW],1)}var\nd=b[1];if(typeof\nd!==\"number\"&&1===d[0]){var\nh=d[1],m=b[4],n=b[3],j=fe(h),k=j?b2(h):j;if(!k)return k;d[1]=cz(h);fi(n);b=m;continue}throw g([0,f,tX],1)}}function\niI(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;if(0===c[0]){var\nd=c[1];if(typeof\nd!==\"number\"&&0===d[0]){var\ne=d[1],u=c[2];if(!iA(e)){if(iz(e)){var\nk=fh(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=iD(k);return}if(iB(e)){var\nn=tM(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var\nq=b2(e);if(q)throw g([0,f,t0],1);return q}var\nm=a[2];if(-1a[3])throw g([0,f,tZ],1)}d[1]=cz(e);return}throw g([0,f,tY],1)}var\nh=c[1];if(typeof\nh!==\"number\"&&1===h[0]){var\nr=c[4],s=c[3],i=h[1],w=c[2];if(iz(i)){var\nl=fh(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=iD(l);fi(s);return fi(r)}if(!iA(i)){if(iB(i)){var\no=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var\nt=b2(i);if(t)throw g([0,f,t3],1);return t}if(-1a[3])throw g([0,f,t2],1)}h[1]=cz(i);iI(a,s);c=r;continue}throw g([0,f,t1],1)}}function\ncA(a,b){if(typeof\nb===\"number\")return 0;if(0!==b[0]){var\ni=b[1];if(-1===i){var\nl=fh(a);b[1]=0;j(a[4],l)[1+l]=b;var\np=cA(a,b[2]);return[1,b,0,p,cA(a,b[3])]}if(!b2(i)){b[1]=cz(b[1]);var\nr=cA(a,b[2]);return[1,b,0,r,cA(a,b[3])]}var\nd=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,t6],1);var\nm=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var\ne=b[1];if(fe(e)&&b2(e)){var\nc=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var\nn=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var\nfj=[0,0,[0],0,0];function\ntN(a){return a[1]}function\ntS(a){return a[1]}function\ntT(a){return a[2]}function\ntU(a,b){var\nc=iG(0),d=iG(0),e=eC(0),f=eC(0);du(c,e,fc,a);du(d,f,fd,b);tR(c,d,e,f);return[0,c,d]}function\ntV(a){if(typeof\na===\"number\")return;if(0===a[0]){a[1]=0;return}var\nb=dq(a[3]);a[1]=(ix(dq(a[2]),b)+1|0)<<2;return}function\nt4(a){var\ne=a[6]-1|0,h=0;if(e>=0){var\nb=h;for(;;){var\nc=j(a[4],b)[1+b];if(typeof\nc!==\"number\")if(0===c[0])c[1]=iC(c[1]);else\nc[1]=iC(c[1]);var\nd=j(a[5],b)[1+b];if(!d)throw g([0,f,t5],1);if(d[2]){var\ni=ck(d);j(a[5],b)[1+b]=i}var\nk=b+1|0;if(e===b)break;b=k}}return}function\niJ(a,b,c){if(typeof\nb===\"number\"){if(typeof\nc===\"number\")return[0,fj,0]}else if(b[1]===c)return[0,fj,b];var\nt=typeof\nb===\"number\"?cy:b[1],m=tU(t,c),i=tS(m),n=tT(m),u=iF(n),v=iF(i)+u|0,o=tN(i)-v|0,w=iE(n),p=iE(i)+w|0,x=0,y=ap(p,0),z=ap(p,0),A=a?o:-1,B=a?0:-1,C=a?ap(o,0):[0],d=[0,C,B,A,z,y,x];iI(d,b);if(d[2]!==d[3])throw g([0,f,t7],1);t4(d);var\nq=cA(d,c),r=d[6]-1|0;if(r>=0){var\nh=r;for(;;){tV(j(d[4],h)[1+h]);var\nF=h-1|0;if(0===h)break;h=F}}if(!a)return[0,fj,q];var\nk=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var\ne=D;for(;;){a8(function(a){if(typeof\na!==\"number\")if(0===a[0]){var\nb=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var\nc=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var\nE=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function\nt8(d,b){if(typeof\nb===\"number\")return 0;function\nc(a){a:if(typeof\na!==\"number\"){b:{if(0===a[0]){var\nb=a[1];if(typeof\nb!==\"number\"&&0===b[0]){var\ne=a[2];if(e){var\nj=e[1];break b}var\nk=h(d[1],b[2]);a[2]=[0,k];return k}break a}var\nl=a[2];if(!l){var\nn=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var\nj=l[1]}return j}throw g([0,f,t9],1)}return[0,c(b)]}function\ndv(a,b){return[0,[0,a,b],0]}function\ndw(a){return t8(a[1],a[2])}function\nt_(a,b){var\nc=a[1];return[0,c,iJ(0,a[2],b)[2]]}function\nfk(a,b){var\nd=a[1],c=iJ(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function\ndx(a,b,c,d){var\ne=[0,d];if(w===a)var\nh=c[1],g=0;else if(ks<=a)var\nh=c[2].length-1,g=c[1];else\nvar\nh=c[2].length-1,g=0;var\nk=h-1|0;if(k>=g){var\nf=g;for(;;){var\nl=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var\nm=f+1|0;if(k===f)break;f=m}}if(ks>a)a8(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(w!==a)a8(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function\nfl(a,b,c){if(typeof\nc===\"number\")throw g([0,f,t$],1);if(0===c[0])return h(a,c[2]);var\nd=fl(a,b,c[3]);return i(b,fl(a,b,c[2]),d)}function\nbr(a,b,c){var\nd=b[2],e=b[1],f=dk(c);if(f){var\ng=f[1];return typeof\ng===\"number\"?R(e):R(fl(a,d,g))}var\nh=[0,dv(a,d)];return k(c,function(a){var\nb=t_(h[1],a);h[1]=b;var\nc=dw(b);return c?c[1]:e})}var\naT=[0,cy,aE];function\nua(a,b){return dm(b,aT,a)}function\ndy(a){return ua(a,J)}function\niK(a){function\ne(a,b){var\nc=a,d=b;for(;;){if(typeof\nc===\"number\")return d;if(0===c[0])return[0,c[2],d];var\nf=e(c[3],d);c=c[2];d=f}}return e(a,0)}var\niL=[0,R(0),function(a,b){return bY(a,b,aE)}];function\nfm(c,b){return br(function(a){return J(h(c,a))},aT,b)}function\nub(a,b){return ih(br(b,iL,a))}function\nbs(a){return ub(a,function(a){return k(a,J)})}var\nbt=e;function\nuc(a){return a[kU]}function\niM(a,b){var\nc=a?a[1]:bt;return BL(b).join(c)}function\nfn(a){return 0===uc(a)?1:0}function\ndz(a,b){return lS(a,b)}p[\"Number\"];var\nfo=null,ud=undefined;function\ncB(a){return a===fo?1:0}function\nue(a){return a===ud?1:0}function\nb3(a){var\nb=cB(a);return b?b:ue(a)}function\niN(a){return 1-b3(a)}function\ndA(a,b){return b3(b)?0:[0,h(a,b)]}var\nl=p;function\nfp(a,b){var\nc=a[b];return b3(c)?0:[0,c]}function\nfq(a){return new\nl[lh](a)}function\niO(a){return a[kU]}function\niP(c,b){return hj(iO(b),function(a){return h(c,b[a])})}function\niQ(a,b){var\nd=b.length-1,e=fq(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){e[c]=h(a,j(b,c)[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\niR(c,b){return mZ(iO(b),function(a){return h(c,b[a])})}function\nfr(f,b){return function(a,b,c){var\ne=a,d=c;for(;;){if(!d)return b;var\ng=d[2];b[e]=h(f,d[1]);e=e+1|0;d=g}}(0,fq(0),b)}function\nui(a,b){var\nc=new\nl[\"Error\"](b);return a?(c[bB]=a[1],c):c}var\nuk=Symbol.iterator;function\num(a){return a.next()}function\nun(a){var\nb=dA(function(a){return a|0},a[\"done\"]);return b?b[1]:0}function\nuo(a){return a[dV]}function\niS(i,g,c,d,e){return function(a,b){var\nd=b;for(;;){var\ne=um(a);if(un(e))return d;var\nf=uo(e),j=h(g,f[1]);d=y(c,h(i,f[0]),j,d)}}(d,e)}l[\"Promise\"];function\nuh(a){return aw(a)}function\nbu(a,b,c){return eg(a,uh(b),c)}function\nay(a){return aw(a)}function\nv(a){return H(a)}function\nb4(a,b){return a\ninstanceof\nb?1:0}var\nuf=true;function\nug(a,b){a[b];return}function\nuj(a,b){return h(function(a){throw a},ui(a,b))}function\nul(a){return a[uk]()}l[\"Event\"];function\ndB(a){return a[f7]}function\niT(a,b,c,d){var\ne=a?a[1]:{},f=bJ(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function\niU(a){return h(a,0)}var\nfs=\"change\",cC=\"click\";l[\"ArrayBuffer\"];l[\"DataView\"];function\nup(a){a.preventDefault();return 0}var\nuq=\"DOMContentLoaded\",ur=kz,us=\"scroll\",ut=\"wheel\";l[\"Blob\"];l[\"File\"];var\niV=l[\"JSON\"];l[\"encodeURI\"];l[\"decodeURI\"];l[\"encodeURIComponent\"];l[\"decodeURIComponent\"];l[\"URL\"];l[\"URLSearchParams\"];function\naU(a,b){return[0,a,b]}var\ncD=[0,bt,bt];function\nft(a){return[0,a,bt]}function\niW(a){return a}var\ncE=ly,fu=ki,iX=bB,iY=k6,fv=\"type\",fw=dV,iZ=ft(dT),ux=\"for\";function\naV(a){return aU(cE,a)}function\ni0(a){return aU(ux,a)}var\nuA=ft(\"required\");function\ndC(a){return aU(iY,a)}function\ni1(a){return aU(fv,a)}var\nuB=ft(\"selected\"),bv=l[\"document\"];function\nuu(a){return iV.stringify(a)}function\nuv(a){try{var\nc=iV.parse(a)}catch(f){var\nb=M(f);if(b[1]===e2)return[1,b[2]];throw g(b,0)}return[0,c]}function\nuw(a,b){return a?b:cD}var\nuy=\"placeholder\";function\nuz(a){return aU(fu,a)}function\nuC(a){return aU(fw,a)}function\nuD(a){return a[\"ownerDocument\"]}if(!b3(bv))bv[ke];function\nuE(a,b){a.appendChild(b);return 0}function\nuF(a,b,c,d){var\ng=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(k6,iM([0,\";\"],ck(g)));if(0!==f)a.setAttribute(ly,iM([0,aI],ck(f)));return}var\nh=e[2],k=e[1],i=k[2],j=k[1];if(fn(j))e=h;else if(dz(j,iY)){g=[0,i,g];e=h}else if(dz(j,cE)){var\nl=fn(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function\ni2(a,b,c,d){var\nf=a?a[1]:bv,g=b?b[1]:0,e=f.createElement(c);uF(e,0,0,g);a8(function(a){return uE(e,a)},d);return e}function\naW(a,b){var\nc=a?a[1]:bv;return c.createTextNode(v(b))}function\ni3(a,b,c){return fn(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function\ni4(a,b,c){return b?(c[j7].add(a),0):(c[j7].remove(a),0)}var\ni5=\"div\";function\nuP(a,b,c,d){return i2(b,c,a,d)}function\ni6(a,b,c){return uP(i5,a,b,c)}function\ni7(a){return a[ke]}function\ndD(a,b,c){eg(a,b,c);return 0}var\ndE=l[kV];function\ndF(a){return BG(function(a,b,c){var\ne=b,d=c;for(;;){if(!d)return a;var\nf=d[2];a[e]=d[1];e=e+1|0;d=f}}(fq(0),0,a))}function\naF(a){return dD(dE,uS,dF(a))}function\nb5(a){return dD(dE,uX,dF(a))}l[kV];l[\"navigator\"];var\nu0=l[\"performance\"],dG=l[lw];ug(l,u1);function\nuG(a,b){eg(a,kR,c7(b));return}function\nuH(a,b,c){var\ne=a?a[1]:l[lw],d=e.getComputedStyle(c)[b];return b3(d)?bt:d}function\nuI(a,b){var\nc=a?a[1]:lt,d=lt<=c?1:0;b.scrollIntoView(!!d);return 0}var\nuJ=\"button\",uK=\"form\",uL=kz,uM=\"label\",uN=\"option\",uO=\"select\";function\nuQ(a){var\nb=a[\"body\"];return iN(b)?b:uj(0,\"Document body is null. Try to defer your script execution.\")}function\nuR(a){return dA(function(a){return a},a[\"activeElement\"])}function\nuT(a){return dD(dE,uU,dF(a))}function\nuV(a){return dD(dE,uW,dF(a))}function\nuY(a){return a}function\nuZ(a){return a.now()}function\nu2(a,b){return l.setTimeout(bJ(1,b),a)}function\nu3(a){l.clearTimeout(a);return}function\nu4(a){l.requestAnimationFrame(bJ(1,a));return}l[\"ClipboardItem\"];l[\"FormData\"];l[\"Headers\"];l[\"Request\"];l[\"Response\"];l[\"fetch\"];l[\"MediaStream\"];l[\"MediaRecorder\"];l[\"MessageChannel\"];l[\"BroadcastChannel\"];l[\"Notification\"];l[\"WebSocket\"];function\nu5(a){return a[\"localStorage\"]}function\nu6(a,b){function\nc(a){return a}return function(a){return dA(c,a)}(a.getItem(b))}function\nu7(a,b,c){try{a.setItem(b,c);return}catch(f){var\nd=M(f);if(d[1]===e2)return;throw g(d,0)}}function\naz(a,b,c){return[0,a,b,c]}function\ni8(a){var\nb=a[1];return 82===b?ha(dk(a[2])):83<=b?ha(dk(a[2])):1}function\ndH(a){return c3(dk(a))}function\nu8(a){return et(c4(function(a){var\nb=a[1];return 82===b?[0,dH(a[2]),0]:83<=b?iK(dH(a[2])):[0,a[2],0]},a))}function\ni9(a){if(!a)return u9;var\nb=m6(i8,a),c=b[2];return[0,u8(b[1]),c]}var\ni_=kR,fx=\"before\";function\nva(a){return[0,a]}function\nvb(a,b){return[1,fo,a,b]}var\nvc=\"remove\",vd=\"contains\";function\ni$(a){var\nb=uR(uD(a));return b?bu(a,vd,[0,b[1]])|0:0}function\nja(e,b){var\nc=[0,dv(va,vb)];return k(b,function(a){var\nb=fk(c[1],a),d=b[2],g=b[1];c[1]=d;dx(w,function(a,b){return 0===a[0]?a[1][dU]=uf:0},g,0);var\nh=i$(e),i=dw(d);if(i){var\nf=function(d,b){if(0!==b[0]){if(!cB(b[1]))return b[1];var\nl=f(d,b[3]),k=f(l,b[2]);b[1]=k;return k}var\nc=b[1];delete\nc[dU];if(c.parentNode!==e)if(cB(d))bu(e,i_,[0,c]);else\nbu(d,fx,[0,c]);else{var\na=c.nextSibling!==d?1:0;if(a){if(h)var\ng=i$(c),i=g?function(a){for(;;){var\nb=c.nextSibling;if(b===d)return 1;if(cB(b))return 0;bu(c,fx,[0,b])}}(0):g;else\nvar\ni=h;var\nj=1-i}else\nvar\nj=a;if(j)if(cB(d))bu(e,i_,[0,c]);else\nbu(d,fx,[0,c])}return c};f(fo,i[1])}dx(w,function(a,b){if(0!==a[0])return 0;var\nc=a[1],d=iN(c[dU]),e=d?(delete\nc[dU],bu(c,vc,[0]),0):d;return e},g,0);return e})}var\ndI=R(0),fy=[0,bt,bt];function\nu_(a){if(!a)return u$;var\nb=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,k(b[2],J)]]}else\nif(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return m2(i8,a)?[0,et(c4(function(a){var\nb=a[1];return 82===b?[0,dH(a[2]),0]:83<=b?iK(dH(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,dm(function(a){var\nb=a[1];return 82===b?k(a[2],J):83<=b?a[2]:R(J(a[2]))},iL,a)]]}function\njb(c,b){function\nd(a){var\nb=a[2],d=a[1];return dz(d,cE)?i4(b,1,c):i3(d,[0,b],c)}function\ne(a){var\nb=a[1],d=a[2];return dz(b,cE)?i4(d,0,c):i3(b,0,c)}function\nh(a){var\nb=[0,fy];return function(a){if(b[1]!==fy)e(b[1]);var\nc=iW(a);d(c);b[1]=c;return 0}}return dm(function(a){var\nb=a[1];if(82===b){var\ni=a[2];return k(i,h(0))}if(83>b)throw g([0,f,ve],1);var\nj=a[2],c=[0,dv(function(a){var\nb=iW(a);d(b);return b},function(a,b){return fy})];return k(j,function(a){var\nb=fk(c[1],a),d=b[2],f=b[1];c[1]=d;dx(w,function(a,b){return e(a)},f,0);dw(d);return 0})},[0,dI,function(a,b){return dI}],b)}function\nfz(a,b){return iT(b[1],b[2],b[3],a)}function\nvf(c,b){return dm(function(a){var\nb=a[1];if(82===b){var\nd=[0,0];return k(a[2],function(a){var\nb=d[1];if(b)iU(b[1]);d[1]=[0,fz(c,a)];return 0})}if(83>b)throw g([0,f,vg],1);var\nh=a[2],e=[0,dv(function(a){return fz(c,a)},function(a,b){return a})];return k(h,function(a){var\nb=fk(e[1],a),c=b[2],d=b[1];e[1]=c;dx(w,function(a,b){return iU(a)},d,0);dw(c);return 0})},[0,dI,function(a,b){return dI}],b)}function\njc(a,b,c,d,e,f){var\nq=b?b[1]:0,r=c?c[1]:0,s=d?d[1]:function(a){return},m=i9(q),l=m[2],t=m[1],n=i9(r),o=n[2],u=n[1],p=u_(f),i=p[2],g=i2(a,[0,t],e,p[1]);h(s,g);if(l)if(i)var\nv=ja(g,i[1]),j=bY(jb(g,l),v,function(a,b){return b});else\nvar\nj=k(jb(g,l),function(a){return g});else\nvar\nj=i?ja(g,i[1]):R(g);a8(function(a){fz(g,a);return 0},u);var\nw=o?bY(vf(g,o),j,function(a,b){return b}):j;return w}function\nb6(a,b,c,d,e,f){return jc(b,c,d,e,a,f)}function\nvh(a,b,c,d,e,f){return jc(b,c,d,e,a,0)}function\nfA(a,b,c,d,e){return b6(uJ,a,b,c,d,e)}function\nK(a,b,c,d,e){return b6(i5,a,b,c,d,e)}function\nfB(a,b,c,d,e){return vh(uL,a,b,c,d,e)}function\njd(a,b,c,d,e){return b6(uM,a,b,c,d,e)}function\nvi(a,b,c,d,e){return b6(uK,a,b,c,d,e)}function\nvj(a,b,c,d,e){return b6(uN,a,b,c,d,e)}function\nvk(a,b,c,d,e){return b6(uO,a,b,c,d,e)}function\ndJ(a,b){return b=c)return vB;if(b===kY)return vA;if(b===\"cyan\")return vz;if(b===lm)return vy;if(b===\"magenta\")return vx;if(b===lq)return vw;if(b===\"reset\")return vv;if(b===\"white\")return vu;if(b===\"yellow\")return vt}else{if(b===\"Black\")return vK;if(b===\"Blue\")return vJ;if(b===\"Cyan\")return vI;if(b===\"Green\")return vH;if(b===\"Magenta\")return vG;if(b===\"Red\")return vF;if(b===\"White\")return vE;if(b===\"Yellow\")return vD;if(b===\"black\")return vC}throw g(fD,1)}function\njg(a,b){a9(b,a);return vM}function\njh(a){try{nM(a);nN(a)}catch(f){var\nb=M(f);if(b!==eB)throw g(b,0)}return vN}var\nji=[q,vO,ag(0)],vL=0;function\nvP(a,b,c){if(c[1]===ji)return jg(a,c[2]);if(c[1]!==cs)return h(b,c);var\ne=c[2];try{var\nf=jg(a,jf(e));return f}catch(f){var\nd=M(f);if(d===fD)return h(b,c);throw g(d,0)}}function\nvQ(a,b,c){if(c[1]===ji)return jh(a);if(c[1]!==cs)return h(b,c);var\ne=c[2];try{jf(e)}catch(f){var\nd=M(f);if(d===fD)return h(b,c);throw g(d,0)}return jh(a)}function\nvR(a){var\nc=bO(0);ry(a,1);var\nb=rz(a,0),d=b[2],e=b[1];return rA(a,[0,function(a){return vP(c,e,a)},function(a){return vQ(c,d,a)},b[3],b[4]])}function\nvS(a,b){var\nd=bo(64),c=df(d),e=a?vL:a;if(e)vR(c);return r1(function(a){a$(c,0);return co(d)},c,b)}function\nvT(a){return vS(1,a)}function\nvU(a,b){return m8(a,b)}function\nvV(a){try{var\nc=[0,l4(a)];return c}catch(f){var\nb=M(f);if(b[1]===cc)return 0;throw g(b,0)}}function\nvW(a){return a|0}function\nfE(a,b){return b?[0,h(a,b[1])]:0}function\nvX(a,b,c){return c?h(b,c[1]):a}function\nvY(a,b){if(b)return h(a,b[1]);return}function\nvZ(a,b){return b?b[1]:a}function\nv0(a,b){return a?a[1]:b}function\nv1(a){return a?[0,a[1],0]:0}function\nv2(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function\nv3(a,b){return v2(b,a)}function\nv4(a){var\nb=nE(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[38],,,,,,,,,,,b[10]]}function\nv5(a){var\nb=v4(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function\nv6(e,b){var\nd=n(e);if(dJ(d,n(b)))return 0;var\nf=n(b)-d|0;return function(a){var\nc=a;for(;;){if(vl(c,d))return 1;if(_(b,f+c|0)!==_(e,c))return 0;c=c+1|0}}(0)}function\nfF(a,b){return v6(a,b)?[0,ex(b,0,n(b)-n(a)|0)]:0}var\njj=[q,v8,ag(0)];function\njk(a){return[0,[0,a]]}function\nbw(a,b,c,d){return[1,a,b,c,d]}function\nv_(a){if(0===a[0]&&typeof\na[1]===\"number\")return 1;return 0}function\njl(a,b){if(0===b[0]){var\nc=b[1];if(typeof\nc===\"number\")return jk(a);switch(c[0]){case\n0:return[0,[1,a,c[1]]];case\n1:return[0,[2,a,c[1],c[2]]];default:return bw(4,[1,a,c[1]],v9,[1,c[2],c[3]])}}var\nd=b[2],f=b[1];if(typeof\nd!==\"number\")switch(d[0]){case\n0:break;case\n1:return bw(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var\ne=b[3],i=d[3],j=d[2],k=d[1],g=aN(e);a:if(aZ===g)var\nh=e[1];else{if(bg!==g&&bE!==g){var\nh=e;break a}var\nh=er(e)}return bw(f+1|0,[1,a,k],[bg,function(a){return jl([0,j,i],h)}],b[4])}return bw(f+1|0,[1,a,d[1]],b[3],b[4])}function\njm(a){if(0===a[0]){var\nb=a[1];if(typeof\nb===\"number\")throw g(jj,1);switch(b[0]){case\n0:return[0,v7,b[1]];case\n1:var\nn=b[2];return[0,jk(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var\nd=a[3],e=a[2],h=a[1],i=aN(d);a:if(aZ===i)var\nf=d[1];else{if(bg!==i&&bE!==i){var\nf=d;break a}var\nf=er(d)}var\nj=a[4];if(typeof\nj!==\"number\"&&0!==j[0]){var\nc=a[4];if(typeof\nc!==\"number\"&&2===c[0]){var\nq=c[3];return[0,bw(h-1|0,e,d,[1,c[1],c[2]]),q]}var\np=c[2];return[0,bw(h-1|0,e,d,[0,c[1]]),p]}var\nk=j[1];if(v_(f))return[0,[0,e],k];var\nl=jm(f),m=l[2],o=[1,m[1],m[2]];return[0,bw(h-1|0,e,mI(l[1]),o),k]}function\nwa(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return 1;case\n1:return 2;default:return 3}}function\nv$(a){try{var\nc=[0,jm(a)];return c}catch(f){var\nb=M(f);if(b===jj)return 0;throw g(b,0)}}function\nwb(a){return 0===a[0]?wa(a[1]):a[1]}function\nwc(a){return a[\"height\"]}function\nwd(a){return a}function\nwg(a){switch(a){case\n0:return wh;case\n1:return wi;default:return wj}}function\nwe(a){return wd(a[\"contentRect\"])}function\nwf(a){a[f7];return}function\nwk(a,b,c){var\nd=b?[0,c,{box:v(wg(b[1]))}]:[0,c];eg(a,\"observe\",d);return 0}function\nwl(c){return new\nl[\"ResizeObserver\"](function(a,b){return i(c,iR(function(a){return a},a),b)})}var\nwm=kc,wn=\"pattern\",jn=v5([0,ey]);function\nwo(a,b){h(a,b);return b}function\nwp(a){var\nb=fF(wq,a);if(b){var\nc=b[1],d=vV(c);if(d)return[0,[0,d[1]]];var\ng=function(a){return[0,a]};return function(a){return fE(g,a)}(fC(c))}var\ne=fF(wr,a);if(e){var\nh=function(a){return[1,a]};return function(a){return fE(h,a)}(fC(e[1]))}var\nf=fF(ws,a);if(!f)return 0;function\ni(a){return[1,a]}return function(a){return fE(i,a)}(fC(f[1]))}function\njo(a){switch(a[0]){case\n0:var\nb=a[1];return h(A(wt),b);case\n1:var\nc=a[1];return h(A(wu),c);default:var\nd=a[1];return h(A(wv),d)}}function\njp(a){var\nc=a?a[1]:i7(bv);function\nb(a){var\nb=wp(aw(uH(0,\"font-size\",a)));if(!b)return 16.;var\nc=b[1];return 0===c[0]?c[1]:a7(ww)}return function(a){switch(a[0]){case\n0:return a[1];case\n1:var\nd=a[1];return d*b(i7(bv));default:var\ne=a[1];return e*b(c)}}}function\nwx(e,b,c,d){function\nf(a,b){return y(e,b[1],b[2],a)}function\ng(a,b){return bY(d,a,b)}return function(a){return g(a,f)}(bY(b,c,function(a,b){return[0,a,b]}))}var\nwA=[q,wz,ag(0)],wC=[q,wB,ag(0)];function\nfG(a){return[0,0]}function\nfH(a,b){if(a[1])throw g(wC,1);a[1]=[0,b];return 0}function\nfI(a){var\nb=a[1];if(b)return b[1];throw g(wA,1)}function\nwy(a,b,c){return wx(function(a,b,c){return[0,a,b,c]},a,b,c)}function\nwD(a){return uu(a)}function\nwE(a){var\nb=uv(a);return 0===b[0]?[0,b[1]]:(uT([0,b[1],0]),wF)}var\njq=u5(dG);function\njr(c,b){return function(a){return u7(jq,c,a)}(wD(b))}function\nwG(a){var\nb=u6(jq,a);function\nc(a){return wE(a)}var\nd=b?[0,b[1]]:wH;return v3(d,c)}function\nwI(a,b){var\nc=wG(a);if(0===c[0])return c[1];var\nd=c[1];return typeof\nd===\"number\"?h(b,0):(uV([0,d[2],0]),h(b,0))}function\nwJ(d,b){jr(d,b);var\na=ae(b),c=e6(0,ar(a));e7(c,function(a){jr(d,b0(c));return 0});b0(c);return a}function\nwK(a,b){var\nc=H(a);return wJ(c,wI(c,b))}function\njs(a,b){return wK(a,function(a){return b})}var\nwM=jn[49],wL=jn[29];function\nwN(a){return c4(function(a){return[0,80,aV(H(a))]},wM(a))}var\nwO=0;function\nbc(d,b,c){var\na=b[1],e=82===a?[0,82,k(b[2],function(a){return function(a){return aU(d,a)}(H(a))})]:83<=a?a7(wR):[0,80,function(a){return aU(d,a)}(H(b[2]))];return[0,e,c]}function\nfJ(d,b,c){return b?[0,[0,80,function(a){return aU(d,a)}(H(b[1]))],c]:c}function\njt(a,b){var\nc=b[1];return 82===c?[0,82,k(b[2],a)]:83<=c?[0,83,fm(a,b[2])]:[0,80,h(a,b[2])]}function\nwT(a){return 0===a[0]?aV(H(a[1])):a[1]}function\nfK(a,b){return[0,jt(wT,a),b]}function\nal(a){return fK(a,0)}function\ncF(a,b){return fK(a,b)}function\nwP(a,b){var\nd=wN(b[1]),e=b[2],c=function(a){return bN(e,a)}(d);return a?[0,[0,80,uz(H(a[1]))],c]:c}function\nwQ(a){return[0,wL(a),wO]}function\nwS(a,b,c){return b?[0,[0,80,a],c]:c}function\nwU(a){return fK(jt(function(a){return[0,a]},a),0)}function\nwV(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):uI(0,b[1])}function\nwW(a,b,c,d,e){var\ng=a?a[1]:0,h=b?b[1]:0,f=ae(1),i=cF(wX,cF([0,82,k(ar(f),function(a){return a?[1,aV(\"locked\")]:[1,cD]})],g)),j=wU(wY),l=[0,[0,80,az(0,cC,function(a){return ab(f,1)})],0],m=K(0,[0,j],[0,l],0,[0,[0,82,fA(0,0,0,0,[0,[0,80,aW(0,wZ)],0])],0]),n=az(0,ut,function(a){var\nb=bq(f);return b?ab(f,0):b});return K(0,[0,i],[0,[0,[0,80,n],h]],c,[0,[0,82,k(wy(e,ar(f),d),function(a){var\nb=a[1],c=a[3];if(a[2])vY(function(a){return wV(b,a)},c);return b})],[0,[0,82,m],0]])}function\ndK(a,b){return typeof\nb===\"number\"?0:0===b[0]?[0,h(a,b[1])]:[1,b[1]]}function\nw0(e,b,c){var\nd=ae(c);return[0,az(0,b,function(a){return ab(d,h(e,dB(a)[dV]))}),d]}function\nju(a,b,c,d,e,f,g,h,i,j){var\nl=d?d[1]:0,m=f?f[1]:0,n=function(a){return fJ(wn,h,a)}(function(a){return wS(uA,m,a)}([0,[0,80,i1(H(i))],l])),o=v0(b,function(a){return[0,a]}),k=w0(a,g,j),p=k[2],q=k[1];return[0,fB(c,[0,n],[0,[0,[0,80,q],v1(e)]],0,0),p,o]}function\ndL(a,b,c,d,e,f,g,h){var\ni=c?c[1]:0,j=function(a){return fJ(fw,h,a)}(function(a){return fJ(uy,g,a)}(i));return ju(ay,a,b,[0,j],d,e,ur,f,w2,vZ(w1,h))}function\ndM(a,b,c,d){var\ne=b?b[1]:0;return ju(function(a){return 0},0,a,[0,bc(fw,d,e)],c,0,fs,0,w3,0)}function\naG(a,b){return k(a,function(a){return[0,a,b]})}function\ndN(a,b,c,d,e){var\ni=[0,[0,cy,function(a){return a}],function(a,b){var\nc=b[2],d=a[2];return[0,aE(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function\nj(a){var\nb=a[1],c=a[2];function\nd(a){var\nc=bq(b[2]);return h(b[3],c)}return[0,J(b[1]),function(a){var\nb=d(0);return h(h(c,a),b)}]}var\nf=function(a){return br(j,i,a)}(bs(d[2])),g=[0,82,k(f,function(a){var\nb=a[2];return az(0,wm,function(a){h(e,h(b,d[1]));return up(a)})})],l=k(f,function(a){return a[1]}),m=vX([0,g,0],function(a){return mU(g,a)},c);return vi(a,b,[0,m],0,[0,[0,83,bs(l)],0])}function\njv(a,b){return a?h(A(w4),b):b}function\nw5(a,b,c,d,e,f){var\nm=a?a[1]:1,n=b?b[1]:0,o=c?c[1]:0,l=d?d[1]:function(a){return function(a){return 0}},j=jv(1,e[1]),p=jv(0,e[1]),g=m?js(j,e[2]):ae(e[2]),q=bq(g);h(h(l,1),q);var\nr=e[3];jd(0,[0,[0,[0,80,i0(H(j))],0]],0,0,r);var\ns=[0,80,p],t=function(a){return bc(fv,w6,a)}(function(a){return bc(iX,s,a)}(bc(fu,[0,80,j],n))),u=[0,[0,80,az(0,fs,function(a){var\nb=ay(dB(a)[dV]);i(l,0,b);return ab(g,b)})],o];return[0,vk(0,[0,t],[0,u],0,[0,[0,83,bs(fm(function(a){var\nb=a[1],c=a[2],d=al([0,80,[1,uC(H(b))]]),e=cF([0,82,k(ar(g),function(a){return[1,uw(vp(a,b),uB)]})],d);return vj(0,[0,e],0,0,[0,[0,80,aW(0,c)],0])},f))],0]),,g]}function\nw7(a,b,c,d,e,f,g){var\nm=b?b[1]:0,n=c?c[1]:function(a){return},j=h(vT(w8),d);function\nl(a){return a?[0,e]:0}a:{if(a&&a[1]){var\no=js(j,l(g)),i=o;break a}var\ni=ae(l(g))}var\np=jd(0,[0,[0,[0,80,i0(H(j))],0]],0,0,f),q=[0,80,d],r=function(a){return bc(fv,w9,a)}(function(a){return bc(iX,q,a)}(bc(fu,[0,80,j],0))),s=[0,[0,82,k(ar(i),function(a){return a?iZ:cD})],r];return[0,K(0,0,0,0,[0,[0,82,fB(0,[0,s],[0,[0,[0,80,az(0,fs,function(a){var\nb=l(dB(a)[dT]|0);h(n,b);return ab(i,b)})],m]],0,0)],[0,[0,82,p],0]]),i]}function\nw_(a){var\nd=eA(a);return[0,,function(a){return wb(a[1])},function(a){return},,function(a,b,c){var\ne=d[2].call(null,b,c,a[2]);return[0,jl(b,a[1]),e]},function(a){var\nc=v$(a[1]);if(!c)return[0,a,0];var\ne=c[1],b=e[2],f=e[1],g=[0,[0,b,d[17].call(null,b,a[2])]];return[0,[0,f,d[6].call(null,b,a[2])],g]},function(a,b){return d[18].call(null,b,a[2])}]}function\nw$(a){var\nb=w_(a);return[0,function(a){b[3].call(null,0);b[3].call(null,0);return}]}function\nxb(a){return br(function(a){return J(K(0,0,0,0,a[3]))},aT,a)}function\nxc(a){return e8(br(function(a){return a[2]},[0,xg,function(a,b){return i(A(xf),a,b)}],a),function(a){return i(A(xe),xd,a)})}jp(0)(xk);function\nxa(a,b,c){return[0,a,b,c]}function\nxh(a){return xc(a[1][1])}function\nxi(a){var\nb=jo(a[2]),c=[0,[0,80,aV(k0)],0],d=[0,[0,80,aV(\"lwdui-lazy-table-header\")],c],e=[0,[0,80,dC(H(h(A(xj),b)))],d];return K(0,[0,e],0,0,[0,[0,83,bs(xb(a[1][1]))],0])}var\nxl=w$([0,vU]),dO=Cb(0);function\nxm(e,b,c,d){var\ns=d[3],t=d[2],l=fG(0),m=fG(0),n=jo(e[2]),v=h(A(xo),n),w=cx(function(a,b){return J([0,e$(a),a,s])},aT,t);hL(0,2048);(function(a){return xl[1].call(null,50)}(0));var\nf=ae(0),a=R(function(a){return a}),g=e6(0,sa(a,ar(f)));e7(g,function(a){var\nb=b0(g);return b[2]?h(b[1],0):0});b0(g);function\nu(a){return i(A(xn),n,a)}function\nj(a){var\nb=[0,aV(\"row_spacer\"),0];return i6(0,[0,[0,dC(H(u(a))),b]],0)}var\nx=k(br(function(a){var\nb=a[1],c=a[3],d=a[2],e=bc(cE,xp,0),f=[0,80,dC(H(v))];return b?[0,0,J(K(0,[0,[0,f,e]],0,0,[0,[0,83,bs(i(c,d,b[1]))],0])),0]:[0,1,cy,0]},[0,[0,0,cy,0],function(a,b){var\nf=b[3],g=b[2],c=b[1],d=a[3],e=a[2],h=a[1],k=iy(e),i=iy(g);if(typeof\nk===\"number\")return typeof\ni===\"number\"?[0,((h+d|0)+c|0)+f|0,e,0]:[0,(h+d|0)+c|0,g,f];if(typeof\ni===\"number\")return[0,h,e,(d+c|0)+f|0];var\nl=dJ(d+c|0,0)?function(a){return aE(e,a)}(aE(J(R(j(d+c|0))),g)):aE(e,g);return[0,h,l,f]}],w),function(a){var\nb=a[3],c=a[2],d=a[1],e=dJ(d,0)?aE(J(R(j(d))),c):c;return dJ(b,0)?aE(e,J(R(j(b)))):e}),y=xi(e),z=wl(function(a,b){var\nd=mV(a);wf(d);var\nc=wc(we(d)),e=bq(f);return e?vm(e[1],c)?ab(f,[0,c]):0:ab(f,[0,c])}),B=al(xq),o=K(0,[0,B],0,[0,function(a){return fH(l,a)}],[0,[0,83,bs(x)],0]),p=al(xr),q=[0,[0,82,k(a,function(c){return az(0,us,function(a){var\nd=[0,0.],b=[0,-1];function\ne(e){var\na=800,f=uZ(u0);if(vn(b[1],0))u3(b[1]);b[1]=u2(a,function(a){return h(c,e)});var\ng=vo(f-d[1],a);return g?(d[1]=f,h(c,e)):g}fI(m);(function(a){return e(a)}(0));return 0})})],0];function\nr(a){return fH(m,a)}var\nC=c?wW([0,p],[0,q],[0,r],k(c[1],function(a){var\nb=fI(l),c=e[2];return[0,[0,cZ(a,vW(jp([0,b])(c)))]]}),o):K(0,[0,p],[0,q],[0,r],[0,[0,82,o],0]);function\nD(a){return wk(z,0,a)}function\nE(a){return wo(D,a)}var\nF=function(a){return k(a,E)}(C),G=wP(0,wQ(xs));return K(0,[0,[0,[0,82,k(xh(e),function(a){return dC(H(a))})],G]],0,0,[0,[0,82,y],[0,[0,82,F],0]])}var\nfL=eA([0,ey]),fM=dO[\"Text\"],fN=dO[lh],fO=dO[\"Map\"],b7=id(xx,xw),bd=id(xz,xy);function\nxt(a,b){return[0,a,b]}function\njw(a){return b4(a,fN)?[0,a0,a]:b4(a,fO)?[0,w,a]:b4(a,fM)?[0,bD,a]:[0,U,a]}function\nxA(a){var\nb=fp(a,xB);if(b)return[0,b[1]];var\nc=fp(a,xC);if(c)return[1,iP(jw,c[1])];var\nd=fp(a,xD);if(d)return[2,d[1]];throw g([0,f,xE],1)}ig(xF,b7,[0,function(a){return new\nfN},function(a,b,c){a.insert(b,iQ(function(a){var\nb=a[1];return bD<=b?a0<=b?a[2]:a[2]:w<=b?a[2]:a[2]},c));return 0},function(a,b,c){a.delete(b,c);return 0},function(a,b){a.push(iQ(function(a){var\nb=a[1];return bD<=b?a0<=b?a[2]:a[2]:w<=b?a[2]:a[2]},b));return 0},function(a,d){a.forEach(function(a,b,c){return y(d,b,jw(a),c)});return 0},function(a,b){function\nc(a){return h(b,xt(xA,a))}a.observe(c);return c}]);function\nfP(a){return b4(a,fN)?[0,a0,a]:b4(a,fO)?[0,w,a]:b4(a,fM)?[0,bD,a]:[0,U,a]}function\njx(a,b){return function(a){return dA(fP,a)}(a.get(v(b)))}function\nxG(a){return a}function\nxH(a){return xG(a[f7])}function\nxI(a){var\nb=ay(a[\"action\"]);if(b!==\"add\")if(b!==la){if(b!==\"update\")throw g([0,cb,h(A(xJ),b)],1);var\nc=1}else\nvar\nc=2;else\nvar\nc=0;var\nd=a[\"oldValue\"],e=b3(d)?0:[0,fP(d)];return[0,c,0,e]}function\njy(a){return ul(a.entries())}ig(xK,bd,[0,function(a){return new\nfO},[0,function(d){var\na=d[kh][\"keys\"].entries();return iS(ay,xI,function(a,b,c){var\ne=jx(xH(d),a);return fL[2].call(null,a,[0,b[1],e,b[3]],c)},a,fL[1])}],jx,function(a,b,c){var\nd=c[1],e=bD<=d?a0<=d?c[2]:c[2]:w<=d?c[2]:c[2];a.set(v(b),e);return 0},function(a,b){a.delete(v(b));return 0},jy,function(a,d,c){return iS(ay,fP,function(a,b,c){return y(d,a,b,c)},jy(a),c)},function(a,b){function\nc(a){return h(b,a)}a.observe(c);return c}]);var\nxL=dO[\"Doc\"];function\njz(a,b){return a.getArray(v(b))}function\nbx(a,b){a.transact(bJ(1,b));return 0}function\nfQ(a){return a}var\nam=bd[4],aX=bd[3],cG=bd[1],dP=b7[5],fR=b7[4],jA=b7[3],jB=b7[1];function\nxu(a){var\nb=a[1];return[0,function(a){return iP(b,a)}(a[2][kh][\"delta\"])]}function\nxv(a,b){var\nc=a?[0,v(a[1])]:[0];return l6(fM,c)}function\nxM(a){return new\nxL}var\nxN=bd[8],xO=bd[7],xP=bd[5],xQ=bd[2][1],xR=b7[6];function\nxS(a){return a}var\nxT=B7(0)[\"Awareness\"];function\nxV(a,b,c){a.setLocalStateField(v(b),c);return}function\njC(a){return a}function\nxU(a){return new\nxT(fQ(a))}function\nxW(a,b,c,d){if(c)var\nf=[0,xX,v(c[1])],e=[0,[0,xY,v(b)],f];else\nvar\ne=[0,[0,x0,v(b)]];return xV(a,xZ,gU(e))}var\nx1=B8(0);function\nx2(a,b){var\nc=fQ(b);new\nx1(v(a),c);return}var\nx3=B$(0);function\nfS(a,b,c){switch(b){case\n0:a.on(v(x_),bJ(1,function(a){return h(c,[0,a[\"connected\"]|0])}));return;case\n1:a.on(v(x$),bJ(1,function(a){return h(c,[0,a[lo]|0])}));return;default:a.on(v(ye),bJ(1,function(b){function\na(a){return function(a){return iR(ay,a)}(b[a])}var\nd=a(ya),e=a(yb),f=a(yc);return h(c,[0,a(yd),f,e,d])}));return}}function\nx4(a,b,c,d){var\nf=cj(function(a){return[0,x5,fr(v,a)]},b),e=[0,[0,x8,{config:{iceServers:fr(function(a){return a},c4(function(a){return{urls:v(h(A(x7),a))}},x6))}}]];aF([0,e,0]);function\ng(a){return a}var\ni=gU(c7(function(a){return hc(g,a)}([0,f,[0,e,[0,cj(function(a){return[0,x9,jC(a)]},c),0]]]))),j=fQ(d);return new\nx3(v(a),j,i)}var\njD=B9(0),yf=B_(0);function\nyh(a){switch(a){case\n0:var\nb=yi;break;case\n1:var\nb=yj;break;case\n2:var\nb=yk;break;case\n3:var\nb=yl;break;default:var\nb=ym}return v(b)}function\nyg(a,b){jD.register(v(a),b);return}function\nyn(a,b,c,d){var\ne=a?a[1]:0,f=e?yo:yr,g=cj(function(a){return[0,yp,!!a]},b),h=gU(c7(hc(function(a){return a},[0,g,[0,cj(function(a){return[0,yq,fr(yh,a[1])]},c),0]])));return{theme:v(f),modules:h}}function\nys(a,b){return new\njD(a,b)}function\nyt(a){return a}var\nyu=Ca(0)[\"QuillBinding\"];function\nyv(a,b,c){var\nd=mK(cj(jC,a)),e=[0,yt(c),d];function\nf(a,b){l6(a,b);return}return function(a){return f(yu,a)}(c7([0,xS(b),e]))}function\nyw(a,b,c){return y(eN(s,yx),b,c,a)}function\njE(a,b,c){var\nd=0<=c?1:0;if(d)var\ne=0<=b?1:0,f=e?(b+c|0)<=a?1:0:e;else\nvar\nf=d;var\ng=1-f;return g?yw(a,b,c):g}var\nyy=[0];function\nyz(a,b,c,d){var\ne=ap(a,b);cm(c,0,e,0,d);return e}function\njF(a,b){return b<=a?a:b}function\njG(a){return eN(s,a)}function\nyA(a,b){var\nc=a[1];return i(jG(yB),b,c)}function\nyC(a,b){return i(jG(yD),a,b.length-1)}function\ncH(a,b){var\nc=1-(a<=b.length-1?1:0);return c?yC(a,b):c}function\njH(a){return[0,0,0,yy]}function\ncI(a){return a[1]}function\nyE(a,b){return a[3][1+b]}function\njI(a){var\nb=a[1],c=a[3];cH(b,c);if(0>>4|0)));var\nf=b+1|0;function\ni(a,b,c){at(a,b,c);return}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var\nn=D(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var\nm=D(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var\nl=D(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var\nk=D(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return $(e);var\nj=D(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}var\nyR=hG(0),an=xM(0),fU=xU(an);yg(yT,yf);xW(fU,yU,0,0);var\ndQ=x4(yW,yV,[0,fU],an);x2(yX,an);dG[\"yjsdoc\"]=an;dG[\"yjsprovider\"]=dQ;var\nfV=ae(0),jL=ae(0),jM=ae(0);fS(dQ,0,function(a){var\nb=a[1];b5([0,yY,[0,!!b,0]]);return ab(jL,b)});fS(dQ,1,function(a){var\nb=a[1];b5([0,yZ,[0,!!b,0]]);return ab(jM,b)});var\ndR=[0,0];fS(dQ,2,function(a){b5([0,y0,[0,a,0]]);function\nc(b){return m3(function(a){return ez(b,a)},a[3])}function\nd(b){var\nc=[0,0];dR[1]=hb(function(a){return ez(b,a)?(c[1]=[0,b],1):0},dR[1]);return c[1]}var\nb=eu(function(a,b){if(d(b))return a;if(c(b))dR[1]=[0,b,dR[1]];return a+1|0},0,a[1]),e=es(a[2]);return function(a){return ab(fV,a)}((bq(fV)+b|0)-e|0)});var\ny4=ar(jM),y6=cF(y5,al([0,82,bY(ar(jL),y4,function(a,b){var\nc=a?b?y1:y2:y3;return[0,c]})])),y8=K(0,[0,y6],0,0,[0,[0,80,aW(0,y7)],0]),y9=[0,[0,82,y8],[0,[0,82,k(ar(fV),function(a){return aW(0,ms(a))})],0]];function\nyS(a){return yO(yR,0)}function\nza(a,b){var\nc=a?a[1]:64,d=ip(0);return[0,d,hL(0,c)]}function\njN(a,b,c){var\ne=hM(a[2],b);if(e)var\nd=e[1];else{var\ng=e_(0,a[1]);hN(a[2],b,g);var\nd=g}var\nf=e$(d);return f?ab(f[1][2],[0,c]):s2(d,[0,b,ae([0,c])])}function\nfW(a,b){var\nc=hM(a[2],b);if(c)var\nd=c[1];else{var\nf=a[1],e=e_([0,[0,b,ae(0)]],f);hN(a[2],b,e);var\nd=e}return ar(c3(e$(d))[2])}function\nfX(a,b){return k(fW(a,b),function(a){if(!a)return 0;var\nb=a[1];if(typeof\nb!==\"number\"&&U===b[1])return[0,ay(b[2])];throw g([0,f,zb],1)})}function\nzc(a){var\nb=ip(0);return[0,b,jH(0)]}function\nzd(a){try{var\nc=[0,jK(a[2],0)];return c}catch(f){var\nb=M(f);if(b[1]===cb)return 0;throw g(b,0)}}function\njO(a,b){var\nc=e_(a,b[1]);return yH(b[2],c)}function\njP(a,b,c,d){var\ne=[0,b,[0,c,[0,cI(d),0]]];b5([0,ze,[0,cI(a),e]]);var\nf=cI(d),g=jK(a,0);fT(d,hj(c,function(a){return g}));return yL(a,b,d,f,c)}function\nzf(i,b,c){var\ne=[0,0],j=i[2],d=jH(0);hk(function(a){switch(a[0]){case\n0:var\nm=a[1];jP(j,e[1],m,d);e[1]=e[1]+m|0;return 0;case\n1:var\nc=a[1];if(0!==cI(d)){var\no=[0,jI(d)];return fT(d,hl(function(a){var\nd=h(b,a),c=sY([0,d],o[1]);o[1]=c;return c},c))}var\nn=zd(i);if(!n)return hk(function(a){var\nc=h(b,a);return jO([0,c],[0,i[1],d])},c);var\ns=n[1];return fT(d,hl(function(a){return sW([0,h(b,a)],s)},c));default:var\nk=a[1],t=0===e[1]?tE(i[1]):iw(jI(d)),p=[0,t],u=1;if(k>=1){var\nl=u;for(;;){var\nq=p[1];if(!q)throw g([0,f,zg],1);var\nr=q[1];p[1]=iw(r);s5(r);var\nv=l+1|0;if(k===l)break;l=v}}e[1]=e[1]+k|0;return 0}},c);var\nk=e[1],a=cI(j)-k|0;if(0 .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}\n\n/*# sourceMappingURL=quill.core.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-bubble.ql-toolbar:after,.ql-bubble .ql-toolbar:after{clear:both;content:'';display:table}.ql-bubble.ql-toolbar button,.ql-bubble .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-bubble.ql-toolbar button svg,.ql-bubble .ql-toolbar button svg{float:left;height:100%}.ql-bubble.ql-toolbar button:active:hover,.ql-bubble .ql-toolbar button:active:hover{outline:none}.ql-bubble.ql-toolbar input.ql-image[type=file],.ql-bubble .ql-toolbar input.ql-image[type=file]{display:none}.ql-bubble.ql-toolbar button:hover,.ql-bubble .ql-toolbar button:hover,.ql-bubble.ql-toolbar button:focus,.ql-bubble .ql-toolbar button:focus,.ql-bubble.ql-toolbar button.ql-active,.ql-bubble .ql-toolbar button.ql-active,.ql-bubble.ql-toolbar .ql-picker-label:hover,.ql-bubble .ql-toolbar .ql-picker-label:hover,.ql-bubble.ql-toolbar .ql-picker-label.ql-active,.ql-bubble .ql-toolbar .ql-picker-label.ql-active,.ql-bubble.ql-toolbar .ql-picker-item:hover,.ql-bubble .ql-toolbar .ql-picker-item:hover,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected{color:#fff}.ql-bubble.ql-toolbar button:hover .ql-fill,.ql-bubble .ql-toolbar button:hover .ql-fill,.ql-bubble.ql-toolbar button:focus .ql-fill,.ql-bubble .ql-toolbar button:focus .ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#fff}.ql-bubble.ql-toolbar button:hover .ql-stroke,.ql-bubble .ql-toolbar button:hover .ql-stroke,.ql-bubble.ql-toolbar button:focus .ql-stroke,.ql-bubble .ql-toolbar button:focus .ql-stroke,.ql-bubble.ql-toolbar button.ql-active .ql-stroke,.ql-bubble .ql-toolbar button.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble.ql-toolbar button:hover .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover .ql-stroke-miter,.ql-bubble.ql-toolbar button:focus .ql-stroke-miter,.ql-bubble .ql-toolbar button:focus .ql-stroke-miter,.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#fff}@media (pointer:coarse){.ql-bubble.ql-toolbar button:hover:not(.ql-active),.ql-bubble .ql-toolbar button:hover:not(.ql-active){color:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#ccc}}.ql-bubble{box-sizing:border-box}.ql-bubble *{box-sizing:border-box}.ql-bubble .ql-hidden{display:none}.ql-bubble .ql-out-bottom,.ql-bubble .ql-out-top{visibility:hidden}.ql-bubble .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-bubble .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-bubble .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-bubble .ql-formats{display:inline-block;vertical-align:middle}.ql-bubble .ql-formats:after{clear:both;content:'';display:table}.ql-bubble .ql-stroke{fill:none;stroke:#ccc;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-bubble .ql-stroke-miter{fill:none;stroke:#ccc;stroke-miterlimit:10;stroke-width:2}.ql-bubble .ql-fill,.ql-bubble .ql-stroke.ql-fill{fill:#ccc}.ql-bubble .ql-empty{fill:none}.ql-bubble .ql-even{fill-rule:evenodd}.ql-bubble .ql-thin,.ql-bubble .ql-stroke.ql-thin{stroke-width:1}.ql-bubble .ql-transparent{opacity:.4}.ql-bubble .ql-direction svg:last-child{display:none}.ql-bubble .ql-direction.ql-active svg:last-child{display:inline}.ql-bubble .ql-direction.ql-active svg:first-child{display:none}.ql-bubble .ql-editor h1{font-size:2em}.ql-bubble .ql-editor h2{font-size:1.5em}.ql-bubble .ql-editor h3{font-size:1.17em}.ql-bubble .ql-editor h4{font-size:1em}.ql-bubble .ql-editor h5{font-size:.83em}.ql-bubble .ql-editor h6{font-size:.67em}.ql-bubble .ql-editor a{text-decoration:underline}.ql-bubble .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-bubble .ql-editor code,.ql-bubble .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-bubble .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-bubble .ql-editor code{font-size:85%;padding:2px 4px}.ql-bubble .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-bubble .ql-editor img{max-width:100%}.ql-bubble .ql-picker{color:#ccc;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-bubble .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-bubble .ql-picker-label::before{display:inline-block;line-height:22px}.ql-bubble .ql-picker-options{background-color:#444;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-bubble .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-bubble .ql-picker.ql-expanded .ql-picker-label{color:#777;z-index:2}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-bubble .ql-color-picker,.ql-bubble .ql-icon-picker{width:28px}.ql-bubble .ql-color-picker .ql-picker-label,.ql-bubble .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-label svg,.ql-bubble .ql-icon-picker .ql-picker-label svg{right:4px}.ql-bubble .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-bubble .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-bubble .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-bubble .ql-picker.ql-header{width:98px}.ql-bubble .ql-picker.ql-header .ql-picker-label::before,.ql-bubble .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-bubble .ql-picker.ql-font{width:108px}.ql-bubble .ql-picker.ql-font .ql-picker-label::before,.ql-bubble .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-bubble .ql-picker.ql-size{width:98px}.ql-bubble .ql-picker.ql-size .ql-picker-label::before,.ql-bubble .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-bubble .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-bubble .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-bubble .ql-toolbar .ql-formats{margin:8px 12px 8px 0}.ql-bubble .ql-toolbar .ql-formats:first-child{margin-left:12px}.ql-bubble .ql-color-picker svg{margin:1px}.ql-bubble .ql-color-picker .ql-picker-item.ql-selected,.ql-bubble .ql-color-picker .ql-picker-item:hover{border-color:#fff}.ql-bubble .ql-tooltip{background-color:#444;border-radius:25px;color:#fff}.ql-bubble .ql-tooltip-arrow{border-left:6px solid transparent;border-right:6px solid transparent;content:\" \";display:block;left:50%;margin-left:-6px;position:absolute}.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow{border-bottom:6px solid #444;top:-6px}.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow{border-top:6px solid #444;bottom:-6px}.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor{display:block}.ql-bubble .ql-tooltip.ql-editing .ql-formats{visibility:hidden}.ql-bubble .ql-tooltip-editor{display:none}.ql-bubble .ql-tooltip-editor input[type=text]{background:transparent;border:none;color:#fff;font-size:13px;height:100%;outline:none;padding:10px 20px;position:absolute;width:100%}.ql-bubble .ql-tooltip-editor a{top:10px;position:absolute;right:20px}.ql-bubble .ql-tooltip-editor a:before{color:#ccc;content:\"\\00D7\";font-size:16px;font-weight:bold}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close){position:relative;white-space:nowrap}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before{background-color:#444;border-radius:15px;top:-5px;font-size:12px;color:#fff;content:attr(href);font-weight:normal;overflow:hidden;padding:5px 15px;text-decoration:none;z-index:1}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{border-top:6px solid #444;border-left:6px solid transparent;border-right:6px solid transparent;top:0;content:\" \";height:0;width:0}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{left:0;margin-left:50%;position:absolute;transform:translate(-50%,-100%);transition:visibility 0s ease 200ms;visibility:hidden}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::after{visibility:visible}\n\n/*# sourceMappingURL=quill.bubble.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow + .ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}\n\n/*# sourceMappingURL=quill.snow.css.map*/", "/**\n * Common Math expressions.\n *\n * @module math\n */\n\nexport const floor = Math.floor\nexport const ceil = Math.ceil\nexport const abs = Math.abs\nexport const imul = Math.imul\nexport const round = Math.round\nexport const log10 = Math.log10\nexport const log2 = Math.log2\nexport const log = Math.log\nexport const sqrt = Math.sqrt\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The sum of a and b\n */\nexport const add = (a, b) => a + b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The smaller element of a and b\n */\nexport const min = (a, b) => a < b ? a : b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The bigger element of a and b\n */\nexport const max = (a, b) => a > b ? a : b\n\nexport const isNaN = Number.isNaN\n\nexport const pow = Math.pow\n/**\n * Base 10 exponential function. Returns the value of 10 raised to the power of pow.\n *\n * @param {number} exp\n * @return {number}\n */\nexport const exp10 = exp => Math.pow(10, exp)\n\nexport const sign = Math.sign\n\n/**\n * @param {number} n\n * @return {boolean} Wether n is negative. This function also differentiates between -0 and +0\n */\nexport const isNegativeZero = n => n !== 0 ? n < 0 : 1 / n < 0\n", "/**\n * Utility helpers for working with numbers.\n *\n * @module number\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\n\nexport const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER\nexport const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER\n\nexport const LOWEST_INT32 = 1 << 31\nexport const HIGHEST_INT32 = binary.BITS31\nexport const HIGHEST_UINT32 = binary.BITS32\n\n/* c8 ignore next */\nexport const isInteger = Number.isInteger || (num => typeof num === 'number' && isFinite(num) && math.floor(num) === num)\nexport const isNaN = Number.isNaN\nexport const parseInt = Number.parseInt\n\n/**\n * Count the number of \"1\" bits in an unsigned 32bit number.\n *\n * Super fun bitcount algorithm by Brian Kernighan.\n *\n * @param {number} n\n */\nexport const countBits = n => {\n n &= binary.BITS32\n let count = 0\n while (n) {\n n &= (n - 1)\n count++\n }\n return count\n}\n", "/**\n * Utility module to work with sets.\n *\n * @module set\n */\n\nexport const create = () => new Set()\n\n/**\n * @template T\n * @param {Set} set\n * @return {Array}\n */\nexport const toArray = set => Array.from(set)\n\n/**\n * @template T\n * @param {Set} set\n * @return {T}\n */\nexport const first = set =>\n set.values().next().value ?? undefined\n\n/**\n * @template T\n * @param {Iterable} entries\n * @return {Set}\n */\nexport const from = entries => new Set(entries)\n", "/**\n * Utility module to work with Arrays.\n *\n * @module array\n */\n\nimport * as set from './set.js'\n\n/**\n * Return the last element of an array. The element must exist\n *\n * @template L\n * @param {ArrayLike} arr\n * @return {L}\n */\nexport const last = arr => arr[arr.length - 1]\n\n/**\n * @template C\n * @return {Array}\n */\nexport const create = () => /** @type {Array} */ ([])\n\n/**\n * @template D\n * @param {Array} a\n * @return {Array}\n */\nexport const copy = a => /** @type {Array} */ (a.slice())\n\n/**\n * Append elements from src to dest\n *\n * @template M\n * @param {Array} dest\n * @param {Array} src\n */\nexport const appendTo = (dest, src) => {\n for (let i = 0; i < src.length; i++) {\n dest.push(src[i])\n }\n}\n\n/**\n * Transforms something array-like to an actual Array.\n *\n * @function\n * @template T\n * @param {ArrayLike|Iterable} arraylike\n * @return {T}\n */\nexport const from = Array.from\n\n/**\n * True iff condition holds on every element in the Array.\n *\n * @function\n * @template ITEM\n * @template {ArrayLike} ARR\n *\n * @param {ARR} arr\n * @param {function(ITEM, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const every = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (!f(arr[i], i, arr)) {\n return false\n }\n }\n return true\n}\n\n/**\n * True iff condition holds on some element in the Array.\n *\n * @function\n * @template S\n * @template {ArrayLike} ARR\n * @param {ARR} arr\n * @param {function(S, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const some = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (f(arr[i], i, arr)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @template ELEM\n *\n * @param {ArrayLike} a\n * @param {ArrayLike} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index])\n\n/**\n * @template ELEM\n * @param {Array>} arr\n * @return {Array}\n */\nexport const flatten = arr => fold(arr, /** @type {Array} */ ([]), (acc, val) => acc.concat(val))\n\n/**\n * @template T\n * @param {number} len\n * @param {function(number, Array):T} f\n * @return {Array}\n */\nexport const unfold = (len, f) => {\n const array = new Array(len)\n for (let i = 0; i < len; i++) {\n array[i] = f(i, array)\n }\n return array\n}\n\n/**\n * @template T\n * @template RESULT\n * @param {Array} arr\n * @param {RESULT} seed\n * @param {function(RESULT, T, number):RESULT} folder\n */\nexport const fold = (arr, seed, folder) => arr.reduce(folder, seed)\n\nexport const isArray = Array.isArray\n\n/**\n * @template T\n * @param {Array} arr\n * @return {Array}\n */\nexport const unique = arr => from(set.from(arr))\n\n/**\n * @template T\n * @template M\n * @param {ArrayLike} arr\n * @param {function(T):M} mapper\n * @return {Array}\n */\nexport const uniqueBy = (arr, mapper) => {\n /**\n * @type {Set}\n */\n const happened = set.create()\n /**\n * @type {Array}\n */\n const result = []\n for (let i = 0; i < arr.length; i++) {\n const el = arr[i]\n const mapped = mapper(el)\n if (!happened.has(mapped)) {\n happened.add(mapped)\n result.push(el)\n }\n }\n return result\n}\n\n/**\n * @template {ArrayLike} ARR\n * @template {function(ARR extends ArrayLike ? T : never, number, ARR):any} MAPPER\n * @param {ARR} arr\n * @param {MAPPER} mapper\n * @return {Array}\n */\nexport const map = (arr, mapper) => {\n /**\n * @type {Array}\n */\n const res = Array(arr.length)\n for (let i = 0; i < arr.length; i++) {\n res[i] = mapper(/** @type {any} */ (arr[i]), i, /** @type {any} */ (arr))\n }\n return /** @type {any} */ (res)\n}\n", "import * as array from './array.js'\n\n/**\n * Utility module to work with strings.\n *\n * @module string\n */\n\nexport const fromCharCode = String.fromCharCode\nexport const fromCodePoint = String.fromCodePoint\n\n/**\n * The largest utf16 character.\n * Corresponds to Uint8Array([255, 255]) or charcodeof(2x2^8)\n */\nexport const MAX_UTF16_CHARACTER = fromCharCode(65535)\n\n/**\n * @param {string} s\n * @return {string}\n */\nconst toLowerCase = s => s.toLowerCase()\n\nconst trimLeftRegex = /^\\s*/g\n\n/**\n * @param {string} s\n * @return {string}\n */\nexport const trimLeft = s => s.replace(trimLeftRegex, '')\n\nconst fromCamelCaseRegex = /([A-Z])/g\n\n/**\n * @param {string} s\n * @param {string} separator\n * @return {string}\n */\nexport const fromCamelCase = (s, separator) => trimLeft(s.replace(fromCamelCaseRegex, match => `${separator}${toLowerCase(match)}`))\n\n/**\n * Compute the utf8ByteLength\n * @param {string} str\n * @return {number}\n */\nexport const utf8ByteLength = str => unescape(encodeURIComponent(str)).length\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Polyfill = str => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n const buf = new Uint8Array(len)\n for (let i = 0; i < len; i++) {\n buf[i] = /** @type {number} */ (encodedString.codePointAt(i))\n }\n return buf\n}\n\n/* c8 ignore next */\nexport const utf8TextEncoder = /** @type {TextEncoder} */ (typeof TextEncoder !== 'undefined' ? new TextEncoder() : null)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Native = str => utf8TextEncoder.encode(str)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\n/* c8 ignore next */\nexport const encodeUtf8 = utf8TextEncoder ? _encodeUtf8Native : _encodeUtf8Polyfill\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Polyfill = buf => {\n let remainingLen = buf.length\n let encodedString = ''\n let bufPos = 0\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n const bytes = buf.subarray(bufPos, bufPos + nextLen)\n bufPos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n return decodeURIComponent(escape(encodedString))\n}\n\n/* c8 ignore next */\nexport let utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8', { fatal: true, ignoreBOM: true })\n\n/* c8 ignore start */\nif (utf8TextDecoder && utf8TextDecoder.decode(new Uint8Array()).length === 1) {\n // Safari doesn't handle BOM correctly.\n // This fixes a bug in Safari 13.0.5 where it produces a BOM the first time it is called.\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the first call and\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the second call\n // Another issue is that from then on no BOM chars are recognized anymore\n /* c8 ignore next */\n utf8TextDecoder = null\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Native = buf => /** @type {TextDecoder} */ (utf8TextDecoder).decode(buf)\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\n/* c8 ignore next */\nexport const decodeUtf8 = utf8TextDecoder ? _decodeUtf8Native : _decodeUtf8Polyfill\n\n/**\n * @param {string} str The initial string\n * @param {number} index Starting position\n * @param {number} remove Number of characters to remove\n * @param {string} insert New content to insert\n */\nexport const splice = (str, index, remove, insert = '') => str.slice(0, index) + insert + str.slice(index + remove)\n\n/**\n * @param {string} source\n * @param {number} n\n */\nexport const repeat = (source, n) => array.unfold(n, () => source).join('')\n", "/**\n * Efficient schema-less binary encoding with support for variable length encoding.\n *\n * Use [lib0/encoding] with [lib0/decoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module encoding\n */\n\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as binary from './binary.js'\nimport * as string from './string.js'\nimport * as array from './array.js'\n\n/**\n * A BinaryEncoder handles the encoding to an Uint8Array.\n */\nexport class Encoder {\n constructor () {\n this.cpos = 0\n this.cbuf = new Uint8Array(100)\n /**\n * @type {Array}\n */\n this.bufs = []\n }\n}\n\n/**\n * @function\n * @return {Encoder}\n */\nexport const createEncoder = () => new Encoder()\n\n/**\n * @param {function(Encoder):void} f\n */\nexport const encode = (f) => {\n const encoder = createEncoder()\n f(encoder)\n return toUint8Array(encoder)\n}\n\n/**\n * The current length of the encoded data.\n *\n * @function\n * @param {Encoder} encoder\n * @return {number}\n */\nexport const length = encoder => {\n let len = encoder.cpos\n for (let i = 0; i < encoder.bufs.length; i++) {\n len += encoder.bufs[i].length\n }\n return len\n}\n\n/**\n * Check whether encoder is empty.\n *\n * @function\n * @param {Encoder} encoder\n * @return {boolean}\n */\nexport const hasContent = encoder => encoder.cpos > 0 || encoder.bufs.length > 0\n\n/**\n * Transform to Uint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @return {Uint8Array} The created ArrayBuffer.\n */\nexport const toUint8Array = encoder => {\n const uint8arr = new Uint8Array(length(encoder))\n let curPos = 0\n for (let i = 0; i < encoder.bufs.length; i++) {\n const d = encoder.bufs[i]\n uint8arr.set(d, curPos)\n curPos += d.length\n }\n uint8arr.set(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos), curPos)\n return uint8arr\n}\n\n/**\n * Verify that it is possible to write `len` bytes wtihout checking. If\n * necessary, a new Buffer with the required length is attached.\n *\n * @param {Encoder} encoder\n * @param {number} len\n */\nexport const verifyLen = (encoder, len) => {\n const bufferLen = encoder.cbuf.length\n if (bufferLen - encoder.cpos < len) {\n encoder.bufs.push(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos))\n encoder.cbuf = new Uint8Array(math.max(bufferLen, len) * 2)\n encoder.cpos = 0\n }\n}\n\n/**\n * Write one byte to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The byte that is to be encoded.\n */\nexport const write = (encoder, num) => {\n const bufferLen = encoder.cbuf.length\n if (encoder.cpos === bufferLen) {\n encoder.bufs.push(encoder.cbuf)\n encoder.cbuf = new Uint8Array(bufferLen * 2)\n encoder.cpos = 0\n }\n encoder.cbuf[encoder.cpos++] = num\n}\n\n/**\n * Write one byte at a specific position.\n * Position must already be written (i.e. encoder.length > pos)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos Position to which to write data\n * @param {number} num Unsigned 8-bit integer\n */\nexport const set = (encoder, pos, num) => {\n let buffer = null\n // iterate all buffers and adjust position\n for (let i = 0; i < encoder.bufs.length && buffer === null; i++) {\n const b = encoder.bufs[i]\n if (pos < b.length) {\n buffer = b // found buffer\n } else {\n pos -= b.length\n }\n }\n if (buffer === null) {\n // use current buffer\n buffer = encoder.cbuf\n }\n buffer[pos] = num\n}\n\n/**\n * Write one byte as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint8 = write\n\n/**\n * Write one byte as an unsigned Integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint8 = set\n\n/**\n * Write two bytes as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint16 = (encoder, num) => {\n write(encoder, num & binary.BITS8)\n write(encoder, (num >>> 8) & binary.BITS8)\n}\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint16 = (encoder, pos, num) => {\n set(encoder, pos, num & binary.BITS8)\n set(encoder, pos + 1, (num >>> 8) & binary.BITS8)\n}\n\n/**\n * Write two bytes as an unsigned integer\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32 = (encoder, num) => {\n for (let i = 0; i < 4; i++) {\n write(encoder, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write two bytes as an unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32BigEndian = (encoder, num) => {\n for (let i = 3; i >= 0; i--) {\n write(encoder, (num >>> (8 * i)) & binary.BITS8)\n }\n}\n\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint32 = (encoder, pos, num) => {\n for (let i = 0; i < 4; i++) {\n set(encoder, pos + i, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write a variable length unsigned integer. Max encodable integer is 2^53.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarUint = (encoder, num) => {\n while (num > binary.BITS7) {\n write(encoder, binary.BIT8 | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n write(encoder, binary.BITS7 & num)\n}\n\n/**\n * Write a variable length integer.\n *\n * We use the 7th bit instead for signaling that this is a negative number.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarInt = (encoder, num) => {\n const isNegative = math.isNegativeZero(num)\n if (isNegative) {\n num = -num\n }\n // |- whether to continue reading |- whether is negative |- number\n write(encoder, (num > binary.BITS6 ? binary.BIT8 : 0) | (isNegative ? binary.BIT7 : 0) | (binary.BITS6 & num))\n num = math.floor(num / 64) // shift >>> 6\n // We don't need to consider the case of num === 0 so we can use a different\n // pattern here than above.\n while (num > 0) {\n write(encoder, (num > binary.BITS7 ? binary.BIT8 : 0) | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n}\n\n/**\n * A cache to store strings temporarily\n */\nconst _strBuffer = new Uint8Array(30000)\nconst _maxStrBSize = _strBuffer.length / 3\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringNative = (encoder, str) => {\n if (str.length < _maxStrBSize) {\n // We can encode the string into the existing buffer\n /* c8 ignore next */\n const written = string.utf8TextEncoder.encodeInto(str, _strBuffer).written || 0\n writeVarUint(encoder, written)\n for (let i = 0; i < written; i++) {\n write(encoder, _strBuffer[i])\n }\n } else {\n writeVarUint8Array(encoder, string.encodeUtf8(str))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringPolyfill = (encoder, str) => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n write(encoder, /** @type {number} */ (encodedString.codePointAt(i)))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\n/* c8 ignore next */\nexport const writeVarString = (string.utf8TextEncoder && /** @type {any} */ (string.utf8TextEncoder).encodeInto) ? _writeVarStringNative : _writeVarStringPolyfill\n\n/**\n * Write a string terminated by a special byte sequence. This is not very performant and is\n * generally discouraged. However, the resulting byte arrays are lexiographically ordered which\n * makes this a nice feature for databases.\n *\n * The string will be encoded using utf8 and then terminated and escaped using writeTerminatingUint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const writeTerminatedString = (encoder, str) =>\n writeTerminatedUint8Array(encoder, string.encodeUtf8(str))\n\n/**\n * Write a terminating Uint8Array. Note that this is not performant and is generally\n * discouraged. There are few situations when this is needed.\n *\n * We use 0x0 as a terminating character. 0x1 serves as an escape character for 0x0 and 0x1.\n *\n * Example: [0,1,2] is encoded to [1,0,1,1,2,0]. 0x0, and 0x1 needed to be escaped using 0x1. Then\n * the result is terminated using the 0x0 character.\n *\n * This is basically how many systems implement null terminated strings. However, we use an escape\n * character 0x1 to avoid issues and potenial attacks on our database (if this is used as a key\n * encoder for NoSql databases).\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} buf The string that is to be encoded.\n */\nexport const writeTerminatedUint8Array = (encoder, buf) => {\n for (let i = 0; i < buf.length; i++) {\n const b = buf[i]\n if (b === 0 || b === 1) {\n write(encoder, 1)\n }\n write(encoder, buf[i])\n }\n write(encoder, 0)\n}\n\n/**\n * Write the content of another Encoder.\n *\n * @TODO: can be improved!\n * - Note: Should consider that when appending a lot of small Encoders, we should rather clone than referencing the old structure.\n * Encoders start with a rather big initial buffer.\n *\n * @function\n * @param {Encoder} encoder The enUint8Arr\n * @param {Encoder} append The BinaryEncoder to be written.\n */\nexport const writeBinaryEncoder = (encoder, append) => writeUint8Array(encoder, toUint8Array(append))\n\n/**\n * Append fixed-length Uint8Array to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeUint8Array = (encoder, uint8Array) => {\n const bufferLen = encoder.cbuf.length\n const cpos = encoder.cpos\n const leftCopyLen = math.min(bufferLen - cpos, uint8Array.length)\n const rightCopyLen = uint8Array.length - leftCopyLen\n encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos)\n encoder.cpos += leftCopyLen\n if (rightCopyLen > 0) {\n // Still something to write, write right half..\n // Append new buffer\n encoder.bufs.push(encoder.cbuf)\n // must have at least size of remaining buffer\n encoder.cbuf = new Uint8Array(math.max(bufferLen * 2, rightCopyLen))\n // copy array\n encoder.cbuf.set(uint8Array.subarray(leftCopyLen))\n encoder.cpos = rightCopyLen\n }\n}\n\n/**\n * Append an Uint8Array to Encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeVarUint8Array = (encoder, uint8Array) => {\n writeVarUint(encoder, uint8Array.byteLength)\n writeUint8Array(encoder, uint8Array)\n}\n\n/**\n * Create an DataView of the next `len` bytes. Use it to write data after\n * calling this function.\n *\n * ```js\n * // write float32 using DataView\n * const dv = writeOnDataView(encoder, 4)\n * dv.setFloat32(0, 1.1)\n * // read float32 using DataView\n * const dv = readFromDataView(encoder, 4)\n * dv.getFloat32(0) // => 1.100000023841858 (leaving it to the reader to find out why this is the correct result)\n * ```\n *\n * @param {Encoder} encoder\n * @param {number} len\n * @return {DataView}\n */\nexport const writeOnDataView = (encoder, len) => {\n verifyLen(encoder, len)\n const dview = new DataView(encoder.cbuf.buffer, encoder.cpos, len)\n encoder.cpos += len\n return dview\n}\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat32 = (encoder, num) => writeOnDataView(encoder, 4).setFloat32(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat64 = (encoder, num) => writeOnDataView(encoder, 8).setFloat64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigInt64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigInt64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigUint64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigUint64(0, num, false)\n\nconst floatTestBed = new DataView(new ArrayBuffer(4))\n/**\n * Check if a number can be encoded as a 32 bit float.\n *\n * @param {number} num\n * @return {boolean}\n */\nconst isFloat32 = num => {\n floatTestBed.setFloat32(0, num)\n return floatTestBed.getFloat32(0) === num\n}\n\n/**\n * Encode data with efficient binary format.\n *\n * Differences to JSON:\n * \u2022 Transforms data to a binary format (not to a string)\n * \u2022 Encodes undefined, NaN, and ArrayBuffer (these can't be represented in JSON)\n * \u2022 Numbers are efficiently encoded either as a variable length integer, as a\n * 32 bit float, as a 64 bit float, or as a 64 bit bigint.\n *\n * Encoding table:\n *\n * | Data Type | Prefix | Encoding Method | Comment |\n * | ------------------- | -------- | ------------------ | ------- |\n * | undefined | 127 | | Functions, symbol, and everything that cannot be identified is encoded as undefined |\n * | null | 126 | | |\n * | integer | 125 | writeVarInt | Only encodes 32 bit signed integers |\n * | float32 | 124 | writeFloat32 | |\n * | float64 | 123 | writeFloat64 | |\n * | bigint | 122 | writeBigInt64 | |\n * | boolean (false) | 121 | | True and false are different data types so we save the following byte |\n * | boolean (true) | 120 | | - 0b01111000 so the last bit determines whether true or false |\n * | string | 119 | writeVarString | |\n * | object | 118 | custom | Writes {length} then {length} key-value pairs |\n * | array | 117 | custom | Writes {length} then {length} json values |\n * | Uint8Array | 116 | writeVarUint8Array | We use Uint8Array for any kind of binary data |\n *\n * Reasons for the decreasing prefix:\n * We need the first bit for extendability (later we may want to encode the\n * prefix with writeVarUint). The remaining 7 bits are divided as follows:\n * [0-30] the beginning of the data range is used for custom purposes\n * (defined by the function that uses this library)\n * [31-127] the end of the data range is used for data encoding by\n * lib0/encoding.js\n *\n * @param {Encoder} encoder\n * @param {undefined|null|number|bigint|boolean|string|Object|Array|Uint8Array} data\n */\nexport const writeAny = (encoder, data) => {\n switch (typeof data) {\n case 'string':\n // TYPE 119: STRING\n write(encoder, 119)\n writeVarString(encoder, data)\n break\n case 'number':\n if (number.isInteger(data) && math.abs(data) <= binary.BITS31) {\n // TYPE 125: INTEGER\n write(encoder, 125)\n writeVarInt(encoder, data)\n } else if (isFloat32(data)) {\n // TYPE 124: FLOAT32\n write(encoder, 124)\n writeFloat32(encoder, data)\n } else {\n // TYPE 123: FLOAT64\n write(encoder, 123)\n writeFloat64(encoder, data)\n }\n break\n case 'bigint':\n // TYPE 122: BigInt\n write(encoder, 122)\n writeBigInt64(encoder, data)\n break\n case 'object':\n if (data === null) {\n // TYPE 126: null\n write(encoder, 126)\n } else if (array.isArray(data)) {\n // TYPE 117: Array\n write(encoder, 117)\n writeVarUint(encoder, data.length)\n for (let i = 0; i < data.length; i++) {\n writeAny(encoder, data[i])\n }\n } else if (data instanceof Uint8Array) {\n // TYPE 116: ArrayBuffer\n write(encoder, 116)\n writeVarUint8Array(encoder, data)\n } else {\n // TYPE 118: Object\n write(encoder, 118)\n const keys = Object.keys(data)\n writeVarUint(encoder, keys.length)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n writeVarString(encoder, key)\n writeAny(encoder, data[key])\n }\n }\n break\n case 'boolean':\n // TYPE 120/121: boolean (true/false)\n write(encoder, data ? 120 : 121)\n break\n default:\n // TYPE 127: undefined\n write(encoder, 127)\n }\n}\n\n/**\n * Now come a few stateful encoder that have their own classes.\n */\n\n/**\n * Basic Run Length Encoder - a basic compression implementation.\n *\n * Encodes [1,1,1,7] to [1,3,7,1] (3 times 1, 1 time 7). This encoder might do more harm than good if there are a lot of values that are not repeated.\n *\n * It was originally used for image compression. Cool .. article http://csbruce.com/cbm/transactor/pdfs/trans_v7_i06.pdf\n *\n * @note T must not be null!\n *\n * @template T\n */\nexport class RleEncoder extends Encoder {\n /**\n * @param {function(Encoder, T):void} writer\n */\n constructor (writer) {\n super()\n /**\n * The writer\n */\n this.w = writer\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n /**\n * @param {T} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n this.w(this, v)\n this.s = v\n }\n }\n}\n\n/**\n * Basic diff decoder using variable length encoding.\n *\n * Encodes the values [3, 1100, 1101, 1050, 0] to [3, 1097, 1, -51, -1050] using writeVarInt.\n */\nexport class IntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n writeVarInt(this, v - this.s)\n this.s = v\n }\n}\n\n/**\n * A combination of IntDiffEncoder and RleEncoder.\n *\n * Basically first writes the IntDiffEncoder and then counts duplicate diffs using RleEncoding.\n *\n * Encodes the values [1,1,1,2,3,4,5,6] as [1,1,0,2,1,5] (RLE([1,0,0,1,1,1,1,1]) \u21D2 RleIntDiff[1,1,0,2,1,5])\n */\nexport class RleIntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v && this.count > 0) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n writeVarInt(this, v - this.s)\n this.s = v\n }\n }\n}\n\n/**\n * @param {UintOptRleEncoder} encoder\n */\nconst flushUintOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set sign to positive\n // case 2: write several values. set sign to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encoder.count === 1 ? encoder.s : -encoder.s)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * Optimized Rle encoder that does not suffer from the mentioned problem of the basic Rle encoder.\n *\n * Internally uses VarInt encoder to write unsigned integers. If the input occurs multiple times, we write\n * write it as a negative number. The UintOptRleDecoder then understands that it needs to read a count.\n *\n * Encodes [1,2,3,3,3] as [1,2,-3,3] (once 1, once 2, three times 3)\n */\nexport class UintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Increasing Uint Optimized RLE Encoder\n *\n * The RLE encoder counts the number of same occurences of the same value.\n * The IncUintOptRle encoder counts if the value increases.\n * I.e. 7, 8, 9, 10 will be encoded as [-7, 4]. 1, 3, 5 will be encoded\n * as [1, 3, 5].\n */\nexport class IncUintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s + this.count === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * @param {IntDiffOptRleEncoder} encoder\n */\nconst flushIntDiffOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // 31 bit making up the diff | wether to write the counter\n // const encodedDiff = encoder.diff << 1 | (encoder.count === 1 ? 0 : 1)\n const encodedDiff = encoder.diff * 2 + (encoder.count === 1 ? 0 : 1)\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set first bit to positive\n // case 2: write several values. set first bit to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encodedDiff)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * A combination of the IntDiffEncoder and the UintOptRleEncoder.\n *\n * The count approach is similar to the UintDiffOptRleEncoder, but instead of using the negative bitflag, it encodes\n * in the LSB whether a count is to be read. Therefore this Encoder only supports 31 bit integers!\n *\n * Encodes [1, 2, 3, 2] as [3, 1, 6, -1] (more specifically [(1 << 1) | 1, (3 << 0) | 0, -1])\n *\n * Internally uses variable length encoding. Contrary to normal UintVar encoding, the first byte contains:\n * * 1 bit that denotes whether the next value is a count (LSB)\n * * 1 bit that denotes whether this value is negative (MSB - 1)\n * * 1 bit that denotes whether to continue reading the variable length integer (MSB)\n *\n * Therefore, only five bits remain to encode diff ranges.\n *\n * Use this Encoder only when appropriate. In most cases, this is probably a bad idea.\n */\nexport class IntDiffOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.diff === v - this.s) {\n this.s = v\n this.count++\n } else {\n flushIntDiffOptRleEncoder(this)\n this.count = 1\n this.diff = v - this.s\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushIntDiffOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Optimized String Encoder.\n *\n * Encoding many small strings in a simple Encoder is not very efficient. The function call to decode a string takes some time and creates references that must be eventually deleted.\n * In practice, when decoding several million small strings, the GC will kick in more and more often to collect orphaned string objects (or maybe there is another reason?).\n *\n * This string encoder solves the above problem. All strings are concatenated and written as a single string using a single encoding call.\n *\n * The lengths are encoded using a UintOptRleEncoder.\n */\nexport class StringEncoder {\n constructor () {\n /**\n * @type {Array}\n */\n this.sarr = []\n this.s = ''\n this.lensE = new UintOptRleEncoder()\n }\n\n /**\n * @param {string} string\n */\n write (string) {\n this.s += string\n if (this.s.length > 19) {\n this.sarr.push(this.s)\n this.s = ''\n }\n this.lensE.write(string.length)\n }\n\n toUint8Array () {\n const encoder = new Encoder()\n this.sarr.push(this.s)\n this.s = ''\n writeVarString(encoder, this.sarr.join(''))\n writeUint8Array(encoder, this.lensE.toUint8Array())\n return toUint8Array(encoder)\n }\n}\n", "/**\n * Error helpers.\n *\n * @module error\n */\n\n/**\n * @param {string} s\n * @return {Error}\n */\n/* c8 ignore next */\nexport const create = s => new Error(s)\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const methodUnimplemented = () => {\n throw create('Method unimplemented')\n}\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const unexpectedCase = () => {\n throw create('Unexpected case')\n}\n", "/**\n * Efficient schema-less binary decoding with support for variable length encoding.\n *\n * Use [lib0/decoding] with [lib0/encoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module decoding\n */\n\nimport * as binary from './binary.js'\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as string from './string.js'\nimport * as error from './error.js'\nimport * as encoding from './encoding.js'\n\nconst errorUnexpectedEndOfArray = error.create('Unexpected end of array')\nconst errorIntegerOutOfRange = error.create('Integer out of Range')\n\n/**\n * A Decoder handles the decoding of an Uint8Array.\n */\nexport class Decoder {\n /**\n * @param {Uint8Array} uint8Array Binary data to decode\n */\n constructor (uint8Array) {\n /**\n * Decoding target.\n *\n * @type {Uint8Array}\n */\n this.arr = uint8Array\n /**\n * Current decoding position.\n *\n * @type {number}\n */\n this.pos = 0\n }\n}\n\n/**\n * @function\n * @param {Uint8Array} uint8Array\n * @return {Decoder}\n */\nexport const createDecoder = uint8Array => new Decoder(uint8Array)\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {boolean}\n */\nexport const hasContent = decoder => decoder.pos !== decoder.arr.length\n\n/**\n * Clone a decoder instance.\n * Optionally set a new position parameter.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} [newPos] Defaults to current position\n * @return {Decoder} A clone of `decoder`\n */\nexport const clone = (decoder, newPos = decoder.pos) => {\n const _decoder = createDecoder(decoder.arr)\n _decoder.pos = newPos\n return _decoder\n}\n\n/**\n * Create an Uint8Array view of the next `len` bytes and advance the position by `len`.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} len The length of bytes to read\n * @return {Uint8Array}\n */\nexport const readUint8Array = (decoder, len) => {\n const view = new Uint8Array(decoder.arr.buffer, decoder.pos + decoder.arr.byteOffset, len)\n decoder.pos += len\n return view\n}\n\n/**\n * Read variable length Uint8Array.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readVarUint8Array = decoder => readUint8Array(decoder, readVarUint(decoder))\n\n/**\n * Read the rest of the content as an ArrayBuffer\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTailAsUint8Array = decoder => readUint8Array(decoder, decoder.arr.length - decoder.pos)\n\n/**\n * Skip one byte, jump to the next position.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} The next position\n */\nexport const skip8 = decoder => decoder.pos++\n\n/**\n * Read one byte as unsigned integer.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} Unsigned 8-bit integer\n */\nexport const readUint8 = decoder => decoder.arr[decoder.pos++]\n\n/**\n * Read 2 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint16 = decoder => {\n const uint =\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n decoder.pos += 2\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32 = decoder => {\n const uint =\n (decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32BigEndian = decoder => {\n const uint =\n (decoder.arr[decoder.pos + 3] +\n (decoder.arr[decoder.pos + 2] << 8) +\n (decoder.arr[decoder.pos + 1] << 16) +\n (decoder.arr[decoder.pos] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint8 = decoder => decoder.arr[decoder.pos]\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint16 = decoder =>\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint32 = decoder => (\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)\n) >>> 0\n\n/**\n * Read unsigned integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarUint = decoder => {\n let num = 0\n let mult = 1\n const len = decoder.arr.length\n while (decoder.pos < len) {\n const r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult // shift $r << (7*#iterations) and add it to num\n mult *= 128 // next iteration, shift 7 \"more\" to the left\n if (r < binary.BIT8) {\n return num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Read signed integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n * @todo This should probably create the inverse ~num if number is negative - but this would be a breaking change.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarInt = decoder => {\n let r = decoder.arr[decoder.pos++]\n let num = r & binary.BITS6\n let mult = 64\n const sign = (r & binary.BIT7) > 0 ? -1 : 1\n if ((r & binary.BIT8) === 0) {\n // don't continue reading\n return sign * num\n }\n const len = decoder.arr.length\n while (decoder.pos < len) {\n r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult\n mult *= 128\n if (r < binary.BIT8) {\n return sign * num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarUint = decoder => {\n const pos = decoder.pos\n const s = readVarUint(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarInt = decoder => {\n const pos = decoder.pos\n const s = readVarInt(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * We don't test this function anymore as we use native decoding/encoding by default now.\n * Better not modify this anymore..\n *\n * Transforming utf8 to a string is pretty expensive. The code performs 10x better\n * when String.fromCodePoint is fed with all characters as arguments.\n * But most environments have a maximum number of arguments per functions.\n * For effiency reasons we apply a maximum of 10000 characters at once.\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String.\n */\n/* c8 ignore start */\nexport const _readVarStringPolyfill = decoder => {\n let remainingLen = readVarUint(decoder)\n if (remainingLen === 0) {\n return ''\n } else {\n let encodedString = String.fromCodePoint(readUint8(decoder)) // remember to decrease remainingLen\n if (--remainingLen < 100) { // do not create a Uint8Array for small strings\n while (remainingLen--) {\n encodedString += String.fromCodePoint(readUint8(decoder))\n }\n } else {\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n // this is dangerous, we create a fresh array view from the existing buffer\n const bytes = decoder.arr.subarray(decoder.pos, decoder.pos + nextLen)\n decoder.pos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n }\n return decodeURIComponent(escape(encodedString))\n }\n}\n/* c8 ignore stop */\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n */\nexport const _readVarStringNative = decoder =>\n /** @type any */ (string.utf8TextDecoder).decode(readVarUint8Array(decoder))\n\n/**\n * Read string of variable length\n * * varUint is used to store the length of the string\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n *\n */\n/* c8 ignore next */\nexport const readVarString = string.utf8TextDecoder ? _readVarStringNative : _readVarStringPolyfill\n\n/**\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTerminatedUint8Array = decoder => {\n const encoder = encoding.createEncoder()\n let b\n while (true) {\n b = readUint8(decoder)\n if (b === 0) {\n return encoding.toUint8Array(encoder)\n }\n if (b === 1) {\n b = readUint8(decoder)\n }\n encoding.write(encoder, b)\n }\n}\n\n/**\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const readTerminatedString = decoder => string.decodeUtf8(readTerminatedUint8Array(decoder))\n\n/**\n * Look ahead and read varString without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const peekVarString = decoder => {\n const pos = decoder.pos\n const s = readVarString(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * @param {Decoder} decoder\n * @param {number} len\n * @return {DataView}\n */\nexport const readFromDataView = (decoder, len) => {\n const dv = new DataView(decoder.arr.buffer, decoder.arr.byteOffset + decoder.pos, len)\n decoder.pos += len\n return dv\n}\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat32 = decoder => readFromDataView(decoder, 4).getFloat32(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat64 = decoder => readFromDataView(decoder, 8).getFloat64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigInt64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigInt64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigUint64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigUint64(0, false)\n\n/**\n * @type {Array}\n */\nconst readAnyLookupTable = [\n decoder => undefined, // CASE 127: undefined\n decoder => null, // CASE 126: null\n readVarInt, // CASE 125: integer\n readFloat32, // CASE 124: float32\n readFloat64, // CASE 123: float64\n readBigInt64, // CASE 122: bigint\n decoder => false, // CASE 121: boolean (false)\n decoder => true, // CASE 120: boolean (true)\n readVarString, // CASE 119: string\n decoder => { // CASE 118: object\n const len = readVarUint(decoder)\n /**\n * @type {Object}\n */\n const obj = {}\n for (let i = 0; i < len; i++) {\n const key = readVarString(decoder)\n obj[key] = readAny(decoder)\n }\n return obj\n },\n decoder => { // CASE 117: array\n const len = readVarUint(decoder)\n const arr = []\n for (let i = 0; i < len; i++) {\n arr.push(readAny(decoder))\n }\n return arr\n },\n readVarUint8Array // CASE 116: Uint8Array\n]\n\n/**\n * @param {Decoder} decoder\n */\nexport const readAny = decoder => readAnyLookupTable[127 - readUint8(decoder)](decoder)\n\n/**\n * T must not be null.\n *\n * @template T\n */\nexport class RleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {function(Decoder):T} reader\n */\n constructor (uint8Array, reader) {\n super(uint8Array)\n /**\n * The reader\n */\n this.reader = reader\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = this.reader(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {T} */ (this.s)\n }\n}\n\nexport class IntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @return {number}\n */\n read () {\n this.s += readVarInt(this)\n return this.s\n }\n}\n\nexport class RleIntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n this.s += readVarInt(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class UintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class IncUintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s++)\n }\n}\n\nexport class IntDiffOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n const diff = readVarInt(this)\n // if the first bit is set, we read more data\n const hasCount = diff & 1\n this.diff = math.floor(diff / 2) // shift >> 1\n this.count = 1\n if (hasCount) {\n this.count = readVarUint(this) + 2\n }\n }\n this.s += this.diff\n this.count--\n return this.s\n }\n}\n\nexport class StringDecoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n this.decoder = new UintOptRleDecoder(uint8Array)\n this.str = readVarString(this.decoder)\n /**\n * @type {number}\n */\n this.spos = 0\n }\n\n /**\n * @return {string}\n */\n read () {\n const end = this.spos + this.decoder.read()\n const res = this.str.slice(this.spos, end)\n this.spos = end\n return res\n }\n}\n", "/**\n * Utility module to work with time.\n *\n * @module time\n */\n\nimport * as metric from './metric.js'\nimport * as math from './math.js'\n\n/**\n * Return current time.\n *\n * @return {Date}\n */\nexport const getDate = () => new Date()\n\n/**\n * Return current unix time.\n *\n * @return {number}\n */\nexport const getUnixTime = Date.now\n\n/**\n * Transform time (in ms) to a human readable format. E.g. 1100 => 1.1s. 60s => 1min. .001 => 10\u03BCs.\n *\n * @param {number} d duration in milliseconds\n * @return {string} humanized approximation of time\n */\nexport const humanizeDuration = d => {\n if (d < 60000) {\n const p = metric.prefix(d, -1)\n return math.round(p.n * 100) / 100 + p.prefix + 's'\n }\n d = math.floor(d / 1000)\n const seconds = d % 60\n const minutes = math.floor(d / 60) % 60\n const hours = math.floor(d / 3600) % 24\n const days = math.floor(d / 86400)\n if (days > 0) {\n return days + 'd' + ((hours > 0 || minutes > 30) ? ' ' + (minutes > 30 ? hours + 1 : hours) + 'h' : '')\n }\n if (hours > 0) {\n /* c8 ignore next */\n return hours + 'h' + ((minutes > 0 || seconds > 30) ? ' ' + (seconds > 30 ? minutes + 1 : minutes) + 'min' : '')\n }\n return minutes + 'min' + (seconds > 0 ? ' ' + seconds + 's' : '')\n}\n", "/**\n * Utility module to work with key-value stores.\n *\n * @module map\n */\n\n/**\n * Creates a new Map instance.\n *\n * @function\n * @return {Map}\n *\n * @function\n */\nexport const create = () => new Map()\n\n/**\n * Copy a Map object into a fresh Map object.\n *\n * @function\n * @template K,V\n * @param {Map} m\n * @return {Map}\n */\nexport const copy = m => {\n const r = create()\n m.forEach((v, k) => { r.set(k, v) })\n return r\n}\n\n/**\n * Get map property. Create T if property is undefined and set T on map.\n *\n * ```js\n * const listeners = map.setIfUndefined(events, 'eventName', set.create)\n * listeners.add(listener)\n * ```\n *\n * @function\n * @template {Map} MAP\n * @template {MAP extends Map ? function():V : unknown} CF\n * @param {MAP} map\n * @param {MAP extends Map ? K : unknown} key\n * @param {CF} createT\n * @return {ReturnType}\n */\nexport const setIfUndefined = (map, key, createT) => {\n let set = map.get(key)\n if (set === undefined) {\n map.set(key, set = createT())\n }\n return set\n}\n\n/**\n * Creates an Array and populates it with the content of all key-value pairs using the `f(value, key)` function.\n *\n * @function\n * @template K\n * @template V\n * @template R\n * @param {Map} m\n * @param {function(V,K):R} f\n * @return {Array}\n */\nexport const map = (m, f) => {\n const res = []\n for (const [key, value] of m) {\n res.push(f(value, key))\n }\n return res\n}\n\n/**\n * Tests whether any key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @todo should rename to some - similarly to Array.some\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const any = (m, f) => {\n for (const [key, value] of m) {\n if (f(value, key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * Tests whether all key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const all = (m, f) => {\n for (const [key, value] of m) {\n if (!f(value, key)) {\n return false\n }\n }\n return true\n}\n", "/**\n * Observable class prototype.\n *\n * @module observable\n */\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as array from './array.js'\n\n/**\n * Handles named events.\n * @experimental\n *\n * This is basically a (better typed) duplicate of Observable, which will replace Observable in the\n * next release.\n *\n * @template {{[key in keyof EVENTS]: function(...any):void}} EVENTS\n */\nexport class ObservableV2 {\n constructor () {\n /**\n * Some desc.\n * @type {Map>}\n */\n this._observers = map.create()\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, /** @type {string} */ (name), set.create).add(f)\n return f\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, /** @type {any} */ (_f))\n f(...args)\n }\n this.on(name, /** @type {any} */ (_f))\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name The event name.\n * @param {Parameters} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n\n/* c8 ignore start */\n/**\n * Handles named events.\n *\n * @deprecated\n * @template N\n */\nexport class Observable {\n constructor () {\n /**\n * Some desc.\n * @type {Map}\n */\n this._observers = map.create()\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, name, set.create).add(f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, _f)\n f(...args)\n }\n this.on(name, _f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @param {N} name The event name.\n * @param {Array} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n/* c8 ignore end */\n", "/**\n * Utility functions for working with EcmaScript objects.\n *\n * @module object\n */\n\n/**\n * @return {Object} obj\n */\nexport const create = () => Object.create(null)\n\n/**\n * Object.assign\n */\nexport const assign = Object.assign\n\n/**\n * @param {Object} obj\n */\nexport const keys = Object.keys\n\n/**\n * @template V\n * @param {{[k:string]:V}} obj\n * @param {function(V,string):any} f\n */\nexport const forEach = (obj, f) => {\n for (const key in obj) {\n f(obj[key], key)\n }\n}\n\n/**\n * @todo implement mapToArray & map\n *\n * @template R\n * @param {Object} obj\n * @param {function(any,string):R} f\n * @return {Array}\n */\nexport const map = (obj, f) => {\n const results = []\n for (const key in obj) {\n results.push(f(obj[key], key))\n }\n return results\n}\n\n/**\n * @deprecated use object.size instead\n * @param {Object} obj\n * @return {number}\n */\nexport const length = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @return {number}\n */\nexport const size = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const some = (obj, f) => {\n for (const key in obj) {\n if (f(obj[key], key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @param {Object|undefined} obj\n */\nexport const isEmpty = obj => {\n // eslint-disable-next-line\n for (const _k in obj) {\n return false\n }\n return true\n}\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const every = (obj, f) => {\n for (const key in obj) {\n if (!f(obj[key], key)) {\n return false\n }\n }\n return true\n}\n\n/**\n * Calls `Object.prototype.hasOwnProperty`.\n *\n * @param {any} obj\n * @param {string|symbol} key\n * @return {boolean}\n */\nexport const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key)\n\n/**\n * @param {Object} a\n * @param {Object} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a === b || (size(a) === size(b) && every(a, (val, key) => (val !== undefined || hasProperty(b, key)) && b[key] === val))\n\n/**\n * Make an object immutable. This hurts performance and is usually not needed if you perform good\n * coding practices.\n */\nexport const freeze = Object.freeze\n\n/**\n * Make an object and all its children immutable.\n * This *really* hurts performance and is usually not needed if you perform good coding practices.\n *\n * @template {any} T\n * @param {T} o\n * @return {Readonly}\n */\nexport const deepFreeze = (o) => {\n for (const key in o) {\n const c = o[key]\n if (typeof c === 'object' || typeof c === 'function') {\n deepFreeze(o[key])\n }\n }\n return freeze(o)\n}\n", "/**\n * Common functions and function call helpers.\n *\n * @module function\n */\n\nimport * as array from './array.js'\nimport * as object from './object.js'\n\n/**\n * Calls all functions in `fs` with args. Only throws after all functions were called.\n *\n * @param {Array} fs\n * @param {Array} args\n */\nexport const callAll = (fs, args, i = 0) => {\n try {\n for (; i < fs.length; i++) {\n fs[i](...args)\n }\n } finally {\n if (i < fs.length) {\n callAll(fs, args, i + 1)\n }\n }\n}\n\nexport const nop = () => {}\n\n/**\n * @template T\n * @param {function():T} f\n * @return {T}\n */\nexport const apply = f => f()\n\n/**\n * @template A\n *\n * @param {A} a\n * @return {A}\n */\nexport const id = a => a\n\n/**\n * @template T\n *\n * @param {T} a\n * @param {T} b\n * @return {boolean}\n */\nexport const equalityStrict = (a, b) => a === b\n\n/**\n * @template T\n *\n * @param {Array|object} a\n * @param {Array|object} b\n * @return {boolean}\n */\nexport const equalityFlat = (a, b) => a === b || (a != null && b != null && a.constructor === b.constructor && ((array.isArray(a) && array.equalFlat(a, /** @type {Array} */ (b))) || (typeof a === 'object' && object.equalFlat(a, b))))\n\n/* c8 ignore start */\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nexport const equalityDeep = (a, b) => {\n if (a == null || b == null) {\n return equalityStrict(a, b)\n }\n if (a.constructor !== b.constructor) {\n return false\n }\n if (a === b) {\n return true\n }\n switch (a.constructor) {\n case ArrayBuffer:\n a = new Uint8Array(a)\n b = new Uint8Array(b)\n // eslint-disable-next-line no-fallthrough\n case Uint8Array: {\n if (a.byteLength !== b.byteLength) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n break\n }\n case Set: {\n if (a.size !== b.size) {\n return false\n }\n for (const value of a) {\n if (!b.has(value)) {\n return false\n }\n }\n break\n }\n case Map: {\n if (a.size !== b.size) {\n return false\n }\n for (const key of a.keys()) {\n if (!b.has(key) || !equalityDeep(a.get(key), b.get(key))) {\n return false\n }\n }\n break\n }\n case Object:\n if (object.length(a) !== object.length(b)) {\n return false\n }\n for (const key in a) {\n if (!object.hasProperty(a, key) || !equalityDeep(a[key], b[key])) {\n return false\n }\n }\n break\n case Array:\n if (a.length !== b.length) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (!equalityDeep(a[i], b[i])) {\n return false\n }\n }\n break\n default:\n return false\n }\n return true\n}\n\n/**\n * @template V\n * @template {V} OPTS\n *\n * @param {V} value\n * @param {Array} options\n */\n// @ts-ignore\nexport const isOneOf = (value, options) => options.includes(value)\n/* c8 ignore stop */\n\nexport const isArray = array.isArray\n\n/**\n * @param {any} s\n * @return {s is String}\n */\nexport const isString = (s) => s && s.constructor === String\n\n/**\n * @param {any} n\n * @return {n is Number}\n */\nexport const isNumber = n => n != null && n.constructor === Number\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {any} n\n * @param {TYPE} T\n * @return {n is InstanceType}\n */\nexport const is = (n, T) => n && n.constructor === T\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {TYPE} T\n */\nexport const isTemplate = (T) =>\n /**\n * @param {any} n\n * @return {n is InstanceType}\n **/\n n => n && n.constructor === T\n", "/* eslint-env browser */\n\nexport const subtle = crypto.subtle\nexport const getRandomValues = crypto.getRandomValues.bind(crypto)\n", "/**\n * Isomorphic module for true random numbers / buffers / uuids.\n *\n * Attention: falls back to Math.random if the browser does not support crypto.\n *\n * @module random\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\nimport { getRandomValues } from 'lib0/webcrypto'\n\nexport const rand = Math.random\n\nexport const uint32 = () => getRandomValues(new Uint32Array(1))[0]\n\nexport const uint53 = () => {\n const arr = getRandomValues(new Uint32Array(8))\n return (arr[0] & binary.BITS21) * (binary.BITS32 + 1) + (arr[1] >>> 0)\n}\n\n/**\n * @template T\n * @param {Array} arr\n * @return {T}\n */\nexport const oneOf = arr => arr[math.floor(rand() * arr.length)]\n\n// @ts-ignore\nconst uuidv4Template = [1e7] + -1e3 + -4e3 + -8e3 + -1e11\n\n/**\n * @return {string}\n */\nexport const uuidv4 = () => uuidv4Template.replace(/[018]/g, /** @param {number} c */ c =>\n (c ^ uint32() & 15 >> c / 4).toString(16)\n)\n", "/**\n * Utility helpers to work with promises.\n *\n * @module promise\n */\n\nimport * as time from './time.js'\n\n/**\n * @template T\n * @callback PromiseResolve\n * @param {T|PromiseLike} [result]\n */\n\n/**\n * @template T\n * @param {function(PromiseResolve,function(Error):void):any} f\n * @return {Promise}\n */\nexport const create = f => /** @type {Promise} */ (new Promise(f))\n\n/**\n * @param {function(function():void,function(Error):void):void} f\n * @return {Promise}\n */\nexport const createEmpty = f => new Promise(f)\n\n/**\n * `Promise.all` wait for all promises in the array to resolve and return the result\n * @template {unknown[] | []} PS\n *\n * @param {PS} ps\n * @return {Promise<{ -readonly [P in keyof PS]: Awaited }>}\n */\nexport const all = Promise.all.bind(Promise)\n\n/**\n * @param {Error} [reason]\n * @return {Promise}\n */\nexport const reject = reason => Promise.reject(reason)\n\n/**\n * @template T\n * @param {T|void} res\n * @return {Promise}\n */\nexport const resolve = res => Promise.resolve(res)\n\n/**\n * @template T\n * @param {T} res\n * @return {Promise}\n */\nexport const resolveWith = res => Promise.resolve(res)\n\n/**\n * @todo Next version, reorder parameters: check, [timeout, [intervalResolution]]\n * @deprecated use untilAsync instead\n *\n * @param {number} timeout\n * @param {function():boolean} check\n * @param {number} [intervalResolution]\n * @return {Promise}\n */\nexport const until = (timeout, check, intervalResolution = 10) => create((resolve, reject) => {\n const startTime = time.getUnixTime()\n const hasTimeout = timeout > 0\n const untilInterval = () => {\n if (check()) {\n clearInterval(intervalHandle)\n resolve()\n } else if (hasTimeout) {\n /* c8 ignore else */\n if (time.getUnixTime() - startTime > timeout) {\n clearInterval(intervalHandle)\n reject(new Error('Timeout'))\n }\n }\n }\n const intervalHandle = setInterval(untilInterval, intervalResolution)\n})\n\n/**\n * @param {()=>Promise|boolean} check\n * @param {number} timeout\n * @param {number} intervalResolution\n * @return {Promise}\n */\nexport const untilAsync = async (check, timeout = 0, intervalResolution = 10) => {\n const startTime = time.getUnixTime()\n const noTimeout = timeout <= 0\n // eslint-disable-next-line no-unmodified-loop-condition\n while (noTimeout || time.getUnixTime() - startTime <= timeout) {\n if (await check()) return\n await wait(intervalResolution)\n }\n throw new Error('Timeout')\n}\n\n/**\n * @param {number} timeout\n * @return {Promise}\n */\nexport const wait = timeout => create((resolve, _reject) => setTimeout(resolve, timeout))\n\n/**\n * Checks if an object is a promise using ducktyping.\n *\n * Promises are often polyfilled, so it makes sense to add some additional guarantees if the user of this\n * library has some insane environment where global Promise objects are overwritten.\n *\n * @param {any} p\n * @return {boolean}\n */\nexport const isPromise = p => p instanceof Promise || (p && p.then && p.catch && p.finally)\n", "/**\n * Often used conditions.\n *\n * @module conditions\n */\n\n/**\n * @template T\n * @param {T|null|undefined} v\n * @return {T|null}\n */\n/* c8 ignore next */\nexport const undefinedToNull = v => v === undefined ? null : v\n", "/* eslint-env browser */\n\n/**\n * Isomorphic variable storage.\n *\n * Uses LocalStorage in the browser and falls back to in-memory storage.\n *\n * @module storage\n */\n\n/* c8 ignore start */\nclass VarStoragePolyfill {\n constructor () {\n this.map = new Map()\n }\n\n /**\n * @param {string} key\n * @param {any} newValue\n */\n setItem (key, newValue) {\n this.map.set(key, newValue)\n }\n\n /**\n * @param {string} key\n */\n getItem (key) {\n return this.map.get(key)\n }\n}\n/* c8 ignore stop */\n\n/**\n * @type {any}\n */\nlet _localStorage = new VarStoragePolyfill()\nlet usePolyfill = true\n\n/* c8 ignore start */\ntry {\n // if the same-origin rule is violated, accessing localStorage might thrown an error\n if (typeof localStorage !== 'undefined' && localStorage) {\n _localStorage = localStorage\n usePolyfill = false\n }\n} catch (e) { }\n/* c8 ignore stop */\n\n/**\n * This is basically localStorage in browser, or a polyfill in nodejs\n */\n/* c8 ignore next */\nexport const varStorage = _localStorage\n\n/**\n * A polyfill for `addEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const onChange = eventHandler => usePolyfill || addEventListener('storage', /** @type {any} */ (eventHandler))\n\n/**\n * A polyfill for `removeEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const offChange = eventHandler => usePolyfill || removeEventListener('storage', /** @type {any} */ (eventHandler))\n", "/**\n * Isomorphic module to work access the environment (query params, env variables).\n *\n * @module environment\n */\n\nimport * as map from './map.js'\nimport * as string from './string.js'\nimport * as conditions from './conditions.js'\nimport * as storage from './storage.js'\nimport * as f from './function.js'\n\n/* c8 ignore next 2 */\n// @ts-ignore\nexport const isNode = typeof process !== 'undefined' && process.release && /node|io\\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n\n/* c8 ignore next */\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && !isNode\n/* c8 ignore next 3 */\nexport const isMac = typeof navigator !== 'undefined'\n ? /Mac/.test(navigator.platform)\n : false\n\n/**\n * @type {Map}\n */\nlet params\nconst args = []\n\n/* c8 ignore start */\nconst computeParams = () => {\n if (params === undefined) {\n if (isNode) {\n params = map.create()\n const pargs = process.argv\n let currParamName = null\n for (let i = 0; i < pargs.length; i++) {\n const parg = pargs[i]\n if (parg[0] === '-') {\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n currParamName = parg\n } else {\n if (currParamName !== null) {\n params.set(currParamName, parg)\n currParamName = null\n } else {\n args.push(parg)\n }\n }\n }\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n // in ReactNative for example this would not be true (unless connected to the Remote Debugger)\n } else if (typeof location === 'object') {\n params = map.create(); // eslint-disable-next-line no-undef\n (location.search || '?').slice(1).split('&').forEach((kv) => {\n if (kv.length !== 0) {\n const [key, value] = kv.split('=')\n params.set(`--${string.fromCamelCase(key, '-')}`, value)\n params.set(`-${string.fromCamelCase(key, '-')}`, value)\n }\n })\n } else {\n params = map.create()\n }\n }\n return params\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next */\nexport const hasParam = (name) => computeParams().has(name)\n\n/**\n * @param {string} name\n * @param {string} defaultVal\n * @return {string}\n */\n/* c8 ignore next 2 */\nexport const getParam = (name, defaultVal) =>\n computeParams().get(name) || defaultVal\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 4 */\nexport const getVariable = (name) =>\n isNode\n ? conditions.undefinedToNull(process.env[name.toUpperCase().replaceAll('-', '_')])\n : conditions.undefinedToNull(storage.varStorage.getItem(name))\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 2 */\nexport const getConf = (name) =>\n computeParams().get('--' + name) || getVariable(name)\n\n/**\n * @param {string} name\n * @return {string}\n */\n/* c8 ignore next 5 */\nexport const ensureConf = (name) => {\n const c = getConf(name)\n if (c == null) throw new Error(`Expected configuration \"${name.toUpperCase().replaceAll('-', '_')}\"`)\n return c\n}\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next 2 */\nexport const hasConf = (name) =>\n hasParam('--' + name) || getVariable(name) !== null\n\n/* c8 ignore next */\nexport const production = hasConf('production')\n\n/* c8 ignore next 2 */\nconst forceColor = isNode &&\n f.isOneOf(process.env.FORCE_COLOR, ['true', '1', '2'])\n\n/* c8 ignore start */\n/**\n * Color is enabled by default if the terminal supports it.\n *\n * Explicitly enable color using `--color` parameter\n * Disable color using `--no-color` parameter or using `NO_COLOR=1` environment variable.\n * `FORCE_COLOR=1` enables color and takes precedence over all.\n */\nexport const supportsColor = forceColor || (\n !hasParam('--no-colors') && // @todo deprecate --no-colors\n !hasConf('no-color') &&\n (!isNode || process.stdout.isTTY) && (\n !isNode ||\n hasParam('--color') ||\n getVariable('COLORTERM') !== null ||\n (getVariable('TERM') || '').includes('color')\n )\n)\n/* c8 ignore stop */\n", "/**\n * Utility functions to work with buffers (Uint8Array).\n *\n * @module buffer\n */\n\nimport * as string from './string.js'\nimport * as env from './environment.js'\nimport * as array from './array.js'\nimport * as math from './math.js'\nimport * as encoding from './encoding.js'\nimport * as decoding from './decoding.js'\n\n/**\n * @param {number} len\n */\nexport const createUint8ArrayFromLen = len => new Uint8Array(len)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n * @param {number} byteOffset\n * @param {number} length\n */\nexport const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n */\nexport const createUint8ArrayFromArrayBuffer = buffer => new Uint8Array(buffer)\n\n/* c8 ignore start */\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Browser = bytes => {\n let s = ''\n for (let i = 0; i < bytes.byteLength; i++) {\n s += string.fromCharCode(bytes[i])\n }\n // eslint-disable-next-line no-undef\n return btoa(s)\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Node = bytes => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('base64')\n\n/* c8 ignore start */\n/**\n * @param {string} s\n * @return {Uint8Array}\n */\nconst fromBase64Browser = s => {\n // eslint-disable-next-line no-undef\n const a = atob(s)\n const bytes = createUint8ArrayFromLen(a.length)\n for (let i = 0; i < a.length; i++) {\n bytes[i] = a.charCodeAt(i)\n }\n return bytes\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} s\n */\nconst fromBase64Node = s => {\n const buf = Buffer.from(s, 'base64')\n return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength)\n}\n\n/* c8 ignore next */\nexport const toBase64 = env.isBrowser ? toBase64Browser : toBase64Node\n\n/* c8 ignore next */\nexport const fromBase64 = env.isBrowser ? fromBase64Browser : fromBase64Node\n\n/**\n * Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5\n * @param {Uint8Array} buf\n */\nexport const toBase64UrlEncoded = buf => toBase64(buf).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')\n\n/**\n * @param {string} base64\n */\nexport const fromBase64UrlEncoded = base64 => fromBase64(base64.replaceAll('-', '+').replaceAll('_', '/'))\n\n/**\n * Base64 is always a more efficient choice. This exists for utility purposes only.\n *\n * @param {Uint8Array} buf\n */\nexport const toHexString = buf => array.map(buf, b => b.toString(16).padStart(2, '0')).join('')\n\n/**\n * Note: This function expects that the hex doesn't start with 0x..\n *\n * @param {string} hex\n */\nexport const fromHexString = hex => {\n const hlen = hex.length\n const buf = new Uint8Array(math.ceil(hlen / 2))\n for (let i = 0; i < hlen; i += 2) {\n buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16)\n }\n return buf\n}\n\n/**\n * Copy the content of an Uint8Array view to a new ArrayBuffer.\n *\n * @param {Uint8Array} uint8Array\n * @return {Uint8Array}\n */\nexport const copyUint8Array = uint8Array => {\n const newBuf = createUint8ArrayFromLen(uint8Array.byteLength)\n newBuf.set(uint8Array)\n return newBuf\n}\n\n/**\n * Encode anything as a UInt8Array. It's a pun on typescripts's `any` type.\n * See encoding.writeAny for more information.\n *\n * @param {any} data\n * @return {Uint8Array}\n */\nexport const encodeAny = data =>\n encoding.encode(encoder => encoding.writeAny(encoder, data))\n\n/**\n * Decode an any-encoded value.\n *\n * @param {Uint8Array} buf\n * @return {any}\n */\nexport const decodeAny = buf => decoding.readAny(decoding.createDecoder(buf))\n\n/**\n * Shift Byte Array {N} bits to the left. Does not expand byte array.\n *\n * @param {Uint8Array} bs\n * @param {number} N should be in the range of [0-7]\n */\nexport const shiftNBitsLeft = (bs, N) => {\n if (N === 0) return bs\n bs = new Uint8Array(bs)\n bs[0] <<= N\n for (let i = 1; i < bs.length; i++) {\n bs[i - 1] |= bs[i] >>> (8 - N)\n bs[i] <<= N\n }\n return bs\n}\n", "/**\n * Working with value pairs.\n *\n * @module pair\n */\n\n/**\n * @template L,R\n */\nexport class Pair {\n /**\n * @param {L} left\n * @param {R} right\n */\n constructor (left, right) {\n this.left = left\n this.right = right\n }\n}\n\n/**\n * @template L,R\n * @param {L} left\n * @param {R} right\n * @return {Pair}\n */\nexport const create = (left, right) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {R} right\n * @param {L} left\n * @return {Pair}\n */\nexport const createReversed = (right, left) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {Array>} arr\n * @param {function(L, R):any} f\n */\nexport const forEach = (arr, f) => arr.forEach(p => f(p.left, p.right))\n\n/**\n * @template L,R,X\n * @param {Array>} arr\n * @param {function(L, R):X} f\n * @return {Array}\n */\nexport const map = (arr, f) => arr.map(p => f(p.left, p.right))\n", "/* eslint-env browser */\n\n/**\n * Utility module to work with the DOM.\n *\n * @module dom\n */\n\nimport * as pair from './pair.js'\nimport * as map from './map.js'\n\n/* c8 ignore start */\n/**\n * @type {Document}\n */\nexport const doc = /** @type {Document} */ (typeof document !== 'undefined' ? document : {})\n\n/**\n * @param {string} name\n * @return {HTMLElement}\n */\nexport const createElement = name => doc.createElement(name)\n\n/**\n * @return {DocumentFragment}\n */\nexport const createDocumentFragment = () => doc.createDocumentFragment()\n\n/**\n * @param {string} text\n * @return {Text}\n */\nexport const createTextNode = text => doc.createTextNode(text)\n\nexport const domParser = /** @type {DOMParser} */ (typeof DOMParser !== 'undefined' ? new DOMParser() : null)\n\n/**\n * @param {HTMLElement} el\n * @param {string} name\n * @param {Object} opts\n */\nexport const emitCustomEvent = (el, name, opts) => el.dispatchEvent(new CustomEvent(name, opts))\n\n/**\n * @param {Element} el\n * @param {Array>} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributes = (el, attrs) => {\n pair.forEach(attrs, (key, value) => {\n if (value === false) {\n el.removeAttribute(key)\n } else if (value === true) {\n el.setAttribute(key, '')\n } else {\n // @ts-ignore\n el.setAttribute(key, value)\n }\n })\n return el\n}\n\n/**\n * @param {Element} el\n * @param {Map} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributesMap = (el, attrs) => {\n attrs.forEach((value, key) => { el.setAttribute(key, value) })\n return el\n}\n\n/**\n * @param {Array|HTMLCollection} children\n * @return {DocumentFragment}\n */\nexport const fragment = children => {\n const fragment = createDocumentFragment()\n for (let i = 0; i < children.length; i++) {\n appendChild(fragment, children[i])\n }\n return fragment\n}\n\n/**\n * @param {Element} parent\n * @param {Array} nodes\n * @return {Element}\n */\nexport const append = (parent, nodes) => {\n appendChild(parent, fragment(nodes))\n return parent\n}\n\n/**\n * @param {HTMLElement} el\n */\nexport const remove = el => el.remove()\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const addEventListener = (el, name, f) => el.addEventListener(name, f)\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const removeEventListener = (el, name, f) => el.removeEventListener(name, f)\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const addEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => addEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const removeEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => removeEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {string} name\n * @param {Array|pair.Pair>} attrs Array of key-value pairs\n * @param {Array} children\n * @return {Element}\n */\nexport const element = (name, attrs = [], children = []) =>\n append(setAttributes(createElement(name), attrs), children)\n\n/**\n * @param {number} width\n * @param {number} height\n */\nexport const canvas = (width, height) => {\n const c = /** @type {HTMLCanvasElement} */ (createElement('canvas'))\n c.height = height\n c.width = width\n return c\n}\n\n/**\n * @param {string} t\n * @return {Text}\n */\nexport const text = createTextNode\n\n/**\n * @param {pair.Pair} pair\n */\nexport const pairToStyleString = pair => `${pair.left}:${pair.right};`\n\n/**\n * @param {Array>} pairs\n * @return {string}\n */\nexport const pairsToStyleString = pairs => pairs.map(pairToStyleString).join('')\n\n/**\n * @param {Map} m\n * @return {string}\n */\nexport const mapToStyleString = m => map.map(m, (value, key) => `${key}:${value};`).join('')\n\n/**\n * @todo should always query on a dom element\n *\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {HTMLElement | null}\n */\nexport const querySelector = (el, query) => el.querySelector(query)\n\n/**\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {NodeListOf}\n */\nexport const querySelectorAll = (el, query) => el.querySelectorAll(query)\n\n/**\n * @param {string} id\n * @return {HTMLElement}\n */\nexport const getElementById = id => /** @type {HTMLElement} */ (doc.getElementById(id))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nconst _parse = html => domParser.parseFromString(`${html}`, 'text/html').body\n\n/**\n * @param {string} html\n * @return {DocumentFragment}\n */\nexport const parseFragment = html => fragment(/** @type {any} */ (_parse(html).childNodes))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nexport const parseElement = html => /** @type HTMLElement */ (_parse(html).firstElementChild)\n\n/**\n * @param {HTMLElement} oldEl\n * @param {HTMLElement|DocumentFragment} newEl\n */\nexport const replaceWith = (oldEl, newEl) => oldEl.replaceWith(newEl)\n\n/**\n * @param {HTMLElement} parent\n * @param {HTMLElement} el\n * @param {Node|null} ref\n * @return {HTMLElement}\n */\nexport const insertBefore = (parent, el, ref) => parent.insertBefore(el, ref)\n\n/**\n * @param {Node} parent\n * @param {Node} child\n * @return {Node}\n */\nexport const appendChild = (parent, child) => parent.appendChild(child)\n\nexport const ELEMENT_NODE = doc.ELEMENT_NODE\nexport const TEXT_NODE = doc.TEXT_NODE\nexport const CDATA_SECTION_NODE = doc.CDATA_SECTION_NODE\nexport const COMMENT_NODE = doc.COMMENT_NODE\nexport const DOCUMENT_NODE = doc.DOCUMENT_NODE\nexport const DOCUMENT_TYPE_NODE = doc.DOCUMENT_TYPE_NODE\nexport const DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE\n\n/**\n * @param {any} node\n * @param {number} type\n */\nexport const checkNodeType = (node, type) => node.nodeType === type\n\n/**\n * @param {Node} parent\n * @param {HTMLElement} child\n */\nexport const isParentOf = (parent, child) => {\n let p = child.parentNode\n while (p && p !== parent) {\n p = p.parentNode\n }\n return p === parent\n}\n/* c8 ignore stop */\n", "/**\n * JSON utility functions.\n *\n * @module json\n */\n\n/**\n * Transform JavaScript object to JSON.\n *\n * @param {any} object\n * @return {string}\n */\nexport const stringify = JSON.stringify\n\n/**\n * Parse JSON object.\n *\n * @param {string} json\n * @return {any}\n */\nexport const parse = JSON.parse\n", "/**\n * Utility module to work with EcmaScript Symbols.\n *\n * @module symbol\n */\n\n/**\n * Return fresh symbol.\n *\n * @return {Symbol}\n */\nexport const create = Symbol\n\n/**\n * @param {any} s\n * @return {boolean}\n */\nexport const isSymbol = s => typeof s === 'symbol'\n", "import * as symbol from './symbol.js'\nimport * as time from './time.js'\nimport * as env from './environment.js'\nimport * as func from './function.js'\nimport * as json from './json.js'\n\nexport const BOLD = symbol.create()\nexport const UNBOLD = symbol.create()\nexport const BLUE = symbol.create()\nexport const GREY = symbol.create()\nexport const GREEN = symbol.create()\nexport const RED = symbol.create()\nexport const PURPLE = symbol.create()\nexport const ORANGE = symbol.create()\nexport const UNCOLOR = symbol.create()\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n * @return {Array}\n */\nexport const computeNoColorLoggingArgs = args => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n if (arg === undefined) {\n break\n } else if (arg.constructor === String || arg.constructor === Number) {\n strBuilder.push(arg)\n } else if (arg.constructor === Object) {\n break\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs.push(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\nconst loggingColors = [GREEN, PURPLE, ORANGE, BLUE]\nlet nextColor = 0\nlet lastLoggingTime = time.getUnixTime()\n\n/* c8 ignore start */\n/**\n * @param {function(...any):void} _print\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (_print, moduleName) => {\n const color = loggingColors[nextColor]\n const debugRegexVar = env.getVariable('log')\n const doLogging = debugRegexVar !== null &&\n (debugRegexVar === '*' || debugRegexVar === 'true' ||\n new RegExp(debugRegexVar, 'gi').test(moduleName))\n nextColor = (nextColor + 1) % loggingColors.length\n moduleName += ': '\n return !doLogging\n ? func.nop\n : (...args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = args[0]()\n }\n const timeNow = time.getUnixTime()\n const timeDiff = timeNow - lastLoggingTime\n lastLoggingTime = timeNow\n _print(\n color,\n moduleName,\n UNCOLOR,\n ...args.map((arg) => {\n if (arg != null && arg.constructor === Uint8Array) {\n arg = Array.from(arg)\n }\n const t = typeof arg\n switch (t) {\n case 'string':\n case 'symbol':\n return arg\n default: {\n return json.stringify(arg)\n }\n }\n }),\n color,\n ' +' + timeDiff + 'ms'\n )\n }\n}\n/* c8 ignore stop */\n", "/**\n * Isomorphic logging module with support for colors!\n *\n * @module logging\n */\n\nimport * as env from './environment.js'\nimport * as set from './set.js'\nimport * as pair from './pair.js'\nimport * as dom from './dom.js'\nimport * as json from './json.js'\nimport * as map from './map.js'\nimport * as eventloop from './eventloop.js'\nimport * as math from './math.js'\nimport * as common from './logging.common.js'\n\nexport { BOLD, UNBOLD, BLUE, GREY, GREEN, RED, PURPLE, ORANGE, UNCOLOR } from './logging.common.js'\n\n/**\n * @type {Object>}\n */\nconst _browserStyleMap = {\n [common.BOLD]: pair.create('font-weight', 'bold'),\n [common.UNBOLD]: pair.create('font-weight', 'normal'),\n [common.BLUE]: pair.create('color', 'blue'),\n [common.GREEN]: pair.create('color', 'green'),\n [common.GREY]: pair.create('color', 'grey'),\n [common.RED]: pair.create('color', 'red'),\n [common.PURPLE]: pair.create('color', 'purple'),\n [common.ORANGE]: pair.create('color', 'orange'), // not well supported in chrome when debugging node with inspector - TODO: deprecate\n [common.UNCOLOR]: pair.create('color', 'black')\n}\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst computeBrowserLoggingArgs = (args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const styles = []\n const currentStyle = map.create()\n /**\n * @type {Array}\n */\n let logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n break\n }\n if (arg.constructor === String || arg.constructor === Number) {\n const style = dom.mapToStyleString(currentStyle)\n if (i > 0 || style.length > 0) {\n strBuilder.push('%c' + arg)\n styles.push(style)\n } else {\n strBuilder.push(arg)\n }\n } else {\n break\n }\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs = styles\n logArgs.unshift(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst computeLoggingArgs = env.supportsColor\n ? computeBrowserLoggingArgs\n : common.computeNoColorLoggingArgs\n/* c8 ignore stop */\n\n/**\n * @param {Array} args\n */\nexport const print = (...args) => {\n console.log(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.print(args))\n}\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n */\nexport const warn = (...args) => {\n console.warn(...computeLoggingArgs(args))\n args.unshift(common.ORANGE)\n vconsoles.forEach((vc) => vc.print(args))\n}\n/* c8 ignore stop */\n\n/**\n * @param {Error} err\n */\n/* c8 ignore start */\nexport const printError = (err) => {\n console.error(err)\n vconsoles.forEach((vc) => vc.printError(err))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} url image location\n * @param {number} height height of the image in pixel\n */\n/* c8 ignore start */\nexport const printImg = (url, height) => {\n if (env.isBrowser) {\n console.log(\n '%c ',\n `font-size: ${height}px; background-size: contain; background-repeat: no-repeat; background-image: url(${url})`\n )\n // console.log('%c ', `font-size: ${height}x; background: url(${url}) no-repeat;`)\n }\n vconsoles.forEach((vc) => vc.printImg(url, height))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} base64\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printImgBase64 = (base64, height) =>\n printImg(`data:image/gif;base64,${base64}`, height)\n\n/**\n * @param {Array} args\n */\nexport const group = (...args) => {\n console.group(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.group(args))\n}\n\n/**\n * @param {Array} args\n */\nexport const groupCollapsed = (...args) => {\n console.groupCollapsed(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupCollapsed(args))\n}\n\nexport const groupEnd = () => {\n console.groupEnd()\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupEnd())\n}\n\n/**\n * @param {function():Node} createNode\n */\n/* c8 ignore next 2 */\nexport const printDom = (createNode) =>\n vconsoles.forEach((vc) => vc.printDom(createNode()))\n\n/**\n * @param {HTMLCanvasElement} canvas\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printCanvas = (canvas, height) =>\n printImg(canvas.toDataURL(), height)\n\nexport const vconsoles = set.create()\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst _computeLineSpans = (args) => {\n const spans = []\n const currentStyle = new Map()\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n let arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n arg = 'undefined '\n }\n if (arg.constructor === String || arg.constructor === Number) {\n // @ts-ignore\n const span = dom.element('span', [\n pair.create('style', dom.mapToStyleString(currentStyle))\n ], [dom.text(arg.toString())])\n if (span.innerHTML === '') {\n span.innerHTML = ' '\n }\n spans.push(span)\n } else {\n break\n }\n }\n }\n // append the rest\n for (; i < args.length; i++) {\n let content = args[i]\n if (!(content instanceof Symbol)) {\n if (content.constructor !== String && content.constructor !== Number) {\n content = ' ' + json.stringify(content) + ' '\n }\n spans.push(\n dom.element('span', [], [dom.text(/** @type {string} */ (content))])\n )\n }\n }\n return spans\n}\n/* c8 ignore stop */\n\nconst lineStyle =\n 'font-family:monospace;border-bottom:1px solid #e2e2e2;padding:2px;'\n\n/* c8 ignore start */\nexport class VConsole {\n /**\n * @param {Element} dom\n */\n constructor (dom) {\n this.dom = dom\n /**\n * @type {Element}\n */\n this.ccontainer = this.dom\n this.depth = 0\n vconsoles.add(this)\n }\n\n /**\n * @param {Array} args\n * @param {boolean} collapsed\n */\n group (args, collapsed = false) {\n eventloop.enqueue(() => {\n const triangleDown = dom.element('span', [\n pair.create('hidden', collapsed),\n pair.create('style', 'color:grey;font-size:120%;')\n ], [dom.text('\u25BC')])\n const triangleRight = dom.element('span', [\n pair.create('hidden', !collapsed),\n pair.create('style', 'color:grey;font-size:125%;')\n ], [dom.text('\u25B6')])\n const content = dom.element(\n 'div',\n [pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )],\n [triangleDown, triangleRight, dom.text(' ')].concat(\n _computeLineSpans(args)\n )\n )\n const nextContainer = dom.element('div', [\n pair.create('hidden', collapsed)\n ])\n const nextLine = dom.element('div', [], [content, nextContainer])\n dom.append(this.ccontainer, [nextLine])\n this.ccontainer = nextContainer\n this.depth++\n // when header is clicked, collapse/uncollapse container\n dom.addEventListener(content, 'click', (_event) => {\n nextContainer.toggleAttribute('hidden')\n triangleDown.toggleAttribute('hidden')\n triangleRight.toggleAttribute('hidden')\n })\n })\n }\n\n /**\n * @param {Array} args\n */\n groupCollapsed (args) {\n this.group(args, true)\n }\n\n groupEnd () {\n eventloop.enqueue(() => {\n if (this.depth > 0) {\n this.depth--\n // @ts-ignore\n this.ccontainer = this.ccontainer.parentElement.parentElement\n }\n })\n }\n\n /**\n * @param {Array} args\n */\n print (args) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('div', [\n pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )\n ], _computeLineSpans(args))\n ])\n })\n }\n\n /**\n * @param {Error} err\n */\n printError (err) {\n this.print([common.RED, common.BOLD, err.toString()])\n }\n\n /**\n * @param {string} url\n * @param {number} height\n */\n printImg (url, height) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('img', [\n pair.create('src', url),\n pair.create('height', `${math.round(height * 1.5)}px`)\n ])\n ])\n })\n }\n\n /**\n * @param {Node} node\n */\n printDom (node) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [node])\n })\n }\n\n destroy () {\n eventloop.enqueue(() => {\n vconsoles.delete(this)\n })\n }\n}\n/* c8 ignore stop */\n\n/**\n * @param {Element} dom\n */\n/* c8 ignore next */\nexport const createVConsole = (dom) => new VConsole(dom)\n\n/**\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (moduleName) => common.createModuleLogger(print, moduleName)\n", "/**\n * Utility module to create and manipulate Iterators.\n *\n * @module iterator\n */\n\n/**\n * @template T,R\n * @param {Iterator} iterator\n * @param {function(T):R} f\n * @return {IterableIterator}\n */\nexport const mapIterator = (iterator, f) => ({\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next () {\n const r = iterator.next()\n return { value: r.done ? undefined : f(r.value), done: r.done }\n }\n})\n\n/**\n * @template T\n * @param {function():IteratorResult} next\n * @return {IterableIterator}\n */\nexport const createIterator = next => ({\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next\n})\n\n/**\n * @template T\n * @param {Iterator} iterator\n * @param {function(T):boolean} filter\n */\nexport const iteratorFilter = (iterator, filter) => createIterator(() => {\n let res\n do {\n res = iterator.next()\n } while (!res.done && !filter(res.value))\n return res\n})\n\n/**\n * @template T,M\n * @param {Iterator} iterator\n * @param {function(T):M} fmap\n */\nexport const iteratorMap = (iterator, fmap) => createIterator(() => {\n const { done, value } = iterator.next()\n return { done, value: done ? undefined : fmap(value) }\n})\n", "import { ObservableV2 } from 'lib0/observable'\n\nimport {\n Doc // eslint-disable-line\n} from '../internals.js'\n\n/**\n * This is an abstract interface that all Connectors should implement to keep them interchangeable.\n *\n * @note This interface is experimental and it is not advised to actually inherit this class.\n * It just serves as typing information.\n *\n * @extends {ObservableV2}\n */\nexport class AbstractConnector extends ObservableV2 {\n /**\n * @param {Doc} ydoc\n * @param {any} awareness\n */\n constructor (ydoc, awareness) {\n super()\n this.doc = ydoc\n this.awareness = awareness\n }\n}\n", "import {\n findIndexSS,\n getState,\n splitItem,\n iterateStructs,\n UpdateEncoderV2,\n DSDecoderV1, DSEncoderV1, DSDecoderV2, DSEncoderV2, Item, GC, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nimport * as array from 'lib0/array'\nimport * as math from 'lib0/math'\nimport * as map from 'lib0/map'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\n\nexport class DeleteItem {\n /**\n * @param {number} clock\n * @param {number} len\n */\n constructor (clock, len) {\n /**\n * @type {number}\n */\n this.clock = clock\n /**\n * @type {number}\n */\n this.len = len\n }\n}\n\n/**\n * We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed.\n * - When created in a transaction, it must only be accessed after sorting, and merging\n * - This DeleteSet is send to other clients\n * - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore\n * - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.\n */\nexport class DeleteSet {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n }\n}\n\n/**\n * Iterate over all structs that the DeleteSet gc's.\n *\n * @param {Transaction} transaction\n * @param {DeleteSet} ds\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateDeletedStructs = (transaction, ds, f) =>\n ds.clients.forEach((deletes, clientid) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(clientid))\n for (let i = 0; i < deletes.length; i++) {\n const del = deletes[i]\n iterateStructs(transaction, structs, del.clock, del.len, f)\n }\n })\n\n/**\n * @param {Array} dis\n * @param {number} clock\n * @return {number|null}\n *\n * @private\n * @function\n */\nexport const findIndexDS = (dis, clock) => {\n let left = 0\n let right = dis.length - 1\n while (left <= right) {\n const midindex = math.floor((left + right) / 2)\n const mid = dis[midindex]\n const midclock = mid.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.len) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {ID} id\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const isDeleted = (ds, id) => {\n const dis = ds.clients.get(id.client)\n return dis !== undefined && findIndexDS(dis, id.clock) !== null\n}\n\n/**\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const sortAndMergeDeleteSet = ds => {\n ds.clients.forEach(dels => {\n dels.sort((a, b) => a.clock - b.clock)\n // merge items without filtering or splicing the array\n // i is the current pointer\n // j refers to the current insert position for the pointed item\n // try to merge dels[i] into dels[j-1] or set dels[j]=dels[i]\n let i, j\n for (i = 1, j = 1; i < dels.length; i++) {\n const left = dels[j - 1]\n const right = dels[i]\n if (left.clock + left.len >= right.clock) {\n left.len = math.max(left.len, right.clock + right.len - left.clock)\n } else {\n if (j < i) {\n dels[j] = right\n }\n j++\n }\n }\n dels.length = j\n })\n}\n\n/**\n * @param {Array} dss\n * @return {DeleteSet} A fresh DeleteSet\n */\nexport const mergeDeleteSets = dss => {\n const merged = new DeleteSet()\n for (let dssI = 0; dssI < dss.length; dssI++) {\n dss[dssI].clients.forEach((delsLeft, client) => {\n if (!merged.clients.has(client)) {\n // Write all missing keys from current ds and all following.\n // If merged already contains `client` current ds has already been added.\n /**\n * @type {Array}\n */\n const dels = delsLeft.slice()\n for (let i = dssI + 1; i < dss.length; i++) {\n array.appendTo(dels, dss[i].clients.get(client) || [])\n }\n merged.clients.set(client, dels)\n }\n })\n }\n sortAndMergeDeleteSet(merged)\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {number} client\n * @param {number} clock\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const addToDeleteSet = (ds, client, clock, length) => {\n map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([])).push(new DeleteItem(clock, length))\n}\n\nexport const createDeleteSet = () => new DeleteSet()\n\n/**\n * @param {StructStore} ss\n * @return {DeleteSet} Merged and sorted DeleteSet\n *\n * @private\n * @function\n */\nexport const createDeleteSetFromStructStore = ss => {\n const ds = createDeleteSet()\n ss.clients.forEach((structs, client) => {\n /**\n * @type {Array}\n */\n const dsitems = []\n for (let i = 0; i < structs.length; i++) {\n const struct = structs[i]\n if (struct.deleted) {\n const clock = struct.id.clock\n let len = struct.length\n if (i + 1 < structs.length) {\n for (let next = structs[i + 1]; i + 1 < structs.length && next.deleted; next = structs[++i + 1]) {\n len += next.length\n }\n }\n dsitems.push(new DeleteItem(clock, len))\n }\n }\n if (dsitems.length > 0) {\n ds.clients.set(client, dsitems)\n }\n })\n return ds\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const writeDeleteSet = (encoder, ds) => {\n encoding.writeVarUint(encoder.restEncoder, ds.clients.size)\n\n // Ensure that the delete set is written in a deterministic order\n array.from(ds.clients.entries())\n .sort((a, b) => b[0] - a[0])\n .forEach(([client, dsitems]) => {\n encoder.resetDsCurVal()\n encoding.writeVarUint(encoder.restEncoder, client)\n const len = dsitems.length\n encoding.writeVarUint(encoder.restEncoder, len)\n for (let i = 0; i < len; i++) {\n const item = dsitems[i]\n encoder.writeDsClock(item.clock)\n encoder.writeDsLen(item.len)\n }\n })\n}\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {DeleteSet}\n *\n * @private\n * @function\n */\nexport const readDeleteSet = decoder => {\n const ds = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n if (numberOfDeletes > 0) {\n const dsField = map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([]))\n for (let i = 0; i < numberOfDeletes; i++) {\n dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()))\n }\n }\n }\n return ds\n}\n\n/**\n * @todo YDecoder also contains references to String and other Decoders. Would make sense to exchange YDecoder.toUint8Array for YDecoder.DsToUint8Array()..\n */\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {Uint8Array|null} Returns a v2 update containing all deletes that couldn't be applied yet; or null if all deletes were applied successfully.\n *\n * @private\n * @function\n */\nexport const readAndApplyDeleteSet = (decoder, transaction, store) => {\n const unappliedDS = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n const structs = store.clients.get(client) || []\n const state = getState(store, client)\n for (let i = 0; i < numberOfDeletes; i++) {\n const clock = decoder.readDsClock()\n const clockEnd = clock + decoder.readDsLen()\n if (clock < state) {\n if (state < clockEnd) {\n addToDeleteSet(unappliedDS, client, state, clockEnd - state)\n }\n let index = findIndexSS(structs, clock)\n /**\n * We can ignore the case of GC and Delete structs, because we are going to skip them\n * @type {Item}\n */\n // @ts-ignore\n let struct = structs[index]\n // split the first item if necessary\n if (!struct.deleted && struct.id.clock < clock) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n index++ // increase we now want to use the next struct\n }\n while (index < structs.length) {\n // @ts-ignore\n struct = structs[index++]\n if (struct.id.clock < clockEnd) {\n if (!struct.deleted) {\n if (clockEnd < struct.id.clock + struct.length) {\n structs.splice(index, 0, splitItem(transaction, struct, clockEnd - struct.id.clock))\n }\n struct.delete(transaction)\n }\n } else {\n break\n }\n }\n } else {\n addToDeleteSet(unappliedDS, client, clock, clockEnd - clock)\n }\n }\n }\n if (unappliedDS.clients.size > 0) {\n const ds = new UpdateEncoderV2()\n encoding.writeVarUint(ds.restEncoder, 0) // encode 0 structs\n writeDeleteSet(ds, unappliedDS)\n return ds.toUint8Array()\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds1\n * @param {DeleteSet} ds2\n */\nexport const equalDeleteSets = (ds1, ds2) => {\n if (ds1.clients.size !== ds2.clients.size) return false\n for (const [client, deleteItems1] of ds1.clients.entries()) {\n const deleteItems2 = /** @type {Array} */ (ds2.clients.get(client))\n if (deleteItems2 === undefined || deleteItems1.length !== deleteItems2.length) return false\n for (let i = 0; i < deleteItems1.length; i++) {\n const di1 = deleteItems1[i]\n const di2 = deleteItems2[i]\n if (di1.clock !== di2.clock || di1.len !== di2.len) {\n return false\n }\n }\n }\n return true\n}\n", "/**\n * @module Y\n */\n\nimport {\n StructStore,\n AbstractType,\n YArray,\n YText,\n YMap,\n YXmlElement,\n YXmlFragment,\n transact,\n ContentDoc, Item, Transaction, YEvent // eslint-disable-line\n} from '../internals.js'\n\nimport { ObservableV2 } from 'lib0/observable'\nimport * as random from 'lib0/random'\nimport * as map from 'lib0/map'\nimport * as array from 'lib0/array'\nimport * as promise from 'lib0/promise'\n\nexport const generateNewClientId = random.uint32\n\n/**\n * @typedef {Object} DocOpts\n * @property {boolean} [DocOpts.gc=true] Disable garbage collection (default: gc=true)\n * @property {function(Item):boolean} [DocOpts.gcFilter] Will be called before an Item is garbage collected. Return false to keep the Item.\n * @property {string} [DocOpts.guid] Define a globally unique identifier for this document\n * @property {string | null} [DocOpts.collectionid] Associate this document with a collection. This only plays a role if your provider has a concept of collection.\n * @property {any} [DocOpts.meta] Any kind of meta information you want to associate with this document. If this is a subdocument, remote peers will store the meta information as well.\n * @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.\n * @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()\n */\n\n/**\n * @typedef {Object} DocEvents\n * @property {function(Doc):void} DocEvents.destroy\n * @property {function(Doc):void} DocEvents.load\n * @property {function(boolean, Doc):void} DocEvents.sync\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.update\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.updateV2\n * @property {function(Doc):void} DocEvents.beforeAllTransactions\n * @property {function(Transaction, Doc):void} DocEvents.beforeTransaction\n * @property {function(Transaction, Doc):void} DocEvents.beforeObserverCalls\n * @property {function(Transaction, Doc):void} DocEvents.afterTransaction\n * @property {function(Transaction, Doc):void} DocEvents.afterTransactionCleanup\n * @property {function(Doc, Array):void} DocEvents.afterAllTransactions\n * @property {function({ loaded: Set, added: Set, removed: Set }, Doc, Transaction):void} DocEvents.subdocs\n */\n\n/**\n * A Yjs instance handles the state of shared data.\n * @extends ObservableV2\n */\nexport class Doc extends ObservableV2 {\n /**\n * @param {DocOpts} opts configuration\n */\n constructor ({ guid = random.uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false, shouldLoad = true } = {}) {\n super()\n this.gc = gc\n this.gcFilter = gcFilter\n this.clientID = generateNewClientId()\n this.guid = guid\n this.collectionid = collectionid\n /**\n * @type {Map>>}\n */\n this.share = new Map()\n this.store = new StructStore()\n /**\n * @type {Transaction | null}\n */\n this._transaction = null\n /**\n * @type {Array}\n */\n this._transactionCleanups = []\n /**\n * @type {Set}\n */\n this.subdocs = new Set()\n /**\n * If this document is a subdocument - a document integrated into another document - then _item is defined.\n * @type {Item?}\n */\n this._item = null\n this.shouldLoad = shouldLoad\n this.autoLoad = autoLoad\n this.meta = meta\n /**\n * This is set to true when the persistence provider loaded the document from the database or when the `sync` event fires.\n * Note that not all providers implement this feature. Provider authors are encouraged to fire the `load` event when the doc content is loaded from the database.\n *\n * @type {boolean}\n */\n this.isLoaded = false\n /**\n * This is set to true when the connection provider has successfully synced with a backend.\n * Note that when using peer-to-peer providers this event may not provide very useful.\n * Also note that not all providers implement this feature. Provider authors are encouraged to fire\n * the `sync` event when the doc has been synced (with `true` as a parameter) or if connection is\n * lost (with false as a parameter).\n */\n this.isSynced = false\n this.isDestroyed = false\n /**\n * Promise that resolves once the document has been loaded from a presistence provider.\n */\n this.whenLoaded = promise.create(resolve => {\n this.on('load', () => {\n this.isLoaded = true\n resolve(this)\n })\n })\n const provideSyncedPromise = () => promise.create(resolve => {\n /**\n * @param {boolean} isSynced\n */\n const eventHandler = (isSynced) => {\n if (isSynced === undefined || isSynced === true) {\n this.off('sync', eventHandler)\n resolve()\n }\n }\n this.on('sync', eventHandler)\n })\n this.on('sync', isSynced => {\n if (isSynced === false && this.isSynced) {\n this.whenSynced = provideSyncedPromise()\n }\n this.isSynced = isSynced === undefined || isSynced === true\n if (this.isSynced && !this.isLoaded) {\n this.emit('load', [this])\n }\n })\n /**\n * Promise that resolves once the document has been synced with a backend.\n * This promise is recreated when the connection is lost.\n * Note the documentation about the `isSynced` property.\n */\n this.whenSynced = provideSyncedPromise()\n }\n\n /**\n * Notify the parent document that you request to load data into this subdocument (if it is a subdocument).\n *\n * `load()` might be used in the future to request any provider to load the most current data.\n *\n * It is safe to call `load()` multiple times.\n */\n load () {\n const item = this._item\n if (item !== null && !this.shouldLoad) {\n transact(/** @type {any} */ (item.parent).doc, transaction => {\n transaction.subdocsLoaded.add(this)\n }, null, true)\n }\n this.shouldLoad = true\n }\n\n getSubdocs () {\n return this.subdocs\n }\n\n getSubdocGuids () {\n return new Set(array.from(this.subdocs).map(doc => doc.guid))\n }\n\n /**\n * Changes that happen inside of a transaction are bundled. This means that\n * the observer fires _after_ the transaction is finished and that all changes\n * that happened inside of the transaction are sent as one message to the\n * other peers.\n *\n * @template T\n * @param {function(Transaction):T} f The function that should be executed as a transaction\n * @param {any} [origin] Origin of who started the transaction. Will be stored on transaction.origin\n * @return T\n *\n * @public\n */\n transact (f, origin = null) {\n return transact(this, f, origin)\n }\n\n /**\n * Define a shared data type.\n *\n * Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result\n * and do not overwrite each other. I.e.\n * `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)`\n *\n * After this method is called, the type is also available on `ydoc.share.get(name)`.\n *\n * *Best Practices:*\n * Define all types right after the Y.Doc instance is created and store them in a separate object.\n * Also use the typed methods `getText(name)`, `getArray(name)`, ..\n *\n * @template {typeof AbstractType} Type\n * @example\n * const ydoc = new Y.Doc(..)\n * const appState = {\n * document: ydoc.getText('document')\n * comments: ydoc.getArray('comments')\n * }\n *\n * @param {string} name\n * @param {Type} TypeConstructor The constructor of the type definition. E.g. Y.Text, Y.Array, Y.Map, ...\n * @return {InstanceType} The created type. Constructed with TypeConstructor\n *\n * @public\n */\n get (name, TypeConstructor = /** @type {any} */ (AbstractType)) {\n const type = map.setIfUndefined(this.share, name, () => {\n // @ts-ignore\n const t = new TypeConstructor()\n t._integrate(this, null)\n return t\n })\n const Constr = type.constructor\n if (TypeConstructor !== AbstractType && Constr !== TypeConstructor) {\n if (Constr === AbstractType) {\n // @ts-ignore\n const t = new TypeConstructor()\n t._map = type._map\n type._map.forEach(/** @param {Item?} n */ n => {\n for (; n !== null; n = n.left) {\n // @ts-ignore\n n.parent = t\n }\n })\n t._start = type._start\n for (let n = t._start; n !== null; n = n.right) {\n n.parent = t\n }\n t._length = type._length\n this.share.set(name, t)\n t._integrate(this, null)\n return /** @type {InstanceType} */ (t)\n } else {\n throw new Error(`Type with the name ${name} has already been defined with a different constructor`)\n }\n }\n return /** @type {InstanceType} */ (type)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YArray}\n *\n * @public\n */\n getArray (name = '') {\n return /** @type {YArray} */ (this.get(name, YArray))\n }\n\n /**\n * @param {string} [name]\n * @return {YText}\n *\n * @public\n */\n getText (name = '') {\n return this.get(name, YText)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YMap}\n *\n * @public\n */\n getMap (name = '') {\n return /** @type {YMap} */ (this.get(name, YMap))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlElement}\n *\n * @public\n */\n getXmlElement (name = '') {\n return /** @type {YXmlElement<{[key:string]:string}>} */ (this.get(name, YXmlElement))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlFragment}\n *\n * @public\n */\n getXmlFragment (name = '') {\n return this.get(name, YXmlFragment)\n }\n\n /**\n * Converts the entire document into a js object, recursively traversing each yjs type\n * Doesn't log types that have not been defined (using ydoc.getType(..)).\n *\n * @deprecated Do not use this method and rather call toJSON directly on the shared types.\n *\n * @return {Object}\n */\n toJSON () {\n /**\n * @type {Object}\n */\n const doc = {}\n\n this.share.forEach((value, key) => {\n doc[key] = value.toJSON()\n })\n\n return doc\n }\n\n /**\n * Emit `destroy` event and unregister all event handlers.\n */\n destroy () {\n this.isDestroyed = true\n array.from(this.subdocs).forEach(subdoc => subdoc.destroy())\n const item = this._item\n if (item !== null) {\n this._item = null\n const content = /** @type {ContentDoc} */ (item.content)\n content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })\n content.doc._item = item\n transact(/** @type {any} */ (item).parent.doc, transaction => {\n const doc = content.doc\n if (!item.deleted) {\n transaction.subdocsAdded.add(doc)\n }\n transaction.subdocsRemoved.add(this)\n }, null, true)\n }\n // @ts-ignore\n this.emit('destroyed', [true]) // DEPRECATED!\n this.emit('destroy', [this])\n super.destroy()\n }\n}\n", "import * as buffer from 'lib0/buffer'\nimport * as decoding from 'lib0/decoding'\nimport {\n ID, createID\n} from '../internals.js'\n\nexport class DSDecoderV1 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n}\n\nexport class UpdateDecoderV1 extends DSDecoderV1 {\n /**\n * @return {ID}\n */\n readLeftID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return decoding.readUint8(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readString () {\n return decoding.readVarString(this.restDecoder)\n }\n\n /**\n * @return {boolean} isKey\n */\n readParentInfo () {\n return decoding.readVarUint(this.restDecoder) === 1\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readTypeRef () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number} len\n */\n readLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return buffer.copyUint8Array(decoding.readVarUint8Array(this.restDecoder))\n }\n\n /**\n * Legacy implementation uses JSON parse. We use any-decoding in v2.\n *\n * @return {any}\n */\n readJSON () {\n return JSON.parse(decoding.readVarString(this.restDecoder))\n }\n\n /**\n * @return {string}\n */\n readKey () {\n return decoding.readVarString(this.restDecoder)\n }\n}\n\nexport class DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n /**\n * @private\n */\n this.dsCurrVal = 0\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n this.dsCurrVal += decoding.readVarUint(this.restDecoder)\n return this.dsCurrVal\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n const diff = decoding.readVarUint(this.restDecoder) + 1\n this.dsCurrVal += diff\n return diff\n }\n}\n\nexport class UpdateDecoderV2 extends DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n super(decoder)\n /**\n * List of cached keys. If the keys[id] does not exist, we read a new key\n * from stringEncoder and push it to keys.\n *\n * @type {Array}\n */\n this.keys = []\n decoding.readVarUint(decoder) // read feature flag - currently unused\n this.keyClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.clientDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.leftClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.rightClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.infoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.stringDecoder = new decoding.StringDecoder(decoding.readVarUint8Array(decoder))\n this.parentInfoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.typeRefDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.lenDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n }\n\n /**\n * @return {ID}\n */\n readLeftID () {\n return new ID(this.clientDecoder.read(), this.leftClockDecoder.read())\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return new ID(this.clientDecoder.read(), this.rightClockDecoder.read())\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return this.clientDecoder.read()\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return /** @type {number} */ (this.infoDecoder.read())\n }\n\n /**\n * @return {string}\n */\n readString () {\n return this.stringDecoder.read()\n }\n\n /**\n * @return {boolean}\n */\n readParentInfo () {\n return this.parentInfoDecoder.read() === 1\n }\n\n /**\n * @return {number} An unsigned 8-bit integer\n */\n readTypeRef () {\n return this.typeRefDecoder.read()\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number}\n */\n readLen () {\n return this.lenDecoder.read()\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return decoding.readVarUint8Array(this.restDecoder)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @return {any}\n */\n readJSON () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readKey () {\n const keyClock = this.keyClockDecoder.read()\n if (keyClock < this.keys.length) {\n return this.keys[keyClock]\n } else {\n const key = this.stringDecoder.read()\n this.keys.push(key)\n return key\n }\n }\n}\n", "import * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nimport {\n ID // eslint-disable-line\n} from '../internals.js'\n\nexport class DSEncoderV1 {\n constructor () {\n this.restEncoder = encoding.createEncoder()\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n encoding.writeVarUint(this.restEncoder, clock)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n}\n\nexport class UpdateEncoderV1 extends DSEncoderV1 {\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * Use writeClient and writeClock instead of writeID if possible.\n * @param {number} client\n */\n writeClient (client) {\n encoding.writeVarUint(this.restEncoder, client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n encoding.writeUint8(this.restEncoder, info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n encoding.writeVarString(this.restEncoder, s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n encoding.writeVarUint(this.restEncoder, isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n encoding.writeVarUint(this.restEncoder, info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeVarString(this.restEncoder, JSON.stringify(embed))\n }\n\n /**\n * @param {string} key\n */\n writeKey (key) {\n encoding.writeVarString(this.restEncoder, key)\n }\n}\n\nexport class DSEncoderV2 {\n constructor () {\n this.restEncoder = encoding.createEncoder() // encodes all the rest / non-optimized\n this.dsCurrVal = 0\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n const diff = clock - this.dsCurrVal\n this.dsCurrVal = clock\n encoding.writeVarUint(this.restEncoder, diff)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n if (len === 0) {\n error.unexpectedCase()\n }\n encoding.writeVarUint(this.restEncoder, len - 1)\n this.dsCurrVal += len\n }\n}\n\nexport class UpdateEncoderV2 extends DSEncoderV2 {\n constructor () {\n super()\n /**\n * @type {Map}\n */\n this.keyMap = new Map()\n /**\n * Refers to the next uniqe key-identifier to me used.\n * See writeKey method for more information.\n *\n * @type {number}\n */\n this.keyClock = 0\n this.keyClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.clientEncoder = new encoding.UintOptRleEncoder()\n this.leftClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.rightClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.infoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.stringEncoder = new encoding.StringEncoder()\n this.parentInfoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.typeRefEncoder = new encoding.UintOptRleEncoder()\n this.lenEncoder = new encoding.UintOptRleEncoder()\n }\n\n toUint8Array () {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, 0) // this is a feature flag that we might use in the future\n encoding.writeVarUint8Array(encoder, this.keyClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.clientEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.leftClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.rightClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.infoEncoder))\n encoding.writeVarUint8Array(encoder, this.stringEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.parentInfoEncoder))\n encoding.writeVarUint8Array(encoder, this.typeRefEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.lenEncoder.toUint8Array())\n // @note The rest encoder is appended! (note the missing var)\n encoding.writeUint8Array(encoder, encoding.toUint8Array(this.restEncoder))\n return encoding.toUint8Array(encoder)\n }\n\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n this.clientEncoder.write(id.client)\n this.leftClockEncoder.write(id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n this.clientEncoder.write(id.client)\n this.rightClockEncoder.write(id.clock)\n }\n\n /**\n * @param {number} client\n */\n writeClient (client) {\n this.clientEncoder.write(client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n this.infoEncoder.write(info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n this.stringEncoder.write(s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n this.parentInfoEncoder.write(isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n this.typeRefEncoder.write(info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n this.lenEncoder.write(len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeAny(this.restEncoder, embed)\n }\n\n /**\n * Property keys are often reused. For example, in y-prosemirror the key `bold` might\n * occur very often. For a 3d application, the key `position` might occur very often.\n *\n * We cache these keys in a Map and refer to them via a unique number.\n *\n * @param {string} key\n */\n writeKey (key) {\n const clock = this.keyMap.get(key)\n if (clock === undefined) {\n /**\n * @todo uncomment to introduce this feature finally\n *\n * Background. The ContentFormat object was always encoded using writeKey, but the decoder used to use readString.\n * Furthermore, I forgot to set the keyclock. So everything was working fine.\n *\n * However, this feature here is basically useless as it is not being used (it actually only consumes extra memory).\n *\n * I don't know yet how to reintroduce this feature..\n *\n * Older clients won't be able to read updates when we reintroduce this feature. So this should probably be done using a flag.\n *\n */\n // this.keyMap.set(key, this.keyClock)\n this.keyClockEncoder.write(this.keyClock++)\n this.stringEncoder.write(key)\n } else {\n this.keyClockEncoder.write(clock)\n }\n }\n}\n", "/**\n * @module encoding\n */\n/*\n * We use the first five bits in the info flag for determining the type of the struct.\n *\n * 0: GC\n * 1: Item with Deleted content\n * 2: Item with JSON content\n * 3: Item with Binary content\n * 4: Item with String content\n * 5: Item with Embed content (for richtext content)\n * 6: Item with Format content (a formatting marker for richtext content)\n * 7: Item with Type\n */\n\nimport {\n findIndexSS,\n getState,\n createID,\n getStateVector,\n readAndApplyDeleteSet,\n writeDeleteSet,\n createDeleteSetFromStructStore,\n transact,\n readItemContent,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n DSEncoderV2,\n DSDecoderV1,\n DSEncoderV1,\n mergeUpdates,\n mergeUpdatesV2,\n Skip,\n diffUpdateV2,\n convertUpdateFormatV2ToV1,\n DSDecoderV2, Doc, Transaction, GC, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as binary from 'lib0/binary'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as array from 'lib0/array'\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Array} structs All structs by `client`\n * @param {number} client\n * @param {number} clock write structs starting with `ID(client,clock)`\n *\n * @function\n */\nconst writeStructs = (encoder, structs, client, clock) => {\n // write first id\n clock = math.max(clock, structs[0].id.clock) // make sure the first id exists\n const startNewStructs = findIndexSS(structs, clock)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, structs.length - startNewStructs)\n encoder.writeClient(client)\n encoding.writeVarUint(encoder.restEncoder, clock)\n const firstStruct = structs[startNewStructs]\n // write first struct with an offset\n firstStruct.write(encoder, clock - firstStruct.id.clock)\n for (let i = startNewStructs + 1; i < structs.length; i++) {\n structs[i].write(encoder, 0)\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {StructStore} store\n * @param {Map} _sm\n *\n * @private\n * @function\n */\nexport const writeClientsStructs = (encoder, store, _sm) => {\n // we filter all valid _sm entries into sm\n const sm = new Map()\n _sm.forEach((clock, client) => {\n // only write if new structs are available\n if (getState(store, client) > clock) {\n sm.set(client, clock)\n }\n })\n getStateVector(store).forEach((_clock, client) => {\n if (!_sm.has(client)) {\n sm.set(client, 0)\n }\n })\n // write # states that were updated\n encoding.writeVarUint(encoder.restEncoder, sm.size)\n // Write items with higher client ids first\n // This heavily improves the conflict algorithm.\n array.from(sm.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n writeStructs(encoder, /** @type {Array} */ (store.clients.get(client)), client, clock)\n })\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder The decoder object to read data from.\n * @param {Doc} doc\n * @return {Map }>}\n *\n * @private\n * @function\n */\nexport const readClientsStructRefs = (decoder, doc) => {\n /**\n * @type {Map }>}\n */\n const clientRefs = map.create()\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n /**\n * @type {Array}\n */\n const refs = new Array(numberOfStructs)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n // const start = performance.now()\n clientRefs.set(client, { i: 0, refs })\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n switch (binary.BITS5 & info) {\n case 0: { // GC\n const len = decoder.readLen()\n refs[i] = new GC(createID(client, clock), len)\n clock += len\n break\n }\n case 10: { // Skip Struct (nothing to apply)\n // @todo we could reduce the amount of checks by adding Skip struct to clientRefs so we know that something is missing.\n const len = decoding.readVarUint(decoder.restDecoder)\n refs[i] = new Skip(createID(client, clock), len)\n clock += len\n break\n }\n default: { // Item with content\n /**\n * The optimized implementation doesn't use any variables because inlining variables is faster.\n * Below a non-optimized version is shown that implements the basic algorithm with\n * a few comments\n */\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n cantCopyParentInfo ? (decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n /* A non-optimized implementation of the above algorithm:\n\n // The item that was originally to the left of this item.\n const origin = (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null\n // The item that was originally to the right of this item.\n const rightOrigin = (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n const hasParentYKey = cantCopyParentInfo ? decoder.readParentInfo() : false\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const parentYKey = cantCopyParentInfo && hasParentYKey ? decoder.readString() : null\n\n const struct = new Item(\n createID(client, clock),\n null, // left\n origin, // origin\n null, // right\n rightOrigin, // right origin\n cantCopyParentInfo && !hasParentYKey ? decoder.readLeftID() : (parentYKey !== null ? doc.get(parentYKey) : null), // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n */\n refs[i] = struct\n clock += struct.length\n }\n }\n }\n // console.log('time to read: ', performance.now() - start) // @todo remove\n }\n return clientRefs\n}\n\n/**\n * Resume computing structs generated by struct readers.\n *\n * While there is something to do, we integrate structs in this order\n * 1. top element on stack, if stack is not empty\n * 2. next element from current struct reader (if empty, use next struct reader)\n *\n * If struct causally depends on another struct (ref.missing), we put next reader of\n * `ref.id.client` on top of stack.\n *\n * At some point we find a struct that has no causal dependencies,\n * then we start emptying the stack.\n *\n * It is not possible to have circles: i.e. struct1 (from client1) depends on struct2 (from client2)\n * depends on struct3 (from client1). Therefore the max stack size is eqaul to `structReaders.length`.\n *\n * This method is implemented in a way so that we can resume computation if this update\n * causally depends on another update.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {Map} clientsStructRefs\n * @return { null | { update: Uint8Array, missing: Map } }\n *\n * @private\n * @function\n */\nconst integrateStructs = (transaction, store, clientsStructRefs) => {\n /**\n * @type {Array}\n */\n const stack = []\n // sort them so that we take the higher id first, in case of conflicts the lower id will probably not conflict with the id from the higher user.\n let clientsStructRefsIds = array.from(clientsStructRefs.keys()).sort((a, b) => a - b)\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n const getNextStructTarget = () => {\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n let nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n while (nextStructsTarget.refs.length === nextStructsTarget.i) {\n clientsStructRefsIds.pop()\n if (clientsStructRefsIds.length > 0) {\n nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n } else {\n return null\n }\n }\n return nextStructsTarget\n }\n let curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n return null\n }\n\n /**\n * @type {StructStore}\n */\n const restStructs = new StructStore()\n const missingSV = new Map()\n /**\n * @param {number} client\n * @param {number} clock\n */\n const updateMissingSv = (client, clock) => {\n const mclock = missingSV.get(client)\n if (mclock == null || mclock > clock) {\n missingSV.set(client, clock)\n }\n }\n /**\n * @type {GC|Item}\n */\n let stackHead = /** @type {any} */ (curStructsTarget).refs[/** @type {any} */ (curStructsTarget).i++]\n // caching the state because it is used very often\n const state = new Map()\n\n const addStackToRestSS = () => {\n for (const item of stack) {\n const client = item.id.client\n const unapplicableItems = clientsStructRefs.get(client)\n if (unapplicableItems) {\n // decrement because we weren't able to apply previous operation\n unapplicableItems.i--\n restStructs.clients.set(client, unapplicableItems.refs.slice(unapplicableItems.i))\n clientsStructRefs.delete(client)\n unapplicableItems.i = 0\n unapplicableItems.refs = []\n } else {\n // item was the last item on clientsStructRefs and the field was already cleared. Add item to restStructs and continue\n restStructs.clients.set(client, [item])\n }\n // remove client from clientsStructRefsIds to prevent users from applying the same update again\n clientsStructRefsIds = clientsStructRefsIds.filter(c => c !== client)\n }\n stack.length = 0\n }\n\n // iterate over all struct readers until we are done\n while (true) {\n if (stackHead.constructor !== Skip) {\n const localClock = map.setIfUndefined(state, stackHead.id.client, () => getState(store, stackHead.id.client))\n const offset = localClock - stackHead.id.clock\n if (offset < 0) {\n // update from the same client is missing\n stack.push(stackHead)\n updateMissingSv(stackHead.id.client, stackHead.id.clock - 1)\n // hid a dead wall, add all items from stack to restSS\n addStackToRestSS()\n } else {\n const missing = stackHead.getMissing(transaction, store)\n if (missing !== null) {\n stack.push(stackHead)\n // get the struct reader that has the missing struct\n /**\n * @type {{ refs: Array, i: number }}\n */\n const structRefs = clientsStructRefs.get(/** @type {number} */ (missing)) || { refs: [], i: 0 }\n if (structRefs.refs.length === structRefs.i) {\n // This update message causally depends on another update message that doesn't exist yet\n updateMissingSv(/** @type {number} */ (missing), getState(store, missing))\n addStackToRestSS()\n } else {\n stackHead = structRefs.refs[structRefs.i++]\n continue\n }\n } else if (offset === 0 || offset < stackHead.length) {\n // all fine, apply the stackhead\n stackHead.integrate(transaction, offset)\n state.set(stackHead.id.client, stackHead.id.clock + stackHead.length)\n }\n }\n }\n // iterate to next stackHead\n if (stack.length > 0) {\n stackHead = /** @type {GC|Item} */ (stack.pop())\n } else if (curStructsTarget !== null && curStructsTarget.i < curStructsTarget.refs.length) {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n } else {\n curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n // we are done!\n break\n } else {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n }\n }\n }\n if (restStructs.clients.size > 0) {\n const encoder = new UpdateEncoderV2()\n writeClientsStructs(encoder, restStructs, new Map())\n // write empty deleteset\n // writeDeleteSet(encoder, new DeleteSet())\n encoding.writeVarUint(encoder.restEncoder, 0) // => no need for an extra function call, just write 0 deletes\n return { missing: missingSV, update: encoder.toUint8Array() }\n }\n return null\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(encoder, transaction.doc.store, transaction.beforeState)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {UpdateDecoderV1 | UpdateDecoderV2} [structDecoder]\n *\n * @function\n */\nexport const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) =>\n transact(ydoc, transaction => {\n // force that transaction.local is set to non-local\n transaction.local = false\n let retry = false\n const doc = transaction.doc\n const store = doc.store\n // let start = performance.now()\n const ss = readClientsStructRefs(structDecoder, doc)\n // console.log('time to read structs: ', performance.now() - start) // @todo remove\n // start = performance.now()\n // console.log('time to merge: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const restStructs = integrateStructs(transaction, store, ss)\n const pending = store.pendingStructs\n if (pending) {\n // check if we can apply something\n for (const [client, clock] of pending.missing) {\n if (clock < getState(store, client)) {\n retry = true\n break\n }\n }\n if (restStructs) {\n // merge restStructs into store.pending\n for (const [client, clock] of restStructs.missing) {\n const mclock = pending.missing.get(client)\n if (mclock == null || mclock > clock) {\n pending.missing.set(client, clock)\n }\n }\n pending.update = mergeUpdatesV2([pending.update, restStructs.update])\n }\n } else {\n store.pendingStructs = restStructs\n }\n // console.log('time to integrate: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const dsRest = readAndApplyDeleteSet(structDecoder, transaction, store)\n if (store.pendingDs) {\n // @todo we could make a lower-bound state-vector check as we do above\n const pendingDSUpdate = new UpdateDecoderV2(decoding.createDecoder(store.pendingDs))\n decoding.readVarUint(pendingDSUpdate.restDecoder) // read 0 structs, because we only encode deletes in pendingdsupdate\n const dsRest2 = readAndApplyDeleteSet(pendingDSUpdate, transaction, store)\n if (dsRest && dsRest2) {\n // case 1: ds1 != null && ds2 != null\n store.pendingDs = mergeUpdatesV2([dsRest, dsRest2])\n } else {\n // case 2: ds1 != null\n // case 3: ds2 != null\n // case 4: ds1 == null && ds2 == null\n store.pendingDs = dsRest || dsRest2\n }\n } else {\n // Either dsRest == null && pendingDs == null OR dsRest != null\n store.pendingDs = dsRest\n }\n // console.log('time to cleanup: ', performance.now() - start) // @todo remove\n // start = performance.now()\n\n // console.log('time to resume delete readers: ', performance.now() - start) // @todo remove\n // start = performance.now()\n if (retry) {\n const update = /** @type {{update: Uint8Array}} */ (store.pendingStructs).update\n store.pendingStructs = null\n applyUpdateV2(transaction.doc, update)\n }\n }, transactionOrigin, false)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const readUpdate = (decoder, ydoc, transactionOrigin) => readUpdateV2(decoder, ydoc, transactionOrigin, new UpdateDecoderV1(decoder))\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n *\n * @function\n */\nexport const applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2) => {\n const decoder = decoding.createDecoder(update)\n readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder))\n}\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1)\n\n/**\n * Write all the document as a single update message. If you specify the state of the remote client (`targetStateVector`) it will\n * only write the operations that are missing.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Doc} doc\n * @param {Map} [targetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n *\n * @function\n */\nexport const writeStateAsUpdate = (encoder, doc, targetStateVector = new Map()) => {\n writeClientsStructs(encoder, doc.store, targetStateVector)\n writeDeleteSet(encoder, createDeleteSetFromStructStore(doc.store))\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2()) => {\n const targetStateVector = decodeStateVector(encodedTargetStateVector)\n writeStateAsUpdate(encoder, doc, targetStateVector)\n const updates = [encoder.toUint8Array()]\n // also add the pending updates (if there are any)\n if (doc.store.pendingDs) {\n updates.push(doc.store.pendingDs)\n }\n if (doc.store.pendingStructs) {\n updates.push(diffUpdateV2(doc.store.pendingStructs.update, encodedTargetStateVector))\n }\n if (updates.length > 1) {\n if (encoder.constructor === UpdateEncoderV1) {\n return mergeUpdates(updates.map((update, i) => i === 0 ? update : convertUpdateFormatV2ToV1(update)))\n } else if (encoder.constructor === UpdateEncoderV2) {\n return mergeUpdatesV2(updates)\n }\n }\n return updates[0]\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdate = (doc, encodedTargetStateVector) => encodeStateAsUpdateV2(doc, encodedTargetStateVector, new UpdateEncoderV1())\n\n/**\n * Read state vector from Decoder and return as Map\n *\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const readStateVector = decoder => {\n const ss = new Map()\n const ssLength = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < ssLength; i++) {\n const client = decoding.readVarUint(decoder.restDecoder)\n const clock = decoding.readVarUint(decoder.restDecoder)\n ss.set(client, clock)\n }\n return ss\n}\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\n// export const decodeStateVectorV2 = decodedState => readStateVector(new DSDecoderV2(decoding.createDecoder(decodedState)))\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const decodeStateVector = decodedState => readStateVector(new DSDecoderV1(decoding.createDecoder(decodedState)))\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Map} sv\n * @function\n */\nexport const writeStateVector = (encoder, sv) => {\n encoding.writeVarUint(encoder.restEncoder, sv.size)\n array.from(sv.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n encoding.writeVarUint(encoder.restEncoder, client) // @todo use a special client decoder that is based on mapping\n encoding.writeVarUint(encoder.restEncoder, clock)\n })\n return encoder\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Doc} doc\n *\n * @function\n */\nexport const writeDocumentStateVector = (encoder, doc) => writeStateVector(encoder, getStateVector(doc.store))\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVectorV2 = (doc, encoder = new DSEncoderV2()) => {\n if (doc instanceof Map) {\n writeStateVector(encoder, doc)\n } else {\n writeDocumentStateVector(encoder, doc)\n }\n return encoder.toUint8Array()\n}\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVector = doc => encodeStateVectorV2(doc, new DSEncoderV1())\n", "import * as f from 'lib0/function'\n\n/**\n * General event handler implementation.\n *\n * @template ARG0, ARG1\n *\n * @private\n */\nexport class EventHandler {\n constructor () {\n /**\n * @type {Array}\n */\n this.l = []\n }\n}\n\n/**\n * @template ARG0,ARG1\n * @returns {EventHandler}\n *\n * @private\n * @function\n */\nexport const createEventHandler = () => new EventHandler()\n\n/**\n * Adds an event listener that is called when\n * {@link EventHandler#callEventListeners} is called.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler.\n *\n * @private\n * @function\n */\nexport const addEventHandlerListener = (eventHandler, f) =>\n eventHandler.l.push(f)\n\n/**\n * Removes an event listener.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler that was added with\n * {@link EventHandler#addEventListener}\n *\n * @private\n * @function\n */\nexport const removeEventHandlerListener = (eventHandler, f) => {\n const l = eventHandler.l\n const len = l.length\n eventHandler.l = l.filter(g => f !== g)\n if (len === eventHandler.l.length) {\n console.error('[yjs] Tried to remove event handler that doesn\\'t exist.')\n }\n}\n\n/**\n * Removes all event listeners.\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n *\n * @private\n * @function\n */\nexport const removeAllEventHandlerListeners = eventHandler => {\n eventHandler.l.length = 0\n}\n\n/**\n * Call all event listeners that were added via\n * {@link EventHandler#addEventListener}.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {ARG0} arg0\n * @param {ARG1} arg1\n *\n * @private\n * @function\n */\nexport const callEventHandlerListeners = (eventHandler, arg0, arg1) =>\n f.callAll(eventHandler.l, [arg0, arg1])\n", "import { AbstractType } from '../internals.js' // eslint-disable-line\n\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\n\nexport class ID {\n /**\n * @param {number} client client id\n * @param {number} clock unique per client id, continuous number\n */\n constructor (client, clock) {\n /**\n * Client id\n * @type {number}\n */\n this.client = client\n /**\n * unique per client id, continuous number\n * @type {number}\n */\n this.clock = clock\n }\n}\n\n/**\n * @param {ID | null} a\n * @param {ID | null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareIDs = (a, b) => a === b || (a !== null && b !== null && a.client === b.client && a.clock === b.clock)\n\n/**\n * @param {number} client\n * @param {number} clock\n *\n * @private\n * @function\n */\nexport const createID = (client, clock) => new ID(client, clock)\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {ID} id\n *\n * @private\n * @function\n */\nexport const writeID = (encoder, id) => {\n encoding.writeVarUint(encoder, id.client)\n encoding.writeVarUint(encoder, id.clock)\n}\n\n/**\n * Read ID.\n * * If first varUint read is 0xFFFFFF a RootID is returned.\n * * Otherwise an ID is returned\n *\n * @param {decoding.Decoder} decoder\n * @return {ID}\n *\n * @private\n * @function\n */\nexport const readID = decoder =>\n createID(decoding.readVarUint(decoder), decoding.readVarUint(decoder))\n\n/**\n * The top types are mapped from y.share.get(keyname) => type.\n * `type` does not store any information about the `keyname`.\n * This function finds the correct `keyname` for `type` and throws otherwise.\n *\n * @param {AbstractType} type\n * @return {string}\n *\n * @private\n * @function\n */\nexport const findRootTypeKey = type => {\n // @ts-ignore _y must be defined, otherwise unexpected case\n for (const [key, value] of type.doc.share.entries()) {\n if (value === type) {\n return key\n }\n }\n throw error.unexpectedCase()\n}\n", "import { AbstractType, Item } from '../internals.js' // eslint-disable-line\n\n/**\n * Check if `parent` is a parent of `child`.\n *\n * @param {AbstractType} parent\n * @param {Item|null} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @private\n * @function\n */\nexport const isParentOf = (parent, child) => {\n while (child !== null) {\n if (child.parent === parent) {\n return true\n }\n child = /** @type {AbstractType} */ (child.parent)._item\n }\n return false\n}\n", "import {\n AbstractType // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Convenient helper to log type information.\n *\n * Do not use in productive systems as the output can be immense!\n *\n * @param {AbstractType} type\n */\nexport const logType = type => {\n const res = []\n let n = type._start\n while (n) {\n res.push(n)\n n = n.right\n }\n console.log('Children: ', res)\n console.log('Children content: ', res.filter(m => !m.deleted).map(m => m.content))\n}\n", "import {\n YArray,\n YMap,\n readDeleteSet,\n writeDeleteSet,\n createDeleteSet,\n DSEncoderV1, DSDecoderV1, ID, DeleteSet, YArrayEvent, Transaction, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as decoding from 'lib0/decoding'\n\nimport { mergeDeleteSets, isDeleted } from './DeleteSet.js'\n\nexport class PermanentUserData {\n /**\n * @param {Doc} doc\n * @param {YMap} [storeType]\n */\n constructor (doc, storeType = doc.getMap('users')) {\n /**\n * @type {Map}\n */\n const dss = new Map()\n this.yusers = storeType\n this.doc = doc\n /**\n * Maps from clientid to userDescription\n *\n * @type {Map}\n */\n this.clients = new Map()\n this.dss = dss\n /**\n * @param {YMap} user\n * @param {string} userDescription\n */\n const initUser = (user, userDescription) => {\n /**\n * @type {YArray}\n */\n const ds = user.get('ds')\n const ids = user.get('ids')\n const addClientId = /** @param {number} clientid */ clientid => this.clients.set(clientid, userDescription)\n ds.observe(/** @param {YArrayEvent} event */ event => {\n event.changes.added.forEach(item => {\n item.content.getContent().forEach(encodedDs => {\n if (encodedDs instanceof Uint8Array) {\n this.dss.set(userDescription, mergeDeleteSets([this.dss.get(userDescription) || createDeleteSet(), readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs)))]))\n }\n })\n })\n })\n this.dss.set(userDescription, mergeDeleteSets(ds.map(encodedDs => readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs))))))\n ids.observe(/** @param {YArrayEvent} event */ event =>\n event.changes.added.forEach(item => item.content.getContent().forEach(addClientId))\n )\n ids.forEach(addClientId)\n }\n // observe users\n storeType.observe(event => {\n event.keysChanged.forEach(userDescription =>\n initUser(storeType.get(userDescription), userDescription)\n )\n })\n // add intial data\n storeType.forEach(initUser)\n }\n\n /**\n * @param {Doc} doc\n * @param {number} clientid\n * @param {string} userDescription\n * @param {Object} conf\n * @param {function(Transaction, DeleteSet):boolean} [conf.filter]\n */\n setUserMapping (doc, clientid, userDescription, { filter = () => true } = {}) {\n const users = this.yusers\n let user = users.get(userDescription)\n if (!user) {\n user = new YMap()\n user.set('ids', new YArray())\n user.set('ds', new YArray())\n users.set(userDescription, user)\n }\n user.get('ids').push([clientid])\n users.observe(_event => {\n setTimeout(() => {\n const userOverwrite = users.get(userDescription)\n if (userOverwrite !== user) {\n // user was overwritten, port all data over to the next user object\n // @todo Experiment with Y.Sets here\n user = userOverwrite\n // @todo iterate over old type\n this.clients.forEach((_userDescription, clientid) => {\n if (userDescription === _userDescription) {\n user.get('ids').push([clientid])\n }\n })\n const encoder = new DSEncoderV1()\n const ds = this.dss.get(userDescription)\n if (ds) {\n writeDeleteSet(encoder, ds)\n user.get('ds').push([encoder.toUint8Array()])\n }\n }\n }, 0)\n })\n doc.on('afterTransaction', /** @param {Transaction} transaction */ transaction => {\n setTimeout(() => {\n const yds = user.get('ds')\n const ds = transaction.deleteSet\n if (transaction.local && ds.clients.size > 0 && filter(transaction, ds)) {\n const encoder = new DSEncoderV1()\n writeDeleteSet(encoder, ds)\n yds.push([encoder.toUint8Array()])\n }\n })\n })\n }\n\n /**\n * @param {number} clientid\n * @return {any}\n */\n getUserByClientId (clientid) {\n return this.clients.get(clientid) || null\n }\n\n /**\n * @param {ID} id\n * @return {string | null}\n */\n getUserByDeletedId (id) {\n for (const [userDescription, ds] of this.dss.entries()) {\n if (isDeleted(ds, id)) {\n return userDescription\n }\n }\n return null\n }\n}\n", "import {\n writeID,\n readID,\n compareIDs,\n getState,\n findRootTypeKey,\n Item,\n createID,\n ContentType,\n followRedone,\n getItem,\n ID, Doc, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as error from 'lib0/error'\n\n/**\n * A relative position is based on the Yjs model and is not affected by document changes.\n * E.g. If you place a relative position before a certain character, it will always point to this character.\n * If you place a relative position at the end of a type, it will always point to the end of the type.\n *\n * A numeric position is often unsuited for user selections, because it does not change when content is inserted\n * before or after.\n *\n * ```Insert(0, 'x')('a|bc') = 'xa|bc'``` Where | is the relative position.\n *\n * One of the properties must be defined.\n *\n * @example\n * // Current cursor position is at position 10\n * const relativePosition = createRelativePositionFromIndex(yText, 10)\n * // modify yText\n * yText.insert(0, 'abc')\n * yText.delete(3, 10)\n * // Compute the cursor position\n * const absolutePosition = createAbsolutePositionFromRelativePosition(y, relativePosition)\n * absolutePosition.type === yText // => true\n * console.log('cursor location is ' + absolutePosition.index) // => cursor location is 3\n *\n */\nexport class RelativePosition {\n /**\n * @param {ID|null} type\n * @param {string|null} tname\n * @param {ID|null} item\n * @param {number} assoc\n */\n constructor (type, tname, item, assoc = 0) {\n /**\n * @type {ID|null}\n */\n this.type = type\n /**\n * @type {string|null}\n */\n this.tname = tname\n /**\n * @type {ID | null}\n */\n this.item = item\n /**\n * A relative position is associated to a specific character. By default\n * assoc >= 0, the relative position is associated to the character\n * after the meant position.\n * I.e. position 1 in 'ab' is associated to character 'b'.\n *\n * If assoc < 0, then the relative position is associated to the caharacter\n * before the meant position.\n *\n * @type {number}\n */\n this.assoc = assoc\n }\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {any}\n */\nexport const relativePositionToJSON = rpos => {\n const json = {}\n if (rpos.type) {\n json.type = rpos.type\n }\n if (rpos.tname) {\n json.tname = rpos.tname\n }\n if (rpos.item) {\n json.item = rpos.item\n }\n if (rpos.assoc != null) {\n json.assoc = rpos.assoc\n }\n return json\n}\n\n/**\n * @param {any} json\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromJSON = json => new RelativePosition(json.type == null ? null : createID(json.type.client, json.type.clock), json.tname ?? null, json.item == null ? null : createID(json.item.client, json.item.clock), json.assoc == null ? 0 : json.assoc)\n\nexport class AbsolutePosition {\n /**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n */\n constructor (type, index, assoc = 0) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n /**\n * @type {number}\n */\n this.index = index\n this.assoc = assoc\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createAbsolutePosition = (type, index, assoc = 0) => new AbsolutePosition(type, index, assoc)\n\n/**\n * @param {AbstractType} type\n * @param {ID|null} item\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createRelativePosition = (type, item, assoc) => {\n let typeid = null\n let tname = null\n if (type._item === null) {\n tname = findRootTypeKey(type)\n } else {\n typeid = createID(type._item.id.client, type._item.id.clock)\n }\n return new RelativePosition(typeid, tname, item, assoc)\n}\n\n/**\n * Create a relativePosition based on a absolute position.\n *\n * @param {AbstractType} type The base type (e.g. YText or YArray).\n * @param {number} index The absolute position.\n * @param {number} [assoc]\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {\n let t = type._start\n if (assoc < 0) {\n // associated to the left character or the beginning of a type, increment index if possible.\n if (index === 0) {\n return createRelativePosition(type, null, assoc)\n }\n index--\n }\n while (t !== null) {\n if (!t.deleted && t.countable) {\n if (t.length > index) {\n // case 1: found position somewhere in the linked list\n return createRelativePosition(type, createID(t.id.client, t.id.clock + index), assoc)\n }\n index -= t.length\n }\n if (t.right === null && assoc < 0) {\n // left-associated position, return last available id\n return createRelativePosition(type, t.lastId, assoc)\n }\n t = t.right\n }\n return createRelativePosition(type, null, assoc)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {RelativePosition} rpos\n *\n * @function\n */\nexport const writeRelativePosition = (encoder, rpos) => {\n const { type, tname, item, assoc } = rpos\n if (item !== null) {\n encoding.writeVarUint(encoder, 0)\n writeID(encoder, item)\n } else if (tname !== null) {\n // case 2: found position at the end of the list and type is stored in y.share\n encoding.writeUint8(encoder, 1)\n encoding.writeVarString(encoder, tname)\n } else if (type !== null) {\n // case 3: found position at the end of the list and type is attached to an item\n encoding.writeUint8(encoder, 2)\n writeID(encoder, type)\n } else {\n throw error.unexpectedCase()\n }\n encoding.writeVarInt(encoder, assoc)\n return encoder\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {Uint8Array}\n */\nexport const encodeRelativePosition = rpos => {\n const encoder = encoding.createEncoder()\n writeRelativePosition(encoder, rpos)\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {decoding.Decoder} decoder\n * @return {RelativePosition}\n *\n * @function\n */\nexport const readRelativePosition = decoder => {\n let type = null\n let tname = null\n let itemID = null\n switch (decoding.readVarUint(decoder)) {\n case 0:\n // case 1: found position somewhere in the linked list\n itemID = readID(decoder)\n break\n case 1:\n // case 2: found position at the end of the list and type is stored in y.share\n tname = decoding.readVarString(decoder)\n break\n case 2: {\n // case 3: found position at the end of the list and type is attached to an item\n type = readID(decoder)\n }\n }\n const assoc = decoding.hasContent(decoder) ? decoding.readVarInt(decoder) : 0\n return new RelativePosition(type, tname, itemID, assoc)\n}\n\n/**\n * @param {Uint8Array} uint8Array\n * @return {RelativePosition}\n */\nexport const decodeRelativePosition = uint8Array => readRelativePosition(decoding.createDecoder(uint8Array))\n\n/**\n * Transform a relative position to an absolute position.\n *\n * If you want to share the relative position with other users, you should set\n * `followUndoneDeletions` to false to get consistent results across all clients.\n *\n * When calculating the absolute position, we try to follow the \"undone deletions\". This yields\n * better results for the user who performed undo. However, only the user who performed the undo\n * will get the better results, the other users don't know which operations recreated a deleted\n * range of content. There is more information in this ticket: https://github.com/yjs/yjs/issues/638\n *\n * @param {RelativePosition} rpos\n * @param {Doc} doc\n * @param {boolean} followUndoneDeletions - whether to follow undone deletions - see https://github.com/yjs/yjs/issues/638\n * @return {AbsolutePosition|null}\n *\n * @function\n */\nexport const createAbsolutePositionFromRelativePosition = (rpos, doc, followUndoneDeletions = true) => {\n const store = doc.store\n const rightID = rpos.item\n const typeID = rpos.type\n const tname = rpos.tname\n const assoc = rpos.assoc\n let type = null\n let index = 0\n if (rightID !== null) {\n if (getState(store, rightID.client) <= rightID.clock) {\n return null\n }\n const res = followUndoneDeletions ? followRedone(store, rightID) : { item: getItem(store, rightID), diff: 0 }\n const right = res.item\n if (!(right instanceof Item)) {\n return null\n }\n type = /** @type {AbstractType} */ (right.parent)\n if (type._item === null || !type._item.deleted) {\n index = (right.deleted || !right.countable) ? 0 : (res.diff + (assoc >= 0 ? 0 : 1)) // adjust position based on left association if necessary\n let n = right.left\n while (n !== null) {\n if (!n.deleted && n.countable) {\n index += n.length\n }\n n = n.left\n }\n }\n } else {\n if (tname !== null) {\n type = doc.get(tname)\n } else if (typeID !== null) {\n if (getState(store, typeID.client) <= typeID.clock) {\n // type does not exist yet\n return null\n }\n const { item } = followUndoneDeletions ? followRedone(store, typeID) : { item: getItem(store, typeID) }\n if (item instanceof Item && item.content instanceof ContentType) {\n type = item.content.type\n } else {\n // struct is garbage collected\n return null\n }\n } else {\n throw error.unexpectedCase()\n }\n if (assoc >= 0) {\n index = type._length\n } else {\n index = 0\n }\n }\n return createAbsolutePosition(type, index, rpos.assoc)\n}\n\n/**\n * @param {RelativePosition|null} a\n * @param {RelativePosition|null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareRelativePositions = (a, b) => a === b || (\n a !== null && b !== null && a.tname === b.tname && compareIDs(a.item, b.item) && compareIDs(a.type, b.type) && a.assoc === b.assoc\n)\n", "import {\n isDeleted,\n createDeleteSetFromStructStore,\n getStateVector,\n getItemCleanStart,\n iterateDeletedStructs,\n writeDeleteSet,\n writeStateVector,\n readDeleteSet,\n readStateVector,\n createDeleteSet,\n createID,\n getState,\n findIndexSS,\n UpdateEncoderV2,\n applyUpdateV2,\n LazyStructReader,\n equalDeleteSets,\n UpdateDecoderV1, UpdateDecoderV2, DSEncoderV1, DSEncoderV2, DSDecoderV1, DSDecoderV2, Transaction, Doc, DeleteSet, Item, // eslint-disable-line\n mergeDeleteSets\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as set from 'lib0/set'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\n\nexport class Snapshot {\n /**\n * @param {DeleteSet} ds\n * @param {Map} sv state map\n */\n constructor (ds, sv) {\n /**\n * @type {DeleteSet}\n */\n this.ds = ds\n /**\n * State Map\n * @type {Map}\n */\n this.sv = sv\n }\n}\n\n/**\n * @param {Snapshot} snap1\n * @param {Snapshot} snap2\n * @return {boolean}\n */\nexport const equalSnapshots = (snap1, snap2) => {\n const ds1 = snap1.ds.clients\n const ds2 = snap2.ds.clients\n const sv1 = snap1.sv\n const sv2 = snap2.sv\n if (sv1.size !== sv2.size || ds1.size !== ds2.size) {\n return false\n }\n for (const [key, value] of sv1.entries()) {\n if (sv2.get(key) !== value) {\n return false\n }\n }\n for (const [client, dsitems1] of ds1.entries()) {\n const dsitems2 = ds2.get(client) || []\n if (dsitems1.length !== dsitems2.length) {\n return false\n }\n for (let i = 0; i < dsitems1.length; i++) {\n const dsitem1 = dsitems1[i]\n const dsitem2 = dsitems2[i]\n if (dsitem1.clock !== dsitem2.clock || dsitem1.len !== dsitem2.len) {\n return false\n }\n }\n }\n return true\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n */\nexport const encodeSnapshotV2 = (snapshot, encoder = new DSEncoderV2()) => {\n writeDeleteSet(encoder, snapshot.ds)\n writeStateVector(encoder, snapshot.sv)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Snapshot} snapshot\n * @return {Uint8Array}\n */\nexport const encodeSnapshot = snapshot => encodeSnapshotV2(snapshot, new DSEncoderV1())\n\n/**\n * @param {Uint8Array} buf\n * @param {DSDecoderV1 | DSDecoderV2} [decoder]\n * @return {Snapshot}\n */\nexport const decodeSnapshotV2 = (buf, decoder = new DSDecoderV2(decoding.createDecoder(buf))) => {\n return new Snapshot(readDeleteSet(decoder), readStateVector(decoder))\n}\n\n/**\n * @param {Uint8Array} buf\n * @return {Snapshot}\n */\nexport const decodeSnapshot = buf => decodeSnapshotV2(buf, new DSDecoderV1(decoding.createDecoder(buf)))\n\n/**\n * @param {DeleteSet} ds\n * @param {Map} sm\n * @return {Snapshot}\n */\nexport const createSnapshot = (ds, sm) => new Snapshot(ds, sm)\n\nexport const emptySnapshot = createSnapshot(createDeleteSet(), new Map())\n\n/**\n * @param {Doc} doc\n * @return {Snapshot}\n */\nexport const snapshot = doc => createSnapshot(createDeleteSetFromStructStore(doc.store), getStateVector(doc.store))\n\n/**\n * @param {Item} item\n * @param {Snapshot|undefined} snapshot\n *\n * @protected\n * @function\n */\nexport const isVisible = (item, snapshot) => snapshot === undefined\n ? !item.deleted\n : snapshot.sv.has(item.id.client) && (snapshot.sv.get(item.id.client) || 0) > item.id.clock && !isDeleted(snapshot.ds, item.id)\n\n/**\n * @param {Transaction} transaction\n * @param {Snapshot} snapshot\n */\nexport const splitSnapshotAffectedStructs = (transaction, snapshot) => {\n const meta = map.setIfUndefined(transaction.meta, splitSnapshotAffectedStructs, set.create)\n const store = transaction.doc.store\n // check if we already split for this snapshot\n if (!meta.has(snapshot)) {\n snapshot.sv.forEach((clock, client) => {\n if (clock < getState(store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n })\n iterateDeletedStructs(transaction, snapshot.ds, _item => {})\n meta.add(snapshot)\n }\n}\n\n/**\n * @example\n * const ydoc = new Y.Doc({ gc: false })\n * ydoc.getText().insert(0, 'world!')\n * const snapshot = Y.snapshot(ydoc)\n * ydoc.getText().insert(0, 'hello ')\n * const restored = Y.createDocFromSnapshot(ydoc, snapshot)\n * assert(restored.getText().toString() === 'world!')\n *\n * @param {Doc} originDoc\n * @param {Snapshot} snapshot\n * @param {Doc} [newDoc] Optionally, you may define the Yjs document that receives the data from originDoc\n * @return {Doc}\n */\nexport const createDocFromSnapshot = (originDoc, snapshot, newDoc = new Doc()) => {\n if (originDoc.gc) {\n // we should not try to restore a GC-ed document, because some of the restored items might have their content deleted\n throw new Error('Garbage-collection must be disabled in `originDoc`!')\n }\n const { sv, ds } = snapshot\n\n const encoder = new UpdateEncoderV2()\n originDoc.transact(transaction => {\n let size = 0\n sv.forEach(clock => {\n if (clock > 0) {\n size++\n }\n })\n encoding.writeVarUint(encoder.restEncoder, size)\n // splitting the structs before writing them to the encoder\n for (const [client, clock] of sv) {\n if (clock === 0) {\n continue\n }\n if (clock < getState(originDoc.store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n const structs = originDoc.store.clients.get(client) || []\n const lastStructIndex = findIndexSS(structs, clock - 1)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, lastStructIndex + 1)\n encoder.writeClient(client)\n // first clock written is 0\n encoding.writeVarUint(encoder.restEncoder, 0)\n for (let i = 0; i <= lastStructIndex; i++) {\n structs[i].write(encoder, 0)\n }\n }\n writeDeleteSet(encoder, ds)\n })\n\n applyUpdateV2(newDoc, encoder.toUint8Array(), 'snapshot')\n return newDoc\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n */\nexport const snapshotContainsUpdateV2 = (snapshot, update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n if ((snapshot.sv.get(curr.id.client) || 0) < curr.id.clock + curr.length) {\n return false\n }\n }\n const mergedDS = mergeDeleteSets([snapshot.ds, readDeleteSet(updateDecoder)])\n return equalDeleteSets(snapshot.ds, mergedDS)\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n */\nexport const snapshotContainsUpdate = (snapshot, update) => snapshotContainsUpdateV2(snapshot, update, UpdateDecoderV1)\n", "import {\n GC,\n splitItem,\n Transaction, ID, Item, DSDecoderV2 // eslint-disable-line\n} from '../internals.js'\n\nimport * as math from 'lib0/math'\nimport * as error from 'lib0/error'\n\nexport class StructStore {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n /**\n * @type {null | { missing: Map, update: Uint8Array }}\n */\n this.pendingStructs = null\n /**\n * @type {null | Uint8Array}\n */\n this.pendingDs = null\n }\n}\n\n/**\n * Return the states as a Map.\n * Note that clock refers to the next expected clock id.\n *\n * @param {StructStore} store\n * @return {Map}\n *\n * @public\n * @function\n */\nexport const getStateVector = store => {\n const sm = new Map()\n store.clients.forEach((structs, client) => {\n const struct = structs[structs.length - 1]\n sm.set(client, struct.id.clock + struct.length)\n })\n return sm\n}\n\n/**\n * @param {StructStore} store\n * @param {number} client\n * @return {number}\n *\n * @public\n * @function\n */\nexport const getState = (store, client) => {\n const structs = store.clients.get(client)\n if (structs === undefined) {\n return 0\n }\n const lastStruct = structs[structs.length - 1]\n return lastStruct.id.clock + lastStruct.length\n}\n\n/**\n * @param {StructStore} store\n *\n * @private\n * @function\n */\nexport const integretyCheck = store => {\n store.clients.forEach(structs => {\n for (let i = 1; i < structs.length; i++) {\n const l = structs[i - 1]\n const r = structs[i]\n if (l.id.clock + l.length !== r.id.clock) {\n throw new Error('StructStore failed integrety check')\n }\n }\n })\n}\n\n/**\n * @param {StructStore} store\n * @param {GC|Item} struct\n *\n * @private\n * @function\n */\nexport const addStruct = (store, struct) => {\n let structs = store.clients.get(struct.id.client)\n if (structs === undefined) {\n structs = []\n store.clients.set(struct.id.client, structs)\n } else {\n const lastStruct = structs[structs.length - 1]\n if (lastStruct.id.clock + lastStruct.length !== struct.id.clock) {\n throw error.unexpectedCase()\n }\n }\n structs.push(struct)\n}\n\n/**\n * Perform a binary search on a sorted array\n * @param {Array} structs\n * @param {number} clock\n * @return {number}\n *\n * @private\n * @function\n */\nexport const findIndexSS = (structs, clock) => {\n let left = 0\n let right = structs.length - 1\n let mid = structs[right]\n let midclock = mid.id.clock\n if (midclock === clock) {\n return right\n }\n // @todo does it even make sense to pivot the search?\n // If a good split misses, it might actually increase the time to find the correct item.\n // Currently, the only advantage is that search with pivoting might find the item on the first try.\n let midindex = math.floor((clock / (midclock + mid.length - 1)) * right) // pivoting the search\n while (left <= right) {\n mid = structs[midindex]\n midclock = mid.id.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.length) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n midindex = math.floor((left + right) / 2)\n }\n // Always check state before looking for a struct in StructStore\n // Therefore the case of not finding a struct is unexpected\n throw error.unexpectedCase()\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {GC|Item}\n *\n * @private\n * @function\n */\nexport const find = (store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n return structs[findIndexSS(structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n * @private\n * @function\n */\nexport const getItem = /** @type {function(StructStore,ID):Item} */ (find)\n\n/**\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clock\n */\nexport const findIndexCleanStart = (transaction, structs, clock) => {\n const index = findIndexSS(structs, clock)\n const struct = structs[index]\n if (struct.id.clock < clock && struct instanceof Item) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n return index + 1\n }\n return index\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanStart = (transaction, id) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(id.client))\n return structs[findIndexCleanStart(transaction, structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanEnd = (transaction, store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n const index = findIndexSS(structs, id.clock)\n const struct = structs[index]\n if (id.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, id.clock - struct.id.clock + 1))\n }\n return struct\n}\n\n/**\n * Replace `item` with `newitem` in store\n * @param {StructStore} store\n * @param {GC|Item} struct\n * @param {GC|Item} newStruct\n *\n * @private\n * @function\n */\nexport const replaceStruct = (store, struct, newStruct) => {\n const structs = /** @type {Array} */ (store.clients.get(struct.id.client))\n structs[findIndexSS(structs, struct.id.clock)] = newStruct\n}\n\n/**\n * Iterate over a range of structs\n *\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clockStart Inclusive start\n * @param {number} len\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateStructs = (transaction, structs, clockStart, len, f) => {\n if (len === 0) {\n return\n }\n const clockEnd = clockStart + len\n let index = findIndexCleanStart(transaction, structs, clockStart)\n let struct\n do {\n struct = structs[index++]\n if (clockEnd < struct.id.clock + struct.length) {\n findIndexCleanStart(transaction, structs, clockEnd)\n }\n f(struct)\n } while (index < structs.length && structs[index].id.clock < clockEnd)\n}\n", "import {\n getState,\n writeStructsFromTransaction,\n writeDeleteSet,\n DeleteSet,\n sortAndMergeDeleteSet,\n getStateVector,\n findIndexSS,\n callEventHandlerListeners,\n Item,\n generateNewClientId,\n createID,\n cleanupYTextAfterTransaction,\n UpdateEncoderV1, UpdateEncoderV2, GC, StructStore, AbstractType, AbstractStruct, YEvent, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as set from 'lib0/set'\nimport * as logging from 'lib0/logging'\nimport { callAll } from 'lib0/function'\n\n/**\n * A transaction is created for every change on the Yjs model. It is possible\n * to bundle changes on the Yjs model in a single transaction to\n * minimize the number on messages sent and the number of observer calls.\n * If possible the user of this library should bundle as many changes as\n * possible. Here is an example to illustrate the advantages of bundling:\n *\n * @example\n * const ydoc = new Y.Doc()\n * const map = ydoc.getMap('map')\n * // Log content when change is triggered\n * map.observe(() => {\n * console.log('change triggered')\n * })\n * // Each change on the map type triggers a log message:\n * map.set('a', 0) // => \"change triggered\"\n * map.set('b', 0) // => \"change triggered\"\n * // When put in a transaction, it will trigger the log after the transaction:\n * ydoc.transact(() => {\n * map.set('a', 1)\n * map.set('b', 1)\n * }) // => \"change triggered\"\n *\n * @public\n */\nexport class Transaction {\n /**\n * @param {Doc} doc\n * @param {any} origin\n * @param {boolean} local\n */\n constructor (doc, origin, local) {\n /**\n * The Yjs instance.\n * @type {Doc}\n */\n this.doc = doc\n /**\n * Describes the set of deleted items by ids\n * @type {DeleteSet}\n */\n this.deleteSet = new DeleteSet()\n /**\n * Holds the state before the transaction started.\n * @type {Map}\n */\n this.beforeState = getStateVector(doc.store)\n /**\n * Holds the state after the transaction.\n * @type {Map}\n */\n this.afterState = new Map()\n /**\n * All types that were directly modified (property added or child\n * inserted/deleted). New types are not included in this Set.\n * Maps from type to parentSubs (`item.parentSub = null` for YArray)\n * @type {Map>,Set>}\n */\n this.changed = new Map()\n /**\n * Stores the events for the types that observe also child elements.\n * It is mainly used by `observeDeep`.\n * @type {Map>,Array>>}\n */\n this.changedParentTypes = new Map()\n /**\n * @type {Array}\n */\n this._mergeStructs = []\n /**\n * @type {any}\n */\n this.origin = origin\n /**\n * Stores meta information on the transaction\n * @type {Map}\n */\n this.meta = new Map()\n /**\n * Whether this change originates from this doc.\n * @type {boolean}\n */\n this.local = local\n /**\n * @type {Set}\n */\n this.subdocsAdded = new Set()\n /**\n * @type {Set}\n */\n this.subdocsRemoved = new Set()\n /**\n * @type {Set}\n */\n this.subdocsLoaded = new Set()\n /**\n * @type {boolean}\n */\n this._needFormattingCleanup = false\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n * @return {boolean} Whether data was written.\n */\nexport const writeUpdateMessageFromTransaction = (encoder, transaction) => {\n if (transaction.deleteSet.clients.size === 0 && !map.any(transaction.afterState, (clock, client) => transaction.beforeState.get(client) !== clock)) {\n return false\n }\n sortAndMergeDeleteSet(transaction.deleteSet)\n writeStructsFromTransaction(encoder, transaction)\n writeDeleteSet(encoder, transaction.deleteSet)\n return true\n}\n\n/**\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const nextID = transaction => {\n const y = transaction.doc\n return createID(y.clientID, getState(y.store, y.clientID))\n}\n\n/**\n * If `type.parent` was added in current transaction, `type` technically\n * did not change, it was just added and we should not fire events for `type`.\n *\n * @param {Transaction} transaction\n * @param {AbstractType>} type\n * @param {string|null} parentSub\n */\nexport const addChangedTypeToTransaction = (transaction, type, parentSub) => {\n const item = type._item\n if (item === null || (item.id.clock < (transaction.beforeState.get(item.id.client) || 0) && !item.deleted)) {\n map.setIfUndefined(transaction.changed, type, set.create).add(parentSub)\n }\n}\n\n/**\n * @param {Array} structs\n * @param {number} pos\n * @return {number} # of merged structs\n */\nconst tryToMergeWithLefts = (structs, pos) => {\n let right = structs[pos]\n let left = structs[pos - 1]\n let i = pos\n for (; i > 0; right = left, left = structs[--i - 1]) {\n if (left.deleted === right.deleted && left.constructor === right.constructor) {\n if (left.mergeWith(right)) {\n if (right instanceof Item && right.parentSub !== null && /** @type {AbstractType} */ (right.parent)._map.get(right.parentSub) === right) {\n /** @type {AbstractType} */ (right.parent)._map.set(right.parentSub, /** @type {Item} */ (left))\n }\n continue\n }\n }\n break\n }\n const merged = pos - i\n if (merged) {\n // remove all merged structs from the array\n structs.splice(pos + 1 - merged, merged)\n }\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nconst tryGcDeleteSet = (ds, store, gcFilter) => {\n for (const [client, deleteItems] of ds.clients.entries()) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n const endDeleteItemClock = deleteItem.clock + deleteItem.len\n for (\n let si = findIndexSS(structs, deleteItem.clock), struct = structs[si];\n si < structs.length && struct.id.clock < endDeleteItemClock;\n struct = structs[++si]\n ) {\n const struct = structs[si]\n if (deleteItem.clock + deleteItem.len <= struct.id.clock) {\n break\n }\n if (struct instanceof Item && struct.deleted && !struct.keep && gcFilter(struct)) {\n struct.gc(store, false)\n }\n }\n }\n }\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n */\nconst tryMergeDeleteSet = (ds, store) => {\n // try to merge deleted / gc'd items\n // merge from right to left for better efficiency and so we don't miss any merge targets\n ds.clients.forEach((deleteItems, client) => {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n // start with merging the item next to the last deleted item\n const mostRightIndexToCheck = math.min(structs.length - 1, 1 + findIndexSS(structs, deleteItem.clock + deleteItem.len - 1))\n for (\n let si = mostRightIndexToCheck, struct = structs[si];\n si > 0 && struct.id.clock >= deleteItem.clock;\n struct = structs[si]\n ) {\n si -= 1 + tryToMergeWithLefts(structs, si)\n }\n }\n })\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nexport const tryGc = (ds, store, gcFilter) => {\n tryGcDeleteSet(ds, store, gcFilter)\n tryMergeDeleteSet(ds, store)\n}\n\n/**\n * @param {Array} transactionCleanups\n * @param {number} i\n */\nconst cleanupTransactions = (transactionCleanups, i) => {\n if (i < transactionCleanups.length) {\n const transaction = transactionCleanups[i]\n const doc = transaction.doc\n const store = doc.store\n const ds = transaction.deleteSet\n const mergeStructs = transaction._mergeStructs\n try {\n sortAndMergeDeleteSet(ds)\n transaction.afterState = getStateVector(transaction.doc.store)\n doc.emit('beforeObserverCalls', [transaction, doc])\n /**\n * An array of event callbacks.\n *\n * Each callback is called even if the other ones throw errors.\n *\n * @type {Array}\n */\n const fs = []\n // observe events on changed types\n transaction.changed.forEach((subs, itemtype) =>\n fs.push(() => {\n if (itemtype._item === null || !itemtype._item.deleted) {\n itemtype._callObserver(transaction, subs)\n }\n })\n )\n fs.push(() => {\n // deep observe events\n transaction.changedParentTypes.forEach((events, type) => {\n // We need to think about the possibility that the user transforms the\n // Y.Doc in the event.\n if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) {\n events = events\n .filter(event =>\n event.target._item === null || !event.target._item.deleted\n )\n events\n .forEach(event => {\n event.currentTarget = type\n // path is relative to the current target\n event._path = null\n })\n // sort events by path length so that top-level events are fired first.\n events\n .sort((event1, event2) => event1.path.length - event2.path.length)\n // We don't need to check for events.length\n // because we know it has at least one element\n callEventHandlerListeners(type._dEH, events, transaction)\n }\n })\n })\n fs.push(() => doc.emit('afterTransaction', [transaction, doc]))\n callAll(fs, [])\n if (transaction._needFormattingCleanup) {\n cleanupYTextAfterTransaction(transaction)\n }\n } finally {\n // Replace deleted items with ItemDeleted / GC.\n // This is where content is actually remove from the Yjs Doc.\n if (doc.gc) {\n tryGcDeleteSet(ds, store, doc.gcFilter)\n }\n tryMergeDeleteSet(ds, store)\n\n // on all affected store.clients props, try to merge\n transaction.afterState.forEach((clock, client) => {\n const beforeClock = transaction.beforeState.get(client) || 0\n if (beforeClock !== clock) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n // we iterate from right to left so we can safely remove entries\n const firstChangePos = math.max(findIndexSS(structs, beforeClock), 1)\n for (let i = structs.length - 1; i >= firstChangePos;) {\n i -= 1 + tryToMergeWithLefts(structs, i)\n }\n }\n })\n // try to merge mergeStructs\n // @todo: it makes more sense to transform mergeStructs to a DS, sort it, and merge from right to left\n // but at the moment DS does not handle duplicates\n for (let i = mergeStructs.length - 1; i >= 0; i--) {\n const { client, clock } = mergeStructs[i].id\n const structs = /** @type {Array} */ (store.clients.get(client))\n const replacedStructPos = findIndexSS(structs, clock)\n if (replacedStructPos + 1 < structs.length) {\n if (tryToMergeWithLefts(structs, replacedStructPos + 1) > 1) {\n continue // no need to perform next check, both are already merged\n }\n }\n if (replacedStructPos > 0) {\n tryToMergeWithLefts(structs, replacedStructPos)\n }\n }\n if (!transaction.local && transaction.afterState.get(doc.clientID) !== transaction.beforeState.get(doc.clientID)) {\n logging.print(logging.ORANGE, logging.BOLD, '[yjs] ', logging.UNBOLD, logging.RED, 'Changed the client-id because another client seems to be using it.')\n doc.clientID = generateNewClientId()\n }\n // @todo Merge all the transactions into one and provide send the data as a single update message\n doc.emit('afterTransactionCleanup', [transaction, doc])\n if (doc._observers.has('update')) {\n const encoder = new UpdateEncoderV1()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('update', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n if (doc._observers.has('updateV2')) {\n const encoder = new UpdateEncoderV2()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('updateV2', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction\n if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) {\n subdocsAdded.forEach(subdoc => {\n subdoc.clientID = doc.clientID\n if (subdoc.collectionid == null) {\n subdoc.collectionid = doc.collectionid\n }\n doc.subdocs.add(subdoc)\n })\n subdocsRemoved.forEach(subdoc => doc.subdocs.delete(subdoc))\n doc.emit('subdocs', [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc, transaction])\n subdocsRemoved.forEach(subdoc => subdoc.destroy())\n }\n\n if (transactionCleanups.length <= i + 1) {\n doc._transactionCleanups = []\n doc.emit('afterAllTransactions', [doc, transactionCleanups])\n } else {\n cleanupTransactions(transactionCleanups, i + 1)\n }\n }\n }\n}\n\n/**\n * Implements the functionality of `y.transact(()=>{..})`\n *\n * @template T\n * @param {Doc} doc\n * @param {function(Transaction):T} f\n * @param {any} [origin=true]\n * @return {T}\n *\n * @function\n */\nexport const transact = (doc, f, origin = null, local = true) => {\n const transactionCleanups = doc._transactionCleanups\n let initialCall = false\n /**\n * @type {any}\n */\n let result = null\n if (doc._transaction === null) {\n initialCall = true\n doc._transaction = new Transaction(doc, origin, local)\n transactionCleanups.push(doc._transaction)\n if (transactionCleanups.length === 1) {\n doc.emit('beforeAllTransactions', [doc])\n }\n doc.emit('beforeTransaction', [doc._transaction, doc])\n }\n try {\n result = f(doc._transaction)\n } finally {\n if (initialCall) {\n const finishCleanup = doc._transaction === transactionCleanups[0]\n doc._transaction = null\n if (finishCleanup) {\n // The first transaction ended, now process observer calls.\n // Observer call may create new transactions for which we need to call the observers and do cleanup.\n // We don't want to nest these calls, so we execute these calls one after\n // another.\n // Also we need to ensure that all cleanups are called, even if the\n // observes throw errors.\n // This file is full of hacky try {} finally {} blocks to ensure that an\n // event can throw errors and also that the cleanup is called.\n cleanupTransactions(transactionCleanups, 0)\n }\n }\n }\n return result\n}\n", "import {\n mergeDeleteSets,\n iterateDeletedStructs,\n keepItem,\n transact,\n createID,\n redoItem,\n isParentOf,\n followRedone,\n getItemCleanStart,\n isDeleted,\n addToDeleteSet,\n YEvent, Transaction, Doc, Item, GC, DeleteSet, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as time from 'lib0/time'\nimport * as array from 'lib0/array'\nimport * as logging from 'lib0/logging'\nimport { ObservableV2 } from 'lib0/observable'\n\nexport class StackItem {\n /**\n * @param {DeleteSet} deletions\n * @param {DeleteSet} insertions\n */\n constructor (deletions, insertions) {\n this.insertions = insertions\n this.deletions = deletions\n /**\n * Use this to save and restore metadata like selection range\n */\n this.meta = new Map()\n }\n}\n/**\n * @param {Transaction} tr\n * @param {UndoManager} um\n * @param {StackItem} stackItem\n */\nconst clearUndoManagerStackItem = (tr, um, stackItem) => {\n iterateDeletedStructs(tr, stackItem.deletions, item => {\n if (item instanceof Item && um.scope.some(type => isParentOf(type, item))) {\n keepItem(item, false)\n }\n })\n}\n\n/**\n * @param {UndoManager} undoManager\n * @param {Array} stack\n * @param {'undo'|'redo'} eventType\n * @return {StackItem?}\n */\nconst popStackItem = (undoManager, stack, eventType) => {\n /**\n * Keep a reference to the transaction so we can fire the event with the changedParentTypes\n * @type {any}\n */\n let _tr = null\n const doc = undoManager.doc\n const scope = undoManager.scope\n transact(doc, transaction => {\n while (stack.length > 0 && undoManager.currStackItem === null) {\n const store = doc.store\n const stackItem = /** @type {StackItem} */ (stack.pop())\n /**\n * @type {Set}\n */\n const itemsToRedo = new Set()\n /**\n * @type {Array}\n */\n const itemsToDelete = []\n let performedChange = false\n iterateDeletedStructs(transaction, stackItem.insertions, struct => {\n if (struct instanceof Item) {\n if (struct.redone !== null) {\n let { item, diff } = followRedone(store, struct.id)\n if (diff > 0) {\n item = getItemCleanStart(transaction, createID(item.id.client, item.id.clock + diff))\n }\n struct = item\n }\n if (!struct.deleted && scope.some(type => isParentOf(type, /** @type {Item} */ (struct)))) {\n itemsToDelete.push(struct)\n }\n }\n })\n iterateDeletedStructs(transaction, stackItem.deletions, struct => {\n if (\n struct instanceof Item &&\n scope.some(type => isParentOf(type, struct)) &&\n // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval.\n !isDeleted(stackItem.insertions, struct.id)\n ) {\n itemsToRedo.add(struct)\n }\n })\n itemsToRedo.forEach(struct => {\n performedChange = redoItem(transaction, struct, itemsToRedo, stackItem.insertions, undoManager.ignoreRemoteMapChanges, undoManager) !== null || performedChange\n })\n // We want to delete in reverse order so that children are deleted before\n // parents, so we have more information available when items are filtered.\n for (let i = itemsToDelete.length - 1; i >= 0; i--) {\n const item = itemsToDelete[i]\n if (undoManager.deleteFilter(item)) {\n item.delete(transaction)\n performedChange = true\n }\n }\n undoManager.currStackItem = performedChange ? stackItem : null\n }\n transaction.changed.forEach((subProps, type) => {\n // destroy search marker if necessary\n if (subProps.has(null) && type._searchMarker) {\n type._searchMarker.length = 0\n }\n })\n _tr = transaction\n }, undoManager)\n const res = undoManager.currStackItem\n if (res != null) {\n const changedParentTypes = _tr.changedParentTypes\n undoManager.emit('stack-item-popped', [{ stackItem: res, type: eventType, changedParentTypes, origin: undoManager }, undoManager])\n undoManager.currStackItem = null\n }\n return res\n}\n\n/**\n * @typedef {Object} UndoManagerOptions\n * @property {number} [UndoManagerOptions.captureTimeout=500]\n * @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.\n * @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes\n * it is necessary to filter what an Undo/Redo operation can delete. If this\n * filter returns false, the type/item won't be deleted even it is in the\n * undo/redo scope.\n * @property {Set} [UndoManagerOptions.trackedOrigins=new Set([null])]\n * @property {boolean} [ignoreRemoteMapChanges] Experimental. By default, the UndoManager will never overwrite remote changes. Enable this property to enable overwriting remote changes on key-value changes (Y.Map, properties on Y.Xml, etc..).\n * @property {Doc} [doc] The document that this UndoManager operates on. Only needed if typeScope is empty.\n */\n\n/**\n * @typedef {Object} StackItemEvent\n * @property {StackItem} StackItemEvent.stackItem\n * @property {any} StackItemEvent.origin\n * @property {'undo'|'redo'} StackItemEvent.type\n * @property {Map>,Array>>} StackItemEvent.changedParentTypes\n */\n\n/**\n * Fires 'stack-item-added' event when a stack item was added to either the undo- or\n * the redo-stack. You may store additional stack information via the\n * metadata property on `event.stackItem.meta` (it is a `Map` of metadata properties).\n * Fires 'stack-item-popped' event when a stack item was popped from either the\n * undo- or the redo-stack. You may restore the saved stack information from `event.stackItem.meta`.\n *\n * @extends {ObservableV2<{'stack-item-added':function(StackItemEvent, UndoManager):void, 'stack-item-popped': function(StackItemEvent, UndoManager):void, 'stack-cleared': function({ undoStackCleared: boolean, redoStackCleared: boolean }):void, 'stack-item-updated': function(StackItemEvent, UndoManager):void }>}\n */\nexport class UndoManager extends ObservableV2 {\n /**\n * @param {AbstractType|Array>} typeScope Accepts either a single type, or an array of types\n * @param {UndoManagerOptions} options\n */\n constructor (typeScope, {\n captureTimeout = 500,\n captureTransaction = _tr => true,\n deleteFilter = () => true,\n trackedOrigins = new Set([null]),\n ignoreRemoteMapChanges = false,\n doc = /** @type {Doc} */ (array.isArray(typeScope) ? typeScope[0].doc : typeScope.doc)\n } = {}) {\n super()\n /**\n * @type {Array>}\n */\n this.scope = []\n this.doc = doc\n this.addToScope(typeScope)\n this.deleteFilter = deleteFilter\n trackedOrigins.add(this)\n this.trackedOrigins = trackedOrigins\n this.captureTransaction = captureTransaction\n /**\n * @type {Array}\n */\n this.undoStack = []\n /**\n * @type {Array}\n */\n this.redoStack = []\n /**\n * Whether the client is currently undoing (calling UndoManager.undo)\n *\n * @type {boolean}\n */\n this.undoing = false\n this.redoing = false\n /**\n * The currently popped stack item if UndoManager.undoing or UndoManager.redoing\n *\n * @type {StackItem|null}\n */\n this.currStackItem = null\n this.lastChange = 0\n this.ignoreRemoteMapChanges = ignoreRemoteMapChanges\n this.captureTimeout = captureTimeout\n /**\n * @param {Transaction} transaction\n */\n this.afterTransactionHandler = transaction => {\n // Only track certain transactions\n if (\n !this.captureTransaction(transaction) ||\n !this.scope.some(type => transaction.changedParentTypes.has(type)) ||\n (!this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor)))\n ) {\n return\n }\n const undoing = this.undoing\n const redoing = this.redoing\n const stack = undoing ? this.redoStack : this.undoStack\n if (undoing) {\n this.stopCapturing() // next undo should not be appended to last stack item\n } else if (!redoing) {\n // neither undoing nor redoing: delete redoStack\n this.clear(false, true)\n }\n const insertions = new DeleteSet()\n transaction.afterState.forEach((endClock, client) => {\n const startClock = transaction.beforeState.get(client) || 0\n const len = endClock - startClock\n if (len > 0) {\n addToDeleteSet(insertions, client, startClock, len)\n }\n })\n const now = time.getUnixTime()\n let didAdd = false\n if (this.lastChange > 0 && now - this.lastChange < this.captureTimeout && stack.length > 0 && !undoing && !redoing) {\n // append change to last stack op\n const lastOp = stack[stack.length - 1]\n lastOp.deletions = mergeDeleteSets([lastOp.deletions, transaction.deleteSet])\n lastOp.insertions = mergeDeleteSets([lastOp.insertions, insertions])\n } else {\n // create a new stack op\n stack.push(new StackItem(transaction.deleteSet, insertions))\n didAdd = true\n }\n if (!undoing && !redoing) {\n this.lastChange = now\n }\n // make sure that deleted structs are not gc'd\n iterateDeletedStructs(transaction, transaction.deleteSet, /** @param {Item|GC} item */ item => {\n if (item instanceof Item && this.scope.some(type => isParentOf(type, item))) {\n keepItem(item, true)\n }\n })\n /**\n * @type {[StackItemEvent, UndoManager]}\n */\n const changeEvent = [{ stackItem: stack[stack.length - 1], origin: transaction.origin, type: undoing ? 'redo' : 'undo', changedParentTypes: transaction.changedParentTypes }, this]\n if (didAdd) {\n this.emit('stack-item-added', changeEvent)\n } else {\n this.emit('stack-item-updated', changeEvent)\n }\n }\n this.doc.on('afterTransaction', this.afterTransactionHandler)\n this.doc.on('destroy', () => {\n this.destroy()\n })\n }\n\n /**\n * @param {Array> | AbstractType} ytypes\n */\n addToScope (ytypes) {\n ytypes = array.isArray(ytypes) ? ytypes : [ytypes]\n ytypes.forEach(ytype => {\n if (this.scope.every(yt => yt !== ytype)) {\n if (ytype.doc !== this.doc) logging.warn('[yjs#509] Not same Y.Doc') // use MultiDocUndoManager instead. also see https://github.com/yjs/yjs/issues/509\n this.scope.push(ytype)\n }\n })\n }\n\n /**\n * @param {any} origin\n */\n addTrackedOrigin (origin) {\n this.trackedOrigins.add(origin)\n }\n\n /**\n * @param {any} origin\n */\n removeTrackedOrigin (origin) {\n this.trackedOrigins.delete(origin)\n }\n\n clear (clearUndoStack = true, clearRedoStack = true) {\n if ((clearUndoStack && this.canUndo()) || (clearRedoStack && this.canRedo())) {\n this.doc.transact(tr => {\n if (clearUndoStack) {\n this.undoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.undoStack = []\n }\n if (clearRedoStack) {\n this.redoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.redoStack = []\n }\n this.emit('stack-cleared', [{ undoStackCleared: clearUndoStack, redoStackCleared: clearRedoStack }])\n })\n }\n }\n\n /**\n * UndoManager merges Undo-StackItem if they are created within time-gap\n * smaller than `options.captureTimeout`. Call `um.stopCapturing()` so that the next\n * StackItem won't be merged.\n *\n *\n * @example\n * // without stopCapturing\n * ytext.insert(0, 'a')\n * ytext.insert(1, 'b')\n * um.undo()\n * ytext.toString() // => '' (note that 'ab' was removed)\n * // with stopCapturing\n * ytext.insert(0, 'a')\n * um.stopCapturing()\n * ytext.insert(0, 'b')\n * um.undo()\n * ytext.toString() // => 'a' (note that only 'b' was removed)\n *\n */\n stopCapturing () {\n this.lastChange = 0\n }\n\n /**\n * Undo last changes on type.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n undo () {\n this.undoing = true\n let res\n try {\n res = popStackItem(this, this.undoStack, 'undo')\n } finally {\n this.undoing = false\n }\n return res\n }\n\n /**\n * Redo last undo operation.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n redo () {\n this.redoing = true\n let res\n try {\n res = popStackItem(this, this.redoStack, 'redo')\n } finally {\n this.redoing = false\n }\n return res\n }\n\n /**\n * Are undo steps available?\n *\n * @return {boolean} `true` if undo is possible\n */\n canUndo () {\n return this.undoStack.length > 0\n }\n\n /**\n * Are redo steps available?\n *\n * @return {boolean} `true` if redo is possible\n */\n canRedo () {\n return this.redoStack.length > 0\n }\n\n destroy () {\n this.trackedOrigins.delete(this)\n this.doc.off('afterTransaction', this.afterTransactionHandler)\n super.destroy()\n }\n}\n", "import * as binary from 'lib0/binary'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\nimport * as f from 'lib0/function'\nimport * as logging from 'lib0/logging'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as string from 'lib0/string'\n\nimport {\n ContentAny,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentString,\n ContentType,\n createID,\n decodeStateVector,\n DSEncoderV1,\n DSEncoderV2,\n GC,\n Item,\n mergeDeleteSets,\n readDeleteSet,\n readItemContent,\n Skip,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n writeDeleteSet,\n YXmlElement,\n YXmlHook\n} from '../internals.js'\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n */\nfunction * lazyStructReaderGenerator (decoder) {\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n // @todo use switch instead of ifs\n if (info === 10) {\n const len = decoding.readVarUint(decoder.restDecoder)\n yield new Skip(createID(client, clock), len)\n clock += len\n } else if ((binary.BITS5 & info) !== 0) {\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n // @ts-ignore Force writing a string here.\n cantCopyParentInfo ? (decoder.readParentInfo() ? decoder.readString() : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n yield struct\n clock += struct.length\n } else {\n const len = decoder.readLen()\n yield new GC(createID(client, clock), len)\n clock += len\n }\n }\n }\n}\n\nexport class LazyStructReader {\n /**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {boolean} filterSkips\n */\n constructor (decoder, filterSkips) {\n this.gen = lazyStructReaderGenerator(decoder)\n /**\n * @type {null | Item | Skip | GC}\n */\n this.curr = null\n this.done = false\n this.filterSkips = filterSkips\n this.next()\n }\n\n /**\n * @return {Item | GC | Skip |null}\n */\n next () {\n // ignore \"Skip\" structs\n do {\n this.curr = this.gen.next().value || null\n } while (this.filterSkips && this.curr !== null && this.curr.constructor === Skip)\n return this.curr\n }\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const logUpdate = update => logUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const logUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n logging.print('Structs: ', structs)\n const ds = readDeleteSet(updateDecoder)\n logging.print('DeleteSet: ', ds)\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const decodeUpdate = (update) => decodeUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const decodeUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n return {\n structs,\n ds: readDeleteSet(updateDecoder)\n }\n}\n\nexport class LazyStructWriter {\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n constructor (encoder) {\n this.currClient = 0\n this.startClock = 0\n this.written = 0\n this.encoder = encoder\n /**\n * We want to write operations lazily, but also we need to know beforehand how many operations we want to write for each client.\n *\n * This kind of meta-information (#clients, #structs-per-client-written) is written to the restEncoder.\n *\n * We fragment the restEncoder and store a slice of it per-client until we know how many clients there are.\n * When we flush (toUint8Array) we write the restEncoder using the fragments and the meta-information.\n *\n * @type {Array<{ written: number, restEncoder: Uint8Array }>}\n */\n this.clientStructs = []\n }\n}\n\n/**\n * @param {Array} updates\n * @return {Uint8Array}\n */\nexport const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof DSEncoderV1 | typeof DSEncoderV2} YEncoder\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdateV2 = (update, YEncoder = DSEncoderV2, YDecoder = UpdateDecoderV2) => {\n const encoder = new YEncoder()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let size = 0\n let currClient = curr.id.client\n let stopCounting = curr.id.clock !== 0 // must start at 0\n let currClock = stopCounting ? 0 : curr.id.clock + curr.length\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n if (currClock !== 0) {\n size++\n // We found a new client\n // write what we have to the encoder\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n currClient = curr.id.client\n currClock = 0\n stopCounting = curr.id.clock !== 0\n }\n // we ignore skips\n if (curr.constructor === Skip) {\n stopCounting = true\n }\n if (!stopCounting) {\n currClock = curr.id.clock + curr.length\n }\n }\n // write what we have\n if (currClock !== 0) {\n size++\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n // prepend the size of the state vector\n const enc = encoding.createEncoder()\n encoding.writeVarUint(enc, size)\n encoding.writeBinaryEncoder(enc, encoder.restEncoder)\n encoder.restEncoder = enc\n return encoder.toUint8Array()\n } else {\n encoding.writeVarUint(encoder.restEncoder, 0)\n return encoder.toUint8Array()\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdate = update => encodeStateVectorFromUpdateV2(update, DSEncoderV1, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMetaV2 = (update, YDecoder = UpdateDecoderV2) => {\n /**\n * @type {Map}\n */\n const from = new Map()\n /**\n * @type {Map}\n */\n const to = new Map()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let currClient = curr.id.client\n let currClock = curr.id.clock\n // write the beginning to `from`\n from.set(currClient, currClock)\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n // We found a new client\n // write the end to `to`\n to.set(currClient, currClock)\n // write the beginning to `from`\n from.set(curr.id.client, curr.id.clock)\n // update currClient\n currClient = curr.id.client\n }\n currClock = curr.id.clock + curr.length\n }\n // write the end to `to`\n to.set(currClient, currClock)\n }\n return { from, to }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMeta = update => parseUpdateMetaV2(update, UpdateDecoderV1)\n\n/**\n * This method is intended to slice any kind of struct and retrieve the right part.\n * It does not handle side-effects, so it should only be used by the lazy-encoder.\n *\n * @param {Item | GC | Skip} left\n * @param {number} diff\n * @return {Item | GC}\n */\nconst sliceStruct = (left, diff) => {\n if (left.constructor === GC) {\n const { client, clock } = left.id\n return new GC(createID(client, clock + diff), left.length - diff)\n } else if (left.constructor === Skip) {\n const { client, clock } = left.id\n return new Skip(createID(client, clock + diff), left.length - diff)\n } else {\n const leftItem = /** @type {Item} */ (left)\n const { client, clock } = leftItem.id\n return new Item(\n createID(client, clock + diff),\n null,\n createID(client, clock + diff - 1),\n null,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n }\n}\n\n/**\n *\n * This function works similarly to `readUpdateV2`.\n *\n * @param {Array} updates\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n * @return {Uint8Array}\n */\nexport const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n if (updates.length === 1) {\n return updates[0]\n }\n const updateDecoders = updates.map(update => new YDecoder(decoding.createDecoder(update)))\n let lazyStructDecoders = updateDecoders.map(decoder => new LazyStructReader(decoder, true))\n\n /**\n * @todo we don't need offset because we always slice before\n * @type {null | { struct: Item | GC | Skip, offset: number }}\n */\n let currWrite = null\n\n const updateEncoder = new YEncoder()\n // write structs lazily\n const lazyStructEncoder = new LazyStructWriter(updateEncoder)\n\n // Note: We need to ensure that all lazyStructDecoders are fully consumed\n // Note: Should merge document updates whenever possible - even from different updates\n // Note: Should handle that some operations cannot be applied yet ()\n\n while (true) {\n // Write higher clients first ⇒ sort by clientID & clock and remove decoders without content\n lazyStructDecoders = lazyStructDecoders.filter(dec => dec.curr !== null)\n lazyStructDecoders.sort(\n /** @type {function(any,any):number} */ (dec1, dec2) => {\n if (dec1.curr.id.client === dec2.curr.id.client) {\n const clockDiff = dec1.curr.id.clock - dec2.curr.id.clock\n if (clockDiff === 0) {\n // @todo remove references to skip since the structDecoders must filter Skips.\n return dec1.curr.constructor === dec2.curr.constructor\n ? 0\n : dec1.curr.constructor === Skip ? 1 : -1 // we are filtering skips anyway.\n } else {\n return clockDiff\n }\n } else {\n return dec2.curr.id.client - dec1.curr.id.client\n }\n }\n )\n if (lazyStructDecoders.length === 0) {\n break\n }\n const currDecoder = lazyStructDecoders[0]\n // write from currDecoder until the next operation is from another client or if filler-struct\n // then we need to reorder the decoders and find the next operation to write\n const firstClient = /** @type {Item | GC} */ (currDecoder.curr).id.client\n\n if (currWrite !== null) {\n let curr = /** @type {Item | GC | null} */ (currDecoder.curr)\n let iterated = false\n\n // iterate until we find something that we haven't written already\n // remember: first the high client-ids are written\n while (curr !== null && curr.id.clock + curr.length <= currWrite.struct.id.clock + currWrite.struct.length && curr.id.client >= currWrite.struct.id.client) {\n curr = currDecoder.next()\n iterated = true\n }\n if (\n curr === null || // current decoder is empty\n curr.id.client !== firstClient || // check whether there is another decoder that has has updates from `firstClient`\n (iterated && curr.id.clock > currWrite.struct.id.clock + currWrite.struct.length) // the above while loop was used and we are potentially missing updates\n ) {\n continue\n }\n\n if (firstClient !== currWrite.struct.id.client) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n } else {\n if (currWrite.struct.id.clock + currWrite.struct.length < curr.id.clock) {\n // @todo write currStruct & set currStruct = Skip(clock = currStruct.id.clock + currStruct.length, length = curr.id.clock - self.clock)\n if (currWrite.struct.constructor === Skip) {\n // extend existing skip\n currWrite.struct.length = curr.id.clock + curr.length - currWrite.struct.id.clock\n } else {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n const diff = curr.id.clock - currWrite.struct.id.clock - currWrite.struct.length\n /**\n * @type {Skip}\n */\n const struct = new Skip(createID(firstClient, currWrite.struct.id.clock + currWrite.struct.length), diff)\n currWrite = { struct, offset: 0 }\n }\n } else { // if (currWrite.struct.id.clock + currWrite.struct.length >= curr.id.clock) {\n const diff = currWrite.struct.id.clock + currWrite.struct.length - curr.id.clock\n if (diff > 0) {\n if (currWrite.struct.constructor === Skip) {\n // prefer to slice Skip because the other struct might contain more information\n currWrite.struct.length -= diff\n } else {\n curr = sliceStruct(curr, diff)\n }\n }\n if (!currWrite.struct.mergeWith(/** @type {any} */ (curr))) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n }\n }\n }\n } else {\n currWrite = { struct: /** @type {Item | GC} */ (currDecoder.curr), offset: 0 }\n currDecoder.next()\n }\n for (\n let next = currDecoder.curr;\n next !== null && next.id.client === firstClient && next.id.clock === currWrite.struct.id.clock + currWrite.struct.length && next.constructor !== Skip;\n next = currDecoder.next()\n ) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: next, offset: 0 }\n }\n }\n if (currWrite !== null) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = null\n }\n finishLazyStructWriting(lazyStructEncoder)\n\n const dss = updateDecoders.map(decoder => readDeleteSet(decoder))\n const ds = mergeDeleteSets(dss)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n */\nexport const diffUpdateV2 = (update, sv, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n const state = decodeStateVector(sv)\n const encoder = new YEncoder()\n const lazyStructWriter = new LazyStructWriter(encoder)\n const decoder = new YDecoder(decoding.createDecoder(update))\n const reader = new LazyStructReader(decoder, false)\n while (reader.curr) {\n const curr = reader.curr\n const currClient = curr.id.client\n const svClock = state.get(currClient) || 0\n if (reader.curr.constructor === Skip) {\n // the first written struct shouldn't be a skip\n reader.next()\n continue\n }\n if (curr.id.clock + curr.length > svClock) {\n writeStructToLazyStructWriter(lazyStructWriter, curr, math.max(svClock - curr.id.clock, 0))\n reader.next()\n while (reader.curr && reader.curr.id.client === currClient) {\n writeStructToLazyStructWriter(lazyStructWriter, reader.curr, 0)\n reader.next()\n }\n } else {\n // read until something new comes up\n while (reader.curr && reader.curr.id.client === currClient && reader.curr.id.clock + reader.curr.length <= svClock) {\n reader.next()\n }\n }\n }\n finishLazyStructWriting(lazyStructWriter)\n // write ds\n const ds = readDeleteSet(decoder)\n writeDeleteSet(encoder, ds)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n */\nexport const diffUpdate = (update, sv) => diffUpdateV2(update, sv, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {LazyStructWriter} lazyWriter\n */\nconst flushLazyStructWriter = lazyWriter => {\n if (lazyWriter.written > 0) {\n lazyWriter.clientStructs.push({ written: lazyWriter.written, restEncoder: encoding.toUint8Array(lazyWriter.encoder.restEncoder) })\n lazyWriter.encoder.restEncoder = encoding.createEncoder()\n lazyWriter.written = 0\n }\n}\n\n/**\n * @param {LazyStructWriter} lazyWriter\n * @param {Item | GC} struct\n * @param {number} offset\n */\nconst writeStructToLazyStructWriter = (lazyWriter, struct, offset) => {\n // flush curr if we start another client\n if (lazyWriter.written > 0 && lazyWriter.currClient !== struct.id.client) {\n flushLazyStructWriter(lazyWriter)\n }\n if (lazyWriter.written === 0) {\n lazyWriter.currClient = struct.id.client\n // write next client\n lazyWriter.encoder.writeClient(struct.id.client)\n // write startClock\n encoding.writeVarUint(lazyWriter.encoder.restEncoder, struct.id.clock + offset)\n }\n struct.write(lazyWriter.encoder, offset)\n lazyWriter.written++\n}\n/**\n * Call this function when we collected all parts and want to\n * put all the parts together. After calling this method,\n * you can continue using the UpdateEncoder.\n *\n * @param {LazyStructWriter} lazyWriter\n */\nconst finishLazyStructWriting = (lazyWriter) => {\n flushLazyStructWriter(lazyWriter)\n\n // this is a fresh encoder because we called flushCurr\n const restEncoder = lazyWriter.encoder.restEncoder\n\n /**\n * Now we put all the fragments together.\n * This works similarly to `writeClientsStructs`\n */\n\n // write # states that were updated - i.e. the clients\n encoding.writeVarUint(restEncoder, lazyWriter.clientStructs.length)\n\n for (let i = 0; i < lazyWriter.clientStructs.length; i++) {\n const partStructs = lazyWriter.clientStructs[i]\n /**\n * Works similarly to `writeStructs`\n */\n // write # encoded structs\n encoding.writeVarUint(restEncoder, partStructs.written)\n // write the rest of the fragment\n encoding.writeUint8Array(restEncoder, partStructs.restEncoder)\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @param {function(Item|GC|Skip):Item|GC|Skip} blockTransformer\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} YDecoder\n * @param {typeof UpdateEncoderV2 | typeof UpdateEncoderV1 } YEncoder\n */\nexport const convertUpdateFormat = (update, blockTransformer, YDecoder, YEncoder) => {\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n const updateEncoder = new YEncoder()\n const lazyWriter = new LazyStructWriter(updateEncoder)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n writeStructToLazyStructWriter(lazyWriter, blockTransformer(curr), 0)\n }\n finishLazyStructWriting(lazyWriter)\n const ds = readDeleteSet(updateDecoder)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @typedef {Object} ObfuscatorOptions\n * @property {boolean} [ObfuscatorOptions.formatting=true]\n * @property {boolean} [ObfuscatorOptions.subdocs=true]\n * @property {boolean} [ObfuscatorOptions.yxml=true] Whether to obfuscate nodeName / hookName\n */\n\n/**\n * @param {ObfuscatorOptions} obfuscator\n */\nconst createObfuscator = ({ formatting = true, subdocs = true, yxml = true } = {}) => {\n let i = 0\n const mapKeyCache = map.create()\n const nodeNameCache = map.create()\n const formattingKeyCache = map.create()\n const formattingValueCache = map.create()\n formattingValueCache.set(null, null) // end of a formatting range should always be the end of a formatting range\n /**\n * @param {Item|GC|Skip} block\n * @return {Item|GC|Skip}\n */\n return block => {\n switch (block.constructor) {\n case GC:\n case Skip:\n return block\n case Item: {\n const item = /** @type {Item} */ (block)\n const content = item.content\n switch (content.constructor) {\n case ContentDeleted:\n break\n case ContentType: {\n if (yxml) {\n const type = /** @type {ContentType} */ (content).type\n if (type instanceof YXmlElement) {\n type.nodeName = map.setIfUndefined(nodeNameCache, type.nodeName, () => 'node-' + i)\n }\n if (type instanceof YXmlHook) {\n type.hookName = map.setIfUndefined(nodeNameCache, type.hookName, () => 'hook-' + i)\n }\n }\n break\n }\n case ContentAny: {\n const c = /** @type {ContentAny} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentBinary: {\n const c = /** @type {ContentBinary} */ (content)\n c.content = new Uint8Array([i])\n break\n }\n case ContentDoc: {\n const c = /** @type {ContentDoc} */ (content)\n if (subdocs) {\n c.opts = {}\n c.doc.guid = i + ''\n }\n break\n }\n case ContentEmbed: {\n const c = /** @type {ContentEmbed} */ (content)\n c.embed = {}\n break\n }\n case ContentFormat: {\n const c = /** @type {ContentFormat} */ (content)\n if (formatting) {\n c.key = map.setIfUndefined(formattingKeyCache, c.key, () => i + '')\n c.value = map.setIfUndefined(formattingValueCache, c.value, () => ({ i }))\n }\n break\n }\n case ContentJSON: {\n const c = /** @type {ContentJSON} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentString: {\n const c = /** @type {ContentString} */ (content)\n c.str = string.repeat((i % 10) + '', c.str.length)\n break\n }\n default:\n // unknown content type\n error.unexpectedCase()\n }\n if (item.parentSub) {\n item.parentSub = map.setIfUndefined(mapKeyCache, item.parentSub, () => i + '')\n }\n i++\n return block\n }\n default:\n // unknown block-type\n error.unexpectedCase()\n }\n }\n}\n\n/**\n * This function obfuscates the content of a Yjs update. This is useful to share\n * buggy Yjs documents while significantly limiting the possibility that a\n * developer can on the user. Note that it might still be possible to deduce\n * some information by analyzing the \"structure\" of the document or by analyzing\n * the typing behavior using the CRDT-related metadata that is still kept fully\n * intact.\n *\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdate = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdateV2 = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV2, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV1ToV2 = update => convertUpdateFormat(update, f.id, UpdateDecoderV1, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV2ToV1 = update => convertUpdateFormat(update, f.id, UpdateDecoderV2, UpdateEncoderV1)\n", "import {\n isDeleted,\n Item, AbstractType, Transaction, AbstractStruct // eslint-disable-line\n} from '../internals.js'\n\nimport * as set from 'lib0/set'\nimport * as array from 'lib0/array'\nimport * as error from 'lib0/error'\n\nconst errorComputeChanges = 'You must not compute changes after the event-handler fired.'\n\n/**\n * @template {AbstractType} T\n * YEvent describes the changes on a YType.\n */\nexport class YEvent {\n /**\n * @param {T} target The changed type.\n * @param {Transaction} transaction\n */\n constructor (target, transaction) {\n /**\n * The type on which this event was created on.\n * @type {T}\n */\n this.target = target\n /**\n * The current target on which the observe callback is called.\n * @type {AbstractType}\n */\n this.currentTarget = target\n /**\n * The transaction that triggered this event.\n * @type {Transaction}\n */\n this.transaction = transaction\n /**\n * @type {Object|null}\n */\n this._changes = null\n /**\n * @type {null | Map}\n */\n this._keys = null\n /**\n * @type {null | Array<{ insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object }>}\n */\n this._delta = null\n /**\n * @type {Array|null}\n */\n this._path = null\n }\n\n /**\n * Computes the path from `y` to the changed type.\n *\n * @todo v14 should standardize on path: Array<{parent, index}> because that is easier to work with.\n *\n * The following property holds:\n * @example\n * let type = y\n * event.path.forEach(dir => {\n * type = type.get(dir)\n * })\n * type === event.target // => true\n */\n get path () {\n return this._path || (this._path = getPathTo(this.currentTarget, this.target))\n }\n\n /**\n * Check if a struct is deleted by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n deletes (struct) {\n return isDeleted(this.transaction.deleteSet, struct.id)\n }\n\n /**\n * @type {Map}\n */\n get keys () {\n if (this._keys === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const keys = new Map()\n const target = this.target\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n changed.forEach(key => {\n if (key !== null) {\n const item = /** @type {Item} */ (target._map.get(key))\n /**\n * @type {'delete' | 'add' | 'update'}\n */\n let action\n let oldValue\n if (this.adds(item)) {\n let prev = item.left\n while (prev !== null && this.adds(prev)) {\n prev = prev.left\n }\n if (this.deletes(item)) {\n if (prev !== null && this.deletes(prev)) {\n action = 'delete'\n oldValue = array.last(prev.content.getContent())\n } else {\n return\n }\n } else {\n if (prev !== null && this.deletes(prev)) {\n action = 'update'\n oldValue = array.last(prev.content.getContent())\n } else {\n action = 'add'\n oldValue = undefined\n }\n }\n } else {\n if (this.deletes(item)) {\n action = 'delete'\n oldValue = array.last(/** @type {Item} */ item.content.getContent())\n } else {\n return // nop\n }\n }\n keys.set(key, { action, oldValue })\n }\n })\n this._keys = keys\n }\n return this._keys\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {Array<{insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object}>}\n */\n get delta () {\n return this.changes.delta\n }\n\n /**\n * Check if a struct is added by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n adds (struct) {\n return struct.id.clock >= (this.transaction.beforeState.get(struct.id.client) || 0)\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n let changes = this._changes\n if (changes === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const target = this.target\n const added = set.create()\n const deleted = set.create()\n /**\n * @type {Array<{insert:Array}|{delete:number}|{retain:number}>}\n */\n const delta = []\n changes = {\n added,\n deleted,\n delta,\n keys: this.keys\n }\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n if (changed.has(null)) {\n /**\n * @type {any}\n */\n let lastOp = null\n const packOp = () => {\n if (lastOp) {\n delta.push(lastOp)\n }\n }\n for (let item = target._start; item !== null; item = item.right) {\n if (item.deleted) {\n if (this.deletes(item) && !this.adds(item)) {\n if (lastOp === null || lastOp.delete === undefined) {\n packOp()\n lastOp = { delete: 0 }\n }\n lastOp.delete += item.length\n deleted.add(item)\n } // else nop\n } else {\n if (this.adds(item)) {\n if (lastOp === null || lastOp.insert === undefined) {\n packOp()\n lastOp = { insert: [] }\n }\n lastOp.insert = lastOp.insert.concat(item.content.getContent())\n added.add(item)\n } else {\n if (lastOp === null || lastOp.retain === undefined) {\n packOp()\n lastOp = { retain: 0 }\n }\n lastOp.retain += item.length\n }\n }\n }\n if (lastOp !== null && lastOp.retain === undefined) {\n packOp()\n }\n }\n this._changes = changes\n }\n return /** @type {any} */ (changes)\n }\n}\n\n/**\n * Compute the path from this type to the specified target.\n *\n * @example\n * // `child` should be accessible via `type.get(path[0]).get(path[1])..`\n * const path = type.getPathTo(child)\n * // assuming `type instanceof YArray`\n * console.log(path) // might look like => [2, 'key1']\n * child === type.get(path[0]).get(path[1])\n *\n * @param {AbstractType} parent\n * @param {AbstractType} child target\n * @return {Array} Path to the target\n *\n * @private\n * @function\n */\nconst getPathTo = (parent, child) => {\n const path = []\n while (child._item !== null && child !== parent) {\n if (child._item.parentSub !== null) {\n // parent is map-ish\n path.unshift(child._item.parentSub)\n } else {\n // parent is array-ish\n let i = 0\n let c = /** @type {AbstractType} */ (child._item.parent)._start\n while (c !== child._item && c !== null) {\n if (!c.deleted && c.countable) {\n i += c.length\n }\n c = c.right\n }\n path.unshift(i)\n }\n child = /** @type {AbstractType} */ (child._item.parent)\n }\n return path\n}\n", "import {\n removeEventHandlerListener,\n callEventHandlerListeners,\n addEventHandlerListener,\n createEventHandler,\n getState,\n isVisible,\n ContentType,\n createID,\n ContentAny,\n ContentBinary,\n getItemCleanStart,\n ContentDoc, YText, YArray, UpdateEncoderV1, UpdateEncoderV2, Doc, Snapshot, Transaction, EventHandler, YEvent, Item, // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as iterator from 'lib0/iterator'\nimport * as error from 'lib0/error'\nimport * as math from 'lib0/math'\nimport * as log from 'lib0/logging'\n\n/**\n * https://docs.yjs.dev/getting-started/working-with-shared-types#caveats\n */\nexport const warnPrematureAccess = () => { log.warn('Invalid access: Add Yjs type to a document before reading data.') }\n\nconst maxSearchMarker = 80\n\n/**\n * A unique timestamp that identifies each marker.\n *\n * Time is relative,.. this is more like an ever-increasing clock.\n *\n * @type {number}\n */\nlet globalSearchMarkerTimestamp = 0\n\nexport class ArraySearchMarker {\n /**\n * @param {Item} p\n * @param {number} index\n */\n constructor (p, index) {\n p.marker = true\n this.p = p\n this.index = index\n this.timestamp = globalSearchMarkerTimestamp++\n }\n}\n\n/**\n * @param {ArraySearchMarker} marker\n */\nconst refreshMarkerTimestamp = marker => { marker.timestamp = globalSearchMarkerTimestamp++ }\n\n/**\n * This is rather complex so this function is the only thing that should overwrite a marker\n *\n * @param {ArraySearchMarker} marker\n * @param {Item} p\n * @param {number} index\n */\nconst overwriteMarker = (marker, p, index) => {\n marker.p.marker = false\n marker.p = p\n p.marker = true\n marker.index = index\n marker.timestamp = globalSearchMarkerTimestamp++\n}\n\n/**\n * @param {Array} searchMarker\n * @param {Item} p\n * @param {number} index\n */\nconst markPosition = (searchMarker, p, index) => {\n if (searchMarker.length >= maxSearchMarker) {\n // override oldest marker (we don't want to create more objects)\n const marker = searchMarker.reduce((a, b) => a.timestamp < b.timestamp ? a : b)\n overwriteMarker(marker, p, index)\n return marker\n } else {\n // create new marker\n const pm = new ArraySearchMarker(p, index)\n searchMarker.push(pm)\n return pm\n }\n}\n\n/**\n * Search marker help us to find positions in the associative array faster.\n *\n * They speed up the process of finding a position without much bookkeeping.\n *\n * A maximum of `maxSearchMarker` objects are created.\n *\n * This function always returns a refreshed marker (updated timestamp)\n *\n * @param {AbstractType} yarray\n * @param {number} index\n */\nexport const findMarker = (yarray, index) => {\n if (yarray._start === null || index === 0 || yarray._searchMarker === null) {\n return null\n }\n const marker = yarray._searchMarker.length === 0 ? null : yarray._searchMarker.reduce((a, b) => math.abs(index - a.index) < math.abs(index - b.index) ? a : b)\n let p = yarray._start\n let pindex = 0\n if (marker !== null) {\n p = marker.p\n pindex = marker.index\n refreshMarkerTimestamp(marker) // we used it, we might need to use it again\n }\n // iterate to right if possible\n while (p.right !== null && pindex < index) {\n if (!p.deleted && p.countable) {\n if (index < pindex + p.length) {\n break\n }\n pindex += p.length\n }\n p = p.right\n }\n // iterate to left if necessary (might be that pindex > index)\n while (p.left !== null && pindex > index) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n // we want to make sure that p can't be merged with left, because that would screw up everything\n // in that cas just return what we have (it is most likely the best marker anyway)\n // iterate to left until p can't be merged with left\n while (p.left !== null && p.left.id.client === p.id.client && p.left.id.clock + p.left.length === p.id.clock) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n\n // @todo remove!\n // assure position\n // {\n // let start = yarray._start\n // let pos = 0\n // while (start !== p) {\n // if (!start.deleted && start.countable) {\n // pos += start.length\n // }\n // start = /** @type {Item} */ (start.right)\n // }\n // if (pos !== pindex) {\n // debugger\n // throw new Error('Gotcha position fail!')\n // }\n // }\n // if (marker) {\n // if (window.lengthes == null) {\n // window.lengthes = []\n // window.getLengthes = () => window.lengthes.sort((a, b) => a - b)\n // }\n // window.lengthes.push(marker.index - pindex)\n // console.log('distance', marker.index - pindex, 'len', p && p.parent.length)\n // }\n if (marker !== null && math.abs(marker.index - pindex) < /** @type {YText|YArray} */ (p.parent).length / maxSearchMarker) {\n // adjust existing marker\n overwriteMarker(marker, p, pindex)\n return marker\n } else {\n // create new marker\n return markPosition(yarray._searchMarker, p, pindex)\n }\n}\n\n/**\n * Update markers when a change happened.\n *\n * This should be called before doing a deletion!\n *\n * @param {Array} searchMarker\n * @param {number} index\n * @param {number} len If insertion, len is positive. If deletion, len is negative.\n */\nexport const updateMarkerChanges = (searchMarker, index, len) => {\n for (let i = searchMarker.length - 1; i >= 0; i--) {\n const m = searchMarker[i]\n if (len > 0) {\n /**\n * @type {Item|null}\n */\n let p = m.p\n p.marker = false\n // Ideally we just want to do a simple position comparison, but this will only work if\n // search markers don't point to deleted items for formats.\n // Iterate marker to prev undeleted countable position so we know what to do when updating a position\n while (p && (p.deleted || !p.countable)) {\n p = p.left\n if (p && !p.deleted && p.countable) {\n // adjust position. the loop should break now\n m.index -= p.length\n }\n }\n if (p === null || p.marker === true) {\n // remove search marker if updated position is null or if position is already marked\n searchMarker.splice(i, 1)\n continue\n }\n m.p = p\n p.marker = true\n }\n if (index < m.index || (len > 0 && index === m.index)) { // a simple index <= m.index check would actually suffice\n m.index = math.max(index, m.index + len)\n }\n }\n}\n\n/**\n * Accumulate all (list) children of a type and return them as an Array.\n *\n * @param {AbstractType} t\n * @return {Array}\n */\nexport const getTypeChildren = t => {\n t.doc ?? warnPrematureAccess()\n let s = t._start\n const arr = []\n while (s) {\n arr.push(s)\n s = s.right\n }\n return arr\n}\n\n/**\n * Call event listeners with an event. This will also add an event to all\n * parents (for `.observeDeep` handlers).\n *\n * @template EventType\n * @param {AbstractType} type\n * @param {Transaction} transaction\n * @param {EventType} event\n */\nexport const callTypeObservers = (type, transaction, event) => {\n const changedType = type\n const changedParentTypes = transaction.changedParentTypes\n while (true) {\n // @ts-ignore\n map.setIfUndefined(changedParentTypes, type, () => []).push(event)\n if (type._item === null) {\n break\n }\n type = /** @type {AbstractType} */ (type._item.parent)\n }\n callEventHandlerListeners(changedType._eH, event, transaction)\n}\n\n/**\n * @template EventType\n * Abstract Yjs Type class\n */\nexport class AbstractType {\n constructor () {\n /**\n * @type {Item|null}\n */\n this._item = null\n /**\n * @type {Map}\n */\n this._map = new Map()\n /**\n * @type {Item|null}\n */\n this._start = null\n /**\n * @type {Doc|null}\n */\n this.doc = null\n this._length = 0\n /**\n * Event handlers\n * @type {EventHandler}\n */\n this._eH = createEventHandler()\n /**\n * Deep event handlers\n * @type {EventHandler>,Transaction>}\n */\n this._dEH = createEventHandler()\n /**\n * @type {null | Array}\n */\n this._searchMarker = null\n }\n\n /**\n * @return {AbstractType|null}\n */\n get parent () {\n return this._item ? /** @type {AbstractType} */ (this._item.parent) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item|null} item\n */\n _integrate (y, item) {\n this.doc = y\n this._item = item\n }\n\n /**\n * @return {AbstractType}\n */\n _copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {AbstractType}\n */\n clone () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n */\n _write (_encoder) { }\n\n /**\n * The first non-deleted item\n */\n get _first () {\n let n = this._start\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Creates YEvent and calls all type observers.\n * Must be implemented by each type.\n *\n * @param {Transaction} transaction\n * @param {Set} _parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, _parentSubs) {\n if (!transaction.local && this._searchMarker) {\n this._searchMarker.length = 0\n }\n }\n\n /**\n * Observe all events that are created on this type.\n *\n * @param {function(EventType, Transaction):void} f Observer function\n */\n observe (f) {\n addEventHandlerListener(this._eH, f)\n }\n\n /**\n * Observe all events that are created by this type and its children.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n observeDeep (f) {\n addEventHandlerListener(this._dEH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(EventType,Transaction):void} f Observer function\n */\n unobserve (f) {\n removeEventHandlerListener(this._eH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n unobserveDeep (f) {\n removeEventHandlerListener(this._dEH, f)\n }\n\n /**\n * @abstract\n * @return {any}\n */\n toJSON () {}\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} start\n * @param {number} end\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListSlice = (type, start, end) => {\n type.doc ?? warnPrematureAccess()\n if (start < 0) {\n start = type._length + start\n }\n if (end < 0) {\n end = type._length + end\n }\n let len = end - start\n const cs = []\n let n = type._start\n while (n !== null && len > 0) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n if (c.length <= start) {\n start -= c.length\n } else {\n for (let i = start; i < c.length && len > 0; i++) {\n cs.push(c[i])\n len--\n }\n start = 0\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArray = type => {\n type.doc ?? warnPrematureAccess()\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @param {Snapshot} snapshot\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArraySnapshot = (type, snapshot) => {\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n *\n * @param {AbstractType} type\n * @param {function(any,number,any):void} f A function to execute on every element of this YArray.\n *\n * @private\n * @function\n */\nexport const typeListForEach = (type, f) => {\n let index = 0\n let n = type._start\n type.doc ?? warnPrematureAccess()\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @template C,R\n * @param {AbstractType} type\n * @param {function(C,number,AbstractType):R} f\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListMap = (type, f) => {\n /**\n * @type {Array}\n */\n const result = []\n typeListForEach(type, (c, i) => {\n result.push(f(c, i, type))\n })\n return result\n}\n\n/**\n * @param {AbstractType} type\n * @return {IterableIterator}\n *\n * @private\n * @function\n */\nexport const typeListCreateIterator = type => {\n let n = type._start\n /**\n * @type {Array|null}\n */\n let currentContent = null\n let currentContentIndex = 0\n return {\n [Symbol.iterator] () {\n return this\n },\n next: () => {\n // find some content\n if (currentContent === null) {\n while (n !== null && n.deleted) {\n n = n.right\n }\n // check if we reached the end, no need to check currentContent, because it does not exist\n if (n === null) {\n return {\n done: true,\n value: undefined\n }\n }\n // we found n, so we can set currentContent\n currentContent = n.content.getContent()\n currentContentIndex = 0\n n = n.right // we used the content of n, now iterate to next\n }\n const value = currentContent[currentContentIndex++]\n // check if we need to empty currentContent\n if (currentContent.length <= currentContentIndex) {\n currentContent = null\n }\n return {\n done: false,\n value\n }\n }\n }\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n * Operates on a snapshotted state of the document.\n *\n * @param {AbstractType} type\n * @param {function(any,number,AbstractType):void} f A function to execute on every element of this YArray.\n * @param {Snapshot} snapshot\n *\n * @private\n * @function\n */\nexport const typeListForEachSnapshot = (type, f, snapshot) => {\n let index = 0\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @return {any}\n *\n * @private\n * @function\n */\nexport const typeListGet = (type, index) => {\n type.doc ?? warnPrematureAccess()\n const marker = findMarker(type, index)\n let n = type._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n return n.content.getContent()[index]\n }\n index -= n.length\n }\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Item?} referenceItem\n * @param {Array|Array|boolean|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => {\n let left = referenceItem\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const store = doc.store\n const right = referenceItem === null ? parent._start : referenceItem.right\n /**\n * @type {Array|number|null>}\n */\n let jsonContent = []\n const packJsonContent = () => {\n if (jsonContent.length > 0) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentAny(jsonContent))\n left.integrate(transaction, 0)\n jsonContent = []\n }\n }\n content.forEach(c => {\n if (c === null) {\n jsonContent.push(c)\n } else {\n switch (c.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n jsonContent.push(c)\n break\n default:\n packJsonContent()\n switch (c.constructor) {\n case Uint8Array:\n case ArrayBuffer:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentBinary(new Uint8Array(/** @type {Uint8Array} */ (c))))\n left.integrate(transaction, 0)\n break\n case Doc:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentDoc(/** @type {Doc} */ (c)))\n left.integrate(transaction, 0)\n break\n default:\n if (c instanceof AbstractType) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentType(c))\n left.integrate(transaction, 0)\n } else {\n throw new Error('Unexpected content type in insert operation')\n }\n }\n }\n }\n })\n packJsonContent()\n}\n\nconst lengthExceeded = () => error.create('Length exceeded!')\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenerics = (transaction, parent, index, content) => {\n if (index > parent._length) {\n throw lengthExceeded()\n }\n if (index === 0) {\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, index, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, null, content)\n }\n const startIndex = index\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n // we need to iterate one to the left so that the algorithm works\n if (index === 0) {\n // @todo refactor this as it actually doesn't consider formats\n n = n.prev // important! get the left undeleted item so that we can actually decrease index\n index += (n && n.countable && !n.deleted) ? n.length : 0\n }\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index <= n.length) {\n if (index < n.length) {\n // insert in-between\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n break\n }\n index -= n.length\n }\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * Pushing content is special as we generally want to push after the last item. So we don't have to update\n * the serach marker.\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListPushGenerics = (transaction, parent, content) => {\n // Use the marker with the highest index and iterate to the right.\n const marker = (parent._searchMarker || []).reduce((maxMarker, currMarker) => currMarker.index > maxMarker.index ? currMarker : maxMarker, { index: 0, p: parent._start })\n let n = marker.p\n if (n) {\n while (n.right) {\n n = n.right\n }\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const typeListDelete = (transaction, parent, index, length) => {\n if (length === 0) { return }\n const startIndex = index\n const startLength = length\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n // compute the first item to be deleted\n for (; n !== null && index > 0; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n index -= n.length\n }\n }\n // delete all items until done\n while (length > 0 && n !== null) {\n if (!n.deleted) {\n if (length < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length))\n }\n n.delete(transaction)\n length -= n.length\n }\n n = n.right\n }\n if (length > 0) {\n throw lengthExceeded()\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length /* in case we remove the above exception */)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n *\n * @private\n * @function\n */\nexport const typeMapDelete = (transaction, parent, key) => {\n const c = parent._map.get(key)\n if (c !== undefined) {\n c.delete(transaction)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Object|number|null|Array|string|Uint8Array|AbstractType} value\n *\n * @private\n * @function\n */\nexport const typeMapSet = (transaction, parent, key, value) => {\n const left = parent._map.get(key) || null\n const doc = transaction.doc\n const ownClientId = doc.clientID\n let content\n if (value == null) {\n content = new ContentAny([value])\n } else {\n switch (value.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n content = new ContentAny([value])\n break\n case Uint8Array:\n content = new ContentBinary(/** @type {Uint8Array} */ (value))\n break\n case Doc:\n content = new ContentDoc(/** @type {Doc} */ (value))\n break\n default:\n if (value instanceof AbstractType) {\n content = new ContentType(value)\n } else {\n throw new Error('Unexpected content type')\n }\n }\n }\n new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0)\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGet = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted ? val.content.getContent()[val.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAll = (parent) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent.doc ?? warnPrematureAccess()\n parent._map.forEach((value, key) => {\n if (!value.deleted) {\n res[key] = value.content.getContent()[value.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const typeMapHas = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGetSnapshot = (parent, key, snapshot) => {\n let v = parent._map.get(key) || null\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n return v !== null && isVisible(v, snapshot) ? v.content.getContent()[v.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAllSnapshot = (parent, snapshot) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent._map.forEach((value, key) => {\n /**\n * @type {Item|null}\n */\n let v = value\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n if (v !== null && isVisible(v, snapshot)) {\n res[key] = v.content.getContent()[v.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType & { _map: Map }} type\n * @return {IterableIterator>}\n *\n * @private\n * @function\n */\nexport const createMapIterator = type => {\n type.doc ?? warnPrematureAccess()\n return iterator.iteratorFilter(type._map.entries(), /** @param {any} entry */ entry => !entry[1].deleted)\n}\n", "/**\n * @module YArray\n */\n\nimport {\n YEvent,\n AbstractType,\n typeListGet,\n typeListToArray,\n typeListForEach,\n typeListCreateIterator,\n typeListInsertGenerics,\n typeListPushGenerics,\n typeListDelete,\n typeListMap,\n YArrayRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\nimport { typeListSlice } from './AbstractType.js'\n\n/**\n * Event that describes the changes on a YArray\n * @template T\n * @extends YEvent>\n */\nexport class YArrayEvent extends YEvent {}\n\n/**\n * A shared Array implementation.\n * @template T\n * @extends AbstractType>\n * @implements {Iterable}\n */\nexport class YArray extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array?}\n * @private\n */\n this._prelimContent = []\n /**\n * @type {Array}\n */\n this._searchMarker = []\n }\n\n /**\n * Construct a new YArray containing the specified items.\n * @template {Object|Array|number|null|string|Uint8Array} T\n * @param {Array} items\n * @return {YArray}\n */\n static from (items) {\n /**\n * @type {YArray}\n */\n const a = new YArray()\n a.push(items)\n return a\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n /**\n * @return {YArray}\n */\n _copy () {\n return new YArray()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YArray}\n */\n clone () {\n /**\n * @type {YArray}\n */\n const arr = new YArray()\n arr.insert(0, this.toArray().map(el =>\n el instanceof AbstractType ? /** @type {typeof el} */ (el.clone()) : el\n ))\n return arr\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * Creates YArrayEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n callTypeObservers(this, transaction, new YArrayEvent(this, transaction))\n }\n\n /**\n * Inserts new content at an index.\n *\n * Important: This function expects an array of content. Not just a content\n * object. The reason for this \"weirdness\" is that inserting several elements\n * is very efficient when it is done as a single operation.\n *\n * @example\n * // Insert character 'a' at position 0\n * yarray.insert(0, ['a'])\n * // Insert numbers 1, 2 at position 1\n * yarray.insert(1, [1, 2])\n *\n * @param {number} index The index to insert content at.\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, 0, ...content)\n }\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n *\n * @todo Use the following implementation in all types.\n */\n push (content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListPushGenerics(transaction, this, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).push(...content)\n }\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} length The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, length)\n }\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {T}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Returns a portion of this YArray into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Array}\n */\n toJSON () {\n return this.map(c => c instanceof AbstractType ? c.toJSON() : c)\n }\n\n /**\n * Returns an Array with the result of calling a provided function on every\n * element of this YArray.\n *\n * @template M\n * @param {function(T,number,YArray):M} f Function that produces an element of the new Array\n * @return {Array} A new array with each element being the result of the\n * callback function\n */\n map (f) {\n return typeListMap(this, /** @type {any} */ (f))\n }\n\n /**\n * Executes a provided function once on every element of this YArray.\n *\n * @param {function(T,number,YArray):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return typeListCreateIterator(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YArrayRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYArray = _decoder => new YArray()\n", "/**\n * @module YMap\n */\n\nimport {\n YEvent,\n AbstractType,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapHas,\n createMapIterator,\n YMapRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as iterator from 'lib0/iterator'\n\n/**\n * @template T\n * @extends YEvent>\n * Event that describes the changes on a YMap.\n */\nexport class YMapEvent extends YEvent {\n /**\n * @param {YMap} ymap The YArray that changed.\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed.\n */\n constructor (ymap, transaction, subs) {\n super(ymap, transaction)\n this.keysChanged = subs\n }\n}\n\n/**\n * @template MapType\n * A shared Map implementation.\n *\n * @extends AbstractType>\n * @implements {Iterable<[string, MapType]>}\n */\nexport class YMap extends AbstractType {\n /**\n *\n * @param {Iterable=} entries - an optional iterable to initialize the YMap\n */\n constructor (entries) {\n super()\n /**\n * @type {Map?}\n * @private\n */\n this._prelimContent = null\n\n if (entries === undefined) {\n this._prelimContent = new Map()\n } else {\n this._prelimContent = new Map(entries)\n }\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;/** @type {Map} */ (this._prelimContent).forEach((value, key) => {\n this.set(key, value)\n })\n this._prelimContent = null\n }\n\n /**\n * @return {YMap}\n */\n _copy () {\n return new YMap()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YMap}\n */\n clone () {\n /**\n * @type {YMap}\n */\n const map = new YMap()\n this.forEach((value, key) => {\n map.set(key, value instanceof AbstractType ? /** @type {typeof value} */ (value.clone()) : value)\n })\n return map\n }\n\n /**\n * Creates YMapEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs))\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Object}\n */\n toJSON () {\n this.doc ?? warnPrematureAccess()\n /**\n * @type {Object}\n */\n const map = {}\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n const v = item.content.getContent()[item.length - 1]\n map[key] = v instanceof AbstractType ? v.toJSON() : v\n }\n })\n return map\n }\n\n /**\n * Returns the size of the YMap (count of key/value pairs)\n *\n * @return {number}\n */\n get size () {\n return [...createMapIterator(this)].length\n }\n\n /**\n * Returns the keys for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n keys () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[0])\n }\n\n /**\n * Returns the values for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n values () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n entries () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => /** @type {any} */ ([v[0], v[1].content.getContent()[v[1].length - 1]]))\n }\n\n /**\n * Executes a provided function on once on every key-value pair.\n *\n * @param {function(MapType,string,YMap):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n this.doc ?? warnPrematureAccess()\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n f(item.content.getContent()[item.length - 1], key, this)\n }\n })\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n [Symbol.iterator] () {\n return this.entries()\n }\n\n /**\n * Remove a specified element from this YMap.\n *\n * @param {string} key The key of the element to remove.\n */\n delete (key) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, key)\n })\n } else {\n /** @type {Map} */ (this._prelimContent).delete(key)\n }\n }\n\n /**\n * Adds or updates an element with a specified key and value.\n * @template {MapType} VAL\n *\n * @param {string} key The key of the element to add to this YMap\n * @param {VAL} value The value of the element to add\n * @return {VAL}\n */\n set (key, value) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, key, /** @type {any} */ (value))\n })\n } else {\n /** @type {Map} */ (this._prelimContent).set(key, value)\n }\n return value\n }\n\n /**\n * Returns a specified element from this YMap.\n *\n * @param {string} key\n * @return {MapType|undefined}\n */\n get (key) {\n return /** @type {any} */ (typeMapGet(this, key))\n }\n\n /**\n * Returns a boolean indicating whether the specified key exists or not.\n *\n * @param {string} key The key to test.\n * @return {boolean}\n */\n has (key) {\n return typeMapHas(this, key)\n }\n\n /**\n * Removes all elements from this YMap.\n */\n clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map} */ (this._prelimContent).clear()\n }\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YMapRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYMap = _decoder => new YMap()\n", "/**\n * @module YText\n */\n\nimport {\n YEvent,\n AbstractType,\n getItemCleanStart,\n getState,\n isVisible,\n createID,\n YTextRefID,\n callTypeObservers,\n transact,\n ContentEmbed,\n GC,\n ContentFormat,\n ContentString,\n splitSnapshotAffectedStructs,\n iterateDeletedStructs,\n iterateStructs,\n findMarker,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n updateMarkerChanges,\n ContentType,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ID, Doc, Item, Snapshot, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as object from 'lib0/object'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nconst equalAttrs = (a, b) => a === b || (typeof a === 'object' && typeof b === 'object' && a && b && object.equalFlat(a, b))\n\nexport class ItemTextListPosition {\n /**\n * @param {Item|null} left\n * @param {Item|null} right\n * @param {number} index\n * @param {Map} currentAttributes\n */\n constructor (left, right, index, currentAttributes) {\n this.left = left\n this.right = right\n this.index = index\n this.currentAttributes = currentAttributes\n }\n\n /**\n * Only call this if you know that this.right is defined\n */\n forward () {\n if (this.right === null) {\n error.unexpectedCase()\n }\n switch (this.right.content.constructor) {\n case ContentFormat:\n if (!this.right.deleted) {\n updateCurrentAttributes(this.currentAttributes, /** @type {ContentFormat} */ (this.right.content))\n }\n break\n default:\n if (!this.right.deleted) {\n this.index += this.right.length\n }\n break\n }\n this.left = this.right\n this.right = this.right.right\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} pos\n * @param {number} count steps to move forward\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findNextPosition = (transaction, pos, count) => {\n while (pos.right !== null && count > 0) {\n switch (pos.right.content.constructor) {\n case ContentFormat:\n if (!pos.right.deleted) {\n updateCurrentAttributes(pos.currentAttributes, /** @type {ContentFormat} */ (pos.right.content))\n }\n break\n default:\n if (!pos.right.deleted) {\n if (count < pos.right.length) {\n // split right\n getItemCleanStart(transaction, createID(pos.right.id.client, pos.right.id.clock + count))\n }\n pos.index += pos.right.length\n count -= pos.right.length\n }\n break\n }\n pos.left = pos.right\n pos.right = pos.right.right\n // pos.forward() - we don't forward because that would halve the performance because we already do the checks above\n }\n return pos\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {boolean} useSearchMarker\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findPosition = (transaction, parent, index, useSearchMarker) => {\n const currentAttributes = new Map()\n const marker = useSearchMarker ? findMarker(parent, index) : null\n if (marker) {\n const pos = new ItemTextListPosition(marker.p.left, marker.p, marker.index, currentAttributes)\n return findNextPosition(transaction, pos, index - marker.index)\n } else {\n const pos = new ItemTextListPosition(null, parent._start, 0, currentAttributes)\n return findNextPosition(transaction, pos, index)\n }\n}\n\n/**\n * Negate applied formats\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Map} negatedAttributes\n *\n * @private\n * @function\n */\nconst insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes) => {\n // check if we really need to remove attributes\n while (\n currPos.right !== null && (\n currPos.right.deleted === true || (\n currPos.right.content.constructor === ContentFormat &&\n equalAttrs(negatedAttributes.get(/** @type {ContentFormat} */ (currPos.right.content).key), /** @type {ContentFormat} */ (currPos.right.content).value)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n negatedAttributes.delete(/** @type {ContentFormat} */ (currPos.right.content).key)\n }\n currPos.forward()\n }\n const doc = transaction.doc\n const ownClientId = doc.clientID\n negatedAttributes.forEach((val, key) => {\n const left = currPos.left\n const right = currPos.right\n const nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n nextFormat.integrate(transaction, 0)\n currPos.right = nextFormat\n currPos.forward()\n })\n}\n\n/**\n * @param {Map} currentAttributes\n * @param {ContentFormat} format\n *\n * @private\n * @function\n */\nconst updateCurrentAttributes = (currentAttributes, format) => {\n const { key, value } = format\n if (value === null) {\n currentAttributes.delete(key)\n } else {\n currentAttributes.set(key, value)\n }\n}\n\n/**\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst minimizeAttributeChanges = (currPos, attributes) => {\n // go right while attributes[right.key] === right.value (or right is deleted)\n while (true) {\n if (currPos.right === null) {\n break\n } else if (currPos.right.deleted || (currPos.right.content.constructor === ContentFormat && equalAttrs(attributes[(/** @type {ContentFormat} */ (currPos.right.content)).key] ?? null, /** @type {ContentFormat} */ (currPos.right.content).value))) {\n //\n } else {\n break\n }\n currPos.forward()\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n * @return {Map}\n *\n * @private\n * @function\n **/\nconst insertAttributes = (transaction, parent, currPos, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const negatedAttributes = new Map()\n // insert format-start items\n for (const key in attributes) {\n const val = attributes[key]\n const currentVal = currPos.currentAttributes.get(key) ?? null\n if (!equalAttrs(currentVal, val)) {\n // save negated attribute (set null if currentVal undefined)\n negatedAttributes.set(key, currentVal)\n const { left, right } = currPos\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n }\n return negatedAttributes\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {string|object|AbstractType} text\n * @param {Object} attributes\n *\n * @private\n * @function\n **/\nconst insertText = (transaction, parent, currPos, text, attributes) => {\n currPos.currentAttributes.forEach((_val, key) => {\n if (attributes[key] === undefined) {\n attributes[key] = null\n }\n })\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // insert content\n const content = text.constructor === String ? new ContentString(/** @type {string} */ (text)) : (text instanceof AbstractType ? new ContentType(text) : new ContentEmbed(text))\n let { left, right, index } = currPos\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength())\n }\n right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content)\n right.integrate(transaction, 0)\n currPos.right = right\n currPos.index = index\n currPos.forward()\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst formatText = (transaction, parent, currPos, length, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // iterate until first non-format or null is found\n // delete all formats with attributes[format.key] != null\n // also check the attributes after the first non-format as we do not want to insert redundant negated attributes there\n // eslint-disable-next-line no-labels\n iterationLoop: while (\n currPos.right !== null &&\n (length > 0 ||\n (\n negatedAttributes.size > 0 &&\n (currPos.right.deleted || currPos.right.content.constructor === ContentFormat)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n switch (currPos.right.content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (currPos.right.content)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (equalAttrs(attr, value)) {\n negatedAttributes.delete(key)\n } else {\n if (length === 0) {\n // no need to further extend negatedAttributes\n // eslint-disable-next-line no-labels\n break iterationLoop\n }\n negatedAttributes.set(key, value)\n }\n currPos.right.delete(transaction)\n } else {\n currPos.currentAttributes.set(key, value)\n }\n break\n }\n default:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n break\n }\n }\n currPos.forward()\n }\n // Quill just assumes that the editor starts with a newline and that it always\n // ends with a newline. We only insert that newline when a new newline is\n // inserted - i.e when length is bigger than type.length\n if (length > 0) {\n let newlines = ''\n for (; length > 0; length--) {\n newlines += '\\n'\n }\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * Call this function after string content has been deleted in order to\n * clean up formatting Items.\n *\n * @param {Transaction} transaction\n * @param {Item} start\n * @param {Item|null} curr exclusive end, automatically iterates to the next Content Item\n * @param {Map} startAttributes\n * @param {Map} currAttributes\n * @return {number} The amount of formatting Items deleted.\n *\n * @function\n */\nconst cleanupFormattingGap = (transaction, start, curr, startAttributes, currAttributes) => {\n /**\n * @type {Item|null}\n */\n let end = start\n /**\n * @type {Map}\n */\n const endFormats = map.create()\n while (end && (!end.countable || end.deleted)) {\n if (!end.deleted && end.content.constructor === ContentFormat) {\n const cf = /** @type {ContentFormat} */ (end.content)\n endFormats.set(cf.key, cf)\n }\n end = end.right\n }\n let cleanups = 0\n let reachedCurr = false\n while (start !== end) {\n if (curr === start) {\n reachedCurr = true\n }\n if (!start.deleted) {\n const content = start.content\n switch (content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (content)\n const startAttrValue = startAttributes.get(key) ?? null\n if (endFormats.get(key) !== content || startAttrValue === value) {\n // Either this format is overwritten or it is not necessary because the attribute already existed.\n start.delete(transaction)\n cleanups++\n if (!reachedCurr && (currAttributes.get(key) ?? null) === value && startAttrValue !== value) {\n if (startAttrValue === null) {\n currAttributes.delete(key)\n } else {\n currAttributes.set(key, startAttrValue)\n }\n }\n }\n if (!reachedCurr && !start.deleted) {\n updateCurrentAttributes(currAttributes, /** @type {ContentFormat} */ (content))\n }\n break\n }\n }\n }\n start = /** @type {Item} */ (start.right)\n }\n return cleanups\n}\n\n/**\n * @param {Transaction} transaction\n * @param {Item | null} item\n */\nconst cleanupContextlessFormattingGap = (transaction, item) => {\n // iterate until item.right is null or content\n while (item && item.right && (item.right.deleted || !item.right.countable)) {\n item = item.right\n }\n const attrs = new Set()\n // iterate back until a content item is found\n while (item && (item.deleted || !item.countable)) {\n if (!item.deleted && item.content.constructor === ContentFormat) {\n const key = /** @type {ContentFormat} */ (item.content).key\n if (attrs.has(key)) {\n item.delete(transaction)\n } else {\n attrs.add(key)\n }\n }\n item = item.left\n }\n}\n\n/**\n * This function is experimental and subject to change / be removed.\n *\n * Ideally, we don't need this function at all. Formatting attributes should be cleaned up\n * automatically after each change. This function iterates twice over the complete YText type\n * and removes unnecessary formatting attributes. This is also helpful for testing.\n *\n * This function won't be exported anymore as soon as there is confidence that the YText type works as intended.\n *\n * @param {YText} type\n * @return {number} How many formatting attributes have been cleaned up.\n */\nexport const cleanupYTextFormatting = type => {\n let res = 0\n transact(/** @type {Doc} */ (type.doc), transaction => {\n let start = /** @type {Item} */ (type._start)\n let end = type._start\n let startAttributes = map.create()\n const currentAttributes = map.copy(startAttributes)\n while (end) {\n if (end.deleted === false) {\n switch (end.content.constructor) {\n case ContentFormat:\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (end.content))\n break\n default:\n res += cleanupFormattingGap(transaction, start, end, startAttributes, currentAttributes)\n startAttributes = map.copy(currentAttributes)\n start = end\n break\n }\n }\n end = end.right\n }\n })\n return res\n}\n\n/**\n * This will be called by the transction once the event handlers are called to potentially cleanup\n * formatting attributes.\n *\n * @param {Transaction} transaction\n */\nexport const cleanupYTextAfterTransaction = transaction => {\n /**\n * @type {Set}\n */\n const needFullCleanup = new Set()\n // check if another formatting item was inserted\n const doc = transaction.doc\n for (const [client, afterClock] of transaction.afterState.entries()) {\n const clock = transaction.beforeState.get(client) || 0\n if (afterClock === clock) {\n continue\n }\n iterateStructs(transaction, /** @type {Array} */ (doc.store.clients.get(client)), clock, afterClock, item => {\n if (\n !item.deleted && /** @type {Item} */ (item).content.constructor === ContentFormat && item.constructor !== GC\n ) {\n needFullCleanup.add(/** @type {any} */ (item).parent)\n }\n })\n }\n // cleanup in a new transaction\n transact(doc, (t) => {\n iterateDeletedStructs(transaction, transaction.deleteSet, item => {\n if (item instanceof GC || !(/** @type {YText} */ (item.parent)._hasFormatting) || needFullCleanup.has(/** @type {YText} */ (item.parent))) {\n return\n }\n const parent = /** @type {YText} */ (item.parent)\n if (item.content.constructor === ContentFormat) {\n needFullCleanup.add(parent)\n } else {\n // If no formatting attribute was inserted or deleted, we can make due with contextless\n // formatting cleanups.\n // Contextless: it is not necessary to compute currentAttributes for the affected position.\n cleanupContextlessFormattingGap(t, item)\n }\n })\n // If a formatting item was inserted, we simply clean the whole type.\n // We need to compute currentAttributes for the current position anyway.\n for (const yText of needFullCleanup) {\n cleanupYTextFormatting(yText)\n }\n })\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst deleteText = (transaction, currPos, length) => {\n const startLength = length\n const startAttrs = map.copy(currPos.currentAttributes)\n const start = currPos.right\n while (length > 0 && currPos.right !== null) {\n if (currPos.right.deleted === false) {\n switch (currPos.right.content.constructor) {\n case ContentType:\n case ContentEmbed:\n case ContentString:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n currPos.right.delete(transaction)\n break\n }\n }\n currPos.forward()\n }\n if (start) {\n cleanupFormattingGap(transaction, start, currPos.right, startAttrs, currPos.currentAttributes)\n }\n const parent = /** @type {AbstractType} */ (/** @type {Item} */ (currPos.left || currPos.right).parent)\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length)\n }\n return currPos\n}\n\n/**\n * The Quill Delta format represents changes on a text document with\n * formatting information. For mor information visit {@link https://quilljs.com/docs/delta/|Quill Delta}\n *\n * @example\n * {\n * ops: [\n * { insert: 'Gandalf', attributes: { bold: true } },\n * { insert: ' the ' },\n * { insert: 'Grey', attributes: { color: '#cccccc' } }\n * ]\n * }\n *\n */\n\n/**\n * Attributes that can be assigned to a selection of text.\n *\n * @example\n * {\n * bold: true,\n * font-size: '40px'\n * }\n *\n * @typedef {Object} TextAttributes\n */\n\n/**\n * @extends YEvent\n * Event that describes the changes on a YText type.\n */\nexport class YTextEvent extends YEvent {\n /**\n * @param {YText} ytext\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed\n */\n constructor (ytext, transaction, subs) {\n super(ytext, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.keysChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.keysChanged.add(sub)\n }\n })\n }\n\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n if (this._changes === null) {\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string|AbstractType|object, delete?:number, retain?:number}>}}\n */\n const changes = {\n keys: this.keys,\n delta: this.delta,\n added: new Set(),\n deleted: new Set()\n }\n this._changes = changes\n }\n return /** @type {any} */ (this._changes)\n }\n\n /**\n * Compute the changes in the delta format.\n * A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document.\n *\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n *\n * @public\n */\n get delta () {\n if (this._delta === null) {\n const y = /** @type {Doc} */ (this.target.doc)\n /**\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n */\n const delta = []\n transact(y, transaction => {\n const currentAttributes = new Map() // saves all current attributes for insert\n const oldAttributes = new Map()\n let item = this.target._start\n /**\n * @type {string?}\n */\n let action = null\n /**\n * @type {Object}\n */\n const attributes = {} // counts added or removed new attributes for retain\n /**\n * @type {string|object}\n */\n let insert = ''\n let retain = 0\n let deleteLen = 0\n const addOp = () => {\n if (action !== null) {\n /**\n * @type {any}\n */\n let op = null\n switch (action) {\n case 'delete':\n if (deleteLen > 0) {\n op = { delete: deleteLen }\n }\n deleteLen = 0\n break\n case 'insert':\n if (typeof insert === 'object' || insert.length > 0) {\n op = { insert }\n if (currentAttributes.size > 0) {\n op.attributes = {}\n currentAttributes.forEach((value, key) => {\n if (value !== null) {\n op.attributes[key] = value\n }\n })\n }\n }\n insert = ''\n break\n case 'retain':\n if (retain > 0) {\n op = { retain }\n if (!object.isEmpty(attributes)) {\n op.attributes = object.assign({}, attributes)\n }\n }\n retain = 0\n break\n }\n if (op) delta.push(op)\n action = null\n }\n }\n while (item !== null) {\n switch (item.content.constructor) {\n case ContentType:\n case ContentEmbed:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n addOp()\n action = 'insert'\n insert = item.content.getContent()[0]\n addOp()\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += 1\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += 1\n }\n break\n case ContentString:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n if (action !== 'insert') {\n addOp()\n action = 'insert'\n }\n insert += /** @type {ContentString} */ (item.content).str\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += item.length\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += item.length\n }\n break\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (item.content)\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (equalAttrs(value, (oldAttributes.get(key) ?? null))) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (value !== null) {\n item.delete(transaction)\n }\n }\n } else if (this.deletes(item)) {\n oldAttributes.set(key, value)\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n attributes[key] = curVal\n }\n } else if (!item.deleted) {\n oldAttributes.set(key, value)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (!equalAttrs(attr, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (value === null) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (attr !== null) { // this will be cleaned up automatically by the contextless cleanup function\n item.delete(transaction)\n }\n }\n }\n if (!item.deleted) {\n if (action === 'insert') {\n addOp()\n }\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (item.content))\n }\n break\n }\n }\n item = item.right\n }\n addOp()\n while (delta.length > 0) {\n const lastOp = delta[delta.length - 1]\n if (lastOp.retain !== undefined && lastOp.attributes === undefined) {\n // retain delta's if they don't assign attributes\n delta.pop()\n } else {\n break\n }\n }\n })\n this._delta = delta\n }\n return /** @type {any} */ (this._delta)\n }\n}\n\n/**\n * Type that represents text with formatting information.\n *\n * This type replaces y-richtext as this implementation is able to handle\n * block formats (format information on a paragraph), embeds (complex elements\n * like pictures and videos), and text formats (**bold**, *italic*).\n *\n * @extends AbstractType\n */\nexport class YText extends AbstractType {\n /**\n * @param {String} [string] The initial value of the YText.\n */\n constructor (string) {\n super()\n /**\n * Array of pending operations on this type\n * @type {Array?}\n */\n this._pending = string !== undefined ? [() => this.insert(0, string)] : []\n /**\n * @type {Array|null}\n */\n this._searchMarker = []\n /**\n * Whether this YText contains formatting attributes.\n * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)\n */\n this._hasFormatting = false\n }\n\n /**\n * Number of characters of this text type.\n *\n * @type {number}\n */\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * @param {Doc} y\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n try {\n /** @type {Array} */ (this._pending).forEach(f => f())\n } catch (e) {\n console.error(e)\n }\n this._pending = null\n }\n\n _copy () {\n return new YText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YText}\n */\n clone () {\n const text = new YText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates YTextEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n const event = new YTextEvent(this, transaction, parentSubs)\n callTypeObservers(this, transaction, event)\n // If a remote change happened, we try to cleanup potential formatting duplicates.\n if (!transaction.local && this._hasFormatting) {\n transaction._needFormattingCleanup = true\n }\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @public\n */\n toString () {\n this.doc ?? warnPrematureAccess()\n let str = ''\n /**\n * @type {Item|null}\n */\n let n = this._start\n while (n !== null) {\n if (!n.deleted && n.countable && n.content.constructor === ContentString) {\n str += /** @type {ContentString} */ (n.content).str\n }\n n = n.right\n }\n return str\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @return {string}\n * @public\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Apply a {@link Delta} on this shared YText type.\n *\n * @param {any} delta The changes to apply on this element.\n * @param {object} opts\n * @param {boolean} [opts.sanitize] Sanitize input delta. Removes ending newlines if set to true.\n *\n *\n * @public\n */\n applyDelta (delta, { sanitize = true } = {}) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const currPos = new ItemTextListPosition(null, this._start, 0, new Map())\n for (let i = 0; i < delta.length; i++) {\n const op = delta[i]\n if (op.insert !== undefined) {\n // Quill assumes that the content starts with an empty paragraph.\n // Yjs/Y.Text assumes that it starts empty. We always hide that\n // there is a newline at the end of the content.\n // If we omit this step, clients will see a different number of\n // paragraphs, but nothing bad will happen.\n const ins = (!sanitize && typeof op.insert === 'string' && i === delta.length - 1 && currPos.right === null && op.insert.slice(-1) === '\\n') ? op.insert.slice(0, -1) : op.insert\n if (typeof ins !== 'string' || ins.length > 0) {\n insertText(transaction, this, currPos, ins, op.attributes || {})\n }\n } else if (op.retain !== undefined) {\n formatText(transaction, this, currPos, op.retain, op.attributes || {})\n } else if (op.delete !== undefined) {\n deleteText(transaction, currPos, op.delete)\n }\n }\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.applyDelta(delta))\n }\n }\n\n /**\n * Returns the Delta representation of this YText type.\n *\n * @param {Snapshot} [snapshot]\n * @param {Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', ID):any} [computeYChange]\n * @return {any} The Delta representation of this type.\n *\n * @public\n */\n toDelta (snapshot, prevSnapshot, computeYChange) {\n this.doc ?? warnPrematureAccess()\n /**\n * @type{Array}\n */\n const ops = []\n const currentAttributes = new Map()\n const doc = /** @type {Doc} */ (this.doc)\n let str = ''\n let n = this._start\n function packStr () {\n if (str.length > 0) {\n // pack str with attributes to ops\n /**\n * @type {Object}\n */\n const attributes = {}\n let addAttributes = false\n currentAttributes.forEach((value, key) => {\n addAttributes = true\n attributes[key] = value\n })\n /**\n * @type {Object}\n */\n const op = { insert: str }\n if (addAttributes) {\n op.attributes = attributes\n }\n ops.push(op)\n str = ''\n }\n }\n const computeDelta = () => {\n while (n !== null) {\n if (isVisible(n, snapshot) || (prevSnapshot !== undefined && isVisible(n, prevSnapshot))) {\n switch (n.content.constructor) {\n case ContentString: {\n const cur = currentAttributes.get('ychange')\n if (snapshot !== undefined && !isVisible(n, snapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'removed') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('removed', n.id) : { type: 'removed' })\n }\n } else if (prevSnapshot !== undefined && !isVisible(n, prevSnapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'added') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('added', n.id) : { type: 'added' })\n }\n } else if (cur !== undefined) {\n packStr()\n currentAttributes.delete('ychange')\n }\n str += /** @type {ContentString} */ (n.content).str\n break\n }\n case ContentType:\n case ContentEmbed: {\n packStr()\n /**\n * @type {Object}\n */\n const op = {\n insert: n.content.getContent()[0]\n }\n if (currentAttributes.size > 0) {\n const attrs = /** @type {Object} */ ({})\n op.attributes = attrs\n currentAttributes.forEach((value, key) => {\n attrs[key] = value\n })\n }\n ops.push(op)\n break\n }\n case ContentFormat:\n if (isVisible(n, snapshot)) {\n packStr()\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (n.content))\n }\n break\n }\n }\n n = n.right\n }\n packStr()\n }\n if (snapshot || prevSnapshot) {\n // snapshots are merged again after the transaction, so we need to keep the\n // transaction alive until we are done\n transact(doc, transaction => {\n if (snapshot) {\n splitSnapshotAffectedStructs(transaction, snapshot)\n }\n if (prevSnapshot) {\n splitSnapshotAffectedStructs(transaction, prevSnapshot)\n }\n computeDelta()\n }, 'cleanup')\n } else {\n computeDelta()\n }\n return ops\n }\n\n /**\n * Insert text at a given index.\n *\n * @param {number} index The index at which to start inserting.\n * @param {String} text The text to insert at the specified position.\n * @param {TextAttributes} [attributes] Optionally define some formatting\n * information to apply on the inserted\n * Text.\n * @public\n */\n insert (index, text, attributes) {\n if (text.length <= 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n if (!attributes) {\n attributes = {}\n // @ts-ignore\n pos.currentAttributes.forEach((v, k) => { attributes[k] = v })\n }\n insertText(transaction, this, pos, text, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insert(index, text, attributes))\n }\n }\n\n /**\n * Inserts an embed at a index.\n *\n * @param {number} index The index to insert the embed at.\n * @param {Object | AbstractType} embed The Object that represents the embed.\n * @param {TextAttributes} [attributes] Attribute information to apply on the\n * embed\n *\n * @public\n */\n insertEmbed (index, embed, attributes) {\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n insertText(transaction, this, pos, embed, attributes || {})\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insertEmbed(index, embed, attributes || {}))\n }\n }\n\n /**\n * Deletes text starting from an index.\n *\n * @param {number} index Index at which to start deleting.\n * @param {number} length The number of characters to remove. Defaults to 1.\n *\n * @public\n */\n delete (index, length) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n deleteText(transaction, findPosition(transaction, this, index, true), length)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.delete(index, length))\n }\n }\n\n /**\n * Assigns properties to a range of text.\n *\n * @param {number} index The position where to start formatting.\n * @param {number} length The amount of characters to assign properties to.\n * @param {TextAttributes} attributes Attribute information to apply on the\n * text.\n *\n * @public\n */\n format (index, length, attributes) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, false)\n if (pos.right === null) {\n return\n }\n formatText(transaction, this, pos, length, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.format(index, length, attributes))\n }\n }\n\n /**\n * Removes an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.removeAttribute(attributeName))\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be set.\n * @param {any} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.setAttribute(attributeName, attributeValue))\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that identifies the\n * queried value.\n * @return {any} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @return {Object} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes () {\n return typeMapGetAll(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YText}\n *\n * @private\n * @function\n */\nexport const readYText = _decoder => new YText()\n", "/**\n * @module YXml\n */\n\nimport {\n YXmlEvent,\n YXmlElement,\n AbstractType,\n typeListMap,\n typeListForEach,\n typeListInsertGenerics,\n typeListInsertGenericsAfter,\n typeListDelete,\n typeListToArray,\n YXmlFragmentRefID,\n callTypeObservers,\n transact,\n typeListGet,\n typeListSlice,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, ContentType, Transaction, Item, YXmlText, YXmlHook // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as array from 'lib0/array'\n\n/**\n * Define the elements to which a set of CSS queries apply.\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|CSS_Selectors}\n *\n * @example\n * query = '.classSelector'\n * query = 'nodeSelector'\n * query = '#idSelector'\n *\n * @typedef {string} CSS_Selector\n */\n\n/**\n * Dom filter function.\n *\n * @callback domFilter\n * @param {string} nodeName The nodeName of the element\n * @param {Map} attributes The map of attributes.\n * @return {boolean} Whether to include the Dom node in the YXmlElement.\n */\n\n/**\n * Represents a subset of the nodes of a YXmlElement / YXmlFragment and a\n * position within them.\n *\n * Can be created with {@link YXmlFragment#createTreeWalker}\n *\n * @public\n * @implements {Iterable}\n */\nexport class YXmlTreeWalker {\n /**\n * @param {YXmlFragment | YXmlElement} root\n * @param {function(AbstractType):boolean} [f]\n */\n constructor (root, f = () => true) {\n this._filter = f\n this._root = root\n /**\n * @type {Item}\n */\n this._currentNode = /** @type {Item} */ (root._start)\n this._firstCall = true\n root.doc ?? warnPrematureAccess()\n }\n\n [Symbol.iterator] () {\n return this\n }\n\n /**\n * Get the next node.\n *\n * @return {IteratorResult} The next node.\n *\n * @public\n */\n next () {\n /**\n * @type {Item|null}\n */\n let n = this._currentNode\n let type = n && n.content && /** @type {any} */ (n.content).type\n if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { // if first call, we check if we can use the first item\n do {\n type = /** @type {any} */ (n.content).type\n if (!n.deleted && (type.constructor === YXmlElement || type.constructor === YXmlFragment) && type._start !== null) {\n // walk down in the tree\n n = type._start\n } else {\n // walk right or up in the tree\n while (n !== null) {\n if (n.right !== null) {\n n = n.right\n break\n } else if (n.parent === this._root) {\n n = null\n } else {\n n = /** @type {AbstractType} */ (n.parent)._item\n }\n }\n }\n } while (n !== null && (n.deleted || !this._filter(/** @type {ContentType} */ (n.content).type)))\n }\n this._firstCall = false\n if (n === null) {\n // @ts-ignore\n return { value: undefined, done: true }\n }\n this._currentNode = n\n return { value: /** @type {any} */ (n.content).type, done: false }\n }\n}\n\n/**\n * Represents a list of {@link YXmlElement}.and {@link YXmlText} types.\n * A YxmlFragment is similar to a {@link YXmlElement}, but it does not have a\n * nodeName and it does not have attributes. Though it can be bound to a DOM\n * element - in this case the attributes and the nodeName are not shared.\n *\n * @public\n * @extends AbstractType\n */\nexport class YXmlFragment extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array|null}\n */\n this._prelimContent = []\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get firstChild () {\n const first = this._first\n return first ? first.content.getContent()[0] : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n _copy () {\n return new YXmlFragment()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlFragment}\n */\n clone () {\n const el = new YXmlFragment()\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._prelimContent === null ? this._length : this._prelimContent.length\n }\n\n /**\n * Create a subtree of childNodes.\n *\n * @example\n * const walker = elem.createTreeWalker(dom => dom.nodeName === 'div')\n * for (let node in walker) {\n * // `node` is a div node\n * nop(node)\n * }\n *\n * @param {function(AbstractType):boolean} filter Function that is called on each child element and\n * returns a Boolean indicating whether the child\n * is to be included in the subtree.\n * @return {YXmlTreeWalker} A subtree and a position within it.\n *\n * @public\n */\n createTreeWalker (filter) {\n return new YXmlTreeWalker(this, filter)\n }\n\n /**\n * Returns the first YXmlElement that matches the query.\n * Similar to DOM's {@link querySelector}.\n *\n * Query support:\n * - tagname\n * TODO:\n * - id\n * - attribute\n *\n * @param {CSS_Selector} query The query on the children.\n * @return {YXmlElement|YXmlText|YXmlHook|null} The first element that matches the query or null.\n *\n * @public\n */\n querySelector (query) {\n query = query.toUpperCase()\n // @ts-ignore\n const iterator = new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query)\n const next = iterator.next()\n if (next.done) {\n return null\n } else {\n return next.value\n }\n }\n\n /**\n * Returns all YXmlElements that match the query.\n * Similar to Dom's {@link querySelectorAll}.\n *\n * @todo Does not yet support all queries. Currently only query by tagName.\n *\n * @param {CSS_Selector} query The query on the children\n * @return {Array} The elements that match this query.\n *\n * @public\n */\n querySelectorAll (query) {\n query = query.toUpperCase()\n // @ts-ignore\n return array.from(new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query))\n }\n\n /**\n * Creates YXmlEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction))\n }\n\n /**\n * Get the string representation of all the children of this YXmlFragment.\n *\n * @return {string} The string representation of all children.\n */\n toString () {\n return typeListMap(this, xml => xml.toString()).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const fragment = _document.createDocumentFragment()\n if (binding !== undefined) {\n binding._createAssociation(fragment, this)\n }\n typeListForEach(this, xmlType => {\n fragment.insertBefore(xmlType.toDOM(_document, hooks, binding), null)\n })\n return fragment\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {number} index The index to insert content at\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, content)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, 0, ...content)\n }\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {null|Item|YXmlElement|YXmlText} ref The index to insert content at\n * @param {Array} content The array of content\n */\n insertAfter (ref, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const refItem = (ref && ref instanceof AbstractType) ? ref._item : ref\n typeListInsertGenericsAfter(transaction, this, refItem, content)\n })\n } else {\n const pc = /** @type {Array} */ (this._prelimContent)\n const index = ref === null ? 0 : pc.findIndex(el => el === ref) + 1\n if (index === 0 && ref !== null) {\n throw error.create('Reference item not found')\n }\n pc.splice(index, 0, ...content)\n }\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} [length=1] The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, length)\n }\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n */\n push (content) {\n this.insert(this.length, content)\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {YXmlElement|YXmlText}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Returns a portion of this YXmlFragment into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Executes a provided function on once on every child element.\n *\n * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlFragmentRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YXmlFragment}\n *\n * @private\n * @function\n */\nexport const readYXmlFragment = _decoder => new YXmlFragment()\n", "import * as object from 'lib0/object'\n\nimport {\n YXmlFragment,\n transact,\n typeMapDelete,\n typeMapHas,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n typeMapGetAllSnapshot,\n typeListForEach,\n YXmlElementRefID,\n Snapshot, YXmlText, ContentType, AbstractType, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Item // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @typedef {Object|number|null|Array|string|Uint8Array|AbstractType} ValueTypes\n */\n\n/**\n * An YXmlElement imitates the behavior of a\n * https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element\n *\n * * An YXmlElement has attributes (key value pairs)\n * * An YXmlElement has childElements that must inherit from YXmlElement\n *\n * @template {{ [key: string]: ValueTypes }} [KV={ [key: string]: string }]\n */\nexport class YXmlElement extends YXmlFragment {\n constructor (nodeName = 'UNDEFINED') {\n super()\n this.nodeName = nodeName\n /**\n * @type {Map|null}\n */\n this._prelimAttrs = new Map()\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;(/** @type {Map} */ (this._prelimAttrs)).forEach((value, key) => {\n this.setAttribute(key, value)\n })\n this._prelimAttrs = null\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n *\n * @return {YXmlElement}\n */\n _copy () {\n return new YXmlElement(this.nodeName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlElement}\n */\n clone () {\n /**\n * @type {YXmlElement}\n */\n const el = new YXmlElement(this.nodeName)\n const attrs = this.getAttributes()\n object.forEach(attrs, (value, key) => {\n if (typeof value === 'string') {\n el.setAttribute(key, value)\n }\n })\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n /**\n * Returns the XML serialization of this YXmlElement.\n * The attributes are ordered by attribute-name, so you can easily use this\n * method to compare YXmlElements\n *\n * @return {string} The string representation of this type.\n *\n * @public\n */\n toString () {\n const attrs = this.getAttributes()\n const stringBuilder = []\n const keys = []\n for (const key in attrs) {\n keys.push(key)\n }\n keys.sort()\n const keysLen = keys.length\n for (let i = 0; i < keysLen; i++) {\n const key = keys[i]\n stringBuilder.push(key + '=\"' + attrs[key] + '\"')\n }\n const nodeName = this.nodeName.toLocaleLowerCase()\n const attrsString = stringBuilder.length > 0 ? ' ' + stringBuilder.join(' ') : ''\n return `<${nodeName}${attrsString}>${super.toString()}`\n }\n\n /**\n * Removes an attribute from this YXmlElement.\n *\n * @param {string} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).delete(attributeName)\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that is to be set.\n * @param {KV[KEY]} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).set(attributeName, attributeValue)\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that identifies the\n * queried value.\n * @return {KV[KEY]|undefined} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns whether an attribute exists\n *\n * @param {string} attributeName The attribute name to check for existence.\n * @return {boolean} whether the attribute exists.\n *\n * @public\n */\n hasAttribute (attributeName) {\n return /** @type {any} */ (typeMapHas(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @param {Snapshot} [snapshot]\n * @return {{ [Key in Extract]?: KV[Key]}} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes (snapshot) {\n return /** @type {any} */ (snapshot ? typeMapGetAllSnapshot(this, snapshot) : typeMapGetAll(this))\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const dom = _document.createElement(this.nodeName)\n const attrs = this.getAttributes()\n for (const key in attrs) {\n const value = attrs[key]\n if (typeof value === 'string') {\n dom.setAttribute(key, value)\n }\n }\n typeListForEach(this, yxml => {\n dom.appendChild(yxml.toDOM(_document, hooks, binding))\n })\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlElementRefID)\n encoder.writeKey(this.nodeName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlElement}\n *\n * @function\n */\nexport const readYXmlElement = decoder => new YXmlElement(decoder.readKey())\n", "import {\n YEvent,\n YXmlText, YXmlElement, YXmlFragment, Transaction // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @extends YEvent\n * An Event that describes changes on a YXml Element or Yxml Fragment\n */\nexport class YXmlEvent extends YEvent {\n /**\n * @param {YXmlElement|YXmlText|YXmlFragment} target The target on which the event is created.\n * @param {Set} subs The set of changed attributes. `null` is included if the\n * child list changed.\n * @param {Transaction} transaction The transaction instance with wich the\n * change was created.\n */\n constructor (target, subs, transaction) {\n super(target, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.attributesChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.attributesChanged.add(sub)\n }\n })\n }\n}\n", "import {\n YMap,\n YXmlHookRefID,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2 // eslint-disable-line\n} from '../internals.js'\n\n/**\n * You can manage binding to a custom type with YXmlHook.\n *\n * @extends {YMap}\n */\nexport class YXmlHook extends YMap {\n /**\n * @param {string} hookName nodeName of the Dom Node.\n */\n constructor (hookName) {\n super()\n /**\n * @type {string}\n */\n this.hookName = hookName\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n */\n _copy () {\n return new YXmlHook(this.hookName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlHook}\n */\n clone () {\n const el = new YXmlHook(this.hookName)\n this.forEach((value, key) => {\n el.set(key, value)\n })\n return el\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object.} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type\n * @return {Element} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const hook = hooks[this.hookName]\n let dom\n if (hook !== undefined) {\n dom = hook.createDom(this)\n } else {\n dom = document.createElement(this.hookName)\n }\n dom.setAttribute('data-yjs-hook', this.hookName)\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlHookRefID)\n encoder.writeKey(this.hookName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlHook}\n *\n * @private\n * @function\n */\nexport const readYXmlHook = decoder =>\n new YXmlHook(decoder.readKey())\n", "import {\n YText,\n YXmlTextRefID,\n ContentType, YXmlElement, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Represents text in a Dom Element. In the future this type will also handle\n * simple formatting information like bold and italic.\n */\nexport class YXmlText extends YText {\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n _copy () {\n return new YXmlText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlText}\n */\n clone () {\n const text = new YXmlText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlText.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Text} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks, binding) {\n const dom = _document.createTextNode(this.toString())\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n toString () {\n // @ts-ignore\n return this.toDelta().map(delta => {\n const nestedNodes = []\n for (const nodeName in delta.attributes) {\n const attrs = []\n for (const key in delta.attributes[nodeName]) {\n attrs.push({ key, value: delta.attributes[nodeName][key] })\n }\n // sort attributes to get a unique order\n attrs.sort((a, b) => a.key < b.key ? -1 : 1)\n nestedNodes.push({ nodeName, attrs })\n }\n // sort node order to get a unique order\n nestedNodes.sort((a, b) => a.nodeName < b.nodeName ? -1 : 1)\n // now convert to dom string\n let str = ''\n for (let i = 0; i < nestedNodes.length; i++) {\n const node = nestedNodes[i]\n str += `<${node.nodeName}`\n for (let j = 0; j < node.attrs.length; j++) {\n const attr = node.attrs[j]\n str += ` ${attr.key}=\"${attr.value}\"`\n }\n str += '>'\n }\n str += delta.insert\n for (let i = nestedNodes.length - 1; i >= 0; i--) {\n str += ``\n }\n return str\n }).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlText}\n *\n * @private\n * @function\n */\nexport const readYXmlText = decoder => new YXmlText()\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, ID, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class AbstractStruct {\n /**\n * @param {ID} id\n * @param {number} length\n */\n constructor (id, length) {\n this.id = id\n this.length = length\n }\n\n /**\n * @type {boolean}\n */\n get deleted () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Merge this struct with the item to the right.\n * This method is already assuming that `this.id.clock + this.length === this.id.clock`.\n * Also this method does *not* remove right from StructStore!\n * @param {AbstractStruct} right\n * @return {boolean} wether this merged with right\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n * @param {number} encodingRef\n */\n write (encoder, offset, encodingRef) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n addStruct,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nexport const structGCRefNumber = 0\n\n/**\n * @private\n */\nexport class GC extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {GC} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.length -= offset\n }\n addStruct(transaction.doc.store, this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structGCRefNumber)\n encoder.writeLen(this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class ContentBinary {\n /**\n * @param {Uint8Array} content\n */\n constructor (content) {\n this.content = content\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.content]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentBinary}\n */\n copy () {\n return new ContentBinary(this.content)\n }\n\n /**\n * @param {number} offset\n * @return {ContentBinary}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentBinary} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeBuf(this.content)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 3\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentBinary}\n */\nexport const readContentBinary = decoder => new ContentBinary(decoder.readBuf())\n", "import {\n addToDeleteSet,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nexport class ContentDeleted {\n /**\n * @param {number} len\n */\n constructor (len) {\n this.len = len\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.len\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentDeleted}\n */\n copy () {\n return new ContentDeleted(this.len)\n }\n\n /**\n * @param {number} offset\n * @return {ContentDeleted}\n */\n splice (offset) {\n const right = new ContentDeleted(this.len - offset)\n this.len = offset\n return right\n }\n\n /**\n * @param {ContentDeleted} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.len += right.len\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n addToDeleteSet(transaction.deleteSet, item.id.client, item.id.clock, this.len)\n item.markDeleted()\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeLen(this.len - offset)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 1\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentDeleted}\n */\nexport const readContentDeleted = decoder => new ContentDeleted(decoder.readLen())\n", "import {\n Doc, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @param {string} guid\n * @param {Object} opts\n */\nconst createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false })\n\n/**\n * @private\n */\nexport class ContentDoc {\n /**\n * @param {Doc} doc\n */\n constructor (doc) {\n if (doc._item) {\n console.error('This document was already integrated as a sub-document. You should create a second instance instead with the same guid.')\n }\n /**\n * @type {Doc}\n */\n this.doc = doc\n /**\n * @type {any}\n */\n const opts = {}\n this.opts = opts\n if (!doc.gc) {\n opts.gc = false\n }\n if (doc.autoLoad) {\n opts.autoLoad = true\n }\n if (doc.meta !== null) {\n opts.meta = doc.meta\n }\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.doc]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentDoc}\n */\n copy () {\n return new ContentDoc(createDocFromOpts(this.doc.guid, this.opts))\n }\n\n /**\n * @param {number} offset\n * @return {ContentDoc}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentDoc} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n // this needs to be reflected in doc.destroy as well\n this.doc._item = item\n transaction.subdocsAdded.add(this.doc)\n if (this.doc.shouldLoad) {\n transaction.subdocsLoaded.add(this.doc)\n }\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (transaction.subdocsAdded.has(this.doc)) {\n transaction.subdocsAdded.delete(this.doc)\n } else {\n transaction.subdocsRemoved.add(this.doc)\n }\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) { }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(this.doc.guid)\n encoder.writeAny(this.opts)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 9\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentDoc}\n */\nexport const readContentDoc = decoder => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny()))\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentEmbed {\n /**\n * @param {Object} embed\n */\n constructor (embed) {\n this.embed = embed\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.embed]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentEmbed}\n */\n copy () {\n return new ContentEmbed(this.embed)\n }\n\n /**\n * @param {number} offset\n * @return {ContentEmbed}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentEmbed} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeJSON(this.embed)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 5\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentEmbed}\n */\nexport const readContentEmbed = decoder => new ContentEmbed(decoder.readJSON())\n", "import {\n YText, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Item, StructStore, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentFormat {\n /**\n * @param {string} key\n * @param {Object} value\n */\n constructor (key, value) {\n this.key = key\n this.value = value\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentFormat}\n */\n copy () {\n return new ContentFormat(this.key, this.value)\n }\n\n /**\n * @param {number} _offset\n * @return {ContentFormat}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentFormat} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n return false\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} item\n */\n integrate (_transaction, item) {\n // @todo searchmarker are currently unsupported for rich text documents\n const p = /** @type {YText} */ (item.parent)\n p._searchMarker = null\n p._hasFormatting = true\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeKey(this.key)\n encoder.writeJSON(this.value)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 6\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentFormat}\n */\nexport const readContentFormat = decoder => new ContentFormat(decoder.readKey(), decoder.readJSON())\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentJSON {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentJSON}\n */\n copy () {\n return new ContentJSON(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentJSON}\n */\n splice (offset) {\n const right = new ContentJSON(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentJSON} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeString(c === undefined ? 'undefined' : JSON.stringify(c))\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 2\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentJSON}\n */\nexport const readContentJSON = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n const c = decoder.readString()\n if (c === 'undefined') {\n cs.push(undefined)\n } else {\n cs.push(JSON.parse(c))\n }\n }\n return new ContentJSON(cs)\n}\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, UpdateDecoderV1, UpdateDecoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as env from 'lib0/environment'\nimport * as object from 'lib0/object'\n\nconst isDevMode = env.getVariable('node_env') === 'development'\n\nexport class ContentAny {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n isDevMode && object.deepFreeze(arr)\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentAny}\n */\n copy () {\n return new ContentAny(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentAny}\n */\n splice (offset) {\n const right = new ContentAny(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentAny} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeAny(c)\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 8\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentAny}\n */\nexport const readContentAny = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n cs.push(decoder.readAny())\n }\n return new ContentAny(cs)\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentString {\n /**\n * @param {string} str\n */\n constructor (str) {\n /**\n * @type {string}\n */\n this.str = str\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.str.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.str.split('')\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentString}\n */\n copy () {\n return new ContentString(this.str)\n }\n\n /**\n * @param {number} offset\n * @return {ContentString}\n */\n splice (offset) {\n const right = new ContentString(this.str.slice(offset))\n this.str = this.str.slice(0, offset)\n\n // Prevent encoding invalid documents because of splitting of surrogate pairs: https://github.com/yjs/yjs/issues/248\n const firstCharCode = this.str.charCodeAt(offset - 1)\n if (firstCharCode >= 0xD800 && firstCharCode <= 0xDBFF) {\n // Last character of the left split is the start of a surrogate utf16/ucs2 pair.\n // We don't support splitting of surrogate pairs because this may lead to invalid documents.\n // Replace the invalid character with a unicode replacement character (� / U+FFFD)\n this.str = this.str.slice(0, offset - 1) + '�'\n // replace right as well\n right.str = '�' + right.str.slice(1)\n }\n return right\n }\n\n /**\n * @param {ContentString} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.str += right.str\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(offset === 0 ? this.str : this.str.slice(offset))\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 4\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentString}\n */\nexport const readContentString = decoder => new ContentString(decoder.readString())\n", "import {\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item, YEvent, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @type {Array>}\n * @private\n */\nexport const typeRefs = [\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText\n]\n\nexport const YArrayRefID = 0\nexport const YMapRefID = 1\nexport const YTextRefID = 2\nexport const YXmlElementRefID = 3\nexport const YXmlFragmentRefID = 4\nexport const YXmlHookRefID = 5\nexport const YXmlTextRefID = 6\n\n/**\n * @private\n */\nexport class ContentType {\n /**\n * @param {AbstractType} type\n */\n constructor (type) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.type]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentType}\n */\n copy () {\n return new ContentType(this.type._copy())\n }\n\n /**\n * @param {number} offset\n * @return {ContentType}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentType} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n this.type._integrate(transaction.doc, item)\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n let item = this.type._start\n while (item !== null) {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // This will be gc'd later and we want to merge it if possible\n // We try to merge all deleted items after each transaction,\n // but we have no knowledge about that this needs to be merged\n // since it is not in transaction.ds. Hence we add it to transaction._mergeStructs\n transaction._mergeStructs.push(item)\n }\n item = item.right\n }\n this.type._map.forEach(item => {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // same as above\n transaction._mergeStructs.push(item)\n }\n })\n transaction.changed.delete(this.type)\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) {\n let item = this.type._start\n while (item !== null) {\n item.gc(store, true)\n item = item.right\n }\n this.type._start = null\n this.type._map.forEach(/** @param {Item | null} item */ (item) => {\n while (item !== null) {\n item.gc(store, true)\n item = item.left\n }\n })\n this.type._map = new Map()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n this.type._write(encoder)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 7\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentType}\n */\nexport const readContentType = decoder => new ContentType(typeRefs[decoder.readTypeRef()](decoder))\n", "import {\n GC,\n getState,\n AbstractStruct,\n replaceStruct,\n addStruct,\n addToDeleteSet,\n findRootTypeKey,\n compareIDs,\n getItem,\n getItemCleanEnd,\n getItemCleanStart,\n readContentDeleted,\n readContentBinary,\n readContentJSON,\n readContentAny,\n readContentString,\n readContentEmbed,\n readContentDoc,\n createID,\n readContentFormat,\n readContentType,\n addChangedTypeToTransaction,\n isDeleted,\n StackItem, DeleteSet, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ContentType, ContentDeleted, StructStore, ID, AbstractType, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as binary from 'lib0/binary'\nimport * as array from 'lib0/array'\n\n/**\n * @todo This should return several items\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {{item:Item, diff:number}}\n */\nexport const followRedone = (store, id) => {\n /**\n * @type {ID|null}\n */\n let nextID = id\n let diff = 0\n let item\n do {\n if (diff > 0) {\n nextID = createID(nextID.client, nextID.clock + diff)\n }\n item = getItem(store, nextID)\n diff = nextID.clock - item.id.clock\n nextID = item.redone\n } while (nextID !== null && item instanceof Item)\n return {\n item, diff\n }\n}\n\n/**\n * Make sure that neither item nor any of its parents is ever deleted.\n *\n * This property does not persist when storing it into a database or when\n * sending it to other peers\n *\n * @param {Item|null} item\n * @param {boolean} keep\n */\nexport const keepItem = (item, keep) => {\n while (item !== null && item.keep !== keep) {\n item.keep = keep\n item = /** @type {AbstractType} */ (item.parent)._item\n }\n}\n\n/**\n * Split leftItem into two items\n * @param {Transaction} transaction\n * @param {Item} leftItem\n * @param {number} diff\n * @return {Item}\n *\n * @function\n * @private\n */\nexport const splitItem = (transaction, leftItem, diff) => {\n // create rightItem\n const { client, clock } = leftItem.id\n const rightItem = new Item(\n createID(client, clock + diff),\n leftItem,\n createID(client, clock + diff - 1),\n leftItem.right,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n if (leftItem.deleted) {\n rightItem.markDeleted()\n }\n if (leftItem.keep) {\n rightItem.keep = true\n }\n if (leftItem.redone !== null) {\n rightItem.redone = createID(leftItem.redone.client, leftItem.redone.clock + diff)\n }\n // update left (do not set leftItem.rightOrigin as it will lead to problems when syncing)\n leftItem.right = rightItem\n // update right\n if (rightItem.right !== null) {\n rightItem.right.left = rightItem\n }\n // right is more specific.\n transaction._mergeStructs.push(rightItem)\n // update parent._map\n if (rightItem.parentSub !== null && rightItem.right === null) {\n /** @type {AbstractType} */ (rightItem.parent)._map.set(rightItem.parentSub, rightItem)\n }\n leftItem.length = diff\n return rightItem\n}\n\n/**\n * @param {Array} stack\n * @param {ID} id\n */\nconst isDeletedByUndoStack = (stack, id) => array.some(stack, /** @param {StackItem} s */ s => isDeleted(s.deletions, id))\n\n/**\n * Redoes the effect of this operation.\n *\n * @param {Transaction} transaction The Yjs instance.\n * @param {Item} item\n * @param {Set} redoitems\n * @param {DeleteSet} itemsToDelete\n * @param {boolean} ignoreRemoteMapChanges\n * @param {import('../utils/UndoManager.js').UndoManager} um\n *\n * @return {Item|null}\n *\n * @private\n */\nexport const redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => {\n const doc = transaction.doc\n const store = doc.store\n const ownClientID = doc.clientID\n const redone = item.redone\n if (redone !== null) {\n return getItemCleanStart(transaction, redone)\n }\n let parentItem = /** @type {AbstractType} */ (item.parent)._item\n /**\n * @type {Item|null}\n */\n let left = null\n /**\n * @type {Item|null}\n */\n let right\n // make sure that parent is redone\n if (parentItem !== null && parentItem.deleted === true) {\n // try to undo parent if it will be undone anyway\n if (parentItem.redone === null && (!redoitems.has(parentItem) || redoItem(transaction, parentItem, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) === null)) {\n return null\n }\n while (parentItem.redone !== null) {\n parentItem = getItemCleanStart(transaction, parentItem.redone)\n }\n }\n const parentType = parentItem === null ? /** @type {AbstractType} */ (item.parent) : /** @type {ContentType} */ (parentItem.content).type\n\n if (item.parentSub === null) {\n // Is an array item. Insert at the old position\n left = item.left\n right = item\n // find next cloned_redo items\n while (left !== null) {\n /**\n * @type {Item|null}\n */\n let leftTrace = left\n // trace redone until parent matches\n while (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item !== parentItem) {\n leftTrace = leftTrace.redone === null ? null : getItemCleanStart(transaction, leftTrace.redone)\n }\n if (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item === parentItem) {\n left = leftTrace\n break\n }\n left = left.left\n }\n while (right !== null) {\n /**\n * @type {Item|null}\n */\n let rightTrace = right\n // trace redone until parent matches\n while (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item !== parentItem) {\n rightTrace = rightTrace.redone === null ? null : getItemCleanStart(transaction, rightTrace.redone)\n }\n if (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item === parentItem) {\n right = rightTrace\n break\n }\n right = right.right\n }\n } else {\n right = null\n if (item.right && !ignoreRemoteMapChanges) {\n left = item\n // Iterate right while right is in itemsToDelete\n // If it is intended to delete right while item is redone, we can expect that item should replace right.\n while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) {\n left = left.right\n // follow redone\n while (left.redone) left = getItemCleanStart(transaction, left.redone)\n }\n if (left && left.right !== null) {\n // It is not possible to redo this item because it conflicts with a\n // change from another client\n return null\n }\n } else {\n left = parentType._map.get(item.parentSub) || null\n }\n }\n const nextClock = getState(store, ownClientID)\n const nextId = createID(ownClientID, nextClock)\n const redoneItem = new Item(\n nextId,\n left, left && left.lastId,\n right, right && right.id,\n parentType,\n item.parentSub,\n item.content.copy()\n )\n item.redone = nextId\n keepItem(redoneItem, true)\n redoneItem.integrate(transaction, 0)\n return redoneItem\n}\n\n/**\n * Abstract class that represents any content.\n */\nexport class Item extends AbstractStruct {\n /**\n * @param {ID} id\n * @param {Item | null} left\n * @param {ID | null} origin\n * @param {Item | null} right\n * @param {ID | null} rightOrigin\n * @param {AbstractType|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it.\n * @param {string | null} parentSub\n * @param {AbstractContent} content\n */\n constructor (id, left, origin, right, rightOrigin, parent, parentSub, content) {\n super(id, content.getLength())\n /**\n * The item that was originally to the left of this item.\n * @type {ID | null}\n */\n this.origin = origin\n /**\n * The item that is currently to the left of this item.\n * @type {Item | null}\n */\n this.left = left\n /**\n * The item that is currently to the right of this item.\n * @type {Item | null}\n */\n this.right = right\n /**\n * The item that was originally to the right of this item.\n * @type {ID | null}\n */\n this.rightOrigin = rightOrigin\n /**\n * @type {AbstractType|ID|null}\n */\n this.parent = parent\n /**\n * If the parent refers to this item with some kind of key (e.g. YMap, the\n * key is specified here. The key is then used to refer to the list in which\n * to insert this item. If `parentSub = null` type._start is the list in\n * which to insert to. Otherwise it is `parent._map`.\n * @type {String | null}\n */\n this.parentSub = parentSub\n /**\n * If this type's effect is redone this type refers to the type that undid\n * this operation.\n * @type {ID | null}\n */\n this.redone = null\n /**\n * @type {AbstractContent}\n */\n this.content = content\n /**\n * bit1: keep\n * bit2: countable\n * bit3: deleted\n * bit4: mark - mark node as fast-search-marker\n * @type {number} byte\n */\n this.info = this.content.isCountable() ? binary.BIT2 : 0\n }\n\n /**\n * This is used to mark the item as an indexed fast-search marker\n *\n * @type {boolean}\n */\n set marker (isMarked) {\n if (((this.info & binary.BIT4) > 0) !== isMarked) {\n this.info ^= binary.BIT4\n }\n }\n\n get marker () {\n return (this.info & binary.BIT4) > 0\n }\n\n /**\n * If true, do not garbage collect this Item.\n */\n get keep () {\n return (this.info & binary.BIT1) > 0\n }\n\n set keep (doKeep) {\n if (this.keep !== doKeep) {\n this.info ^= binary.BIT1\n }\n }\n\n get countable () {\n return (this.info & binary.BIT2) > 0\n }\n\n /**\n * Whether this item was deleted or not.\n * @type {Boolean}\n */\n get deleted () {\n return (this.info & binary.BIT3) > 0\n }\n\n set deleted (doDelete) {\n if (this.deleted !== doDelete) {\n this.info ^= binary.BIT3\n }\n }\n\n markDeleted () {\n this.info |= binary.BIT3\n }\n\n /**\n * Return the creator clientID of the missing op or define missing items and return null.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= getState(store, this.origin.client)) {\n return this.origin.client\n }\n if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= getState(store, this.rightOrigin.client)) {\n return this.rightOrigin.client\n }\n if (this.parent && this.parent.constructor === ID && this.id.client !== this.parent.client && this.parent.clock >= getState(store, this.parent.client)) {\n return this.parent.client\n }\n\n // We have all missing ids, now find the items\n\n if (this.origin) {\n this.left = getItemCleanEnd(transaction, store, this.origin)\n this.origin = this.left.lastId\n }\n if (this.rightOrigin) {\n this.right = getItemCleanStart(transaction, this.rightOrigin)\n this.rightOrigin = this.right.id\n }\n if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) {\n this.parent = null\n } else if (!this.parent) {\n // only set parent if this shouldn't be garbage collected\n if (this.left && this.left.constructor === Item) {\n this.parent = this.left.parent\n this.parentSub = this.left.parentSub\n }\n if (this.right && this.right.constructor === Item) {\n this.parent = this.right.parent\n this.parentSub = this.right.parentSub\n }\n } else if (this.parent.constructor === ID) {\n const parentItem = getItem(store, this.parent)\n if (parentItem.constructor === GC) {\n this.parent = null\n } else {\n this.parent = /** @type {ContentType} */ (parentItem.content).type\n }\n }\n return null\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.left = getItemCleanEnd(transaction, transaction.doc.store, createID(this.id.client, this.id.clock - 1))\n this.origin = this.left.lastId\n this.content = this.content.splice(offset)\n this.length -= offset\n }\n\n if (this.parent) {\n if ((!this.left && (!this.right || this.right.left !== null)) || (this.left && this.left.right !== this.right)) {\n /**\n * @type {Item|null}\n */\n let left = this.left\n\n /**\n * @type {Item|null}\n */\n let o\n // set o to the first conflicting item\n if (left !== null) {\n o = left.right\n } else if (this.parentSub !== null) {\n o = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (o !== null && o.left !== null) {\n o = o.left\n }\n } else {\n o = /** @type {AbstractType} */ (this.parent)._start\n }\n // TODO: use something like DeleteSet here (a tree implementation would be best)\n // @todo use global set definitions\n /**\n * @type {Set}\n */\n const conflictingItems = new Set()\n /**\n * @type {Set}\n */\n const itemsBeforeOrigin = new Set()\n // Let c in conflictingItems, b in itemsBeforeOrigin\n // ***{origin}bbbb{this}{c,b}{c,b}{o}***\n // Note that conflictingItems is a subset of itemsBeforeOrigin\n while (o !== null && o !== this.right) {\n itemsBeforeOrigin.add(o)\n conflictingItems.add(o)\n if (compareIDs(this.origin, o.origin)) {\n // case 1\n if (o.id.client < this.id.client) {\n left = o\n conflictingItems.clear()\n } else if (compareIDs(this.rightOrigin, o.rightOrigin)) {\n // this and o are conflicting and point to the same integration points. The id decides which item comes first.\n // Since this is to the left of o, we can break here\n break\n } // else, o might be integrated before an item that this conflicts with. If so, we will find it in the next iterations\n } else if (o.origin !== null && itemsBeforeOrigin.has(getItem(transaction.doc.store, o.origin))) { // use getItem instead of getItemCleanEnd because we don't want / need to split items.\n // case 2\n if (!conflictingItems.has(getItem(transaction.doc.store, o.origin))) {\n left = o\n conflictingItems.clear()\n }\n } else {\n break\n }\n o = o.right\n }\n this.left = left\n }\n // reconnect left/right + update parent map/start if necessary\n if (this.left !== null) {\n const right = this.left.right\n this.right = right\n this.left.right = this\n } else {\n let r\n if (this.parentSub !== null) {\n r = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (r !== null && r.left !== null) {\n r = r.left\n }\n } else {\n r = /** @type {AbstractType} */ (this.parent)._start\n ;/** @type {AbstractType} */ (this.parent)._start = this\n }\n this.right = r\n }\n if (this.right !== null) {\n this.right.left = this\n } else if (this.parentSub !== null) {\n // set as current parent value if right === null and this is parentSub\n /** @type {AbstractType} */ (this.parent)._map.set(this.parentSub, this)\n if (this.left !== null) {\n // this is the current attribute value of parent. delete right\n this.left.delete(transaction)\n }\n }\n // adjust length of parent\n if (this.parentSub === null && this.countable && !this.deleted) {\n /** @type {AbstractType} */ (this.parent)._length += this.length\n }\n addStruct(transaction.doc.store, this)\n this.content.integrate(transaction, this)\n // add parent to transaction.changed\n addChangedTypeToTransaction(transaction, /** @type {AbstractType} */ (this.parent), this.parentSub)\n if ((/** @type {AbstractType} */ (this.parent)._item !== null && /** @type {AbstractType} */ (this.parent)._item.deleted) || (this.parentSub !== null && this.right !== null)) {\n // delete if parent is deleted or if this is not the current attribute value of parent\n this.delete(transaction)\n }\n } else {\n // parent is not defined. Integrate GC struct instead\n new GC(this.id, this.length).integrate(transaction, 0)\n }\n }\n\n /**\n * Returns the next non-deleted item\n */\n get next () {\n let n = this.right\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Returns the previous non-deleted item\n */\n get prev () {\n let n = this.left\n while (n !== null && n.deleted) {\n n = n.left\n }\n return n\n }\n\n /**\n * Computes the last content address of this Item.\n */\n get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }\n\n /**\n * Try to merge two items\n *\n * @param {Item} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (\n this.constructor === right.constructor &&\n compareIDs(right.origin, this.lastId) &&\n this.right === right &&\n compareIDs(this.rightOrigin, right.rightOrigin) &&\n this.id.client === right.id.client &&\n this.id.clock + this.length === right.id.clock &&\n this.deleted === right.deleted &&\n this.redone === null &&\n right.redone === null &&\n this.content.constructor === right.content.constructor &&\n this.content.mergeWith(right.content)\n ) {\n const searchMarker = /** @type {AbstractType} */ (this.parent)._searchMarker\n if (searchMarker) {\n searchMarker.forEach(marker => {\n if (marker.p === right) {\n // right is going to be \"forgotten\" so we need to update the marker\n marker.p = this\n // adjust marker index\n if (!this.deleted && this.countable) {\n marker.index -= this.length\n }\n }\n })\n }\n if (right.keep) {\n this.keep = true\n }\n this.right = right.right\n if (this.right !== null) {\n this.right.left = this\n }\n this.length += right.length\n return true\n }\n return false\n }\n\n /**\n * Mark this Item as deleted.\n *\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (!this.deleted) {\n const parent = /** @type {AbstractType} */ (this.parent)\n // adjust the length of parent\n if (this.countable && this.parentSub === null) {\n parent._length -= this.length\n }\n this.markDeleted()\n addToDeleteSet(transaction.deleteSet, this.id.client, this.id.clock, this.length)\n addChangedTypeToTransaction(transaction, parent, this.parentSub)\n this.content.delete(transaction)\n }\n }\n\n /**\n * @param {StructStore} store\n * @param {boolean} parentGCd\n */\n gc (store, parentGCd) {\n if (!this.deleted) {\n throw error.unexpectedCase()\n }\n this.content.gc(store)\n if (parentGCd) {\n replaceStruct(store, this, new GC(this.id, this.length))\n } else {\n this.content = new ContentDeleted(this.length)\n }\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n */\n write (encoder, offset) {\n const origin = offset > 0 ? createID(this.id.client, this.id.clock + offset - 1) : this.origin\n const rightOrigin = this.rightOrigin\n const parentSub = this.parentSub\n const info = (this.content.getRef() & binary.BITS5) |\n (origin === null ? 0 : binary.BIT8) | // origin is defined\n (rightOrigin === null ? 0 : binary.BIT7) | // right origin is defined\n (parentSub === null ? 0 : binary.BIT6) // parentSub is non-null\n encoder.writeInfo(info)\n if (origin !== null) {\n encoder.writeLeftID(origin)\n }\n if (rightOrigin !== null) {\n encoder.writeRightID(rightOrigin)\n }\n if (origin === null && rightOrigin === null) {\n const parent = /** @type {AbstractType} */ (this.parent)\n if (parent._item !== undefined) {\n const parentItem = parent._item\n if (parentItem === null) {\n // parent type on y._map\n // find the correct key\n const ykey = findRootTypeKey(parent)\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(ykey)\n } else {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parentItem.id)\n }\n } else if (parent.constructor === String) { // this edge case was added by differential updates\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(parent)\n } else if (parent.constructor === ID) {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parent)\n } else {\n error.unexpectedCase()\n }\n if (parentSub !== null) {\n encoder.writeString(parentSub)\n }\n }\n this.content.write(encoder, offset)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {number} info\n */\nexport const readItemContent = (decoder, info) => contentRefs[info & binary.BITS5](decoder)\n\n/**\n * A lookup map for reading Item content.\n *\n * @type {Array}\n */\nexport const contentRefs = [\n () => { error.unexpectedCase() }, // GC is not ItemContent\n readContentDeleted, // 1\n readContentJSON, // 2\n readContentBinary, // 3\n readContentString, // 4\n readContentEmbed, // 5\n readContentFormat, // 6\n readContentType, // 7\n readContentAny, // 8\n readContentDoc, // 9\n () => { error.unexpectedCase() } // 10 - Skip is not ItemContent\n]\n\n/**\n * Do not implement this class!\n */\nexport class AbstractContent {\n /**\n * @return {number}\n */\n getLength () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Should return false if this Item is some kind of meta information\n * (e.g. format information).\n *\n * * Whether this Item should be addressable via `yarray.get(i)`\n * * Whether this Item should be counted when computing yarray.length\n *\n * @return {boolean}\n */\n isCountable () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {AbstractContent}\n */\n copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {number} _offset\n * @return {AbstractContent}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {AbstractContent} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} _item\n */\n integrate (_transaction, _item) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n */\n delete (_transaction) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {StructStore} _store\n */\n gc (_store) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n * @param {number} _offset\n */\n write (_encoder, _offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {number}\n */\n getRef () {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\nimport * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nexport const structSkipRefNumber = 10\n\n/**\n * @private\n */\nexport class Skip extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {Skip} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n // skip structs cannot be integrated\n error.unexpectedCase()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structSkipRefNumber)\n // write as VarUint because Skips can't make use of predictable length-encoding\n encoding.writeVarUint(encoder.restEncoder, this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "/** eslint-env browser */\n\nexport {\n Doc,\n Transaction,\n YArray as Array,\n YMap as Map,\n YText as Text,\n YXmlText as XmlText,\n YXmlHook as XmlHook,\n YXmlElement as XmlElement,\n YXmlFragment as XmlFragment,\n YXmlEvent,\n YMapEvent,\n YArrayEvent,\n YTextEvent,\n YEvent,\n Item,\n AbstractStruct,\n GC,\n Skip,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentAny,\n ContentString,\n ContentType,\n AbstractType,\n getTypeChildren,\n createRelativePositionFromTypeIndex,\n createRelativePositionFromJSON,\n createAbsolutePositionFromRelativePosition,\n compareRelativePositions,\n AbsolutePosition,\n RelativePosition,\n ID,\n createID,\n compareIDs,\n getState,\n Snapshot,\n createSnapshot,\n createDeleteSet,\n createDeleteSetFromStructStore,\n cleanupYTextFormatting,\n snapshot,\n emptySnapshot,\n findRootTypeKey,\n findIndexSS,\n getItem,\n typeListToArraySnapshot,\n typeMapGetSnapshot,\n typeMapGetAllSnapshot,\n createDocFromSnapshot,\n iterateDeletedStructs,\n applyUpdate,\n applyUpdateV2,\n readUpdate,\n readUpdateV2,\n encodeStateAsUpdate,\n encodeStateAsUpdateV2,\n encodeStateVector,\n UndoManager,\n decodeSnapshot,\n encodeSnapshot,\n decodeSnapshotV2,\n encodeSnapshotV2,\n decodeStateVector,\n logUpdate,\n logUpdateV2,\n decodeUpdate,\n decodeUpdateV2,\n relativePositionToJSON,\n isDeleted,\n isParentOf,\n equalSnapshots,\n PermanentUserData, // @TODO experimental\n tryGc,\n transact,\n AbstractConnector,\n logType,\n mergeUpdates,\n mergeUpdatesV2,\n parseUpdateMeta,\n parseUpdateMetaV2,\n encodeStateVectorFromUpdate,\n encodeStateVectorFromUpdateV2,\n encodeRelativePosition,\n decodeRelativePosition,\n diffUpdate,\n diffUpdateV2,\n convertUpdateFormatV1ToV2,\n convertUpdateFormatV2ToV1,\n obfuscateUpdate,\n obfuscateUpdateV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n UpdateDecoderV1,\n UpdateDecoderV2,\n equalDeleteSets,\n mergeDeleteSets,\n snapshotContainsUpdate\n} from './internals.js'\n\nconst glo = /** @type {any} */ (typeof globalThis !== 'undefined'\n ? globalThis\n : typeof window !== 'undefined'\n ? window\n // @ts-ignore\n : typeof global !== 'undefined' ? global : {})\n\nconst importIdentifier = '__ $YJS$ __'\n\nif (glo[importIdentifier] === true) {\n /**\n * Dear reader of this message. Please take this seriously.\n *\n * If you see this message, make sure that you only import one version of Yjs. In many cases,\n * your package manager installs two versions of Yjs that are used by different packages within your project.\n * Another reason for this message is that some parts of your project use the commonjs version of Yjs\n * and others use the EcmaScript version of Yjs.\n *\n * This often leads to issues that are hard to debug. We often need to perform constructor checks,\n * e.g. `struct instanceof GC`. If you imported different versions of Yjs, it is impossible for us to\n * do the constructor checks anymore - which might break the CRDT algorithm.\n *\n * https://github.com/yjs/yjs/issues/438\n */\n console.error('Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438')\n}\nglo[importIdentifier] = true\n", "/**\n * @module awareness-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as time from 'lib0/time'\nimport * as math from 'lib0/math'\nimport { Observable } from 'lib0/observable'\nimport * as f from 'lib0/function'\nimport * as Y from 'yjs' // eslint-disable-line\n\nexport const outdatedTimeout = 30000\n\n/**\n * @typedef {Object} MetaClientState\n * @property {number} MetaClientState.clock\n * @property {number} MetaClientState.lastUpdated unix timestamp\n */\n\n/**\n * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information\n * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of\n * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.\n *\n * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override\n * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is\n * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that\n * a remote client is offline, it may propagate a message with\n * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a\n * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.\n *\n * Before a client disconnects, it should propagate a `null` state with an updated clock.\n *\n * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.\n *\n * @extends {Observable}\n */\nexport class Awareness extends Observable {\n /**\n * @param {Y.Doc} doc\n */\n constructor (doc) {\n super()\n this.doc = doc\n /**\n * @type {number}\n */\n this.clientID = doc.clientID\n /**\n * Maps from client id to client state\n * @type {Map>}\n */\n this.states = new Map()\n /**\n * @type {Map}\n */\n this.meta = new Map()\n this._checkInterval = /** @type {any} */ (setInterval(() => {\n const now = time.getUnixTime()\n if (this.getLocalState() !== null && (outdatedTimeout / 2 <= now - /** @type {{lastUpdated:number}} */ (this.meta.get(this.clientID)).lastUpdated)) {\n // renew local clock\n this.setLocalState(this.getLocalState())\n }\n /**\n * @type {Array}\n */\n const remove = []\n this.meta.forEach((meta, clientid) => {\n if (clientid !== this.clientID && outdatedTimeout <= now - meta.lastUpdated && this.states.has(clientid)) {\n remove.push(clientid)\n }\n })\n if (remove.length > 0) {\n removeAwarenessStates(this, remove, 'timeout')\n }\n }, math.floor(outdatedTimeout / 10)))\n doc.on('destroy', () => {\n this.destroy()\n })\n this.setLocalState({})\n }\n\n destroy () {\n this.emit('destroy', [this])\n this.setLocalState(null)\n super.destroy()\n clearInterval(this._checkInterval)\n }\n\n /**\n * @return {Object|null}\n */\n getLocalState () {\n return this.states.get(this.clientID) || null\n }\n\n /**\n * @param {Object|null} state\n */\n setLocalState (state) {\n const clientID = this.clientID\n const currLocalMeta = this.meta.get(clientID)\n const clock = currLocalMeta === undefined ? 0 : currLocalMeta.clock + 1\n const prevState = this.states.get(clientID)\n if (state === null) {\n this.states.delete(clientID)\n } else {\n this.states.set(clientID, state)\n }\n this.meta.set(clientID, {\n clock,\n lastUpdated: time.getUnixTime()\n })\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n if (state === null) {\n removed.push(clientID)\n } else if (prevState == null) {\n if (state != null) {\n added.push(clientID)\n }\n } else {\n updated.push(clientID)\n if (!f.equalityDeep(prevState, state)) {\n filteredUpdated.push(clientID)\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n this.emit('change', [{ added, updated: filteredUpdated, removed }, 'local'])\n }\n this.emit('update', [{ added, updated, removed }, 'local'])\n }\n\n /**\n * @param {string} field\n * @param {any} value\n */\n setLocalStateField (field, value) {\n const state = this.getLocalState()\n if (state !== null) {\n this.setLocalState({\n ...state,\n [field]: value\n })\n }\n }\n\n /**\n * @return {Map>}\n */\n getStates () {\n return this.states\n }\n}\n\n/**\n * Mark (remote) clients as inactive and remove them from the list of active peers.\n * This change will be propagated to remote clients.\n *\n * @param {Awareness} awareness\n * @param {Array} clients\n * @param {any} origin\n */\nexport const removeAwarenessStates = (awareness, clients, origin) => {\n const removed = []\n for (let i = 0; i < clients.length; i++) {\n const clientID = clients[i]\n if (awareness.states.has(clientID)) {\n awareness.states.delete(clientID)\n if (clientID === awareness.clientID) {\n const curMeta = /** @type {MetaClientState} */ (awareness.meta.get(clientID))\n awareness.meta.set(clientID, {\n clock: curMeta.clock + 1,\n lastUpdated: time.getUnixTime()\n })\n }\n removed.push(clientID)\n }\n }\n if (removed.length > 0) {\n awareness.emit('change', [{ added: [], updated: [], removed }, origin])\n awareness.emit('update', [{ added: [], updated: [], removed }, origin])\n }\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Array} clients\n * @return {Uint8Array}\n */\nexport const encodeAwarenessUpdate = (awareness, clients, states = awareness.states) => {\n const len = clients.length\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = clients[i]\n const state = states.get(clientID) || null\n const clock = /** @type {MetaClientState} */ (awareness.meta.get(clientID)).clock\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(state))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * Modify the content of an awareness update before re-encoding it to an awareness update.\n *\n * This might be useful when you have a central server that wants to ensure that clients\n * cant hijack somebody elses identity.\n *\n * @param {Uint8Array} update\n * @param {function(any):any} modify\n * @return {Uint8Array}\n */\nexport const modifyAwarenessUpdate = (update, modify) => {\n const decoder = decoding.createDecoder(update)\n const encoder = encoding.createEncoder()\n const len = decoding.readVarUint(decoder)\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n const clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const modifiedState = modify(state)\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(modifiedState))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Uint8Array} update\n * @param {any} origin This will be added to the emitted change event\n */\nexport const applyAwarenessUpdate = (awareness, update, origin) => {\n const decoder = decoding.createDecoder(update)\n const timestamp = time.getUnixTime()\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n const len = decoding.readVarUint(decoder)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n let clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const clientMeta = awareness.meta.get(clientID)\n const prevState = awareness.states.get(clientID)\n const currClock = clientMeta === undefined ? 0 : clientMeta.clock\n if (currClock < clock || (currClock === clock && state === null && awareness.states.has(clientID))) {\n if (state === null) {\n // never let a remote client remove this local state\n if (clientID === awareness.clientID && awareness.getLocalState() != null) {\n // remote client removed the local state. Do not remote state. Broadcast a message indicating\n // that this client still exists by increasing the clock\n clock++\n } else {\n awareness.states.delete(clientID)\n }\n } else {\n awareness.states.set(clientID, state)\n }\n awareness.meta.set(clientID, {\n clock,\n lastUpdated: timestamp\n })\n if (clientMeta === undefined && state !== null) {\n added.push(clientID)\n } else if (clientMeta !== undefined && state === null) {\n removed.push(clientID)\n } else if (state !== null) {\n if (!f.equalityDeep(state, prevState)) {\n filteredUpdated.push(clientID)\n }\n updated.push(clientID)\n }\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n awareness.emit('change', [{\n added, updated: filteredUpdated, removed\n }, origin])\n }\n if (added.length > 0 || updated.length > 0 || removed.length > 0) {\n awareness.emit('update', [{\n added, updated, removed\n }, origin])\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers to work with IndexedDB.\n *\n * @module indexeddb\n */\n\nimport * as promise from './promise.js'\nimport * as error from './error.js'\n\n/* c8 ignore start */\n\n/**\n * IDB Request to Promise transformer\n *\n * @param {IDBRequest} request\n * @return {Promise}\n */\nexport const rtop = request => promise.create((resolve, reject) => {\n // @ts-ignore\n request.onerror = event => reject(new Error(event.target.error))\n // @ts-ignore\n request.onsuccess = event => resolve(event.target.result)\n})\n\n/**\n * @param {string} name\n * @param {function(IDBDatabase):any} initDB Called when the database is first created\n * @return {Promise}\n */\nexport const openDB = (name, initDB) => promise.create((resolve, reject) => {\n const request = indexedDB.open(name)\n /**\n * @param {any} event\n */\n request.onupgradeneeded = event => initDB(event.target.result)\n /**\n * @param {any} event\n */\n request.onerror = event => reject(error.create(event.target.error))\n /**\n * @param {any} event\n */\n request.onsuccess = event => {\n /**\n * @type {IDBDatabase}\n */\n const db = event.target.result\n db.onversionchange = () => { db.close() }\n resolve(db)\n }\n})\n\n/**\n * @param {string} name\n */\nexport const deleteDB = name => rtop(indexedDB.deleteDatabase(name))\n\n/**\n * @param {IDBDatabase} db\n * @param {Array|Array>} definitions\n */\nexport const createStores = (db, definitions) => definitions.forEach(d =>\n // @ts-ignore\n db.createObjectStore.apply(db, d)\n)\n\n/**\n * @param {IDBDatabase} db\n * @param {Array} stores\n * @param {\"readwrite\"|\"readonly\"} [access]\n * @return {Array}\n */\nexport const transact = (db, stores, access = 'readwrite') => {\n const transaction = db.transaction(stores, access)\n return stores.map(store => getStore(transaction, store))\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @return {Promise}\n */\nexport const count = (store, range) =>\n rtop(store.count(range))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | Array } key\n * @return {Promise>}\n */\nexport const get = (store, key) =>\n rtop(store.get(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | IDBKeyRange | Array } key\n */\nexport const del = (store, key) =>\n rtop(store.delete(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} [key]\n */\nexport const put = (store, item, key) =>\n rtop(store.put(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} key\n * @return {Promise}\n */\nexport const add = (store, item, key) =>\n rtop(store.add(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date} item\n * @return {Promise} Returns the generated key\n */\nexport const addAutoKey = (store, item) =>\n rtop(store.add(item))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAll = (store, range, limit) =>\n rtop(store.getAll(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeys = (store, range, limit) =>\n rtop(store.getAllKeys(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} query\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n * @return {Promise}\n */\nexport const queryFirst = (store, query, direction) => {\n /**\n * @type {any}\n */\n let first = null\n return iterateKeys(store, query, key => {\n first = key\n return false\n }, direction).then(() => first)\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getLastKey = (store, range = null) => queryFirst(store, range, 'prev')\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getFirstKey = (store, range = null) => queryFirst(store, range, 'next')\n\n/**\n * @typedef KeyValuePair\n * @type {Object}\n * @property {any} k key\n * @property {any} v Value\n */\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeysValues = (store, range, limit) =>\n // @ts-ignore\n promise.all([getAllKeys(store, range, limit), getAll(store, range, limit)]).then(([ks, vs]) => ks.map((k, i) => ({ k, v: vs[i] })))\n\n/**\n * @param {any} request\n * @param {function(IDBCursorWithValue):void|boolean|Promise} f\n * @return {Promise}\n */\nconst iterateOnRequest = (request, f) => promise.create((resolve, reject) => {\n request.onerror = reject\n /**\n * @param {any} event\n */\n request.onsuccess = async event => {\n const cursor = event.target.result\n if (cursor === null || (await f(cursor)) === false) {\n return resolve()\n }\n cursor.continue()\n }\n})\n\n/**\n * Iterate on keys and values\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any,any):void|boolean|Promise} f Callback that receives (value, key)\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterate = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openCursor(keyrange, direction), cursor => f(cursor.value, cursor.key))\n\n/**\n * Iterate on the keys (no values)\n *\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any):void|boolean|Promise} f callback that receives the key\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterateKeys = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openKeyCursor(keyrange, direction), cursor => f(cursor.key))\n\n/**\n * Open store from transaction\n * @param {IDBTransaction} t\n * @param {String} store\n * @returns {IDBObjectStore}\n */\nexport const getStore = (t, store) => t.objectStore(store)\n\n/**\n * @param {any} lower\n * @param {any} upper\n * @param {boolean} lowerOpen\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeBound = (lower, upper, lowerOpen, upperOpen) => IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen)\n\n/**\n * @param {any} upper\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeUpperBound = (upper, upperOpen) => IDBKeyRange.upperBound(upper, upperOpen)\n\n/**\n * @param {any} lower\n * @param {boolean} lowerOpen\n */\nexport const createIDBKeyRangeLowerBound = (lower, lowerOpen) => IDBKeyRange.lowerBound(lower, lowerOpen)\n\n/* c8 ignore stop */\n", "import * as Y from 'yjs'\nimport * as idb from 'lib0/indexeddb'\nimport * as promise from 'lib0/promise'\nimport { Observable } from 'lib0/observable'\n\nconst customStoreName = 'custom'\nconst updatesStoreName = 'updates'\n\nexport const PREFERRED_TRIM_SIZE = 500\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {function(IDBObjectStore):void} [beforeApplyUpdatesCallback]\n * @param {function(IDBObjectStore):void} [afterApplyUpdatesCallback]\n */\nexport const fetchUpdates = (idbPersistence, beforeApplyUpdatesCallback = () => {}, afterApplyUpdatesCallback = () => {}) => {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (idbPersistence.db), [updatesStoreName]) // , 'readonly')\n return idb.getAll(updatesStore, idb.createIDBKeyRangeLowerBound(idbPersistence._dbref, false)).then(updates => {\n if (!idbPersistence._destroyed) {\n beforeApplyUpdatesCallback(updatesStore)\n Y.transact(idbPersistence.doc, () => {\n updates.forEach(val => Y.applyUpdate(idbPersistence.doc, val))\n }, idbPersistence, false)\n afterApplyUpdatesCallback(updatesStore)\n }\n })\n .then(() => idb.getLastKey(updatesStore).then(lastKey => { idbPersistence._dbref = lastKey + 1 }))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n .then(() => updatesStore)\n}\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {boolean} forceStore\n */\nexport const storeState = (idbPersistence, forceStore = true) =>\n fetchUpdates(idbPersistence)\n .then(updatesStore => {\n if (forceStore || idbPersistence._dbsize >= PREFERRED_TRIM_SIZE) {\n idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(idbPersistence.doc))\n .then(() => idb.del(updatesStore, idb.createIDBKeyRangeUpperBound(idbPersistence._dbref, true)))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n }\n })\n\n/**\n * @param {string} name\n */\nexport const clearDocument = name => idb.deleteDB(name)\n\n/**\n * @extends Observable\n */\nexport class IndexeddbPersistence extends Observable {\n /**\n * @param {string} name\n * @param {Y.Doc} doc\n */\n constructor (name, doc) {\n super()\n this.doc = doc\n this.name = name\n this._dbref = 0\n this._dbsize = 0\n this._destroyed = false\n /**\n * @type {IDBDatabase|null}\n */\n this.db = null\n this.synced = false\n this._db = idb.openDB(name, db =>\n idb.createStores(db, [\n ['updates', { autoIncrement: true }],\n ['custom']\n ])\n )\n /**\n * @type {Promise}\n */\n this.whenSynced = promise.create(resolve => this.on('synced', () => resolve(this)))\n\n this._db.then(db => {\n this.db = db\n /**\n * @param {IDBObjectStore} updatesStore\n */\n const beforeApplyUpdatesCallback = (updatesStore) => idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(doc))\n const afterApplyUpdatesCallback = () => {\n if (this._destroyed) return this\n this.synced = true\n this.emit('synced', [this])\n }\n fetchUpdates(this, beforeApplyUpdatesCallback, afterApplyUpdatesCallback)\n })\n /**\n * Timeout in ms untill data is merged and persisted in idb.\n */\n this._storeTimeout = 1000\n /**\n * @type {any}\n */\n this._storeTimeoutId = null\n /**\n * @param {Uint8Array} update\n * @param {any} origin\n */\n this._storeUpdate = (update, origin) => {\n if (this.db && origin !== this) {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (this.db), [updatesStoreName])\n idb.addAutoKey(updatesStore, update)\n if (++this._dbsize >= PREFERRED_TRIM_SIZE) {\n // debounce store call\n if (this._storeTimeoutId !== null) {\n clearTimeout(this._storeTimeoutId)\n }\n this._storeTimeoutId = setTimeout(() => {\n storeState(this, false)\n this._storeTimeoutId = null\n }, this._storeTimeout)\n }\n }\n }\n doc.on('update', this._storeUpdate)\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n destroy () {\n if (this._storeTimeoutId) {\n clearTimeout(this._storeTimeoutId)\n }\n this.doc.off('update', this._storeUpdate)\n this.doc.off('destroy', this.destroy)\n this._destroyed = true\n return this._db.then(db => {\n db.close()\n })\n }\n\n /**\n * Destroys this instance and removes all data from indexeddb.\n *\n * @return {Promise}\n */\n clearData () {\n return this.destroy().then(() => {\n idb.deleteDB(this.name)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n get (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName], 'readonly')\n return idb.get(custom, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @param {String | number | ArrayBuffer | Date} value\n * @return {Promise}\n */\n set (key, value) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.put(custom, value, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n del (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.del(custom, key)\n })\n }\n}\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", "import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n", "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n", "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", "import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n", "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n", "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", "import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n", "import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n", "import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n", "import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n", "import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n", "import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n", "import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n", "import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n", "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n", "import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n", "import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n", "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n", "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n", "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n", "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n", "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n", "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n", "import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n", "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", "import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n", "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n", "import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n", "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n", "import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n", "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n", "import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n", "import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n", "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", "import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n", "import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", "import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n", "import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n", "import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n", "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", "import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n", "import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n", "import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n", "import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n", "import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n", "import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n", "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n", "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n", "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n", "import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n", "import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n", "import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n", "import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n", "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n", "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n", "/**\n * @license\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"es\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\nexport { default as add } from './add.js';\nexport { default as after } from './after.js';\nexport { default as ary } from './ary.js';\nexport { default as assign } from './assign.js';\nexport { default as assignIn } from './assignIn.js';\nexport { default as assignInWith } from './assignInWith.js';\nexport { default as assignWith } from './assignWith.js';\nexport { default as at } from './at.js';\nexport { default as attempt } from './attempt.js';\nexport { default as before } from './before.js';\nexport { default as bind } from './bind.js';\nexport { default as bindAll } from './bindAll.js';\nexport { default as bindKey } from './bindKey.js';\nexport { default as camelCase } from './camelCase.js';\nexport { default as capitalize } from './capitalize.js';\nexport { default as castArray } from './castArray.js';\nexport { default as ceil } from './ceil.js';\nexport { default as chain } from './chain.js';\nexport { default as chunk } from './chunk.js';\nexport { default as clamp } from './clamp.js';\nexport { default as clone } from './clone.js';\nexport { default as cloneDeep } from './cloneDeep.js';\nexport { default as cloneDeepWith } from './cloneDeepWith.js';\nexport { default as cloneWith } from './cloneWith.js';\nexport { default as commit } from './commit.js';\nexport { default as compact } from './compact.js';\nexport { default as concat } from './concat.js';\nexport { default as cond } from './cond.js';\nexport { default as conforms } from './conforms.js';\nexport { default as conformsTo } from './conformsTo.js';\nexport { default as constant } from './constant.js';\nexport { default as countBy } from './countBy.js';\nexport { default as create } from './create.js';\nexport { default as curry } from './curry.js';\nexport { default as curryRight } from './curryRight.js';\nexport { default as debounce } from './debounce.js';\nexport { default as deburr } from './deburr.js';\nexport { default as defaultTo } from './defaultTo.js';\nexport { default as defaults } from './defaults.js';\nexport { default as defaultsDeep } from './defaultsDeep.js';\nexport { default as defer } from './defer.js';\nexport { default as delay } from './delay.js';\nexport { default as difference } from './difference.js';\nexport { default as differenceBy } from './differenceBy.js';\nexport { default as differenceWith } from './differenceWith.js';\nexport { default as divide } from './divide.js';\nexport { default as drop } from './drop.js';\nexport { default as dropRight } from './dropRight.js';\nexport { default as dropRightWhile } from './dropRightWhile.js';\nexport { default as dropWhile } from './dropWhile.js';\nexport { default as each } from './each.js';\nexport { default as eachRight } from './eachRight.js';\nexport { default as endsWith } from './endsWith.js';\nexport { default as entries } from './entries.js';\nexport { default as entriesIn } from './entriesIn.js';\nexport { default as eq } from './eq.js';\nexport { default as escape } from './escape.js';\nexport { default as escapeRegExp } from './escapeRegExp.js';\nexport { default as every } from './every.js';\nexport { default as extend } from './extend.js';\nexport { default as extendWith } from './extendWith.js';\nexport { default as fill } from './fill.js';\nexport { default as filter } from './filter.js';\nexport { default as find } from './find.js';\nexport { default as findIndex } from './findIndex.js';\nexport { default as findKey } from './findKey.js';\nexport { default as findLast } from './findLast.js';\nexport { default as findLastIndex } from './findLastIndex.js';\nexport { default as findLastKey } from './findLastKey.js';\nexport { default as first } from './first.js';\nexport { default as flatMap } from './flatMap.js';\nexport { default as flatMapDeep } from './flatMapDeep.js';\nexport { default as flatMapDepth } from './flatMapDepth.js';\nexport { default as flatten } from './flatten.js';\nexport { default as flattenDeep } from './flattenDeep.js';\nexport { default as flattenDepth } from './flattenDepth.js';\nexport { default as flip } from './flip.js';\nexport { default as floor } from './floor.js';\nexport { default as flow } from './flow.js';\nexport { default as flowRight } from './flowRight.js';\nexport { default as forEach } from './forEach.js';\nexport { default as forEachRight } from './forEachRight.js';\nexport { default as forIn } from './forIn.js';\nexport { default as forInRight } from './forInRight.js';\nexport { default as forOwn } from './forOwn.js';\nexport { default as forOwnRight } from './forOwnRight.js';\nexport { default as fromPairs } from './fromPairs.js';\nexport { default as functions } from './functions.js';\nexport { default as functionsIn } from './functionsIn.js';\nexport { default as get } from './get.js';\nexport { default as groupBy } from './groupBy.js';\nexport { default as gt } from './gt.js';\nexport { default as gte } from './gte.js';\nexport { default as has } from './has.js';\nexport { default as hasIn } from './hasIn.js';\nexport { default as head } from './head.js';\nexport { default as identity } from './identity.js';\nexport { default as inRange } from './inRange.js';\nexport { default as includes } from './includes.js';\nexport { default as indexOf } from './indexOf.js';\nexport { default as initial } from './initial.js';\nexport { default as intersection } from './intersection.js';\nexport { default as intersectionBy } from './intersectionBy.js';\nexport { default as intersectionWith } from './intersectionWith.js';\nexport { default as invert } from './invert.js';\nexport { default as invertBy } from './invertBy.js';\nexport { default as invoke } from './invoke.js';\nexport { default as invokeMap } from './invokeMap.js';\nexport { default as isArguments } from './isArguments.js';\nexport { default as isArray } from './isArray.js';\nexport { default as isArrayBuffer } from './isArrayBuffer.js';\nexport { default as isArrayLike } from './isArrayLike.js';\nexport { default as isArrayLikeObject } from './isArrayLikeObject.js';\nexport { default as isBoolean } from './isBoolean.js';\nexport { default as isBuffer } from './isBuffer.js';\nexport { default as isDate } from './isDate.js';\nexport { default as isElement } from './isElement.js';\nexport { default as isEmpty } from './isEmpty.js';\nexport { default as isEqual } from './isEqual.js';\nexport { default as isEqualWith } from './isEqualWith.js';\nexport { default as isError } from './isError.js';\nexport { default as isFinite } from './isFinite.js';\nexport { default as isFunction } from './isFunction.js';\nexport { default as isInteger } from './isInteger.js';\nexport { default as isLength } from './isLength.js';\nexport { default as isMap } from './isMap.js';\nexport { default as isMatch } from './isMatch.js';\nexport { default as isMatchWith } from './isMatchWith.js';\nexport { default as isNaN } from './isNaN.js';\nexport { default as isNative } from './isNative.js';\nexport { default as isNil } from './isNil.js';\nexport { default as isNull } from './isNull.js';\nexport { default as isNumber } from './isNumber.js';\nexport { default as isObject } from './isObject.js';\nexport { default as isObjectLike } from './isObjectLike.js';\nexport { default as isPlainObject } from './isPlainObject.js';\nexport { default as isRegExp } from './isRegExp.js';\nexport { default as isSafeInteger } from './isSafeInteger.js';\nexport { default as isSet } from './isSet.js';\nexport { default as isString } from './isString.js';\nexport { default as isSymbol } from './isSymbol.js';\nexport { default as isTypedArray } from './isTypedArray.js';\nexport { default as isUndefined } from './isUndefined.js';\nexport { default as isWeakMap } from './isWeakMap.js';\nexport { default as isWeakSet } from './isWeakSet.js';\nexport { default as iteratee } from './iteratee.js';\nexport { default as join } from './join.js';\nexport { default as kebabCase } from './kebabCase.js';\nexport { default as keyBy } from './keyBy.js';\nexport { default as keys } from './keys.js';\nexport { default as keysIn } from './keysIn.js';\nexport { default as last } from './last.js';\nexport { default as lastIndexOf } from './lastIndexOf.js';\nexport { default as lodash } from './wrapperLodash.js';\nexport { default as lowerCase } from './lowerCase.js';\nexport { default as lowerFirst } from './lowerFirst.js';\nexport { default as lt } from './lt.js';\nexport { default as lte } from './lte.js';\nexport { default as map } from './map.js';\nexport { default as mapKeys } from './mapKeys.js';\nexport { default as mapValues } from './mapValues.js';\nexport { default as matches } from './matches.js';\nexport { default as matchesProperty } from './matchesProperty.js';\nexport { default as max } from './max.js';\nexport { default as maxBy } from './maxBy.js';\nexport { default as mean } from './mean.js';\nexport { default as meanBy } from './meanBy.js';\nexport { default as memoize } from './memoize.js';\nexport { default as merge } from './merge.js';\nexport { default as mergeWith } from './mergeWith.js';\nexport { default as method } from './method.js';\nexport { default as methodOf } from './methodOf.js';\nexport { default as min } from './min.js';\nexport { default as minBy } from './minBy.js';\nexport { default as mixin } from './mixin.js';\nexport { default as multiply } from './multiply.js';\nexport { default as negate } from './negate.js';\nexport { default as next } from './next.js';\nexport { default as noop } from './noop.js';\nexport { default as now } from './now.js';\nexport { default as nth } from './nth.js';\nexport { default as nthArg } from './nthArg.js';\nexport { default as omit } from './omit.js';\nexport { default as omitBy } from './omitBy.js';\nexport { default as once } from './once.js';\nexport { default as orderBy } from './orderBy.js';\nexport { default as over } from './over.js';\nexport { default as overArgs } from './overArgs.js';\nexport { default as overEvery } from './overEvery.js';\nexport { default as overSome } from './overSome.js';\nexport { default as pad } from './pad.js';\nexport { default as padEnd } from './padEnd.js';\nexport { default as padStart } from './padStart.js';\nexport { default as parseInt } from './parseInt.js';\nexport { default as partial } from './partial.js';\nexport { default as partialRight } from './partialRight.js';\nexport { default as partition } from './partition.js';\nexport { default as pick } from './pick.js';\nexport { default as pickBy } from './pickBy.js';\nexport { default as plant } from './plant.js';\nexport { default as property } from './property.js';\nexport { default as propertyOf } from './propertyOf.js';\nexport { default as pull } from './pull.js';\nexport { default as pullAll } from './pullAll.js';\nexport { default as pullAllBy } from './pullAllBy.js';\nexport { default as pullAllWith } from './pullAllWith.js';\nexport { default as pullAt } from './pullAt.js';\nexport { default as random } from './random.js';\nexport { default as range } from './range.js';\nexport { default as rangeRight } from './rangeRight.js';\nexport { default as rearg } from './rearg.js';\nexport { default as reduce } from './reduce.js';\nexport { default as reduceRight } from './reduceRight.js';\nexport { default as reject } from './reject.js';\nexport { default as remove } from './remove.js';\nexport { default as repeat } from './repeat.js';\nexport { default as replace } from './replace.js';\nexport { default as rest } from './rest.js';\nexport { default as result } from './result.js';\nexport { default as reverse } from './reverse.js';\nexport { default as round } from './round.js';\nexport { default as sample } from './sample.js';\nexport { default as sampleSize } from './sampleSize.js';\nexport { default as set } from './set.js';\nexport { default as setWith } from './setWith.js';\nexport { default as shuffle } from './shuffle.js';\nexport { default as size } from './size.js';\nexport { default as slice } from './slice.js';\nexport { default as snakeCase } from './snakeCase.js';\nexport { default as some } from './some.js';\nexport { default as sortBy } from './sortBy.js';\nexport { default as sortedIndex } from './sortedIndex.js';\nexport { default as sortedIndexBy } from './sortedIndexBy.js';\nexport { default as sortedIndexOf } from './sortedIndexOf.js';\nexport { default as sortedLastIndex } from './sortedLastIndex.js';\nexport { default as sortedLastIndexBy } from './sortedLastIndexBy.js';\nexport { default as sortedLastIndexOf } from './sortedLastIndexOf.js';\nexport { default as sortedUniq } from './sortedUniq.js';\nexport { default as sortedUniqBy } from './sortedUniqBy.js';\nexport { default as split } from './split.js';\nexport { default as spread } from './spread.js';\nexport { default as startCase } from './startCase.js';\nexport { default as startsWith } from './startsWith.js';\nexport { default as stubArray } from './stubArray.js';\nexport { default as stubFalse } from './stubFalse.js';\nexport { default as stubObject } from './stubObject.js';\nexport { default as stubString } from './stubString.js';\nexport { default as stubTrue } from './stubTrue.js';\nexport { default as subtract } from './subtract.js';\nexport { default as sum } from './sum.js';\nexport { default as sumBy } from './sumBy.js';\nexport { default as tail } from './tail.js';\nexport { default as take } from './take.js';\nexport { default as takeRight } from './takeRight.js';\nexport { default as takeRightWhile } from './takeRightWhile.js';\nexport { default as takeWhile } from './takeWhile.js';\nexport { default as tap } from './tap.js';\nexport { default as template } from './template.js';\nexport { default as templateSettings } from './templateSettings.js';\nexport { default as throttle } from './throttle.js';\nexport { default as thru } from './thru.js';\nexport { default as times } from './times.js';\nexport { default as toArray } from './toArray.js';\nexport { default as toFinite } from './toFinite.js';\nexport { default as toInteger } from './toInteger.js';\nexport { default as toIterator } from './toIterator.js';\nexport { default as toJSON } from './toJSON.js';\nexport { default as toLength } from './toLength.js';\nexport { default as toLower } from './toLower.js';\nexport { default as toNumber } from './toNumber.js';\nexport { default as toPairs } from './toPairs.js';\nexport { default as toPairsIn } from './toPairsIn.js';\nexport { default as toPath } from './toPath.js';\nexport { default as toPlainObject } from './toPlainObject.js';\nexport { default as toSafeInteger } from './toSafeInteger.js';\nexport { default as toString } from './toString.js';\nexport { default as toUpper } from './toUpper.js';\nexport { default as transform } from './transform.js';\nexport { default as trim } from './trim.js';\nexport { default as trimEnd } from './trimEnd.js';\nexport { default as trimStart } from './trimStart.js';\nexport { default as truncate } from './truncate.js';\nexport { default as unary } from './unary.js';\nexport { default as unescape } from './unescape.js';\nexport { default as union } from './union.js';\nexport { default as unionBy } from './unionBy.js';\nexport { default as unionWith } from './unionWith.js';\nexport { default as uniq } from './uniq.js';\nexport { default as uniqBy } from './uniqBy.js';\nexport { default as uniqWith } from './uniqWith.js';\nexport { default as uniqueId } from './uniqueId.js';\nexport { default as unset } from './unset.js';\nexport { default as unzip } from './unzip.js';\nexport { default as unzipWith } from './unzipWith.js';\nexport { default as update } from './update.js';\nexport { default as updateWith } from './updateWith.js';\nexport { default as upperCase } from './upperCase.js';\nexport { default as upperFirst } from './upperFirst.js';\nexport { default as value } from './value.js';\nexport { default as valueOf } from './valueOf.js';\nexport { default as values } from './values.js';\nexport { default as valuesIn } from './valuesIn.js';\nexport { default as without } from './without.js';\nexport { default as words } from './words.js';\nexport { default as wrap } from './wrap.js';\nexport { default as wrapperAt } from './wrapperAt.js';\nexport { default as wrapperChain } from './wrapperChain.js';\nexport { default as wrapperCommit } from './commit.js';\nexport { default as wrapperLodash } from './wrapperLodash.js';\nexport { default as wrapperNext } from './next.js';\nexport { default as wrapperPlant } from './plant.js';\nexport { default as wrapperReverse } from './wrapperReverse.js';\nexport { default as wrapperToIterator } from './toIterator.js';\nexport { default as wrapperValue } from './wrapperValue.js';\nexport { default as xor } from './xor.js';\nexport { default as xorBy } from './xorBy.js';\nexport { default as xorWith } from './xorWith.js';\nexport { default as zip } from './zip.js';\nexport { default as zipObject } from './zipObject.js';\nexport { default as zipObjectDeep } from './zipObjectDeep.js';\nexport { default as zipWith } from './zipWith.js';\nexport { default } from './lodash.default.js';\n", "enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n", "import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n", "export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n", "import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n", "import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n", "import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n", "import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n", "import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n", "import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n", "import type LinkedNode from './linked-node.js';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n", "import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot | null): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record,\n obj2: Record,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n", "import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n", "import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n", "import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n", "import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n", "/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @param {boolean} [cleanup] Apply semantic cleanup before returning.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n if (cleanup) {\n diff_cleanupSemantic(diffs);\n }\n return diffs;\n}\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)],\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n}\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = delta % 2 !== 0;\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length &&\n y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length &&\n y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ===\n text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n}\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n}\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\nfunction diff_commonOverlap_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (\n found == 0 ||\n text1.substring(text_length - length) == text2.substring(0, length)\n ) {\n best = length;\n length++;\n }\n }\n}\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = \"\";\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i),\n shorttext.substring(j)\n );\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i),\n shorttext.substring(0, j)\n );\n if (best_common.length < suffixLength + prefixLength) {\n best_common =\n shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a,\n best_longtext_b,\n best_shorttext_a,\n best_shorttext_b,\n best_common,\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 4)\n );\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 2)\n );\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n}\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemantic(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) {\n // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else {\n // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (\n lastequality &&\n lastequality.length <=\n Math.max(length_insertions1, length_deletions1) &&\n lastequality.length <= Math.max(length_insertions2, length_deletions2)\n ) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0, [\n DIFF_DELETE,\n lastequality,\n ]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (\n diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT\n ) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (\n overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2\n ) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n insertion.substring(0, overlap_length1),\n ]);\n diffs[pointer - 1][1] = deletion.substring(\n 0,\n deletion.length - overlap_length1\n );\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (\n overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2\n ) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n deletion.substring(0, overlap_length2),\n ]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] = insertion.substring(\n 0,\n insertion.length - overlap_length2\n );\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] = deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n}\n\nvar nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\nvar whitespaceRegex_ = /\\s/;\nvar linebreakRegex_ = /[\\r\\n]/;\nvar blanklineEndRegex_ = /\\n\\r?\\n$/;\nvar blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemanticLossless(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);\n var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);\n var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);\n var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);\n var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n}\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, \"\"]); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = \"\";\n var text_insert = \"\";\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (\n previous_equality >= 0 &&\n ends_with_pair_start(diffs[previous_equality][1])\n ) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(\n 0,\n -1\n );\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(\n 0,\n commonlength\n );\n } else {\n diffs.splice(0, 0, [\n DIFF_EQUAL,\n text_insert.substring(0, commonlength),\n ]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) +\n diffs[pointer][1];\n text_insert = text_insert.substring(\n 0,\n text_insert.length - commonlength\n );\n text_delete = text_delete.substring(\n 0,\n text_delete.length - commonlength\n );\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(\n pointer - n,\n n,\n [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]\n );\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = \"\";\n text_insert = \"\";\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === \"\") {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n if (\n diffs[pointer][1].substring(\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n ) === diffs[pointer - 1][1]\n ) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] =\n diffs[pointer - 1][1] +\n diffs[pointer][1].substring(\n 0,\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n );\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (\n diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]\n ) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n}\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xd800 && charCode <= 0xdbff;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xdc00 && charCode <= 0xdfff;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after],\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange =\n typeof cursor_pos === \"number\"\n ? { index: cursor_pos, length: 0 }\n : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === \"number\" ? null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos, cleanup) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, cleanup, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n", "/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n", "/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n", "import cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\n\ninterface AttributeMap {\n [key: string]: unknown;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n", "import AttributeMap from './AttributeMap';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | Record;\n delete?: number;\n retain?: number | Record;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n return 1;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n", "import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (\n typeof nextOp.retain === 'object' &&\n nextOp.retain !== null\n ) {\n // offset should === 0, length should === 1\n retOp.retain = nextOp.retain;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n const op = this.ops[this.index];\n if (op) {\n if (typeof op.delete === 'number') {\n return 'delete';\n } else if (\n typeof op.retain === 'number' ||\n (typeof op.retain === 'object' && op.retain !== null)\n ) {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n", "import * as diff from 'fast-diff';\nimport cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\nimport OpIterator from './OpIterator';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\ninterface EmbedHandler {\n compose(a: T, b: T, keepNull: boolean): T;\n invert(a: T, b: T): T;\n transform(a: T, b: T, priority: boolean): T;\n}\n\nconst getEmbedTypeAndData = (\n a: Op['insert'] | Op['retain'],\n b: Op['insert'],\n): [string, unknown, unknown] => {\n if (typeof a !== 'object' || a === null) {\n throw new Error(`cannot retain a ${typeof a}`);\n }\n if (typeof b !== 'object' || b === null) {\n throw new Error(`cannot retain a ${typeof b}`);\n }\n const embedType = Object.keys(a)[0];\n if (!embedType || embedType !== Object.keys(b)[0]) {\n throw new Error(\n `embed types not matched: ${embedType} != ${Object.keys(b)[0]}`,\n );\n }\n return [embedType, a[embedType], b[embedType]];\n};\n\nclass Delta {\n static Op = Op;\n static OpIterator = OpIterator;\n static AttributeMap = AttributeMap;\n private static handlers: { [embedType: string]: EmbedHandler } = {};\n\n static registerEmbed(embedType: string, handler: EmbedHandler): void {\n this.handlers[embedType] = handler;\n }\n\n static unregisterEmbed(embedType: string): void {\n delete this.handlers[embedType];\n }\n\n private static getHandler(embedType: string): EmbedHandler {\n const handler = this.handlers[embedType];\n if (!handler) {\n throw new Error(`no handlers for embed type \"${embedType}\"`);\n }\n return handler;\n }\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(\n arg: string | Record,\n attributes?: AttributeMap | null,\n ): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(\n length: number | Record,\n attributes?: AttributeMap | null,\n ): this {\n if (typeof length === 'number' && length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = new OpIterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (otherOp.retain) {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain =\n typeof otherOp.retain === 'number' ? length : otherOp.retain;\n } else {\n if (typeof otherOp.retain === 'number') {\n if (thisOp.retain == null) {\n newOp.insert = thisOp.insert;\n } else {\n newOp.retain = thisOp.retain;\n }\n } else {\n const action = thisOp.retain == null ? 'insert' : 'retain';\n const [embedType, thisData, otherData] = getEmbedTypeAndData(\n thisOp[action],\n otherOp.retain,\n );\n const handler = Delta.getHandler(embedType);\n newOp[action] = {\n [embedType]: handler.compose(\n thisData,\n otherData,\n action === 'retain',\n ),\n };\n }\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n (typeof thisOp.retain === 'number' ||\n (typeof thisOp.retain === 'object' && thisOp.retain !== null))\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor, true);\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = new OpIterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (typeof op.retain === 'number' && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || typeof op.retain === 'number') {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n const slice = base.slice(baseIndex, baseIndex + 1);\n const baseOp = new OpIterator(slice.ops).next();\n const [embedType, opData, baseOpData] = getEmbedTypeAndData(\n op.retain,\n baseOp.insert,\n );\n const handler = Delta.getHandler(embedType);\n inverted.retain(\n { [embedType]: handler.invert(opData, baseOpData) },\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n return baseIndex + 1;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n const thisData = thisOp.retain;\n const otherData = otherOp.retain;\n let transformedData: Op['retain'] =\n typeof otherData === 'object' && otherData !== null\n ? otherData\n : length;\n if (\n typeof thisData === 'object' &&\n thisData !== null &&\n typeof otherData === 'object' &&\n otherData !== null\n ) {\n const embedType = Object.keys(thisData)[0];\n if (embedType === Object.keys(otherData)[0]) {\n const handler = Delta.getHandler(embedType);\n if (handler) {\n transformedData = {\n [embedType]: handler.transform(\n thisData[embedType],\n otherData[embedType],\n priority,\n ),\n };\n }\n }\n }\n\n // We retain either their retain or insert\n delta.retain(\n transformedData,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = new OpIterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport default Delta;\n\nexport { Op, OpIterator, AttributeMap };\n\nif (typeof module === 'object') {\n module.exports = Delta;\n module.exports.default = Delta;\n}\n", "import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n", "import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text: string) {\n return text.replace(/[&<>\"']/g, (s) => {\n // https://lodash.com/docs#escape\n const entityMap: Record = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n", "import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport type { BlotConstructor } from 'parchment';\nimport Break from './break.js';\nimport Text from './text.js';\n\nclass Inline extends InlineBlot {\n static allowedChildren: BlotConstructor[] = [Inline, Break, EmbedBlot, Text];\n // Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n static order = [\n 'cursor',\n 'inline', // Must be lower\n 'link', // Chrome wants to be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'code', // Must be higher\n ];\n\n static compare(self: string, other: string) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n // @ts-expect-error TODO: make isolate generic\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\n\nexport default Inline;\n", "import {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport type { Blot, Parent } from 'parchment';\nimport Delta from 'quill-delta';\nimport Break from './break.js';\nimport Inline from './inline.js';\nimport TextBlot from './text.js';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n cache: { delta?: Delta | null; length?: number } = {};\n\n delta(): Delta {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index: number, length: number) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift() as string;\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block: Blot | this = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target: Parent, ref?: Blot | null) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index: number) {\n return super.path(index, true);\n }\n\n removeChild(child: Blot) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index: number, force: boolean | undefined = false): Blot | null {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attributes: AttributorStore;\n domNode: HTMLElement;\n\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), {\n ...this.formats(),\n ...this.attributes.values(),\n });\n }\n\n format(name: string, value: unknown) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n this.format(name, value);\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map((line) => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach((block) => {\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot: BlockBlot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(\n blot: Blot | null,\n formats: Record = {},\n filter = true,\n): Record {\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = {\n ...formats,\n ...blot.formats(),\n };\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n", "import { EmbedBlot, Scope } from 'parchment';\nimport type { Parent, ScrollBlot } from 'parchment';\nimport type Selection from '../core/selection.js';\nimport TextBlot from './text.js';\nimport type { EmbedContextRange } from './embed.js';\n\nclass Cursor extends EmbedBlot {\n static blotName = 'cursor';\n static className = 'ql-cursor';\n static tagName = 'span';\n static CONTENTS = '\\uFEFF'; // Zero width no break space\n\n static value() {\n return undefined;\n }\n\n selection: Selection;\n textNode: Text;\n savedLength: number;\n\n constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name: string, value: unknown) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let target: Parent | this = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: allow empty context in Parchment\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node: Node, offset: number) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position(): [Text, number] {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n // @ts-expect-error Fix me later\n this.parent = null;\n }\n\n restore(): EmbedContextRange | null {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Browser may push down styles/nodes inside the cursor blot.\n // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n // @ts-expect-error Fix me later\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n // @ts-expect-error TODO: make TextBlot.text public\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node: Node, offset: number) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n // Avoid .ql-cursor being a descendant of ``.\n // The reason is Safari pushes down `` on text insertion.\n // That will cause DOM nodes not sync with the model.\n //\n // For example ({I} is the caret), given the markup:\n // \\uFEFF{I}\n // When typing a char \"x\", `` will be pushed down inside the `` first:\n // \\uFEFF{I}\n // And then \"x\" will be inserted after ``:\n // \\uFEFFd{I}\n optimize(context?: unknown) {\n // @ts-expect-error Fix me later\n super.optimize(context);\n\n let { parent } = this;\n while (parent) {\n if (parent.domNode.tagName === 'A') {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: make isolate generic\n parent.isolate(this.offset(parent), this.length()).unwrap();\n this.savedLength = 0;\n break;\n }\n parent = parent.parent;\n }\n }\n\n value() {\n return '';\n }\n}\n\nexport default Cursor;\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n", "import type Quill from '../core.js';\n\nexport default new WeakMap();\n", "const levels = ['error', 'warn', 'log', 'info'] as const;\nexport type DebugLevel = (typeof levels)[number];\nlet level: DebugLevel | false = 'warn';\n\nfunction debug(method: DebugLevel, ...args: unknown[]) {\n if (level) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n\nfunction namespace(\n ns: string,\n): Record void> {\n return levels.reduce(\n (logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n },\n {} as Record void>,\n );\n}\n\nnamespace.level = (newLevel: DebugLevel | false) => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n", "import { EventEmitter } from 'eventemitter3';\nimport instances from './instances.js';\nimport logger from './logger.js';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach((eventName) => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach((node) => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n static events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SCROLL_EMBED_UPDATE: 'scroll-embed-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n COMPOSITION_BEFORE_START: 'composition-before-start',\n COMPOSITION_START: 'composition-start',\n COMPOSITION_BEFORE_END: 'composition-before-end',\n COMPOSITION_END: 'composition-end',\n } as const;\n\n static sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n } as const;\n\n protected domListeners: Record;\n\n constructor() {\n super();\n this.domListeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args: unknown[]): boolean {\n debug.log.call(debug, ...args);\n // @ts-expect-error\n return super.emit(...args);\n }\n\n handleDOM(event: Event, ...args: unknown[]) {\n (this.domListeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target as Node)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName: string, node: Node, handler: EventListener) {\n if (!this.domListeners[eventName]) {\n this.domListeners[eventName] = [];\n }\n this.domListeners[eventName].push({ node, handler });\n }\n}\n\nexport type EmitterSource =\n (typeof Emitter.sources)[keyof typeof Emitter.sources];\n\nexport default Emitter;\n", "import { LeafBlot, Scope } from 'parchment';\nimport { cloneDeep, isEqual } from 'lodash-es';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport logger from './logger.js';\nimport type Cursor from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\n\nconst debug = logger('quill:selection');\n\ntype NativeRange = AbstractRange;\n\ninterface NormalizedRange {\n start: {\n node: NativeRange['startContainer'];\n offset: NativeRange['startOffset'];\n };\n end: { node: NativeRange['endContainer']; offset: NativeRange['endOffset'] };\n native: NativeRange;\n}\n\nexport interface Bounds {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n}\n\nexport class Range {\n constructor(\n public index: number,\n public length = 0,\n ) {}\n}\n\nclass Selection {\n scroll: Scroll;\n emitter: Emitter;\n composing: boolean;\n mouseDown: boolean;\n\n root: HTMLElement;\n cursor: Cursor;\n savedRange: Range;\n lastRange: Range | null;\n lastNative: NormalizedRange | null;\n\n constructor(scroll: Scroll, emitter: Emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n // @ts-expect-error\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.lastNative = null;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(\n Emitter.events.SCROLL_UPDATE,\n (source, mutations: MutationRecord[]) => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n const triggeredByTyping = mutations.some(\n (mutation) =>\n mutation.type === 'characterData' ||\n mutation.type === 'childList' ||\n (mutation.type === 'attributes' &&\n mutation.target === this.root),\n );\n this.update(triggeredByTyping ? Emitter.sources.SILENT : source);\n } catch (ignored) {\n // ignore\n }\n },\n );\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.emitter.on(Emitter.events.COMPOSITION_BEFORE_START, () => {\n this.composing = true;\n });\n this.emitter.on(Emitter.events.COMPOSITION_END, () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus({ preventScroll: true });\n this.setRange(this.savedRange);\n }\n\n format(format: string, value: unknown) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index: number, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node: Node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n if (length > 0 && offset === leaf.length()) {\n const [next] = this.scroll.leaf(index + 1);\n if (next) {\n const [line] = this.scroll.line(index);\n const [nextLine] = this.scroll.line(index + 1);\n if (line === nextLine) {\n leaf = next;\n offset = 0;\n }\n }\n }\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side: 'left' | 'right' = 'left';\n let rect: DOMRect;\n if (node instanceof Text) {\n // Return null if the text node is empty because it is\n // not able to get a useful client rect:\n // https://github.com/w3c/csswg-drafts/issues/2514.\n // Empty text nodes are most likely caused by TextBlot#optimize()\n // not getting called when editor content changes.\n if (!node.data.length) {\n return null;\n }\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n if (!(leaf.domNode instanceof Element)) return null;\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange(): NormalizedRange | null {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange(): [Range, NormalizedRange] | [null, null] {\n const root = this.scroll.domNode;\n if ('isConnected' in root && !root.isConnected) {\n // document.getSelection() forces layout on Blink, so we trend to\n // not calling it.\n return [null, null];\n }\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus(): boolean {\n return (\n document.activeElement === this.root ||\n (document.activeElement != null &&\n contains(this.root, document.activeElement))\n );\n }\n\n normalizedToRange(range: NormalizedRange) {\n const positions: [Node, number][] = [\n [range.start.node, range.start.offset],\n ];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map((position) => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n // @ts-expect-error Fix me later\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n // @ts-expect-error Fix me later\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange: NativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach((position) => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n // @ts-expect-error Fix me later\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range: Range): [Node | null, number, Node | null, number] {\n const scrollLength = this.scroll.length();\n\n const getPosition = (\n index: number,\n inclusive: boolean,\n ): [Node | null, number] => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n return leaf ? leaf.position(leafOffset, inclusive) : [null, -1];\n };\n return [\n ...getPosition(range.index, false),\n ...getPosition(range.index + range.length, true),\n ];\n }\n\n setNativeRange(\n startNode: Node | null,\n startOffset?: number,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n // @ts-expect-error Fix me later\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus({ preventScroll: true });\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode instanceof Element && startNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode instanceof Element && endNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n // @ts-expect-error Fix me later\n range.setStart(startNode, startOffset);\n // @ts-expect-error Fix me later\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range: Range | null, force: boolean, source?: EmitterSource): void;\n setRange(range: Range | null, source?: EmitterSource): void;\n setRange(\n range: Range | null,\n force: boolean | EmitterSource = false,\n source: EmitterSource = Emitter.sources.API,\n ): void {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n this.lastNative = nativeRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n cloneDeep(this.lastRange),\n cloneDeep(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent: Node, descendant: Node) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport default Selection;\n", "import { cloneDeep, isEqual, merge } from 'lodash-es';\nimport { LeafBlot, EmbedBlot, Scope, ParentBlot } from 'parchment';\nimport type { Blot } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport { Range } from './selection.js';\n\nconst ASCII = /^[ -~]*$/;\n\ntype SelectionInfo = {\n newRange: Range;\n oldRange: Range;\n};\n\nclass Editor {\n scroll: Scroll;\n delta: Delta;\n\n constructor(scroll: Scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta: Delta): Delta {\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n const deleteDelta = new Delta();\n const normalizedOps = splitOpLines(normalizedDelta.ops.slice());\n normalizedOps.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n let isImplicitNewlinePrepended = false;\n let isImplicitNewlineAppended = false;\n if (op.insert != null) {\n deleteDelta.retain(length);\n if (typeof op.insert === 'string') {\n const text = op.insert;\n isImplicitNewlineAppended =\n !text.endsWith('\\n') &&\n (scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]);\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n if (leaf) {\n formats = merge(formats, bubbleFormats(leaf));\n }\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n const isInlineEmbed = this.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n if (\n scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]\n ) {\n isImplicitNewlineAppended = true;\n }\n } else if (index > 0) {\n const [leaf, offset] = this.scroll.descendant(LeafBlot, index - 1);\n if (leaf instanceof TextBlot) {\n const text = leaf.value();\n if (text[offset] !== '\\n') {\n isImplicitNewlinePrepended = true;\n }\n } else if (\n leaf instanceof EmbedBlot &&\n leaf.statics.scope === Scope.INLINE_BLOT\n ) {\n isImplicitNewlinePrepended = true;\n }\n }\n this.scroll.insertAt(index, key, op.insert[key]);\n\n if (isInlineEmbed) {\n const [leaf] = this.scroll.descendant(LeafBlot, index);\n if (leaf) {\n const formats = merge({}, bubbleFormats(leaf));\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n scrollLength += length;\n } else {\n deleteDelta.push(op);\n\n if (op.retain !== null && typeof op.retain === 'object') {\n const key = Object.keys(op.retain)[0];\n if (key == null) return index;\n this.scroll.updateEmbedAt(index, key, op.retain[key]);\n }\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n const prependedLength = isImplicitNewlinePrepended ? 1 : 0;\n const addedLength = isImplicitNewlineAppended ? 1 : 0;\n scrollLength += prependedLength + addedLength;\n deleteDelta.retain(prependedLength);\n deleteDelta.delete(addedLength);\n return index + length + prependedLength + addedLength;\n }, 0);\n deleteDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + Op.length(op);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index: number, length: number): Delta {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n this.scroll.lines(index, Math.max(length, 1)).forEach((line) => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n formatText(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n getContents(index: number, length: number): Delta {\n return this.delta.slice(index, index + length);\n }\n\n getDelta(): Delta {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index: number, length = 0): Record {\n let lines: (Block | BlockEmbed)[] = [];\n let leaves: LeafBlot[] = [];\n if (length === 0) {\n this.scroll.path(index).forEach((path) => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map((blots) => {\n const blot = blots.shift();\n if (blot == null) return {};\n let formats = bubbleFormats(blot);\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getHTML(index: number, length: number): string {\n const [line, lineOffset] = this.scroll.line(index);\n if (line) {\n const lineLength = line.length();\n const isWithinLine = line.length() >= lineOffset + length;\n if (isWithinLine && !(lineOffset === 0 && length === lineLength)) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n return '';\n }\n\n getText(index: number, length: number): string {\n return this.getContents(index, length)\n .filter((op) => typeof op.insert === 'string')\n .map((op) => op.insert)\n .join('');\n }\n\n insertContents(index: number, contents: Delta): Delta {\n const normalizedDelta = normalizeDelta(contents);\n const change = new Delta().retain(index).concat(normalizedDelta);\n this.scroll.insertContents(index, normalizedDelta);\n return this.update(change);\n }\n\n insertEmbed(index: number, embed: string, value: unknown): Delta {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(\n index: number,\n text: string,\n formats: Record = {},\n ): Delta {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(\n new Delta().retain(index).insert(text, cloneDeep(formats)),\n );\n }\n\n isBlank(): boolean {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const blot = this.scroll.children.head;\n if (blot?.statics.blotName !== Block.blotName) return false;\n const block = blot as Block;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index: number, length: number): Delta {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(\n change: Delta | null,\n mutations: MutationRecord[] = [],\n selectionInfo: SelectionInfo | undefined = undefined,\n ): Delta {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n // @ts-expect-error Fix me later\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target) as Blot;\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n // @ts-expect-error Fix me later\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n // @ts-expect-error\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\ninterface ListItem {\n child: Blot;\n offset: number;\n length: number;\n indent: number;\n type: string;\n}\nfunction convertListHTML(\n items: ListItem[],\n lastIndent: number,\n types: string[],\n): string {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(\n blot: Blot,\n index: number,\n length: number,\n isRoot = false,\n): string {\n if ('html' in blot && typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot instanceof ParentBlot) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items: any[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats =\n 'formats' in child && typeof child.formats === 'function'\n ? child.formats()\n : {};\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts: string[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode as Element;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode instanceof Element ? blot.domNode.outerHTML : '';\n}\n\nfunction combineFormats(\n formats: Record,\n combined: Record,\n): Record {\n return Object.keys(combined).reduce(\n (merged, name) => {\n if (formats[name] == null) return merged;\n const combinedValue = combined[name];\n if (combinedValue === formats[name]) {\n merged[name] = combinedValue;\n } else if (Array.isArray(combinedValue)) {\n if (combinedValue.indexOf(formats[name]) < 0) {\n merged[name] = combinedValue.concat([formats[name]]);\n } else {\n // If style already exists, don't add to an array, but don't lose other styles\n merged[name] = combinedValue;\n }\n } else {\n merged[name] = [combinedValue, formats[name]];\n }\n return merged;\n },\n {} as Record,\n );\n}\n\nfunction getListType(type: string | undefined) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta: Delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }: Range, amount: number) {\n return new Range(index + amount, length);\n}\n\nfunction splitOpLines(ops: Op[]) {\n const split: Op[] = [];\n ops.forEach((op) => {\n if (typeof op.insert === 'string') {\n const lines = op.insert.split('\\n');\n lines.forEach((line, index) => {\n if (index) split.push({ insert: '\\n', attributes: op.attributes });\n if (line) split.push({ insert: line, attributes: op.attributes });\n });\n } else {\n split.push(op);\n }\n });\n\n return split;\n}\n\nexport default Editor;\n", "import type Quill from './quill.js';\n\nabstract class Module {\n static DEFAULTS = {};\n\n constructor(\n public quill: Quill,\n protected options: Partial = {},\n ) {}\n}\n\nexport default Module;\n", "import type { ScrollBlot } from 'parchment';\nimport { EmbedBlot } from 'parchment';\nimport TextBlot from './text.js';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nexport interface EmbedContextRange {\n startNode: Node | Text;\n startOffset: number;\n endNode?: Node | Text;\n endOffset?: number;\n}\n\nclass Embed extends EmbedBlot {\n contentNode: HTMLSpanElement;\n leftGuard: Text;\n rightGuard: Text;\n\n constructor(scroll: ScrollBlot, node: Node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', 'false');\n Array.from(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node: Node, offset: number) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node: Text): EmbedContextRange | null {\n let range: EmbedContextRange | null = null;\n let textNode: Text;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n mutations.forEach((mutation) => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target as Text);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n", "import Embed from '../blots/embed.js';\nimport type Scroll from '../blots/scroll.js';\nimport Emitter from './emitter.js';\n\nclass Composition {\n isComposing = false;\n\n constructor(\n private scroll: Scroll,\n private emitter: Emitter,\n ) {\n this.setupListeners();\n }\n\n private setupListeners() {\n this.scroll.domNode.addEventListener('compositionstart', (event) => {\n if (!this.isComposing) {\n this.handleCompositionStart(event);\n }\n });\n\n this.scroll.domNode.addEventListener('compositionend', (event) => {\n if (this.isComposing) {\n // Webkit makes DOM changes after compositionend, so we use microtask to\n // ensure the order.\n // https://bugs.webkit.org/show_bug.cgi?id=31902\n queueMicrotask(() => {\n this.handleCompositionEnd(event);\n });\n }\n });\n }\n\n private handleCompositionStart(event: CompositionEvent) {\n const blot =\n event.target instanceof Node\n ? this.scroll.find(event.target, true)\n : null;\n\n if (blot && !(blot instanceof Embed)) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START, event);\n this.scroll.batchStart();\n this.emitter.emit(Emitter.events.COMPOSITION_START, event);\n this.isComposing = true;\n }\n }\n\n private handleCompositionEnd(event: CompositionEvent) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END, event);\n this.scroll.batchEnd();\n this.emitter.emit(Emitter.events.COMPOSITION_END, event);\n this.isComposing = false;\n }\n}\n\nexport default Composition;\n", "import type Quill from '../core.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type { ToolbarProps } from '../modules/toolbar.js';\nimport type Uploader from '../modules/uploader.js';\n\nexport interface ThemeOptions {\n modules: Record & {\n toolbar?: null | ToolbarProps;\n };\n}\n\nclass Theme {\n static DEFAULTS: ThemeOptions = {\n modules: {},\n };\n\n static themes = {\n default: Theme,\n };\n\n modules: ThemeOptions['modules'] = {};\n\n constructor(\n protected quill: Quill,\n protected options: ThemeOptions,\n ) {}\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: string): unknown;\n addModule(name: string) {\n // @ts-expect-error\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\n\nexport interface ThemeConstructor {\n new (quill: Quill, options: unknown): Theme;\n DEFAULTS: ThemeOptions;\n}\n\nexport default Theme;\n", "export type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getParentElement = (element: Node): Element | null =>\n element.parentElement || (element.getRootNode() as ShadowRoot).host || null;\n\nconst getElementRect = (element: Element): Rect => {\n const rect = element.getBoundingClientRect();\n const scaleX =\n ('offsetWidth' in element &&\n Math.abs(rect.width) / (element as HTMLElement).offsetWidth) ||\n 1;\n const scaleY =\n ('offsetHeight' in element &&\n Math.abs(rect.height) / (element as HTMLElement).offsetHeight) ||\n 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left,\n };\n};\n\nconst paddingValueToInt = (value: string) => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (\n targetStart: number,\n targetEnd: number,\n scrollStart: number,\n scrollEnd: number,\n scrollPaddingStart: number,\n scrollPaddingEnd: number,\n) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart\n ? targetStart + scrollPaddingStart - scrollStart\n : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\n\nconst scrollRectIntoView = (root: HTMLElement, targetRect: Rect) => {\n const document = root.ownerDocument;\n\n let rect = targetRect;\n\n let current: Element | null = root;\n while (current) {\n const isDocumentBody: boolean = current === document.body;\n const bounding = isDocumentBody\n ? {\n top: 0,\n right:\n window.visualViewport?.width ??\n document.documentElement.clientWidth,\n bottom:\n window.visualViewport?.height ??\n document.documentElement.clientHeight,\n left: 0,\n }\n : getElementRect(current);\n\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(\n rect.left,\n rect.right,\n bounding.left,\n bounding.right,\n paddingValueToInt(style.scrollPaddingLeft),\n paddingValueToInt(style.scrollPaddingRight),\n );\n const scrollDistanceY = getScrollDistance(\n rect.top,\n rect.bottom,\n bounding.top,\n bounding.bottom,\n paddingValueToInt(style.scrollPaddingTop),\n paddingValueToInt(style.scrollPaddingBottom),\n );\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n document.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const { scrollLeft, scrollTop } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop,\n };\n }\n }\n\n current =\n isDocumentBody || style.position === 'fixed'\n ? null\n : getParentElement(current);\n }\n};\n\nexport default scrollRectIntoView;\n", "import { Registry } from 'parchment';\n\nconst MAX_REGISTER_ITERATIONS = 100;\nconst CORE_FORMATS = ['block', 'break', 'cursor', 'inline', 'scroll', 'text'];\n\nconst createRegistryWithFormats = (\n formats: string[],\n sourceRegistry: Registry,\n debug: { error: (errorMessage: string) => void },\n) => {\n const registry = new Registry();\n CORE_FORMATS.forEach((name) => {\n const coreBlot = sourceRegistry.query(name);\n if (coreBlot) registry.register(coreBlot);\n });\n\n formats.forEach((name) => {\n let format = sourceRegistry.query(name);\n if (!format) {\n debug.error(\n `Cannot register \"${name}\" specified in \"formats\" config. Are you sure it was registered?`,\n );\n }\n let iterations = 0;\n while (format) {\n registry.register(format);\n format = 'blotName' in format ? format.requiredContainer ?? null : null;\n\n iterations += 1;\n if (iterations > MAX_REGISTER_ITERATIONS) {\n debug.error(\n `Cycle detected in registering blot requiredContainer: \"${name}\"`,\n );\n break;\n }\n }\n });\n\n return registry;\n};\n\nexport default createRegistryWithFormats;\n", "import { merge } from 'lodash-es';\nimport * as Parchment from 'parchment';\nimport type { Op } from 'quill-delta';\nimport Delta from 'quill-delta';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type Block from '../blots/block.js';\nimport type Scroll from '../blots/scroll.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport Editor from './editor.js';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport instances from './instances.js';\nimport logger from './logger.js';\nimport type { DebugLevel } from './logger.js';\nimport Module from './module.js';\nimport Selection, { Range } from './selection.js';\nimport type { Bounds } from './selection.js';\nimport Composition from './composition.js';\nimport Theme from './theme.js';\nimport type { ThemeConstructor } from './theme.js';\nimport scrollRectIntoView from './utils/scrollRectIntoView.js';\nimport type { Rect } from './utils/scrollRectIntoView.js';\nimport createRegistryWithFormats from './utils/createRegistryWithFormats.js';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\n/**\n * Options for initializing a Quill instance\n */\nexport interface QuillOptions {\n theme?: string;\n debug?: DebugLevel | boolean;\n registry?: Parchment.Registry;\n /**\n * Whether to disable the editing\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * Placeholder text to display when the editor is empty\n * @default \"\"\n */\n placeholder?: string;\n bounds?: HTMLElement | string | null;\n modules?: Record;\n\n /**\n * A list of formats that are recognized and can exist within the editor contents.\n * `null` means all formats are allowed.\n * @default null\n */\n formats?: string[] | null;\n}\n\n/**\n * Similar to QuillOptions, but with all properties expanded to their default values,\n * and all selectors resolved to HTMLElements.\n */\nexport interface ExpandedQuillOptions\n extends Omit {\n theme: ThemeConstructor;\n registry: Parchment.Registry;\n container: HTMLElement;\n modules: Record;\n bounds?: HTMLElement | null;\n readOnly: boolean;\n}\n\nclass Quill {\n static DEFAULTS = {\n bounds: null,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n theme: 'default',\n } satisfies Partial;\n static events = Emitter.events;\n static sources = Emitter.sources;\n static version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\n static imports: Record = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n };\n\n static debug(limit: DebugLevel | boolean) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node: Node, bubble = false) {\n return instances.get(node) || globalRegistry.find(node, bubble);\n }\n\n static import(name: 'core/module'): typeof Module;\n static import(name: `themes/${string}`): typeof Theme;\n static import(name: 'parchment'): typeof Parchment;\n static import(name: 'delta'): typeof Delta;\n static import(name: string): unknown;\n static import(name: string) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(\n targets: Record<\n string,\n | Parchment.RegistryDefinition\n | Record // any objects\n | Theme\n | Module\n | Function // ES5 constructors\n >,\n overwrite?: boolean,\n ): void;\n static register(\n target: Parchment.RegistryDefinition,\n overwrite?: boolean,\n ): void;\n static register(path: string, target: any, overwrite?: boolean): void;\n static register(...args: any[]): void {\n if (typeof args[0] !== 'string') {\n const target = args[0];\n const overwrite = !!args[1];\n\n const name = 'attrName' in target ? target.attrName : target.blotName;\n if (typeof name === 'string') {\n // Shortcut for formats:\n // register(Blot | Attributor, overwrite)\n this.register(`formats/${name}`, target, overwrite);\n } else {\n Object.keys(target).forEach((key) => {\n this.register(key, target[key], overwrite);\n });\n }\n } else {\n const path = args[0];\n const target = args[1];\n const overwrite = !!args[2];\n\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target &&\n typeof target !== 'boolean' &&\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n container: HTMLElement;\n root: HTMLDivElement;\n scroll: Scroll;\n emitter: Emitter;\n protected allowReadOnlyEdits: boolean;\n editor: Editor;\n composition: Composition;\n selection: Selection;\n\n theme: Theme;\n keyboard: Keyboard;\n clipboard: Clipboard;\n history: History;\n uploader: Uploader;\n\n options: ExpandedQuillOptions;\n\n constructor(container: HTMLElement | string, options: QuillOptions = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n debug.error('Invalid Quill container', container);\n return;\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n const scrollBlotName = Parchment.ScrollBlot.blotName;\n const ScrollBlot = this.options.registry.query(scrollBlotName);\n if (!ScrollBlot || !('blotName' in ScrollBlot)) {\n throw new Error(\n `Cannot initialize Quill without \"${scrollBlotName}\" blot`,\n );\n }\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n }) as Scroll;\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.composition = new Composition(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.addModule('input');\n this.theme.addModule('uiNode');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n this.emitter.on(Emitter.events.SCROLL_EMBED_UPDATE, (blot, delta) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => {\n const change = new Delta()\n .retain(blot.offset(this))\n .retain({ [blot.statics.blotName]: delta });\n return this.editor.update(change, [], selectionInfo);\n },\n Quill.sources.USER,\n );\n });\n if (html) {\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n }\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container: string, refNode?: Node | null): HTMLDivElement;\n addContainer(container: HTMLElement, refNode?: Node | null): HTMLElement;\n addContainer(\n container: string | HTMLElement,\n refNode: Node | null = null,\n ): HTMLDivElement | HTMLElement {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(range: Range, source?: EmitterSource): Delta;\n deleteText(index: number, length: number, source?: EmitterSource): Delta;\n deleteText(\n index: number | Range,\n length?: number | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier: () => T): T {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus(options: { preventScroll?: boolean } = {}) {\n this.selection.focus();\n if (!options.preventScroll) {\n this.scrollSelectionIntoView();\n }\n }\n\n format(\n name: string,\n value: unknown,\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string,\n value?: unknown,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string | Record,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n // @ts-expect-error\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(\n range: Range,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number | Range,\n length: number | string,\n name: string | unknown,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n // @ts-expect-error\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index: number | Range, length = 0): Bounds | null {\n let bounds: Bounds | null = null;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n if (!bounds) return null;\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index?: number, length?: number): { [format: string]: unknown };\n getFormat(range?: Range): {\n [format: string]: unknown;\n };\n getFormat(\n index: Range | number = this.getSelection(true),\n length = 0,\n ): { [format: string]: unknown } {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot: Parchment.Blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index: number) {\n return this.scroll.leaf(index);\n }\n\n getLine(index: number) {\n return this.scroll.line(index);\n }\n\n getLines(range: Range): (Block | BlockEmbed)[];\n getLines(index?: number, length?: number): (Block | BlockEmbed)[];\n getLines(\n index: Range | number = 0,\n length = Number.MAX_VALUE,\n ): (Block | BlockEmbed)[] {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name: string) {\n return this.theme.modules[name];\n }\n\n getSelection(focus: true): Range;\n getSelection(focus?: boolean): Range | null;\n getSelection(focus = false): Range | null {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(range: Range): string;\n getSemanticHTML(index?: number, length?: number): string;\n getSemanticHTML(index: Range | number = 0, length?: number) {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(range?: Range): string;\n getText(index?: number, length?: number): string;\n getText(index: Range | number = 0, length?: number): string {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(\n index: number,\n embed: string,\n value: unknown,\n source: EmitterSource = Quill.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index: number, text: string, source?: EmitterSource): Delta;\n insertText(\n index: number,\n text: string,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name?: string | Record | EmitterSource,\n value?: unknown,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n // @ts-expect-error\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args: Parameters<(typeof Emitter)['prototype']['off']>) {\n return this.emitter.off(...args);\n }\n\n on(\n event: (typeof Emitter)['events']['TEXT_CHANGE'],\n handler: (delta: Delta, oldContent: Delta, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['SELECTION_CHANGE'],\n handler: (range: Range, oldRange: Range, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['EDITOR_CHANGE'],\n handler: (\n ...args:\n | [\n (typeof Emitter)['events']['TEXT_CHANGE'],\n Delta,\n Delta,\n EmitterSource,\n ]\n | [\n (typeof Emitter)['events']['SELECTION_CHANGE'],\n Range,\n Range,\n EmitterSource,\n ]\n ) => void,\n ): Emitter;\n on(event: string, ...args: unknown[]): Emitter;\n on(...args: Parameters<(typeof Emitter)['prototype']['on']>): Emitter {\n return this.emitter.on(...args);\n }\n\n once(...args: Parameters<(typeof Emitter)['prototype']['once']>) {\n return this.emitter.once(...args);\n }\n\n removeFormat(index: number, length: number, source?: EmitterSource): Delta {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollRectIntoView(rect: Rect) {\n scrollRectIntoView(this.root, rect);\n }\n\n /**\n * @deprecated Use Quill#scrollSelectionIntoView() instead.\n */\n scrollIntoView() {\n console.warn(\n 'Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.',\n );\n this.scrollSelectionIntoView();\n }\n\n /**\n * Scroll the current selection into the visible area.\n * If the selection is already visible, no scrolling will occur.\n */\n scrollSelectionIntoView() {\n const range = this.selection.lastRange;\n const bounds = range && this.selection.getBounds(range.index, range.length);\n if (bounds) {\n this.scrollRectIntoView(bounds);\n }\n }\n\n setContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n // Quill will set empty editor to \\n\n const delete1 = this.editor.deleteText(0, length);\n const applied = this.editor.insertContents(0, delta);\n // Remove extra \\n from empty editor initialization\n const delete2 = this.editor.deleteText(this.getLength() - 1, 1);\n return delete1.compose(applied).compose(delete2);\n },\n source,\n );\n }\n setSelection(range: Range | null, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(index: number, length?: number, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(\n index: Range | null | number,\n length?: EmitterSource | number,\n source?: EmitterSource,\n ): void {\n if (index == null) {\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.scrollSelectionIntoView();\n }\n }\n }\n\n setText(text: string, source: EmitterSource = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta);\n },\n source,\n true,\n );\n }\n}\n\nfunction resolveSelector(selector: string | HTMLElement | null | undefined) {\n return typeof selector === 'string'\n ? document.querySelector(selector)\n : selector;\n}\n\nfunction expandModuleConfig(config: Record | undefined) {\n return Object.entries(config ?? {}).reduce(\n (expanded, [key, value]) => ({\n ...expanded,\n [key]: value === true ? {} : value,\n }),\n {} as Record,\n );\n}\n\nfunction omitUndefinedValuesFromOptions(obj: QuillOptions) {\n return Object.fromEntries(\n Object.entries(obj).filter((entry) => entry[1] !== undefined),\n );\n}\n\nfunction expandConfig(\n containerOrSelector: HTMLElement | string,\n options: QuillOptions,\n): ExpandedQuillOptions {\n const container = resolveSelector(containerOrSelector);\n if (!container) {\n throw new Error('Invalid Quill container');\n }\n\n const shouldUseDefaultTheme =\n !options.theme || options.theme === Quill.DEFAULTS.theme;\n const theme = shouldUseDefaultTheme\n ? Theme\n : Quill.import(`themes/${options.theme}`);\n if (!theme) {\n throw new Error(`Invalid theme ${options.theme}. Did you register it?`);\n }\n\n const { modules: quillModuleDefaults, ...quillDefaults } = Quill.DEFAULTS;\n const { modules: themeModuleDefaults, ...themeDefaults } = theme.DEFAULTS;\n\n let userModuleOptions = expandModuleConfig(options.modules);\n // Special case toolbar shorthand\n if (\n userModuleOptions != null &&\n userModuleOptions.toolbar &&\n userModuleOptions.toolbar.constructor !== Object\n ) {\n userModuleOptions = {\n ...userModuleOptions,\n toolbar: { container: userModuleOptions.toolbar },\n };\n }\n\n const modules: ExpandedQuillOptions['modules'] = merge(\n {},\n expandModuleConfig(quillModuleDefaults),\n expandModuleConfig(themeModuleDefaults),\n userModuleOptions,\n );\n\n const config = {\n ...quillDefaults,\n ...omitUndefinedValuesFromOptions(themeDefaults),\n ...omitUndefinedValuesFromOptions(options),\n };\n\n let registry = options.registry;\n if (registry) {\n if (options.formats) {\n debug.warn('Ignoring \"formats\" option because \"registry\" is specified');\n }\n } else {\n registry = options.formats\n ? createRegistryWithFormats(options.formats, config.registry, debug)\n : config.registry;\n }\n\n return {\n ...config,\n registry,\n container,\n theme,\n modules: Object.entries(modules).reduce(\n (modulesWithDefaults, [name, value]) => {\n if (!value) return modulesWithDefaults;\n\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n return modulesWithDefaults;\n }\n return {\n ...modulesWithDefaults,\n // @ts-expect-error\n [name]: merge({}, moduleClass.DEFAULTS || {}, value),\n };\n },\n {},\n ),\n bounds: resolveSelector(config.bounds),\n };\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(\n modifier: () => Delta,\n source: EmitterSource,\n index: number | boolean,\n shift: number | null,\n) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n // @ts-expect-error index should always be number\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\ntype NormalizedIndexLength = [\n number,\n number,\n Record,\n EmitterSource,\n];\nfunction overload(index: number, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(range: Range, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: Range | number,\n length?: number | string | Record | EmitterSource,\n name?: string | unknown | Record | EmitterSource,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n): NormalizedIndexLength {\n let formats: Record = {};\n // @ts-expect-error\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n // @ts-expect-error Fix me later\n formats = name;\n // @ts-expect-error\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n // @ts-expect-error\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n // @ts-expect-error\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range: Range, change: Delta, source?: EmitterSource): Range;\nfunction shiftRange(\n range: Range,\n index: number,\n length?: number,\n source?: EmitterSource,\n): Range;\nfunction shiftRange(\n range: Range,\n index: number | Delta,\n lengthOrSource?: number | EmitterSource,\n source?: EmitterSource,\n) {\n const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0;\n if (range == null) return null;\n let start;\n let end;\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (index && typeof index.transformPosition === 'function') {\n [start, end] = [range.index, range.index + range.length].map((pos) =>\n // @ts-expect-error -- TODO: add a better type guard around `index`\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map((pos) => {\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n // @ts-expect-error -- TODO: add a better type guard around `index`\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport type { Bounds, DebugLevel, EmitterSource };\nexport { Parchment, Range };\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n", "import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n", "import { ContainerBlot, LeafBlot, Scope, ScrollBlot } from 'parchment';\nimport type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Emitter from '../core/emitter.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport Block, { BlockEmbed, bubbleFormats } from './block.js';\nimport Break from './break.js';\nimport Container from './container.js';\n\ntype RenderBlock =\n | {\n type: 'blockEmbed';\n attributes: AttributeMap;\n key: string;\n value: unknown;\n }\n | { type: 'block'; attributes: AttributeMap; delta: Delta };\n\nfunction isLine(blot: unknown): blot is Block | BlockEmbed {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\ninterface UpdatableEmbed {\n updateContent(change: unknown): void;\n}\n\nfunction isUpdatable(blot: Blot): blot is Blot & UpdatableEmbed {\n return typeof (blot as unknown as any).updateContent === 'function';\n}\n\nclass Scroll extends ScrollBlot {\n static blotName = 'scroll';\n static className = 'ql-editor';\n static tagName = 'DIV';\n static defaultChild = Block;\n static allowedChildren = [Block, BlockEmbed, Container];\n\n emitter: Emitter;\n batch: false | MutationRecord[];\n\n constructor(\n registry: Registry,\n domNode: HTMLDivElement,\n { emitter }: { emitter: Emitter },\n ) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', (e) => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n emitEmbedUpdate(blot: Blot, change: unknown) {\n this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE, blot, change);\n }\n\n deleteAt(index: number, length: number) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n\n formatAt(index: number, length: number, format: string, value: unknown) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(\n this.statics.defaultChild.blotName,\n ) as Parent;\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n insertContents(index: number, delta: Delta) {\n const renderBlocks = this.deltaToRenderBlocks(\n delta.concat(new Delta().insert('\\n')),\n );\n const last = renderBlocks.pop();\n if (last == null) return;\n\n this.batchStart();\n\n const first = renderBlocks.shift();\n if (first) {\n const shouldInsertNewlineChar =\n first.type === 'block' &&\n (first.delta.length() === 0 ||\n (!this.descendant(BlockEmbed, index)[0] && index < this.length()));\n const delta =\n first.type === 'block'\n ? first.delta\n : new Delta().insert({ [first.key]: first.value });\n insertInlineContents(this, index, delta);\n const newlineCharLength = first.type === 'block' ? 1 : 0;\n const lineEndIndex = index + delta.length() + newlineCharLength;\n if (shouldInsertNewlineChar) {\n this.insertAt(lineEndIndex - 1, '\\n');\n }\n\n const formats = bubbleFormats(this.line(index)[0]);\n const attributes = AttributeMap.diff(formats, first.attributes) || {};\n Object.keys(attributes).forEach((name) => {\n this.formatAt(lineEndIndex - 1, 1, name, attributes[name]);\n });\n\n index = lineEndIndex;\n }\n\n let [refBlot, refBlotOffset] = this.children.find(index);\n if (renderBlocks.length) {\n if (refBlot) {\n refBlot = refBlot.split(refBlotOffset);\n refBlotOffset = 0;\n }\n\n renderBlocks.forEach((renderBlock) => {\n if (renderBlock.type === 'block') {\n const block = this.createBlock(\n renderBlock.attributes,\n refBlot || undefined,\n );\n insertInlineContents(block, 0, renderBlock.delta);\n } else {\n const blockEmbed = this.create(\n renderBlock.key,\n renderBlock.value,\n ) as EmbedBlot;\n this.insertBefore(blockEmbed, refBlot || undefined);\n Object.keys(renderBlock.attributes).forEach((name) => {\n blockEmbed.format(name, renderBlock.attributes[name]);\n });\n }\n });\n }\n\n if (last.type === 'block' && last.delta.length()) {\n const offset = refBlot\n ? refBlot.offset(refBlot.scroll) + refBlotOffset\n : this.length();\n insertInlineContents(this, offset, last.delta);\n }\n\n this.batchEnd();\n this.optimize();\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index: number): [LeafBlot | null, number] {\n const last = this.path(index).pop();\n if (!last) {\n return [null, -1];\n }\n\n const [blot, offset] = last;\n return blot instanceof LeafBlot ? [blot, offset] : [null, -1];\n }\n\n line(index: number): [Block | BlockEmbed | null, number] {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n // @ts-expect-error TODO: make descendant() generic\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE): (Block | BlockEmbed)[] {\n const getLines = (\n blot: ParentBlot,\n blotIndex: number,\n blotLength: number,\n ) => {\n let lines: (Block | BlockEmbed)[] = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(context?: { [key: string]: any }): void;\n optimize(\n mutations?: MutationRecord[],\n context?: { [key: string]: any },\n ): void;\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index: number) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(source?: EmitterSource): void;\n update(mutations?: MutationRecord[]): void;\n update(mutations?: MutationRecord[] | EmitterSource): void {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source: EmitterSource = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n mutations = mutations.filter(({ target }) => {\n const blot = this.find(target, true);\n return blot && !isUpdatable(blot);\n });\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n\n updateEmbedAt(index: number, key: string, change: unknown) {\n // Currently it only supports top-level embeds (BlockEmbed).\n // We can update `ParentBlot` in parchment to support inline embeds.\n const [blot] = this.descendant((b: Blot) => b instanceof BlockEmbed, index);\n if (blot && blot.statics.blotName === key && isUpdatable(blot)) {\n blot.updateContent(change);\n }\n }\n\n protected handleDragStart(event: DragEvent) {\n event.preventDefault();\n }\n\n private deltaToRenderBlocks(delta: Delta) {\n const renderBlocks: RenderBlock[] = [];\n\n let currentBlockDelta = new Delta();\n delta.forEach((op) => {\n const insert = op?.insert;\n if (!insert) return;\n if (typeof insert === 'string') {\n const splitted = insert.split('\\n');\n splitted.slice(0, -1).forEach((text) => {\n currentBlockDelta.insert(text, op.attributes);\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: op.attributes ?? {},\n });\n currentBlockDelta = new Delta();\n });\n const last = splitted[splitted.length - 1];\n if (last) {\n currentBlockDelta.insert(last, op.attributes);\n }\n } else {\n const key = Object.keys(insert)[0];\n if (!key) return;\n if (this.query(key, Scope.INLINE)) {\n currentBlockDelta.push(op);\n } else {\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n currentBlockDelta = new Delta();\n renderBlocks.push({\n type: 'blockEmbed',\n key,\n value: insert[key],\n attributes: op.attributes ?? {},\n });\n }\n }\n });\n\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n\n return renderBlocks;\n }\n\n private createBlock(attributes: AttributeMap, refBlot?: Blot) {\n let blotName: string | undefined;\n const formats: AttributeMap = {};\n\n Object.entries(attributes).forEach(([key, value]) => {\n const isBlockBlot = this.query(key, Scope.BLOCK & Scope.BLOT) != null;\n if (isBlockBlot) {\n blotName = key;\n } else {\n formats[key] = value;\n }\n });\n\n const block = this.create(\n blotName || this.statics.defaultChild.blotName,\n blotName ? attributes[blotName] : undefined,\n ) as ParentBlot;\n\n this.insertBefore(block, refBlot || undefined);\n\n const length = block.length();\n Object.entries(formats).forEach(([key, value]) => {\n block.formatAt(0, length, key, value);\n });\n\n return block;\n }\n}\n\nfunction insertInlineContents(\n parent: ParentBlot,\n index: number,\n inlineContents: Delta,\n) {\n inlineContents.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n const text = op.insert;\n parent.insertAt(index, text);\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n parent.insertAt(index, key, op.insert[key]);\n const isInlineEmbed = parent.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n Object.keys(attributes).forEach((key) => {\n parent.formatAt(index, length, key, attributes[key]);\n });\n return index + length;\n }, index);\n}\n\nexport default Scroll;\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode: HTMLElement) {\n let value = super.value(domNode) as string;\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map((component) => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n", "import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color.js';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n", "import Block from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport Cursor from '../blots/cursor.js';\nimport Inline from '../blots/inline.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport Container from '../blots/container.js';\nimport Quill from '../core/quill.js';\n\nclass CodeBlockContainer extends Container {\n static create(value: string) {\n const domNode = super.create(value) as Element;\n domNode.setAttribute('spellcheck', 'false');\n return domNode;\n }\n\n code(index: number, length: number) {\n return (\n this.children\n // @ts-expect-error\n .map((child) => (child.length() <= 1 ? '' : child.domNode.innerText))\n .join('\\n')\n .slice(index, index + length)\n );\n }\n\n html(index: number, length: number) {\n // `\\n`s are needed in order to support empty lines at the beginning and the end.\n // https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\n return `
    \\n${escapeText(this.code(index, length))}\\n
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static TAB = ' ';\n\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node: HTMLElement) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n", "import { cloneDeep, isEqual } from 'lodash-es';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport type { Blot, BlockBlot } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nexport interface Context {\n collapsed: boolean;\n empty: boolean;\n offset: number;\n prefix: string;\n suffix: string;\n format: Record;\n event: KeyboardEvent;\n line: BlockEmbed | BlockBlot;\n}\n\ninterface BindingObject\n extends Partial> {\n key: number | string | string[];\n shortKey?: boolean | null;\n shiftKey?: boolean | null;\n altKey?: boolean | null;\n metaKey?: boolean | null;\n ctrlKey?: boolean | null;\n prefix?: RegExp;\n suffix?: RegExp;\n format?: Record | string[];\n handler?: (\n this: { quill: Quill },\n range: Range,\n curContext: Context,\n // eslint-disable-next-line no-use-before-define\n binding: NormalizedBinding,\n ) => boolean | void;\n}\n\ntype Binding = BindingObject | string | number;\n\ninterface NormalizedBinding extends Omit {\n key: string | number;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\nclass Keyboard extends Module {\n static DEFAULTS: KeyboardOptions;\n\n static match(evt: KeyboardEvent, binding: BindingObject) {\n if (\n (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'] as const).some((key) => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n bindings: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.bindings = {};\n // @ts-expect-error Fix me later\n Object.keys(this.options.bindings).forEach((name) => {\n // @ts-expect-error Fix me later\n if (this.options.bindings[name]) {\n // @ts-expect-error Fix me later\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(\n keyBinding: Binding,\n context:\n | Required\n | Partial> = {},\n handler:\n | Required\n | Partial> = {},\n ) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach((key) => {\n const singleBinding = {\n ...binding,\n key,\n ...context,\n ...handler,\n };\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented || evt.isComposing) return;\n\n // evt.isComposing is false when pressing Enter/Backspace when composing in Safari\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n const isComposing =\n evt.keyCode === 229 && (evt.key === 'Enter' || evt.key === 'Backspace');\n if (isComposing) return;\n\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter((binding) =>\n Keyboard.match(evt, binding),\n );\n if (matches.length === 0) return;\n // @ts-expect-error\n const blot = Quill.find(evt.target, true);\n if (blot && blot.scroll !== this.quill.scroll) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n // @ts-expect-error Fix me later\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some((binding) => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every((name) => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every((name) => {\n // @ts-expect-error Fix me later\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n // @ts-expect-error Fix me later\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n // @ts-expect-error Fix me later\n return isEqual(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n // @ts-expect-error Fix me later\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range: Range, context: Context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const isPrevLineEmpty =\n prev.statics.blotName === 'block' && prev.length() <= 1;\n if (!isPrevLineEmpty) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range: Range, context: Context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n // @ts-expect-error Fix me later\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n this.quill.focus();\n }\n\n handleEnter(range: Range, context: Context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats: Record, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n }\n}\n\nconst defaultOptions: KeyboardOptions = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats: Record = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = {\n // @ts-expect-error Fix me later\n ...line.formats(),\n list: 'checked',\n };\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n // @ts-expect-error\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n 'code-block': false,\n blockquote: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n // @ts-expect-error Fix me later\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n // @ts-expect-error\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nKeyboard.DEFAULTS = defaultOptions;\n\nfunction makeCodeBlockHandler(indent: boolean): BindingObject {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range, { event }) {\n const CodeBlock = this.quill.scroll.query('code-block');\n // @ts-expect-error\n const { TAB } = CodeBlock;\n if (range.length === 0 && !event.shiftKey) {\n this.quill.insertText(range.index, TAB, Quill.sources.USER);\n this.quill.setSelection(range.index + TAB.length, Quill.sources.SILENT);\n return;\n }\n\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, TAB);\n if (i === 0) {\n index += TAB.length;\n } else {\n length += TAB.length;\n }\n // @ts-expect-error Fix me later\n } else if (line.domNode.textContent.startsWith(TAB)) {\n line.deleteAt(0, TAB.length);\n if (i === 0) {\n index -= TAB.length;\n } else {\n length -= TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(\n key: string,\n shiftKey: boolean | null,\n): BindingObject {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format: string): BindingObject {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up: boolean): BindingObject {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n // @ts-expect-error\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n // @ts-expect-error\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n // @ts-expect-error\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding: Binding): BindingObject | null {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = cloneDeep(binding);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n// TODO: Move into quill.ts or editor.ts\nfunction deleteRange({ quill, range }: { quill: Quill; range: Range }) {\n const lines = quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n quill.setSelection(range.index, Quill.sources.SILENT);\n}\n\nfunction tableSide(_table: unknown, row: Blot, cell: Blot, offset: number) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize, deleteRange };\n", "const normalWeightRegexp = /font-weight:\\s*normal/;\nconst blockTagNames = ['P', 'OL', 'UL'];\n\nconst isBlockElement = (element: Element | null) => {\n return element && blockTagNames.includes(element.tagName);\n};\n\nconst normalizeEmptyLines = (doc: Document) => {\n Array.from(doc.querySelectorAll('br'))\n .filter(\n (br) =>\n isBlockElement(br.previousElementSibling) &&\n isBlockElement(br.nextElementSibling),\n )\n .forEach((br) => {\n br.parentNode?.removeChild(br);\n });\n};\n\nconst normalizeFontWeight = (doc: Document) => {\n Array.from(doc.querySelectorAll('b[style*=\"font-weight\"]'))\n .filter((node) => node.getAttribute('style')?.match(normalWeightRegexp))\n .forEach((node) => {\n const fragment = doc.createDocumentFragment();\n fragment.append(...node.childNodes);\n node.parentNode?.replaceChild(fragment, node);\n });\n};\n\nexport default function normalize(doc: Document) {\n if (doc.querySelector('[id^=\"docs-internal-guid-\"]')) {\n normalizeFontWeight(doc);\n normalizeEmptyLines(doc);\n }\n}\n", "const ignoreRegexp = /\\bmso-list:[^;]*ignore/i;\nconst idRegexp = /\\bmso-list:[^;]*\\bl(\\d+)/i;\nconst indentRegexp = /\\bmso-list:[^;]*\\blevel(\\d+)/i;\n\nconst parseListItem = (element: Element, html: string) => {\n const style = element.getAttribute('style');\n const idMatch = style?.match(idRegexp);\n if (!idMatch) {\n return null;\n }\n const id = Number(idMatch[1]);\n\n const indentMatch = style?.match(indentRegexp);\n const indent = indentMatch ? Number(indentMatch[1]) : 1;\n\n const typeRegexp = new RegExp(\n `@list l${id}:level${indent}\\\\s*\\\\{[^\\\\}]*mso-level-number-format:\\\\s*([\\\\w-]+)`,\n 'i',\n );\n const typeMatch = html.match(typeRegexp);\n const type = typeMatch && typeMatch[1] === 'bullet' ? 'bullet' : 'ordered';\n\n return { id, indent, type, element };\n};\n\n// list items are represented as `p` tags with styles like `mso-list: l0 level1` where:\n// 1. \"0\" in \"l0\" means the list item id;\n// 2. \"1\" in \"level1\" means the indent level, starting from 1.\nconst normalizeListItem = (doc: Document) => {\n const msoList = Array.from(doc.querySelectorAll('[style*=mso-list]'));\n const ignored: Element[] = [];\n const others: Element[] = [];\n msoList.forEach((node) => {\n const shouldIgnore = (node.getAttribute('style') || '').match(ignoreRegexp);\n if (shouldIgnore) {\n ignored.push(node);\n } else {\n others.push(node);\n }\n });\n\n // Each list item contains a marker wrapped with \"mso-list: Ignore\".\n ignored.forEach((node) => node.parentNode?.removeChild(node));\n\n // The list stype is not defined inline with the tag, instead, it's in the\n // style tag so we need to pass the html as a string.\n const html = doc.documentElement.innerHTML;\n const listItems = others\n .map((element) => parseListItem(element, html))\n .filter((parsed) => parsed);\n\n while (listItems.length) {\n const childListItems = [];\n\n let current = listItems.shift();\n // Group continuous items into the same group (aka \"ul\")\n while (current) {\n childListItems.push(current);\n current =\n listItems.length &&\n listItems[0]?.element === current.element.nextElementSibling &&\n // Different id means the next item doesn't belong to this group.\n listItems[0].id === current.id\n ? listItems.shift()\n : null;\n }\n\n const ul = document.createElement('ul');\n childListItems.forEach((listItem) => {\n const li = document.createElement('li');\n li.setAttribute('data-list', listItem.type);\n if (listItem.indent > 1) {\n li.setAttribute('class', `ql-indent-${listItem.indent - 1}`);\n }\n li.innerHTML = listItem.element.innerHTML;\n ul.appendChild(li);\n });\n\n const element = childListItems[0]?.element;\n const { parentNode } = element ?? {};\n if (element) {\n parentNode?.replaceChild(ul, element);\n }\n childListItems.slice(1).forEach(({ element: e }) => {\n parentNode?.removeChild(e);\n });\n }\n};\n\nexport default function normalize(doc: Document) {\n if (\n doc.documentElement.getAttribute('xmlns:w') ===\n 'urn:schemas-microsoft-com:office:word'\n ) {\n normalizeListItem(doc);\n }\n}\n", "import googleDocs from './normalizers/googleDocs.js';\nimport msWord from './normalizers/msWord.js';\n\nconst NORMALIZERS = [msWord, googleDocs];\n\nconst normalizeExternalHTML = (doc: Document) => {\n if (doc.documentElement) {\n NORMALIZERS.forEach((normalize) => {\n normalize(doc);\n });\n }\n};\n\nexport default normalizeExternalHTML;\n", "import type { ScrollBlot } from 'parchment';\nimport {\n Attributor,\n BlockBlot,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n} from 'parchment';\nimport Delta from 'quill-delta';\nimport { BlockEmbed } from '../blots/block.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { AlignAttribute, AlignStyle } from '../formats/align.js';\nimport { BackgroundStyle } from '../formats/background.js';\nimport CodeBlock from '../formats/code.js';\nimport { ColorStyle } from '../formats/color.js';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction.js';\nimport { FontStyle } from '../formats/font.js';\nimport { SizeStyle } from '../formats/size.js';\nimport { deleteRange } from './keyboard.js';\nimport normalizeExternalHTML from './normalizeExternalHTML/index.js';\n\nconst debug = logger('quill:clipboard');\n\ntype Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];\ntype Matcher = (node: Node, delta: Delta, scroll: ScrollBlot) => Delta;\n\nconst CLIPBOARD_CONFIG: [Selector, Matcher][] = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', createMatchAlias('bold')],\n ['i', createMatchAlias('italic')],\n ['strike', createMatchAlias('strike')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\ninterface ClipboardOptions {\n matchers: [Selector, Matcher][];\n}\n\nclass Clipboard extends Module {\n static DEFAULTS: ClipboardOptions = {\n matchers: [],\n };\n\n matchers: [Selector, Matcher][];\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.root.addEventListener('copy', (e) =>\n this.onCaptureCopy(e, false),\n );\n this.quill.root.addEventListener('cut', (e) => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers ?? []).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector: Selector, matcher: Matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(\n { html, text }: { html?: string; text?: string },\n formats: Record = {},\n ) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text || '', {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '', formats);\n }\n const delta = this.convertHTML(html);\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n protected normalizeHTML(doc: Document) {\n normalizeExternalHTML(doc);\n }\n\n protected convertHTML(html: string) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n this.normalizeHTML(doc);\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n return traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n }\n\n dangerouslyPasteHTML(html: string, source?: EmitterSource): void;\n dangerouslyPasteHTML(\n index: number,\n html: string,\n source?: EmitterSource,\n ): void;\n dangerouslyPasteHTML(\n index: number | string,\n html?: string,\n source: EmitterSource = Quill.sources.API,\n ) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n // @ts-expect-error\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e: ClipboardEvent, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData?.setData('text/plain', text);\n e.clipboardData?.setData('text/html', html);\n if (isCut) {\n deleteRange({ range, quill: this.quill });\n }\n }\n\n /*\n * https://www.iana.org/assignments/media-types/text/uri-list\n */\n private normalizeURIList(urlList: string) {\n return (\n urlList\n .split(/\\r?\\n/)\n // Ignore all comments\n .filter((url) => url[0] !== '#')\n .join('\\n')\n );\n }\n\n onCapturePaste(e: ClipboardEvent) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData?.getData('text/html');\n let text = e.clipboardData?.getData('text/plain');\n if (!html && !text) {\n const urlList = e.clipboardData?.getData('text/uri-list');\n if (urlList) {\n text = this.normalizeURIList(urlList);\n }\n }\n const files = Array.from(e.clipboardData?.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n return;\n }\n if (html && files.length > 0) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n if (\n doc.body.childElementCount === 1 &&\n doc.body.firstElementChild?.tagName === 'IMG'\n ) {\n this.quill.uploader.upload(range, files);\n return;\n }\n }\n this.onPaste(range, { html, text });\n }\n\n onCopy(range: Range, isCut: boolean): { html: string; text: string };\n onCopy(range: Range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range: Range, { text, html }: { text?: string; html?: string }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollSelectionIntoView();\n }\n\n prepareMatching(container: Element, nodeMatches: WeakMap) {\n const elementMatchers: Matcher[] = [];\n const textMatchers: Matcher[] = [];\n this.matchers.forEach((pair) => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach((node) => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches?.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\n\nfunction applyFormat(\n delta: Delta,\n format: string,\n value: unknown,\n scroll: ScrollBlot,\n): Delta {\n if (!scroll.query(format)) {\n return delta;\n }\n\n return delta.reduce((newDelta, op) => {\n if (!op.insert) return newDelta;\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n const formats = value ? { [format]: value } : {};\n return newDelta.insert(op.insert, { ...formats, ...op.attributes });\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta: Delta, text: string) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node: Node, scroll: ScrollBlot) {\n if (!(node instanceof Element)) return false;\n const match = scroll.query(node);\n // @ts-expect-error\n if (match && match.prototype instanceof EmbedBlot) return false;\n\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nfunction isBetweenInlineElements(node: HTMLElement, scroll: ScrollBlot) {\n return (\n node.previousElementSibling &&\n node.nextElementSibling &&\n !isLine(node.previousElementSibling, scroll) &&\n !isLine(node.nextElementSibling, scroll)\n );\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node: Node | null) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n // @ts-expect-error\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(\n scroll: ScrollBlot,\n node: ChildNode,\n elementMatchers: Matcher[],\n textMatchers: Matcher[],\n nodeMatches: WeakMap,\n): Delta {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta: Delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode as HTMLElement, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction createMatchAlias(format: string) {\n return (_node: Element, delta: Delta, scroll: ScrollBlot) => {\n return applyFormat(delta, format, true, scroll);\n };\n}\n\nfunction matchAttributor(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats: Record = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n let attr = scroll.query(name, Scope.ATTRIBUTE) as Attributor;\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n\n return Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n}\n\nfunction matchBlot(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (match == null) return delta;\n // @ts-expect-error\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n // @ts-expect-error\n const value = match.value(node);\n if (value != null) {\n // @ts-expect-error\n embed[match.blotName] = value;\n // @ts-expect-error\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n // @ts-expect-error\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (\n 'blotName' in match &&\n 'formats' in match &&\n typeof match.formats === 'function'\n ) {\n return applyFormat(\n delta,\n match.blotName,\n match.formats(node, scroll),\n scroll,\n );\n }\n }\n return delta;\n}\n\nfunction matchBreak(node: Node, delta: Delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query('code-block');\n const language =\n match && 'formats' in match && typeof match.formats === 'function'\n ? match.formats(node, scroll)\n : true;\n return applyFormat(delta, 'code-block', language, scroll);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (\n match == null ||\n // @ts-expect-error\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n // @ts-expect-error\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (!op.insert) return composed;\n if (op.attributes && typeof op.attributes.indent === 'number') {\n return composed.push(op);\n }\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node: Node, delta: Delta, scroll: ScrollBlot) {\n const element = node as Element;\n let list = element.tagName === 'OL' ? 'ordered' : 'bullet';\n\n const checkedAttr = element.getAttribute('data-checked');\n if (checkedAttr) {\n list = checkedAttr === 'true' ? 'checked' : 'unchecked';\n }\n\n return applyFormat(delta, 'list', list, scroll);\n}\n\nfunction matchNewline(node: Node, delta: Delta, scroll: ScrollBlot) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (\n isLine(node, scroll) &&\n (node.childNodes.length > 0 || node instanceof HTMLParagraphElement)\n ) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let nextSibling: Node | null = node.nextSibling;\n while (nextSibling != null) {\n if (isLine(nextSibling, scroll)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n // @ts-expect-error\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const formats: Record = {};\n const style: Partial = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight?.startsWith('bold') ||\n // @ts-expect-error Fix me later\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n delta = Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n // @ts-expect-error\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(\n node: HTMLTableRowElement,\n delta: Delta,\n scroll: ScrollBlot,\n) {\n const table =\n node.parentElement?.tagName === 'TABLE'\n ? node.parentElement\n : node.parentElement?.parentElement;\n if (table != null) {\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row, scroll);\n }\n return delta;\n}\n\nfunction matchText(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n // @ts-expect-error\n let text = node.data;\n // Word represents empty line with  \n if (node.parentElement?.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!isPre(node)) {\n if (\n text.trim().length === 0 &&\n text.includes('\\n') &&\n !isBetweenInlineElements(node, scroll)\n ) {\n return delta;\n }\n const replacer = (collapse: unknown, match: string) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.previousSibling instanceof Element &&\n isLine(node.previousSibling, scroll))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.nextSibling instanceof Element && isLine(node.nextSibling, scroll))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n", "import { Scope } from 'parchment';\nimport type Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type Scroll from '../blots/scroll.js';\nimport type { Range } from '../core/selection.js';\n\nexport interface HistoryOptions {\n userOnly: boolean;\n delay: number;\n maxStack: number;\n}\n\nexport interface StackItem {\n delta: Delta;\n range: Range | null;\n}\n\ninterface Stack {\n undo: StackItem[];\n redo: StackItem[];\n}\n\nclass History extends Module {\n static DEFAULTS: HistoryOptions = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n };\n\n lastRecorded = 0;\n ignoreChange = false;\n stack: Stack = { undo: [], redo: [] };\n currentRange: Range | null = null;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, value, oldValue, source) => {\n if (eventName === Quill.events.SELECTION_CHANGE) {\n if (value && source !== Quill.sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === Quill.events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n\n this.currentRange = transformRange(this.currentRange, value);\n }\n },\n );\n\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: ['z', 'Z'], shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n\n this.quill.root.addEventListener('beforeinput', (event) => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n\n change(source: 'undo' | 'redo', dest: 'redo' | 'undo') {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta),\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, Quill.sources.USER);\n this.ignoreChange = false;\n\n this.restoreSelection(item);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta: Delta, oldDelta: Delta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({ delta: undoDelta, range: undoRange });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta: Delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n\n protected restoreSelection(stackItem: StackItem) {\n if (stackItem.range) {\n this.quill.setSelection(stackItem.range, Quill.sources.USER);\n } else {\n const index = getLastChangeIndex(this.quill.scroll, stackItem.delta);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n}\n\nfunction transformStack(stack: StackItem[], delta: Delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldItem = stack[i];\n stack[i] = {\n delta: remoteDelta.transform(oldItem.delta, true),\n range: oldItem.range && transformRange(oldItem.range, remoteDelta),\n };\n remoteDelta = oldItem.delta.transform(remoteDelta);\n if (stack[i].delta.length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll: Scroll, delta: Delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some((attr) => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll: Scroll, delta: Delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nfunction transformRange(range: Range | null, delta: Delta) {\n if (!range) return range;\n const start = delta.transformPosition(range.index);\n const end = delta.transformPosition(range.index + range.length);\n return { index: start, length: end - start };\n}\n\nexport { History as default, getLastChangeIndex };\n", "import Delta from 'quill-delta';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\ninterface UploaderOptions {\n mimetypes: string[];\n handler: (this: { quill: Quill }, range: Range, files: File[]) => void;\n}\n\nclass Uploader extends Module {\n static DEFAULTS: UploaderOptions;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n quill.root.addEventListener('drop', (e) => {\n e.preventDefault();\n let native: ReturnType | null = null;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n // @ts-expect-error\n } else if (document.caretPositionFromPoint) {\n // @ts-expect-error\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n }\n\n const normalized = native && quill.selection.normalizeNative(native);\n if (normalized) {\n const range = quill.selection.normalizedToRange(normalized);\n if (e.dataTransfer?.files) {\n this.upload(range, e.dataTransfer.files);\n }\n }\n });\n }\n\n upload(range: Range, files: FileList | File[]) {\n const uploads: File[] = [];\n Array.from(files).forEach((file) => {\n if (file && this.options.mimetypes?.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n // @ts-expect-error Fix me later\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range: Range, files: File[]) {\n if (!this.quill.scroll.query('image')) {\n return;\n }\n const promises = files.map>((file) => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then((images) => {\n const update = images.reduce((delta: Delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length)) as Delta;\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n", "import Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { deleteRange } from './keyboard.js';\n\nconst INSERT_TYPES = ['insertText', 'insertReplacementText'];\n\nclass Input extends Module {\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n quill.root.addEventListener('beforeinput', (event) => {\n this.handleBeforeInput(event);\n });\n\n // Gboard with English input on Android triggers `compositionstart` sometimes even\n // users are not going to type anything.\n if (!/Android/i.test(navigator.userAgent)) {\n quill.on(Quill.events.COMPOSITION_BEFORE_START, () => {\n this.handleCompositionStart();\n });\n }\n }\n\n private deleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n }\n\n private replaceText(range: Range, text = '') {\n if (range.length === 0) return false;\n\n if (text) {\n // Follow the native behavior that inherits the formats of the first character\n const formats = this.quill.getFormat(range.index, 1);\n this.deleteRange(range);\n this.quill.updateContents(\n new Delta().retain(range.index).insert(text, formats),\n Quill.sources.USER,\n );\n } else {\n this.deleteRange(range);\n }\n\n this.quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT);\n return true;\n }\n\n private handleBeforeInput(event: InputEvent) {\n if (\n this.quill.composition.isComposing ||\n event.defaultPrevented ||\n !INSERT_TYPES.includes(event.inputType)\n ) {\n return;\n }\n\n const staticRange = event.getTargetRanges\n ? event.getTargetRanges()[0]\n : null;\n if (!staticRange || staticRange.collapsed === true) {\n return;\n }\n\n const text = getPlainTextFromInputEvent(event);\n if (text == null) {\n return;\n }\n const normalized = this.quill.selection.normalizeNative(staticRange);\n const range = normalized\n ? this.quill.selection.normalizedToRange(normalized)\n : null;\n if (range && this.replaceText(range, text)) {\n event.preventDefault();\n }\n }\n\n private handleCompositionStart() {\n const range = this.quill.getSelection();\n if (range) {\n this.replaceText(range);\n }\n }\n}\n\nfunction getPlainTextFromInputEvent(event: InputEvent) {\n // When `inputType` is \"insertText\":\n // - `event.data` should be string (Safari uses `event.dataTransfer`).\n // - `event.dataTransfer` should be null.\n // When `inputType` is \"insertReplacementText\":\n // - `event.data` should be null.\n // - `event.dataTransfer` should contain \"text/plain\" data.\n\n if (typeof event.data === 'string') {\n return event.data;\n }\n if (event.dataTransfer?.types.includes('text/plain')) {\n return event.dataTransfer.getData('text/plain');\n }\n return null;\n}\n\nexport default Input;\n", "import { ParentBlot } from 'parchment';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\n\nconst isMac = /Mac/i.test(navigator.platform);\n\n// Export for testing\nexport const TTL_FOR_VALID_SELECTION_CHANGE = 100;\n\n// A loose check to determine if the shortcut can move the caret before a UI node:\n// [CARET]
    [CONTENT]
    \nconst canMoveCaretBeforeUINode = (event: KeyboardEvent) => {\n if (\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' || // RTL scripts or moving from the end of the previous line\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n event.key === 'Home'\n ) {\n return true;\n }\n\n if (isMac && event.key === 'a' && event.ctrlKey === true) {\n return true;\n }\n\n return false;\n};\n\nclass UINode extends Module {\n isListening = false;\n selectionChangeDeadline = 0;\n\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n this.handleArrowKeys();\n this.handleNavigationShortcuts();\n }\n\n private handleArrowKeys() {\n this.quill.keyboard.addBinding({\n key: ['ArrowLeft', 'ArrowRight'],\n offset: 0,\n shiftKey: null,\n handler(range, { line, event }) {\n if (!(line instanceof ParentBlot) || !line.uiNode) {\n return true;\n }\n\n const isRTL = getComputedStyle(line.domNode)['direction'] === 'rtl';\n if (\n (isRTL && event.key !== 'ArrowRight') ||\n (!isRTL && event.key !== 'ArrowLeft')\n ) {\n return true;\n }\n\n this.quill.setSelection(\n range.index - 1,\n range.length + (event.shiftKey ? 1 : 0),\n Quill.sources.USER,\n );\n return false;\n },\n });\n }\n\n private handleNavigationShortcuts() {\n this.quill.root.addEventListener('keydown', (event) => {\n if (!event.defaultPrevented && canMoveCaretBeforeUINode(event)) {\n this.ensureListeningToSelectionChange();\n }\n });\n }\n\n /**\n * We only listen to the `selectionchange` event when\n * there is an intention of moving the caret to the beginning using shortcuts.\n * This is primarily implemented to prevent infinite loops, as we are changing\n * the selection within the handler of a `selectionchange` event.\n */\n private ensureListeningToSelectionChange() {\n this.selectionChangeDeadline = Date.now() + TTL_FOR_VALID_SELECTION_CHANGE;\n\n if (this.isListening) return;\n this.isListening = true;\n\n const listener = () => {\n this.isListening = false;\n\n if (Date.now() <= this.selectionChangeDeadline) {\n this.handleSelectionChange();\n }\n };\n\n document.addEventListener('selectionchange', listener, {\n once: true,\n });\n }\n\n private handleSelectionChange() {\n const selection = document.getSelection();\n if (!selection) return;\n const range = selection.getRangeAt(0);\n if (range.collapsed !== true || range.startOffset !== 0) return;\n\n const line = this.quill.scroll.find(range.startContainer);\n if (!(line instanceof ParentBlot) || !line.uiNode) return;\n\n const newRange = document.createRange();\n newRange.setStartAfter(line.uiNode);\n newRange.setEndAfter(line.uiNode);\n selection.removeAllRanges();\n selection.addRange(newRange);\n }\n}\n\nexport default UINode;\n", "import Quill, { Parchment, Range } from './core/quill.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core/quill.js';\n\nimport Block, { BlockEmbed } from './blots/block.js';\nimport Break from './blots/break.js';\nimport Container from './blots/container.js';\nimport Cursor from './blots/cursor.js';\nimport Embed from './blots/embed.js';\nimport Inline from './blots/inline.js';\nimport Scroll from './blots/scroll.js';\nimport TextBlot from './blots/text.js';\n\nimport Clipboard from './modules/clipboard.js';\nimport History from './modules/history.js';\nimport Keyboard from './modules/keyboard.js';\nimport Uploader from './modules/uploader.js';\nimport Delta, { Op, OpIterator, AttributeMap } from 'quill-delta';\nimport Input from './modules/input.js';\nimport UINode from './modules/uiNode.js';\n\nexport { default as Module } from './core/module.js';\nexport { Delta, Op, OpIterator, AttributeMap, Parchment, Range };\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n 'modules/input': Input,\n 'modules/uiNode': UINode,\n});\n\nexport default Quill;\n", "import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node: HTMLElement, value: string | number) {\n let normalizedValue = 0;\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n normalizedValue = value === '+1' ? indent + 1 : indent - 1;\n } else if (typeof value === 'number') {\n normalizedValue = value;\n }\n if (normalizedValue === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, normalizedValue.toString());\n }\n\n canAdd(node: HTMLElement, value: string) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node: HTMLElement) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n // @ts-expect-error\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n", "import Block from '../blots/block.js';\n\nclass Blockquote extends Block {\n static blotName = 'blockquote';\n static tagName = 'blockquote';\n}\n\nexport default Blockquote;\n", "import Block from '../blots/block.js';\n\nclass Header extends Block {\n static blotName = 'header';\n static tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n static formats(domNode: Element) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\n\nexport default Header;\n", "import Block from '../blots/block.js';\nimport Container from '../blots/container.js';\nimport type Scroll from '../blots/scroll.js';\nimport Quill from '../core/quill.js';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value: string) {\n const node = super.create() as HTMLElement;\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll: Scroll, domNode: HTMLElement) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = (e: Event) => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name: string, value: string) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n", "import Inline from '../blots/inline.js';\n\nclass Bold extends Inline {\n static blotName = 'bold';\n static tagName = ['STRONG', 'B'];\n\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\n\nexport default Bold;\n", "import Bold from './bold.js';\n\nclass Italic extends Bold {\n static blotName = 'italic';\n static tagName = ['EM', 'I'];\n}\n\nexport default Italic;\n", "import Inline from '../blots/inline.js';\n\nclass Link extends Inline {\n static blotName = 'link';\n static tagName = 'A';\n static SANITIZED_URL = 'about:blank';\n static PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms'];\n\n static create(value: string) {\n const node = super.create(value) as HTMLElement;\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url: string) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name: string, value: unknown) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n // @ts-expect-error\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\n\nfunction sanitize(url: string, protocols: string[]) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n", "import Inline from '../blots/inline.js';\n\nclass Script extends Inline {\n static blotName = 'script';\n static tagName = ['SUB', 'SUP'];\n\n static create(value: 'super' | 'sub' | (string & {})) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\n\nexport default Script;\n", "import Bold from './bold.js';\n\nclass Strike extends Bold {\n static blotName = 'strike';\n static tagName = ['S', 'STRIKE'];\n}\n\nexport default Strike;\n", "import Inline from '../blots/inline.js';\n\nclass Underline extends Inline {\n static blotName = 'underline';\n static tagName = 'U';\n}\n\nexport default Underline;\n", "import Embed from '../blots/embed.js';\n\nclass Formula extends Embed {\n static blotName = 'formula';\n static className = 'ql-formula';\n static tagName = 'SPAN';\n\n static create(value: string) {\n // @ts-expect-error\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n // @ts-expect-error\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\n\nexport default Formula;\n", "import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link.js';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static blotName = 'image';\n static tagName = 'IMG';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static match(url: string) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url: string) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLImageElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\n\nexport default Image;\n", "import { BlockEmbed } from '../blots/block.js';\nimport Link from './link.js';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static blotName = 'video';\n static className = 'ql-video';\n static tagName = 'IFRAME';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static sanitize(url: string) {\n return Link.sanitize(url);\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLVideoElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `${video}`;\n }\n}\n\nexport default Video;\n", "import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport type { Blot, ScrollBlot } from 'parchment';\nimport Inline from '../blots/inline.js';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport { blockDelta } from '../blots/block.js';\nimport BreakBlot from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code.js';\nimport { traverse } from './clipboard.js';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node: Element, scroll: ScrollBlot) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList && node.classList.contains(CodeBlock.className)) {\n // @ts-expect-error\n return super.formats(node, scroll);\n }\n // @ts-expect-error\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll: ScrollBlot, domNode: Node, value: unknown) {\n // @ts-expect-error\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format: string, value: unknown) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args: unknown[]) {\n // @ts-expect-error\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value: unknown) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode: Node) {\n // @ts-expect-error\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name: string, value: unknown) {\n if (name === this.statics.blotName && value) {\n // @ts-expect-error\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name: string | Blot, value?: any) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n forceNext?: boolean;\n cachedText?: string | null;\n\n attach() {\n super.attach();\n this.forceNext = false;\n // @ts-expect-error\n this.scroll.emitMount(this);\n }\n\n format(name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach((child) => {\n // @ts-expect-error\n child.format(name, value);\n });\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(\n highlight: (text: string, language: string) => Delta,\n forced = false,\n ) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n (node) => node !== this.uiNode,\n );\n const text = `${nodes.map((node) => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n // @ts-expect-error\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach((format) => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n // @ts-expect-error\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n // @ts-expect-error\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n html(index: number, length: number) {\n const [codeBlock] = this.children.find(index);\n const language = codeBlock\n ? SyntaxCodeBlock.formats(codeBlock.domNode)\n : 'plain';\n\n return `
    \\n${escapeText(\n      this.code(index, length),\n    )}\\n
    `;\n }\n\n optimize(context: Record) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n // @ts-expect-error\n if (language !== this.uiNode.value) {\n // @ts-expect-error\n this.uiNode.value = language;\n }\n }\n }\n}\n\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\ninterface SyntaxOptions {\n interval: number;\n languages: { key: string; label: string }[];\n hljs: any;\n}\n\nconst highlight = (lib: any, language: string, text: string) => {\n if (typeof lib.versionString === 'string') {\n const majorVersion = lib.versionString.split('.')[0];\n if (parseInt(majorVersion, 10) >= 11) {\n return lib.highlight(text, { language }).value;\n }\n }\n return lib.highlight(language, text).value;\n};\n\nclass Syntax extends Module {\n static DEFAULTS: SyntaxOptions & { hljs: any };\n\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n languages: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n // @ts-expect-error Fix me later\n this.languages = this.options.languages.reduce(\n (memo: Record, { key }) => {\n memo[key] = true;\n return memo;\n },\n {},\n );\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, (blot: Blot) => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n // @ts-expect-error Fix me later\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer: ReturnType | null = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot: SyntaxCodeBlockContainer | null = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach((container) => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text: string, language = 'plain') {\n language = this.languages[language] ? language : 'plain';\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = highlight(this.options.hljs, language, text);\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n // @ts-expect-error\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n // @ts-expect-error\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'JavaScript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n", "import type { LinkedList } from 'parchment';\nimport Block from '../blots/block.js';\nimport Container from '../blots/container.js';\n\nclass TableCell extends Block {\n static blotName = 'table';\n static tagName = 'TD';\n\n static create(value: string) {\n const node = super.create() as HTMLElement;\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n next: this | null;\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name: string, value: string) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row(): TableRow {\n return this.parent as TableRow;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\n\nclass TableRow extends Container {\n static blotName = 'table-row';\n static tagName = 'TR';\n\n children: LinkedList;\n next: this | null;\n\n checkMerge() {\n // @ts-expect-error\n if (super.checkMerge() && this.next.children.head != null) {\n // @ts-expect-error\n const thisHead = this.children.head.formats();\n // @ts-expect-error\n const thisTail = this.children.tail.formats();\n // @ts-expect-error\n const nextHead = this.next.children.head.formats();\n // @ts-expect-error\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.children.forEach((child) => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\n\nclass TableBody extends Container {\n static blotName = 'table-body';\n static tagName = 'TBODY';\n\n children: LinkedList;\n}\n\nclass TableContainer extends Container {\n static blotName = 'table-container';\n static tagName = 'TABLE';\n\n children: LinkedList;\n\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach((row) => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column: number) {\n return this.rows().map((row) => row.children.at(column));\n }\n\n deleteColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const ref = row.children.at(index);\n // @ts-expect-error\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName) as TableRow;\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map((row) => row);\n }\n}\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random().toString(36).slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n", "import Delta from 'quill-delta';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table.js';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach((table) => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n // @ts-expect-error\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n // @ts-expect-error\n const offset = table.offset();\n // @ts-expect-error\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(\n range = this.quill.getSelection(),\n ): [null, null, null, -1] | [Table, TableRow, TableCell, number] {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n // @ts-expect-error\n return [table, row, cell, offset];\n }\n\n insertColumn(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows: number, columns: number) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce((memo) => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(\n Quill.events.SCROLL_OPTIMIZE,\n (mutations: MutationRecord[]) => {\n mutations.some((mutation) => {\n if (\n ['TD', 'TR', 'TBODY', 'TABLE'].includes(\n (mutation.target as HTMLElement).tagName,\n )\n ) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n },\n );\n }\n}\n\nexport default Table;\n", "import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:toolbar');\n\ntype Handler = (this: Toolbar, value: any) => void;\n\nexport type ToolbarConfig = Array<\n string[] | Array>\n>;\nexport interface ToolbarProps {\n container?: HTMLElement | ToolbarConfig | null;\n handlers?: Record;\n option?: number;\n module?: boolean;\n theme?: boolean;\n}\n\nclass Toolbar extends Module {\n static DEFAULTS: ToolbarProps;\n\n container?: HTMLElement | null;\n controls: [string, HTMLElement][];\n handlers: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n container.setAttribute('role', 'toolbar');\n addControls(container, this.options.container);\n quill.container?.parentNode?.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n debug.error('Container required for toolbar', this.options);\n return;\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n if (this.options.handlers) {\n Object.keys(this.options.handlers).forEach((format) => {\n const handler = this.options.handlers?.[format];\n if (handler) {\n this.addHandler(format, handler);\n }\n });\n }\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n (input) => {\n // @ts-expect-error\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format: string, handler: Handler) {\n this.handlers[format] = handler;\n }\n\n attach(input: HTMLElement) {\n let format = Array.from(input.classList).find((className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n // @ts-expect-error\n if (input.selectedIndex < 0) return;\n // @ts-expect-error\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n // @ts-expect-error\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n // @ts-expect-error\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index)\n // @ts-expect-error Fix me later\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range: Range | null) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach((pair) => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option: HTMLOptionElement | null = null;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n // @ts-expect-error TODO fix me later\n input.value = ''; // TODO make configurable?\n // @ts-expect-error TODO fix me later\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n input.setAttribute('aria-pressed', 'false');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const value = formats[format] as boolean | number | string | object;\n const isActive =\n value === input.getAttribute('value') ||\n (value != null && value.toString() === input.getAttribute('value')) ||\n (value == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n } else {\n const isActive = formats[format] != null;\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container: HTMLElement, format: string, value?: string) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n input.setAttribute('aria-pressed', 'false');\n if (value != null) {\n input.value = value;\n input.setAttribute('aria-label', `${format}: ${value}`);\n } else {\n input.setAttribute('aria-label', format);\n }\n container.appendChild(input);\n}\n\nfunction addControls(\n container: HTMLElement,\n groups:\n | (string | Record)[][]\n | (string | Record)[],\n) {\n if (!Array.isArray(groups[0])) {\n // @ts-expect-error\n groups = [groups];\n }\n groups.forEach((controls: any) => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach((control: any) => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(\n container: HTMLElement,\n format: string,\n values: Array,\n) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', String(value));\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range.index, range.length, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n // @ts-expect-error\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n", "import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport header3Icon from '../assets/icons/header-3.svg';\nimport header4Icon from '../assets/icons/header-4.svg';\nimport header5Icon from '../assets/icons/header-5.svg';\nimport header6Icon from '../assets/icons/header-6.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n '3': header3Icon,\n '4': header4Icon,\n '5': header5Icon,\n '6': header6Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n", "import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element: HTMLElement, attribute: string) {\n element.setAttribute(\n attribute,\n `${!(element.getAttribute(attribute) === 'true')}`,\n );\n}\n\nclass Picker {\n select: HTMLSelectElement;\n container: HTMLElement;\n label: HTMLElement;\n\n constructor(select: HTMLSelectElement) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n // @ts-expect-error Fix me later\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n // @ts-expect-error\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = document.createElement('span');\n // @ts-expect-error\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n const value = option.getAttribute('value');\n if (value) {\n item.setAttribute('data-value', value);\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n // @ts-expect-error\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n // @ts-expect-error\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n // @ts-expect-error\n this.options = options;\n\n Array.from(this.select.options).forEach((option) => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n // @ts-expect-error\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item: HTMLElement | null, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n // @ts-expect-error Fix me later\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item =\n // @ts-expect-error Fix me later\n this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n // @ts-expect-error\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n", "import Picker from './picker.js';\n\nclass ColorPicker extends Picker {\n constructor(select: HTMLSelectElement, label: string) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach((item) => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item: HTMLElement | null, trigger?: boolean) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n", "import Picker from './picker.js';\n\nclass IconPicker extends Picker {\n defaultItem: HTMLElement | null;\n\n constructor(select: HTMLSelectElement, icons: Record) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target: HTMLElement | null, trigger?: boolean) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n\nexport default IconPicker;\n", "import type Quill from '../core.js';\nimport type { Bounds } from '../core/selection.js';\n\nconst isScrollable = (el: Element) => {\n const { overflowY } = getComputedStyle(el, null);\n return overflowY !== 'visible' && overflowY !== 'clip';\n};\n\nclass Tooltip {\n quill: Quill;\n boundsContainer: HTMLElement;\n root: HTMLDivElement;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n // @ts-expect-error\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (isScrollable(this.quill.root)) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference: Bounds) {\n const left =\n reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n", "import { merge } from 'lodash-es';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Theme from '../core/theme.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport ColorPicker from '../ui/color-picker.js';\nimport IconPicker from '../ui/icon-picker.js';\nimport Picker from '../ui/picker.js';\nimport Tooltip from '../ui/tooltip.js';\nimport type { Range } from '../core/selection.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport type Selection from '../core/selection.js';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n pickers: Picker[];\n tooltip?: Tooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n super(quill, options);\n const listener = (e: MouseEvent) => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n // @ts-expect-error\n !this.tooltip.root.contains(e.target) &&\n // @ts-expect-error\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach((picker) => {\n // @ts-expect-error\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: 'selection'): Selection;\n addModule(name: string): unknown;\n addModule(name: string) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n // @ts-expect-error\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(\n buttons: NodeListOf,\n icons: Record | string>,\n ) {\n Array.from(buttons).forEach((button) => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n // @ts-expect-error\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n // @ts-expect-error\n button.innerHTML = icons[name];\n } else {\n // @ts-expect-error\n const value = button.value || '';\n // @ts-expect-error\n if (value != null && icons[name][value]) {\n // @ts-expect-error\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(\n selects: NodeListOf,\n icons: Record>,\n ) {\n this.pickers = Array.from(selects).map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n if (typeof icons.align === 'object') {\n return new IconPicker(select, icons.align);\n }\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format] as string);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach((picker) => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = merge({}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n textbox: HTMLInputElement | null;\n linkRange?: Range;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n // @ts-expect-error Fix me later\n this.textbox.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n this.restoreFocus();\n }\n\n edit(mode = 'link', preview: string | null = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (this.textbox == null) return;\n\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n const bounds = this.quill.getBounds(this.quill.selection.savedRange);\n if (bounds != null) {\n this.position(bounds);\n }\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n this.quill.focus({ preventScroll: true });\n }\n\n save() {\n // @ts-expect-error Fix me later\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n // @ts-expect-error Fix me later\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n // @ts-expect-error Fix me later\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url: string) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(\n select: HTMLSelectElement,\n values: Array,\n defaultValue: unknown = false,\n) {\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', String(value));\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport { Range } from '../core/selection.js';\nimport type { Bounds } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n ].join('');\n\n constructor(quill: Quill, bounds?: HTMLElement) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n if (indexBounds != null) {\n this.position(indexBounds);\n }\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference: Bounds) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n // @ts-expect-error\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n // @ts-expect-error\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\n\nclass BubbleTheme extends BaseTheme {\n tooltip: BubbleTooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar: Toolbar) {\n // @ts-expect-error\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n if (toolbar.container != null) {\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n }\n}\nBubbleTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (!value) {\n this.quill.format('link', false, Quill.sources.USER);\n } else {\n // @ts-expect-error\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport { BubbleTooltip, BubbleTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport LinkBlot from '../formats/link.js';\nimport { Range } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { Context } from '../modules/keyboard.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\nimport type { ThemeOptions } from '../core/theme.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '',\n '',\n '',\n ].join('');\n\n preview = this.root.querySelector('a.ql-preview');\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-action')\n .addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n // @ts-expect-error Fix me later\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-remove')\n .addEventListener('click', (event) => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n // @ts-expect-error Fix me later\n this.preview.textContent = preview;\n // @ts-expect-error Fix me later\n this.preview.setAttribute('href', preview);\n this.show();\n const bounds = this.quill.getBounds(this.linkRange);\n if (bounds != null) {\n this.position(bounds);\n }\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\n\nclass SnowTheme extends BaseTheme {\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar: Toolbar) {\n if (toolbar.container != null) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n // @ts-expect-error\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (_range: Range, context: Context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n }\n}\nSnowTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n // @ts-expect-error\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false, Quill.sources.USER);\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport default SnowTheme;\n", "import Quill, { Parchment, Range } from './core.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core.js';\n\nimport { AlignClass, AlignStyle } from './formats/align.js';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction.js';\nimport Indent from './formats/indent.js';\n\nimport Blockquote from './formats/blockquote.js';\nimport Header from './formats/header.js';\nimport List from './formats/list.js';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background.js';\nimport { ColorClass, ColorStyle } from './formats/color.js';\nimport { FontClass, FontStyle } from './formats/font.js';\nimport { SizeClass, SizeStyle } from './formats/size.js';\n\nimport Bold from './formats/bold.js';\nimport Italic from './formats/italic.js';\nimport Link from './formats/link.js';\nimport Script from './formats/script.js';\nimport Strike from './formats/strike.js';\nimport Underline from './formats/underline.js';\n\nimport Formula from './formats/formula.js';\nimport Image from './formats/image.js';\nimport Video from './formats/video.js';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code.js';\n\nimport Syntax from './modules/syntax.js';\nimport Table from './modules/table.js';\nimport Toolbar from './modules/toolbar.js';\n\nimport Icons from './ui/icons.js';\nimport Picker from './ui/picker.js';\nimport ColorPicker from './ui/color-picker.js';\nimport IconPicker from './ui/icon-picker.js';\nimport Tooltip from './ui/tooltip.js';\n\nimport BubbleTheme from './themes/bubble.js';\nimport SnowTheme from './themes/snow.js';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport { Module } from './core.js';\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\nexport { Parchment, Range };\n\nexport default Quill;\n", "/*! For license information please see quill-cursors.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.QuillCursors=e():t.QuillCursors=e()}(self,(()=>(()=>{var t={582:(t,e,r)=>{\"use strict\";r.d(e,{Z:()=>s});var n=r(81),i=r.n(n),o=r(645),a=r.n(o)()(i());a.push([t.id,\".ql-container{position:relative;overflow:hidden}@media(pointer: coarse){.ql-cursor-caret-container{z-index:-1}}.ql-cursor.hidden{display:none}.ql-cursor .ql-cursor-caret-container,.ql-cursor .ql-cursor-flag{position:absolute}.ql-cursor .ql-cursor-flag{z-index:1;transform:translate3d(-1px, -100%, 0);opacity:0;visibility:hidden;color:#fff;padding-bottom:2px;border-radius:0 3px 3px 0}.ql-cursor .ql-cursor-flag.flag-flipped{border-radius:3px 0 0 3px;transform:translate3d(calc(-100% + 1px ), -100%, 0)}@media screen{.ql-cursor .ql-cursor-flag{transition:opacity 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms,visibility 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms}}.ql-cursor .ql-cursor-flag .ql-cursor-name{margin-left:5px;margin-right:5px;display:inline-block;margin-top:-2px;white-space:nowrap}.ql-cursor .ql-cursor-flag.no-delay[style]{transition-delay:unset !important}.ql-cursor .ql-cursor-caret-container{cursor:text;margin-left:-9px;padding:0 9px}.ql-cursor .ql-cursor-caret-container.hover+.ql-cursor-flag{opacity:1;visibility:visible;transition:none}.ql-cursor .ql-cursor-caret-container.no-pointer{pointer-events:none}.ql-cursor .ql-cursor-caret-container .ql-cursor-caret{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background-color:attr(data-color)}.ql-cursor .ql-cursor-selection-block{position:absolute;pointer-events:none}\",\"\"]);const s=a},645:t=>{\"use strict\";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=\"\",n=void 0!==e[5];return e[4]&&(r+=\"@supports (\".concat(e[4],\") {\")),e[2]&&(r+=\"@media \".concat(e[2],\" {\")),n&&(r+=\"@layer\".concat(e[5].length>0?\" \".concat(e[5]):\"\",\" {\")),r+=t(e),n&&(r+=\"}\"),e[2]&&(r+=\"}\"),e[4]&&(r+=\"}\"),r})).join(\"\")},e.i=function(t,r,n,i,o){\"string\"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var s=0;s0?\" \".concat(l[5]):\"\",\" {\").concat(l[1],\"}\")),l[5]=o),r&&(l[2]?(l[1]=\"@media \".concat(l[2],\" {\").concat(l[1],\"}\"),l[2]=r):l[2]=r),i&&(l[4]?(l[1]=\"@supports (\".concat(l[4],\") {\").concat(l[1],\"}\"),l[4]=i):l[4]=\"\".concat(i)),e.push(l))}},e}},81:t=>{\"use strict\";t.exports=function(t){return t[1]}},529:t=>{var e=-1;function r(t,s,u,c){if(t===s)return t?[[0,t]]:[];if(null!=u){var l=function(t,e,r){var n=\"number\"==typeof r?{index:r,length:0}:r.oldRange,i=\"number\"==typeof r?null:r.newRange,o=t.length,a=e.length;if(0===n.length&&(null===i||0===i.length)){var s=n.index,u=t.slice(0,s),c=t.slice(s),l=i?i.index:null,h=s+a-o;if((null===l||l===h)&&!(h<0||h>a)){var d=e.slice(0,h);if((_=e.slice(h))===c){var p=Math.min(s,h);if((b=u.slice(0,p))===(m=d.slice(0,p)))return f(b,u.slice(p),d.slice(p),c)}}if(null===l||l===s){var g=s,_=(d=e.slice(0,g),e.slice(g));if(d===u){var v=Math.min(o-g,a-g);if((y=c.slice(c.length-v))===(A=_.slice(_.length-v)))return f(u,c.slice(0,c.length-v),_.slice(0,_.length-v),y)}}}if(n.length>0&&i&&0===i.length){var b=t.slice(0,n.index),y=t.slice(n.index+n.length);if(!(a<(p=b.length)+(v=y.length))){var m=e.slice(0,p),A=e.slice(a-v);if(b===m&&y===A)return f(b,t.slice(p,o-v),e.slice(p,a-v),y)}}return null}(t,s,u);if(l)return l}var h=i(t,s),d=t.substring(0,h);h=o(t=t.substring(h),s=s.substring(h));var p=t.substring(t.length-h),g=function(t,a){var s;if(!t)return[[1,a]];if(!a)return[[e,t]];var u=t.length>a.length?t:a,c=t.length>a.length?a:t,l=u.indexOf(c);if(-1!==l)return s=[[1,u.substring(0,l)],[0,c],[1,u.substring(l+c.length)]],t.length>a.length&&(s[0][0]=s[2][0]=e),s;if(1===c.length)return[[e,t],[1,a]];var f=function(t,e){var r=t.length>e.length?t:e,n=t.length>e.length?e:t;if(r.length<4||2*n.length=t.length?[n,a,s,u,f]:null}var s,u,c,l,f,h=a(r,n,Math.ceil(r.length/4)),d=a(r,n,Math.ceil(r.length/2));return h||d?(s=d?h&&h[4].length>d[4].length?h:d:h,t.length>e.length?(u=s[0],c=s[1],l=s[2],f=s[3]):(l=s[0],f=s[1],u=s[2],c=s[3]),[u,c,l,f,s[4]]):null}(t,a);if(f){var h=f[0],d=f[1],p=f[2],g=f[3],_=f[4],v=r(h,p),b=r(d,g);return v.concat([[0,_]],b)}return function(t,r){for(var i=t.length,o=r.length,a=Math.ceil((i+o)/2),s=a,u=2*a,c=new Array(u),l=new Array(u),f=0;fi)g+=2;else if(A>o)p+=2;else if(d&&(w=s+h-y)>=0&&w=(C=i-l[w]))return n(t,r,S,A)}for(var x=-b+_;x<=b-v;x+=2){for(var C,w=s+x,E=(C=x===-b||x!==b&&l[w-1]i)v+=2;else if(E>o)_+=2;else if(!d){var S;if((m=s+h-x)>=0&&m=(C=i-C))return n(t,r,S,A)}}}return[[e,t],[1,r]]}(t,a)}(t=t.substring(0,t.length-h),s=s.substring(0,s.length-h));return d&&g.unshift([0,d]),p&&g.push([0,p]),a(g,c),g}function n(t,e,n,i){var o=t.substring(0,n),a=e.substring(0,i),s=t.substring(n),u=e.substring(i),c=r(o,a),l=r(s,u);return c.concat(l)}function i(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var r=0,n=Math.min(t.length,e.length),i=n,o=0;r=0&&l(t[p][1])){var g=t[p][1].slice(-1);if(t[p][1]=t[p][1].slice(0,-1),h=g+h,d=g+d,!t[p][1]){t.splice(p,1),s--;var _=p-1;t[_]&&1===t[_][0]&&(f++,d=t[_][1]+d,_--),t[_]&&t[_][0]===e&&(u++,h=t[_][1]+h,_--),p=_}}c(t[s][1])&&(g=t[s][1].charAt(0),t[s][1]=t[s][1].slice(1),h+=g,d+=g)}if(s0||d.length>0){h.length>0&&d.length>0&&(0!==(n=i(d,h))&&(p>=0?t[p][1]+=d.substring(0,n):(t.splice(0,0,[0,d.substring(0,n)]),s++),d=d.substring(n),h=h.substring(n)),0!==(n=o(d,h))&&(t[s][1]=d.substring(d.length-n)+t[s][1],d=d.substring(0,d.length-n),h=h.substring(0,h.length-n)));var v=f+u;0===h.length&&0===d.length?(t.splice(s-v,v),s-=v):0===h.length?(t.splice(s-v,v,[1,d]),s=s-v+1):0===d.length?(t.splice(s-v,v,[e,h]),s=s-v+1):(t.splice(s-v,v,[e,h],[1,d]),s=s-v+2)}0!==s&&0===t[s-1][0]?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,f=0,u=0,h=\"\",d=\"\"}\"\"===t[t.length-1][1]&&t.pop();var b=!1;for(s=1;s=55296&&t<=56319}function u(t){return t>=56320&&t<=57343}function c(t){return u(t.charCodeAt(0))}function l(t){return s(t.charCodeAt(t.length-1))}function f(t,r,n,i){return l(t)||c(i)?null:function(t){for(var e=[],r=0;r0&&e.push(t[r]);return e}([[0,t],[e,r],[1,n],[0,i]])}function h(t,e,n){return r(t,e,n,!0)}h.INSERT=1,h.DELETE=e,h.EQUAL=0,t.exports=h},465:(t,e,r)=>{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Boolean]\",s=\"[object Date]\",u=\"[object Function]\",c=\"[object GeneratorFunction]\",l=\"[object Map]\",f=\"[object Number]\",h=\"[object Object]\",d=\"[object Promise]\",p=\"[object RegExp]\",g=\"[object Set]\",_=\"[object String]\",v=\"[object Symbol]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=\"[object Float32Array]\",x=\"[object Float64Array]\",C=\"[object Int8Array]\",w=\"[object Int16Array]\",E=\"[object Int32Array]\",S=\"[object Uint8Array]\",M=\"[object Uint8ClampedArray]\",O=\"[object Uint16Array]\",j=\"[object Uint32Array]\",L=/\\w*$/,k=/^\\[object .+?Constructor\\]$/,T=/^(?:0|[1-9]\\d*)$/,R={};R[o]=R[\"[object Array]\"]=R[y]=R[m]=R[a]=R[s]=R[A]=R[x]=R[C]=R[w]=R[E]=R[l]=R[f]=R[h]=R[p]=R[g]=R[_]=R[v]=R[S]=R[M]=R[O]=R[j]=!0,R[\"[object Error]\"]=R[u]=R[b]=!1;var N=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,q=\"object\"==typeof self&&self&&self.Object===Object&&self,D=N||q||Function(\"return this\")(),F=e&&!e.nodeType&&e,I=F&&t&&!t.nodeType&&t,P=I&&I.exports===F;function B(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function H(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=kt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new St,map:new(pt||Mt),string:new St}},Ot.prototype.delete=function(t){return qt(this,t).delete(t)},Ot.prototype.get=function(t){return qt(this,t).get(t)},Ot.prototype.has=function(t){return qt(this,t).has(t)},Ot.prototype.set=function(t,e){return qt(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Mt},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Ot(n)}return r.set(t,e),this};var Ft=lt?$(lt,Object):function(){return[]},It=function(t){return et.call(t)};function Pt(t,e){return!!(e=null==e?i:e)&&(\"number\"==typeof t||T.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!Vt(t)}var $t=ft||function(){return!1};function Vt(t){var e=Wt(t)?et.call(t):\"\";return e==u||e==c}function Wt(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function Xt(t){return Gt(t)?function(t,e){var r=Ut(t)||function(t){return function(t){return function(t){return!!t&&\"object\"==typeof t}(t)&&Gt(t)}(t)&&tt.call(t,\"callee\")&&(!ut.call(t,\"callee\")||et.call(t)==o)}(t)?function(t,e){for(var r=-1,n=Array(t);++r{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Array]\",s=\"[object Boolean]\",u=\"[object Date]\",c=\"[object Error]\",l=\"[object Function]\",f=\"[object Map]\",h=\"[object Number]\",d=\"[object Object]\",p=\"[object Promise]\",g=\"[object RegExp]\",_=\"[object Set]\",v=\"[object String]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=/^\\[object .+?Constructor\\]$/,x=/^(?:0|[1-9]\\d*)$/,C={};C[\"[object Float32Array]\"]=C[\"[object Float64Array]\"]=C[\"[object Int8Array]\"]=C[\"[object Int16Array]\"]=C[\"[object Int32Array]\"]=C[\"[object Uint8Array]\"]=C[\"[object Uint8ClampedArray]\"]=C[\"[object Uint16Array]\"]=C[\"[object Uint32Array]\"]=!0,C[o]=C[a]=C[y]=C[s]=C[m]=C[u]=C[c]=C[l]=C[f]=C[h]=C[d]=C[g]=C[_]=C[v]=C[b]=!1;var w=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E=\"object\"==typeof self&&self&&self.Object===Object&&self,S=w||E||Function(\"return this\")(),M=e&&!e.nodeType&&e,O=M&&t&&!t.nodeType&&t,j=O&&O.exports===M,L=j&&w.process,k=function(){try{return L&&L.binding&&L.binding(\"util\")}catch(t){}}(),T=k&&k.isTypedArray;function R(t,e){for(var r=-1,n=null==t?0:t.length;++rs))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var l=-1,f=!0,h=2&r?new yt:void 0;for(o.set(t,e),o.set(e,t);++l-1},vt.prototype.set=function(t,e){var r=this.__data__,n=At(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bt.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(it||vt),string:new _t}},bt.prototype.delete=function(t){var e=Mt(this,t).delete(t);return this.size-=e?1:0,e},bt.prototype.get=function(t){return Mt(this,t).get(t)},bt.prototype.has=function(t){return Mt(this,t).has(t)},bt.prototype.set=function(t,e){var r=Mt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},yt.prototype.add=yt.prototype.push=function(t){return this.__data__.set(t,n),this},yt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.clear=function(){this.__data__=new vt,this.size=0},mt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},mt.prototype.get=function(t){return this.__data__.get(t)},mt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(n)}return r.set(t,e),this.size=r.size,this};var jt=tt?function(t){return null==t?[]:(t=Object(t),function(e,r){for(var n=-1,i=null==e?0:e.length,o=0,a=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=i}function Pt(t){var e=typeof t;return null!=t&&(\"object\"==e||\"function\"==e)}function Bt(t){return null!=t&&\"object\"==typeof t}var zt=T?function(t){return function(e){return t(e)}}(T):function(t){return Bt(t)&&It(t.length)&&!!C[xt(t)]};function Ht(t){return null!=(e=t)&&It(e.length)&&!Ft(e)?function(t,e){var r=qt(t),n=!r&&Nt(t),i=!r&&!n&&Dt(t),o=!r&&!n&&!i&&zt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++r0?n:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),\"object\"!=typeof t&&(t={}),\"object\"!=typeof e&&(e={});var r=Object.keys(t).concat(Object.keys(e)).reduce((function(r,n){return a.default(t[n],e[n])||(r[n]=void 0===e[n]?null:e[n]),r}),{});return Object.keys(r).length>0?r:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var r=Object.keys(e).reduce((function(r,n){return e[n]!==t[n]&&void 0!==t[n]&&(r[n]=e[n]),r}),{});return Object.keys(t).reduce((function(r,n){return t[n]!==e[n]&&void 0===e[n]&&(r[n]=null),r}),r)},t.transform=function(t,e,r){if(void 0===r&&(r=!1),\"object\"!=typeof t)return e;if(\"object\"==typeof e){if(!r)return e;var n=Object.keys(e).reduce((function(r,n){return void 0===t[n]&&(r[n]=e[n]),r}),{});return Object.keys(n).length>0?n:void 0}}}(i||(i={})),e.default=i},895:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=n(r(529)),o=n(r(465)),a=n(r(307)),s=n(r(210)),u=n(r(430)),c=String.fromCharCode(0),l=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var r={};return\"string\"==typeof t&&0===t.length?this:(r.insert=t,null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var r={retain:t};return null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r)},t.prototype.push=function(t){var e=this.ops.length,r=this.ops[e-1];if(t=o.default(t),\"object\"==typeof r){if(\"number\"==typeof t.delete&&\"number\"==typeof r.delete)return this.ops[e-1]={delete:r.delete+t.delete},this;if(\"number\"==typeof r.delete&&null!=t.insert&&(e-=1,\"object\"!=typeof(r=this.ops[e-1])))return this.ops.unshift(t),this;if(a.default(t.attributes,r.attributes)){if(\"string\"==typeof t.insert&&\"string\"==typeof r.insert)return this.ops[e-1]={insert:r.insert+t.insert},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if(\"number\"==typeof t.retain&&\"number\"==typeof r.retain)return this.ops[e-1]={retain:r.retain+t.retain},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],r=[];return this.forEach((function(n){(t(n)?e:r).push(n)})),[e,r]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+u.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+u.default.length(e)}),0)},t.prototype.slice=function(e,r){void 0===e&&(e=0),void 0===r&&(r=1/0);for(var n=[],i=u.default.iterator(this.ops),o=0;o0&&n.next(o.retain-c)}for(var l=new t(i);r.hasNext()||n.hasNext();)if(\"insert\"===n.peekType())l.push(n.next());else if(\"delete\"===r.peekType())l.push(r.next());else{var f=Math.min(r.peekLength(),n.peekLength()),h=r.next(f),d=n.next(f);if(\"number\"==typeof d.retain){var p={};\"number\"==typeof h.retain?p.retain=f:p.insert=h.insert;var g=s.default.compose(h.attributes,d.attributes,\"number\"==typeof h.retain);if(g&&(p.attributes=g),l.push(p),!n.hasNext()&&a.default(l.ops[l.ops.length-1],p)){var _=new t(r.rest());return l.concat(_).chop()}}else\"number\"==typeof d.delete&&\"number\"==typeof h.retain&&l.push(d)}return l.chop()},t.prototype.concat=function(e){var r=new t(this.ops.slice());return e.ops.length>0&&(r.push(e.ops[0]),r.ops=r.ops.concat(e.ops.slice(1))),r},t.prototype.diff=function(e,r){if(this.ops===e.ops)return new t;var n=[this,e].map((function(t){return t.map((function(r){if(null!=r.insert)return\"string\"==typeof r.insert?r.insert:c;throw new Error(\"diff() called \"+(t===e?\"on\":\"with\")+\" non-document\")})).join(\"\")})),o=new t,l=i.default(n[0],n[1],r),f=u.default.iterator(this.ops),h=u.default.iterator(e.ops);return l.forEach((function(t){for(var e=t[1].length;e>0;){var r=0;switch(t[0]){case i.default.INSERT:r=Math.min(h.peekLength(),e),o.push(h.next(r));break;case i.default.DELETE:r=Math.min(e,f.peekLength()),f.next(r),o.delete(r);break;case i.default.EQUAL:r=Math.min(f.peekLength(),h.peekLength(),e);var n=f.next(r),u=h.next(r);a.default(n.insert,u.insert)?o.retain(r,s.default.diff(n.attributes,u.attributes)):o.push(u).delete(r)}e-=r}})),o.chop()},t.prototype.eachLine=function(e,r){void 0===r&&(r=\"\\n\");for(var n=u.default.iterator(this.ops),i=new t,o=0;n.hasNext();){if(\"insert\"!==n.peekType())return;var a=n.peek(),s=u.default.length(a)-n.peekLength(),c=\"string\"==typeof a.insert?a.insert.indexOf(r,s)-s:-1;if(c<0)i.push(n.next());else if(c>0)i.push(n.next(c));else{if(!1===e(i,n.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var r=new t;return this.reduce((function(t,n){if(n.insert)r.delete(u.default.length(n));else{if(n.retain&&null==n.attributes)return r.retain(n.retain),t+n.retain;if(n.delete||n.retain&&n.attributes){var i=n.delete||n.retain;return e.slice(t,t+i).forEach((function(t){n.delete?r.push(t):n.retain&&n.attributes&&r.retain(u.default.length(t),s.default.invert(n.attributes,t.attributes))})),t+i}}return t}),0),r.chop()},t.prototype.transform=function(e,r){if(void 0===r&&(r=!1),r=!!r,\"number\"==typeof e)return this.transformPosition(e,r);for(var n=e,i=u.default.iterator(this.ops),o=u.default.iterator(n.ops),a=new t;i.hasNext()||o.hasNext();)if(\"insert\"!==i.peekType()||!r&&\"insert\"===o.peekType())if(\"insert\"===o.peekType())a.push(o.next());else{var c=Math.min(i.peekLength(),o.peekLength()),l=i.next(c),f=o.next(c);if(l.delete)continue;f.delete?a.push(f):a.retain(c,s.default.transform(l.attributes,f.attributes,r))}else a.retain(u.default.length(i.next()));return a.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var r=u.default.iterator(this.ops),n=0;r.hasNext()&&n<=t;){var i=r.peekLength(),o=r.peekType();r.next(),\"delete\"!==o?(\"insert\"===o&&(n=n-r?(t=n-r,this.index+=1,this.offset=0):this.offset+=t,\"number\"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),\"number\"==typeof e.retain?o.retain=t:\"string\"==typeof e.insert?o.insert=e.insert.substr(r,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?\"number\"==typeof this.ops[this.index].delete?\"delete\":\"number\"==typeof this.ops[this.index].retain?\"retain\":\"insert\":\"retain\"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[r].concat(n)}return[]},t}();e.default=o},430:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i,o=n(r(977));!function(t){t.iterator=function(t){return new o.default(t)},t.length=function(t){return\"number\"==typeof t.delete?t.delete:\"number\"==typeof t.retain?t.retain:\"string\"==typeof t.insert?t.insert.length:1}}(i||(i={})),e.default=i},165:function(t,e,r){var n,i;void 0===(i=\"function\"==typeof(n=function(){var t,e={};function r(t,e,r){var n=t.getClientRects();if(2===n.length){var i=t.getBoundingClientRect();return n[e][r]=e.length)return Array.prototype.push.apply(t,e);for(;n1,t.getClientRects||(s.setEnd(o,1),t.getClientRects=t.getBoundingClientRect=2===s.getClientRects().length),!t.getBoundingClientRect){s.setEnd(s.startContainer,s.startOffset);var u=s.getBoundingClientRect();t.getBoundingClientRect=0===u.top&&0===u.left}if(document.body.removeChild(e),!t.getBoundingClientRect){var c=document.createElement(\"p\");c.style.width=\"0px\",c.style.fontSize=\"20px\",c.style.whiteSpace=\"normal\",c.style.wordBreak=\"normal\";var l=document.createTextNode(\"m mm\");c.appendChild(l),document.body.appendChild(c),s.setStart(l,1),s.setEnd(l,2),r(s,1,\"left\")?t.getBoundingClientRect=!0:(s.setStart(l,1),s.setEnd(l,3),r(s,0,\"top\")&&(t.getBoundingClientRect=!0)),document.body.removeChild(c)}var f=window.ActiveXObject&&new Function(\"/*@cc_on return @_jscript_version; @*/\")();t.ieZoom=!!f&&f<=10}return t},e.getClientRects=function(t){var e=this.isBroken();if(e.ieZoom)return n(t.getClientRects());if(!e.getClientRects)return t.getClientRects();var r=[],o=[],a=t.endContainer,s=t.endOffset,u=document.createRange();function c(t){for(var e=0;t=t.previousSibling;)e++;return e}for(;a!==t.commonAncestorContainer;)u.setStart(a,0),u.setEnd(a,s),i(o,u.getClientRects()),s=c(a),a=a.parentNode;return(u=t.cloneRange()).setEnd(a,s),i(r,u.getClientRects()),i(r,o),r},e.getBoundingClientRect=function(t){var e=this.getClientRects(t);if(0===e.length)return null;var r,i=t.getBoundingClientRect(),o=this.isBroken();if(o.ieZoom)return n(i);if(!o.getBoundingClientRect)return i;if(0===i.width&&0===i.height)return e[0];for(var a=0,s=e.length;a{\"use strict\";r.r(e),r.d(e,{default:()=>C});var n=function(){if(\"undefined\"!=typeof Map)return Map;function t(t,e){var r=-1;return t.some((function(t,n){return t[0]===e&&(r=n,!0)})),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,\"size\",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var r=t(this.__entries__,e),n=this.__entries__[r];return n&&n[1]},e.prototype.set=function(e,r){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=r:this.__entries__.push([e,r])},e.prototype.delete=function(e){var r=this.__entries__,n=t(r,e);~n&&r.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var r=0,n=this.__entries__;r0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener(\"transitionend\",this.onTransitionEnd_),window.addEventListener(\"resize\",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener(\"transitionend\",this.onTransitionEnd_),window.removeEventListener(\"resize\",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,r=void 0===e?\"\":e;s.some((function(t){return!!~r.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var r=0,n=Object.keys(e);r0},t}(),A=\"undefined\"!=typeof WeakMap?new WeakMap:new n,x=function t(e){if(!(this instanceof t))throw new TypeError(\"Cannot call a class as a function.\");if(!arguments.length)throw new TypeError(\"1 argument required, but only 0 present.\");var r=c.getInstance(),n=new m(e,r,this);A.set(this,n)};[\"observe\",\"unobserve\",\"disconnect\"].forEach((function(t){x.prototype[t]=function(){var e;return(e=A.get(this))[t].apply(e,arguments)}}));const C=void 0!==o.ResizeObserver?o.ResizeObserver:x},413:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{default:()=>v});var n=r(379),i=r.n(n),o=r(795),a=r.n(o),s=r(569),u=r.n(s),c=r(565),l=r.n(c),f=r(216),h=r.n(f),d=r(589),p=r.n(d),g=r(582),_={};_.styleTagTransform=p(),_.setAttributes=l(),_.insert=u().bind(null,\"head\"),_.domAPI=a(),_.insertStyleElement=h(),i()(g.Z,_);const v=g.Z&&g.Z.locals?g.Z.locals:void 0},379:t=>{\"use strict\";var e=[];function r(t){for(var r=-1,n=0;n{\"use strict\";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");n.appendChild(r)}},216:t=>{\"use strict\";t.exports=function(t){var e=document.createElement(\"style\");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,r)=>{\"use strict\";t.exports=function(t){var e=r.nc;e&&t.setAttribute(\"nonce\",e)}},795:t=>{\"use strict\";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n=\"\";r.supports&&(n+=\"@supports (\".concat(r.supports,\") {\")),r.media&&(n+=\"@media \".concat(r.media,\" {\"));var i=void 0!==r.layer;i&&(n+=\"@layer\".concat(r.layer.length>0?\" \".concat(r.layer):\"\",\" {\")),n+=r.css,i&&(n+=\"}\"),r.media&&(n+=\"}\"),r.supports&&(n+=\"}\");var o=r.sourceMap;o&&\"undefined\"!=typeof btoa&&(n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o)))),\" */\")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{\"use strict\";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},607:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.Cursor=e.default=void 0;var i=n(r(678));e.default=i.default;var o=n(r(353));e.Cursor=o.default,r(413)},353:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(207),i=function(){function t(t,e,r){this.id=t,this.name=e,this.color=r,this.toggleNearCursor=this.toggleNearCursor.bind(this),this._toggleOpenedCursor=this._toggleOpenedCursor.bind(this),this._setHoverState=this._setHoverState.bind(this)}return t.prototype.build=function(e){var r=document.createElement(t.CONTAINER_ELEMENT_TAG);r.classList.add(t.CURSOR_CLASS),r.id=\"ql-cursor-\".concat(this.id),r.innerHTML=e.template;var n=r.getElementsByClassName(t.SELECTION_CLASS)[0],i=r.getElementsByClassName(t.CARET_CONTAINER_CLASS)[0],o=i.getElementsByClassName(t.CARET_CLASS)[0],a=r.getElementsByClassName(t.FLAG_CLASS)[0];return a.style.backgroundColor=this.color,o.style.backgroundColor=this.color,r.getElementsByClassName(t.NAME_CLASS)[0].textContent=this.name,this._hideDelay=\"\".concat(e.hideDelayMs,\"ms\"),this._hideSpeedMs=e.hideSpeedMs,this._positionFlag=e.positionFlag,a.style.transitionDelay=this._hideDelay,a.style.transitionDuration=\"\".concat(this._hideSpeedMs,\"ms\"),this._el=r,this._selectionEl=n,this._caretEl=i,this._flagEl=a,i.addEventListener(\"mouseover\",this._setHoverState,{passive:!0}),this._el},t.prototype.show=function(){this._el.classList.remove(t.HIDDEN_CLASS)},t.prototype.hide=function(){this._el.classList.add(t.HIDDEN_CLASS)},t.prototype.remove=function(){this._el.parentNode.removeChild(this._el)},t.prototype.toggleNearCursor=function(e,r){var n=this._getCoordinates(),i=n.left,o=n.right,a=n.top,s=n.bottom,u=e>=i&&e<=o&&r>=a&&r<=s;return this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,u),u},t.prototype.toggleFlag=function(e){var r=this;this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,e)||(this._flagEl.classList.add(t.NO_DELAY_CLASS),setTimeout((function(){return r._flagEl.classList.remove(t.NO_DELAY_CLASS)}),this._hideSpeedMs))},t.prototype.updateCaret=function(t,e){this._caretEl.style.top=\"\".concat(t.top,\"px\"),this._caretEl.style.left=\"\".concat(t.left,\"px\"),this._caretEl.style.height=\"\".concat(t.height,\"px\"),this._positionFlag?this._positionFlag(this._flagEl,t,e):this._updateCaretFlag(t,e)},t.prototype.updateSelection=function(t,e){var r=this;this._clearSelection(),t=t||[],t=Array.from(t),t=this._sanitize(t),(t=this._sortByDomPosition(t)).forEach((function(t){return r._addSelection(t,e)}))},t.prototype._setHoverState=function(){document.addEventListener(\"mousemove\",this._toggleOpenedCursor,{passive:!0})},t.prototype._toggleOpenedCursor=function(e){var r=this.toggleNearCursor(e.clientX,e.clientY);this._caretEl.classList.toggle(t.CONTAINER_NO_POINTER_CLASS,r),r||document.removeEventListener(\"mousemove\",this._toggleOpenedCursor)},t.prototype._getCoordinates=function(){return this._caretEl.getBoundingClientRect()},t.prototype._updateCaretFlag=function(e,r){this._flagEl.style.width=\"\";var n=this._flagEl.getBoundingClientRect();this._flagEl.classList.remove(t.FLAG_FLIPPED_CLASS),e.left>r.width-n.width&&this._flagEl.classList.add(t.FLAG_FLIPPED_CLASS),this._flagEl.style.left=\"\".concat(e.left,\"px\"),this._flagEl.style.top=\"\".concat(e.top,\"px\"),this._flagEl.style.width=\"\".concat(Math.ceil(n.width),\"px\")},t.prototype._clearSelection=function(){this._selectionEl.innerHTML=\"\"},t.prototype._addSelection=function(t,e){var r=this._selectionBlock(t,e);this._selectionEl.appendChild(r)},t.prototype._selectionBlock=function(e,r){var i=document.createElement(t.SELECTION_ELEMENT_TAG);return i.classList.add(t.SELECTION_BLOCK_CLASS),i.style.top=\"\".concat(e.top-r.top,\"px\"),i.style.left=\"\".concat(e.left-r.left,\"px\"),i.style.width=\"\".concat(e.width,\"px\"),i.style.height=\"\".concat(e.height,\"px\"),i.style.backgroundColor=n(this.color).setAlpha(.3).toString(),i},t.prototype._sortByDomPosition=function(t){return t.sort((function(t,e){return t.top===e.top?t.left-e.left:t.top-e.top}))},t.prototype._sanitize=function(t){var e=this,r=new Set;return t.filter((function(t){if(!t.width||!t.height)return!1;var n=e._serialize(t);return!r.has(n)&&(r.add(n),!0)}))},t.prototype._serialize=function(t){return[\"top:\".concat(t.top),\"right:\".concat(t.right),\"bottom:\".concat(t.bottom),\"left:\".concat(t.left)].join(\";\")},t.CONTAINER_ELEMENT_TAG=\"SPAN\",t.SELECTION_ELEMENT_TAG=\"SPAN\",t.CURSOR_CLASS=\"ql-cursor\",t.SELECTION_CLASS=\"ql-cursor-selections\",t.SELECTION_BLOCK_CLASS=\"ql-cursor-selection-block\",t.CARET_CLASS=\"ql-cursor-caret\",t.CARET_CONTAINER_CLASS=\"ql-cursor-caret-container\",t.CONTAINER_HOVER_CLASS=\"hover\",t.CONTAINER_NO_POINTER_CLASS=\"no-pointer\",t.FLAG_CLASS=\"ql-cursor-flag\",t.FLAG_FLIPPED_CLASS=\"flag-flipped\",t.NAME_CLASS=\"ql-cursor-name\",t.HIDDEN_CLASS=\"hidden\",t.NO_DELAY_CLASS=\"no-delay\",t}();e.default=i},678:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)\"default\"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var s=a(r(353)),u=o(r(165)),c=a(r(338)),l=a(r(33)),f=r(895),h=function(){function t(t,e){void 0===e&&(e={}),this._cursors={},this._isObserving=!1,this._handleCursorTouch=this._handleCursorTouch.bind(this),this.quill=t,this.options=this._setDefaults(e),this._container=this.quill.addContainer(this.options.containerClass),this._boundsContainer=this.options.boundsContainer||this.quill.container,this._currentSelection=this.quill.getSelection(),this._registerSelectionChangeListeners(),this._registerTextChangeListener(),this._registerDomListeners()}return t.prototype.createCursor=function(t,e,r){var n=this._cursors[t];if(!n){n=new s.default(t,e,r),this._cursors[t]=n;var i=n.build(this.options);this._container.appendChild(i)}return n},t.prototype.moveCursor=function(t,e){var r=this._cursors[t];r&&(r.range=e,this._updateCursor(r))},t.prototype.removeCursor=function(t){var e=this._cursors[t];e&&(e.remove(),delete this._cursors[t])},t.prototype.update=function(){var t=this;this.cursors().forEach((function(e){return t._updateCursor(e)}))},t.prototype.clearCursors=function(){var t=this;this.cursors().forEach((function(e){return t.removeCursor(e.id)}))},t.prototype.toggleFlag=function(t,e){var r=this._cursors[t];r&&r.toggleFlag(e)},t.prototype.cursors=function(){var t=this;return Object.keys(this._cursors).map((function(e){return t._cursors[e]}))},t.prototype._registerSelectionChangeListeners=function(){var t=this;this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,(function(e){t._currentSelection=e}))},t.prototype._registerTextChangeListener=function(){var t=this;this.quill.on(this.quill.constructor.events.TEXT_CHANGE,(function(e){return t._handleTextChange(e)}))},t.prototype._registerDomListeners=function(){var t=this,e=this.quill.container.getElementsByClassName(\"ql-editor\")[0];e.addEventListener(\"scroll\",(function(){return t.update()}),{passive:!0}),e.addEventListener(\"touchstart\",this._handleCursorTouch,{passive:!0})},t.prototype._handleCursorTouch=function(t){var e=this;this.cursors().forEach((function(r){r.toggleNearCursor(t.pageX,t.pageY),setTimeout((function(){return r.toggleFlag(!1)}),e.options.hideDelayMs)}))},t.prototype._registerResizeObserver=function(){var t=this;if(!this._isObserving){var e=this.quill.container.getElementsByClassName(\"ql-editor\")[0],r=new l.default((function(e){if(!e[0].target.isConnected)return r.disconnect(),void(t._isObserving=!1);t.update()}));r.observe(e),this._isObserving=!0}},t.prototype._updateCursor=function(t){if(this._registerResizeObserver(),!t.range)return t.hide();var e=this._indexWithinQuillBounds(t.range.index),r=this._indexWithinQuillBounds(t.range.index+t.range.length),n=this.quill.getLeaf(e),i=this.quill.getLeaf(r);if(!this._leafIsValid(n)||!this._leafIsValid(i))return t.hide();t.show();var o=this._boundsContainer.getBoundingClientRect(),a=this.quill.getBounds(r);t.updateCaret(a,o);var s=this._lineRanges(t,n,i).reduce((function(t,e){return t.concat(Array.from(u.getClientRects(e)))}),[]);t.updateSelection(s,o)},t.prototype._indexWithinQuillBounds=function(t){var e=this.quill.getLength(),r=e?e-1:0;return t=Math.max(t,0),Math.min(t,r)},t.prototype._leafIsValid=function(t){return t&&t[0]&&t[0].domNode&&t[1]>=0},t.prototype._handleTextChange=function(t){var e=this;window.setTimeout((function(){e.options.transformOnTextChange&&e._transformCursors(t),e.options.selectionChangeSource&&(e._emitSelection(),e.update())}))},t.prototype._emitSelection=function(){this.quill.emitter.emit(this.quill.constructor.events.SELECTION_CHANGE,this.quill.getSelection(),this._currentSelection,this.options.selectionChangeSource)},t.prototype._setDefaults=function(e){return(e=Object.assign({},e)).template||(e.template=t.DEFAULTS.template),e.containerClass||(e.containerClass=t.DEFAULTS.containerClass),null!==e.selectionChangeSource&&(e.selectionChangeSource||(e.selectionChangeSource=t.DEFAULTS.selectionChangeSource)),e.hideDelayMs=Number.isInteger(e.hideDelayMs)?e.hideDelayMs:t.DEFAULTS.hideDelayMs,e.hideSpeedMs=Number.isInteger(e.hideSpeedMs)?e.hideSpeedMs:t.DEFAULTS.hideSpeedMs,e.transformOnTextChange=!!e.transformOnTextChange,e},t.prototype._lineRanges=function(t,e,r){var n=this.quill.getLines(t.range);return n.reduce((function(t,i,o){if(!i.children){var a=document.createRange();return a.selectNode(i.domNode),t.concat(a)}var s=0===o?e:i.path(0).pop(),u=s[0],c=s[1],l=o===n.length-1?r:i.path(i.length()-1).pop(),f=l[0],h=l[1],d=document.createRange();return u.domNode.nodeType===Node.TEXT_NODE?d.setStart(u.domNode,c):d.setStartBefore(u.domNode),f.domNode.nodeType===Node.TEXT_NODE?d.setEnd(f.domNode,h):d.setEndAfter(f.domNode),t.concat(d)}),[])},t.prototype._transformCursors=function(t){var e=this;t=new f(t),this.cursors().filter((function(t){return t.range})).forEach((function(r){r.range.index=t.transformPosition(r.range.index),e._updateCursor(r)}))},t.DEFAULTS={template:c.default,containerClass:\"ql-cursors\",selectionChangeSource:\"api\",hideDelayMs:3e3,hideSpeedMs:400},t}();e.default=h},338:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(r(353)),o='\\n \\n \\n \\n \\n
    \\n \\n
    \\n');e.default=o},207:function(t){t.exports=function(){\"use strict\";const t=/^\\s+/,e=/\\s+$/;function r(n,i){if(i=i||{},(n=n||\"\")instanceof r)return n;if(!(this instanceof r))return new r(n,i);var o=function(r){var n={r:0,g:0,b:0},i=1,o=null,a=null,s=null,u=!1,c=!1;return\"string\"==typeof r&&(r=function(r){r=r.replace(t,\"\").replace(e,\"\").toLowerCase();var n,i=!1;if(y[r])r=y[r],i=!0;else if(\"transparent\"==r)return{r:0,g:0,b:0,a:0,format:\"name\"};return(n=T.rgb.exec(r))?{r:n[1],g:n[2],b:n[3]}:(n=T.rgba.exec(r))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=T.hsl.exec(r))?{h:n[1],s:n[2],l:n[3]}:(n=T.hsla.exec(r))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=T.hsv.exec(r))?{h:n[1],s:n[2],v:n[3]}:(n=T.hsva.exec(r))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=T.hex8.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),a:O(n[4]),format:i?\"name\":\"hex8\"}:(n=T.hex6.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),format:i?\"name\":\"hex\"}:(n=T.hex4.exec(r))?{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),a:O(n[4]+\"\"+n[4]),format:i?\"name\":\"hex8\"}:!!(n=T.hex3.exec(r))&&{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),format:i?\"name\":\"hex\"}}(r)),\"object\"==typeof r&&(R(r.r)&&R(r.g)&&R(r.b)?(l=r.r,f=r.g,h=r.b,n={r:255*x(l,255),g:255*x(f,255),b:255*x(h,255)},u=!0,c=\"%\"===String(r.r).substr(-1)?\"prgb\":\"rgb\"):R(r.h)&&R(r.s)&&R(r.v)?(o=S(r.s),a=S(r.v),n=function(t,e,r){t=6*x(t,360),e=x(e,100),r=x(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(r.h,o,a),u=!0,c=\"hsv\"):R(r.h)&&R(r.s)&&R(r.l)&&(o=S(r.s),s=S(r.l),n=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=x(t,360),e=x(e,100),r=x(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(r.h,o,s),u=!0,c=\"hsl\"),r.hasOwnProperty(\"a\")&&(i=r.a)),i=A(i),{ok:u,format:r.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:i};var l,f,h}(n);this._originalInput=n,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||o.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function n(t,e,r){t=x(t,255),e=x(e,255),r=x(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)i.h=(i.h+o)%360,a.push(r(i));return a}function b(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,o=n.s,a=n.v,s=[],u=1/e;e--;)s.push(r({h:i,s:o,v:a})),a=(a+u)%1;return s}r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=A(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?\"hsv(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsva(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),i=Math.round(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+i+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+i+\"%, \"+this._roundA+\")\"},toHex:function(t){return o(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[E(Math.round(t).toString(16)),E(Math.round(e).toString(16)),E(Math.round(r).toString(16)),E(M(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(\"\")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return\"#\"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\")\":\"rgba(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\", \"+this._roundA+\")\"},toPercentageRgb:function(){return{r:Math.round(100*x(this._r,255))+\"%\",g:Math.round(100*x(this._g,255))+\"%\",b:Math.round(100*x(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%)\":\"rgba(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":!(this._a<1)&&(m[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e=\"#\"+a(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?\"GradientType = 1, \":\"\";if(t){var o=r(t);n=\"#\"+a(o._r,o._g,o._b,o._a)}return\"progid:DXImageTransform.Microsoft.gradient(\"+i+\"startColorstr=\"+e+\",endColorstr=\"+n+\")\"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||\"hex\"!==t&&\"hex6\"!==t&&\"hex3\"!==t&&\"hex4\"!==t&&\"hex8\"!==t&&\"name\"!==t?(\"rgb\"===t&&(r=this.toRgbString()),\"prgb\"===t&&(r=this.toPercentageRgbString()),\"hex\"!==t&&\"hex6\"!==t||(r=this.toHexString()),\"hex3\"===t&&(r=this.toHexString(!0)),\"hex4\"===t&&(r=this.toHex8String(!0)),\"hex8\"===t&&(r=this.toHex8String()),\"name\"===t&&(r=this.toName()),\"hsl\"===t&&(r=this.toHslString()),\"hsv\"===t&&(r=this.toHsvString()),r||this.toHexString()):\"name\"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},r.fromRatio=function(t,e){if(\"object\"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=\"a\"===i?t[i]:S(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),o=r(e).toRgb(),a=n/100;return r({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},r.readability=function(t,e){var n=r(t),i=r(e);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,o,a,s,u,c=r.readability(t,e);switch(o=!1,(a=n,\"AA\"!==(s=((a=a||{level:\"AA\",size:\"small\"}).level||\"AA\").toUpperCase())&&\"AAA\"!==s&&(s=\"AA\"),\"small\"!==(u=(a.size||\"small\").toLowerCase())&&\"large\"!==u&&(u=\"small\"),i={level:s,size:u}).level+i.size){case\"AAsmall\":case\"AAAlarge\":o=c>=4.5;break;case\"AAlarge\":o=c>=3;break;case\"AAAsmall\":o=c>=7}return o},r.mostReadable=function(t,e,n){var i,o,a,s,u=null,c=0;o=(n=n||{}).includeFallbackColors,a=n.level,s=n.size;for(var l=0;lc&&(c=i,u=r(e[l]));return r.isReadable(t,u,{level:a,size:s})||!o?u:(n.includeFallbackColors=!1,r.mostReadable(t,[\"#fff\",\"#000\"],n))};var y=r.names={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"0ff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000\",blanchedalmond:\"ffebcd\",blue:\"00f\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",burntsienna:\"ea7e5d\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"0ff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkgrey:\"a9a9a9\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkslategrey:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dimgrey:\"696969\",dodgerblue:\"1e90ff\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"f0f\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",grey:\"808080\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgray:\"d3d3d3\",lightgreen:\"90ee90\",lightgrey:\"d3d3d3\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslategray:\"789\",lightslategrey:\"789\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"0f0\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"f0f\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370db\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"db7093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",rebeccapurple:\"663399\",red:\"f00\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",slategrey:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",wheat:\"f5deb3\",white:\"fff\",whitesmoke:\"f5f5f5\",yellow:\"ff0\",yellowgreen:\"9acd32\"},m=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(y);function A(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function x(t,e){(function(t){return\"string\"==typeof t&&-1!=t.indexOf(\".\")&&1===parseFloat(t)})(t)&&(t=\"100%\");var r=function(t){return\"string\"==typeof t&&-1!=t.indexOf(\"%\")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function C(t){return Math.min(1,Math.max(0,t))}function w(t){return parseInt(t,16)}function E(t){return 1==t.length?\"0\"+t:\"\"+t}function S(t){return t<=1&&(t=100*t+\"%\"),t}function M(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return w(t)/255}var j,L,k,T=(L=\"[\\\\s|\\\\(]+(\"+(j=\"(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)\")+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",k=\"[\\\\s|\\\\(]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",{CSS_UNIT:new RegExp(j),rgb:new RegExp(\"rgb\"+L),rgba:new RegExp(\"rgba\"+k),hsl:new RegExp(\"hsl\"+L),hsla:new RegExp(\"hsla\"+k),hsv:new RegExp(\"hsv\"+L),hsva:new RegExp(\"hsva\"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(t){return!!T.CSS_UNIT.exec(t)}return r}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.nc=void 0;var n=r(607);return n.default})()));", "/* eslint-env browser */\n\n/**\n * Tiny websocket connection handler.\n *\n * Implements exponential backoff reconnects, ping/pong, and a nice event system using [lib0/observable].\n *\n * @module websocket\n */\n\nimport { Observable } from './observable.js'\nimport * as time from './time.js'\nimport * as math from './math.js'\n\nconst reconnectTimeoutBase = 1200\nconst maxReconnectTimeout = 2500\n// @todo - this should depend on awareness.outdatedTime\nconst messageReconnectTimeout = 30000\n\n/**\n * @param {WebsocketClient} wsclient\n */\nconst setupWS = (wsclient) => {\n if (wsclient.shouldConnect && wsclient.ws === null) {\n const websocket = new WebSocket(wsclient.url)\n const binaryType = wsclient.binaryType\n /**\n * @type {any}\n */\n let pingTimeout = null\n if (binaryType) {\n websocket.binaryType = binaryType\n }\n wsclient.ws = websocket\n wsclient.connecting = true\n wsclient.connected = false\n websocket.onmessage = event => {\n wsclient.lastMessageReceived = time.getUnixTime()\n const data = event.data\n const message = typeof data === 'string' ? JSON.parse(data) : data\n if (message && message.type === 'pong') {\n clearTimeout(pingTimeout)\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n wsclient.emit('message', [message, wsclient])\n }\n /**\n * @param {any} error\n */\n const onclose = error => {\n if (wsclient.ws !== null) {\n wsclient.ws = null\n wsclient.connecting = false\n if (wsclient.connected) {\n wsclient.connected = false\n wsclient.emit('disconnect', [{ type: 'disconnect', error }, wsclient])\n } else {\n wsclient.unsuccessfulReconnects++\n }\n // Start with no reconnect timeout and increase timeout by\n // log10(wsUnsuccessfulReconnects).\n // The idea is to increase reconnect timeout slowly and have no reconnect\n // timeout at the beginning (log(1) = 0)\n setTimeout(setupWS, math.min(math.log10(wsclient.unsuccessfulReconnects + 1) * reconnectTimeoutBase, maxReconnectTimeout), wsclient)\n }\n clearTimeout(pingTimeout)\n }\n const sendPing = () => {\n if (wsclient.ws === websocket) {\n wsclient.send({\n type: 'ping'\n })\n }\n }\n websocket.onclose = () => onclose(null)\n websocket.onerror = error => onclose(error)\n websocket.onopen = () => {\n wsclient.lastMessageReceived = time.getUnixTime()\n wsclient.connecting = false\n wsclient.connected = true\n wsclient.unsuccessfulReconnects = 0\n wsclient.emit('connect', [{ type: 'connect' }, wsclient])\n // set ping\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n }\n}\n\n/**\n * @deprecated\n * @extends Observable\n */\nexport class WebsocketClient extends Observable {\n /**\n * @param {string} url\n * @param {object} opts\n * @param {'arraybuffer' | 'blob' | null} [opts.binaryType] Set `ws.binaryType`\n */\n constructor (url, { binaryType } = {}) {\n super()\n this.url = url\n /**\n * @type {WebSocket?}\n */\n this.ws = null\n this.binaryType = binaryType || null\n this.connected = false\n this.connecting = false\n this.unsuccessfulReconnects = 0\n this.lastMessageReceived = 0\n /**\n * Whether to connect to other peers or not\n * @type {boolean}\n */\n this.shouldConnect = true\n this._checkInterval = setInterval(() => {\n if (this.connected && messageReconnectTimeout < time.getUnixTime() - this.lastMessageReceived) {\n // no message received in a long time - not even your own awareness\n // updates (which are updated every 15 seconds)\n /** @type {WebSocket} */ (this.ws).close()\n }\n }, messageReconnectTimeout / 2)\n setupWS(this)\n }\n\n /**\n * @param {any} message\n */\n send (message) {\n if (this.ws) {\n this.ws.send(JSON.stringify(message))\n }\n }\n\n destroy () {\n clearInterval(this._checkInterval)\n this.disconnect()\n super.destroy()\n }\n\n disconnect () {\n this.shouldConnect = false\n if (this.ws !== null) {\n this.ws.close()\n }\n }\n\n connect () {\n this.shouldConnect = true\n if (!this.connected && this.ws === null) {\n setupWS(this)\n }\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers for cross-tab communication using broadcastchannel with LocalStorage fallback.\n *\n * ```js\n * // In browser window A:\n * broadcastchannel.subscribe('my events', data => console.log(data))\n * broadcastchannel.publish('my events', 'Hello world!') // => A: 'Hello world!' fires synchronously in same tab\n *\n * // In browser window B:\n * broadcastchannel.publish('my events', 'hello from tab B') // => A: 'hello from tab B'\n * ```\n *\n * @module broadcastchannel\n */\n\n// @todo before next major: use Uint8Array instead as buffer object\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as buffer from './buffer.js'\nimport * as storage from './storage.js'\n\n/**\n * @typedef {Object} Channel\n * @property {Set} Channel.subs\n * @property {any} Channel.bc\n */\n\n/**\n * @type {Map}\n */\nconst channels = new Map()\n\n/* c8 ignore start */\nclass LocalStoragePolyfill {\n /**\n * @param {string} room\n */\n constructor (room) {\n this.room = room\n /**\n * @type {null|function({data:ArrayBuffer}):void}\n */\n this.onmessage = null\n /**\n * @param {any} e\n */\n this._onChange = e => e.key === room && this.onmessage !== null && this.onmessage({ data: buffer.fromBase64(e.newValue || '') })\n storage.onChange(this._onChange)\n }\n\n /**\n * @param {ArrayBuffer} buf\n */\n postMessage (buf) {\n storage.varStorage.setItem(this.room, buffer.toBase64(buffer.createUint8ArrayFromArrayBuffer(buf)))\n }\n\n close () {\n storage.offChange(this._onChange)\n }\n}\n/* c8 ignore stop */\n\n// Use BroadcastChannel or Polyfill\n/* c8 ignore next */\nconst BC = typeof BroadcastChannel === 'undefined' ? LocalStoragePolyfill : BroadcastChannel\n\n/**\n * @param {string} room\n * @return {Channel}\n */\nconst getChannel = room =>\n map.setIfUndefined(channels, room, () => {\n const subs = set.create()\n const bc = new BC(room)\n /**\n * @param {{data:ArrayBuffer}} e\n */\n /* c8 ignore next */\n bc.onmessage = e => subs.forEach(sub => sub(e.data, 'broadcastchannel'))\n return {\n bc, subs\n }\n })\n\n/**\n * Subscribe to global `publish` events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const subscribe = (room, f) => {\n getChannel(room).subs.add(f)\n return f\n}\n\n/**\n * Unsubscribe from `publish` global events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const unsubscribe = (room, f) => {\n const channel = getChannel(room)\n const unsubscribed = channel.subs.delete(f)\n if (unsubscribed && channel.subs.size === 0) {\n channel.bc.close()\n channels.delete(room)\n }\n return unsubscribed\n}\n\n/**\n * Publish data to all subscribers (including subscribers on this tab)\n *\n * @function\n * @param {string} room\n * @param {any} data\n * @param {any} [origin]\n */\nexport const publish = (room, data, origin = null) => {\n const c = getChannel(room)\n c.bc.postMessage(data)\n c.subs.forEach(sub => sub(data, origin))\n}\n", "/**\n * Mutual exclude for JavaScript.\n *\n * @module mutex\n */\n\n/**\n * @callback mutex\n * @param {function():void} cb Only executed when this mutex is not in the current stack\n * @param {function():void} [elseCb] Executed when this mutex is in the current stack\n */\n\n/**\n * Creates a mutual exclude function with the following property:\n *\n * ```js\n * const mutex = createMutex()\n * mutex(() => {\n * // This function is immediately executed\n * mutex(() => {\n * // This function is not executed, as the mutex is already active.\n * })\n * })\n * ```\n *\n * @return {mutex} A mutual exclude function\n * @public\n */\nexport const createMutex = () => {\n let token = true\n return (f, g) => {\n if (token) {\n token = false\n try {\n f()\n } finally {\n token = true\n }\n } else if (g !== undefined) {\n g()\n }\n }\n}\n", "(function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var t;t=\"undefined\"==typeof window?\"undefined\"==typeof global?\"undefined\"==typeof self?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(s,e,n){function t(o,i){if(!e[o]){if(!s[o]){var l=\"function\"==typeof require&&require;if(!i&&l)return l(o,!0);if(r)return r(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var a=e[o]={exports:{}};s[o][0].call(a.exports,function(e){var r=s[o][1][e];return t(r||e)},a,a.exports,d,s,e,n)}return e[o].exports}for(var r=\"function\"==typeof require&&require,a=0;a>16,l[c++]=255&t>>8,l[c++]=255&t;return 2===s&&(t=u[e.charCodeAt(n)]<<2|u[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===s&&(t=u[e.charCodeAt(n)]<<10|u[e.charCodeAt(n+1)]<<4|u[e.charCodeAt(n+2)]>>2,l[c++]=255&t>>8,l[c++]=255&t),l}function d(e){return c[63&e>>18]+c[63&e>>12]+c[63&e>>6]+c[63&e]}function s(e,t,n){for(var r,a=[],o=t;ol?l:d+o));return 1===r?(t=e[n-1],a.push(c[t>>2]+c[63&t<<4]+\"==\")):2===r&&(t=(e[n-2]<<8)+e[n-1],a.push(c[t>>10]+c[63&t>>4]+c[63&t<<2]+\"=\")),a.join(\"\")}n.byteLength=function(e){var t=r(e),n=t[0],a=t[1];return 3*(n+a)/4-a},n.toByteArray=o,n.fromByteArray=l;for(var c=[],u=[],p=\"undefined\"==typeof Uint8Array?Array:Uint8Array,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",g=0,_=f.length;g<_;++g)c[g]=f[g],u[f.charCodeAt(g)]=g;u[45]=62,u[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){(function(){(function(){/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */'use strict';var t=String.fromCharCode,o=Math.min;function d(e){if(2147483647e)throw new RangeError(\"The value \\\"\"+e+\"\\\" is invalid for option \\\"size\\\"\")}function u(e,t,n){return c(e),0>=e?d(e):void 0===t?d(e):\"string\"==typeof n?d(e).fill(t,n):d(e).fill(t)}function p(e){return c(e),d(0>e?0:0|m(e))}function f(e,t){if((\"string\"!=typeof t||\"\"===t)&&(t=\"utf8\"),!s.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);var n=0|b(e,t),r=d(n),a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function g(e){for(var t=0>e.length?0:0|m(e.length),n=d(t),r=0;rt||e.byteLength=2147483647)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+2147483647 .toString(16)+\" bytes\");return 0|e}function b(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. Received type \"+typeof e);var n=e.length,r=2>>1;case\"base64\":return z(e).length;default:if(a)return r?-1:H(e).length;t=(\"\"+t).toLowerCase(),a=!0;}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return\"\";if(n>>>=0,t>>>=0,n<=t)return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return P(this,t,n);case\"utf8\":case\"utf-8\":return x(this,t,n);case\"ascii\":return D(this,t,n);case\"latin1\":case\"binary\":return I(this,t,n);case\"base64\":return A(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return M(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0;}}function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function R(e,t,n,r,a){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):2147483647n&&(n=-2147483648),n=+n,X(n)&&(n=a?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(0>n)if(a)n=0;else return-1;if(\"string\"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,a);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,a);throw new TypeError(\"val must be string, number or Buffer\")}function E(e,t,n,r,a){function o(e,t){return 1===d?e[t]:e.readUInt16BE(t*d)}var d=1,s=e.length,l=t.length;if(void 0!==r&&(r=(r+\"\").toLowerCase(),\"ucs2\"===r||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(2>e.length||2>t.length)return-1;d=2,s/=2,l/=2,n/=2}var c;if(a){var u=-1;for(c=n;cs&&(n=s-l),c=n;0<=c;c--){for(var p=!0,f=0;fa&&(r=a)):r=a;var o=t.length;r>o/2&&(r=o/2);for(var d,s=0;sd&&(s=d):2===l?(c=e[a+1],128==(192&c)&&(f=(31&d)<<6|63&c,127f||57343f&&(s=f))):void 0}null===s?(s=65533,l=1):65535>>10),s=56320|1023&s),r.push(s),a+=l}return N(r)}function N(e){var n=e.length;if(n<=4096)return t.apply(String,e);for(var r=\"\",a=0;at)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var a=\"\",o=t;oe)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function F(e,t,n,r,a,o){if(!s.isBuffer(e))throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");if(t>a||te.length)throw new RangeError(\"Index out of range\")}function B(e,t,n,r){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(0>n)throw new RangeError(\"Index out of range\")}function U(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,4,34028234663852886e22,-34028234663852886e22),J.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,8,17976931348623157e292,-17976931348623157e292),J.write(e,t,n,r,52,8),n+8}function q(e){if(e=e.split(\"=\")[0],e=e.trim().replace(Q,\"\"),2>e.length)return\"\";for(;0!=e.length%4;)e+=\"=\";return e}function W(e){return 16>e?\"0\"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,r=e.length,a=null,o=[],d=0;dn){if(!a){if(56319n){-1<(t-=3)&&o.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&-1<(t-=3)&&o.push(239,191,189);if(a=null,128>n){if(0>(t-=1))break;o.push(n)}else if(2048>n){if(0>(t-=2))break;o.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;o.push(224|n>>12,128|63&n>>6,128|63&n)}else if(1114112>n){if(0>(t-=4))break;o.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}else throw new Error(\"Invalid code point\")}return o}function Y(e){for(var t=[],n=0;n(t-=2));++d)n=e.charCodeAt(d),r=n>>8,a=n%256,o.push(a),o.push(r);return o}function z(e){return $.toByteArray(q(e))}function G(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}var $=e(\"base64-js\"),J=e(\"ieee754\");n.Buffer=s,n.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},n.INSPECT_MAX_BYTES=50;n.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(s.prototype,\"parent\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,\"offset\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),\"undefined\"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,n){return u(e,t,n)},s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");if(e===t)return 0;for(var n=e.length,r=t.length,d=0,l=o(n,r);dt&&(e+=\" ... \"),\"\"},s.prototype.compare=function(e,t,n,r,a){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. Received type \"+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),0>t||n>e.length||0>r||a>this.length)throw new RangeError(\"out of range index\");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var d=a-r,l=n-t,c=o(d,l),u=this.slice(r,a),p=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0);else throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");var a=this.length-t;if((void 0===n||n>a)&&(n=a),0n||0>t)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");for(var o=!1;;)switch(r){case\"hex\":return w(this,e,t,n);case\"utf8\":case\"utf-8\":return S(this,e,t,n);case\"ascii\":return T(this,e,t,n);case\"latin1\":case\"binary\":return v(this,e,t,n);case\"base64\":return k(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return L(this,e,t,n);default:if(o)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),o=!0;}},s.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],a=1,o=0;++o>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],a=1;0>>=0,t||O(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=this[e],o=1,d=0;++d=o&&(a-=r(2,8*t)),a},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=t,o=1,d=this[e+--a];0=o&&(d-=r(2,8*t)),d},s.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t>>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=n-1,s=1;for(this[t+d]=255&e;0<=--d&&(s*=256);)this[t+d]=255&e/s;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=0,s=1,l=0;for(this[t]=255&e;++de&&0===l&&0!==this[t+d-1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=n-1,s=1,l=0;for(this[t+d]=255&e;0<=--d&&(s*=256);)0>e&&0===l&&0!==this[t+d+1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0t)throw new RangeError(\"targetStart out of bounds\");if(0>n||n>=this.length)throw new RangeError(\"Index out of range\");if(0>r)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-ta||\"latin1\"===r)&&(e=a)}}else\"number\"==typeof e&&(e&=255);if(0>t||this.length>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(\"number\"==typeof e)for(o=t;o{\"%%\"===e||(r++,\"%c\"===e&&(a=r))}),e.splice(a,0,n)},n.save=function(e){try{e?n.storage.setItem(\"debug\",e):n.storage.removeItem(\"debug\")}catch(e){}},n.load=r,n.useColors=function(){return!!(\"undefined\"!=typeof window&&window.process&&(\"renderer\"===window.process.type||window.process.__nwjs))||!(\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&31<=parseInt(RegExp.$1,10)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),n.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],n.log=console.debug||console.log||(()=>{}),t.exports=e(\"./common\")(n);const{formatters:o}=t.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}}).call(this)}).call(this,e(\"_process\"))},{\"./common\":5,_process:12}],5:[function(e,t){t.exports=function(t){function r(e){function t(...e){if(!t.enabled)return;const a=t,o=+new Date,i=o-(n||o);a.diff=i,a.prev=n,a.curr=o,n=o,e[0]=r.coerce(e[0]),\"string\"!=typeof e[0]&&e.unshift(\"%O\");let d=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if(\"%%\"===t)return\"%\";d++;const o=r.formatters[n];if(\"function\"==typeof o){const n=e[d];t=o.call(a,n),e.splice(d,1),d--}return t}),r.formatArgs.call(a,e);const s=a.log||r.log;s.apply(a,e)}let n,o=null;return t.namespace=e,t.useColors=r.useColors(),t.color=r.selectColor(e),t.extend=a,t.destroy=r.destroy,Object.defineProperty(t,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null===o?r.enabled(e):o,set:e=>{o=e}}),\"function\"==typeof r.init&&r.init(t),t}function a(e,t){const n=r(this.namespace+(\"undefined\"==typeof t?\":\":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>\"-\"+e)].join(\",\");return r.enable(\"\"),e},r.enable=function(e){r.save(e),r.names=[],r.skips=[];let t;const n=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),a=n.length;for(t=0;t{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let n=0;nd&&!l.warned){l.warned=!0;var c=new Error(\"Possible EventEmitter memory leak detected. \"+l.length+\" \"+(t+\" listeners added. Use emitter.setMaxListeners() to increase limit\"));c.name=\"MaxListenersExceededWarning\",c.emitter=e,c.type=t,c.count=l.length,n(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=d.bind(r);return a.listener=n,r.wrapFn=a,a}function l(e,t,n){var r=e._events;if(r===void 0)return[];var a=r[t];return void 0===a?[]:\"function\"==typeof a?n?[a.listener||a]:[a]:n?f(a):u(a,a.length)}function c(e){var t=this._events;if(t!==void 0){var n=t[e];if(\"function\"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function u(e,t){for(var n=Array(t),r=0;re||y(e))throw new RangeError(\"The value of \\\"defaultMaxListeners\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");C=e}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||0>e||y(e))throw new RangeError(\"The value of \\\"n\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){for(var t=[],n=1;no)return this;0===o?n.shift():p(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit(\"removeListener\",e,s||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,o=Object.keys(n);for(r=0;r */o.read=function(t,n,a,o,l){var c,u,p=8*l-o-1,f=(1<>1,_=-7,h=a?l-1:0,b=a?-1:1,d=t[n+h];for(h+=b,c=d&(1<<-_)-1,d>>=-_,_+=p;0<_;c=256*c+t[n+h],h+=b,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=o;0<_;u=256*u+t[n+h],h+=b,_-=8);if(0===c)c=1-g;else{if(c===f)return u?NaN:(d?-1:1)*(1/0);u+=r(2,o),c-=g}return(d?-1:1)*u*r(2,c-o)},o.write=function(a,o,l,u,p,f){var h,b,y,g=Math.LN2,_=Math.log,C=8*f-p-1,R=(1<>1,w=23===p?r(2,-24)-r(2,-77):0,S=u?0:f-1,T=u?1:-1,d=0>o||0===o&&0>1/o?1:0;for(o=n(o),isNaN(o)||o===1/0?(b=isNaN(o)?1:0,h=R):(h=t(_(o)/g),1>o*(y=r(2,-h))&&(h--,y*=2),o+=1<=h+E?w/y:w*r(2,1-E),2<=o*y&&(h++,y/=2),h+E>=R?(b=0,h=R):1<=h+E?(b=(o*y-1)*r(2,p),h+=E):(b=o*r(2,E-1)*r(2,p),h=0));8<=p;a[l+S]=255&b,S+=T,b/=256,p-=8);for(h=h<=1.5*a?\"s\":\"\")}var l=24*(60*60000);t.exports=function(e,t){t=t||{};var n=typeof e;if(\"string\"==n&&0 */let n;t.exports=\"function\"==typeof queueMicrotask?queueMicrotask.bind(\"undefined\"==typeof window?e:window):e=>(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this)}).call(this,\"undefined\"==typeof global?\"undefined\"==typeof self?\"undefined\"==typeof window?{}:window:self:global)},{}],14:[function(e,t){(function(n,r){(function(){'use strict';var a=e(\"safe-buffer\").Buffer,o=r.crypto||r.msCrypto;t.exports=o&&o.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError(\"requested too many random bytes\");var r=a.allocUnsafe(e);if(0n?0:+n,t.length)===t}function i(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function d(e,t,n){return\"number\"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}var s={};r(\"ERR_INVALID_OPT_VALUE\",function(e,t){return\"The value \\\"\"+t+\"\\\" is invalid for option \\\"\"+e+\"\\\"\"},TypeError),r(\"ERR_INVALID_ARG_TYPE\",function(e,t,n){var r;\"string\"==typeof t&&o(t,\"not \")?(r=\"must not be\",t=t.replace(/^not /,\"\")):r=\"must be\";var s;if(i(e,\" argument\"))s=\"The \".concat(e,\" \").concat(r,\" \").concat(a(t,\"type\"));else{var l=d(e,\".\")?\"property\":\"argument\";s=\"The \\\"\".concat(e,\"\\\" \").concat(l,\" \").concat(r,\" \").concat(a(t,\"type\"))}return s+=\". Received type \".concat(typeof n),s},TypeError),r(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),r(\"ERR_METHOD_NOT_IMPLEMENTED\",function(e){return\"The \"+e+\" method is not implemented\"}),r(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),r(\"ERR_STREAM_DESTROYED\",function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"}),r(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),r(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),r(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),r(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),r(\"ERR_UNKNOWN_ENCODING\",function(e){return\"Unknown encoding: \"+e},TypeError),r(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=s},{}],16:[function(e,t){(function(n){(function(){'use strict';function r(e){return this instanceof r?void(d.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",a)))):new r(e)}function a(){this._writableState.ended||n.nextTick(o,this)}function o(e){e.end()}var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var d=e(\"./_stream_readable\"),s=e(\"./_stream_writable\");e(\"inherits\")(r,d);for(var l,c=i(s.prototype),u=0;u>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function g(e,t){if(x(\"onEofChunk\"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?_(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,h(e)))}}function _(e){var t=e._readableState;x(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x(\"emitReadable\",t.flowing),t.emittedReadable=!0,n.nextTick(h,e))}function h(e){var t=e._readableState;x(\"emitReadable_\",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,S(e)}function m(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(b,e,t))}function b(e,t){for(;!t.reading&&!t.ended&&(t.length=t.length?(n=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function v(e){var t=e._readableState;x(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){if(x(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark)||t.ended))return x(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?v(this):_(this),null;if(e=f(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var a=t.needReadable;x(\"need readable\",a),(0===t.length||t.length-e>>0),n=this.head,r=0;n;)s(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:\"consume\",value:function(e,t){var n;return eo.length?o.length:e;if(a+=i===o.length?o:o.slice(0,e),e-=i,0===e){i===o.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,a}},{key:\"_getBuffer\",value:function(e){var t=u.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),e-=i,0===e){i===o.length?(++a,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=o.slice(i));break}++a}return this.length-=a,t}},{key:g,value:function(e,t){return f(this,r({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:3,util:2}],23:[function(e,t){(function(e){(function(){'use strict';function n(e,t){a(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function a(e,t){e.emit(\"error\",t)}t.exports={destroy:function(t,o){var i=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(t):t&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(a,this,t)):e.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!o&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(r,i):(i._writableState.errorEmitted=!0,e.nextTick(n,i,t)):e.nextTick(n,i,t):o?(e.nextTick(r,i),o(t)):e.nextTick(r,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}}).call(this)}).call(this,e(\"_process\"))},{_process:12}],24:[function(e,t){'use strict';function n(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),a=0;at.length)throw new u(\"streams\");var a,l=t.map(function(e,n){var d=nd){var s=i?o:\"highWaterMark\";throw new a(s,d)}return t(d)}return e.objectMode?16:16384}}},{\"../../../errors\":15}],28:[function(e,t){t.exports=e(\"events\").EventEmitter},{events:7}],29:[function(e,t,n){n=t.exports=e(\"./lib/_stream_readable.js\"),n.Stream=n,n.Readable=n,n.Writable=e(\"./lib/_stream_writable.js\"),n.Duplex=e(\"./lib/_stream_duplex.js\"),n.Transform=e(\"./lib/_stream_transform.js\"),n.PassThrough=e(\"./lib/_stream_passthrough.js\"),n.finished=e(\"./lib/internal/streams/end-of-stream.js\"),n.pipeline=e(\"./lib/internal/streams/pipeline.js\")},{\"./lib/_stream_duplex.js\":16,\"./lib/_stream_passthrough.js\":17,\"./lib/_stream_readable.js\":18,\"./lib/_stream_transform.js\":19,\"./lib/_stream_writable.js\":20,\"./lib/internal/streams/end-of-stream.js\":24,\"./lib/internal/streams/pipeline.js\":26}],30:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var o=e(\"buffer\"),i=o.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=o:(r(o,n),n.Buffer=a),a.prototype=Object.create(i.prototype),r(i,a),a.from=function(e,t,n){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return i(e,t,n)},a.alloc=function(e,t,n){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var r=i(e);return void 0===t?r.fill(0):\"string\"==typeof n?r.fill(t,n):r.fill(t),r},a.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return i(e)},a.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return o.SlowBuffer(e)}},{buffer:3}],31:[function(e,t,n){'use strict';function r(e){if(!e)return\"utf8\";for(var t;;)switch(e){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0;}}function a(e){var t=r(e);if(\"string\"!=typeof t&&(m.isEncoding===b||!b(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}function o(e){this.encoding=a(e);var t;switch(this.encoding){case\"utf16le\":this.text=u,this.end=p,t=4;break;case\"utf8\":this.fillLast=c,t=4;break;case\"base64\":this.text=f,this.end=g,t=3;break;default:return this.write=_,void(this.end=h);}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t)}function d(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function s(e,t,n){var r=t.length-1;if(r=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,n)}return t}function f(e,t){var r=(e.length-t)%3;return 0==r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function _(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):\"\"}var m=e(\"safe-buffer\").Buffer,b=m.isEncoding||function(e){switch(e=\"\"+e,e&&e.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1;}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return\"\";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return\"\";n=this.lastNeed,this.lastNeed=0}else n=0;return n */const a=e(\"debug\")(\"simple-peer\"),o=e(\"get-browser-rtc\"),i=e(\"randombytes\"),d=e(\"readable-stream\"),s=e(\"queue-microtask\"),l=e(\"err-code\"),{Buffer:c}=e(\"buffer\"),u=65536;class p extends d.Duplex{constructor(e){if(e=Object.assign({allowHalfOpen:!1},e),super(e),this._id=i(4).toString(\"hex\").slice(0,7),this._debug(\"new peer %o\",e),this.channelName=e.initiator?e.channelName||i(20).toString(\"hex\"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||p.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},p.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5000,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&\"object\"==typeof e.wrtc?e.wrtc:o(),!this._wrtc)if(\"undefined\"==typeof window)throw l(new Error(\"No WebRTC support: Specify `opts.wrtc` option in this environment\"),\"ERR_WEBRTC_SUPPORT\");else throw l(new Error(\"No WebRTC support: Not a supported browser\"),\"ERR_WEBRTC_SUPPORT\");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(l(e,\"ERR_PC_CONSTRUCTOR\"))}this._isReactNativeWebrtc=\"number\"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},\"object\"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(e=>{this.destroy(l(e,\"ERR_PC_PEER_IDENTITY\"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach(e=>{this.addStream(e)}),this._pc.ontrack=e=>{this._onTrack(e)},this._debug(\"initial negotiation\"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once(\"finish\",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&\"open\"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot signal after peer is destroyed\"),\"ERR_DESTROYED\");if(\"string\"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug(\"signal()\"),e.renegotiate&&this.initiator&&(this._debug(\"got request to renegotiate\"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug(\"got request for transceiver\"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e=>{this._addIceCandidate(e)}),this._pendingCandidates=[],\"offer\"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(e=>{this.destroy(l(e,\"ERR_SET_REMOTE_DESCRIPTION\"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(l(new Error(\"signal() called with invalid signal data\"),\"ERR_SIGNALING\"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch(e=>{!t.address||t.address.endsWith(\".local\")?r(\"Ignoring unsupported ICE candidate.\"):this.destroy(l(e,\"ERR_ADD_ICE_CANDIDATE\"))})}send(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot send after peer is destroyed\"),\"ERR_DESTROYED\");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addTransceiver after peer is destroyed\"),\"ERR_DESTROYED\");if(this._debug(\"addTransceiver()\"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(l(e,\"ERR_ADD_TRANSCEIVER\"))}else this.emit(\"signal\",{type:\"transceiverRequest\",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addStream()\"),e.getTracks().forEach(t=>{this.addTrack(t,e)})}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot addTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addTrack()\");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(!r)r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation();else if(r.removed)throw l(new Error(\"Track has been removed. You should enable/disable tracks that you want to re-add.\"),\"ERR_SENDER_REMOVED\");else throw l(new Error(\"Track has already been added to that stream.\"),\"ERR_SENDER_ALREADY_ADDED\")}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot replaceTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"replaceTrack()\");const r=this._senderMap.get(e),a=r?r.get(n):null;if(!a)throw l(new Error(\"Cannot replace track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");t&&this._senderMap.set(t,r),null==a.replaceTrack?this.destroy(l(new Error(\"replaceTrack is not supported in this browser\"),\"ERR_UNSUPPORTED_REPLACETRACK\")):a.replaceTrack(t)}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot removeTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSender()\");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw l(new Error(\"Cannot remove track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){\"NS_ERROR_UNEXPECTED\"===e.name?this._sendersAwaitingStable.push(r):this.destroy(l(e,\"ERR_REMOVE_TRACK\"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot removeStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSenders()\"),e.getTracks().forEach(t=>{this.removeTrack(t,e)})}}_needsNegotiation(){this._debug(\"_needsNegotiation\"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug(\"starting batched negotiation\"),this.negotiate()):this._debug(\"non-initiator initial negotiation request discarded\"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot negotiate after peer is destroyed\"),\"ERR_DESTROYED\");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"start negotiation\"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"requesting negotiation from initiator\"),this.emit(\"signal\",{type:\"renegotiate\",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,()=>{})}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug(\"destroying (error: %s)\",e&&(e.message||e)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug(\"destroy (error: %s)\",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener(\"finish\",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit(\"error\",e),this.emit(\"close\"),t()}))}_setupData(e){if(!e.channel)return this.destroy(l(new Error(\"Data channel event is missing `channel` property\"),\"ERR_DATA_CHANNEL\"));this._channel=e.channel,this._channel.binaryType=\"arraybuffer\",\"number\"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(l(t,\"ERR_DATA_CHANNEL\"))};let t=!1;this._closingInterval=setInterval(()=>{this._channel&&\"closing\"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1},5000)}_read(){}_write(e,t,n){if(this.destroyed)return n(l(new Error(\"cannot write after peer is destroyed\"),\"ERR_DATA_CHANNEL\"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._channel.bufferedAmount>u?(this._debug(\"start backpressure: bufferedAmount %d\",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug(\"write before connect\"),this._chunk=e,this._cb=n}_onFinish(){if(!this.destroyed){const e=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e():this.once(\"connect\",e)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug(\"started iceComplete timeout\"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug(\"iceComplete timeout completed\"),this.emit(\"iceTimeout\"),this.emit(\"_iceComplete\"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp})}};this._pc.setLocalDescription(e).then(()=>{this._debug(\"createOffer success\"),this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_OFFER\"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_ANSWER\"))})}_onConnectionStateChange(){this.destroyed||\"failed\"===this._pc.connectionState&&this.destroy(l(new Error(\"Connection failed.\"),\"ERR_CONNECTION_FAILURE\"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug(\"iceStateChange (connection: %s) (gathering: %s)\",e,t),this.emit(\"iceStateChange\",e,t),(\"connected\"===e||\"completed\"===e)&&(this._pcReady=!0,this._maybeReady()),\"failed\"===e&&this.destroy(l(new Error(\"Ice connection failed.\"),\"ERR_ICE_CONNECTION_FAILURE\")),\"closed\"===e&&this.destroy(l(new Error(\"Ice connection closed.\"),\"ERR_ICE_CONNECTION_CLOSED\"))}getStats(e){const t=e=>(\"[object Array]\"===Object.prototype.toString.call(e.values)&&e.values.forEach(t=>{Object.assign(e,t)}),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(e=>{r.push(t(e))}),e(null,r)},t=>e(t)):0{if(this.destroyed)return;const r=[];n.result().forEach(e=>{const n={};e.names().forEach(t=>{n[t]=e.stat(t)}),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))}),e(null,r)},t=>e(t)):e(null,[])}_maybeReady(){if(this._debug(\"maybeReady pc %s channel %s\",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},a={},o={};let i=!1;n.forEach(e=>{(\"remotecandidate\"===e.type||\"remote-candidate\"===e.type)&&(r[e.id]=e),(\"localcandidate\"===e.type||\"local-candidate\"===e.type)&&(a[e.id]=e),(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&(o[e.id]=e)});const d=e=>{i=!0;let t=a[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=+t.port):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=+t.portNumber):\"string\"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(\":\"),this.localAddress=t[0],this.localPort=+t[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(\":\")?\"IPv6\":\"IPv4\");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=+n.port):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=+n.portNumber):\"string\"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(\":\"),this.remoteAddress=n[0],this.remotePort=+n[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(\":\")?\"IPv6\":\"IPv4\"),this._debug(\"connect local: %s:%s remote: %s:%s\",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach(e=>{\"transport\"===e.type&&e.selectedCandidatePairId&&d(o[e.selectedCandidatePairId]),(\"googCandidatePair\"===e.type&&\"true\"===e.googActiveConnection||(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&e.selected)&&d(e)}),!i&&(!Object.keys(o).length||Object.keys(a).length))return void setTimeout(e,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._chunk=null,this._debug(\"sent chunk from \\\"write before connect\\\"\");const e=this._cb;this._cb=null,e(null)}\"number\"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug(\"connect\"),this.emit(\"connect\")})};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(\"stable\"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug(\"flushing sender queue\",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug(\"flushing negotiation queue\"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug(\"negotiated\"),this.emit(\"negotiated\"))),this._debug(\"signalingStateChange %s\",this._pc.signalingState),this.emit(\"signalingStateChange\",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit(\"signal\",{type:\"candidate\",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit(\"_iceComplete\")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug(\"ending backpressure: bufferedAmount %d\",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug(\"on channel open\"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug(\"on channel close\"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach(t=>{this._debug(\"on track\"),this.emit(\"track\",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some(e=>e.id===t.id)||(this._remoteStreams.push(t),s(()=>{this._debug(\"on stream\"),this.emit(\"stream\",t)}))})}_debug(){const e=[].slice.call(arguments);e[0]=\"[\"+this._id+\"] \"+e[0],a.apply(null,e)}}p.WEBRTC_SUPPORT=!!o(),p.config={iceServers:[{urls:[\"stun:stun.l.google.com:19302\",\"stun:global.stun.twilio.com:3478\"]}],sdpSemantics:\"unified-plan\"},p.channelConfig={},t.exports=p},{buffer:3,debug:4,\"err-code\":6,\"get-browser-rtc\":8,\"queue-microtask\":13,randombytes:14,\"readable-stream\":29}]},{},[])(\"/\")});", "/**\n * @module sync-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as Y from 'yjs'\n\n/**\n * @typedef {Map} StateMap\n */\n\n/**\n * Core Yjs defines two message types:\n * \u2022 YjsSyncStep1: Includes the State Set of the sending client. When received, the client should reply with YjsSyncStep2.\n * \u2022 YjsSyncStep2: Includes all missing structs and the complete delete set. When received, the client is assured that it\n * received all information from the remote client.\n *\n * In a peer-to-peer network, you may want to introduce a SyncDone message type. Both parties should initiate the connection\n * with SyncStep1. When a client received SyncStep2, it should reply with SyncDone. When the local client received both\n * SyncStep2 and SyncDone, it is assured that it is synced to the remote client.\n *\n * In a client-server model, you want to handle this differently: The client should initiate the connection with SyncStep1.\n * When the server receives SyncStep1, it should reply with SyncStep2 immediately followed by SyncStep1. The client replies\n * with SyncStep2 when it receives SyncStep1. Optionally the server may send a SyncDone after it received SyncStep2, so the\n * client knows that the sync is finished. There are two reasons for this more elaborated sync model: 1. This protocol can\n * easily be implemented on top of http and websockets. 2. The server should only reply to requests, and not initiate them.\n * Therefore it is necessary that the client initiates the sync.\n *\n * Construction of a message:\n * [messageType : varUint, message definition..]\n *\n * Note: A message does not include information about the room name. This must to be handled by the upper layer protocol!\n *\n * stringify[messageType] stringifies a message definition (messageType is already read from the bufffer)\n */\n\nexport const messageYjsSyncStep1 = 0\nexport const messageYjsSyncStep2 = 1\nexport const messageYjsUpdate = 2\n\n/**\n * Create a sync step 1 message based on the state of the current shared document.\n *\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n */\nexport const writeSyncStep1 = (encoder, doc) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep1)\n const sv = Y.encodeStateVector(doc)\n encoding.writeVarUint8Array(encoder, sv)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n * @param {Uint8Array} [encodedStateVector]\n */\nexport const writeSyncStep2 = (encoder, doc, encodedStateVector) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep2)\n encoding.writeVarUint8Array(encoder, Y.encodeStateAsUpdate(doc, encodedStateVector))\n}\n\n/**\n * Read SyncStep1 message and reply with SyncStep2.\n *\n * @param {decoding.Decoder} decoder The reply to the received message\n * @param {encoding.Encoder} encoder The received message\n * @param {Y.Doc} doc\n */\nexport const readSyncStep1 = (decoder, encoder, doc) =>\n writeSyncStep2(encoder, doc, decoding.readVarUint8Array(decoder))\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncStep2 = (decoder, doc, transactionOrigin) => {\n try {\n Y.applyUpdate(doc, decoding.readVarUint8Array(decoder), transactionOrigin)\n } catch (error) {\n // This catches errors that are thrown by event handlers\n console.error('Caught error while handling a Yjs update', error)\n }\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Uint8Array} update\n */\nexport const writeUpdate = (encoder, update) => {\n encoding.writeVarUint(encoder, messageYjsUpdate)\n encoding.writeVarUint8Array(encoder, update)\n}\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readUpdate = readSyncStep2\n\n/**\n * @param {decoding.Decoder} decoder A message received from another client\n * @param {encoding.Encoder} encoder The reply message. Does not need to be sent if empty.\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {\n const messageType = decoding.readVarUint(decoder)\n switch (messageType) {\n case messageYjsSyncStep1:\n readSyncStep1(decoder, encoder, doc)\n break\n case messageYjsSyncStep2:\n readSyncStep2(decoder, doc, transactionOrigin)\n break\n case messageYjsUpdate:\n readUpdate(decoder, doc, transactionOrigin)\n break\n default:\n throw new Error('Unknown message type')\n }\n return messageType\n}\n", "/* eslint-env browser */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as promise from 'lib0/promise'\nimport * as error from 'lib0/error'\nimport * as string from 'lib0/string'\n\n/**\n * @param {string} secret\n * @param {string} roomName\n * @return {PromiseLike}\n */\nexport const deriveKey = (secret, roomName) => {\n const secretBuffer = string.encodeUtf8(secret).buffer\n const salt = string.encodeUtf8(roomName).buffer\n return crypto.subtle.importKey(\n 'raw',\n secretBuffer,\n 'PBKDF2',\n false,\n ['deriveKey']\n ).then(keyMaterial =>\n crypto.subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt,\n iterations: 100000,\n hash: 'SHA-256'\n },\n keyMaterial,\n {\n name: 'AES-GCM',\n length: 256\n },\n true,\n ['encrypt', 'decrypt']\n )\n )\n}\n\n/**\n * @param {Uint8Array} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted, base64 encoded message\n */\nexport const encrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const iv = crypto.getRandomValues(new Uint8Array(12))\n return crypto.subtle.encrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n data\n ).then(cipher => {\n const encryptedDataEncoder = encoding.createEncoder()\n encoding.writeVarString(encryptedDataEncoder, 'AES-GCM')\n encoding.writeVarUint8Array(encryptedDataEncoder, iv)\n encoding.writeVarUint8Array(encryptedDataEncoder, new Uint8Array(cipher))\n return encoding.toUint8Array(encryptedDataEncoder)\n })\n}\n\n/**\n * @param {Object} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted data, if key is provided\n */\nexport const encryptJson = (data, key) => {\n const dataEncoder = encoding.createEncoder()\n encoding.writeAny(dataEncoder, data)\n return encrypt(encoding.toUint8Array(dataEncoder), key)\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted buffer\n */\nexport const decrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const dataDecoder = decoding.createDecoder(data)\n const algorithm = decoding.readVarString(dataDecoder)\n if (algorithm !== 'AES-GCM') {\n promise.reject(error.create('Unknown encryption algorithm'))\n }\n const iv = decoding.readVarUint8Array(dataDecoder)\n const cipher = decoding.readVarUint8Array(dataDecoder)\n return crypto.subtle.decrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n cipher\n ).then(data => new Uint8Array(data))\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted object\n */\nexport const decryptJson = (data, key) =>\n decrypt(data, key).then(decryptedValue =>\n decoding.readAny(decoding.createDecoder(new Uint8Array(decryptedValue)))\n )\n", "import * as ws from 'lib0/websocket'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\nimport * as random from 'lib0/random'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport { ObservableV2 } from 'lib0/observable'\nimport * as logging from 'lib0/logging'\nimport * as promise from 'lib0/promise'\nimport * as bc from 'lib0/broadcastchannel'\nimport * as buffer from 'lib0/buffer'\nimport * as math from 'lib0/math'\nimport { createMutex } from 'lib0/mutex'\n\nimport * as Y from 'yjs' // eslint-disable-line\nimport Peer from 'simple-peer/simplepeer.min.js'\n\nimport * as syncProtocol from 'y-protocols/sync'\nimport * as awarenessProtocol from 'y-protocols/awareness'\n\nimport * as cryptoutils from './crypto.js'\n\nconst log = logging.createModuleLogger('y-webrtc')\n\nconst messageSync = 0\nconst messageQueryAwareness = 3\nconst messageAwareness = 1\nconst messageBcPeerId = 4\n\n/**\n * @type {Map}\n */\nconst signalingConns = new Map()\n\n/**\n * @type {Map}\n */\nconst rooms = new Map()\n\n/**\n * @param {Room} room\n */\nconst checkIsSynced = room => {\n let synced = true\n room.webrtcConns.forEach(peer => {\n if (!peer.synced) {\n synced = false\n }\n })\n if ((!synced && room.synced) || (synced && !room.synced)) {\n room.synced = synced\n room.provider.emit('synced', [{ synced }])\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with all peers')\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} buf\n * @param {function} syncedCallback\n * @return {encoding.Encoder?}\n */\nconst readMessage = (room, buf, syncedCallback) => {\n const decoder = decoding.createDecoder(buf)\n const encoder = encoding.createEncoder()\n const messageType = decoding.readVarUint(decoder)\n if (room === undefined) {\n return null\n }\n const awareness = room.awareness\n const doc = room.doc\n let sendReply = false\n switch (messageType) {\n case messageSync: {\n encoding.writeVarUint(encoder, messageSync)\n const syncMessageType = syncProtocol.readSyncMessage(decoder, encoder, doc, room)\n if (syncMessageType === syncProtocol.messageYjsSyncStep2 && !room.synced) {\n syncedCallback()\n }\n if (syncMessageType === syncProtocol.messageYjsSyncStep1) {\n sendReply = true\n }\n break\n }\n case messageQueryAwareness:\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awareness.getStates().keys())))\n sendReply = true\n break\n case messageAwareness:\n awarenessProtocol.applyAwarenessUpdate(awareness, decoding.readVarUint8Array(decoder), room)\n break\n case messageBcPeerId: {\n const add = decoding.readUint8(decoder) === 1\n const peerName = decoding.readVarString(decoder)\n if (peerName !== room.peerId && ((room.bcConns.has(peerName) && !add) || (!room.bcConns.has(peerName) && add))) {\n const removed = []\n const added = []\n if (add) {\n room.bcConns.add(peerName)\n added.push(peerName)\n } else {\n room.bcConns.delete(peerName)\n removed.push(peerName)\n }\n room.provider.emit('peers', [{\n added,\n removed,\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n broadcastBcPeerId(room)\n }\n break\n }\n default:\n console.error('Unable to compute message')\n return encoder\n }\n if (!sendReply) {\n // nothing has been written, no answer created\n return null\n }\n return encoder\n}\n\n/**\n * @param {WebrtcConn} peerConn\n * @param {Uint8Array} buf\n * @return {encoding.Encoder?}\n */\nconst readPeerMessage = (peerConn, buf) => {\n const room = peerConn.room\n log('received message from ', logging.BOLD, peerConn.remotePeerId, logging.GREY, ' (', room.name, ')', logging.UNBOLD, logging.UNCOLOR)\n return readMessage(room, buf, () => {\n peerConn.synced = true\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with ', logging.BOLD, peerConn.remotePeerId)\n checkIsSynced(room)\n })\n}\n\n/**\n * @param {WebrtcConn} webrtcConn\n * @param {encoding.Encoder} encoder\n */\nconst sendWebrtcConn = (webrtcConn, encoder) => {\n log('send message to ', logging.BOLD, webrtcConn.remotePeerId, logging.UNBOLD, logging.GREY, ' (', webrtcConn.room.name, ')', logging.UNCOLOR)\n try {\n webrtcConn.peer.send(encoding.toUint8Array(encoder))\n } catch (e) {}\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastWebrtcConn = (room, m) => {\n log('broadcast message in ', logging.BOLD, room.name, logging.UNBOLD)\n room.webrtcConns.forEach(conn => {\n try {\n conn.peer.send(m)\n } catch (e) {}\n })\n}\n\nexport class WebrtcConn {\n /**\n * @param {SignalingConn} signalingConn\n * @param {boolean} initiator\n * @param {string} remotePeerId\n * @param {Room} room\n */\n constructor (signalingConn, initiator, remotePeerId, room) {\n log('establishing connection to ', logging.BOLD, remotePeerId)\n this.room = room\n this.remotePeerId = remotePeerId\n this.glareToken = undefined\n this.closed = false\n this.connected = false\n this.synced = false\n /**\n * @type {any}\n */\n this.peer = new Peer({ initiator, ...room.provider.peerOpts })\n this.peer.on('signal', signal => {\n if (this.glareToken === undefined) {\n // add some randomness to the timestamp of the offer\n this.glareToken = Date.now() + Math.random()\n }\n publishSignalingMessage(signalingConn, room, { to: remotePeerId, from: room.peerId, type: 'signal', token: this.glareToken, signal })\n })\n this.peer.on('connect', () => {\n log('connected to ', logging.BOLD, remotePeerId)\n this.connected = true\n // send sync step 1\n const provider = room.provider\n const doc = provider.doc\n const awareness = room.awareness\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeSyncStep1(encoder, doc)\n sendWebrtcConn(this, encoder)\n const awarenessStates = awareness.getStates()\n if (awarenessStates.size > 0) {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awarenessStates.keys())))\n sendWebrtcConn(this, encoder)\n }\n })\n this.peer.on('close', () => {\n this.connected = false\n this.closed = true\n if (room.webrtcConns.has(this.remotePeerId)) {\n room.webrtcConns.delete(this.remotePeerId)\n room.provider.emit('peers', [{\n removed: [this.remotePeerId],\n added: [],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n }\n checkIsSynced(room)\n this.peer.destroy()\n log('closed connection to ', logging.BOLD, remotePeerId)\n announceSignalingInfo(room)\n })\n this.peer.on('error', err => {\n log('Error in connection to ', logging.BOLD, remotePeerId, ': ', err)\n announceSignalingInfo(room)\n })\n this.peer.on('data', data => {\n const answer = readPeerMessage(this, data)\n if (answer !== null) {\n sendWebrtcConn(this, answer)\n }\n })\n }\n\n destroy () {\n this.peer.destroy()\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastBcMessage = (room, m) => cryptoutils.encrypt(m, room.key).then(data =>\n room.mux(() =>\n bc.publish(room.name, data)\n )\n)\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastRoomMessage = (room, m) => {\n if (room.bcconnected) {\n broadcastBcMessage(room, m)\n }\n broadcastWebrtcConn(room, m)\n}\n\n/**\n * @param {Room} room\n */\nconst announceSignalingInfo = room => {\n signalingConns.forEach(conn => {\n // only subscribe if connection is established, otherwise the conn automatically subscribes to all rooms\n if (conn.connected) {\n conn.send({ type: 'subscribe', topics: [room.name] })\n if (room.webrtcConns.size < room.provider.maxConns) {\n publishSignalingMessage(conn, room, { type: 'announce', from: room.peerId })\n }\n }\n })\n}\n\n/**\n * @param {Room} room\n */\nconst broadcastBcPeerId = room => {\n if (room.provider.filterBcConns) {\n // broadcast peerId via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 1)\n encoding.writeVarString(encoderPeerIdBc, room.peerId)\n broadcastBcMessage(room, encoding.toUint8Array(encoderPeerIdBc))\n }\n}\n\nexport class Room {\n /**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n */\n constructor (doc, provider, name, key) {\n /**\n * Do not assume that peerId is unique. This is only meant for sending signaling messages.\n *\n * @type {string}\n */\n this.peerId = random.uuidv4()\n this.doc = doc\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = provider.awareness\n this.provider = provider\n this.synced = false\n this.name = name\n // @todo make key secret by scoping\n this.key = key\n /**\n * @type {Map}\n */\n this.webrtcConns = new Map()\n /**\n * @type {Set}\n */\n this.bcConns = new Set()\n this.mux = createMutex()\n this.bcconnected = false\n /**\n * @param {ArrayBuffer} data\n */\n this._bcSubscriber = data =>\n cryptoutils.decrypt(new Uint8Array(data), key).then(m =>\n this.mux(() => {\n const reply = readMessage(this, m, () => {})\n if (reply) {\n broadcastBcMessage(this, encoding.toUint8Array(reply))\n }\n })\n )\n /**\n * Listens to Yjs updates and sends them to remote peers\n *\n * @param {Uint8Array} update\n * @param {any} _origin\n */\n this._docUpdateHandler = (update, _origin) => {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeUpdate(encoder, update)\n broadcastRoomMessage(this, encoding.toUint8Array(encoder))\n }\n /**\n * Listens to Awareness updates and sends them to remote peers\n *\n * @param {any} changed\n * @param {any} _origin\n */\n this._awarenessUpdateHandler = ({ added, updated, removed }, _origin) => {\n const changedClients = added.concat(updated).concat(removed)\n const encoderAwareness = encoding.createEncoder()\n encoding.writeVarUint(encoderAwareness, messageAwareness)\n encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))\n broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))\n }\n\n this._beforeUnloadHandler = () => {\n awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')\n rooms.forEach(room => {\n room.disconnect()\n })\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.on('exit', this._beforeUnloadHandler)\n }\n }\n\n connect () {\n this.doc.on('update', this._docUpdateHandler)\n this.awareness.on('update', this._awarenessUpdateHandler)\n // signal through all available signaling connections\n announceSignalingInfo(this)\n const roomName = this.name\n bc.subscribe(roomName, this._bcSubscriber)\n this.bcconnected = true\n // broadcast peerId via broadcastchannel\n broadcastBcPeerId(this)\n // write sync step 1\n const encoderSync = encoding.createEncoder()\n encoding.writeVarUint(encoderSync, messageSync)\n syncProtocol.writeSyncStep1(encoderSync, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderSync))\n // broadcast local state\n const encoderState = encoding.createEncoder()\n encoding.writeVarUint(encoderState, messageSync)\n syncProtocol.writeSyncStep2(encoderState, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderState))\n // write queryAwareness\n const encoderAwarenessQuery = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessQuery, messageQueryAwareness)\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessQuery))\n // broadcast local awareness state\n const encoderAwarenessState = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessState, messageAwareness)\n encoding.writeVarUint8Array(encoderAwarenessState, awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this.doc.clientID]))\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessState))\n }\n\n disconnect () {\n // signal through all available signaling connections\n signalingConns.forEach(conn => {\n if (conn.connected) {\n conn.send({ type: 'unsubscribe', topics: [this.name] })\n }\n })\n awarenessProtocol.removeAwarenessStates(this.awareness, [this.doc.clientID], 'disconnect')\n // broadcast peerId removal via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 0) // remove peerId from other bc peers\n encoding.writeVarString(encoderPeerIdBc, this.peerId)\n broadcastBcMessage(this, encoding.toUint8Array(encoderPeerIdBc))\n\n bc.unsubscribe(this.name, this._bcSubscriber)\n this.bcconnected = false\n this.doc.off('update', this._docUpdateHandler)\n this.awareness.off('update', this._awarenessUpdateHandler)\n this.webrtcConns.forEach(conn => conn.destroy())\n }\n\n destroy () {\n this.disconnect()\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.off('exit', this._beforeUnloadHandler)\n }\n }\n}\n\n/**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n * @return {Room}\n */\nconst openRoom = (doc, provider, name, key) => {\n // there must only be one room\n if (rooms.has(name)) {\n throw error.create(`A Yjs Doc connected to room \"${name}\" already exists!`)\n }\n const room = new Room(doc, provider, name, key)\n rooms.set(name, /** @type {Room} */ (room))\n return room\n}\n\n/**\n * @param {SignalingConn} conn\n * @param {Room} room\n * @param {any} data\n */\nconst publishSignalingMessage = (conn, room, data) => {\n if (room.key) {\n cryptoutils.encryptJson(data, room.key).then(data => {\n conn.send({ type: 'publish', topic: room.name, data: buffer.toBase64(data) })\n })\n } else {\n conn.send({ type: 'publish', topic: room.name, data })\n }\n}\n\nexport class SignalingConn extends ws.WebsocketClient {\n constructor (url) {\n super(url)\n /**\n * @type {Set}\n */\n this.providers = new Set()\n this.on('connect', () => {\n log(`connected (${url})`)\n const topics = Array.from(rooms.keys())\n this.send({ type: 'subscribe', topics })\n rooms.forEach(room =>\n publishSignalingMessage(this, room, { type: 'announce', from: room.peerId })\n )\n })\n this.on('message', m => {\n switch (m.type) {\n case 'publish': {\n const roomName = m.topic\n const room = rooms.get(roomName)\n if (room == null || typeof roomName !== 'string') {\n return\n }\n const execMessage = data => {\n const webrtcConns = room.webrtcConns\n const peerId = room.peerId\n if (data == null || data.from === peerId || (data.to !== undefined && data.to !== peerId) || room.bcConns.has(data.from)) {\n // ignore messages that are not addressed to this conn, or from clients that are connected via broadcastchannel\n return\n }\n const emitPeerChange = webrtcConns.has(data.from)\n ? () => {}\n : () =>\n room.provider.emit('peers', [{\n removed: [],\n added: [data.from],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n switch (data.type) {\n case 'announce':\n if (webrtcConns.size < room.provider.maxConns) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, true, data.from, room))\n emitPeerChange()\n }\n break\n case 'signal':\n if (data.signal.type === 'offer') {\n const existingConn = webrtcConns.get(data.from)\n if (existingConn) {\n const remoteToken = data.token\n const localToken = existingConn.glareToken\n if (localToken && localToken > remoteToken) {\n log('offer rejected: ', data.from)\n return\n }\n // if we don't reject the offer, we will be accepting it and answering it\n existingConn.glareToken = undefined\n }\n }\n if (data.signal.type === 'answer') {\n log('offer answered by: ', data.from)\n const existingConn = webrtcConns.get(data.from)\n existingConn.glareToken = undefined\n }\n if (data.to === peerId) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, false, data.from, room)).peer.signal(data.signal)\n emitPeerChange()\n }\n break\n }\n }\n if (room.key) {\n if (typeof m.data === 'string') {\n cryptoutils.decryptJson(buffer.fromBase64(m.data), room.key).then(execMessage)\n }\n } else {\n execMessage(m.data)\n }\n }\n }\n })\n this.on('disconnect', () => log(`disconnect (${url})`))\n }\n}\n\n/**\n * @typedef {Object} ProviderOptions\n * @property {Array} [signaling]\n * @property {string} [password]\n * @property {awarenessProtocol.Awareness} [awareness]\n * @property {number} [maxConns]\n * @property {boolean} [filterBcConns]\n * @property {any} [peerOpts]\n */\n\n/**\n * @param {WebrtcProvider} provider\n */\nconst emitStatus = provider => {\n provider.emit('status', [{\n connected: provider.connected\n }])\n}\n\n/**\n * @typedef {Object} WebrtcProviderEvents\n * @property {function({connected:boolean}):void} WebrtcProviderEvent.status\n * @property {function({synced:boolean}):void} WebrtcProviderEvent.synced\n * @property {function({added:Array,removed:Array,webrtcPeers:Array,bcPeers:Array}):void} WebrtcProviderEvent.peers\n */\n\n/**\n * @extends ObservableV2\n */\nexport class WebrtcProvider extends ObservableV2 {\n /**\n * @param {string} roomName\n * @param {Y.Doc} doc\n * @param {ProviderOptions?} opts\n */\n constructor (\n roomName,\n doc,\n {\n signaling = ['wss://y-webrtc-eu.fly.dev'],\n password = null,\n awareness = new awarenessProtocol.Awareness(doc),\n maxConns = 20 + math.floor(random.rand() * 15), // the random factor reduces the chance that n clients form a cluster\n filterBcConns = true,\n peerOpts = {} // simple-peer options. See https://github.com/feross/simple-peer#peer--new-peeropts\n } = {}\n ) {\n super()\n this.roomName = roomName\n this.doc = doc\n this.filterBcConns = filterBcConns\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = awareness\n this.shouldConnect = false\n this.signalingUrls = signaling\n this.signalingConns = []\n this.maxConns = maxConns\n this.peerOpts = peerOpts\n /**\n * @type {PromiseLike}\n */\n this.key = password ? cryptoutils.deriveKey(password, roomName) : /** @type {PromiseLike} */ (promise.resolve(null))\n /**\n * @type {Room|null}\n */\n this.room = null\n this.key.then(key => {\n this.room = openRoom(doc, this, roomName, key)\n if (this.shouldConnect) {\n this.room.connect()\n } else {\n this.room.disconnect()\n }\n emitStatus(this)\n })\n this.connect()\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n /**\n * Indicates whether the provider is looking for other peers.\n *\n * Other peers can be found via signaling servers or via broadcastchannel (cross browser-tab\n * communication). You never know when you are connected to all peers. You also don't know if\n * there are other peers. connected doesn't mean that you are connected to any physical peers\n * working on the same resource as you. It does not change unless you call provider.disconnect()\n *\n * `this.on('status', (event) => { console.log(event.connected) })`\n *\n * @type {boolean}\n */\n get connected () {\n return this.room !== null && this.shouldConnect\n }\n\n connect () {\n this.shouldConnect = true\n this.signalingUrls.forEach(url => {\n const signalingConn = map.setIfUndefined(signalingConns, url, () => new SignalingConn(url))\n this.signalingConns.push(signalingConn)\n signalingConn.providers.add(this)\n })\n if (this.room) {\n this.room.connect()\n emitStatus(this)\n }\n }\n\n disconnect () {\n this.shouldConnect = false\n this.signalingConns.forEach(conn => {\n conn.providers.delete(this)\n if (conn.providers.size === 0) {\n conn.destroy()\n signalingConns.delete(conn.url)\n }\n })\n if (this.room) {\n this.room.disconnect()\n emitStatus(this)\n }\n }\n\n destroy () {\n this.doc.off('destroy', this.destroy)\n // need to wait for key before deleting room\n this.key.then(() => {\n /** @type {Room} */ (this.room).destroy()\n rooms.delete(this.roomName)\n })\n super.destroy()\n }\n}\n", "/**\n * @module bindings/quill\n */\n\nimport * as Y from 'yjs' // eslint-disable-line\n\n/**\n * @typedef {import('y-protocols/awareness').Awareness} Awareness\n\n/**\n * Removes the pending '\\n's if it has no attributes.\n */\nexport const normQuillDelta = delta => {\n if (delta.length > 0) {\n const d = delta[delta.length - 1]\n const insert = d.insert\n if (d.attributes === undefined && insert !== undefined && insert.slice(-1) === '\\n') {\n delta = delta.slice()\n let ins = insert.slice(0, -1)\n while (ins.slice(-1) === '\\n') {\n ins = ins.slice(0, -1)\n }\n delta[delta.length - 1] = { insert: ins }\n if (ins.length === 0) {\n delta.pop()\n }\n return delta\n }\n }\n return delta\n}\n\n/**\n * @param {any} quillCursors\n */\nconst updateCursor = (quillCursors, aw, clientId, doc, type) => {\n try {\n if (aw && aw.cursor && clientId !== doc.clientID) {\n const user = aw.user || {}\n const color = user.color || '#ffa500'\n const name = user.name || `User: ${clientId}`\n quillCursors.createCursor(clientId.toString(), name, color)\n const anchor = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.anchor), doc)\n const head = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.head), doc)\n if (anchor && head && anchor.type === type) {\n quillCursors.moveCursor(clientId.toString(), { index: anchor.index, length: head.index - anchor.index })\n }\n } else {\n quillCursors.removeCursor(clientId.toString())\n }\n } catch (err) {\n console.error(err)\n }\n}\n\nexport class QuillBinding {\n /**\n * @param {Y.Text} type\n * @param {any} quill\n * @param {Awareness} [awareness]\n */\n constructor (type, quill, awareness) {\n const doc = /** @type {Y.Doc} */ (type.doc)\n this.type = type\n this.doc = doc\n this.quill = quill\n const quillCursors = quill.getModule('cursors') || null\n this.quillCursors = quillCursors\n // This object contains all attributes used in the quill instance\n this._negatedUsedFormats = {}\n this.awareness = awareness\n this._awarenessChange = ({ added, removed, updated }) => {\n const states = /** @type {Awareness} */ (awareness).getStates()\n added.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n updated.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n removed.forEach(id => {\n quillCursors.removeCursor(id.toString())\n })\n }\n /**\n * @param {Y.YTextEvent} event\n */\n this._typeObserver = event => {\n if (event.transaction.origin !== this) {\n const eventDelta = event.delta\n // We always explicitly set attributes, otherwise concurrent edits may\n // result in quill assuming that a text insertion shall inherit existing\n // attributes.\n const delta = []\n for (let i = 0; i < eventDelta.length; i++) {\n const d = eventDelta[i]\n if (d.insert !== undefined) {\n delta.push(Object.assign({}, d, { attributes: Object.assign({}, this._negatedUsedFormats, d.attributes || {}) }))\n } else {\n delta.push(d)\n }\n }\n quill.updateContents(delta, this)\n }\n }\n type.observe(this._typeObserver)\n this._quillObserver = (eventType, delta, state, origin) => {\n if (delta && delta.ops) {\n // update content\n const ops = delta.ops\n ops.forEach(op => {\n if (op.attributes !== undefined) {\n for (const key in op.attributes) {\n if (this._negatedUsedFormats[key] === undefined) {\n this._negatedUsedFormats[key] = false\n }\n }\n }\n })\n if (origin !== this) {\n doc.transact(() => {\n type.applyDelta(ops)\n }, this)\n }\n }\n // always check selection\n if (awareness && quillCursors) {\n const sel = quill.getSelection()\n const aw = /** @type {any} */ (awareness.getLocalState())\n if (sel === null) {\n if (awareness.getLocalState() !== null) {\n awareness.setLocalStateField('cursor', /** @type {any} */ (null))\n }\n } else {\n const anchor = Y.createRelativePositionFromTypeIndex(type, sel.index)\n const head = Y.createRelativePositionFromTypeIndex(type, sel.index + sel.length)\n if (!aw || !aw.cursor || !Y.compareRelativePositions(anchor, aw.cursor.anchor) || !Y.compareRelativePositions(head, aw.cursor.head)) {\n awareness.setLocalStateField('cursor', {\n anchor,\n head\n })\n }\n }\n // update all remote cursor locations\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n }\n }\n quill.on('editor-change', this._quillObserver)\n // This indirectly initializes _negatedUsedFormats.\n // Make sure that this call this after the _quillObserver is set.\n quill.setContents(type.toDelta(), this)\n // init remote cursors\n if (quillCursors !== null && awareness) {\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n awareness.on('change', this._awarenessChange)\n }\n }\n\n destroy () {\n this.type.unobserve(this._typeObserver)\n this.quill.off('editor-change', this._quillObserver)\n if (this.awareness) {\n this.awareness.off('change', this._awarenessChange)\n }\n }\n}\n", "// Generated by js_of_ocaml\n//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.9.0+5.9.0\n(function(a){typeof\nglobalThis!==\"object\"&&(this?b():(a.defineProperty(a.prototype,\"_T_\",{configurable:true,get:b}),_T_));function\nb(){var\nb=this||self;b.globalThis=b;delete\na.prototype._T_}}(Object));(function(a){require(\"quill/dist/quill.core.css\");require(\"quill/dist/quill.bubble.css\");require(\"quill/dist/quill.snow.css\")}(globalThis));(function(c){\"use strict\";var\nv=3850876,af=\"0\",aH=\" \",gy=\"compare: functional value\",gf=\"mkdir\",lh=\"synced\",cM=1000,k5=\"delete\",Y=\"vendor/lwd/lib/lwd/lwd_seq.pp.ml\",kB=\"@[\",kO=\"console\",lp=\"window\",aZ=\"int_of_string\",kq=\"%u\",lo=\"/static/\",gi=\"node:fs\",k4=\"%i\",ly=\"%ni\",aK=0xff,ge=749039939,kA=\"Assert_failure\",kp=\"camlinternalMod.ml\",aI=737455525,k3=\"0x\",ko=0x7ff0,lx=218,k2=0xdfff,kn=\"End_of_file\",ln=\"OCAMLRUNPARAM\",k1=\": closedir failed\",lw=\"Out_of_memory\",kz=553,k0=\"Not_found\",gB=\"Failure\",d5=\"Unix.Unix_error\",kZ=\"style\",d4=244,lg=\"^\",b4=\"text\",kN=\"length\",lf=\"green\",gu=\"ENOTDIR\",ky=\"Lwd_seq.rank: node is marked\",bz=936573133,kY=\"%Li\",j9=\"Invalid_argument\",kX=\"flex\",d3=254,b5=\"+\",dX=\"Set.bal\",lv=\", characters \",aG=0xffffff,km=858694086,kx=120,kw=1027,cI=1024,d0=\"Map.bal\",dW=246,le=\"Pervasives.do_at_exit\",lm=389604418,kl=65536,j8=\"submit\",B=\"vendor/brr_lwd_ui/examples/yjs/main.ml\",U=16620,gt=0xf,dU=512,gb=-588596599,kW=\", \",kM=\"closedir\",lu=\"Match_failure\",j6=\"%li\",j7=1026,j5=157,j4=\"b\",f_=\"nan\",e=\"\",f9=\"rmdir\",gd=\"Fatal error: exception \",kk=\"infinity\",L=\"camlinternalFormat.ml\",lc=571,ld=\"fd \",kK=\"append\",kL=\": \",j3=174,r=248,kj=\"em\",ki=\"data\",kJ=0xe0,aJ=24029,lb=0xf0,kh=\"Sys_error\",at=0x80,gs=\"vendor/brr_lwd_ui/bindings/yjs/doc.ml\",ll=\"ENOTEMPTY\",lt=\"EEXIST\",gx=1255,kV=\"checkbox\",dT=\"value\",kI=\"px\",gl=\" : flags Open_text and Open_binary are not compatible\",gr=\"e\",kv=\"Stack_overflow\",gk=\": Not a directory\",gq=\"ENOENT\",ga=-605101559,T=15681,kH=\"Undefined_recursive_module\",la=\"Array\",kG=2147483647,k$=544,aA=0x8000,dV=\"table\",cL=\"string\",kg=0x800,lk=-48,j2=\" : is a directory\",kf=\"@{\",kU=\"error\",k_=\"Division_by_zero\",j1=\"classList\",bd=\".\",ke=\"(Program not linked with -g, cannot print stack backtrace)\\n\",be=0x3f,bx=\"name\",lj=\"red\",bc=737456202,f$=\" : file already exists\",bv=128,cN=\": No such file or directory\",kd=\"vendor/lwd/lib/brr-lwd/elwd.ml\",k9=255,dS=\"lwd-to-remove\",cJ=256,dR=\"checked\",kc=\"id\",cK=-976970511,gp=100,f8=\"index out of bounds\",li=-937474657,aY=\"/\",kF=\"height: \",gj=504440814,d2=252,f7=\"%d\",kT=\"lwdui-virtual-table-row\",kR=\"bold\",kS=\": file descriptor already closed\",bw=\"-\",f6=\"EBADF\",kb=\"changes\",aX=951901561,ka=102,go=-97,ls=\"Printexc.handle_uncaught_exception\",kQ=12520,gA=\" : flags Open_rdonly and Open_wronly are not compatible\",a=\"vendor/lwd/lib/lwd/lwd_table.ml\",kE=499,gw=756711075,ku=\"Fatal error: exception %s\\n\",gn=4100401,lr=\"class\",j0=\"\\xe2\\x9d\\x8c\",cH=250,j$=199,dZ=\"bool\",gh=82908052,gz=\"kind\",by=611392745,gm=\"cell\",kD=\">\",k8=\"([^/]+)\",kt=\"input\",gc=\"jsError\",jZ=103,gg=127,d1='\"',aB=0xffff,gv=737308346,j_=\"documentElement\",kC=\"Sys_blocked_io\",kP=0xdc00,b=\"vendor/lwd/lib/lwd/lwd.ml\",ks=\"not implemented\",k7=\"Form submitted:\",lq=\"_\",f5=\"target\",kr=\"rem\",dY=\"_bigarr02\",k6=-101336657;function\nAO(a,b,c,d,e){if(d<=b)for(var\nf=1;f<=e;f++)c[d+f]=a[b+f];else\nfor(var\nf=e;f>=1;f--)c[d+f]=a[b+f];return 0}function\nAQ(a,b,c){var\nd=new\nArray(c+1);d[0]=0;for(var\ne=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function\ngC(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function\nAR(a,b){var\nc=a[1];a[1]+=b;return c}function\ngD(a){return a[1]}var\nme={};function\nmf(a){if(me[a])return me[a];var\nb=c.process;if(b&&b.env&&b.env[a]!==undefined)return b.env[a];if(c.jsoo_env&&typeof\nc.jsoo_env[a]===\"string\")return c.jsoo_env[a]}var\neh=0;(function(){var\nc=mf(ln);if(c!==undefined){var\nb=c.split(\",\");for(var\na=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new\nd(a,b,c)};d.prototype.add=function(a){var\nb=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.sub=function(a){var\nb=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.mul=function(a){var\nb=this.lo*a.lo,c=(b*lT|0)+this.mi*a.lo+this.lo*a.mi,e=(c*lT|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new\nd(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)===0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new\nd(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new\nd(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new\nd(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a===0)return this;if(a<24)return new\nd(this.lo<>24-a,this.hi<>24-a);if(a<48)return new\nd(0,this.lo<>48-a);return new\nd(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new\nd(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a===0)return this;var\nc=this.hi<<16>>16;if(a<24)return new\nd(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var\nb=this.hi<<16>>31;if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&aB);return new\nd(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&aG;this.lo=this.lo<<1&aG};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aG;this.mi=(this.mi>>>1|this.hi<<23)&aG;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var\ne=0,c=this.copy(),b=a.copy(),f=new\nd(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var\nb=this;if(a.isZero())l9();var\nd=b.hi^a.hi;if(b.hi&aA)b=b.neg();if(a.hi&aA)a=a.neg();var\nc=b.udivmod(a).quotient;if(d&aA)c=c.neg();return c};d.prototype.mod=function(a){var\nb=this;if(a.isZero())l9();var\nd=b.hi;if(b.hi&aA)b=b.neg();if(a.hi&aA)a=a.neg();var\nc=b.udivmod(a).modulus;if(d&aA)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&aK,this.mi>>16,this.mi>>8&aK,this.mi&aK,this.lo>>16,this.lo>>8&aK,this.lo&aK]};d.prototype.lo32=function(){return this.lo|(this.mi&aK)<<24};d.prototype.hi32=function(){return this.mi>>>8&aB|this.hi<<16};function\nBi(a,b){return new\nd(a&aG,a>>>24&aK|(b&aB)<<8,b>>>16&aB)}function\ngO(a){return a.hi32()}function\ngP(a){return a.lo32()}function\ncP(){G(f8)}var\nAT=dY;function\nbf(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bf.prototype.caml_custom=AT;bf.prototype.offset=function(a){var\nc=0;if(typeof\na===\"number\")a=[a];if(!Array.isArray(a))G(\"bigarray.js: invalid offset\");if(this.dims.length!==a.length)G(\"Bigarray.get/set: bad number of dimensions\");if(this.layout===0)for(var\nb=0;b=this.dims[b])cP();c=c*this.dims[b]+a[b]}else\nfor(var\nb=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])cP();c=c*this.dims[b]+(a[b]-1)}return c};bf.prototype.get=function(a){switch(this.kind){case\n7:var\nd=this.data[a*2+0],b=this.data[a*2+1];return Bi(d,b);case\n10:case\n11:var\ne=this.data[a*2+0],c=this.data[a*2+1];return[d3,e,c];default:return this.data[a]}};bf.prototype.set=function(a,b){switch(this.kind){case\n7:this.data[a*2+0]=gP(b);this.data[a*2+1]=gO(b);break;case\n10:case\n11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};bf.prototype.fill=function(a){switch(this.kind){case\n7:var\nc=gP(a),e=gO(a);if(c===e)this.data.fill(c);else\nfor(var\nb=0;be)return 1;if(d!==e){if(!b)return Number.NaN;if(!Number.isNaN(d))return 1;if(!Number.isNaN(e))return-1}}break;case\n7:for(var\nc=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case\n2:case\n3:case\n4:case\n5:case\n6:case\n8:case\n9:case\n12:for(var\nc=0;ca.data[c])return 1}break}return 0};function\nb6(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}b6.prototype=new\nbf();b6.prototype.offset=function(a){if(typeof\na!==\"number\")if(Array.isArray(a)&&a.length===1)a=a[0];else\nG(\"Ml_Bigarray_c_1_1.offset\");if(a<0||a>=this.dims[0])cP();return a};b6.prototype.get=function(a){return this.data[a]};b6.prototype.set=function(a,b){this.data[a]=b;return 0};b6.prototype.fill=function(a){this.data.fill(a);return 0};function\ngE(a,b,c,d){var\ne=lD(a);if(d7(c)*e!==d.length)G(\"length doesn't match dims\");if(b===0&&c.length===1&&e===1)return new\nb6(a,b,c,d);return new\nbf(a,b,c,d)}function\ngR(a){return a.slice(1)}function\nAS(a,b,c){var\nd=gR(c),e=lB(a,d7(d));return gE(a,b,d,e)}function\ncQ(a,b,c){a.set(a.offset(b),c);return 0}function\ncY(a,b,c){var\nd=String.fromCharCode;if(b===0&&c<=4096&&c===a.length)return d.apply(null,a);var\nf=e;for(;0=c.l||c.t===2&&e>=c.c.length)){c.c=a.t===4?cY(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else if(c.t===2&&d===c.c.length){c.c+=a.t===4?cY(a.c,b,e):b===0&&a.c.length===e?a.c:a.c.slice(b,b+e);c.t=c.c.length===c.l?0:2}else{if(c.t!==4)d$(c);var\ng=a.c,h=c.c;if(a.t===4)if(d<=b)for(var\nf=0;f=0;f--)h[d+f]=g[b+f];else{var\ni=Math.min(e,g.length-b);for(var\nf=0;f>=1;if(a===0)return d;b+=b;c++;if(c===9)b.slice(0,1)}}function\ncT(a){if(a.t===2)a.c+=b7(a.l-a.c.length,\"\\0\");else\na.c=cY(a.c,0,a.c.length);a.t=0}function\ngZ(a){if(a.length<24){for(var\nb=0;bgg)return false;return true}else\nreturn!/[^\\x00-\\x7f]/.test(a)}function\nmc(a){for(var\nk=e,d=e,h,g,i,b,c=0,j=a.length;cdU){d.slice(0,1);k+=d;d=e;k+=a.slice(c,f)}else\nd+=a.slice(c,f);if(f===j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+=\"\\ufffd\"}else if(b>aB)d+=String.fromCharCode(0xd7c0+(b>>10),kP+(b&0x3ff));else\nd+=String.fromCharCode(b);if(d.length>cI){d.slice(0,1);k+=d;d=e}}return k+d}function\na0(a,b,c){this.t=a;this.c=b;this.l=c}a0.prototype.toString=function(){switch(this.t){case\n9:case\n8:return this.c;case\n4:case\n2:cT(this);case\n0:if(gZ(this.c))this.t=9;else\nthis.t=8;return this.c}};a0.prototype.toUtf16=function(){var\na=this.toString();if(this.t===9)return a;return mc(a)};a0.prototype.slice=function(){var\na=this.t===4?this.c.slice():this.c;return new\na0(this.t,a,this.l)};function\nlG(a){return new\na0(0,a,a.length)}function\naL(a){return a}function\nbg(a){return lG(aL(a))}function\ncR(a,b,c,d,e){a1(bg(a),b,c,d,e);return 0}function\nd8(){G(f8)}function\nbB(a,b){switch(a.t&6){case\n0:return a.c.charCodeAt(b);case\n2:if(b>=a.c.length)return 0;return a.c.charCodeAt(b);case\n4:return a.c[b]}}function\nAX(a,b){if(b>>>0>=a.l)d8();return bB(a,b)}function\nbC(a){return new\nd(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function\nAY(a,b){if(b>>>0>=a.l-7)d8();var\nd=new\nArray(8);for(var\nc=0;c<8;c++)d[7-c]=bB(a,b+c);return bC(d)}function\nA(a,b,c){c&=aK;if(a.t!==4){if(b===a.c.length){a.c+=String.fromCharCode(c);if(b+1===a.l)a.t=0;return 0}d$(a)}a.c[b]=c;return 0}function\nau(a,b,c){if(b>>>0>=a.l)d8();return A(a,b,c)}function\nbD(a){return a.toArray()}function\nlH(a,b,c){if(b>>>0>=a.l-7)d8();var\ne=bD(c);for(var\nd=0;d<8;d++)A(a,b+7-d,e[d]);return 0}function\nbh(d,c){var\nf=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b===0)return d.apply(null,c);else if(b<0){var\na=d.apply(null,c.slice(0,f));if(typeof\na!==\"function\")return a;return bh(a,c.slice(f))}else{switch(b){case\n1:{var\na=function(a){var\nf=new\nArray(e+1);for(var\nb=0;b>>0>=a.length-1)cP();return a}function\nAZ(a){if(Number.isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!==0)return 1;return 2}return Number.isNaN(a)?4:3}function\nlY(a){return a===245?1:0}var\nB4=Math.log2&&Math.log2(1.1235582092889474e307)===1020;function\nB3(a){if(B4)return Math.floor(Math.log2(a));var\nb=0;if(a===0)return Number.NEGATIVE_INFINITY;if(a>=1)while(a>=2){a/=2;b++}else\nwhile(a<1){a*=2;b--}return b}function\ngL(a){var\nb=new\nFloat32Array(1);b[0]=a;var\nc=new\nInt32Array(b.buffer);return c[0]|0}function\nao(a,b,c){return new\nd(a,b,c)}function\nec(a){if(!Number.isFinite(a)){if(Number.isNaN(a))return ao(1,0,ko);return a>0?ao(0,0,ko):ao(0,0,0xfff0)}var\nf=a===0&&1/a===Number.NEGATIVE_INFINITY?aA:a>=0?0:aA;if(f)a=-a;var\nb=B3(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-j7)}else{a/=Math.pow(2,b-kw);if(a<16){a*=2;b-=1}if(b===0)a/=2}var\nd=Math.pow(2,24),c=a|0;a=(a-c)*d;var\ne=a|0;a=(a-e)*d;var\ng=a|0;c=c>|f|b<<4;return ao(g,e,c)}function\nlF(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom===dY)for(var\nd=0;d>4;if(d===2047)return(f|g|c>)===0?c&aA?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY:Number.NaN;var\ne=Math.pow(2,-24),b=(f*e+g)*e+(c>);if(d>0){b+=16;b*=Math.pow(2,d-kw)}else\nb*=Math.pow(2,-j7);if(c&aA)b=-b;return b}function\nV(a){if(!O.Failure)O.Failure=[r,aq(gB),-3];gW(O.Failure,a)}function\nlC(a,b,c){var\nk=a.read32s();if(k<0||k>16)V(\"input_value: wrong number of bigarray dimensions\");var\nr=a.read32s(),l=r&aK,q=r>>8&1,j=[];if(c===dY)for(var\nd=0;d>>32-15;b=cX(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function\nBc(a,b){a=W(a,gP(b));a=W(a,gO(b));return a}function\ngJ(a,b){return Bc(a,ec(b))}function\nlE(a){var\nc=d7(a.dims),d=0;switch(a.kind){case\n2:case\n3:case\n12:if(c>cJ)c=cJ;var\ne=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=W(d,e)}e=0;switch(c&3){case\n3:e=a.data[b+2]<<16;case\n2:e|=a.data[b+1]<<8;case\n1:e|=a.data[b+0];d=W(d,e)}break;case\n4:case\n5:if(c>bv)c=bv;var\ne=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=W(d,e)}if((c&1)!==0)d=W(d,a.data[b]);break;case\n6:if(c>64)c=64;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;c*=2;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;for(var\nb=0;b0?f(b,a,d):f(a,b,d);if(d&&Number.isNaN(e))return c;if(Number.isNaN(+e))return+e;if((e|0)!==0)return e|0}return c}function\nee(a){return typeof\na===\"string\"&&!/[^\\x00-\\xff]/.test(a)}function\ned(a){return a\ninstanceof\na0}function\nlJ(a){if(typeof\na===\"number\")return cM;else if(ed(a))return d2;else if(ee(a))return 1252;else if(Array.isArray(a)&&a[0]===a[0]>>>0&&a[0]<=k9){var\nb=a[0]|0;return b===d3?0:b}else if(a\ninstanceof\nString)return kQ;else if(typeof\na===\"string\")return kQ;else if(a\ninstanceof\nNumber)return cM;else if(a&&a.caml_custom)return gx;else if(a&&a.compare)return 1256;else if(typeof\na===\"function\")return 1247;else if(typeof\na===\"symbol\")return 1251;return 1001}function\nlW(a,b){if(ab?1:0}function\nAW(a,b){a.t&6&&cT(a);b.t&6&&cT(b);return a.cb.c?1:0}function\nd_(a,b,c){var\nf=[];for(;;){if(!(c&&a===b)){var\ne=lJ(a);if(e===cH){a=a[1];continue}var\ng=lJ(b);if(g===cH){b=b[1];continue}if(e!==g){if(e===cM){if(g===gx)return lI(a,b,-1,c);return-1}if(g===cM){if(e===gx)return lI(b,a,1,c);return 1}return eb)return 1;if(a!==b){if(!c)return Number.NaN;if(!Number.isNaN(a))return 1;if(!Number.isNaN(b))return-1}break;case\n1001:if(ab)return 1;if(a!==b)return c?1:Number.NaN;break;case\n1251:if(a!==b)return c?1:Number.NaN;break;case\n1252:var\na=aL(a),b=aL(b);if(a!==b){if(ab)return 1}break;case\n12520:var\na=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;default:if(lY(e)){G(\"compare: continuation value\");break}if(a.length!==b.length)return a.length1)f.push(a,b,1);break}}if(f.length===0)return 0;var\nh=f.pop();b=f.pop();a=f.pop();if(h+10)if(b===0&&(c>=a.l||a.t===2&&c>=a.c.length))if(d===0){a.c=e;a.t=2}else{a.c=b7(c,String.fromCharCode(d));a.t=c===a.l?0:2}else{if(a.t!==4)d$(a);for(c+=b;b31)G(\"format_int: format too long\");var\nb={justify:b5,signstyle:bw,filler:aH,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:\"f\"};for(var\nd=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case\".\":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;break;case\"d\":case\"i\":b.signedconv=true;b.base=10;break;case\"u\":b.base=10;break;case\"x\":b.base=16;break;case\"X\":b.base=16;b.uppercase=true;break;case\"o\":b.base=8;break;case\"e\":case\"f\":case\"g\":b.signedconv=true;b.conv=c;break;case\"E\":case\"F\":case\"G\":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function\ngH(a,b){if(a.uppercase)b=b.toUpperCase();var\nf=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!==bw))f++;if(a.alternate){if(a.base===8)f+=1;if(a.base===16)f+=2}var\nc=e;if(a.justify===b5&&a.filler===aH)for(var\nd=f;d20){c-=20;a/=Math.pow(10,c);a+=new\nArray(c+1).join(af);if(b>0)a=a+bd+new\nArray(b+1).join(af);return a}else\nreturn a.toFixed(b)}}var\nc,f=gV(a),e=f.prec<0?6:f.prec;if(b<0||b===0&&1/b===Number.NEGATIVE_INFINITY){f.sign=-1;b=-b}if(Number.isNaN(b)){c=f_;f.filler=aH}else if(!Number.isFinite(b)){c=\"inf\";f.filler=aH}else\nswitch(f.conv){case\"e\":var\nc=b.toExponential(e),d=c.length;if(c.charAt(d-3)===gr)c=c.slice(0,d-1)+af+c.slice(d-1);break;case\"f\":c=j(b,e);break;case\"g\":e=e?e:1;c=b.toExponential(e-1);var\ni=c.indexOf(gr),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var\nd=i-1;while(c.charAt(d)===af)d--;if(c.charAt(d)===bd)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)===gr)c=c.slice(0,d-1)+af+c.slice(d-1);break}else{var\ng=e;if(h<0){g-=h+1;c=b.toFixed(g)}else\nwhile(c=b.toFixed(g),c.length>e+1)g--;if(g){var\nd=c.length-1;while(c.charAt(d)===af)d--;if(c.charAt(d)===bd)d--;c=c.slice(0,d+1)}}break}return gH(f,c)}function\neb(a,b){if(aL(a)===f7)return aq(e+b);var\nc=gV(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else\nb>>>=0;var\nd=b.toString(c.base);if(c.prec>=0){c.filler=aH;var\nf=c.prec-d.length;if(f>0)d=b7(f,af)+d}return gH(c,d)}var\nBL=0;function\nan(){return BL++}function\nH(a){if(gZ(a))return a;return mc(a)}function\ncZ(){return typeof\nc.process!==\"undefined\"&&typeof\nc.process.versions!==\"undefined\"&&typeof\nc.process.versions.node!==\"undefined\"}function\nB5(){function\na(a){if(a.charAt(0)===aY)return[e,a.slice(1)];return}function\nb(a){var\nh=/^([a-zA-Z]:|[\\\\/]{2}[^\\\\/]+[\\\\/]+[^\\\\/]+)?([\\\\/])?([\\s\\S]*?)$/,b=h.exec(a),c=b[1]||e,f=c.length>0&&c.charAt(1)!==\":\";if(b[2]||f){var\nd=b[1]||e,g=b[2]||e;return[d,a.slice(d.length+g.length)]}return}return cZ()&&c.process&&c.process.platform?c.process.platform===\"win32\"?b:a:a}var\ng0=B5();function\nma(a){return a.slice(-1)!==aY?a+aY:a}if(cZ()&&c.process&&c.process.cwd)var\ncU=c.process.cwd().replace(/\\\\/g,aY);else\nvar\ncU=\"/static\";cU=ma(cU);function\nBA(a){a=H(a);if(!g0(a))a=cU+a;var\ne=g0(a),d=e[1].split(/[/\\\\]/),b=[];for(var\nc=0;c1)b.pop();break;case\".\":break;case\"\":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function\nBV(a){for(var\ng=e,c=g,b,i,d=0,h=a.length;ddU){c.slice(0,1);g+=c;c=e;g+=a.slice(d,f)}else\nc+=a.slice(d,f);if(f===h)break;d=f}if(b>6);c+=String.fromCharCode(at|b&be)}else if(b<0xd800||b>=k2)c+=String.fromCharCode(kJ|b>>12,at|b>>6&be,at|b&be);else if(b>=0xdbff||d+1===h||(i=a.charCodeAt(d+1))k2)c+=\"\\xef\\xbf\\xbd\";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(lb|b>>18,at|b>>12&be,at|b>>6&be,at|b&be)}if(c.length>cI){c.slice(0,1);g+=c;c=e}}return g+c}function\nag(a){return gZ(a)?aq(a):aq(BV(a))}var\nB6=[\"E2BIG\",\"EACCES\",\"EAGAIN\",f6,\"EBUSY\",\"ECHILD\",\"EDEADLK\",\"EDOM\",lt,\"EFAULT\",\"EFBIG\",\"EINTR\",\"EINVAL\",\"EIO\",\"EISDIR\",\"EMFILE\",\"EMLINK\",\"ENAMETOOLONG\",\"ENFILE\",\"ENODEV\",gq,\"ENOEXEC\",\"ENOLCK\",\"ENOMEM\",\"ENOSPC\",\"ENOSYS\",gu,ll,\"ENOTTY\",\"ENXIO\",\"EPERM\",\"EPIPE\",\"ERANGE\",\"EROFS\",\"ESPIPE\",\"ESRCH\",\"EXDEV\",\"EWOULDBLOCK\",\"EINPROGRESS\",\"EALREADY\",\"ENOTSOCK\",\"EDESTADDRREQ\",\"EMSGSIZE\",\"EPROTOTYPE\",\"ENOPROTOOPT\",\"EPROTONOSUPPORT\",\"ESOCKTNOSUPPORT\",\"EOPNOTSUPP\",\"EPFNOSUPPORT\",\"EAFNOSUPPORT\",\"EADDRINUSE\",\"EADDRNOTAVAIL\",\"ENETDOWN\",\"ENETUNREACH\",\"ENETRESET\",\"ECONNABORTED\",\"ECONNRESET\",\"ENOBUFS\",\"EISCONN\",\"ENOTCONN\",\"ESHUTDOWN\",\"ETOOMANYREFS\",\"ETIMEDOUT\",\"ECONNREFUSED\",\"EHOSTDOWN\",\"EHOSTUNREACH\",\"ELOOP\",\"EOVERFLOW\"];function\na3(a,b,c,d){var\nf=B6.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var\ng=[f,ag(b||e),ag(c||e)];return g}var\nl5={};function\nbj(a){return l5[a]}function\na2(a,b){throw g([0,a].concat(b))}function\ngF(a){if(!(a\ninstanceof\nUint8Array))a=new\nUint8Array(a);return new\na0(4,a,a.length)}function\nl(a){gW(O.Sys_error,a)}function\nl8(a){l(a+cN)}function\ngY(a){if(a.t!==4)d$(a);return a.c}function\nav(a){return a.l}function\nlz(){}function\nZ(a){this.data=a}Z.prototype=new\nlz();Z.prototype.constructor=Z;Z.prototype.truncate=function(a){var\nb=this.data;this.data=C(a|0);a1(b,0,this.data,0,a)};Z.prototype.length=function(){return av(this.data)};Z.prototype.write=function(a,b,c,d){var\ne=this.length();if(a+d>=e){var\nf=C(a+d),g=this.data;this.data=f;a1(g,0,this.data,0,e)}a1(gF(b),c,this.data,a,d);return 0};Z.prototype.read=function(a,b,c,d){var\ne=this.length();if(a+d>=e)d=e-a;if(d){var\nf=C(d|0);a1(this.data,a,f,0,d);b.set(gY(f),c)}return d};function\nbA(a,b,c){this.file=b;this.name=a;this.flags=c}bA.prototype.err_closed=function(){l(this.name+kS)};bA.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};bA.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};bA.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};bA.prototype.close=function(){this.file=undefined};function\nN(a,b){this.content={};this.root=a;this.lookupFun=b}N.prototype.nm=function(a){return this.root+a};N.prototype.create_dir_if_needed=function(a){var\nd=a.split(aY),c=e;for(var\nb=0;b>>16;a=cX(a,0x85ebca6b|0);a^=a>>>13;a=cX(a,0xc2b2ae35|0);a^=a>>>16;return a}function\nA_(a,b,c,d){var\nj,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cJ)h=cJ;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(cV[e.caml_custom]&&cV[e.caml_custom].hash){var\nn=cV[e.caml_custom].hash(e);f=W(f,n);g--}}else if(Array.isArray(e)&&e[0]===(e[0]|0))switch(e[0]){case\n248:f=W(f,e[2]);g--;break;case\n250:j[--k]=e[1];break;default:if(lY(e[0]))break;var\no=e.length-1<<10|e[0];f=W(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(ed(e)){f=A$(f,e);g--}else if(ee(e)){f=Bd(f,e);g--}else if(typeof\ne===\"string\"){f=gK(f,e);g--}else if(e===(e|0)){f=W(f,e+e+1);g--}else if(typeof\ne===\"number\"){f=gJ(f,e);g--}}f=Bb(f);return f&0x3fffffff}function\nBe(a,b,c){if(!Number.isFinite(a)){if(Number.isNaN(a))return ag(f_);return ag(a>0?kk:\"-infinity\")}var\nk=a===0&&1/a===Number.NEGATIVE_INFINITY?1:a>=0?0:1;if(k)a=-a;var\nf=0;if(a===0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else\nwhile(a>=2){a/=2;f++}var\nl=f<0?e:b5,g=e;if(k)g=bw;else\nswitch(c){case\n43:g=b5;break;case\n32:g=aH;break;default:break}if(b>=0&&b<13){var\ni=Math.pow(2,b*4);a=Math.round(a*i)/i}var\nd=a.toString(16);if(b>=0){var\nj=d.indexOf(bd);if(j<0)d+=bd+b7(b,af);else{var\nh=j+1+b;if(d.length>24&aG,a>>31&aB)}function\nlV(a){return a.toInt()}function\nBl(a){return+a.isNeg()}function\nlR(a){return a.neg()}function\nBj(a,b){var\nc=gV(a);if(c.signedconv&&Bl(b)){c.sign=-1;b=lR(b)}var\nd=e,i=cW(c.base),h=\"0123456789abcdef\";do{var\ng=b.udivmod(i);b=g.quotient;d=h.charAt(lV(g.modulus))+d}while(!Bm(b));if(c.prec>=0){c.filler=aH;var\nf=c.prec-d.length;if(f>0)d=b7(f,af)+d}return gH(c,d)}function\nlU(a,b){return a.or(b)}function\nl6(a){var\nb=0,f=n(a),d=10,e=1,c=1;if(f>0)switch(_(a,b)){case\n45:b++;e=-1;break;case\n43:b++;e=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function\nlX(a){var\nf=l6(a),d=f[0],i=f[1],g=f[2],j=f[3],h=n(a),k=-1>>>0,e=d=g)V(aZ);var\nb=c;for(d++;d=g)break;b=g*b+c;if(b>k)V(aZ)}if(d!==h)V(aZ);b=i*b;if(j&&(b|0)!==b)V(aZ);return b|0}function\nef(a,b,c){return a[H(b)].apply(a,gR(c))}function\nlZ(a,b){switch(b.length){case\n1:return new\na();case\n2:return new\na(b[1]);case\n3:return new\na(b[1],b[2]);case\n4:return new\na(b[1],b[2],b[3]);case\n5:return new\na(b[1],b[2],b[3],b[4]);case\n6:return new\na(b[1],b[2],b[3],b[4],b[5]);case\n7:return new\na(b[1],b[2],b[3],b[4],b[5],b[6]);case\n8:return new\na(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function\nc(){return a.apply(this,gR(b))}c.prototype=a.prototype;return new\nc()}function\ngS(a){var\nc={};for(var\nb=1;b>>0&&gU(a,dW,d4)?0:1}function\nl0(a){gU(a,d4,cH);return 0}function\nBw(a,b){return+(d_(a,b,false)<0)}function\nBx(a){var\nb=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function\nlP(a,b){return a.add(b)}function\nlQ(a,b){return a.mul(b)}function\ngQ(a,b){return a.ucompare(b)<0}function\nlS(a){var\ng=l6(a),f=g[0],j=g[1],h=g[2],k=g[3],i=cW(h),l=new\nd(aG,0xfffffff,aB).udivmod(i).quotient,e=_(a,f),b=eg(e);if(b<0||b>=h)V(aZ);var\nc=cW(b);for(;;){f++;e=_(a,f);if(e===95)continue;b=eg(e);if(b<0||b>=h)break;if(gQ(l,c))V(aZ);b=cW(b);c=lP(lQ(i,c),b);if(gQ(c,b))V(aZ)}if(f!==n(a))V(aZ);if(k&&gQ(new\nd(0,0,aA),c))V(aZ);if(j<0)c=lR(c);return c}var\nBz=lS(ag(\"0xdaba0b6eb09322e3\")),By=lS(ag(\"0xd1342543de82ef95\"));function\nAU(a,b){return a.get(a.offset(b))}function\nBr(a,b){return a.xor(b)}function\nBp(a,b){return a.shift_right_unsigned(b)}function\nBo(a,b){return a.shift_left(b)}function\nl1(a){function\no(a,b){return Bo(a,b)}function\nh(a,b){return Bp(a,b)}function\ns(a,b){return lU(a,b)}function\nf(a,b){return Br(a,b)}function\nk(a,b){return lP(a,b)}function\ni(a,b){return lQ(a,b)}function\nm(a,b){return s(o(a,b),h(a,64-b))}function\ng(a,b){return AU(a,b)}function\nj(a,b,c){return cQ(a,b,c)}var\nq=By,l=Bz,b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var\nd=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function\nAP(a,b){if(a<0)cP();var\na=a+1|0,c=new\nArray(a);c[0]=0;for(var\nd=1;d>>32-e,c)}function\ng(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function\nh(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function\ni(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function\nj(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var\nc=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xd76aa478);f=g(f,c,d,e,b[1],12,0xe8c7b756);e=g(e,f,c,d,b[2],17,0x242070db);d=g(d,e,f,c,b[3],22,0xc1bdceee);c=g(c,d,e,f,b[4],7,0xf57c0faf);f=g(f,c,d,e,b[5],12,0x4787c62a);e=g(e,f,c,d,b[6],17,0xa8304613);d=g(d,e,f,c,b[7],22,0xfd469501);c=g(c,d,e,f,b[8],7,0x698098d8);f=g(f,c,d,e,b[9],12,0x8b44f7af);e=g(e,f,c,d,b[10],17,0xffff5bb1);d=g(d,e,f,c,b[11],22,0x895cd7be);c=g(c,d,e,f,b[12],7,0x6b901122);f=g(f,c,d,e,b[13],12,0xfd987193);e=g(e,f,c,d,b[14],17,0xa679438e);d=g(d,e,f,c,b[15],22,0x49b40821);c=h(c,d,e,f,b[1],5,0xf61e2562);f=h(f,c,d,e,b[6],9,0xc040b340);e=h(e,f,c,d,b[11],14,0x265e5a51);d=h(d,e,f,c,b[0],20,0xe9b6c7aa);c=h(c,d,e,f,b[5],5,0xd62f105d);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xd8a1e681);d=h(d,e,f,c,b[4],20,0xe7d3fbc8);c=h(c,d,e,f,b[9],5,0x21e1cde6);f=h(f,c,d,e,b[14],9,0xc33707d6);e=h(e,f,c,d,b[3],14,0xf4d50d87);d=h(d,e,f,c,b[8],20,0x455a14ed);c=h(c,d,e,f,b[13],5,0xa9e3e905);f=h(f,c,d,e,b[2],9,0xfcefa3f8);e=h(e,f,c,d,b[7],14,0x676f02d9);d=h(d,e,f,c,b[12],20,0x8d2a4c8a);c=i(c,d,e,f,b[5],4,0xfffa3942);f=i(f,c,d,e,b[8],11,0x8771f681);e=i(e,f,c,d,b[11],16,0x6d9d6122);d=i(d,e,f,c,b[14],23,0xfde5380c);c=i(c,d,e,f,b[1],4,0xa4beea44);f=i(f,c,d,e,b[4],11,0x4bdecfa9);e=i(e,f,c,d,b[7],16,0xf6bb4b60);d=i(d,e,f,c,b[10],23,0xbebfbc70);c=i(c,d,e,f,b[13],4,0x289b7ec6);f=i(f,c,d,e,b[0],11,0xeaa127fa);e=i(e,f,c,d,b[3],16,0xd4ef3085);d=i(d,e,f,c,b[6],23,0x04881d05);c=i(c,d,e,f,b[9],4,0xd9d4d039);f=i(f,c,d,e,b[12],11,0xe6db99e5);e=i(e,f,c,d,b[15],16,0x1fa27cf8);d=i(d,e,f,c,b[2],23,0xc4ac5665);c=j(c,d,e,f,b[0],6,0xf4292244);f=j(f,c,d,e,b[7],10,0x432aff97);e=j(e,f,c,d,b[14],15,0xab9423a7);d=j(d,e,f,c,b[5],21,0xfc93a039);c=j(c,d,e,f,b[12],6,0x655b59c3);f=j(f,c,d,e,b[3],10,0x8f0ccc92);e=j(e,f,c,d,b[10],15,0xffeff47d);d=j(d,e,f,c,b[1],21,0x85845dd1);c=j(c,d,e,f,b[8],6,0x6fa87e4f);f=j(f,c,d,e,b[15],10,0xfe2ce6e0);e=j(e,f,c,d,b[6],15,0xa3014314);d=j(d,e,f,c,b[13],21,0x4e0811a1);c=j(c,d,e,f,b[4],6,0xf7537e82);f=j(f,c,d,e,b[11],10,0xbd3af235);e=j(e,f,c,d,b[2],15,0x2ad7d2bb);d=j(d,e,f,c,b[9],21,0xeb86d391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function\nAN(a,b,c){var\ne=a.len&be,d=0;a.len+=c;if(e){var\nf=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);d6(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function\nAL(a){var\nc=a.len&be;a.b8[c]=at;c++;if(c>56){for(var\nb=c;b<64;b++)a.b8[b]=0;d6(a.w,a.b32);for(var\nb=0;b<56;b++)a.b8[b]=0}else\nfor(var\nb=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1fffffff;d6(a.w,a.b32);var\ne=new\nUint8Array(16);for(var\nd=0;d<4;d++)for(var\nb=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&aK;return e}function\nBR(a){return aq(cY(a,0,a.length))}function\nBB(a,b,c){var\nd=AM(),e=gY(a);AN(d,e.subarray(b,b+c),c);return BR(AL(d))}function\nBC(a,b,c){return BB(bg(a),b,c)}function\nBE(){return 0}var\nbi=new\nArray();function\nl2(a){return bi[a]}function\nbF(a){var\nb=l2(a);if(!b.opened)l(\"Cannot flush a closed channel\");if(!b.buffer||b.buffer_curr===0)return 0;if(b.output)b.output(cY(b.buffer,0,b.buffer_curr));else\nb.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function\nBT(a,b){if(b.name)try{var\nd=require(gi),c=d.openSync(b.name,\"rs\");return new\naC(c,b)}catch(f){}return new\naC(a,b)}var\nek=new\nArray(3);function\ncO(a,b){Z.call(this,C(0));this.log=function(a){return 0};if(a===1&&typeof\nconsole.log===\"function\")this.log=console.log;else if(a===2&&typeof\nconsole.error===\"function\")this.log=console.error;else if(typeof\nconsole.log===\"function\")this.log=console.log;this.flags=b}cO.prototype.length=function(){return 0};cO.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]===10)d--;var\ne=C(d);a1(gF(b),c,e,0,d);this.log(e.toUtf16());return 0}l(this.fd+kS)};cO.prototype.read=function(a,b,c,d){l(this.fd+\": file descriptor is write only\")};cO.prototype.close=function(){this.log=undefined};function\nel(a,b){if(b===undefined)b=ek.length;ek[b]=a;return b|0}function\nB8(a,b,c){var\nd={};while(b){switch(b[1]){case\n0:d.rdonly=1;break;case\n1:d.wronly=1;break;case\n2:d.append=1;break;case\n3:d.create=1;break;case\n4:d.truncate=1;break;case\n5:d.excl=1;break;case\n6:d.binary=1;break;case\n7:d.text=1;break;case\n8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)l(aL(a)+gA);if(d.text&&d.binary)l(aL(a)+gl);var\ne=mh(a),f=e.device.open(e.rest,d);return el(f,undefined)}(function(){function\na(a,b){return cZ()?BT(a,b):new\ncO(a,b)}el(a(0,{rdonly:1,altname:\"/dev/stdin\",isCharacterDevice:true}),0);el(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);el(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function\nBF(a){var\nb=ek[a];if(b.flags.wronly)l(ld+a+\" is writeonly\");var\nd=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new\nUint8Array(kl),refill:d};bi[c.fd]=c;return c.fd}function\nl3(a){var\nb=ek[a];if(b.flags.rdonly)l(ld+a+\" is readonly\");var\nd=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new\nUint8Array(kl),buffered:d};bi[c.fd]=c;return c.fd}function\nBG(){var\nb=0;for(var\na=0;ae.buffer.length){var\ng=new\nUint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case\n0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;bF(a);break;case\n1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bF(a);break;case\n2:var\nf=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bF(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;bF(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function\nBH(a,b,c,d){var\nb=gY(b);return BI(a,b,c,d)}function\ngT(a,b,c,d){return BH(a,bg(b),c,d)}function\nl4(a,b){var\nc=aq(String.fromCharCode(b));gT(a,c,0,1);return 0}function\nbG(a,b){return+(d_(a,b,false)!==0)}function\nBK(a,b){var\nd=new\nArray(b+1);d[0]=a;for(var\nc=1;c<=b;c++)d[c]=0;return d}function\nbH(a){if(Array.isArray(a)&&a[0]===a[0]>>>0)return a[0];else if(ed(a))return d2;else if(ee(a))return d2;else if(a\ninstanceof\nFunction||typeof\na===\"function\")return 247;else if(a&&a.caml_custom)return k9;else\nreturn cM}var\nmg=undefined;function\nAV(a){var\nd={},c=-1;if(a)for(var\nb=1;b=0)a=e;else{var\na=O.symidx.next_idx++;O.symidx[d]=a}}}O[a+1]=b;if(c)O[c]=b}function\ngX(a,b){l5[aL(a)]=b;return 0}function\nBQ(){G(f8)}function\nD(a,b){if(b>>>0>=n(a))BQ();return _(a,b)}function\nej(a){a.t&6&&cT(a);return aq(a.c)}function\nBS(){return 0x7fffffff/4|0}function\nBM(){l7(O.Not_found)}function\nl$(a){var\nb=mf(H(a));if(b===undefined)BM();return ag(b)}function\nBU(){if(c.crypto)if(c.crypto.getRandomValues){var\na=c.crypto.getRandomValues(new\nInt32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(c.crypto.randomBytes){var\na=new\nInt32Array(c.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var\nb=new\nDate().getTime(),d=b^0xffffffff*Math.random();return[0,d]}function\nbI(a){var\nb=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function\np(a,b){return{joo_tramp:a,joo_args:b}}function\nmb(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof\nb===\"function\"){a.fun=b;return 0}var\nc=b.length;while(c--)a[c]=b[c];return 0}function\nP(a){{if(Array.isArray(a))return a;var\nb;if(c.RangeError&&a\ninstanceof\nc.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=O.Stack_overflow;else if(c.InternalError&&a\ninstanceof\nc.InternalError&&a.message&&a.message.match(/too much recursion/i))b=O.Stack_overflow;else if(a\ninstanceof\nc.Error&&bj(gc))b=[0,bj(gc),a];else\nb=[0,O.Failure,ag(String(a))];if(a\ninstanceof\nc.Error)b.js_error=a;return b}}function\nBW(){return require(\"y-protocols/awareness.js\")}function\nBX(){return require(\"y-indexeddb\").IndexeddbPersistence}function\nBY(){return require(\"quill\").default}function\nBZ(){return require(\"quill-cursors\")}function\nB0(){return require(\"y-webrtc\").WebrtcProvider}function\nB1(){return require(\"y-quill\")}function\nB2(){return require(\"yjs\")}function\nBs(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function\nA7(a){var\nb=e;if(a[0]===0){b+=a[1][1];if(a.length===3&&a[2][0]===0&&Bs(a[1]))var\nf=a[2],g=1;else\nvar\ng=2,f=a;b+=\"(\";for(var\nd=g;dg)b+=kW;var\nc=f[d];if(typeof\nc===\"number\")b+=c.toString();else if(c\ninstanceof\na0)b+=d1+c.toString()+d1;else if(typeof\nc===\"string\")b+=d1+c.toString()+d1;else\nb+=lq}b+=\")\"}else if(a[0]===r)b+=a[1];return b}function\nlM(a){if(Array.isArray(a)&&(a[0]===0||a[0]===r)){var\nc=bj(ls);if(c)d9(c,[a,false]);else{var\nd=A7(a),b=bj(le);if(b)d9(b,[0]);console.error(gd+d);if(a.js_error)throw a.js_error}}else\nthrow a}function\nBP(){var\nd=c.process;if(d&&d.on)d.on(\"uncaughtException\",function(a,b){lM(a);d.exit(2)});else if(c.addEventListener)c.addEventListener(kU,function(a){if(a.error)lM(a.error)})}BP();function\nh(a,b){return(a.l>=0?a.l:a.l=a.length)===1?a(b):bh(a,[b])}function\ni(a,b,c){return(a.l>=0?a.l:a.l=a.length)===2?a(b,c):bh(a,[b,c])}function\nx(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)===3?a(b,c,d):bh(a,[b,c,d])}function\nf4(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)===5?a(b,c,d,e,f):bh(a,[b,c,d,e,f])}function\nAK(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)===7?a(b,c,d,e,f,g,h):bh(a,[b,c,d,e,f,g,h])}var\nB7=0;A8();var\nem=[r,lw,-1],g3=[r,kh,-2],b_=[r,gB,-3],b9=[r,j9,-4],a5=[r,k0,-7],g1=[r,lu,-8],g2=[r,kv,-9],f=[r,kA,-11],b$=[r,kH,-12],AJ=[4,0,0,0,[12,45,[4,0,0,0,0]]],eN=[0,[11,'File \"',[2,0,[11,'\", line ',[4,0,0,0,[11,lv,[4,0,0,0,[12,45,[4,0,0,0,[11,kL,[2,0,0]]]]]]]]]],'File \"%s\", line %d, characters %d-%d: %s'],jK=gz,bu=\"content\",jQ=\"columns\",jR=\"rows\",fY=kc,fZ=gz,jS=bx,jT=\"page_content\";aw(11,b$,kH);aw(10,f,kA);aw(9,[r,kC,-10],kC);aw(8,g2,kv);aw(7,g1,lu);aw(6,a5,k0);aw(5,[r,k_,-6],k_);aw(4,[r,kn,-5],kn);aw(3,b9,j9);aw(2,b_,gB);aw(1,g3,kh);aw(0,em,lw);var\nms=\"output_substring\",mo=bd,mk=\"true\",ml=\"false\",mx=\"CamlinternalLazy.Undefined\",mD=\"option is None\",mG=\"\\\\\\\\\",mH=\"\\\\'\",mI=\"\\\\b\",mJ=\"\\\\t\",mK=\"\\\\n\",mL=\"\\\\r\",mU=\"List.init\",mQ=\"hd\",m$=\"String.blit / Bytes.blit_string\",m_=\"Bytes.blit\",m9=\"String.sub / Bytes.sub\",nk=\"String.contains_from / Bytes.contains_from\",nq=\"Array.blit\",np=\"Array.sub\",nn=\"Array.init\",nx=[0,\"set.ml\",lc,18],nt=dX,nu=dX,nv=dX,nw=dX,nA=d0,nB=d0,nC=d0,nD=d0,nE=\"Stdlib.Stack.Empty\",nI=\"Stdlib.Queue.Empty\",nR=\"Buffer.add_substring/add_subbytes\",nP=\"Buffer.add: cannot grow buffer\",nN=\"Buffer.sub\",nY=\"first domain already spawned\",nV=[0,\"domain.ml\",184,13],n9=\"%c\",n_=\"%s\",n$=k4,oa=j6,ob=ly,oc=kY,od=\"%f\",oe=\"%B\",of=\"%{\",og=\"%}\",oh=\"%(\",oi=\"%)\",oj=\"%a\",ok=\"%t\",ol=\"%?\",om=\"%r\",on=\"%_r\",oo=[0,L,850,23],oz=[0,L,814,21],or=[0,L,815,21],oA=[0,L,818,21],os=[0,L,819,21],oB=[0,L,822,19],ot=[0,L,823,19],oC=[0,L,826,22],ou=[0,L,827,22],oD=[0,L,831,30],ov=[0,L,832,30],ox=[0,L,836,26],op=[0,L,837,26],oy=[0,L,846,28],oq=[0,L,847,28],ow=[0,L,851,23],pP=[0,L,1558,4],pQ=\"Printf: bad conversion %[\",pR=[0,L,1626,39],pS=[0,L,1649,31],pT=[0,L,1650,31],pU=\"Printf: bad conversion %_\",pV=kf,pW=kB,pX=kf,pY=kB,p2=[0,[11,\"invalid box description \",[3,0,0]],\"invalid box description %S\"],p1=[0,0,4],pK=f_,pI=\"neg_infinity\",pJ=kk,pH=bd,pC=[0,jZ],pq=\"%+nd\",pr=\"% nd\",pt=\"%+ni\",pu=\"% ni\",pv=\"%nx\",pw=\"%#nx\",px=\"%nX\",py=\"%#nX\",pz=\"%no\",pA=\"%#no\",pp=\"%nd\",ps=ly,pB=\"%nu\",pc=\"%+ld\",pd=\"% ld\",pf=\"%+li\",pg=\"% li\",ph=\"%lx\",pi=\"%#lx\",pj=\"%lX\",pk=\"%#lX\",pl=\"%lo\",pm=\"%#lo\",pb=\"%ld\",pe=j6,pn=\"%lu\",o0=\"%+Ld\",o1=\"% Ld\",o3=\"%+Li\",o4=\"% Li\",o5=\"%Lx\",o6=\"%#Lx\",o7=\"%LX\",o8=\"%#LX\",o9=\"%Lo\",o_=\"%#Lo\",oZ=\"%Ld\",o2=kY,o$=\"%Lu\",oM=\"%+d\",oN=\"% d\",oP=\"%+i\",oQ=\"% i\",oR=\"%x\",oS=\"%#x\",oT=\"%X\",oU=\"%#X\",oV=\"%o\",oW=\"%#o\",oL=f7,oO=k4,oX=kq,n1=\"@]\",n2=\"@}\",n3=\"@?\",n4=\"@\\n\",n5=\"@.\",n6=\"@@\",n7=\"@%\",n8=\"@\",oE=\"CamlinternalFormat.Type_mismatch\",p7=e,p8=[0,[11,kW,[2,0,[2,0,0]]],\", %s%s\"],qI=[0,[11,gd,[2,0,[12,10,0]]],ku],qJ=[0,[11,\"Fatal error in uncaught exception handler: exception \",[2,0,[12,10,0]]],\"Fatal error in uncaught exception handler: exception %s\\n\"],qH=\"Fatal error: out of memory in uncaught exception handler\",qE=[0,[11,gd,[2,0,[12,10,0]]],ku],qy=[0,[2,0,[12,10,0]],\"%s\\n\"],qz=[0,[11,ke,0],ke],qn=\"Raised at\",qo=\"Re-raised at\",qp=\"Raised by primitive operation at\",qq=\"Called from\",qr=[0,[12,32,[4,0,0,0,0]],\" %d\"],qv=[0,[11,\"s \",[4,0,0,0,[12,45,[4,0,0,0,0]]]],\"s %d-%d\"],qs=\" (inlined)\",qu=e,qt=[0,[2,0,[12,32,[2,0,[11,' in file \"',[2,0,[12,34,[2,0,[11,\", line\",[2,0,[11,lv,AJ]]]]]]]]]],'%s %s in file \"%s\"%s, line%s, characters %d-%d'],qw=[0,[2,0,[11,\" unknown location\",0]],\"%s unknown location\"],qg=\"Out of memory\",qh=\"Stack overflow\",qi=\"Pattern matching failed\",qj=\"Assertion failed\",qk=\"Undefined recursive module\",p_=[0,[12,40,[2,0,[2,0,[12,41,0]]]],\"(%s%s)\"],p$=e,qa=e,qb=[0,[12,40,[2,0,[12,41,0]]],\"(%s)\"],p6=[0,[4,0,0,0,0],f7],p4=[0,[3,0,0],\"%S\"],p5=lq,qB=[0,e,\"(Cannot print locations:\\n bytecode executable program file not found)\",\"(Cannot print locations:\\n bytecode executable program file appears to be corrupt)\",\"(Cannot print locations:\\n bytecode executable program file has wrong magic number)\",\"(Cannot print locations:\\n bytecode executable program file cannot be opened;\\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)\"],qN=\"Fun.Finally_raised: \",qL=\"Stdlib.Fun.Finally_raised\",qO=\"Digest.BLAKE2: wrong hash size\",qZ=ao(14371852,15349651,22696),q0=ao(12230193,11438743,35013),q1=ao(1424933,15549263,2083),q2=ao(9492471,4696708,43520),qR=ao(1,0,0),qS=ao(0,0,0),qV=ao(1,0,0),qT=ao(0,0,0),qU=ao(2,0,0),q_=\"Hashtbl: unsupported hash table format\",q4=e,rQ=[3,0,3],rR=bd,rL=kD,rM=\"<\\/\",rN=e,rH=kD,rI=\"<\",rJ=e,rF=\"\\n\",rB=e,rC=e,rD=e,rE=e,ro=[0,e],rj=e,rk=e,rl=e,rm=e,rf=[0,e,0,e],rb=\"Stdlib.Format.String_tag\",r0=[0,kp,72,5],r1=[0,kp,81,2],r2=\"CamlinternalMod.update_mod: not a module\",rY=\"CamlinternalMod.init_mod: not a module\",r3=\"Jsoo_runtime.Error.Exn\",r4=gc,r8=[0,b,j5,10],r_=[0,b,179,10],sa=[0,b,191,10],sd=[0,b,lx,17],sm=[0,b,367,16],sn=[0,b,368,18],so=[0,b,372,15],sp=[0,b,377,15],sq=[0,b,383,15],sr=[0,b,386,10],ss=[0,b,362,16],st=[0,b,517,12],su=[0,b,459,14],sF=[0,b,686,27],sE=[0,b,651,27],sy=[0,b,560,16],sv=[0,b,550,23],sw=[0,b,k$,14],sl=[0,b,334,9],sh=[0,b,309,9],sg=[0,b,305,9],sf=[0,[11,\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n\",[15,0]],\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n%a\"],sc=[0,b,j$,14],r$=[0,b,186,14],r9=[0,b,169,14],r7=[0,b,152,14],sz=\"Lwd.Release_failure\",sN=[0,a,64,12],sX=[0,a,bv,21],s6=[0,a,205,18],s5=[0,a,lx,9],s8=[0,a,224,18],s7=[0,a,237,9],s9=[0,a,240,21],s_=[0,a,cH,21],s$=[0,a,260,21],tb=[0,a,296,14],tz=[0,a,kz,18],tA=[0,a,557,12],tB=[0,a,546,14],ty=[0,a,538,21],tw=[0,a,531,14],tv=[0,a,523,14],tt=[0,a,492,29],ts=[0,a,kE,29],tr=[0,a,462,21],tm=[0,a,420,10],tn=[0,a,423,15],to=[0,a,435,10],tp=[0,a,457,2],th=[0,a,371,24],ti=[0,a,391,16],tj=[0,a,394,2],te=[0,a,315,18],td=[0,a,317,9],s2=[0,a,193,4],s1=[0,a,j$,21],sZ=[0,a,j3,4],s0=[0,a,177,14],sU=[0,a,113,14],sS=[0,a,ka,14],sQ=[0,a,93,14],sO=[0,a,82,21],sM=[0,a,39,4],sL=[0,a,45,21],sJ=[0,a,32,14],t4=[0,Y,lc,12],tP=[0,Y,321,37],tQ=[0,Y,322,37],tS=[0,Y,346,10],tT=[0,Y,358,8],tR=[0,Y,337,37],tV=[0,Y,375,10],tW=[0,Y,384,8],tU=[0,Y,338,37],tZ=[0,Y,425,16],t2=[0,Y,513,50],t0=[0,Y,480,6],tY=[0,Y,395,14],tH=[0,Y,j3,57],tI=[0,Y,182,57],tJ=[0,Y,238,11],tC=ky,tD=ky,uQ=\"debug\",uP=\"warn\",uN=kU,uL=\"log\",uU=\"isSecureContext\",u$=[0,kd,233,16],u9=[0,kd,201,16],u4=[0,0,0],u2=[0,0,0],vG=e,vF=e,vv=[0,[0,T,li],0],vw=[0,[0,T,gh],[0,aI,0]],vx=[0,[0,T,gb],[0,aI,0]],vy=[0,[0,T,gn],[0,aI,0]],vz=[0,[0,T,ga],[0,aI,0]],vA=[0,[0,T,gw],[0,aI,0]],vB=[0,[0,T,ge],[0,aI,0]],vC=[0,[0,T,gv],[0,aI,0]],vD=[0,[0,T,li],[0,aI,0]],vm=[0,[0,T,gh],0],vn=[0,[0,T,gb],0],vo=[0,k6,0],vp=[0,[0,T,gn],0],vq=[0,[0,T,ga],0],vr=[0,[0,T,gw],0],vs=[0,[0,T,ge],0],vt=[0,aI,0],vu=[0,[0,T,gv],0],vk=[0,[11,\"\\x1b[\",[4,0,0,0,[12,109,0]]],\"\\x1b[%dm\"],vl=\"CCFormat.ANSI_codes.No_such_style\",vH=\"CCFormat.Style\",v5=\"content-box\",v6=\"border-box\",v7=\"device-pixel-content-box\",wi=ks,wf=[0,[8,[0,0,0],0,0,[11,kI,0]],\"%fpx\"],wg=[0,[8,[0,0,0],0,0,[11,kr,0]],\"%frem\"],wh=[0,[8,[0,0,0],0,0,[11,kj,0]],\"%fem\"],wc=kI,wd=kr,we=kj,wl=\"Common.Utils.Forward_ref.Not_set\",wn=\"Common.Utils.Forward_ref.Already_set\",wr=[1,[0,3854881,\"Failed to unmarshal data\"]],wt=[1,-358247754],wD=\"TODO not implemented\",wJ=[0,80,[0,\"lwdui-controlled-scroll-wrapper\"]],wK=[0,80,\"lwdui-controlled-scroll-controls\"],wL=\"Show playing\",wP=j8,wN=e,wO=b4,wS=[0,80,b4],wQ=[0,[2,0,[11,\"--id\",0]],\"%s--id\"],wU=[0,[2,0,[11,\"-id\",0]],\"%s-id\"],wV=[0,80,kV],w7=[0,[11,kF,[2,0,0]],\"height: %s\"],w3=[0,[2,0,[12,32,[2,0,0]]],\"%s %s\"],w1=\"grid-template-columns\",w2=[0,[2,0,[11,kL,[2,0,[12,59,0]]]],\"%s: %s;\"],w4=e,w8=[1,4.],xb=[0,80,kT],w$=[0,[11,\"height: calc(\",[2,0,[11,\" * \",[4,3,0,0,[11,\");\",0]]]]],\"height: calc(%s * %i);\"],xa=[0,[11,kF,[2,0,[11,\" !important;\",0]]],\"height: %s !important;\"],xc=[0,80,[0,\"lwdui-lazy-table-content\"]],xd=[0,80,[0,\"lwdui-lazy-table-content-wrapper\"]],xe=[0,\"lwdui-lazy-table\",0],xv=[0,[3,0,[11,\" is not a valid action\",0]],\"%S is not a valid action\"],xn=\"retain\",xo=\"insert\",xp=k5,xq=[0,gs,72,22],xi=[0,[0,0,0,0,0,0,0]],xj=[0,gs,49,6],xk=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],xl=[0,gs,j5,6],xr=[0,[0,0,0,0,0,0,0]],xw=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],xJ=\"color\",xK=bx,xM=bx,xL=\"user\",xY=\"bcPeers\",xZ=\"webrtcPeers\",x0=\"removed\",x1=\"added\",xW=\"status\",xX=lh,x2=\"peers\",xV=\"awareness\",xT=[0,[11,\"stun:\",[2,0,0]],\"stun:%s\"],xR=\"signaling\",xS=[0,\"stun.l.google.com:19302\",[0,\"stun2.l.google.com:19302\",[0,\"stun3.l.google.com:19302\",[0,\"stun4.l.google.com:19302\",0]]]],xU=\"peerOpts\",yc=\"toolbar\",yb=\"cursors\",ya=\"bubble\",yd=\"snow\",x6=kR,x7=\"italic\",x8=\"underline\",x9=\"strike\",x_=\"link\",yp=[0,[11,\"vector length is \",[4,0,0,0,[11,\", but data array has length \",[4,0,0,0,[11,\" (racy access?)\",0]]]]],\"vector length is %d, but data array has length %d (racy access?)\"],yn=[0,[11,\"index \",[4,0,0,0,[11,\" is out of range [0, \",[4,0,0,0,[12,41,0]]]]],\"index %d is out of range [0, %d)\"],yj=[0,[11,\"invalid segment (ofs = \",[4,0,0,0,[11,\", len = \",[4,0,0,0,[11,\") in a sequence of length \",[4,0,0,0,0]]]]]],\"invalid segment (ofs = %d, len = %d) in a sequence of length %d\"],yC=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",AA=\"tbl\",AB=[0,\"Create new table:\",0],Aw=ks,Ax=[0,80,[0,dV]],Ay=[0,80,[0,kX]],Ar=\"Found\",As=j0,At=\"1fr\",Au=\"a\",Aq=[2,5.],Ao=[0,B,848,19],An=[0,80,\"Add row\"],Ag=[0,1],Af=\"Add map with id \",Ah=[0,1],Ak=e,Al=e,Ai=[0,bc,1],Aj=[0,bc,0],Am=[0,B,829,18],Ac=[0,B,777,25],Ab=e,Ad=[0,B,769,23],z$=k7,Aa=\"Form valid:\",z4=[0,0,0],z5=[0,80,\"Add column\"],z6=[0,[0,cL,\"String\"],[0,[0,dZ,\"Checkbox\"],[0,[0,b4,\"Richtext\"],0]]],z7=[0,gz,cL,0],z8=[0,0],z9=[0,\"demo\"],z_=[0,1],z1=\"DELETE ROW\",z2=j0,z0=[0,B,689,17],zV=[0,80,[0,gm]],zW=[0,[0,0,[0,1,[0,2,0]]]],zX=[0,1],zY=[0,0],zS=dR,zT=[0,80,[0,gm]],zN=k7,zO=\" -> \",zM=[0,0],zK=[0,0],zL=[0,80,\"Update\"],zG=e,zH=e,zI=[0,80,[0,\"cell-edit-btn\"]],zJ=\"\\xe2\\x9c\\x8f\\xef\\xb8\\x8f\",zP=[0,80,[0,\"cell-edit-overlay\"]],zQ=[0,80,[0,gm]],zr=\"GET\",zq=[0,B,479,17],zp=[0,B,494,11],zu=[0,B,509,19],zt=[0,B,519,13],zs=[0,B,kE,13],zv=[0,B,526,11],zB=[0,B,k$,19],zA=[0,B,539,19],zw=[0,B,532,13],zy=[0,B,548,15],zz=[0,B,552,15],zx=[0,B,kz,11],zD=e,zE=[0,B,565,17],zC=[0,B,568,11],zk=bx,zl=ki,ze=\"New column kind:\",zc=[0,B,354,13],y_=dZ,y$=b4,za=dV,zb=cL,y6=\"Old value:\",y7=\"Action: delete\",y8=\"Key:\",y9=[0,B,279,15],y5=\"On_change\",y4=[0,B,204,22],y2=\"[blit v(%i) %i %i v'(%i)]\",yZ=[0,B,147,18],yN=lf,yO=\"orange\",yP=lj,yM=\"Received peers\",yL=\"Received synced\",yK=\"Received connected\",yF=\"modules/cursors\",yG=\"Narines\",yH=[0,[0,\"wss://p2p.u31.fr\",0]],yI=\"testroom5267564\",yJ=\"zedoc\",yR=[0,80,[0,\"p2p_status_icon\"]],yT=\"\\xe2\\x99\\xbc\",yW=[0,80,[0,\"p2p_status\"]],zh=bx,zi=ki,AC=[0,80,\"Add table\"],AF=[0,80,[0,kX]];function\ny(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return[0,y(a[1])];case\n1:return[1,y(a[1])];case\n2:return[2,y(a[1])];case\n3:return[3,y(a[1])];case\n4:return[4,y(a[1])];case\n5:return[5,y(a[1])];case\n6:return[6,y(a[1])];case\n7:return[7,y(a[1])];case\n8:var\nc=a[1];return[8,c,y(a[2])];case\n9:var\nb=a[1];return[9,b,b,y(a[3])];case\n10:return[10,y(a[1])];case\n11:return[11,y(a[1])];case\n12:return[12,y(a[1])];case\n13:return[13,y(a[1])];default:return[14,y(a[1])]}}function\nX(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,X(a[1],b)];case\n1:return[1,X(a[1],b)];case\n2:return[2,X(a[1],b)];case\n3:return[3,X(a[1],b)];case\n4:return[4,X(a[1],b)];case\n5:return[5,X(a[1],b)];case\n6:return[6,X(a[1],b)];case\n7:return[7,X(a[1],b)];case\n8:var\nc=a[1];return[8,c,X(a[2],b)];case\n9:var\nd=a[2],e=a[1];return[9,e,d,X(a[3],b)];case\n10:return[10,X(a[1],b)];case\n11:return[11,X(a[1],b)];case\n12:return[12,X(a[1],b)];case\n13:return[13,X(a[1],b)];default:return[14,X(a[1],b)]}}function\nw(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,w(a[1],b)];case\n1:return[1,w(a[1],b)];case\n2:var\nc=a[1];return[2,c,w(a[2],b)];case\n3:var\nd=a[1];return[3,d,w(a[2],b)];case\n4:var\ne=a[3],f=a[2],g=a[1];return[4,g,f,e,w(a[4],b)];case\n5:var\nh=a[3],i=a[2],j=a[1];return[5,j,i,h,w(a[4],b)];case\n6:var\nk=a[3],l=a[2],m=a[1];return[6,m,l,k,w(a[4],b)];case\n7:var\nn=a[3],o=a[2],p=a[1];return[7,p,o,n,w(a[4],b)];case\n8:var\nq=a[3],r=a[2],s=a[1];return[8,s,r,q,w(a[4],b)];case\n9:var\nt=a[1];return[9,t,w(a[2],b)];case\n10:return[10,w(a[1],b)];case\n11:var\nu=a[1];return[11,u,w(a[2],b)];case\n12:var\nv=a[1];return[12,v,w(a[2],b)];case\n13:var\nx=a[2],y=a[1];return[13,y,x,w(a[3],b)];case\n14:var\nz=a[2],A=a[1];return[14,A,z,w(a[3],b)];case\n15:return[15,w(a[1],b)];case\n16:return[16,w(a[1],b)];case\n17:var\nB=a[1];return[17,B,w(a[2],b)];case\n18:var\nC=a[1];return[18,C,w(a[2],b)];case\n19:return[19,w(a[1],b)];case\n20:var\nD=a[2],E=a[1];return[20,E,D,w(a[3],b)];case\n21:var\nF=a[1];return[21,F,w(a[2],b)];case\n22:return[22,w(a[1],b)];case\n23:var\nG=a[1];return[23,G,w(a[2],b)];default:var\nH=a[2],I=a[1];return[24,I,H,w(a[3],b)]}}function\na4(a){throw g([0,b_,a],1)}function\ns(a){throw g([0,b9,a],1)}function\nc0(a){return 0<=a?a:-a|0}var\ng4=kG;function\naM(a,b){return a+b}function\nmn(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(e<=c)return aM(b,mo);var\nd=D(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function\nmr(a,b,c,d){var\nf=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var\nh=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var\nj=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var\nl=[0,j[1],aJ],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}BF(0);var\nen=l3(1),ah=l3(2);function\nca(a,b){gT(a,b,0,n(b))}function\ng5(a,b,c,d){if(0<=c&&0<=d&&(n(b)-d|0)>=c)return gT(a,b,c,d);return s(ms)}function\ng6(a){ca(ah,a);l4(ah,10);return bF(ah)}var\neo=[0,function(a){return function(a){var\nb=a;for(;;){if(!b)return 0;var\nd=b[2],e=b[1];try{bF(e)}catch(f){var\nc=P(f);if(c[1]!==g3)throw g(c,0)}b=d}}(BG(0))}],g7=[0,function(a){}];function\nep(a){h(g7[1],0);return h(gD(eo),0)}gX(le,ep);function\ncb(a){return bF(a)}function\nmi(a){return a^-1}function\nmj(a){return a?mk:ml}function\nmm(a){return e+a}function\nmp(a){return mn(gI(\"%.12g\",a))}function\nmq(a,b){if(!a)return b;var\nc=a[2],d=a[1];if(!c)return[0,d,b];var\ne=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var\ng=[0,e[1],aJ];mr(g,1,e[2],b);return[0,d,[0,f,g]]}function\nmt(c){for(;;){var\na=gD(eo);let\nd=[0,1],e=a;var\nb=1-gC(eo,a,function(a){if(gC(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function\nmu(a,b){l4(a,b)}var\neq=BS(0),cc=(4*eq|0)-1|0;function\nmv(a){return 1-(typeof\na===\"number\"?1:0)}function\ng8(a,b,c){return gC(a,b,c)}function\ncd(a){return gD(a)}function\nce(a){return[0,a]}function\nmw(a,b){return AR(a,b)}var\nmy=[r,mx,an(0)];function\nmz(a){var\nd=a[1];a[1]=0;try{var\nc=h(d,0);a[1]=c;l0(a);return c}catch(f){var\nb=P(f);a[1]=function(a){throw g(b,0)};Bu(a);throw g(b,0)}}function\nmA(a){var\nc=a[1];a[1]=0;var\nb=h(c,0);a[1]=b;l0(a);return b}function\nmB(a,b){if(0===Bv(b))return a?mA(b):mz(b);throw g(my,1)}function\nmC(a){return mB(0,a)}function\nc1(a){return a?a[1]:s(mD)}function\ncf(a,b){return b?[0,h(a,b[1])]:0}function\ng9(a){return a?1:0}function\nmE(a){return a?[0,a[1],0]:0}function\nmF(a){a:{if(40<=a){if(92===a)return mG;if(gg>a)break a}else{if(32<=a){if(39<=a)return mH;break a}if(14>a)switch(a){case\n8:return mI;case\n9:return mJ;case\n10:return mK;case\n13:return mL}}var\nb=C(4);A(b,0,92);A(b,1,48+(a/gp|0)|0);A(b,2,48+((a/10|0)%10|0)|0);A(b,3,48+(a%10|0)|0);return ej(b)}var\nc=C(1);A(c,0,a);return ej(c)}function\nmM(a){return 25>>0?a:a-32|0}function\nmN(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\ner(a){return mN(0,a)}function\nbJ(a,b){var\nc=a,d=b;for(;;){if(!c)return d;var\ne=[0,c[1],d];c=c[2];d=e}}function\ncg(a){return bJ(a,0)}function\nmR(a,b,c){if(b>1,s=p(r,b),D=s[1],t=p(a-r|0,s[2]),E=t[2];return[0,B(D,t[1],0),E]}function\np(a,b){if(2===a){if(b){var\nj=b[2];if(j){var\nk=j[1],g=b[1],B=j[2],q=i(d,g,k),C=0===q?[0,g,0]:0>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var\na=er(b);return 2<=a?h(a,b)[1]:b}function\nm2(a,b){return lW(a,b)}function\nm3(a,b){return a<=b?a:b}function\nm4(a,b){return b<=a?a:b}function\nm5(a){return e+a}function\nbk(a,b){var\nc=C(a);A5(c,0,a,b);return c}var\nm6=C(0);function\nm7(a){var\nb=av(a),c=C(b);a1(a,0,c,0,b);return c}function\neu(a,b,c){if(0<=b&&0<=c&&(av(a)-c|0)>=b){var\nd=C(c);a1(a,b,d,0,c);return d}return s(m9)}function\nev(a,b,c){return ej(eu(a,b,c))}function\nha(a,b,c,d,e){if(0<=e&&0<=b&&(av(a)-e|0)>=b&&0<=d&&(av(c)-e|0)>=d){a1(a,b,c,d,e);return}return s(m_)}function\nax(a,b,c,d,e){if(0<=e&&0<=b&&(n(a)-e|0)>=b&&0<=d&&(av(c)-e|0)>=d){cR(a,b,c,d,e);return}return s(m$)}function\nhb(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nnc(a,b){var\nd=av(b);if(0===d)return b;var\ne=C(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){A(e,c,h(a,bB(b,c)));var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nhc(a,b,c){lH(a,b,Bg(c))}function\nhd(a,b,c){au(a,b,c)}function\nhe(a,b){return AX(a,b)}function\nch(a){return bg(a)}function\n$(a){return ej(a)}function\nm8(a){return m7(bg(a))}function\nna(a){var\nd=av(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!hb(bB(a,b[1])))break;b[1]++}var\nc=[0,d-1|0];for(;;){if(b[1]<=c[1]&&hb(bB(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?eu(a,b[1],(c[1]-b[1]|0)+1|0):m6}}function\nnb(a){var\nb=[0,0],j=av(a)-1|0,l=0;if(j>=0){var\ng=l;for(;;){var\ne=bB(a,g);a:{b:{c:{if(32<=e){var\nh=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var\ni=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var\ni=4;break a}var\ni=2}b[1]=b[1]+i|0;var\no=g+1|0;if(j===g)break;g=o}}if(b[1]===av(a))return a;var\nc=C(b[1]);b[1]=0;var\nk=av(a)-1|0,m=0;if(k>=0){var\nf=m;for(;;){var\nd=bB(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(gg<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case\n8:A(c,b[1],92);b[1]++;A(c,b[1],98);break a;case\n9:A(c,b[1],92);b[1]++;A(c,b[1],116);break a;case\n10:A(c,b[1],92);b[1]++;A(c,b[1],110);break a;case\n13:A(c,b[1],92);b[1]++;A(c,b[1],114);break a;default:break c}}if(34>d)break b}A(c,b[1],92);b[1]++;A(c,b[1],d);break a}A(c,b[1],92);b[1]++;A(c,b[1],48+(d/gp|0)|0);b[1]++;A(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;A(c,b[1],48+(d%10|0)|0);break a}A(c,b[1],d)}b[1]++;var\nn=f+1|0;if(k===f)break;f=n}}return c}function\nnd(a){return nc(mM,a)}function\nne(a,b){return AY(a,b)}function\nnf(a,b,c){lH(a,b,c)}function\nc3(a,b){return $(bk(a,b))}function\new(a,b,c){return $(eu(ch(a),b,c))}function\nhf(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nni(a,b,c,d){var\ne=c;for(;;){if(b<=e)throw g(a5,1);if(_(a,e)===d)return e;e=e+1|0}}function\nnj(a,b,c){var\nd=n(a);if(0<=b&&d>=b)try{ni(a,d,b,c);var\nf=1;return f}catch(f){var\ne=P(f);if(e===a5)return 0;throw g(e,0)}return s(nk)}function\nex(a,b){return l_(a,b)}function\nc4(a,b){return ne(ch(a),b)}function\ney(a,b){return a===b?1:0}function\nng(a){if(a===e)return a;if(!hf(_(a,0))&&!hf(_(a,n(a)-1|0)))return a;return $(na(ch(a)))}function\nnh(a){return $(nb(ch(a)))}function\nnl(a,b){return nj(a,0,b)}function\nnm(a){return $(nd(ch(a)))}function\nhg(a,b){if(0===a)return[0];if(0>a)return s(nn);var\nd=ap(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var\nc=f;for(;;){d[1+c]=h(b,c);var\ng=c+1|0;if(e===c)break;c=g}}return d}function\nci(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d)return AO(a,b,c,d,e);return s(nq)}function\nhh(a,b){var\nd=b.length-2|0,e=0;if(d>=0){var\nc=e;for(;;){h(a,b[1+c]);var\nf=c+1|0;if(d===c)break;c=f}}return 0}function\nhi(a,b){var\nd=b.length-1;if(0===d)return[0];var\ne=ap(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var\nc=g;for(;;){e[1+c]=h(a,b[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nnr(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\nc5(a){if(!a)return[0];var\nb=a[2],c=a[1],e=ap(nr(0,a),c);return function(a,b){var\nd=a,c=b;for(;;){if(!c)return e;var\nf=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function\nno(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return AQ(a,b,c);return s(np)}function\nns(k){function\nh(a){return a?a[4]:0}function\nd(a,b,c){var\nd=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function\nj(a,b,c){var\ng=a?a[4]:0,i=c?c[4]:0;if((i+2|0)=i){var\nw=i<=g?g+1|0:i+1|0;return[0,a,b,c,w]}if(!c)return s(nw);var\nk=c[3],m=c[2],f=c[1],r=h(f);if(r<=h(k))return d(d(a,b,f),m,k);if(!f)return s(nv);var\nt=f[2],u=f[1],v=d(f[3],m,k);return d(d(a,b,u),t,v)}function\nc(a,b){if(!b)return[0,0,a,0,1];var\nd=b[3],e=b[2],f=b[1],g=i(k[1],a,e);if(0===g)return b;if(0<=g){var\nh=c(a,d);return d===h?b:j(f,e,h)}var\nl=c(a,f);return f===l?b:j(l,e,d)}function\nb(a){return[0,0,a,0,1]}var\nm=0;function\ne(a,b){var\nd=a,c=b;for(;;){if(!c)return d;var\nf=c[2],g=c[1];d=[0,f,e(d,c[3])];c=g}}function\nn(a){function\nc(a,b){if(3>=a>>>0)switch(a){case\n0:return[0,0,b];case\n1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case\n2:if(b){var\nh=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var\ni=b[2];if(i){var\nj=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var\nk=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,nx],1);var\no=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(er(a),a)[1]}return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return e(0,a)},,,,,,,,,,,,,,,,,,,function(a){if(!a)return m;var\nf=a[2],d=a[1];if(!f)return b(d);var\ng=f[2],e=f[1];if(!g)return c(e,b(d));var\nh=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var\nj=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return n(m1(k[1],a));var\no=j[1];return c(o,c(l,c(i,c(e,b(d)))))}]}function\nny(a){var\nb=ns(a);return[0,,,,,,,,,,b[39],,,,,,,,,,,,,,,,,,,,,,,,,,,,b[58]]}function\nnz(n){function\nh(a){return a?a[5]:0}function\ne(a,b,c,d){var\ne=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function\nj(a,b,c,d){var\ni=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var\nB=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return s(nD);var\nl=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return s(nC);var\nx=g[3],y=g[2],z=g[1],A=e(g[4],p,o,l);return e(e(a,b,c,z),y,x,A)}function\nf(a,b,c){if(!c)return[0,0,a,b,0,1];var\nd=c[4],g=c[3],h=c[2],e=c[1],o=c[5],k=i(n[1],a,h);if(0===k)return g===b?c:[0,e,a,b,d,o];if(0<=k){var\nl=f(a,b,d);return d===l?c:j(e,h,g,l)}var\nm=f(a,b,e);return e===m?c:j(m,h,g,d)}function\nd(a,b){var\nc=b;for(;;){if(!c)return 0;var\ne=c[4],f=c[3],g=c[2];d(a,c[1]);i(a,g,f);c=e}}function\ng(a,b,c){var\nd=b,e=c;for(;;){if(!d)return e;var\nf=d[4],h=d[3],i=d[2],j=x(a,i,h,g(a,d[1],e));d=f;e=j}}return[0,,,,,0,,f,,,,,,,,,,,,,,,,,,,,d,,,g]}function\nhj(a){var\nb=nz(a);return[0,b[5],b[7],,,,,,,,,,,,,,,,,,,,,b[27],b[30]]}var\nez=[r,nE,an(0)];function\nbK(a){return[0,0,0]}function\ncj(a){a[1]=0;a[2]=0}function\na7(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function\nbL(a){var\nb=a[1];if(!b)return 0;var\nc=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function\nbM(a){var\nb=a[1];return b?[0,b[1]]:0}function\nnF(a){var\nb=a[1];if(!b)throw g(ez,1);a[1]=b[2];a[2]=a[2]-1|0}function\nnG(a){if(a[1])return;throw g(ez,1)}function\nnH(a,b){return a6(a,b[1])}var\nnJ=[r,nI,an(0)];function\neA(a){return[0,0,0,0]}function\neB(a){a[1]=0;a[2]=0;a[3]=0}function\neC(a,b){var\nc=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function\nhk(a){var\nb=a[2];if(!b)throw g(nJ,1);var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return c}eB(a);return c}function\neD(a){return 0===a[1]?1:0}function\nnK(a){var\nb=a[2];return b?[0,b[1]]:0}function\nnL(a){var\nb=a[2];if(!b)return 0;var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}eB(a);return[0,c]}function\nbl(a){var\nb=1<=a?a:1,c=cc=(d+b|0))break;c[1]=2*c[1]|0}if(cc=b)return ev(a[1][1],b,c);return s(nN)}function\nnO(a){a[2]=0;return 0}function\nnQ(a,b){var\nc=a[2],d=a[1],e=d[1];if(d[2]<=c){eE(a,1);au(a[1][1],a[2],b)}else\nA(e,c,b);a[2]=c+1|0}var\neF=[0,0];function\nhn(a){return a}function\nho(a){return a!==eF?1:0}function\nhp(a){return a}(function(a){A3(ap(8,eF))}(0));var\nnS=ce(0),hq=ce(0);function\nnT(a){for(;;){var\nb=cd(hq),c=1-g8(hq,b,[0,a,b]);if(!c)return c}}function\naN(a,b){var\nc=[0,mw(nS,1),b];if(a)nT([0,c,a[1]]);return c}function\nhr(d){for(;;){var\na=lK(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e-43|0){case\n5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var\nf=bk(d+1|0,48);au(f,0,e);ax(b,1,f,(d-c|0)+2|0,c-1|0);return $(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(ca)return b;var\nh=[0,0],i=n(b)-1|0,o=0;if(i>=0){var\nd=o;for(;;){if(9>=_(b,d)+lk>>>0)h[1]++;var\nr=d+1|0;if(i===d)break;d=r}}var\nj=h[1],k=C(n(b)+((j-1|0)/3|0)|0),l=[0,0];function\ne(a){au(k,l[1],a);l[1]++}var\nf=[0,((j-1|0)%3|0)+1|0],m=n(b)-1|0,p=0;if(m>=0){var\nc=p;for(;;){var\ng=_(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var\nq=c+1|0;if(m===c)break;c=q}}return $(k)}function\npD(a,b){return c7(a,eb(oK(a),b))}function\npE(a,b){return c7(a,eb(pa(a),b))}function\npF(a,b){return c7(a,eb(po(a),b))}function\npG(a,b){return c7(a,Bj(oY(a),b))}function\naO(d,b,c){function\na(a){switch(d[1]){case\n0:var\ne=45;break;case\n1:var\ne=43;break;default:var\ne=32}return Be(c,b,e)}function\ne(a){var\nb=AZ(c);return 3===b?c<0.?pI:pJ:4<=b?pK:a}function\nf(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(c===e)return 0;var\nd=D(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:aM(b,pH)}switch(d[2]){case\n5:return e(f(gI(hx(d,b),c)));case\n6:return a(0);case\n7:return nm(a(0));case\n8:return e(a(0));default:return gI(hx(d,b),c)}}function\npL(a){var\nb=mF(a),c=n(b),d=bk(c+2|0,39);cR(b,0,d,1,c);return $(d)}function\npM(a){var\nb=ht(16);eI(b,a);return hv(b)}function\ncF(a,b,c,d){var\nk=b,j=c,e=d;for(;;){if(typeof\ne===\"number\")return h(k,j);switch(e[0]){case\n0:var\nt=e[1];return function(a){return o(k,[5,j,a],t)};case\n1:var\nu=e[1];return function(a){return o(k,[4,j,pL(a)],u)};case\n2:return eJ(k,j,e[2],e[1],function(a){return a});case\n3:return eJ(k,j,e[2],e[1],oJ);case\n4:return c8(k,j,e[4],e[2],e[3],pD,e[1]);case\n5:return c8(k,j,e[4],e[2],e[3],pE,e[1]);case\n6:return c8(k,j,e[4],e[2],e[3],pF,e[1]);case\n7:return c8(k,j,e[4],e[2],e[3],pG,e[1]);case\n8:return pN(k,j,e[4],e[2],e[3],e[1]);case\n9:return eJ(k,j,e[2],e[1],mj);case\n10:j=[7,j];e=e[1];break;case\n11:j=[2,j,e[1]];e=e[2];break;case\n12:j=[3,j,e[1]];e=e[2];break;case\n13:var\nv=e[3],x=pM(e[2]);return function(a){return o(k,[4,j,x],v)};case\n14:var\ny=e[3],z=e[2];return function(a){return o(k,j,w(oI(a[1],z),y))};case\n15:var\nA=e[1];return function(c,b){return o(k,[6,j,function(a){return i(c,a,b)}],A)};case\n16:var\nB=e[1];return function(a){return o(k,[6,j,a],B)};case\n17:j=[0,j,e[1]];e=e[2];break;case\n18:var\nl=e[1];if(0===l[0]){let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case\n19:throw g([0,f,pP],1);case\n20:var\nC=e[3],D=[8,j,pQ];return function(a){return o(k,D,C)};case\n21:var\nE=e[2];return function(a){return o(k,[4,j,eb(kq,a)],E)};case\n22:var\nF=e[1];return function(a){return o(k,[5,j,a],F)};case\n23:var\nm=e[2],n=e[1];return a<50?jV(a+1|0,k,j,n,m):p(jV,[0,k,j,n,m]);default:var\nq=e[3],r=e[1],s=h(e[2],0);return a<50?f0(a+1|0,k,j,q,r,s):p(f0,[0,k,j,q,r,s])}}}function\no(a,b,c){return bI(cF(0,a,b,c))}function\njV(a,b,c,d,e){if(typeof\nd===\"number\")switch(d){case\n0:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n1:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n2:throw g([0,f,pR],1);default:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e])}switch(d[0]){case\n0:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n1:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n2:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n3:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n4:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n5:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n6:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n7:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n8:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);case\n9:var\nh=d[2];return a<50?f1(a+1|0,b,c,h,e):p(f1,[0,b,c,h,e]);case\n10:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e]);default:return a<50?q(a+1|0,b,c,e):p(q,[0,b,c,e])}}function\nf1(a,h,c,d,e){if(typeof\nd===\"number\")return a<50?q(a+1|0,h,c,e):p(q,[0,h,c,e]);switch(d[0]){case\n0:var\nb=d[1];return function(a){return ai(h,c,b,e)};case\n1:var\ni=d[1];return function(a){return ai(h,c,i,e)};case\n2:var\nj=d[1];return function(a){return ai(h,c,j,e)};case\n3:var\nk=d[1];return function(a){return ai(h,c,k,e)};case\n4:var\nl=d[1];return function(a){return ai(h,c,l,e)};case\n5:var\nm=d[1];return function(a){return ai(h,c,m,e)};case\n6:var\nn=d[1];return function(a){return ai(h,c,n,e)};case\n7:var\no=d[1];return function(a){return ai(h,c,o,e)};case\n8:var\nr=d[2];return function(a){return ai(h,c,r,e)};case\n9:var\ns=d[3],t=d[2],u=I(E(d[1]),t);return function(a){return ai(h,c,X(u,s),e)};case\n10:var\nv=d[1];return function(a,b){return ai(h,c,v,e)};case\n11:var\nw=d[1];return function(a){return ai(h,c,w,e)};case\n12:var\nx=d[1];return function(a){return ai(h,c,x,e)};case\n13:throw g([0,f,pS],1);default:throw g([0,f,pT],1)}}function\nai(a,b,c,d){return bI(f1(0,a,b,c,d))}function\nq(a,b,c,d){var\ne=[8,c,pU];return a<50?cF(a+1|0,b,e,d):p(cF,[0,b,e,d])}function\neJ(g,f,c,d,e){if(typeof\nd===\"number\")return function(a){return o(g,[4,f,h(e,a)],c)};if(0===d[0]){var\nb=d[2],i=d[1];return function(a){return o(g,[4,f,ad(i,b,h(e,a))],c)}}var\nj=d[1];return function(a,b){return o(g,[4,f,ad(j,a,h(e,b))],c)}}function\nc8(k,j,h,d,e,f,g){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,bO(a,i(f,g,b))],h)}:function(a){return o(k,[4,j,i(f,g,a)],h)};var\nb=e[1];return function(a){return o(k,[4,j,bO(b,i(f,g,a))],h)}}if(0===d[0]){var\nc=d[2],l=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,ad(l,c,bO(a,i(f,g,b)))],h)}:function(a){return o(k,[4,j,ad(l,c,i(f,g,a))],h)};var\nn=e[1];return function(a){return o(k,[4,j,ad(l,c,bO(n,i(f,g,a)))],h)}}var\nm=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(k,[4,j,ad(m,a,bO(b,i(f,g,c)))],h)}:function(a,b){return o(k,[4,j,ad(m,a,i(f,g,b))],h)};var\np=e[1];return function(a,b){return o(k,[4,j,ad(m,a,bO(p,i(f,g,b)))],h)}}function\npN(i,h,g,d,e,f){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,aO(f,a,b)],g)}:function(a){return o(i,[4,h,aO(f,eH(f),a)],g)};var\nb=e[1];return function(a){return o(i,[4,h,aO(f,b,a)],g)}}if(0===d[0]){var\nc=d[2],j=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,ad(j,c,aO(f,a,b))],g)}:function(a){return o(i,[4,h,ad(j,c,aO(f,eH(f),a))],g)};var\nl=e[1];return function(a){return o(i,[4,h,ad(j,c,aO(f,l,a))],g)}}var\nk=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(i,[4,h,ad(k,a,aO(f,b,c))],g)}:function(a,b){return o(i,[4,h,ad(k,a,aO(f,eH(f),b))],g)};var\nm=e[1];return function(a,b){return o(i,[4,h,ad(k,a,aO(f,m,b))],g)}}function\nf0(a,b,c,d,e,f){if(e){var\ni=e[1];return function(a){return pO(b,c,d,i,h(f,a))}}var\ng=[4,c,f];return a<50?cF(a+1|0,b,g,d):p(cF,[0,b,g,d])}function\npO(a,b,c,d,e){return bI(f0(0,a,b,c,d,e))}function\naP(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=hw(c[2]);aP(a,f);return ca(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aP(a,e);ca(a,pV);c=i}else{var\nj=d[1];aP(a,e);ca(a,pW);c=j}break;case\n6:var\nm=c[2];aP(a,c[1]);return h(m,a);case\n7:aP(a,c[1]);return cb(a);case\n8:var\nn=c[2];aP(a,c[1]);return s(n);case\n2:case\n4:var\nk=c[2];aP(a,c[1]);return ca(a,k);default:var\nl=c[2];aP(a,c[1]);return mu(a,l)}}}function\naQ(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=hw(c[2]);aQ(a,f);return cl(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aQ(a,e);cl(a,pX);c=i}else{var\nj=d[1];aQ(a,e);cl(a,pY);c=j}break;case\n6:var\nm=c[2];aQ(a,c[1]);return cl(a,h(m,0));case\n7:c=c[1];break;case\n8:var\nn=c[2];aQ(a,c[1]);return s(n);case\n2:case\n4:var\nk=c[2];aQ(a,c[1]);return cl(a,k);default:var\nl=c[2];aQ(a,c[1]);return nQ(a,l)}}}function\npZ(a){var\nc=a[1],b=bl(cJ);return o(function(a){aQ(b,a);return a4(ck(b))},0,c)}function\np0(c){if(c===e)return p1;var\nf=n(c);function\nj(a){return h(pZ(p2),c)}function\nk(a){var\nb=a;for(;;){if(b===f)return b;var\nd=D(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var\ni=k(0),o=function(a,b){var\nd=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=ew(c,i,o-i|0),d=k(o),l=function(a,b){var\nd=b;for(;;){if(d===f)return d;var\ne=D(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var\nm=0;else\ntry{var\nr=lX(ew(c,d,l-d|0)),m=r}catch(f){var\np=P(f);if(p[1]!==b_)throw g(p,0);var\nq=j(0),m=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==j4){if(a===\"h\"){var\nb=0;break a}if(a===\"hov\"){var\nb=3;break a}if(a===\"hv\"){var\nb=2;break a}if(a!==\"v\"){var\nb=j(0);break a}var\nb=1;break a}var\nb=4}return[0,m,b]}function\np3(d,b,c){return o(function(a){aP(b,a);return h(d,b)},0,c[1])}function\nc9(a,b){return p3(function(a){return 0},a,b)}function\neK(a){return c9(ah,a)}function\neL(c,b){return o(function(a){var\nb=bl(64);aQ(b,a);return h(c,ck(b))},0,b[1])}function\nz(a){return eL(function(a){return a},a)}var\neM=ce(0);function\neO(a,b){var\nc=a[1+b];return mv(c)?bH(c)===d2?h(z(p4),c):bH(c)===253?mp(c):p5:h(z(p6),c)}function\nhy(a,b){if(a.length-1<=b)return p7;var\nc=hy(a,b+1|0),d=eO(a,b);return i(z(p8),d,c)}function\np9(a){var\nb=a.length-1;if(2>=b>>>0)switch(b){case\n0:return p$;case\n1:return qa;default:var\ne=eO(a,1);return h(z(qb),e)}var\nc=hy(a,2),d=eO(a,1);return i(z(p_),d,c)}function\nqc(d){return function(a){var\nb=a;for(;;){if(!b)return 0;var\ne=b[2],f=b[1];a:{try{var\nc=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(cd(eM))}function\nqd(a){if(0!==bH(a))return[0,a[1],0];var\nb=a[1][1];return[0,b,[0,p9(a)]]}function\nqe(a){var\nb=qd(a),c=b[2],d=b[1];return c?aM(d,c[1]):d}function\nqf(a){if(a===em)return qg;if(a===g2)return qh;if(a[1]===g1){var\nb=a[2],e=b[3],i=b[2],j=b[1];return f4(z(eN),j,i,e,e+5|0,qi)}if(a[1]===f){var\nc=a[2],g=c[3],k=c[2],l=c[1];return f4(z(eN),l,k,g,g+6|0,qj)}if(a[1]!==b$)return qe(a);var\nd=a[2],h=d[3],m=d[2],n=d[1];return f4(z(eN),n,m,h,h+6|0,qk)}function\nc_(a){var\nb=qc(a);return b?b[1]:qf(a)}function\nql(a){var\nb=[0,A0(a)];return b}function\nqm(c,b){function\na(a){return a?0===c?qn:qo:0===c?qp:qq}if(0!==b[0]){if(b[1])return 0;var\np=a(0);return[0,h(z(qw),p)]}if(b[3]===b[6])var\ne=b[3],d=h(z(qr),e);else\nvar\nn=b[6],o=b[3],d=i(z(qv),o,n);var\nf=b[7],g=b[4],j=b[8]?qs:qu,k=b[2],l=b[9],m=a(b[1]);return[0,AK(z(qt),m,l,k,j,d,g,f)]}function\nqx(a,b){if(!b)return c9(a,qz);var\nd=b[1],e=d.length-2|0,g=0;if(e>=0){var\nc=g;for(;;){var\nf=qm(c,j(d,c)[1+c]);if(f){var\ni=f[1];h(c9(a,qy),i)}var\nk=c+1|0;if(e===c)break;c=k}}return 0}function\nc$(a,b){return qx(a,ql(b))}var\nqC=qB.slice();function\nqD(a,b){var\ne=c_(a);h(eK(qE),e);c$(ah,b);var\nc=BE(0);if(c<0){var\nd=c0(c);g6(j(qC,d)[1+d])}return cb(ah)}var\nqF=[0];function\nhz(a){var\nb=lN(0);return b}function\nqG(a,b){try{var\nd=b?qF:hz(0);try{ep(0)}catch(f){}try{var\nf=qD(a,d),e=f}catch(f){var\ni=P(f),j=hz(0),k=c_(a);h(eK(qI),k);c$(ah,d);var\nl=c_(i);h(eK(qJ),l);c$(ah,j);var\ne=cb(ah)}return e}catch(f){var\nc=P(f);if(c===em)return g6(qH);throw g(c,0)}}gX(ls,function(a,b){try{var\nc=qG(a,b);return c}catch(f){return 0}});function\nqA(a){for(;;){var\nb=cd(eM),c=1-g8(eM,b,[0,a,b]);if(!c)return c}}function\nqK(a){return lN(a)}var\nqM=[r,qL,an(0)];qA(function(a){return a[1]===qM?[0,aM(qN,c_(a[2]))]:0});function\neP(a){var\nb=a[1]<1?1:0,c=b||(64=0){var\nc=i;for(;;){nf(d,c*8|0,cW(j(b,c)[1+c]));var\nn=c+1|0;if(f===c)break;c=n}}au(d,e*8|0,1);var\ng=hA(d);au(d,e*8|0,2);var\nh=hA(d),k=c4(h,8),l=c4(h,0),m=c4(g,8);return hC(a,c4(g,0),m,l,k)}function\nqX(a){var\nb=hB(0);qW(b,a);return b}function\nhE(a){return qX(BU(0))}function\nbP(a){return l1(a)}function\nqY(a){return lV(l1(a))&1073741823}aN([0,function(a){var\nb=bP(a),c=bP(a),d=bP(a);return hD(b,c,d,bP(a))}],function(a){return hD(q2,q1,q0,qZ)});function\nq3(a){var\nb=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var\nAI=l$(ln),hI=AI}catch(f){var\nhF=P(f);if(hF!==a5)throw g(hF,0);try{var\nAH=l$(\"CAMLRUNPARAM\"),hH=AH}catch(f){var\nhG=P(f);if(hG!==a5)throw g(hG,0);var\nhH=q4}var\nhI=hH}var\nq5=ce(nl(hI,82)),q6=aN(0,hE);function\nq7(a,b){var\nc=a;for(;;){if(b<=c)return c;if(eq<(c*2|0))return c;c=c*2|0}}function\nhJ(a,b){var\nd=a?a[1]:cd(q5),c=q7(16,b),e=d?qY(a8(q6)):0;return[0,0,ap(c,0),e,c]}function\nq8(m,b,c,d){var\ng=d.length-1,f=ap(g,0),i=c.length-2|0;function\nn(a){var\nc=a;for(;;){if(!c)return;var\ni=c[1],l=c[2],n=c[3],g=b?c:[0,i,l,0],e=h(m,i),k=j(f,e)[1+e];if(k)k[3]=g;else\nj(d,e)[1+e]=g;j(f,e)[1+e]=g;c=n}}var\no=0;if(i>=0){var\ne=o;for(;;){n(j(c,e)[1+e]);var\nr=e+1|0;if(i===e)break;e=r}}if(b){var\nk=g-1|0,p=0;if(k>=0){var\na=p;for(;;){var\nl=j(f,a)[1+a];if(l)l[3]=0;var\nq=a+1|0;if(k===a)break;a=q}}}}function\nq9(a,b){var\nc=b[2],d=(c.length-1)*2|0,e=d>>0)return;return hQ(a,d)}function\nrh(a){var\nb=nL(a[28]);if(!b)return;var\nc=b[1],d=c[1];a[12]=a[12]-c[3]|0;var\ne=ar(d);a[9]=a[9]+e|0}function\nri(a,b,c){if(typeof\nc===\"number\")switch(c){case\n0:var\nj=bM(a[3]);if(!j)return;var\nk=j[1][1],l=function(a,b){if(!b)return[0,a,0];var\nc=b[1],d=b[2];return Bw(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case\n1:bL(a[2]);return;case\n2:bL(a[3]);return;case\n3:var\nm=bM(a[2]);return m?hQ(a,m[1][2]):db(a);case\n4:var\no=a[10]!==(a[6]-a[9]|0)?1:0;return o?rh(a):o;default:var\np=bL(a[5]);if(p)return eR(a,h(a[25],p[1]));return}switch(c[0]){case\n0:return hP(a,b,c[1]);case\n1:var\nd=c[2],f=c[1],q=d[1],z=d[2],r=bM(a[2]);if(!r)return;var\ns=r[1],e=s[2];switch(s[1]){case\n0:return bQ(a,f);case\n1:return bm(a,d,e);case\n2:return bm(a,d,e);case\n3:return a[9]<(b+n(q)|0)?bm(a,d,e):bQ(a,f);case\n4:return a[11]?bQ(a,f):a[9]<(b+n(q)|0)?bm(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=hO;hR(a);if(b)db(a);return ru(a)}hW(a,0)}}function\neU(a,b,c){var\nd=a[14]=c)return x(a[17],h2,0,c);x(a[17],h2,0,80);c=c-80|0}}function\nrG(a){return a[1]===co?aM(rI,aM(a[2],rH)):rJ}function\nrK(a){return a[1]===co?aM(rM,aM(a[2],rL)):rN}function\nrO(a){return 0}function\nrP(a){return 0}function\neW(a,b,c,d,e){var\ng=eA(0),h=[0,hM,rQ,0];eC(h,g);var\nf=bK(0);eS(f);a7([0,1,h],f);var\ni=78,j=bK(0),k=bK(0),l=bK(0);return[0,f,bK(0),l,k,j,i,10,68,i,0,1,1,1,1,g4,rR,a,b,c,d,e,0,0,rG,rK,rO,rP,g]}function\nh3(a,b){var\nc=eW(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return eV(c,a)};c[20]=function(a){return bR(c,a)};c[21]=function(a){return bR(c,a)};return c}function\nh4(d){return h3(function(a,b,c){return g5(d,a,b,c)},function(a){return cb(d)})}function\ndd(d){return h3(function(a,b,c){return hm(d,a,b,c)},function(a){return 0})}var\neX=dU;function\nh5(a){return bl(eX)}var\nh6=h5(0),eY=h4(en),eZ=h4(ah),rS=dd(h6),h7=aN(0,h5);cm(h7,h6);cm(aN(0,function(a){return dd(a8(h7))}),rS);function\nde(a,b,c,d){return hm(a8(a),b,c,d)}function\ndf(a,b,c){var\nd=a8(b),e=hl(d);g5(a,ck(d),0,e);cb(a);return nO(d)}var\ndg=aN(0,function(a){return bl(eX)}),dh=aN(0,function(a){return bl(eX)}),h8=aN(0,function(a){var\nb=eW(function(a,b,c){return de(dg,a,b,c)},function(a){return df(en,dg,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return eV(b,a)};b[20]=function(a){return bR(b,a)};b[21]=function(a){return bR(b,a)};hs(function(a){return a9(b,a)});return b});cm(h8,eY);var\nh9=aN(0,function(a){var\nb=eW(function(a,b,c){return de(dh,a,b,c)},function(a){return df(ah,dh,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return eV(b,a)};b[20]=function(a){return bR(b,a)};b[21]=function(a){return bR(b,a)};hs(function(a){return a9(b,a)});return b});cm(h9,eZ);function\nrq(a,b){if(a[22]){a7(b,a[4]);h(a[26],b)}var\nc=a[23];return c?cp(a,[0,da,[5,b],0]):c}function\nrw(a,b){return hZ(a,n(b),b)}function\nrx(a,b){hY(a,1);return h(a[18],0)}function\nry(a,b){var\nc=a[14]=0){var\nc=g;for(;;){rX(e,c,a,j(b,c)[1+c]);var\nh=c+1|0;if(f===c)break;c=h}}return e}function\nib(a,b){if(typeof\nb!==\"number\"&&0===b[0])return ia(a,b[1]);return a4(rY)}function\nrZ(a,b,c,d){if(typeof\nc!==\"number\"){if(0===c[0])return ic(c[1],a[1+b],d);return}if(2!==c){a[1+b]=d;return}if(0===bH(d)&&4===d.length-1){var\ne=0,h=a[1+b];for(;;){h[1+e]=d[1+e];var\ni=e+1|0;if(3===e)return;e=i}}throw g([0,f,r0],1)}function\nic(a,b,c){if(0===bH(c)&&a.length-1<=c.length-1){var\ne=a.length-2|0,h=0;if(e>=0){var\nd=h;for(;;){var\ni=c[1+d];rZ(b,d,j(a,d)[1+d],i);var\nk=d+1|0;if(e===d)break;d=k}}return}throw g([0,f,r1],1)}function\nid(a,b,c){if(typeof\na!==\"number\"&&0===a[0])return ic(a[1],b,c);return a4(r2)}var\ne0=[r,r3,an(0)];rV(r4,[0,e0,[0]]);(function(a){throw a});function\ne1(a){return[0,a]}function\nS(a){return[0,a]}function\ndi(a){return 0===a[0]?[0,a[1]]:0}var\nbS=[0,function(a){return a}(0)];function\nbT(a){return[1,0,0,0,a]}function\nk(a,b){return 0===a[0]?[0,h(b,a[1])]:bT([0,a,b])}function\nbU(a,b,c){if(0===a[0]){var\nd=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return bT([1,a,b,c])}function\nie(a){return 0===a[0]?a[1]:bT([4,a,0])}function\nig(a,b,c){switch(c[0]){case\n0:throw g([0,f,r7],1);case\n1:c[3]=[0,b,a,c[3]];return;default:c[2]=[0,b,a,c[2]];return}}function\ne2(a,b){if(!b)throw g([0,f,r8],1);if(b[2]===a)return[0,b[1],b[3]];var\nc=e2(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function\ncr(a,b){switch(b[0]){case\n0:throw g([0,f,r9],1);case\n1:var\nc=e2(a,b[3]),e=c[1];b[3]=c[2];return e;default:var\nd=e2(a,b[2]),h=d[1];b[2]=d[2];return h}}function\nih(a,b,c,d){var\ne=d;for(;;){if(!e)throw g([0,f,r_],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function\ne3(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,r$],1);case\n1:return ih(a,b,c,d[3]);default:return ih(a,b,c,d[2])}}function\nii(a,b){var\nc=b;for(;;){if(!c)throw g([0,f,sa],1);if(c[2]===a)return c[1];c=c[3]}}function\nsb(a,b){switch(b[0]){case\n0:throw g([0,f,sc],1);case\n1:return ii(a,b[3]);default:return ii(a,b[2])}}function\naW(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,sd],1);case\n1:var\nj=d[1];if(typeof\nj===\"number\"&&!j){if(!c)return;if(b[1])return;b[1]=1;return}var\nk=d[4];if(7===k[0]){var\nn=k[2];if(1===n[0]){var\no=n[1];if(typeof\no===\"number\"){if(!o&&c){if(b[1])return;b[1]=1;return}}else if(c)return}}var\nl=d[1];a:{if(typeof\nl===\"number\"&&l){var\ne=1;break a}var\ne=c}d[1]=0;var\nm=d[2];return a<50?jW(a+1|0,b,e,m):p(jW,[0,b,e,m]);default:var\ni=d[1];d[1]=0;if(typeof\ni===\"number\"){if(!i)return;b[1]=2;return}var\nq=i[1];if(c)b[1]=2;return h(d[3],q)}}function\na_(a,b,c){return bI(aW(0,a,b,c))}function\njW(a,b,c,d){if(typeof\nd===\"number\")return;switch(d[0]){case\n0:var\nf=d[1];return a<50?aW(a+1|0,b,c,f):p(aW,[0,b,c,f]);case\n1:var\ng=d[2];a_(b,c,d[1]);return a<50?aW(a+1|0,b,c,g):p(aW,[0,b,c,g]);case\n2:var\nh=d[3],l=d[2];a_(b,c,d[1]);a_(b,c,l);return a<50?aW(a+1|0,b,c,h):p(aW,[0,b,c,h]);case\n3:var\ni=d[4],m=d[3],n=d[2];a_(b,c,d[1]);a_(b,c,n);a_(b,c,m);return a<50?aW(a+1|0,b,c,i):p(aW,[0,b,c,i]);default:var\no=d[1];d[1]=0;var\nk=o-1|0,q=0;if(k>=0){var\ne=q;for(;;){a_(b,c,j(d[3],e)[1+e]);var\nr=e+1|0;if(k===e)break;e=r}}return}}function\nse(a){return i(c9(ah,sf),c$,A9(20))}function\ndj(a,b){var\nc=[0,0];a_(c,a,b);var\nd=2<=c[1]?1:0;return d?se(0):d}function\nae(a){return bT([5,a])}function\nas(a){return a}function\nab(a,b){if(1===a[0]){var\nc=a[4];if(5===c[0]){c[1]=b;return dj(0,a)}}throw g([0,f,sg],1)}function\nbn(a){if(1===a[0]){var\nb=a[4];if(5===b[0])return b[1]}throw g([0,f,sh],1)}function\nbV(a,b,c){var\nk=a,h=b,d=c;for(;;)switch(d[0]){case\n0:return k;case\n1:var\ne=d[2];if(typeof\ne===\"number\")throw g([0,f,sm],1);switch(e[0]){case\n0:if(e[1]!==h)throw g([0,f,sn],1);var\no=0;break;case\n1:var\nB=e[2],C=e[1];if(C===h)var\nD=[0,B];else{if(B!==h)throw g([0,f,so],1);var\nD=[0,C]}var\no=D;break;case\n2:var\nu=e[3],v=e[2],w=e[1];if(w===h)var\nx=[1,v,u];else if(v===h)var\nx=[1,w,u];else{if(u!==h)throw g([0,f,sp],1);var\nx=[1,w,v]}var\no=x;break;case\n3:var\np=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var\nt=[2,r,q,p];else if(r===h)var\nt=[2,s,q,p];else if(q===h)var\nt=[2,s,r,p];else{if(p!==h)throw g([0,f,sq],1);var\nt=[2,s,r,q]}var\no=t;break;default:var\nn=cr(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,sr],1);var\nm=e[2]-1|0;e[2]=m;if(n>>2|0))var\nU=no(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else\nvar\nL=e;var\nJ=L}var\no=J}d[2]=o;if(typeof\no!==\"number\")return k;var\ny=d[1];d[1]=1;var\nl=d[4];switch(l[0]){case\n0:h=d;d=l[1];break;case\n1:var\nM=l[2];k=bV(k,d,l[1]);h=d;d=M;break;case\n2:var\nN=l[2];k=bV(k,d,l[1]);h=d;d=N;break;case\n3:var\nO=l[2];k=bV(k,d,l[1]);h=d;d=O;break;case\n4:var\nz=l[2],A=bV(k,d,l[1]);if(!z)return A;var\nQ=z[1];l[2]=0;k=A;h=d;d=Q;break;case\n5:return k;case\n6:if(typeof\ny===\"number\")return k;var\nR=y[1];try{i(l[2],d,R);return k}catch(f){var\nS=P(f);return[0,[0,S,qK(0)],k]}default:var\nT=l[1];k=bV(k,d,l[2]);h=d;d=T}break;default:throw g([0,f,ss],1)}}function\na$(a,b){var\ne=a,c=b;for(;;)switch(c[0]){case\n0:return;case\n1:var\nn=typeof\nc[2]===\"number\"?1:0,d=c[2];if(typeof\nd===\"number\")var\nk=[0,e];else\nswitch(d[0]){case\n0:var\nk=[1,e,d[1]];break;case\n1:var\nk=[2,e,d[1],d[2]];break;case\n2:var\nk=[3,e,d[1],d[2],d[3]];break;case\n3:var\no=[0,d[1],d[2],d[3],d[4],e,bS,bS,bS],l=0;for(;;){ig(c,l,j(o,l)[1+l]);var\nw=l+1|0;if(4===l)break;l=w}var\nk=[4,5,5,o];break;default:var\ni=d[2];if(i>>1|0)}function\niq(a,b,c){if(typeof\na!==\"number\"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,s2],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,s1],1)}function\nf3(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[2];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,s6],1);e[5]=c;var\ni=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;iq(h,c,d);e$(b,c);return a<50?cG(a+1|0,b,d):p(cG,[0,b,d])}}throw g([0,f,s5],1)}function\ns3(a,b){return bI(f3(0,a,b))}function\nf2(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[4];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,s8],1);e[5]=c;var\ni=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;iq(h,c,d);e$(b,c);return a<50?cG(a+1|0,b,d):p(cG,[0,b,d])}}throw g([0,f,s7],1)}function\ns4(a,b){return bI(f2(0,a,b))}function\njY(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=bX(d[2]);if(e_(bX(d[4]),e)){s4(b,d);break a}}return a<50?f3(a+1|0,b,c):p(f3,[0,b,c])}throw g([0,f,s9],1)}function\njX(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=bX(d[4]);if(e_(bX(d[2]),e)){s3(b,d);break a}}return a<50?f2(a+1|0,b,c):p(f2,[0,b,c])}throw g([0,f,s_],1)}function\ncG(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=bX(c[2]),e=bX(c[4]);return d>>2|0}function\naD(a,b){if(typeof\na===\"number\")var\nc=b;else{if(typeof\nb!==\"number\"){var\nd=dn(b);return[1,(iv(dn(a),d)+1|0)<<2,a,b]}var\nc=a}return c}function\niw(a){return typeof\na===\"number\"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var\nfa=1,fb=2,tE=3;function\nix(a){return-1===a?1:0}function\nfc(a){return-1!==a?1:0}function\nbY(a){return(a&3)===3?1:0}function\niy(a){return(a&3)===1?1:0}function\niz(a){return(a&3)===2?1:0}function\niA(a){return a|3}function\ntF(a){return a>>>2|0}function\niB(a){return a<<2|2}function\ncv(a){return a&mi(tE)}function\niC(a){return a[2]}function\niD(a){return a[3]}function\niE(a){return[0,0,0,0]}function\ndp(a){a[1]=a[1]+1|0}function\ndq(a){a[2]=a[2]+1|0}function\ndr(a){a[3]=a[3]+1|0}function\nfd(a,b,c){var\nd=c;for(;;){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,tH],1);dp(a);dr(a);d[1]=e|3}return}var\nh=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,tI],1);dp(a);dr(a);d[1]=h|3;fd(a,b,d[2]);d=d[3]}}function\nds(a,b,c,d){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1];if(0===(e&c)){dp(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;dr(a);dq(a)}}var\ng=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,dq(a)):h}var\nf=d[1];if(0===(f&c)){dp(a);if(0===(f&3)){d[1]=f|c;eC(d,b)}else{d[1]=-1;dr(a);dq(a);fd(a,c,d[2]);fd(a,c,d[3])}}var\ni=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,dq(a)):j}function\nfe(a,b,c){var\nd=hk(b);if(typeof\nd!==\"number\"&&1===d[0]){var\ne=(d[1]&3)===c?1:0;return e?(ds(a,b,c,d[2]),ds(a,b,c,d[3])):e}throw g([0,f,tJ],1)}function\niF(a,b,c){for(;;){if(eD(b))return;fe(a,b,c)}}function\ntK(a,b,c,d){for(;;){if(eD(c))return iF(b,d,fb);if(eD(d))return iF(a,c,fa);fe(a,c,fa);fe(b,d,fb)}}function\nff(a){var\nb=a[6];a[6]=b+1|0;return b}function\nfg(a){var\nb=a;for(;;){if(typeof\nb===\"number\")return;if(0===b[0]){var\nc=b[1];if(typeof\nc!==\"number\"&&0===c[0]){var\ne=c[1],i=fc(e),l=i?bY(e):i;if(l)c[1]=cv(e);return}throw g([0,f,tP],1)}var\nd=b[1];if(typeof\nd!==\"number\"&&1===d[0]){var\nh=d[1],m=b[4],n=b[3],j=fc(h),k=j?bY(h):j;if(!k)return k;d[1]=cv(h);fg(n);b=m;continue}throw g([0,f,tQ],1)}}function\niG(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;if(0===c[0]){var\nd=c[1];if(typeof\nd!==\"number\"&&0===d[0]){var\ne=d[1],u=c[2];if(!iy(e)){if(ix(e)){var\nk=ff(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=iB(k);return}if(iz(e)){var\nn=tF(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var\nq=bY(e);if(q)throw g([0,f,tT],1);return q}var\nm=a[2];if(-1a[3])throw g([0,f,tS],1)}d[1]=cv(e);return}throw g([0,f,tR],1)}var\nh=c[1];if(typeof\nh!==\"number\"&&1===h[0]){var\nr=c[4],s=c[3],i=h[1],w=c[2];if(ix(i)){var\nl=ff(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=iB(l);fg(s);return fg(r)}if(!iy(i)){if(iz(i)){var\no=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var\nt=bY(i);if(t)throw g([0,f,tW],1);return t}if(-1a[3])throw g([0,f,tV],1)}h[1]=cv(i);iG(a,s);c=r;continue}throw g([0,f,tU],1)}}function\ncw(a,b){if(typeof\nb===\"number\")return 0;if(0!==b[0]){var\ni=b[1];if(-1===i){var\nl=ff(a);b[1]=0;j(a[4],l)[1+l]=b;var\np=cw(a,b[2]);return[1,b,0,p,cw(a,b[3])]}if(!bY(i)){b[1]=cv(b[1]);var\nr=cw(a,b[2]);return[1,b,0,r,cw(a,b[3])]}var\nd=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,tZ],1);var\nm=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var\ne=b[1];if(fc(e)&&bY(e)){var\nc=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var\nn=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var\nfh=[0,0,[0],0,0];function\ntG(a){return a[1]}function\ntL(a){return a[1]}function\ntM(a){return a[2]}function\ntN(a,b){var\nc=iE(0),d=iE(0),e=eA(0),f=eA(0);ds(c,e,fa,a);ds(d,f,fb,b);tK(c,d,e,f);return[0,c,d]}function\ntO(a){if(typeof\na===\"number\")return;if(0===a[0]){a[1]=0;return}var\nb=dn(a[3]);a[1]=(iv(dn(a[2]),b)+1|0)<<2}function\ntX(a){var\ne=a[6]-1|0,h=0;if(e>=0){var\nb=h;for(;;){var\nc=j(a[4],b)[1+b];if(typeof\nc!==\"number\")if(0===c[0])c[1]=iA(c[1]);else\nc[1]=iA(c[1]);var\nd=j(a[5],b)[1+b];if(!d)throw g([0,f,tY],1);if(d[2]){var\ni=cg(d);j(a[5],b)[1+b]=i}var\nk=b+1|0;if(e===b)break;b=k}}}function\niH(a,b,c){if(typeof\nb===\"number\"){if(typeof\nc===\"number\")return[0,fh,0]}else if(b[1]===c)return[0,fh,b];var\nt=typeof\nb===\"number\"?cu:b[1],m=tN(t,c),i=tL(m),n=tM(m),u=iD(n),v=iD(i)+u|0,o=tG(i)-v|0,w=iC(n),p=iC(i)+w|0,x=0,y=ap(p,0),z=ap(p,0),A=a?o:-1,B=a?0:-1,C=a?ap(o,0):[0],d=[0,C,B,A,z,y,x];iG(d,b);if(d[2]!==d[3])throw g([0,f,t0],1);tX(d);var\nq=cw(d,c),r=d[6]-1|0;if(r>=0){var\nh=r;for(;;){tO(j(d[4],h)[1+h]);var\nF=h-1|0;if(0===h)break;h=F}}if(!a)return[0,fh,q];var\nk=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var\ne=D;for(;;){a6(function(a){if(typeof\na!==\"number\")if(0===a[0]){var\nb=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var\nc=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var\nE=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function\nt1(d,b){if(typeof\nb===\"number\")return 0;function\nc(a){a:if(typeof\na!==\"number\"){b:{if(0===a[0]){var\nb=a[1];if(typeof\nb!==\"number\"&&0===b[0]){var\ne=a[2];if(e){var\nj=e[1];break b}var\nk=h(d[1],b[2]);a[2]=[0,k];return k}break a}var\nl=a[2];if(!l){var\nn=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var\nj=l[1]}return j}throw g([0,f,t2],1)}return[0,c(b)]}function\ndt(a,b){return[0,[0,a,b],0]}function\ndu(a){return t1(a[1],a[2])}function\nt3(a,b){var\nc=a[1];return[0,c,iH(0,a[2],b)[2]]}function\nfi(a,b){var\nd=a[1],c=iH(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function\ndv(a,b,c,d){var\ne=[0,d];if(v===a)var\nh=c[1],g=0;else if(km<=a)var\nh=c[2].length-1,g=c[1];else\nvar\nh=c[2].length-1,g=0;var\nk=h-1|0;if(k>=g){var\nf=g;for(;;){var\nl=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var\nm=f+1|0;if(k===f)break;f=m}}if(km>a)a6(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(v!==a)a6(function(a){e[1]=i(b,a,e[1]);return 0},c[4])}function\nfj(a,b,c){if(typeof\nc===\"number\")throw g([0,f,t4],1);if(0===c[0])return h(a,c[2]);var\nd=fj(a,b,c[3]);return i(b,fj(a,b,c[2]),d)}function\nbo(a,b,c){var\nd=b[2],e=b[1],f=di(c);if(f){var\ng=f[1];return typeof\ng===\"number\"?S(e):S(fj(a,d,g))}var\nh=[0,dt(a,d)];return k(c,function(a){var\nb=t3(h[1],a);h[1]=b;var\nc=du(b);return c?c[1]:e})}var\naR=[0,cu,aD];function\nt5(a,b){return dk(b,aR,a)}function\ndw(a){return t5(a,J)}function\niI(a){function\ne(a,b){var\nc=a,d=b;for(;;){if(typeof\nc===\"number\")return d;if(0===c[0])return[0,c[2],d];var\nf=e(c[3],d);c=c[2];d=f}}return e(a,0)}var\niJ=[0,S(0),function(a,b){return bU(a,b,aD)}];function\nfk(c,b){return bo(function(a){return J(h(c,a))},aR,b)}function\nt6(a,b){return ie(bo(b,iJ,a))}function\nbp(a){return t6(a,function(a){return k(a,J)})}var\nbq=e;function\nt7(a){return a[kN]}function\niK(a,b){var\nc=a?a[1]:bq;return Bx(b).join(c)}function\nfl(a){return 0===t7(a)?1:0}function\ndx(a,b){return lL(a,b)}c[\"Number\"];var\nfm=null,t8=undefined;function\ncx(a){return a===fm?1:0}function\nt9(a){return a===t8?1:0}function\nbZ(a){var\nb=cx(a);return b?b:t9(a)}function\niL(a){return 1-bZ(a)}function\ndy(a,b){return bZ(b)?0:[0,h(a,b)]}var\nm=c;function\nfn(a,b){var\nc=a[b];return bZ(c)?0:[0,c]}function\nfo(a){return new\nm[la](a)}function\niM(a){return a[kN]}function\niN(c,b){return hg(iM(b),function(a){return h(c,b[a])})}function\niO(a,b){var\nd=b.length-1,e=fo(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){e[c]=h(a,j(b,c)[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\niP(c,b){return mT(iM(b),function(a){return h(c,b[a])})}function\nfp(f,b){return function(a,b,c){var\ne=a,d=c;for(;;){if(!d)return b;var\ng=d[2];b[e]=h(f,d[1]);e=e+1|0;d=g}}(0,fo(0),b)}function\nub(a,b){var\nc=new\nm[\"Error\"](b);return a?(c[bx]=a[1],c):c}var\nud=Symbol.iterator;function\nuf(a){return a.next()}function\nug(a){var\nb=dy(function(a){return a|0},a[\"done\"]);return b?b[1]:0}function\nuh(a){return a[dT]}function\niQ(i,g,c,d,e){return function(a,b){var\nd=b;for(;;){var\ne=uf(a);if(ug(e))return d;var\nf=uh(e),j=h(g,f[1]);d=x(c,h(i,f[0]),j,d)}}(d,e)}m[\"Promise\"];function\nua(a){return ag(a)}function\nbr(a,b,c){return ef(a,ua(b),c)}function\nay(a){return ag(a)}function\nu(a){return H(a)}function\nb0(a,b){return a\ninstanceof\nb?1:0}var\nt_=true;function\nt$(a,b){a[b]}function\nuc(a,b){return h(function(a){throw a},ub(a,b))}function\nue(a){return a[ud]()}m[\"Event\"];function\ndz(a){return a[f5]}function\niR(a,b,c,d){var\ne=a?a[1]:{},f=bE(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function\niS(a){return h(a,0)}var\nfq=\"change\",cy=\"click\";m[\"ArrayBuffer\"];m[\"DataView\"];function\nui(a){a.preventDefault();return 0}var\nuj=\"DOMContentLoaded\",uk=kt,ul=\"scroll\",um=\"wheel\";m[\"Blob\"];m[\"File\"];var\niT=m[\"JSON\"];m[\"encodeURI\"];m[\"decodeURI\"];m[\"encodeURIComponent\"];m[\"decodeURIComponent\"];m[\"URL\"];m[\"URLSearchParams\"];function\naS(a,b){return[0,a,b]}var\ncz=[0,bq,bq];function\nfr(a){return[0,a,bq]}function\niU(a){return a}var\ncA=lr,fs=kc,iV=bx,iW=kZ,ft=\"type\",fu=dT,iX=fr(dR),uq=\"for\";function\naT(a){return aS(cA,a)}function\niY(a){return aS(uq,a)}var\nut=fr(\"required\");function\ndA(a){return aS(iW,a)}function\niZ(a){return aS(ft,a)}var\nuu=fr(\"selected\"),bs=m[\"document\"];function\nun(a){return iT.stringify(a)}function\nuo(a){try{var\nc=iT.parse(a)}catch(f){var\nb=P(f);if(b[1]===e0)return[1,b[2]];throw g(b,0)}return[0,c]}function\nup(a,b){return a?b:cz}var\nur=\"placeholder\";function\nus(a){return aS(fs,a)}function\nuv(a){return aS(fu,a)}function\nuw(a){return a[\"ownerDocument\"]}if(!bZ(bs))bs[j_];function\nux(a,b){a.appendChild(b);return 0}function\nuy(a,b,c,d){var\ng=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(kZ,iK([0,\";\"],cg(g)));if(0!==f)a.setAttribute(lr,iK([0,aH],cg(f)));return}var\nh=e[2],k=e[1],i=k[2],j=k[1];if(fl(j))e=h;else if(dx(j,iW)){g=[0,i,g];e=h}else if(dx(j,cA)){var\nl=fl(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function\ni0(a,b,c,d){var\nf=a?a[1]:bs,g=b?b[1]:0,e=f.createElement(c);uy(e,0,0,g);a6(function(a){return ux(e,a)},d);return e}function\naU(a,b){var\nc=a?a[1]:bs;return c.createTextNode(u(b))}function\ni1(a,b,c){return fl(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function\ni2(a,b,c){return b?(c[j1].add(a),0):(c[j1].remove(a),0)}var\ni3=\"div\";function\nuI(a,b,c,d){return i0(b,c,a,d)}function\ni4(a,b,c){return uI(i3,a,b,c)}function\ni5(a){return a[j_]}function\ndB(a,b,c){ef(a,b,c);return 0}var\ndC=m[kO];function\ndD(a){return Bt(function(a,b,c){var\ne=b,d=c;for(;;){if(!d)return a;var\nf=d[2];a[e]=d[1];e=e+1|0;d=f}}(fo(0),0,a))}function\naE(a){return dB(dC,uL,dD(a))}function\nb1(a){return dB(dC,uQ,dD(a))}m[kO];m[\"navigator\"];var\nuT=m[\"performance\"],dE=m[lp];t$(m,uU);function\nuz(a,b){ef(a,kK,c5(b))}function\nuA(a,b,c){var\ne=a?a[1]:m[lp],d=e.getComputedStyle(c)[b];return bZ(d)?bq:d}function\nuB(a,b){var\nc=a?a[1]:lm,d=lm<=c?1:0;b.scrollIntoView(!!d);return 0}var\nuC=\"button\",uD=\"form\",uE=kt,uF=\"label\",uG=\"option\",uH=\"select\";function\nuJ(a){var\nb=a[\"body\"];return iL(b)?b:uc(0,\"Document body is null. Try to defer your script execution.\")}function\nuK(a){return dy(function(a){return a},a[\"activeElement\"])}function\nuM(a){return dB(dC,uN,dD(a))}function\nuO(a){return dB(dC,uP,dD(a))}function\nuR(a){return a}function\nuS(a){return a.now()}function\nuV(a,b){return m.setTimeout(bE(1,b),a)}function\nuW(a){m.clearTimeout(a)}function\nuX(a){m.requestAnimationFrame(bE(1,a))}m[\"ClipboardItem\"];m[\"FormData\"];m[\"Headers\"];m[\"Request\"];m[\"Response\"];m[\"fetch\"];m[\"MediaStream\"];m[\"MediaRecorder\"];m[\"MessageChannel\"];m[\"BroadcastChannel\"];m[\"Notification\"];m[\"WebSocket\"];function\nuY(a){return a[\"localStorage\"]}function\nuZ(a,b){function\nc(a){return a}return function(a){return dy(c,a)}(a.getItem(b))}function\nu0(a,b,c){try{a.setItem(b,c);return}catch(f){var\nd=P(f);if(d[1]===e0)return;throw g(d,0)}}function\naz(a,b,c){return[0,a,b,c]}function\ni6(a){var\nb=a[1];return 82===b?g9(di(a[2])):83<=b?g9(di(a[2])):1}function\ndF(a){return c1(di(a))}function\nu1(a){return es(c2(function(a){var\nb=a[1];return 82===b?[0,dF(a[2]),0]:83<=b?iI(dF(a[2])):[0,a[2],0]},a))}function\ni7(a){if(!a)return u2;var\nb=m0(i6,a),c=b[2];return[0,u1(b[1]),c]}var\ni8=kK,fv=\"before\";function\nu5(a){return[0,a]}function\nu6(a,b){return[1,fm,a,b]}var\nu7=\"remove\",u8=\"contains\";function\ni9(a){var\nb=uK(uw(a));return b?br(a,u8,[0,b[1]])|0:0}function\ni_(e,b){var\nc=[0,dt(u5,u6)];return k(b,function(a){var\nb=fi(c[1],a),d=b[2],g=b[1];c[1]=d;dv(v,function(a,b){return 0===a[0]?a[1][dS]=t_:0},g,0);var\nh=i9(e),i=du(d);if(i){var\nf=function(d,b){if(0!==b[0]){if(!cx(b[1]))return b[1];var\nl=f(d,b[3]),k=f(l,b[2]);b[1]=k;return k}var\nc=b[1];delete\nc[dS];if(c.parentNode!==e)if(cx(d))br(e,i8,[0,c]);else\nbr(d,fv,[0,c]);else{var\na=c.nextSibling!==d?1:0;if(a){if(h)var\ng=i9(c),i=g?function(a){for(;;){var\nb=c.nextSibling;if(b===d)return 1;if(cx(b))return 0;br(c,fv,[0,b])}}(0):g;else\nvar\ni=h;var\nj=1-i}else\nvar\nj=a;if(j)if(cx(d))br(e,i8,[0,c]);else\nbr(d,fv,[0,c])}return c};f(fm,i[1])}dv(v,function(a,b){if(0!==a[0])return 0;var\nc=a[1],d=iL(c[dS]),e=d?(delete\nc[dS],br(c,u7,[0]),0):d;return e},g,0);return e})}var\ndG=S(0),fw=[0,bq,bq];function\nu3(a){if(!a)return u4;var\nb=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,k(b[2],J)]]}else\nif(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return mW(i6,a)?[0,es(c2(function(a){var\nb=a[1];return 82===b?[0,dF(a[2]),0]:83<=b?iI(dF(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,dk(function(a){var\nb=a[1];return 82===b?k(a[2],J):83<=b?a[2]:S(J(a[2]))},iJ,a)]]}function\ni$(c,b){function\nd(a){var\nb=a[2],d=a[1];return dx(d,cA)?i2(b,1,c):i1(d,[0,b],c)}function\ne(a){var\nb=a[1],d=a[2];return dx(b,cA)?i2(d,0,c):i1(b,0,c)}function\nh(a){var\nb=[0,fw];return function(a){if(b[1]!==fw)e(b[1]);var\nc=iU(a);d(c);b[1]=c;return 0}}return dk(function(a){var\nb=a[1];if(82===b){var\ni=a[2];return k(i,h(0))}if(83>b)throw g([0,f,u9],1);var\nj=a[2],c=[0,dt(function(a){var\nb=iU(a);d(b);return b},function(a,b){return fw})];return k(j,function(a){var\nb=fi(c[1],a),d=b[2],f=b[1];c[1]=d;dv(v,function(a,b){return e(a)},f,0);du(d);return 0})},[0,dG,function(a,b){return dG}],b)}function\nfx(a,b){return iR(b[1],b[2],b[3],a)}function\nu_(c,b){return dk(function(a){var\nb=a[1];if(82===b){var\nd=[0,0];return k(a[2],function(a){var\nb=d[1];if(b)iS(b[1]);d[1]=[0,fx(c,a)];return 0})}if(83>b)throw g([0,f,u$],1);var\nh=a[2],e=[0,dt(function(a){return fx(c,a)},function(a,b){return a})];return k(h,function(a){var\nb=fi(e[1],a),c=b[2],d=b[1];e[1]=c;dv(v,function(a,b){return iS(a)},d,0);du(c);return 0})},[0,dG,function(a,b){return dG}],b)}function\nja(a,b,c,d,e,f){var\nq=b?b[1]:0,r=c?c[1]:0,s=d?d[1]:function(a){},m=i7(q),l=m[2],t=m[1],n=i7(r),o=n[2],u=n[1],p=u3(f),i=p[2],g=i0(a,[0,t],e,p[1]);h(s,g);if(l)if(i)var\nv=i_(g,i[1]),j=bU(i$(g,l),v,function(a,b){return b});else\nvar\nj=k(i$(g,l),function(a){return g});else\nvar\nj=i?i_(g,i[1]):S(g);a6(function(a){fx(g,a);return 0},u);var\nw=o?bU(u_(g,o),j,function(a,b){return b}):j;return w}function\nb2(a,b,c,d,e,f){return ja(b,c,d,e,a,f)}function\nva(a,b,c,d,e,f){return ja(b,c,d,e,a,0)}function\nfy(a,b,c,d,e){return b2(uC,a,b,c,d,e)}function\nK(a,b,c,d,e){return b2(i3,a,b,c,d,e)}function\nfz(a,b,c,d,e){return va(uE,a,b,c,d,e)}function\njb(a,b,c,d,e){return b2(uF,a,b,c,d,e)}function\nvb(a,b,c,d,e){return b2(uD,a,b,c,d,e)}function\nvc(a,b,c,d,e){return b2(uG,a,b,c,d,e)}function\nvd(a,b,c,d,e){return b2(uH,a,b,c,d,e)}function\ndH(a,b){return b=c)return vu;if(b===kR)return vt;if(b===\"cyan\")return vs;if(b===lf)return vr;if(b===\"magenta\")return vq;if(b===lj)return vp;if(b===\"reset\")return vo;if(b===\"white\")return vn;if(b===\"yellow\")return vm}else{if(b===\"Black\")return vD;if(b===\"Blue\")return vC;if(b===\"Cyan\")return vB;if(b===\"Green\")return vA;if(b===\"Magenta\")return vz;if(b===\"Red\")return vy;if(b===\"White\")return vx;if(b===\"Yellow\")return vw;if(b===\"black\")return vv}throw g(fB,1)}function\nje(a,b){a7(b,a);return vF}function\njf(a){try{nF(a);nG(a)}catch(f){var\nb=P(f);if(b!==ez)throw g(b,0)}return vG}var\njg=[r,vH,an(0)],vE=0;function\nvI(a,b,c){if(c[1]===jg)return je(a,c[2]);if(c[1]!==co)return h(b,c);var\ne=c[2];try{var\nf=je(a,jd(e));return f}catch(f){var\nd=P(f);if(d===fB)return h(b,c);throw g(d,0)}}function\nvJ(a,b,c){if(c[1]===jg)return jf(a);if(c[1]!==co)return h(b,c);var\ne=c[2];try{jd(e)}catch(f){var\nd=P(f);if(d===fB)return h(b,c);throw g(d,0)}return jf(a)}function\nvK(a){var\nc=bK(0);rr(a,1);var\nb=rs(a,0),d=b[2],e=b[1];return rt(a,[0,function(a){return vI(c,e,a)},function(a){return vJ(c,d,a)},b[3],b[4]])}function\nvL(a,b){var\nd=bl(64),c=dd(d),e=a?vE:a;if(e)vK(c);return rU(function(a){a9(c,0);return ck(d)},c,b)}function\nvM(a){return vL(1,a)}function\nvN(a,b){return m2(a,b)}function\nvO(a){try{var\nc=[0,lX(a)];return c}catch(f){var\nb=P(f);if(b[1]===b_)return 0;throw g(b,0)}}function\nvP(a){return a|0}function\nfC(a,b){return b?[0,h(a,b[1])]:0}function\nvQ(a,b,c){return c?h(b,c[1]):a}function\nvR(a,b){if(b)return h(a,b[1])}function\nvS(a,b){return b?b[1]:a}function\nvT(a,b){return a?a[1]:b}function\nvU(a){return a?[0,a[1],0]:0}function\nvV(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function\nvW(a,b){return vV(b,a)}function\nvX(a){var\nb=ny(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[38],,,,,,,,,,,b[10]]}function\nvY(a){var\nb=vX(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function\nvZ(e,b){var\nd=n(e);if(dH(d,n(b)))return 0;var\nf=n(b)-d|0;return function(a){var\nc=a;for(;;){if(ve(c,d))return 1;if(_(b,f+c|0)!==_(e,c))return 0;c=c+1|0}}(0)}function\nfD(a,b){return vZ(a,b)?[0,ew(b,0,n(b)-n(a)|0)]:0}function\nv0(a){return a[\"height\"]}function\nv1(a){return a}function\nv4(a){switch(a){case\n0:return v5;case\n1:return v6;default:return v7}}function\nv2(a){return v1(a[\"contentRect\"])}function\nv3(a){a[f5]}function\nv8(a,b,c){var\nd=b?[0,c,{box:u(v4(b[1]))}]:[0,c];ef(a,\"observe\",d);return 0}function\nv9(c){return new\nm[\"ResizeObserver\"](function(a,b){return i(c,iP(function(a){return a},a),b)})}var\nv_=j8,v$=\"pattern\",jh=vY([0,ex]);function\nwa(a,b){h(a,b);return b}function\nwb(a){var\nb=fD(wc,a);if(b){var\nc=b[1],d=vO(c);if(d)return[0,[0,d[1]]];var\ng=function(a){return[0,a]};return function(a){return fC(g,a)}(fA(c))}var\ne=fD(wd,a);if(e){var\nh=function(a){return[1,a]};return function(a){return fC(h,a)}(fA(e[1]))}var\nf=fD(we,a);if(!f)return 0;function\ni(a){return[1,a]}return function(a){return fC(i,a)}(fA(f[1]))}function\nji(a){switch(a[0]){case\n0:var\nb=a[1];return h(z(wf),b);case\n1:var\nc=a[1];return h(z(wg),c);default:var\nd=a[1];return h(z(wh),d)}}function\njj(a){var\nc=a?a[1]:i5(bs);function\nb(a){var\nb=wb(ag(uA(0,\"font-size\",a)));if(!b)return 16.;var\nc=b[1];return 0===c[0]?c[1]:a4(wi)}return function(a){switch(a[0]){case\n0:return a[1];case\n1:var\nd=a[1];return d*b(i5(bs));default:var\ne=a[1];return e*b(c)}}}function\nwj(e,b,c,d){function\nf(a,b){return x(e,b[1],b[2],a)}function\ng(a,b){return bU(d,a,b)}return function(a){return g(a,f)}(bU(b,c,function(a,b){return[0,a,b]}))}var\nwm=[r,wl,an(0)],wo=[r,wn,an(0)];function\nfE(a){return[0,0]}function\nfF(a,b){if(a[1])throw g(wo,1);a[1]=[0,b];return 0}function\nfG(a){var\nb=a[1];if(b)return b[1];throw g(wm,1)}function\nwk(a,b,c){return wj(function(a,b,c){return[0,a,b,c]},a,b,c)}function\nwp(a){return un(a)}function\nwq(a){var\nb=uo(a);return 0===b[0]?[0,b[1]]:(uM([0,b[1],0]),wr)}var\njk=uY(dE);function\njl(c,b){return function(a){return u0(jk,c,a)}(wp(b))}function\nws(a){var\nb=uZ(jk,a);function\nc(a){return wq(a)}var\nd=b?[0,b[1]]:wt;return vW(d,c)}function\nwu(a,b){var\nc=ws(a);if(0===c[0])return c[1];var\nd=c[1];return typeof\nd===\"number\"?h(b,0):(uO([0,d[2],0]),h(b,0))}function\nwv(d,b){jl(d,b);var\na=ae(b),c=e4(0,as(a));e5(c,function(a){jl(d,bW(c));return 0});bW(c);return a}function\nww(a,b){var\nc=H(a);return wv(c,wu(c,b))}function\njm(a,b){return ww(a,function(a){return b})}var\nwy=jh[49],wx=jh[29];function\nwz(a){return c2(function(a){return[0,80,aT(H(a))]},wy(a))}var\nwA=0;function\nba(d,b,c){var\na=b[1],e=82===a?[0,82,k(b[2],function(a){return function(a){return aS(d,a)}(H(a))})]:83<=a?a4(wD):[0,80,function(a){return aS(d,a)}(H(b[2]))];return[0,e,c]}function\nfH(d,b,c){return b?[0,[0,80,function(a){return aS(d,a)}(H(b[1]))],c]:c}function\njn(a,b){var\nc=b[1];return 82===c?[0,82,k(b[2],a)]:83<=c?[0,83,fk(a,b[2])]:[0,80,h(a,b[2])]}function\nwF(a){return 0===a[0]?aT(H(a[1])):a[1]}function\nfI(a,b){return[0,jn(wF,a),b]}function\nak(a){return fI(a,0)}function\ncB(a,b){return fI(a,b)}function\nwB(a,b){var\nd=wz(b[1]),e=b[2],c=function(a){return bJ(e,a)}(d);return a?[0,[0,80,us(H(a[1]))],c]:c}function\nwC(a){return[0,wx(a),wA]}function\nwE(a,b,c){return b?[0,[0,80,a],c]:c}function\nwG(a){return fI(jn(function(a){return[0,a]},a),0)}function\nwH(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):uB(0,b[1])}function\nwI(a,b,c,d,e){var\ng=a?a[1]:0,h=b?b[1]:0,f=ae(1),i=cB(wJ,cB([0,82,k(as(f),function(a){return a?[1,aT(\"locked\")]:[1,cz]})],g)),j=wG(wK),l=[0,[0,80,az(0,cy,function(a){return ab(f,1)})],0],m=K(0,[0,j],[0,l],0,[0,[0,82,fy(0,0,0,0,[0,[0,80,aU(0,wL)],0])],0]),n=az(0,um,function(a){var\nb=bn(f);return b?ab(f,0):b});return K(0,[0,i],[0,[0,[0,80,n],h]],c,[0,[0,82,k(wk(e,as(f),d),function(a){var\nb=a[1],c=a[3];if(a[2])vR(function(a){return wH(b,a)},c);return b})],[0,[0,82,m],0]])}function\ndI(a,b){return typeof\nb===\"number\"?0:0===b[0]?[0,h(a,b[1])]:[1,b[1]]}function\nwM(e,b,c){var\nd=ae(c);return[0,az(0,b,function(a){return ab(d,h(e,dz(a)[dT]))}),d]}function\njo(a,b,c,d,e,f,g,h,i,j){var\nl=d?d[1]:0,m=f?f[1]:0,n=function(a){return fH(v$,h,a)}(function(a){return wE(ut,m,a)}([0,[0,80,iZ(H(i))],l])),o=vT(b,function(a){return[0,a]}),k=wM(a,g,j),p=k[2],q=k[1];return[0,fz(c,[0,n],[0,[0,[0,80,q],vU(e)]],0,0),p,o]}function\ndJ(a,b,c,d,e,f,g,h){var\ni=c?c[1]:0,j=function(a){return fH(fu,h,a)}(function(a){return fH(ur,g,a)}(i));return jo(ay,a,b,[0,j],d,e,uk,f,wO,vS(wN,h))}function\ndK(a,b,c,d){var\ne=b?b[1]:0;return jo(function(a){return 0},0,a,[0,ba(fu,d,e)],c,0,fq,0,wP,0)}function\naF(a,b){return k(a,function(a){return[0,a,b]})}function\ndL(a,b,c,d,e){var\ni=[0,[0,cu,function(a){return a}],function(a,b){var\nc=b[2],d=a[2];return[0,aD(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function\nj(a){var\nb=a[1],c=a[2];function\nd(a){var\nc=bn(b[2]);return h(b[3],c)}return[0,J(b[1]),function(a){var\nb=d(0);return h(h(c,a),b)}]}var\nf=function(a){return bo(j,i,a)}(bp(d[2])),g=[0,82,k(f,function(a){var\nb=a[2];return az(0,v_,function(a){h(e,h(b,d[1]));return ui(a)})})],l=k(f,function(a){return a[1]}),m=vQ([0,g,0],function(a){return mO(g,a)},c);return vb(a,b,[0,m],0,[0,[0,83,bp(l)],0])}function\njp(a,b){return a?h(z(wQ),b):b}function\nwR(a,b,c,d,e,f){var\nm=a?a[1]:1,n=b?b[1]:0,o=c?c[1]:0,l=d?d[1]:function(a){return function(a){return 0}},j=jp(1,e[1]),p=jp(0,e[1]),g=m?jm(j,e[2]):ae(e[2]),q=bn(g);h(h(l,1),q);var\nr=e[3];jb(0,[0,[0,[0,80,iY(H(j))],0]],0,0,r);var\ns=[0,80,p],t=function(a){return ba(ft,wS,a)}(function(a){return ba(iV,s,a)}(ba(fs,[0,80,j],n))),u=[0,[0,80,az(0,fq,function(a){var\nb=ay(dz(a)[dT]);i(l,0,b);return ab(g,b)})],o];return[0,vd(0,[0,t],[0,u],0,[0,[0,83,bp(fk(function(a){var\nb=a[1],c=a[2],d=ak([0,80,[1,uv(H(b))]]),e=cB([0,82,k(as(g),function(a){return[1,up(vi(a,b),uu)]})],d);return vc(0,[0,e],0,0,[0,[0,80,aU(0,c)],0])},f))],0]),,g]}function\nwT(a,b,c,d,e,f,g){var\nm=b?b[1]:0,n=c?c[1]:function(a){},j=h(vM(wU),d);function\nl(a){return a?[0,e]:0}a:{if(a&&a[1]){var\no=jm(j,l(g)),i=o;break a}var\ni=ae(l(g))}var\np=jb(0,[0,[0,[0,80,iY(H(j))],0]],0,0,f),q=[0,80,d],r=function(a){return ba(ft,wV,a)}(function(a){return ba(iV,q,a)}(ba(fs,[0,80,j],0))),s=[0,[0,82,k(as(i),function(a){return a?iX:cz})],r];return[0,K(0,0,0,0,[0,[0,82,fz(0,[0,s],[0,[0,[0,80,az(0,fq,function(a){var\nb=l(dz(a)[dR]|0);h(n,b);return ab(i,b)})],m]],0,0)],[0,[0,82,p],0]]),i]}function\nwW(a){return[0,,,function(a){}]}function\nwX(a){var\nb=wW(a);return[0,function(a){b[3].call(null,0);b[3].call(null,0)}]}function\nwZ(a){return bo(function(a){return J(K(0,0,0,0,a[3]))},aR,a)}function\nw0(a){return e6(bo(function(a){return a[2]},[0,w4,function(a,b){return i(z(w3),a,b)}],a),function(a){return i(z(w2),w1,a)})}jj(0)(w8);function\nwY(a,b,c){return[0,a,b,c]}function\nw5(a){return w0(a[1][1])}function\nw6(a){var\nb=ji(a[2]),c=[0,[0,80,aT(kT)],0],d=[0,[0,80,aT(\"lwdui-lazy-table-header\")],c],e=[0,[0,80,dA(H(h(z(w7),b)))],d];return K(0,[0,e],0,0,[0,[0,83,bp(wZ(a[1][1]))],0])}var\nw9=wX([0,vN]),dM=B2(0);function\nw_(e,b,c,d){var\ns=d[3],t=d[2],l=fE(0),m=fE(0),n=ji(e[2]),v=h(z(xa),n),w=ct(function(a,b){return J([0,e9(a),a,s])},aR,t);hJ(0,2048);(function(a){return w9[1].call(null,50)}(0));var\nf=ae(0),a=S(function(a){return a}),g=e4(0,r5(a,as(f)));e5(g,function(a){var\nb=bW(g);return b[2]?h(b[1],0):0});bW(g);function\nu(a){return i(z(w$),n,a)}function\nj(a){var\nb=[0,aT(\"row_spacer\"),0];return i4(0,[0,[0,dA(H(u(a))),b]],0)}var\nx=k(bo(function(a){var\nb=a[1],c=a[3],d=a[2],e=ba(cA,xb,0),f=[0,80,dA(H(v))];return b?[0,0,J(K(0,[0,[0,f,e]],0,0,[0,[0,83,bp(i(c,d,b[1]))],0])),0]:[0,1,cu,0]},[0,[0,0,cu,0],function(a,b){var\nf=b[3],g=b[2],c=b[1],d=a[3],e=a[2],h=a[1],k=iw(e),i=iw(g);if(typeof\nk===\"number\")return typeof\ni===\"number\"?[0,((h+d|0)+c|0)+f|0,e,0]:[0,(h+d|0)+c|0,g,f];if(typeof\ni===\"number\")return[0,h,e,(d+c|0)+f|0];var\nl=dH(d+c|0,0)?function(a){return aD(e,a)}(aD(J(S(j(d+c|0))),g)):aD(e,g);return[0,h,l,f]}],w),function(a){var\nb=a[3],c=a[2],d=a[1],e=dH(d,0)?aD(J(S(j(d))),c):c;return dH(b,0)?aD(e,J(S(j(b)))):e}),y=w6(e),A=v9(function(a,b){var\nd=mP(a);v3(d);var\nc=v0(v2(d)),e=bn(f);return e?vf(e[1],c)?ab(f,[0,c]):0:ab(f,[0,c])}),B=ak(xc),o=K(0,[0,B],0,[0,function(a){return fF(l,a)}],[0,[0,83,bp(x)],0]),p=ak(xd),q=[0,[0,82,k(a,function(c){return az(0,ul,function(a){var\nd=[0,0.],b=[0,-1];function\ne(e){var\na=800,f=uS(uT);if(vg(b[1],0))uW(b[1]);b[1]=uV(a,function(a){return h(c,e)});var\ng=vh(f-d[1],a);return g?(d[1]=f,h(c,e)):g}fG(m);(function(a){return e(a)}(0));return 0})})],0];function\nr(a){return fF(m,a)}var\nC=c?wI([0,p],[0,q],[0,r],k(c[1],function(a){var\nb=fG(l),c=e[2];return[0,[0,cX(a,vP(jj([0,b])(c)))]]}),o):K(0,[0,p],[0,q],[0,r],[0,[0,82,o],0]);function\nD(a){return v8(A,0,a)}function\nE(a){return wa(D,a)}var\nF=function(a){return k(a,E)}(C),G=wB(0,wC(xe));return K(0,[0,[0,[0,82,k(w5(e),function(a){return dA(H(a))})],G]],0,0,[0,[0,82,y],[0,[0,82,F],0]])}var\nfJ=hj([0,ex]),fK=dM[\"Text\"],fL=dM[la],fM=dM[\"Map\"],b3=ib(xj,xi),bb=ib(xl,xk);function\nxf(a,b){return[0,a,b]}function\njq(a){return b0(a,fL)?[0,aX,a]:b0(a,fM)?[0,v,a]:b0(a,fK)?[0,bz,a]:[0,U,a]}function\nxm(a){var\nb=fn(a,xn);if(b)return[0,b[1]];var\nc=fn(a,xo);if(c)return[1,iN(jq,c[1])];var\nd=fn(a,xp);if(d)return[2,d[1]];throw g([0,f,xq],1)}id(xr,b3,[0,function(a){return new\nfL},function(a,b,c){a.insert(b,iO(function(a){var\nb=a[1];return bz<=b?aX<=b?a[2]:a[2]:v<=b?a[2]:a[2]},c));return 0},function(a,b,c){a.delete(b,c);return 0},function(a,b){a.push(iO(function(a){var\nb=a[1];return bz<=b?aX<=b?a[2]:a[2]:v<=b?a[2]:a[2]},b));return 0},function(a,d){a.forEach(function(a,b,c){return x(d,b,jq(a),c)});return 0},function(a,b){function\nc(a){return h(b,xf(xm,a))}a.observe(c);return c}]);function\nfN(a){return b0(a,fL)?[0,aX,a]:b0(a,fM)?[0,v,a]:b0(a,fK)?[0,bz,a]:[0,U,a]}function\njr(a,b){return function(a){return dy(fN,a)}(a.get(u(b)))}function\nxs(a){return a}function\nxt(a){return xs(a[f5])}function\nxu(a){var\nb=ay(a[\"action\"]);if(b!==\"add\")if(b!==k5){if(b!==\"update\")throw g([0,b9,h(z(xv),b)],1);var\nc=1}else\nvar\nc=2;else\nvar\nc=0;var\nd=a[\"oldValue\"],e=bZ(d)?0:[0,fN(d)];return[0,c,0,e]}function\njs(a){return ue(a.entries())}id(xw,bb,[0,function(a){return new\nfM},[0,function(d){var\na=d[kb][\"keys\"].entries();return iQ(ay,xu,function(a,b,c){var\ne=jr(xt(d),a);return fJ[2].call(null,a,[0,b[1],e,b[3]],c)},a,fJ[1])}],jr,function(a,b,c){var\nd=c[1],e=bz<=d?aX<=d?c[2]:c[2]:v<=d?c[2]:c[2];a.set(u(b),e);return 0},function(a,b){a.delete(u(b));return 0},js,function(a,d,c){return iQ(ay,fN,function(a,b,c){return x(d,a,b,c)},js(a),c)},function(a,b){function\nc(a){return h(b,a)}a.observe(c);return c}]);var\nxx=dM[\"Doc\"];function\njt(a,b){return a.getArray(u(b))}function\nbt(a,b){a.transact(bE(1,b));return 0}function\nfO(a){return a}var\nal=bb[4],aV=bb[3],cC=bb[1],dN=b3[5],fP=b3[4],ju=b3[3],jv=b3[1];function\nxg(a){var\nb=a[1];return[0,function(a){return iN(b,a)}(a[2][kb][\"delta\"])]}function\nxh(a,b){var\nc=a?[0,u(a[1])]:[0];return lZ(fK,c)}function\nxy(a){return new\nxx}var\nxz=bb[8],xA=bb[7],xB=bb[5],xC=bb[2][1],xD=b3[6];function\nxE(a){return a}var\nxF=BW(0)[\"Awareness\"];function\nxH(a,b,c){a.setLocalStateField(u(b),c)}function\njw(a){return a}function\nxG(a){return new\nxF(fO(a))}function\nxI(a,b,c,d){if(c)var\nf=[0,xJ,u(c[1])],e=[0,[0,xK,u(b)],f];else\nvar\ne=[0,[0,xM,u(b)]];return xH(a,xL,gS(e))}var\nxN=BX(0);function\nxO(a,b){var\nc=fO(b);new\nxN(u(a),c)}var\nxP=B0(0);function\nfQ(a,b,c){switch(b){case\n0:a.on(u(xW),bE(1,function(a){return h(c,[0,a[\"connected\"]|0])}));return;case\n1:a.on(u(xX),bE(1,function(a){return h(c,[0,a[lh]|0])}));return;default:a.on(u(x2),bE(1,function(b){function\na(a){return function(a){return iP(ay,a)}(b[a])}var\nd=a(xY),e=a(xZ),f=a(x0);return h(c,[0,a(x1),f,e,d])}));return}}function\nxQ(a,b,c,d){var\nf=cf(function(a){return[0,xR,fp(u,a)]},b),e=[0,[0,xU,{config:{iceServers:fp(function(a){return a},c2(function(a){return{urls:u(h(z(xT),a))}},xS))}}]];aE([0,e,0]);function\ng(a){return a}var\ni=gS(c5(function(a){return g$(g,a)}([0,f,[0,e,[0,cf(function(a){return[0,xV,jw(a)]},c),0]]]))),j=fO(d);return new\nxP(u(a),j,i)}var\njx=BY(0),x3=BZ(0);function\nx5(a){switch(a){case\n0:var\nb=x6;break;case\n1:var\nb=x7;break;case\n2:var\nb=x8;break;case\n3:var\nb=x9;break;default:var\nb=x_}return u(b)}function\nx4(a,b){jx.register(u(a),b)}function\nx$(a,b,c,d){var\ne=a?a[1]:0,f=e?ya:yd,g=cf(function(a){return[0,yb,!!a]},b),h=gS(c5(g$(function(a){return a},[0,g,[0,cf(function(a){return[0,yc,fp(x5,a[1])]},c),0]])));return{theme:u(f),modules:h}}function\nye(a,b){return new\njx(a,b)}function\nyf(a){return a}var\nyg=B1(0)[\"QuillBinding\"];function\nyh(a,b,c){var\nd=mE(cf(jw,a)),e=[0,yf(c),d];function\nf(a,b){lZ(a,b)}return function(a){return f(yg,a)}(c5([0,xE(b),e]))}function\nyi(a,b,c){return x(eL(s,yj),b,c,a)}function\njy(a,b,c){var\nd=0<=c?1:0;if(d)var\ne=0<=b?1:0,f=e?(b+c|0)<=a?1:0:e;else\nvar\nf=d;var\ng=1-f;return g?yi(a,b,c):g}var\nyk=[0];function\nyl(a,b,c,d){var\ne=ap(a,b);ci(c,0,e,0,d);return e}function\njz(a,b){return b<=a?a:b}function\njA(a){return eL(s,a)}function\nym(a,b){var\nc=a[1];return i(jA(yn),b,c)}function\nyo(a,b){return i(jA(yp),a,b.length-1)}function\ncD(a,b){var\nc=1-(a<=b.length-1?1:0);return c?yo(a,b):c}function\njB(a){return[0,0,0,yk]}function\ncE(a){return a[1]}function\nyq(a,b){return a[3][1+b]}function\njC(a){var\nb=a[1],c=a[3];cD(b,c);if(0>>4|0)));var\nf=b+1|0;function\ni(a,b,c){au(a,b,c)}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var\nn=D(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var\nm=D(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var\nl=D(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var\nk=D(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return $(e);var\nj=D(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}var\nyD=hE(0),am=xy(0),fS=xG(am);x4(yF,x3);xI(fS,yG,0,0);var\ndO=xQ(yI,yH,[0,fS],am);xO(yJ,am);dE[\"yjsdoc\"]=am;dE[\"yjsprovider\"]=dO;var\nfT=ae(0),jF=ae(0),jG=ae(0);fQ(dO,0,function(a){var\nb=a[1];b1([0,yK,[0,!!b,0]]);return ab(jF,b)});fQ(dO,1,function(a){var\nb=a[1];b1([0,yL,[0,!!b,0]]);return ab(jG,b)});var\ndP=[0,0];fQ(dO,2,function(a){b1([0,yM,[0,a,0]]);function\nc(b){return mX(function(a){return ey(b,a)},a[3])}function\nd(b){var\nc=[0,0];dP[1]=g_(function(a){return ey(b,a)?(c[1]=[0,b],1):0},dP[1]);return c[1]}var\nb=et(function(a,b){if(d(b))return a;if(c(b))dP[1]=[0,b,dP[1]];return a+1|0},0,a[1]),e=er(a[2]);return function(a){return ab(fT,a)}((bn(fT)+b|0)-e|0)});var\nyQ=as(jG),yS=cB(yR,ak([0,82,bU(as(jF),yQ,function(a,b){var\nc=a?b?yN:yO:yP;return[0,c]})])),yU=K(0,[0,yS],0,0,[0,[0,80,aU(0,yT)],0]),yV=[0,[0,82,yU],[0,[0,82,k(as(fT),function(a){return aU(0,mm(a))})],0]];function\nyE(a){return yA(yD,0)}function\nyY(a,b){var\nc=a?a[1]:64,d=im(0);return[0,d,hJ(0,c)]}function\njH(a,b,c){var\ne=hK(a[2],b);if(e)var\nd=e[1];else{var\ng=e8(0,a[1]);hL(a[2],b,g);var\nd=g}var\nf=e9(d);return f?ab(f[1][2],[0,c]):sV(d,[0,b,ae([0,c])])}function\nfU(a,b){var\nc=hK(a[2],b);if(c)var\nd=c[1];else{var\nf=a[1],e=e8([0,[0,b,ae(0)]],f);hL(a[2],b,e);var\nd=e}return as(c1(e9(d))[2])}function\nfV(a,b){return k(fU(a,b),function(a){if(!a)return 0;var\nb=a[1];if(typeof\nb!==\"number\"&&U===b[1])return[0,ay(b[2])];throw g([0,f,yZ],1)})}function\ny0(a){var\nb=im(0);return[0,b,jB(0)]}function\ny1(a){try{var\nc=[0,jE(a[2],0)];return c}catch(f){var\nb=P(f);if(b[1]===b9)return 0;throw g(b,0)}}function\njI(a,b){var\nc=e8(a,b[1]);return yt(b[2],c)}function\njJ(a,b,c,d){var\ne=[0,b,[0,c,[0,cE(d),0]]];b1([0,y2,[0,cE(a),e]]);var\nf=cE(d),g=jE(a,0);fR(d,hg(c,function(a){return g}));return yx(a,b,d,f,c)}function\ny3(i,b,c){var\ne=[0,0],j=i[2],d=jB(0);hh(function(a){switch(a[0]){case\n0:var\nm=a[1];jJ(j,e[1],m,d);e[1]=e[1]+m|0;return 0;case\n1:var\nc=a[1];if(0!==cE(d)){var\no=[0,jC(d)];return fR(d,hi(function(a){var\nd=h(b,a),c=sR([0,d],o[1]);o[1]=c;return c},c))}var\nn=y1(i);if(!n)return hh(function(a){var\nc=h(b,a);return jI([0,c],[0,i[1],d])},c);var\ns=n[1];return fR(d,hi(function(a){return sP([0,h(b,a)],s)},c));default:var\nk=a[1],t=0===e[1]?tx(i[1]):iu(jC(d)),p=[0,t],u=1;if(k>=1){var\nl=u;for(;;){var\nq=p[1];if(!q)throw g([0,f,y4],1);var\nr=q[1];p[1]=iu(r);sY(r);var\nv=l+1|0;if(k===l)break;l=v}}e[1]=e[1]+k|0;return 0}},c);var\nk=e[1],a=cE(j)-k|0;if(0