From 41a016a9534b7e362498420b1d39f8890611c44a Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 12:32:11 -0500 Subject: [PATCH 001/263] Update README.md --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 59a835b7..aa76563a 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# pointR - -**pointR** is an R package providing a *shiny-based* minimalist ide for R scripting using svgR +# pointR and ptR + +- **pointR** is an R package providing a *shiny-based* minimalist ide for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning. +- **ptR** is an **electron** wrapper around **pointR**. Using **electron** + - Removes the dependency on the local browser + - Provides independent windows for help + - Provides an integrated approach for building **shiny custom inputs** + - Prepackaged installations **ptR** are readily available for *mac* and *linux* (dmg and deb). - ***Videos on pointR*** can be found at http://mslegrand.github.io/pointRmedia/. - ***Related information*** can be found at http://mslegrand.github.io/svgR/. - ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki -## Some Points on PointR +## Installation + +We strongly recommend installing **ptR** from one of the installations packages. Prior to installation, you may want to +consider installing **pandoc** and the R package **tidyverse**. Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. + +## Some Points on pointR - pointR is a shiny server application - pointR uses the ACE editor for coding - pointR is intended to ease the writing of R scripts using svgR. - pointR is an attempt to bridge the gap between coding and point&click. - svgR bridges the gap between R and SVG -## Try Out -- runGitHub("pointR", "mslegrand") - -# Installation -- install.packages("devtools") -- library(devtools) -- install_github("shiny", "rstudio") -- install_github("shinyAce", "trestletech") -- install_github("shinyjs", "daattali") -- install_github("svgR", "mslegrand") # Reporting issues Please report any bugs/issue in the From 79561887383a62a5eb49e8242fc54841dcf20e28 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 12:37:59 -0500 Subject: [PATCH 002/263] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa76563a..86617763 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ - Removes the dependency on the local browser - Provides independent windows for help - Provides an integrated approach for building **shiny custom inputs** - - Prepackaged installations **ptR** are readily available for *mac* and *linux* (dmg and deb). + - Prepackaged installations **ptR** are readily available for *mac* and *linux* (dmg and deb). These can be found on the release page https://github.com/mslegrand/ptR/releases - ***Videos on pointR*** can be found at http://mslegrand.github.io/pointRmedia/. - ***Related information*** can be found at http://mslegrand.github.io/svgR/. - ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki ## Installation -We strongly recommend installing **ptR** from one of the installations packages. Prior to installation, you may want to +We strongly recommend installing **ptR** from one of the installations packages found at https://github.com/mslegrand/ptR/releases. Prior to installation, you may want to consider installing **pandoc** and the R package **tidyverse**. Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. ## Some Points on pointR From aca4cabb8778ff2fc15426764a5a652f5f37a6b6 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 12:39:16 -0500 Subject: [PATCH 003/263] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86617763..fc5ee6c1 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,12 @@ ## Installation -We strongly recommend installing **ptR** from one of the installations packages found at https://github.com/mslegrand/ptR/releases. Prior to installation, you may want to -consider installing **pandoc** and the R package **tidyverse**. Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. +We strongly recommend installing **ptR** from one of the installations packages found at https://github.com/mslegrand/ptR/releases. + +Prior to installation, you may want to +consider installing **pandoc** and the R package **tidyverse**. + +Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. ## Some Points on pointR - pointR is a shiny server application From 2d5945bb15ca2a5cfa3100d45743323027e030df Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 13:06:50 -0500 Subject: [PATCH 004/263] rework shinyInputControl template --- .../.workspace/PTR-TABID1b8a789c513.rda | Bin 1074 -> 0 bytes .../.workspace/PTR-TABID41cd6cdad2c7.rda | Bin 1605 -> 0 bytes .../.workspace/PTR-TABID704c2e20c007.rda | Bin 1705 -> 0 bytes .../.workspace/PTR-TABIDa9527235bba.rda | Bin 1362 -> 0 bytes .../shinyInput/.workspace/currentTab.rda | Bin 72 -> 0 bytes inst/App/projectTemplates/shinyInput/app.R | 39 -- .../projectTemplates/shinyInput/circularArc.R | 36 -- .../projectTemplates/shinyInput/pieShape.R | 36 -- .../projectTemplates/shinyInput/pieShape2.R | 38 -- .../shinyInput/shinyInputCntrl.R | 104 ---- .../shinyInput/shinyInput_svg.R | 69 --- inst/App/projectTemplates/shinyInput/test.SVG | 11 - .../shinyInput/www/shinyInput.js | 78 --- .../.workspace/PTR-TABID41cd6cdad2c7.rda | Bin 0 -> 1363 bytes .../.workspace/PTR-TABID4e863aae5fe.rda | Bin 0 -> 2783 bytes .../.workspace/PTR-TABID4e867f16b059.rda | Bin 0 -> 1531 bytes .../.workspace/PTR-TABID5e821a75da45.rda | Bin 0 -> 931 bytes .../.workspace/PTR-TABID7274230e0fc4.rda | Bin 0 -> 1083 bytes .../.workspace/currentTab.rda | Bin 0 -> 73 bytes .../.workspace/loadedDnippets.rda | Bin .../projectTemplates/shinyInputControl/app.R | 41 ++ .../shinyInputControl/aux/dnds/cntl.dnds | 175 ++++++ .../aux/dnds/jstools.dnds | 420 +++++++------ .../aux/dnds/mouseEvents.dnds | 228 ++++++++ .../aux/dnds/sampleShapes.dnds | 0 .../shinyInputControl/notes.Rmd | 136 +++++ .../shinyInputControl/notes.html | 550 ++++++++++++++++++ .../shinyInputControl/readme.Rmd | 331 +++++++++++ .../shinyInputControl/readme.html | 412 +++++++++++++ .../shinyInputControl/shinyInputControl.R | 75 +++ .../shinyInputControl.pprj} | 4 +- .../shinyInputControl/shinyInputControl_svg.R | 32 + .../www/shinyInputControl.js | 59 ++ 33 files changed, 2291 insertions(+), 583 deletions(-) delete mode 100644 inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID1b8a789c513.rda delete mode 100644 inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID41cd6cdad2c7.rda delete mode 100644 inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID704c2e20c007.rda delete mode 100644 inst/App/projectTemplates/shinyInput/.workspace/PTR-TABIDa9527235bba.rda delete mode 100644 inst/App/projectTemplates/shinyInput/.workspace/currentTab.rda delete mode 100644 inst/App/projectTemplates/shinyInput/app.R delete mode 100644 inst/App/projectTemplates/shinyInput/circularArc.R delete mode 100644 inst/App/projectTemplates/shinyInput/pieShape.R delete mode 100644 inst/App/projectTemplates/shinyInput/pieShape2.R delete mode 100644 inst/App/projectTemplates/shinyInput/shinyInputCntrl.R delete mode 100644 inst/App/projectTemplates/shinyInput/shinyInput_svg.R delete mode 100644 inst/App/projectTemplates/shinyInput/test.SVG delete mode 100644 inst/App/projectTemplates/shinyInput/www/shinyInput.js create mode 100644 inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID41cd6cdad2c7.rda create mode 100644 inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID4e863aae5fe.rda create mode 100644 inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID4e867f16b059.rda create mode 100644 inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID5e821a75da45.rda create mode 100644 inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID7274230e0fc4.rda create mode 100644 inst/App/projectTemplates/shinyInputControl/.workspace/currentTab.rda rename inst/App/projectTemplates/{shinyInput => shinyInputControl}/.workspace/loadedDnippets.rda (100%) create mode 100644 inst/App/projectTemplates/shinyInputControl/app.R create mode 100644 inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds rename inst/App/projectTemplates/{shinyInput => shinyInputControl}/aux/dnds/jstools.dnds (78%) create mode 100644 inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds rename inst/App/projectTemplates/{shinyInput => shinyInputControl}/aux/dnds/sampleShapes.dnds (100%) create mode 100644 inst/App/projectTemplates/shinyInputControl/notes.Rmd create mode 100644 inst/App/projectTemplates/shinyInputControl/notes.html create mode 100644 inst/App/projectTemplates/shinyInputControl/readme.Rmd create mode 100644 inst/App/projectTemplates/shinyInputControl/readme.html create mode 100644 inst/App/projectTemplates/shinyInputControl/shinyInputControl.R rename inst/App/projectTemplates/{shinyInput/shinyInput.pprj => shinyInputControl/shinyInputControl.pprj} (81%) create mode 100644 inst/App/projectTemplates/shinyInputControl/shinyInputControl_svg.R create mode 100644 inst/App/projectTemplates/shinyInputControl/www/shinyInputControl.js diff --git a/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID1b8a789c513.rda b/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID1b8a789c513.rda deleted file mode 100644 index a11713516e8c92d85842d606519309ea313908a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1074 zcmV-21kL*&iwFP!000001C>^5Z`(E$RhwjOG%U!Fc8_8MxU7IAM7C2m!!jVkmZlrv zFP#y459}K)F&0}{BuFZ@(FW^p*)QBL*mgxq*2Brt3XsKn&gHoeQKWyjEz8=lHa>vg zEf`u`zl?wC99!1iJunX7-i7;)wP|g`^TBX@-Wi`h8$5q9ImX`}e;0o9J4?Q3K z0am}$r#|W*^r?qDU#rDWT_?=z!dpNkdTSUOltTQZ$}gLvaZb7)K;vID_GZg!l#_O z84WV{O3gYC%)@JKE8Am%Q<*>y-f?rQ``lTSo7VS#U%P4Dhn;PRQrB zCxfWqK521Oj_@TZ*-u++ZVs`E3;JP;#wjc~R*-uwa>gQ3P@7>j{sQ(QqDCYk`fKj0 z{KL6mVm4m#(&s_jr&hpcEsm=*mb`#2lqIxy!R7-vUlwJSEjq1cK5S7loJ$wvqqVRj zT__+o1ePSJ2mZW8!{L<8(pus>6CA#Z1mlfzD-iyYML8Hd}ZH>s7 z&C5MP1JR;sE*k>%P_`0u(v;LlT~Y&;q%oHbfptl}<(Ej5(q`R{G$L_+RE=WHiR|VG zCrXwp`8toNWIxvIOE}S3(jY$4M2J-#+$+3~!u;H7_}gU@W*Yq6;bme5(5r?-zkxyW-Tj~c0LtV~6=Dkj0QC(DxBvhE diff --git a/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID41cd6cdad2c7.rda b/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID41cd6cdad2c7.rda deleted file mode 100644 index 4556a66c5298669a643eff4d139042e5cb19ae08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1605 zcmV-L2D{OZ`(u|&)CXTBc`G;UMBvyl}UB9)Y+y9P^SpG7e*#l zN|TL|snRa?lh~beHh1T|Fjeqb_+)$pJ^}FD*%zPPblohq$vyAS@1Fbl^4w`O8s{75 z-^c%J__eY2wEz9~H;u-7mvM0e|2FXNT;oDx9Y3$^_Yb!FyZ5>e?%eW&ul#@pxBahC z;b^1$&vt0G!(;+&k)`e3-L?oLw&=1nlkM4TW-YxVfyS4L0Oqj+IY)F#h0mi@RyFH? zx7+0L?z7$A{e$j)-*MXQ?%w{>KDpQ3d(ho`F>R zTPWP-UFW(7a|tYPSNpceYlq-7!sQMbWz3gR!d&4eDKrb6di;cmBnB@|#_pCf-on^M z$w6kEk?Vzug`yDwFO?ZM0DU5tppaq3H= zG|@1VWwzWy*}9v9%@%pw`)SWhDHq_Xh)wN|kWGP0A`>ixB*P<6v9KhJNBwYBuq|ET zR_mq?K!mQ))Lh^;2Kh_@P(`iSDs;*O1S)5-DXM=B7)eIBhy+H&9Z?%9c@jG{@N&>* zVdRH-YBHmO_#tIu2ZF|PJ)Z+J1ZGQ@!<~zDijMwo6oVIfdDyW*;IO01 zcyaU4?lqbe;#-G>^tckYgI=c^eY)Z;O5cQfCi+7T1kP*KgWj+js5cu4(M z_5nw@SR!%P5N3{Zi!%TW)R#Oosm&{fDw5XEdBH4rEXt(K+N_ugT#H4HtHoz*b@_Iv zqLk6-B-@xO@FczQu~TyJA)3My5Q2{DpsBr3h)PtkuNOSORC*_7vhpOY>FEHOQ7^h{Q`djIx-} zVUpQYrZKmXpCouzZ>Q42JPKL_kM*LdAfJE?6HRM|Rka7M60XH!I?fkPiH>5s-m^!Y zAn~&aqUimmfa*bvM4aH6`ErxoAW?u&nbyzpz$_=7RH{^VjI-x+pc3%geiAWRPIxN4 zIlijr)_Q^Kg;^J*isA{y{h#+aWdhl2;+n`v{XL8h?0)}=t5^wR!c>-TS;cjT z{Yj2^o~NSDhoQyYiX+_peOL!c{k-*b%$~_AM)^399dVgaamAAc|+D7N*=A!xSKPxYq z>k_Xo`;Zzc(n`Cf6de*?NHiHJ z)e=D`X$-xPrXV~eNkIxT$*U{^qy0#0kAzH;xT5$_D|{+#;pM{mj<2}BV(-kNU|j8A zORT~9KnwB>t=PzNq;s1|#PH=;714Pq%H8n&lbXVEfu0%&e!&GOhX40}ppiy;C=mbv DbPg_= diff --git a/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID704c2e20c007.rda b/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABID704c2e20c007.rda deleted file mode 100644 index b240f0e5c4ebf94bc01d08db8390b6cfaee6cb86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1705 zcmV;a23GkWiwFP!000001Fcv8Z_`E;4}*g0X^08f7qlO4X;JLeNz;gliPdaCg~(L8 zswrd2v`tt05+B%Sb9YYKv1+-n;kpbMIb$G+M3J#n#2k z@Vf%9t(9kokGo&BTJK$l#Rhz@!S_PzQfn2SH}?+@x`z)Q4tMVM@3;dp=)3*?U0@hm zDE(G9Set$nl1-7sn-3mr3ZJr*A&V1Pd40qr4|)e6d^J;$f2xWu#*)`bh8@r&j`@kH zby-HSoJ|kP)e8}^fJ$N+hJ@v7#7P*iekVkvg&wFy#I8iq$Ex+W1r(FDzXEFtv>!VProq))Q&!bp{sz^fDn^#;mx zB{HgfA9`6XT{Fjuh&g3)QcY_Wr#&~I?n~mC?c1VlquZVhCZzRs$IcYmsE;iB|I@am zvxKtf^=7~d6Ot#cQ~^hTQ9-zb2Lf23gc@RLJqxvS-*L?^`}S79Z>fT~=GI1^g1L|OPGM91Vn&__uO4iF=K zEI;Ui2mwzU)e$o2_w73wME0KT?rLDHA!sX9=}V;z-EsrMrqYM-K6eI{*6U(`$PxA+ zFJZ?j$l1BpI*qg)Yt1Z29GXxrq>**+1`w6xf5zf6G-|b+xSXiSR3m}>QBHKr)LaHV zdb?ZeQ}0&3X8lrQp%BnXb*t2U+EMzoKmnChFe}cwAk5Q-o&o_+NqL-=DvbbuK+Fl? z(ghKuu$QHpcnTC5JSIE}b%ZHM(uQ&G9w$?9hVa^j4IV7Jv-R;RAf#ikk(O=3$wII5 ztC@-(OM)O3hgO4ftYnaAD@K#oflwsK*elk`c$a@&x3(vi0zU2zI=-^ZSCAXuFQR^ zqsvG0rrNj8@~zyjZ-<3n&2=rO0iF7C%E`&OEWN2{{zGTr%AX6?*D|kG|A9|y`9F?# z3hTV@=g$6_nq7_~0J~Tg$eW7IYC@JkVufRmMy=MR_o_q&6Mk-CBO~6J(17fabX19W zPvWDYm+?Mo@TeH!8OgaHH@IrKkENfdp~1%R4`naPnAaQ35H697b;&K?KZDta$dSGZ z;dJ+;I+QTqgoh__E_0(PQwiXc1}~P6qF@iQkcZIVL&MZWq2o zjMX?JgF%-t5V-jImKhN9``Lx5m;S& zBOk{^^b{o~aGo+GFOu+b?uVND0tVsqX diff --git a/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABIDa9527235bba.rda b/inst/App/projectTemplates/shinyInput/.workspace/PTR-TABIDa9527235bba.rda deleted file mode 100644 index a661cf3858b7f190ccaee8088dd3003ae0b0bb94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1362 zcmV-Y1+DrYiwFP!000001Em*xZ`(xNdvv2lOhemvO#E@`RK;HH)CsHDqdwpU=L;cC(i_#fg9K=iTq}+%yd1l5yz@e6PT( zvGV=Fx9)wzxOfAA4S24@bHTW5titcj?m^Ez*nYIPgCA_QziNNE)$e1#n~EoY%KX;m zh>gjnm?WFq+nZuU<8&`hCbIPUvp5?zd%$}wll%H_L$9))ONr!F)RhMj?Q_gi3*>vY zsUbQ(q-QH1%+gQCy^`|&BNV}8(8-|&$;h;w)yz!&VI*D zu#m*F)^J3)v>Jb`IVi9^r)4{6?I98*B7r1f!(Ow^qf8um8!hUfmg`a5eA02nZy+Wn zW9umktt0!VwyhYCHlLV#I~}(%PQRP z2Ns!8A%(S;6W45H|862!1IDcw(HO;eOoWw_?ShysECe0KR_qjdkB{S%6I+pAnlE)K zah#$a8j&a=90d#<88RXO!O8N}s`Q#>LdpIJC!{kE#R_JrgL;0;L2^VS7JimW)V`b0 z+^rl7Nn?<-99UnsaypQ^9amaoEIFN7P=$brf(eS@3L0z3cG{Z1d$+d%Rso1GAChez z_#Oaa;L`z#1hG&^2Lmnm&`+}3IbJ3m`Vr*SDzf#|&zvuSCw}+XX`N_r8{zsO?JT`Qa&}6ZQyR*V-|{vOcaK{qkhox+L^HJB3EXuwPaTaz zGIP-LA02eK>!25)yCm+Q0gWQRk&-B4(}shfd5c0ry45fDvkrWbmsiE>Z}Xu>z<#pO zEcG+}(~+Nv6gHj-GXYj@wyYj-9E%7`@{Yr<%yVJ(mdW)2 zRHBPx5@|leSju;m#m~sJE8n6{*?V6nS5#NMVNAbmtQ*>^Z}#S1)!|A?bp_J*G4!gW z_)iu7)xVa&*9)gs|AqBGgDT4|!`I*6H}mJpbtPdmmg03`yegS2r{gu0KYM-%! zc%w!f!?{zCE(eSEFW~k; zCENuT1Q;){*B96k2~OwrGly_vtjMn_j2N-0K6?}*oK?ZJqM&Tbglkv7s#0OfDiva( zG6&O&g7YfRFiZ-K31eD~`?kUe3^OAi)S{VT5(4|F=;UP_p{9PUsK3GlWKo6iks<_G zmXS9K?t4Kjd6nOUX)~wCsqNQ`5F^zw~Q5A(}3sf!!m#;)SmLrP4 U8;1apY-;@TABL1+=E@BK04Oq+n*aa+ diff --git a/inst/App/projectTemplates/shinyInput/.workspace/currentTab.rda b/inst/App/projectTemplates/shinyInput/.workspace/currentTab.rda deleted file mode 100644 index 9b69586b4e555d93575813e1a7b9c027fee653bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72 zcmb2|=3oE==I#ec2?+^l32Dre);Op!XJ>TGUdK8?k>N-Wj}FfqhbR>V6%X?x7f)V3 ZYH(8N;+;cAH?LffV2Fr4_ud+4002#98h8Kz diff --git a/inst/App/projectTemplates/shinyInput/app.R b/inst/App/projectTemplates/shinyInput/app.R deleted file mode 100644 index 79fe9595..00000000 --- a/inst/App/projectTemplates/shinyInput/app.R +++ /dev/null @@ -1,39 +0,0 @@ -library(shiny) -source("shinyInputCntrl.R") - -ui<-fluidPage( - shinyInputCntrl(inputId='myshinyInput', wh=c(400,200), Z=c(2-2i, 2+2i) ), - h3('current Value'), - textOutput('currentValue'), - textInput(inputId='updateValue','update value', ''), - actionButton('updateButton', label='press to update value') -) - -server<-function(input,output,session){ - output$currentValue<-renderText( - paste('c(', paste(as.character(round(input$myshinyInput, digits=2)), collapse=", "), ')') - ) - - observeEvent(input$updateButton,{ - value<-input$updateValue - print('update button pressed') - tryCatch({ - - value<-eval(parse(text=value)) - - if(length(value)!=2 || class(value)!='complex'){ - stop('invalid input') - } - - updateShinyInputCntrl(session, 'myshinyInput', wh=c(400,200), Z=value) - }, - error=function(e){ - # do nothing , record error - print('error') - }) - } - - ) -} - -shinyApp(ui=ui, server=server) diff --git a/inst/App/projectTemplates/shinyInput/circularArc.R b/inst/App/projectTemplates/shinyInput/circularArc.R deleted file mode 100644 index 87da31a3..00000000 --- a/inst/App/projectTemplates/shinyInput/circularArc.R +++ /dev/null @@ -1,36 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -# Defined by mouse: edit with care! -ptR<-list( - x= tribble( - ~points, - matrix(0,2,0) - ) -) - - -pieShape<-function(cxy, R=min(cxy), theta1=0, theta2=2*pi){ - P0=c(cos(theta1),-sin(theta1))*R+cxy - P1=c(cos(theta2),-sin(theta2))*R+cxy - largeArc=ifelse( (theta2-theta1)>pi, 1,0) - sf=0 - d=list( - M=P0, - A=c( c(R,R), 0, largeArc, sf, P1) - ) -} - -R=100 - -svgR(wh=WH, - #your custom code goes here - circle(cxy=WH/2, R=R, fill='lightblue') , - path( - d=pieShape(cxy=WH/2,R=R, 0, 3*pi/4), - stroke='#0000FF', - stroke.width=20, - fill='none' - ) -) diff --git a/inst/App/projectTemplates/shinyInput/pieShape.R b/inst/App/projectTemplates/shinyInput/pieShape.R deleted file mode 100644 index f7b6afb9..00000000 --- a/inst/App/projectTemplates/shinyInput/pieShape.R +++ /dev/null @@ -1,36 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,600) - -# Defined by mouse: edit with care! -ptR<-list( - x= tribble( - ~points, - matrix( c(c(69,71)), 2), - matrix(0,2,0) - ) -) - - -pieShape<-function(cxy, R=min(cxy), theta1=0, theta2=2*pi){ - P0=c(cos(theta1),-sin(theta1))*R+cxy - P1=c(cos(theta2),-sin(theta2))*R+cxy - largeArc=ifelse( (theta2-theta1)>pi, 1,0) - sf=0 - d=list( - M=cxy, - L=P0, - A=c( c(R,R), 0, largeArc, sf, P1), - Z=0 - ) -} - -svgR(wh=WH, - #your custom code goes here - path( - d=pieShape(cxy=WH/2,R=100, 0, 3*pi/2), - stroke='#0000FF', - stroke.width=2, - fill='lightblue' - ) -) diff --git a/inst/App/projectTemplates/shinyInput/pieShape2.R b/inst/App/projectTemplates/shinyInput/pieShape2.R deleted file mode 100644 index dc2cb521..00000000 --- a/inst/App/projectTemplates/shinyInput/pieShape2.R +++ /dev/null @@ -1,38 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -# Defined by mouse: edit with care! -ptR<-list( - x= tribble( - ~points, - matrix(0,2,0) - ) -) - -pieShape2<-function(cxy, R=min(cxy), thetas=c(0,2*pi), dR=30){ - thetas=sort(thetas%%(2*pi)) - RI=R-dR - P=t(matrix(c( cos(thetas), -sin(thetas)),2)) - PP=P*RI + cxy - P= P*R +cxy - largeArc=ifelse(diff(thetas)>pi,1,0) - sf=0 - d=list( - M=P[,1], - A=c( c(R,R), 0, largeArc, sf, P[,2]), - L=PP[,2], - A=c( c(RI,RI), 0, largeArc, 1-sf, PP[,1]), - Z=0 - ) -} - -svgR(wh=WH, - #your custom code goes here - path( - d=pieShape2(cxy=WH/2,R=100, thetas=c(0, 5*pi/4)), - stroke='#0000FF', - stroke.width=2, - fill='lightblue' - ) -) diff --git a/inst/App/projectTemplates/shinyInput/shinyInputCntrl.R b/inst/App/projectTemplates/shinyInput/shinyInputCntrl.R deleted file mode 100644 index c502b160..00000000 --- a/inst/App/projectTemplates/shinyInput/shinyInputCntrl.R +++ /dev/null @@ -1,104 +0,0 @@ -library(shiny) -library(svgR) -library(jsonlite) - -try({ removeInputHandler("shinyInputCntrlBinding") }) - -#helper functions - -Normalize<-function(Z){ - S2<-sum(Mod(Z)^2) - if(S2>0){ - Z<-Z/sqrt(S2) - } - Z -} - -# use toJSON for non-trivial initialization -ZtoJSON<-function(Z){ - toJSON(data.frame(re=Re(Z),im=Im(Z))) -} - -# wrapper around svgR code -shinyInputSvgCntrl<-function(params){ - source('shinyInput_svg.R', local=T)$value -} - -# return svg given params -newShinyInputCntrl<-function(ID, WH, CMDS, Z){ - svg<-shinyInputSvgCntrl( - params=list(ID=ID, WH=WH, CMDS=CMDS, Z=Z ) - ) - tmp<-HTML(as.character(svg)) - return(tmp) -} - -# definition of what to call for the given mouse events -id2CMDS<-function(inputId){ - c( - sprintf('shinyInputCntrlBinding.clicked("%s", %d, evt);',inputId, 0 ), - sprintf('shinyInputCntrlBinding.clicked("%s", %d, evt);',inputId, 1 ) - ) -} - -# Cntrl constructor to insert in app ui -shinyInputCntrl<-function(inputId, wh=c(50,100), Z=c(1+0i, 1+1i) ){ - Z<-Normalize(Z) - #CMDS<-paste0("alert('qubit |", c(0,1), "> selected')") - CMDS=id2CMDS(inputId) - - tagList( - singleton(tags$head(tags$script(src = "shinyInput.js"))), - div( id=inputId, - class="shinyInputCntrl", - # customize for initializationby attaching property(s) to this div - 'data-Z'=ZtoJSON(Z), - newShinyInputCntrl(ID=inputId, WH=wh, CMDS=CMDS, Z=Z) - ) - ) -} - -# server to client update -updateShinyInputCntrl<-function(session, inputId, wh=c(200,400), Z=NULL){ - # validate input - if(length(Z)!=2){ - cat('bad dim') - return(NULL) - } - - # normalize first - Z<-Normalize(Z) - # CMDS<-paste0("alert('qubit |", c(0,1), "> selected')") - CMDS=id2CMDS(inputId) - #recreate the entire svg - node<-as.character(newShinyInputCntrl(ID=inputId, WH=wh, CMDS=CMDS, Z=Z)) - mssg<-list(value=node, Z=ZtoJSON(Z)) - session$sendInputMessage(inputId, mssg) -} - - -# preprocess data returned to server from the client -shiny::registerInputHandler( - "shinyInputCntrlBinding", - function(value, shinysession, inputId) { - if(is.null(value) ) { - return("NULL") - } else { - ZDF<-fromJSON(value$Z) - print(ZDF) - if(nrow(ZDF)<2){ - return(NULL) - } - Z=complex(nrow(ZDF), ZDF$re, ZDF$im) - Index=1+value$Index - L<-1-sum(Mod(Z[ Index])^2) - LL<- sum(Mod(Z[-Index])^2) - Z[-Index]<-sqrt(L/LL)*Z[-Index] - print("ZZ") - print(Z) - updateShinyInputCntrl(shinysession, inputId, wh=c(200,400), Z=Z) - return(Z) - } - } -) - diff --git a/inst/App/projectTemplates/shinyInput/shinyInput_svg.R b/inst/App/projectTemplates/shinyInput/shinyInput_svg.R deleted file mode 100644 index b85815db..00000000 --- a/inst/App/projectTemplates/shinyInput/shinyInput_svg.R +++ /dev/null @@ -1,69 +0,0 @@ -library(svgR) -library(tidyverse) - -#-------- params ---------------------- -#` default params -WH<-c(400,800) -CMDS<-paste0("alert('|", c(0,1), "> selected')") -Z<-c( 0+1i, 1-0i) -L<-sqrt(sum(Mod(Z)^2)) -Z<-Z/L -ID<-'myQubitbit' - -#----------function override of params---------- -if(exists("params") ){ - for(n in names(params)){ - assign(n, params[[n]]) - } -} - -#-----any R helper code goes here-------------------------- - - -pieShape<-function(cxy, R=1, thetas=c(0, 2*pi)){ - thetas<-sort(thetas%%(2*pi)) - P<-t(matrix( c(cos(thetas), -sin(thetas)),2)) - P<-P*R+cxy - largeArc=0 - sf=ifelse( diff(thetas)>=pi, 1,0) - d=list( - M=cxy, - L=P[,1], - A=c( c(R,R), 0, largeArc, sf, P[,2]), - Z=0 - ) -} - -stroke.width=10/WH[1] - - -cmplx % - - - - - - diff --git a/inst/App/projectTemplates/shinyInput/www/shinyInput.js b/inst/App/projectTemplates/shinyInput/www/shinyInput.js deleted file mode 100644 index 7d4fa9c2..00000000 --- a/inst/App/projectTemplates/shinyInput/www/shinyInput.js +++ /dev/null @@ -1,78 +0,0 @@ -// JAVASCRIPT - -//INPUT BINDING -var shinyInputCntrlBinding = new Shiny.InputBinding(); -$.extend(shinyInputCntrlBinding, { - find: function(scope) { - console.log('find'); - return $(scope).find(".shinyInputCntrl"); - }, - initialize: function(el){ - // Initialize any data values here - // here we initial Z and the current Index - let iniZ=$(el).attr(`data-Z`); //extract attribute - $(el).data("Z", JSON.parse(iniZ)); //convert to an object and attach - $(el).data('Index',0); // set index - }, - getValue: function(el) { - // used to return the value of this input control - // here we Z and which index was changed - return { - Z: JSON.stringify($(el).data('Z')), - Index: $(el).data('Index') - }; - }, - setValue: function(el, index, value) { - // used for updating input control - let Z=$(el).data("Z"); - $(el).index=index; - Z[index]={ - re:value[0], - im:value[1] - } - $(el).data('Z',Z); - $(el).data('Index',index); - $(el).trigger("change"); - }, - subscribe: function(el, callback) { - // notify server whenever change - $(el).on("change.shinyInputCntrlBinding", function(e) { - callback(); - }); - }, - unsubscribe: function(el) { - $(el).off(".shinyInputCntrlBinding"); - }, - receiveMessage: function(el, data) { //called by server when updating - if(!!data.value){ - var htm=data.value; //htm is string represented a node - var node=jQuery.parseHTML( htm ); - $(el).empty().append(node); - - $(el).data("Z", data.Z); - // alternatively, set value but be careful about index - } - }, - mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id ); - thisSVG=document.querySelector("svg#" + id ); - var pt= thisSVG.createSVGPoint(); - pt.x = x; - pt.y = y; - return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); - }, - clicked: function(ctrlId, index, evt){ - let svgId=ctrlId + index; - let pt = this.mouse2pt(svgId, evt.clientX, evt.clientY); - let el = "#" + ctrlId; - let value =[pt.x, - pt.y] ; - this.setValue(el, index, value); - }, - getType: function(el){ - return "shinyInputCntrlBinding"; - } -}); - -// REGISTER INPUT BINDING -Shiny.inputBindings.register(shinyInputCntrlBinding); - diff --git a/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID41cd6cdad2c7.rda b/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID41cd6cdad2c7.rda new file mode 100644 index 0000000000000000000000000000000000000000..21e0724aef2c2760cff2663d6e25088e3f5206fd GIT binary patch literal 1363 zcmV-Z1+4lXiwFP!000001C>`@>2$hC4Q>U9Y#BBAW2^IT@dS&I(^R_1#$WY1dUO8v zyz}b1+3xy&z20oKZ@TEB*}81DUi%Zw(SpJA^9#x%$_D6L#K;tN6hojn3{a__`7Z); zCkcxx_siGNuRemO56cGXk69>b!YU$6Qc^XTdN`3|&d>{k1d6}1A1qP44~CV*Z#Dg* zj7o}Q`U|ntlek)_hWJsZd(}oK!7*yi*%67!h%kvFEHN4qP8znz2+z=15G02LMJy5x z<%NJ#)G2CIQuR}Qr1gQ`(sUaBB80DHfL z`K&NV`-TyG!VD$7TN28ePTdrPQJLrzzUlnb3bL%w{>*naJd<~JR4mI=4P~s5FH|@% z&J#9H!AF&^$5K;})E0`;7G^f)8;zF4Uo(DKijD)dO$jL~I{Wjc1hW*N4v zsVDcMGA{#g+znvNmWN=gGVb*I%UeA6qbSp^X^%H-#s(thRnb0r>R+is@=(htduVv-B1A>!g4NmBGOIB}`-YHYZ4 zU<{xtVW@H(%A)V}SW!+i&^sWi(XuEARoG61puKpe>K`K04VX1$V?NLHjOyrSJXo&i z#O;eIl|y|7WDewdI`=wq8szy9lL71ti-;bG6&M!`b_o*9XQ)v{6~GTACwjnEi+ZxR zRpn64?$h81;V3c*hXRjj_?~3e^XUp{Egu4T2bgKI|3I;sBKB1|!y$>TuU$zKgr(58aSO7Lhfu*yUV>S!K{$nEkPr!R2%Ti z1+yI;C{XS(EJ$n{{-OkjNjx4g%keFBNJl(Lop1{(2qfH4w+rf!sG*wwr5JD;Ir5vD zB8JH{pBdJ6SX8Nx%A680>c+jNDFTnum~@6X zB_dE)dV_wV(OV&tBzAx;4TMa_Hg#81M+qE)R}(lO9T9&@qk$WsrdXBnu_k0Y=J3d( zW;31Mq&x}RaJg~(+i?Kevx>-pLZ>nI VY$)qeje6d{{{wj4SM@j#005*Ojqv~g literal 0 HcmV?d00001 diff --git a/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID4e863aae5fe.rda b/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID4e863aae5fe.rda new file mode 100644 index 0000000000000000000000000000000000000000..5290f4510bbb97505f1bc4566170d125cebafabd GIT binary patch literal 2783 zcmV<53Ly0#iwFP!000001LYcjbJNPveZYG~onh$kpg*R6T!D^d*A|JB01bFrLSS&G z&`c6a|6m5r(#1X^=`?re828O<`&s%4`w80a-koeob`mFq*Eg+aY)iL$d%Ju4^Q1p} zwOZ{`?b4TD)Gl3t%i5LK`_J1CYqc+Kz)b+(>+ts)c$9{|Wzx?aHt*v`%$kRzL%|`mENVOF4J;`X4uwXZd0O=Y|`0YPy`KL(W z%S=mYunMDh*4pj1r@4;VCaJ5V!7kw`q2wi%hmjbkWLt!FkB;(ZI8OwTNVD6l>M3Q^i%iMZWdkym;IW{q>cV zR%d0U;o-Xec-VdOqNUkK?brAApY5#HTOTLg(C;8pqtOCE;Uih7eS1lWfv*CUjT}q} zkbyZHE3MzG%mxp59Czz?wzi%>-`c9@!wLjAWZil{9sUk;Ia@voX+MG_Xlis`_zR?I7 zGCmmU2B{$Qw#k8zL=TyvCSt;)3d+-$+k3=M=!B?Imc7)M{u%{%{BZeCQ|F%JJ}PMq=d@W1H6a+IF#zU{MkFKVqRAgA&0 zu!}y@B*v9^3O-7~L65ke07+cA*?fYW!(8a@s43g91vXG z)&mvZKm*i5ZB*kB)Ns3T9x8w-kQHyR#OQwjODhquLZ>_B7Q{19Lhnw;gI&J4u{j;D6~d^fWmag zk;byj&?vDcd4B}N!4nykwhW>xj^9Y!6QeBEf-z4MP(knY%gH2i`|``WIUvCjG+J`_84?kiR%z? z|74O(c^Gnp641J0ps9dVKBIH2II}EkcE8!Q`~TJ$0EhybGVCT1hDP8TVs1cuCu~sw zpq@b}*9Qv>a*L-Jkpef(zx^w9y9ND_h5{&Gu(#a+Ud|W9L1BrA_yLD3DO}BOqv1wi zV;^dMm+6sAiBX9nCi^@!0xcC5S3gf!{Pc2t78p0q6d2D_$V)ch3OX=D$R(8vh>zb@ zl)%+5u%kV_g3a4m@SWx&-7P5gG6DT-xzuyz0C$dZrs5Oln@`T~Y` z3;syZAzQ_>i*5{Q$3FCM=OTrqQ$X>1+g&45FKUrDFS_Gl%kpH;HcCyebNt8cc^2PD z>{eydcckrKu~JM$1T(1$!XZUNWYTx^EEcHXxsb{9(3VU;iBf~dZNqGlwU!~-#UIBd zl#zRdP-3>lmU=T{SRX@*73tf%7e4QoF)h|LPP^F zL@Q#O-7_-d)uWREbkL*DW zv}7lErI3e(2Yqc~sM-Si|KhTtqO2-rKA>J{bW|ZH|UET94FVeOlr-_-e`Orjk; z&2_j%*jFNb#l|~&!OK2X)Z>;f;#?UIxh}qTRORKg*OY2GBfslS8L8fvlx2K%Alc+B z3;n%7_-{tyul}*%{<>r8>c8PrJN{j&W!}9y?K&6iq<^pSe{IQm?*H-^1)i^@6jHPU z2Du=Z=eL;(CC{{wfu{XliUX3U((P@J0ogK#Fsq z%i-+$7gRxh-h)JLDvdy+n?Mtq>`$^B=j$p?L4coDU>W#h{0g*?i%@|}G44U`{+M%F z0jIN>H!GloB54Qw`P{O5Mo<_zW?{wR;=(_xfI|_FlC;41wLT3GBdDZH;?724f{e;Y zV1u%NW~5*lKQaS$$4WSQX0sM2;VG1!`>Z`(E$cAKU}G$82E%P!c%fm6UzV5?2j+l(4p(zIxX zG&5pn-P=G*w8d1S1d_fr=(gXoAGhcIf^CPC6ibSmv<4K3=R4={+{yfE)oQhs+RF8- zwUt%;tgRmRU$vgqYFBUJ!o}w%K38hjYHRqu)9oL%`a8S(dynX|Cr^i4PX-Sje~*A= zn9`>xu=)G_-QD{#V0^yMld*acb0y;NJjFdi?)6MV{wr!)Nt7s)Zu}jxfgoaT8*Pqt zww#QP9BTve^@)sm$P{%fOX2bq1dZYeHQT=?+z+X+>*p-m+1X{>XM9w5-~)`reB-d%fqaIzii&-N?k+!08lsh$8gLmQKT|8yWLw1A6_J zU3la^Y-0eDka)DH42T3&BH~0abis(^f#F5|7Q}?LRgfR9< z*y%g>CL|nF>w}3=#)fussl?b*u>chV;}U(rmo@{&Y*~Z~abX(R_nR;cI-dRL!Gk6~ zP7};doyIgkCni)h07JI{JXW*~V@YwRpL#zZ!Vov*F>fisCX9r*EmQbr?@5|c?Rplm zZFj4*aJQgqqNi&i!BC3Wqf%m}Ks*FH(*(vqC$$H2krqiw&qJ)Jld)7;8n9mR8`I!Z z$prPSJlW4%8nO5HI%iJ5echP`O~|}8e;r6mM3K>fW=}H++OCi)j2Hs)UOqiEh{}V z)l;UKU&F}GX0t|TKA!{NoI%Z=M-wGsLUn0NT@)eZBNf2b5*6CIC>B(=EzXRYF{cSQ zsIXkMd0D}tao8{u-6Cl-6;!2W7;>XiM4g-i*G|@c*k!22=nEO;3dV`A8$NyYE^Iof z>pbR7xTO0A@n|d?dT4DxmkRVTGTma}O3&!N06X)N4RM4~pZboKC-VvR2^<^NT|sap zV+F&pF&1|8z```Pty2C`1ltRaXg-c7Bj^iC&vQL=;gvQnLSx8i3B$GvJ&LnCV_1YO zi{`=?lQ^8LYAiVQHDea(p@<_hJu^X5<<4-ft!3X=mc;6!w^ezsf1+IWzIL@>^eQJf8#2(% zh_~^^ME7WV#Kyu^WU%jN*xd@oWRFZ}j($}^^|DJ;kcX%O6THJ5#u<340!Db%%%E%D z;`=*1s;TPHkeV^#D&0?dMEB=O&U3rUQ*hwx3YK6)hld!2+=U7*;^{t4?OASR1?CIM zI~6D*T6G3~dv4pFaTF;Z*;vxBxbZg?*o(t)#0!S64~X~9#~X0T-31i|Vv$jAE~o+Z z-ks&o8VTl?rP@@>njF%HU1WO{;l=-8w zgN9P5j4uo!%~**?EowI9i5UNdgk=($El8;t9=u6jk14^F1@+(Jf~wrf>~!zq$zQVX hRtaE(LJ^f9uhbZKi%{C72Cdcp{U2Ev3mS(H002@b?sNbE literal 0 HcmV?d00001 diff --git a/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID5e821a75da45.rda b/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID5e821a75da45.rda new file mode 100644 index 0000000000000000000000000000000000000000..2bba8fdf4ecd971c1161b94faad4cf4fa766f47e GIT binary patch literal 931 zcmV;U16=$ciwFP!000001C>>OZ`?E(4*kKXk*cDu<%bZm+CQ3;n%g?9VnUsOu0uO% zRHxpJB25$clJ^o*$Bu00t`QpWS@?u}0>E*cUXr$SSh5^H&+EtUYrlT;Bl0|N*;{^p z$y;7EpWf=L@pr)!&s*9wlfLO2roZQ{cxz_d8jjC`@wdl=lS6p&=zx5A7?H<^hCtS+ z>dgiH-yR$vKTrwf#eiqIekQn`QnR>!W>%~_mAW<6mNPBe(9#!-P9%|qZ`Pmn zP(9N$DrO)R^bpz&T*DcWBvm-Lv7z0caRgJ6Gwlq~`HQ0<^dCQbxNmw7J^TJ-bQJ6m z22%TbVdXg1lEyJei1vCrXmD~A?4^a{_RQvZG=4tB2mOPuFo~jCdErzLOmiM;DmWI# zV@V^xV(RP`Mi|kl50_MF{lD^79uwSxzZx- z=u`%$uU@`%rtWkeRi~o`F4f90lt46Knvxirw#G6QxdIF`;96l{bG{+_JF(*4+5h z4jl@Xr@Z0#`hDiEdfc7WC(~o;OJ}r%~Jv&?1e@_|O8?jkRp_B4;a`l=2@4YeVF60aeSC zhOExV3b1Jb(Ycv`u7k`ZWKx7f^KWYTx7i}-q>)4|Dr`NB?Iu;dQp=j(#J|!nTCAT5 F007mq*^~eP literal 0 HcmV?d00001 diff --git a/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID7274230e0fc4.rda b/inst/App/projectTemplates/shinyInputControl/.workspace/PTR-TABID7274230e0fc4.rda new file mode 100644 index 0000000000000000000000000000000000000000..3e648dcc20417d9f3158a4c083c50c70c81223c5 GIT binary patch literal 1083 zcmV-B1jPFviwFP!000001C>@?Z`(E$Rr9ef8W3bilWs#Fh^~MoKvtYIXt$xpmb4k* zm&{1qZm+b&SX^aNAgMUUkZr$Zzi_``+Z8EUqU&fwSRk!MHaZU35n$r-L^yk6s=hJ@1j;Rdfu5tBuUB z>G0(DgVWOknNT(#uq;=vIa7kC2RO^Z3*fg)pXzG*u4hWv(8jkZ9Sbbxo>uf-$#W4A z@99#2lauh`sqeZuebv26a~covgm^B3D>?K!BO(<#$+C_g80@*%iE<$bQ|KK|b5aqC z+^C;&1;Pshi(eS&;2tgh2XViXXE9d9m@-)3Gp{r>D=q=tMKIwy&^CIY&bGo7N* z3%G7ZAR!|F{oizW13qgu=v5b{F%cu^jd6XpG7rBl!bpvE;InHGD*c*G2~5D^x;9~& zHahacK#BQltfIuLeHN3i(dFoDh+c$;-!(9V4nqXp&af!EjIOvS+in{cSHUsPy2brB z<`PAmNeXqNTv9ecgsOyyCC}ob{-Oo~qX$7H@d~ZJhJ7C``9VN>Rc1ydV)>K^8m*QG z{Zbywu(b4yvMqcRA{@u4Ec0^t9=Ue!Zi9MGgy5pT*dxTRdu`-n4lPni(Te~H5^)h5 zC(AAq6mEA%6CJ;fR84P#azZDJ3o>9-p*|X2ygk#n@7}_OEfR-k+RJG_rvWk>xNio( zb+&Ac1ZFaYdhdI}HH{wJR7cnMf3G~cK85pbh#5)mIN~01c1~tPb%&ge_t9By&JwEY zs}AS3?475%Q|0x;V3AjQZFM!JlSEAfnSWHIKO4$_=ng#mYsGq}%xddjxSS8abMEz$ zS~Yi8^y>dcw>56x)2|#i)*4A~GCU=+B*PMXbVXD0hR8_JOmPt^JRZa)x8LHZyu{a} zVjs8IVmZVrsan*cF&ty(yd-y9Et=Jydo5~;3+a;lYANicE)H&r9xsx?Yj3hBJng!;oX8WBEy))vSdHk?5|RBo?67V zCL*TNCc3B5DbJ<(LaOE_0rj)_ggbm@F8ZvHDk*wN} z2GHAr#6QD=sH(`~lS1&Q_y)D|+qDQfZfqipimV4?ze$;=RI`rr&wuUr2zAa2007nR B3UvSg literal 0 HcmV?d00001 diff --git a/inst/App/projectTemplates/shinyInputControl/.workspace/currentTab.rda b/inst/App/projectTemplates/shinyInputControl/.workspace/currentTab.rda new file mode 100644 index 0000000000000000000000000000000000000000..3e4d8c14b5c475914c4095ef38de53971a0dbebf GIT binary patch literal 73 zcmb2|=3oE==I#ec2?+^l32Dhm32CfGk`d0%cS>{{co-GZQW6p$uv}7NRCL^>*ylG- ZPi>`G+Of{gmCG_$GHl<|SZWP40RSVG7$X1x literal 0 HcmV?d00001 diff --git a/inst/App/projectTemplates/shinyInput/.workspace/loadedDnippets.rda b/inst/App/projectTemplates/shinyInputControl/.workspace/loadedDnippets.rda similarity index 100% rename from inst/App/projectTemplates/shinyInput/.workspace/loadedDnippets.rda rename to inst/App/projectTemplates/shinyInputControl/.workspace/loadedDnippets.rda diff --git a/inst/App/projectTemplates/shinyInputControl/app.R b/inst/App/projectTemplates/shinyInputControl/app.R new file mode 100644 index 00000000..aaf48dd3 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/app.R @@ -0,0 +1,41 @@ +library(shiny) +source("shinyInputControl.R") + +ui<-fluidPage( + h1('Test App'), + h3('current Value'), + textOutput('currentValue'), + + textInput(inputId='updateValue','update value', '200'), + actionButton('updateButton', label='press to update value'), + + shinyInputControl(inputId='myshinyInputControl', wh=c(400,400), value=200 ) +) + +server<-function(input,output,session){ + output$currentValue<-renderText(input$myshinyInputControl) + + + observeEvent(input$updateButton,{ + value<-input$updateValue + tryCatch({ + + # STEP 6.1: + # 1. prepare value for update: + # for non-text values consider using either + # i) value<-eval(parse(text=value)) + # or if value is numeric + # ii) value<-as.numeric(value) + # 2. add updateShinyInputControl + + }, + error=function(e){ + # do nothing , record error + print('error') + }) + }, + ignoreInit = TRUE + ) +} + +shinyApp(ui=ui, server=server) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds new file mode 100644 index 00000000..a5e6d616 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds @@ -0,0 +1,175 @@ +--- +title: "Dnd Snippet" +author: "Anonymous" +date: "TODAY" +output: dnd_snippet +--- + +- Individual drippets are seperate by lines consisting of three or more stars (*) +- Each drippet consists of 3 entries, with each entry having a title and a value (block) + - The title consists of a single line followed by a colon (:) + - titles are *POPUP*, *SNIPPET*, *SVGR* + - The values are blocks defined by 3 backtics *````* +- Two drippets are shown below to help you get started + +****************** +POPUP +``` +toJSON (Steps 3.1? 6.2?) +``` +SNIPPET +``` + toJSON('${1:(value)'}, ${0:(value)}); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-.06*WH[1] +d<-list(M=WH*c(.8,.85), Q=WH*c(c(.12,.85),c(.12,.52))) + +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + polygon(points=WH*c(c(.25,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + rect(cxy=WH*c(.1,.5), wh=WH*c(.1,.1),fill="#00FFFF"), + text(cxy=WH*c(.6,.5),'JSon', fill="#00FFFF", stroke="#00FFFF", + stroke.width=1) +) +``` + +********************* +********************* + + +POPUP +``` +Forward click cmd (Step 4.2) +``` +SNIPPET +``` +params$CMDS<-sprintf('shinyInputControlAABinding.clicked("%s", evt)',params$ID) +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[1]*.2 +CXY=WH*c(.3,.5) +svgR(wh=WH, stroke="#00FFFF", fill="none", + text(xy=c(.05,.3)*WH,'CMDS', font.size=9), + g( + polygon( + points=c(WH)*c( + c(.0,.0),c(.2,.5), c(.05,.3), c(.05,.6), + c(-.05,.6),c(-.05,.3), c(-.2,.5) + ), + stroke="#00FFFF" + ), + lapply(c(0,45,135), function(theta){ + line(xy1=c(.1,0)*WH, xy2=c(.3,0)*WH, stroke="#00FFFF", + transform=list(rotate=-theta) + ) + }), + transform=list( translate=WH*c(.6,.45), rotate=65) + ) +) +``` +********************* +****************** +POPUP +``` +fromJSON (Step 5.1?) +``` +SNIPPET +``` + fromJSON('${0:(value)}); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-.06*WH[1] +d<-list(M=WH*c(.8,.85), Q=WH*c(c(.12,.85),c(.12,.52))) + +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), + text(cxy=WH*c(.6,.5),'JSon', fill="#00FFFF", stroke="#00FFFF", + stroke.width=1) +) +``` + +********************* + +POPUP +``` +Update (Step 6.2) +``` +SNIPPET +``` + #1. Recreate svg Tree + node<-as.character(@projectName@SvgWrapper( + params=list(ID=inputId, WH=wh, ${1:value}=value) #<<-- + )) + # 2. Form message + mssg<-list(node=node, value=value) + #3. Send message to client + session$sendInputMessage(inputId, mssg) + +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +X=c(.2,.4,.6,.8) + +svgR(wh=WH, stroke.width=3, stroke="#00FFFF", fill="#00FFFF", + # + line(xy1=WH*c(.1,.1), xy2=WH*c(.9,.1) ), + line(xy1=WH*c(.1,.23), xy2=WH*c(.9,.23) ), + line(xy1=WH*c(.5,.4), xy2=WH*c(.5,.9) ), + polygon(points=WH*c( .5,.3, .7,.5, .3,.5)) + +) +``` +****************** + +****************** +POPUP +``` +update (Step 7) +``` +SNIPPET +``` +wh=${1:c(400,400)} +updateShinyInputControlAA(session=shinysession, inputId=inputId, wh=wh, value=value ) +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) + + +svgR(wh=WH, stroke.width=3, stroke="#00FFFF", fill="#00FFFF", + line(xy1=WH*c(.1,.1), xy2=WH*c(.9,.1) ), + line(xy1=WH*c(.1,.23), xy2=WH*c(.9,.23) ), + polygon(points=WH*c( .5,.3, .7,.5, .3,.5)), + polyline(points=WH*c(.1, .5, .1,.85, .5,.85, .5,.4 ) , fill="none") +) +``` +********************* + diff --git a/inst/App/projectTemplates/shinyInput/aux/dnds/jstools.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds similarity index 78% rename from inst/App/projectTemplates/shinyInput/aux/dnds/jstools.dnds rename to inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds index baf3ee98..7f8896c8 100644 --- a/inst/App/projectTemplates/shinyInput/aux/dnds/jstools.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds @@ -6,22 +6,52 @@ output: dnd_snippet --- +****************** +POPUP +``` +get element data (Steps 3.2?) +``` +SNIPPET +``` + $(el).data('${0:(valueName)}'); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-.06*WH[1] +d<-list(M=WH*c(.8,.42), Q=WH*c(c(.8,.8),c(.2,.8))) + +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), + lapply(1:5, function(i){ + ellipse( + cxy=c(.6, .8-i*.1)*WH, + rxy=c(.2,.1)*WH, + stroke='black', + fill='#00FFFF', + stroke='black', + stroke.width=.5 + ) + }) +) +``` +****************** + ********************* POPUP ``` -add mouse2pt function +From String (step 3.2? 6.3.1?) ``` SNIPPET ``` -mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id +" svg"); - var pt= thisSVG.createSVGPoint(); - pt.x = x; - pt.y = y; - return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); -} +JSON.parse(${1:'{x:1, y:1\}'}) ``` SVGR ``` @@ -30,35 +60,135 @@ WH<-c(48,32) ptR<-list( x=matrix(0,2,0) ) -R<-WH[1]*.2 -CXY=WH*c(.3,.5) - - +r=WH[2]/3 +lft=WH[1]/2-1.5*r +top<-WH[2]/2-r +bot<-WH[2]/2+r svgR(wh=WH, - circle(cxy=CXY+c(-R,-R), r=R/4, fill='#00FFFF'), - circle(cxy=CXY+c(-R,+R), r=R/4, fill='#00FFFF'), + polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), circle( - cxy=CXY, - r=R, + cxy=WH/2, + r=WH[2]/3, + stroke='none', fill='#00FFFF' ), - rect(xy=CXY-c(0,R), wh=c(.5,.6)*WH, fill='#00FFFF'), - line(xy1=CXY-c(0,R),xy2=CXY+c(0,R), stroke='black'), - line(xy1=CXY-c(R,0),xy2=CXY, stroke='black'), - #polygon(points=WH*c(c(.1,.5),c(.25,.2),c(.25,.8)), fill='#00FFFF'), - text(cxy=WH/2, "xy") + path( + d=list( + M=c(.4,.8)*WH, + C=c( c(.6,1.2),c(.9,.2), c(.8,.9))*WH + ), + stroke='#00FFFF', + stroke.width=1, + fill='none' + ), + g( + lapply(1:3, function(i){ + ellipse(cxy=WH*c(.5, .1), rxy=i*c(8,3), fill='none', stroke='#000000', stroke.width=.5) + }), + mask=mask(circle(cxy=WH/2, r=WH[2]/3), fill='white' ) + ), + g( + lapply(1:5, function(i){ + ellipse(cxy=WH*c(.7, .5), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) + }), + mask=mask( + circle(cxy=WH/2, r=WH[2]/3, fill='white'), + ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black') + ) + ), + g( + lapply(1:5, function(i){ + ellipse(cxy=WH*c(.3, .3), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) + }), + mask=mask( + circle(cxy=WH/2, r=WH[2]/3, fill='white'), + ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black'), + ellipse(cxy=WH*c(.7, .5), rxy=5*c(3,5), fill='black') + ) + ) +) +``` +********************* + +****************** +POPUP +``` +set element data (Step 3.2?) +``` +SNIPPET +``` + $(el).data('${1:(valueName)'}, ${0:(value)}); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-.06*WH[1] +d<-list(M=WH*c(.8,.85), Q=WH*c(c(.12,.85),c(.12,.52))) + +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + polygon(points=WH*c(c(.25,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + rect(cxy=WH*c(.1,.5), wh=WH*c(.1,.1),fill="#00FFFF"), + lapply(1:5, function(i){ + ellipse( + cxy=c(.6, .8-i*.1)*WH, + rxy=c(.2,.1)*WH, + stroke='black', + fill='#00FFFF', + stroke='black', + stroke.width=.5 + ) + }) +) +``` + +********************* + +******************** +POPUP +``` +Trigger +``` +SNIPPET +``` +${1:$(el)}.trigger(${0:"change"}); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +X=c(.2,.4,.6,.8) +D<-list( + M=c(.2,.2), + Q=c( ) +) +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + path(d=c("M",c(10,5), "Q", c(5,20), c(25,25) , "T", c(40,5)) , fill='#00FFFF'), + path(d=c("M",c(12,8), "Q", c(8,20), c(25,22) , "T", c(36,8)) , fill='black'), + path(d=c( "M", c(24,8), "C", c(22,10), c(30,10), c( 18,18), "Q" , c(30,15), c(28,10), c(32,10), c(32,8)),fill='#00FFFF') + + ) ``` +****************** + ********************* POPUP ``` -add mouse click +add mouse click (step 4.1) ``` SNIPPET ``` clicked: function(ctrlId, evt ){ - ${0:0} + alert('hi from '+ ctrlId); } ``` SVGR @@ -92,15 +222,22 @@ svgR(wh=WH, stroke="#00FFFF", fill="none", ``` ****************** +********************* + + POPUP ``` -replace node +add mouse2pt function ``` SNIPPET ``` - var htm=data.${1,value}; //value - var node=jQuery.parseHTML( htm ); - ${0,(el)}.empty().append(node); +mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord + var thisSVG=document.querySelector("#" + id +" svg"); + var pt= thisSVG.createSVGPoint(); + pt.x = x; + pt.y = y; + return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); +} ``` SVGR ``` @@ -109,32 +246,78 @@ WH<-c(48,32) ptR<-list( x=matrix(0,2,0) ) -R<-.06*WH[1] -d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) +R<-WH[1]*.2 +CXY=WH*c(.3,.5) -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - #circle(cxy=WH*c(.2,.2), fill="#00FFFF", r=R), - #circle(cxy=WH*c(.8,.2), fill="#00FFFF", r=R), - #rect(xy=WH*c(.16,.32), fill="#00FFFF", wh=c(.6,.16)*WH), - text(xy=WH*c(.16,.38),'html', stroke.width=1, fill="#00FFFF"), - circle(cxy=WH*(c(1,1)-c(.2,.2)), r=R), - path(d=d, stroke="#00FFFF", - marker.end=marker(viewBox=c(0, 0, 10, 10), refXY=c(1,5), stroke.width=1, fill="#00FFFF", - markerWidth=4, markerHeight=5, orient="auto", - path( d=c("M", 0, 0, "L", 9, 5, "L", 0, 9, "z") ) - ) - ) + +svgR(wh=WH, + circle(cxy=CXY+c(-R,-R), r=R/4, fill='#00FFFF'), + circle(cxy=CXY+c(-R,+R), r=R/4, fill='#00FFFF'), + circle( + cxy=CXY, + r=R, + fill='#00FFFF' + ), + rect(xy=CXY-c(0,R), wh=c(.5,.6)*WH, fill='#00FFFF'), + line(xy1=CXY-c(0,R),xy2=CXY+c(0,R), stroke='black'), + line(xy1=CXY-c(R,0),xy2=CXY, stroke='black'), + text(cxy=WH/2, "xy") ) ``` -****************** -****************** +********************* + +POPUP +``` +extract value from data (6.3.1) +``` +SNIPPET +``` +var value = data.value; +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +svgR(wh=WH, + text(cxy=WH/2, "Xval", stroke='#00FFFF', fill='#00FFFF') +) +``` +********************* +********************* + POPUP ``` -get attribute +set this value (6.3.3) ``` SNIPPET ``` - var attr = $(el).attr(`${1:data-Z}`); +this.setValue($(el), value); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +svgR(wh=WH, + text(cxy=WH/2, "Sval", stroke='#00FFFF', fill='#00FFFF') +) +``` +********************* +********************* + +POPUP +``` +replace svg tree (Step 6.4.3) +``` +SNIPPET +``` +var node=data.${0:value}; //value +$(el).empty().append(node); ``` SVGR ``` @@ -147,7 +330,11 @@ R<-.06*WH[1] d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - text(xy=WH*c(.2,.38),'attr', stroke.width=1, fill="#00FFFF"), + text(xy=WH*c(.16,.38),'svg', stroke.width=1, fill="#00FFFF"), + ellipse(cxy=WH*(c(1,1)-c(.2,.55)), rxy=R*c(2,1), fill="#00FFFF"), + line(xy1=WH*(c(1,1)-c(.2,.1)), xy2=WH*(c(1,1)-c(.2,.3)) ), + line(xy1=WH*(c(1,1)-c(.2,.3)), xy2=WH*(c(1,1)-c(.25,.5)),stroke.width=1.5 ), + line(xy1=WH*(c(1,1)-c(.2,.3)), xy2=WH*(c(1,1)-c(.15,.5)),stroke.width=1.9 ), path(d=d, stroke="#00FFFF", marker.end=marker(viewBox=c(0, 0, 10, 10), refXY=c(1,5), stroke.width=1, fill="#00FFFF", markerWidth=4, markerHeight=5, orient="auto", @@ -160,13 +347,12 @@ svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", ****************** POPUP ``` -get element data +set svg node attribute ``` SNIPPET ``` - var htm=data.${1,value}; //value - var node=jQuery.parseHTML( htm ); - ${0,(el)}.empty().append(node); +var node=document.getElementById( ${1:nodeId}); +node.setAttribute('${2:attrName}', ${0:attrValue}); ``` SVGR ``` @@ -176,21 +362,16 @@ ptR<-list( x=matrix(0,2,0) ) R<-.06*WH[1] -d<-list(M=WH*c(.8,.42), Q=WH*c(c(.8,.8),c(.2,.8))) +d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - lapply(1:5, function(i){ - ellipse( - cxy=c(.6, .8-i*.1)*WH, - rxy=c(.2,.1)*WH, - stroke='black', - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ) - }) +svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", + text(xy=WH*c(.2,.38),'attr', stroke.width=1, fill="#00FFFF"), + path(d=d, stroke="#00FFFF", + marker.end=marker(viewBox=c(0, 0, 10, 10), refXY=c(1,5), stroke.width=1, fill="#00FFFF", + markerWidth=4, markerHeight=5, orient="auto", + path( d=c("M", 0, 0, "L", 9, 5, "L", 0, 9, "z") ) + ) + ) ) ``` ****************** @@ -198,13 +379,11 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", ****************** POPUP ``` -set element data +set element data (Step 3.2?) ``` SNIPPET ``` - var htm=data.${1,value}; //value - var node=jQuery.parseHTML( htm ); - ${0,(el)}.empty().append(node); + $(el).data('${1:(valueName)'}, ${0:(value)}); ``` SVGR ``` @@ -240,11 +419,11 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", POPUP ``` -To string +To string ``` SNIPPET ``` -JSON.stringify(${1:obj}) +JSON.stringify(${1:{x:1, y:1}}) ``` SVGR ``` @@ -303,72 +482,6 @@ svgR(wh=WH, ) ``` ********************* - - -POPUP -``` -From string -``` -SNIPPET -``` -JSON.parse(${1:obj}) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -r=WH[2]/3 -lft=WH[1]/2-1.5*r -top<-WH[2]/2-r -bot<-WH[2]/2+r -svgR(wh=WH, - polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - circle( - cxy=WH/2, - r=WH[2]/3, - stroke='none', - fill='#00FFFF' - ), - path( - d=list( - M=c(.4,.8)*WH, - C=c( c(.6,1.2),c(.9,.2), c(.8,.9))*WH - ), - stroke='#00FFFF', - stroke.width=1, - fill='none' - ), - g( - lapply(1:3, function(i){ - ellipse(cxy=WH*c(.5, .1), rxy=i*c(8,3), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask(circle(cxy=WH/2, r=WH[2]/3), fill='white' ) - ), - g( - lapply(1:5, function(i){ - ellipse(cxy=WH*c(.7, .5), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask( - circle(cxy=WH/2, r=WH[2]/3, fill='white'), - ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black') - ) - ), - g( - lapply(1:5, function(i){ - ellipse(cxy=WH*c(.3, .3), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask( - circle(cxy=WH/2, r=WH[2]/3, fill='white'), - ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black'), - ellipse(cxy=WH*c(.7, .5), rxy=5*c(3,5), fill='black') - ) - ) -) -``` ********************* @@ -379,7 +492,7 @@ LOG ``` SNIPPET ``` -console.log(${1:'text '+} ${0:value}); +console.log(${1:'value='+} ${0:value}) ``` SVGR ``` @@ -415,36 +528,3 @@ svgR(wh=WH, ``` ********************* -POPUP -``` -Trigger -``` -SNIPPET -``` -${1:$(el)}.trigger(${0:"change"}); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -X=c(.2,.4,.6,.8) -D<-list( - M=c(.2,.2), - Q=c( ) -) -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - path(d=c("M",c(10,5), "Q", c(5,20), c(25,25) , "T", c(40,5)) , fill='#00FFFF'), - path(d=c("M",c(12,8), "Q", c(8,20), c(25,22) , "T", c(36,8)) , fill='black'), - path(d=c( "M", c(24,8), "C", c(22,10), c(30,10), c( 18,18), "Q" , c(30,15), c(28,10), c(32,10), c(32,8)),fill='#00FFFF') - - -) -``` -****************** - - - - diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds new file mode 100644 index 00000000..a66e3db9 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds @@ -0,0 +1,228 @@ +--- +title: "Dnd Snippet" +author: "Anonymous" +date: "TODAY" +output: dnd_snippet +--- + +********************* + +POPUP +``` +mouse click +``` +SNIPPET +``` +onclick='CMDS[${0:1}]' +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[1]*.2 +CXY=WH*c(.3,.5) +svgR(wh=WH, stroke="#00FFFF", fill="none", + g( + polygon( + points=c(WH)*c( + c(.0,.0),c(.2,.5), c(.05,.3), c(.05,.6), + c(-.05,.6),c(-.05,.3), c(-.2,.5) + ), + stroke="#00FFFF" + ), + lapply(c(0,45,135,180), function(theta){ + line(xy1=c(.1,0)*WH, xy2=c(.3,0)*WH, stroke="#00FFFF", + transform=list(rotate=-theta) + ) + }), + transform=list( translate=WH*c(.6,.45), rotate=65) + ) +) +``` + +****************** +********************* + + +POPUP +``` +mouse down +``` +SNIPPET +``` +onmousedown='CMDS[${0:1}]' +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[2]*.2 +CXY=WH*c(.5,.7) + + +svgR(wh=WH, + circle( + cxy=CXY, + r=R, + fill='#00FFFF' + ), + rect(xy=CXY-c(R,2*R), wh=c(2*R,2*R), fill='#00FFFF'), + line(xy1=CXY-c(R,0),xy2=CXY+c(R,0), stroke='black'), + line(xy1=CXY+c(0,R),xy2=CXY, stroke='black') + +) +``` +********************* + + +********************* + + +POPUP +``` +mouse up +``` +SNIPPET +``` +onmouseup='CMDS[${0:1}]' +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[2]*.2 +CXY=WH*c(.5,.3) + + +svgR(wh=WH, + circle( + cxy=CXY, + r=R, + fill='#00FFFF' + ), + rect(xy=CXY-c(R,0), wh=c(2*R,2*R), fill='#00FFFF'), + line(xy1=CXY-c(R,0),xy2=CXY+c(R,0), stroke='black'), + line(xy1=CXY-c(0,R),xy2=CXY, stroke='black') + +) +``` +********************* + +********************* + + +POPUP +``` +mouse over +``` +SNIPPET +``` +onmouseover='CMDS[${0:1}]' +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[2]*.2 +CXY=WH*c(.6,.4) + + +svgR(wh=WH, + rect(xy=WH*c(.2,.1), wh=c(.6,.8)*WH, stroke='#00FFFF', fill='none'), + circle( + cxy=CXY, + r=R, + fill='#00FFFF' + ), + rect(xy=CXY-c(2*R,R), wh=c(2*R,2*R), fill='#00FFFF'), + line(xy1=CXY-c(0,R),xy2=CXY+c(0,R), stroke='black'), + line(xy1=CXY+c(R,0),xy2=CXY, stroke='black') + +) +``` +********************* + +********************* + +POPUP +``` +mouse move +``` +SNIPPET +``` +onmousemove='CMDS[${0:1}]' +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[2]*.2 +CXY=WH*c(.6,.5) + + +svgR(wh=WH, + circle( + cxy=CXY, + r=R, + fill='#00FFFF' + ), + rect(xy=CXY-c(2*R,R), wh=c(2*R,2*R), fill='#00FFFF'), + line(xy1=CXY-c(0,R),xy2=CXY+c(0,R), stroke='black'), + line(xy1=CXY+c(R,0),xy2=CXY, stroke='black'), + line(xy1=CXY+c(-4*R,-R),xy2=CXY+c(-4*R,R), stroke='#00FFFF'), + line(xy1=CXY+c(-3*R,-R),xy2=CXY+c(-3*R,R), stroke='#00FFFF'), + line(xy1=CXY+c(-2.5*R,-R),xy2=CXY+c(-2.5*R,R), stroke='#00FFFF') +) +``` +****************** +********************* + +POPUP +``` +mouse out +``` +SNIPPET +``` +onmouseout='CMDS[${0:1}]' +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +R<-WH[2]*.2 +CXY=WH*c(.5,.5) + + +svgR(wh=WH, + circle( + cxy=CXY, + r=R, + fill='none' + , stroke='#00FFFF' + ), + rect(xy=CXY-c(2*R,R), wh=c(2*R,2*R), fill='black', stroke='#00FFFF'), + line(xy1=CXY-c(0,R),xy2=CXY+c(0,R), stroke='#00FFFF'), + line(xy1=CXY+c(R,0),xy2=CXY, stroke='#00FFFF') + +) +``` +****************** + diff --git a/inst/App/projectTemplates/shinyInput/aux/dnds/sampleShapes.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds similarity index 100% rename from inst/App/projectTemplates/shinyInput/aux/dnds/sampleShapes.dnds rename to inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds diff --git a/inst/App/projectTemplates/shinyInputControl/notes.Rmd b/inst/App/projectTemplates/shinyInputControl/notes.Rmd new file mode 100644 index 00000000..56322a87 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/notes.Rmd @@ -0,0 +1,136 @@ +--- +title: 'Notes on building shiny input controls' +author: 'author' +date: "2020-02-11" +output: html_document +--- + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +library(svgR) +``` + + + +# Details about the Strategies + + +## Notes on SVG +For initial SVG development it is convenient to keep the svgR in a seperate file +Thus we +- put svgR code in a seperate file: *shinyInputControl_svg.R* +- create a wrapper to source the svg +- call that wrapper from the constructor for *shinyInputControl* + +## Notes on Updating + +### What is updating + +Updating is the act of sending a message from the server to the client. +The message contains info to recreate appearence and value + +### What is the purpose of updating? + +The purpose of updating is to perform 2 objectives: + +- set a new value for the control +- change the control's appearence + + +### What are the steps of updating? + +- Starts in the server by calling the function *updateShinyInputControl* +- A message is formed to be sent to the client +- To send the message a call is made via *session\$sendInputMessage* +- The client receives the message in the function *receiveMessage* +- In *receiveMessage* + - extract the value + - reset the value via set value + - reset the appearence (via node manipulations) + +### Three Strategies to Update + +I. **Braindead**: (minimal js) + + 1. Recreate the svgTree with using new params + 2. Form message = value + svg + 3. send to the client + 4. client replaces tree and updates value + +II. **Mixedup**: + + 1. Recreate the svg with using new params + 2. get id of svg node that is affected + 3. Extract affected node from svg to send + 4. Form message = value + replacement-node + id of node + 5. send to the client + 6. find node given id and replace with replacement-node + +III. **Traditional**: (uses more js) + + 1. Form message = value + 2. Send to client + 3. Use javascript to update appearence base on value. + +We recommend the *Kindergarden* strategy to begin with. + + +## Notes on registerInputHandler + +### On the client side + +- svg sends a message to the **shinyInputControl**, probably **clicked** +- **clicked** resets the value via **setValue** +- The **setValue** function triggers a change message +- Inside the subscribe function a callback has been registered +to send a message containg the value to the server + +### On the server side + +#### Inputhandler +- The message from the client is received by the **inputhandler** + - The **inputhandler** was defined when we called **registerInputHandler** +- The **inputhandler** allows for preprocessing of the data before attaching it to the **input\$controlId** + - This preprocessing is need for lists, etc. + - The **inputhandler** returns a value to be assigned to **input\$controlId** + +#### How is the appearnce of the control changed? + +The appearance of the control can be changed in one of two ways: + +##### On the client side + +Prior to sending the value to the server via setValue use javascript to modify the appearance. +For example, one might do this inside the **:clicked** function. + +##### On the server side + +Inside the inputhandler function, after receiving the value, call an update with the +new value to force the client to redraw the control with that new value. + + +# Some supported events by SVG + +- SVG Mouse events + - onclick + - onmousedown + - onmouseup + - onmouseover + - onmousemove + - onmouseout +- SVG UIEvents + - onfocusin + - onfocusout + - onactivate +- SVG Misc + - onload + - onunload + - onabort + - onerror + - onresize + - onscroll + - onzoom + - onbegin + - onend + - onrepeat diff --git a/inst/App/projectTemplates/shinyInputControl/notes.html b/inst/App/projectTemplates/shinyInputControl/notes.html new file mode 100644 index 00000000..e34d582b --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/notes.html @@ -0,0 +1,550 @@ + + + + + + + + + + + + + + + +Notes on building shiny input controls + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+

Details about the Strategies

+
+

Notes on SVG

+

For initial SVG development it is convenient to keep the svgR in a seperate file Thus we - put svgR code in a seperate file: shinyInputControl_svg.R - create a wrapper to source the svg - call that wrapper from the constructor for shinyInputControl

+
+
+

Notes on Updating

+
+

What is updating

+

Updating is the act of sending a message from the server to the client. The message contains info to recreate appearence and value

+
+
+

What is the purpose of updating?

+

The purpose of updating is to perform 2 objectives:

+
    +
  • set a new value for the control
  • +
  • change the control’s appearence
  • +
+
+
+

What are the steps of updating?

+
    +
  • Starts in the server by calling the function updateShinyInputControl
  • +
  • A message is formed to be sent to the client
  • +
  • To send the message a call is made via session$sendInputMessage
  • +
  • The client receives the message in the function receiveMessage
  • +
  • In receiveMessage +
      +
    • extract the value
    • +
    • reset the value via set value
    • +
    • reset the appearence (via node manipulations)
    • +
  • +
+
+
+

Three Strategies to Update

+
    +
  1. Braindead: (minimal js)

    +
    1. Recreate the svgTree with using new params 
    +2. Form message = value + svg
    +3. send to the client
    +4. client replaces tree and updates value
  2. +
  3. Mixedup:

    +
    1. Recreate the svg with using new params 
    +2. get id of svg node that is affected
    +3. Extract affected node from svg to send
    +4. Form message = value + replacement-node + id of node
    +5. send to the client
    +6. find node given id and replace with replacement-node
  4. +
  5. Traditional: (uses more js)

    +
      +
    1. Form message = value
    2. +
    3. Send to client
    4. +
    5. Use javascript to update appearence base on value.
    6. +
  6. +
+

We recommend the Kindergarden strategy to begin with.

+
+
+
+

Notes on registerInputHandler

+
+

On the client side

+
    +
  • svg sends a message to the shinyInputControl, probably clicked
  • +
  • clicked resets the value via setValue
  • +
  • The setValue function triggers a change message
  • +
  • Inside the subscribe function a callback has been registered to send a message containg the value to the server
  • +
+
+
+

On the server side

+
+

Inputhandler

+
    +
  • The message from the client is received by the inputhandler +
      +
    • The inputhandler was defined when we called registerInputHandler
    • +
  • +
  • The inputhandler allows for preprocessing of the data before attaching it to the input$controlId +
      +
    • This preprocessing is need for lists, etc.
    • +
    • The inputhandler returns a value to be assigned to input$controlId
    • +
  • +
+
+
+

How is the appearnce of the control changed?

+

The appearance of the control can be changed in one of two ways:

+
+
On the client side
+

Prior to sending the value to the server via setValue use javascript to modify the appearance. For example, one might do this inside the :clicked function.

+
+
+
On the server side
+

Inside the inputhandler function, after receiving the value, call an update with the new value to force the client to redraw the control with that new value.

+
+
+
+
+
+
+

Some supported events by SVG

+
    +
  • SVG Mouse events +
      +
    • onclick
    • +
    • onmousedown
    • +
    • onmouseup
    • +
    • onmouseover
    • +
    • onmousemove
    • +
    • onmouseout
    • +
  • +
  • SVG UIEvents +
      +
    • onfocusin
    • +
    • onfocusout
    • +
    • onactivate
    • +
  • +
  • SVG Misc +
      +
    • onload
    • +
    • onunload
    • +
    • onabort
    • +
    • onerror
    • +
    • onresize
    • +
    • onscroll
    • +
    • onzoom
    • +
    • onbegin
    • +
    • onend
    • +
    • onrepeat
    • +
  • +
+
+ + + + +
+ + + + + + + + diff --git a/inst/App/projectTemplates/shinyInputControl/readme.Rmd b/inst/App/projectTemplates/shinyInputControl/readme.Rmd new file mode 100644 index 00000000..f3a5c9f2 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/readme.Rmd @@ -0,0 +1,331 @@ +--- +title: 'svgR in a Markdown Doc' +author: 'author' +date: "2020-02-04" +output: html_document +--- + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = FALSE) +library(svgR) +``` + + +# Steps to Implement *shinyInputControl* + +### 1. Building your svg + +```{r, results='asis', } +WH<-c(400,200) +svgR(wh=WH,text('STEP1',xy=c(20,20)), + rect( + xy=c(100,5), + wh=c(250,90), + fill='#BBFFBB', + stroke='blue', + stroke.width=3 + ), + + text('shinyInputControl_svg.R',xy=c(100,5)+c(10,20),stroke='blue' ), + text('add to',cxy=c(250,50)), + text('params and svgR',cxy=c(250,70)), + rect( + xy=c(100,100), + wh=c(250,50), + fill='#BBFFBB', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,100)+c(10,20),stroke='blue' ), + text('commit to test',cxy=c(250,120)) +) +```` + +1. In file **shinyInputControl_svg.R** + - Add to Parameters section as needed + - Parameters section contains variables: + - WH (width height) + - ID for the contol id + - CMDS (may supply more than one) + - Add here anything you want to be adjustable + - add to the svgR(){} what you want to see +2. commit to test image + +### 2. Adding mouse events + +```{r, results='asis'} +WH<-c(400,200) +svgR(wh=WH,text('STEP2',xy=c(20,20)), + rect( + xy=c(100,5), + wh=c(250,90), + fill='#BBFFBB', + stroke='blue', + stroke.width=3 + ), + + text('shinyInputControl_svg.R',xy=c(100,5)+c(10,20),stroke='blue' ), + text('add mouse events',cxy=c(250,50)), + rect( + xy=c(100,100), + wh=c(250,50), + fill='pink', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,100)+c(10,20),stroke='blue' ), + text('run to test',cxy=c(250,120)) +) +```` + +- In file **shinyInputControl_svg.R** + - add *onclick=CMDS* for interactivity +- run **App.R** and test for on an click message +- use browser to verify value was assigned + +### 3. Initializing the Control + +```{r, results='asis', } +WH<-c(400,300) +svgR(wh=WH, text('STEP3',xy=c(20,20)), + rect( + xy=c(100,5), + wh=c(250,90), + fill='lightyellow', + stroke='blue', + stroke.width=3 + ), + + text('shinyInputControl.R',xy=c(100,5)+c(10,20),stroke='blue' ), + text('edit shinyInputControl()',cxy=c(250,50)), + rect( + xy=c(100,102), + wh=c(250,90), + fill='lightblue', + stroke='blue', + stroke.width=3 + ), + + text('shinyInputControl.js',xy=c(100,105)+c(10,20),stroke='blue' ), + text('edit shinyInputControl()',cxy=c(250,150)), + rect( + xy=c(100,200), + wh=c(250,50), + fill='pink', + stroke='blue', + stroke.width=3 + ), + + text('app.R',xy=c(100,200)+c(10,20),stroke='blue' ), + text('run to test',cxy=c(250,220)) +) +```` + +1. In file **shinyInputControl.R** + - in function *shinyInputControl()* + - if necessary + - preprocess the *value* argument + - edit params + - edit 'data-value'=value +2. In file **shinyInputControl.js** + - in function **initialize** + - do any needed processing of data here + - if a data value is a string representing an object + - get value from data-value using 'get element data' dnd + - convert into object using 'From String' dnd + - set data-value using 'set element data' dnd +3. run **App.R** and use browser to verify data-value attached + - in the browser panel (right hand side) + - locate the div with the id matching your control id + - verify that the data-value attribute appears and has the value you assigned + +### 4. Adding Mouseclick Handler + +```{r, results='asis', } +WH<-c(400,260) +svgR(wh=WH, + rect( + xy=c(100,5), + wh=c(250,90), + fill='lightblue', + stroke='blue', + stroke.width=3 + ), + text('STEP4',xy=c(20,20)), + text('shinyInputControl.js',xy=c(100,5)+c(10,20),stroke='blue' ), + text('add clicked:',cxy=c(250,50)), + rect( + xy=c(100,102), + wh=c(250,90), + fill='lightyellow', + stroke='blue', + stroke.width=3 + ), + text('shinyInputControl.R',xy=c(100,105)+c(10,20),stroke='blue' ), + text('edit params$CMDS',cxy=c(250,150)), + rect( + xy=c(100,200), + wh=c(250,50), + fill='pink', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,200)+c(10,20),stroke='blue' ), + text('run to test',cxy=c(250,220)) +) +```` + +1. In **shinyInputControl.js** + - add handler **clicked:** (assuming that you are using mouse click) + - typically this will + - getValue + - do something + - setValue +2. In **shinyInputControl.R** + - edit **params\$CMDS** to use cmd in client. (clicked) + - **sprintf('shinyInputControlBinding.clicked("%s", evt)',params\$ID)** +3. run **App.R** and use browser to verify data-value is modified on click + +### 5. Handling Return Values From Client + +```{r, results='asis', } +WH<-c(400,160) +svgR(wh=WH, + rect( + xy=c(100,5), + wh=c(250,90), + fill='lightyellow', + stroke='blue', + stroke.width=3 + ), + text('STEP5',xy=c(20,20)), + text('shinyInputControl.R',xy=c(100,5)+c(10,20),stroke='blue' ), + text('registerInputHandler',cxy=c(250,50)), + rect( + xy=c(100,102), + wh=c(250,50), + fill='pink', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,102)+c(10,20),stroke='blue' ), + text('run to test',cxy=c(250,120)) +) +```` + +1. In file **shinyInputControl.R** + - in *registerInputHandler* + - do any post processing of value and return value +2. test return value of input\$controlId in App.R + +### 6. Implement Update using a Braindead Approach + +```{r, results='asis', } +WH<-c(400,400) +svgR(wh=WH, text('STEP6',xy=c(20,20)), + rect( + xy=c(100,5), + wh=c(250,90), + fill='pink', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,5)+c(10,20),stroke='blue' ), + text('edit observer for update',cxy=c(250,50)), + rect( + xy=c(100,102), + wh=c(250,100), + fill='lightyellow', + stroke='blue', + stroke.width=3 + ), + text('shinyInputControl.R',xy=c(100,105)+c(10,20),stroke='blue' ), + text('recreate svgTree',xy=c(200,150)), + text('create message', xy=c(200,165)), + text('send message', xy=c(200,180)), + + rect( + xy=c(100,210), + wh=c(250,100), + fill='lightblue', + stroke='blue', + stroke.width=3 + ), + text('shinyInputControl.js',xy=c(100,212)+c(10,20),stroke='blue' ), + text('extract value from data',xy=c(200,250)), + text('set element withvalue', xy=c(200,265)), + text('extract and replace tree', xy=c(200,280)), + rect( + xy=c(100,317), + wh=c(250,80), + fill='pink', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,317)+c(10,20),stroke='blue' ), + text('run to test',xy=c(200,350)+c(10,20) ) +) +```` + + +1. In **App.R** + - Edit *observeEvent(input\$updateButton* to call + - *updateshinyInputControl* with the proper value +2. In file **shinyInputControl.R** (use dnd) + 1. Recreate svg Tree, edit params=list as necessary + - params=list(ID=inputId, WH=wh, value=value) + - svgTree<-*shinyInputControlWrapper*(params=params) + - node<-as.character(svgTree) + 2. Form message + mssg<-list( value=value, node=node) + 3. Send message to client + - session\$sendInputMessage(inputId, mssg) +3. In file **shinyInputControl.js** in function *receivemessage* + 1. extract value(s) + - var value = data.value; + 2. Possibly convert to object: i.e. value=JSON.parse(value); + 3. set element with new data + - this.setValue($(el), value); + 4. update svg rendering by replacing the entire svgTree under the $(el) + - var node=data.node; + - \$(el).empty().append(node); //this replaces the svgTree +4. In **App.R** validate that *updateshinyInputControl* works: + - the appearance changes + - value changes + +### 7. Updating the Appearance Upon Receiving Input + +```{r, results='asis', } +WH<-c(400,160) +svgR(wh=WH, text('STEP7',xy=c(20,20)), + rect( + xy=c(100,5), + wh=c(250,90), + fill='lightyellow', + stroke='blue', + stroke.width=3 + ), + text('shinyInputControl.R',xy=c(100,5)+c(10,20),stroke='blue' ), + text('add to registerInputHandler',cxy=c(250,50)), + text('updateShinyInputControl(...)',cxy=c(250,70)), + rect( + xy=c(100,102), + wh=c(250,50), + fill='pink', + stroke='blue', + stroke.width=3 + ), + text('app.R',xy=c(100,102)+c(10,20),stroke='blue' ), + text('run to test',cxy=c(250,120)) +) +```` + + + +- In **shinyInputControl.R** + - In *registerInputHandler* prior to returning value + - add *updateshinyInputControl(...)* + + + diff --git a/inst/App/projectTemplates/shinyInputControl/readme.html b/inst/App/projectTemplates/shinyInputControl/readme.html new file mode 100644 index 00000000..0923bd94 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/readme.html @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + +svgR in a Markdown Doc + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+

Steps to Implement shinyInputControl

+
+

1. Building your svg

+ +STEP1 shinyInputControl_svg.R add to params and svgR app.R commit to test + +
    +
  1. In file shinyInputControl_svg.R +
      +
    • Parameters section +
        +
      • contains variables: +
          +
        • WH (width height)
        • +
        • ID for the contol id
        • +
        • CMDS (may supply more than one)
        • +
      • +
      • Add here anything you want to be adjustable
      • +
    • +
    • add to the svgR(){} what you want to see
    • +
  2. +
  3. commit to test image
  4. +
+
+
+

2. Adding mouse events

+ +STEP2 shinyInputControl_svg.R add mouse events app.R run to test + +
    +
  • In file shinyInputControl_svg.R +
      +
    • add onclick=CMDS for interactivity
    • +
  • +
  • run App.R and test for on an click message
  • +
  • use browser to verify value was assigned
  • +
+
+
+

3. Initializing the Control

+ +STEP3 shinyInputControl.R edit shinyInputControl() shinyInputControl.js edit shinyInputControl() app.R run to test + +
    +
  1. In file shinyInputControl.R +
      +
    • in function shinyInputControl() +
        +
      • if necessary +
          +
        • preprocess the value argument
        • +
        • edit params
        • +
        • edit ‘data-value’=value
        • +
      • +
    • +
  2. +
  3. In file shinyInputControl.js +
      +
    • in function initialize +
        +
      • do any needed processing of data here +
          +
        • if a data value is a string representing an object +
            +
          • get value from data-value using ‘get element data’ dnd
          • +
          • convert into object using ‘From String’ dnd
          • +
          • set data-value using ‘set element data’ dnd
          • +
        • +
      • +
    • +
  4. +
  5. run App.R and use browser to verify data-value attached +
      +
    • in the browser panel (right hand side) +
        +
      • locate the div with the id matching your control id
      • +
      • verify that the data-value attribute appears and has the value you assigned
      • +
    • +
  6. +
+
+
+

4. Adding Mouseclick Handler

+ + STEP4 shinyInputControl.js add clicked: shinyInputControl.R edit params$CMDS app.R run to test + +
    +
  1. In shinyInputControl.js +
      +
    • add handler clicked: (assuming that you are using mouse click) +
        +
      • typically this will +
          +
        • getValue
        • +
        • do something
        • +
        • setValue
        • +
      • +
    • +
  2. +
  3. In shinyInputControl.R +
      +
    • edit params$CMDS to use cmd in client. (clicked) +
        +
      • sprintf(‘shinyInputControlBinding.clicked(“%s”, evt)’,params$ID)
      • +
    • +
  4. +
  5. run App.R and use browser to verify data-value is modified on click
  6. +
+
+
+

5. Handling Return Values From Client

+ + STEP5 shinyInputControl.R registerInputHandler app.R run to test + +
    +
  1. In file shinyInputControl.R +
      +
    • in registerInputHandler +
        +
      • do any post processing of value and return value
      • +
    • +
  2. +
  3. test return value of input$controlId in App.R
  4. +
+
+
+

6. Implement Updating using a Braindead Approach

+ +STEP6 app.R edit observer for update shinyInputControl.R recreate svgTree create message send message shinyInputControl.js extract value from data set element withvalue extract and replace tree app.R run to test + +
    +
  1. In App.R +
      +
    • Edit observeEvent(input$updateButton to call
    • +
    • updateshinyInputControl with the proper value
    • +
  2. +
  3. In file shinyInputControl.R (use dnd) +
      +
    1. Recreate svg Tree, edit params=list as necessary +
        +
      • params=list(ID=inputId, WH=wh, value=value)
      • +
      • svgTree<-shinyInputControlWrapper(params=params)
      • +
      • node<-as.character(svgTree)
      • +
    2. +
    3. Form message mssg<-list( value=value, node=node)
    4. +
    5. Send message to client +
        +
      • session$sendInputMessage(inputId, mssg)
      • +
    6. +
  4. +
  5. In file shinyInputControl.js in function receivemessage +
      +
    1. extract value(s) +
        +
      • var value = data.value;
      • +
    2. +
    3. Possibly convert to object: i.e. value=JSON.parse(value);
    4. +
    5. set element with new data +
        +
      • this.setValue($(el), value);
      • +
    6. +
    7. update svg rendering by replacing the entire svgTree under the $(el) +
        +
      • var node=data.node;
      • +
      • $(el).empty().append(node); //this replaces the svgTree
      • +
    8. +
  6. +
  7. In App.R validate that updateshinyInputControl works: - the appearance changes - value changes
  8. +
+
+
+

7. Updating the Appearance Upon Receiving Input

+ +STEP7 shinyInputControl.R add to registerInputHandler updateShinyInputControl(…) app.R run to test + +
    +
  • In shinyInputControl.R +
      +
    • In registerInputHandler prior to returning value +
        +
      • add updateshinyInputControl(…)
      • +
    • +
  • +
+
+
+ + + + +
+ + + + + + + + diff --git a/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R new file mode 100644 index 00000000..e9a6bd00 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R @@ -0,0 +1,75 @@ +library(shiny) +library(svgR) +# library(jsonlite) + +try({ removeInputHandler("shinyInputControlBinding") }) + +# add any helper functions here + + + +# create simple wrapper around svgR code +shinyInputControlSvgWrapper<-function(params){ + + params$CMDS<-"alert('Wrapper: new command(s)')" + + # STEP 4.2: replace params$CMDS as appropriate + + # fill the wrapper + source('shinyInputControl_svg.R', local=T)$value +} + + +# Control constructor to insert in app ui +shinyInputControl<-function(inputId, wh=c(400,400), value='whatever' ){ +# note: use toJSON for non-trivial initializations + # STEP 3.1 + # STEP 3.1.1 Place any preprocessing of (initial input) value(s) here + # STEP 3.1.2 adjust params list as desired + params<-list(ID=inputId, WH=wh, value=value) + + tagList( + singleton(tags$head(tags$script(src = "shinyInputControl.js"))), + div( id=inputId, + class="shinyInputControl", + HTML(as.character( + shinyInputControlSvgWrapper(params) + )), + # STEP 3.3 customize for initialization by attaching data-*** to this div + # Note: + # 'data-xxx'=yyy only accepts vectors of length 1 + # for more complex data, try using toJSON to convert value + 'data-value'=value + ) + ) +} + + +# server to client update +updateShinyInputControl<-function(session, inputId, wh=c(400,400), value='bogus'){ + # Perform any value preprocessing here (toJSON if needed) + # STEP 6.2 Using Braindead Update Approach: + # STEP 6.2.1. Recreate svg Tree + # STEP 6.2.2. Form message + # STEP 6.2.3. Send message to client +} + + +# preprocess data returned to server from the client +shiny::registerInputHandler( + "shinyInputControlBinding", + function(value, shinysession, inputId) { + if(is.null(value) ) { + return("NULL") + } else { + # STEP 5: process value (may use fromJSON) + + # STEP 7: add updateShinyInputControl() + + return(value) + } + } +) + + + diff --git a/inst/App/projectTemplates/shinyInput/shinyInput.pprj b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.pprj similarity index 81% rename from inst/App/projectTemplates/shinyInput/shinyInput.pprj rename to inst/App/projectTemplates/shinyInputControl/shinyInputControl.pprj index ccd1344d..c434297e 100644 --- a/inst/App/projectTemplates/shinyInput/shinyInput.pprj +++ b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.pprj @@ -1,9 +1,9 @@ { "pathToProj": [ - "/home/sup/AA/shinyInput" + "~/BB/shinyInputControl" ], "projName": [ - "shinyInput.pprj" + "shinyInputControl.pprj" ], "projType": [ [ diff --git a/inst/App/projectTemplates/shinyInputControl/shinyInputControl_svg.R b/inst/App/projectTemplates/shinyInputControl/shinyInputControl_svg.R new file mode 100644 index 00000000..4247149e --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/shinyInputControl_svg.R @@ -0,0 +1,32 @@ +library(svgR) +library(tidyverse) + +#-------- params ---------------------- +#` default params +WH<-c(400,400) +CMDS<-"alert('control triggered')" +ID<-'mycontrol' + +# STEP 1.1: add params + +#----------function override of params---------- +if(exists("params") ){ + for(n in names(params)){ + assign(n, params[[n]]) + } +} + +#-----any R helper code goes here-------------------------- + +svgR(wh=WH, + #your custom code goes here + NULL + #STEP 1.2: add to svgR to create image + #STEP 2: mouse events (such as onclick=CMDS) +) + + + + + + diff --git a/inst/App/projectTemplates/shinyInputControl/www/shinyInputControl.js b/inst/App/projectTemplates/shinyInputControl/www/shinyInputControl.js new file mode 100644 index 00000000..c6611770 --- /dev/null +++ b/inst/App/projectTemplates/shinyInputControl/www/shinyInputControl.js @@ -0,0 +1,59 @@ +// JAVASCRIPT + +//INPUT BINDING +var shinyInputControlBinding = new Shiny.InputBinding(); +$.extend(shinyInputControlBinding, { + find: function(scope) { + return $(scope).find(".shinyInputControl"); + }, + initialize: function(el){ + // STEP 3.2 Initialize element data here: + // may use the dnds: + // 1. get element data, 'from string dnd' + }, + getValue: function(el) { + // Used for returning the value(s) of this input control + // Typically, held as element data, ie. $(el).data('value') + + var value = $(el).data('value'); + // if value is an object, may want to use JSON.stringify + return value ; + }, + setValue: function(el, value) { + // used for updating input control + // Typically + // 1. set element data value + $(el).data('value', value) + // 2. then trigger element change + $(el).trigger("change"); + }, + subscribe: function(el, callback) { + // notify server whenever change + $(el).on("change.shinyInputControlBinding", function(e) { + callback(); + }); + }, + unsubscribe: function(el) { + $(el).off(".shinyInputControlBinding"); + }, + receiveMessage: function(el, data) { //called when server sends update message + if(!!data.value){ + // handle update here + // Step 6.3 + // Typically: + // 6.3.1. extract value(s) from data: Xval dnd + // 6.3.2. Possibly convert to object: may use 'fromString' dnd + // 6.3.3. set element with new data: may use Sval dnd + // 6.3.4. update svg rendering (if necessary :) (svg-tree dnd) + } + }, + // STEP 4.1 add handler clicked + + getType: function(el){ + return "shinyInputControlBinding"; + } +}); + +// REGISTER INPUT BINDING +Shiny.inputBindings.register(shinyInputControlBinding); + From e3f73d9c822fb8416611f127a06fc45630bfff12 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 13:12:03 -0500 Subject: [PATCH 005/263] Add 'Rmd' extension to file open --- inst/App/fileIO/serverShinyFiles.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/fileIO/serverShinyFiles.R b/inst/App/fileIO/serverShinyFiles.R index d025dc1c..3c5c83fa 100644 --- a/inst/App/fileIO/serverShinyFiles.R +++ b/inst/App/fileIO/serverShinyFiles.R @@ -23,7 +23,7 @@ # } shinyFileChoose(input, "buttonFileOpen", session=session, roots=c(home="~"), - filetypes=c('R','PTR','SVGR','js','dnds')) + filetypes=c('R','PTR','SVGR','js','dnds', 'Rmd')) shinyFileChoose(input,"buttonFileOpenProject", session=session, roots=c(home="~"), filetypes=c('pprj')) shinyFileChoose(input,"buttonSnippetImport", session=session, roots=c(home="~"), filetypes=c('snip')) shinyFileChoose(input,"buttonDnippetImport", session=session, roots=c(home="~"), filetypes=c('dnds')) From 170a70086a0ccfd79954bb4230bc7e10f35f53ac Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 13:15:54 -0500 Subject: [PATCH 006/263] remove sample projects from menu --- inst/App/leftPanel/menu/UIbuildLeftMenu.R | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/inst/App/leftPanel/menu/UIbuildLeftMenu.R b/inst/App/leftPanel/menu/UIbuildLeftMenu.R index b4bf33f6..be93bf01 100644 --- a/inst/App/leftPanel/menu/UIbuildLeftMenu.R +++ b/inst/App/leftPanel/menu/UIbuildLeftMenu.R @@ -32,9 +32,7 @@ buildLeftMenu<-function(version){ ), - menuDropdown('Sample Project', - UIProjectSampleMenu() - ), + # menuDropdown('Sample Project', UIProjectSampleMenu()), menuDropdown("Recent Projects"), menuDivider(), shinyDMDMenu::menuItem("Open File", value='openFile'), From d330752bbf5682d49dbf73950da4bccd6f4c4bf4 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 18 Feb 2020 13:49:13 -0500 Subject: [PATCH 007/263] Bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 42057b27..f3f7786f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2019-12-30 Title: pointR -Version: 0.4.1.11 +Version: 0.4.2.0 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR From b9108be0d566b285d33b507168ad6b33209b6439 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 20 Feb 2020 11:17:24 -0500 Subject: [PATCH 008/263] template to use matrix(0,2,0) --- inst/App/templates/ptRTemplate.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/templates/ptRTemplate.R b/inst/App/templates/ptRTemplate.R index ac4d2735..5710720d 100644 --- a/inst/App/templates/ptRTemplate.R +++ b/inst/App/templates/ptRTemplate.R @@ -6,7 +6,7 @@ WH<-c(600,400) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) From 4e9a3dcbc535bad923fbb04c8f311e1b1155587e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 20 Feb 2020 15:58:05 -0500 Subject: [PATCH 009/263] when ptR list doesnot exist, adds new asset above svgR call --- inst/App/util/utilParser.R | 10 +++++----- inst/App/util/utilptR.R | 35 +++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/inst/App/util/utilParser.R b/inst/App/util/utilParser.R index 5e2c2c8d..2950055a 100755 --- a/inst/App/util/utilParser.R +++ b/inst/App/util/utilParser.R @@ -158,9 +158,9 @@ extractPositions<-function(csnCharLines, df){ # }) # } -# extractSVGRDF<-function(p.df, tag="svgR"){ -# df1<-subset(p.df, token=='SYMBOL_FUNCTION_CALL' & text ==tag & ggid==0) -# stopifnot(nrow(df1)==1) -# subset(p.df, id==df1$gid) -# } +extractSVGRDF<-function(p.df, tag="svgR"){ + df1<-subset(p.df, token=='SYMBOL_FUNCTION_CALL' & text ==tag & ggid==0) + stopifnot(nrow(df1)==1) + subset(p.df, id==df1$gid) +} diff --git a/inst/App/util/utilptR.R b/inst/App/util/utilptR.R index c7159e06..101d9f11 100755 --- a/inst/App/util/utilptR.R +++ b/inst/App/util/utilptR.R @@ -79,12 +79,35 @@ ptDef2ReplacementList<-function(name, newPtDef, txt){ # name arg not used??? p.df<-getParseDataFrame(txt) ptR.df<-extractTagDF(p.df, tag='ptR') - pt.Pos<-list( - startRow= ptR.df$line1 -1, - startColumn=ptR.df$col1 -1 , - endRow= ptR.df$line2 -1, - endColumn=ptR.df$col2 - ) + if(!is.null(ptR.df)){ + pt.Pos<-list( + startRow= ptR.df$line1 -1, + startColumn=ptR.df$col1 -1 , + endRow= ptR.df$line2 -1, + endColumn=ptR.df$col2 + ) + } else { + svgR.df<-extractSVGRDF(p.df) + if(nrow(svgR.df)>0){ + pt.Pos<-list( + startRow= svgR.df$line1 -1, + startColumn=0 , + endRow= svgR.df$line1 -1, + endColumn= 0 + ) + pt.repl<-paste0(pt.repl,' \n \n') + } + else { + pt.Pos<-list( + startRow= 0, + startColumn=0 , + endRow= 0, + endColumn= 0 + ) + pt.repl<-paste0(pt.repl,' \n \n') + } + } + replacementList<-c(replacementList, list(list(rng=pt.Pos, txt= pt.repl))) replacementList } From 3098f84c370792a71c10c6c24c436511fa573958 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 18 Mar 2020 13:25:36 -0400 Subject: [PATCH 010/263] getColType returns NULL if tibColName is NULL --- inst/App/rightPanel/serverPanelCoordinator.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/serverPanelCoordinator.R b/inst/App/rightPanel/serverPanelCoordinator.R index 741a4ebe..e2d852b4 100644 --- a/inst/App/rightPanel/serverPanelCoordinator.R +++ b/inst/App/rightPanel/serverPanelCoordinator.R @@ -59,7 +59,10 @@ getNameType<-reactive({ # 3. getTibEntry, getTibEntryChoices # and use it only for whether or not the column is a 'points' column. getColumnType<-reactive({ - colName<-getTibColumnName() + colName<-getTibColumnName() # i.e. selectedAsset$columnName + if(is.null(colName)){ + return(NULL) + } columnValues<-getTib()[[colName]] if(!is.null(columnValues)){ return(extractColType(columnValues)) From a9a0f3ff8108122c5e345a15d47985254f8d22b5 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 18 Mar 2020 13:28:11 -0400 Subject: [PATCH 011/263] 1. replace getColumnType== with identical(getColumnType 2. handle cases where getColName is NULL --- inst/App/rightPanel/mid/serverRowIndexCtrl.R | 21 +++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/inst/App/rightPanel/mid/serverRowIndexCtrl.R b/inst/App/rightPanel/mid/serverRowIndexCtrl.R index c38a4bf7..365e42d5 100644 --- a/inst/App/rightPanel/mid/serverRowIndexCtrl.R +++ b/inst/App/rightPanel/mid/serverRowIndexCtrl.R @@ -82,12 +82,12 @@ observeEvent( input$myTibRowCntrl$selected, { # else # cat('group is empty\n') # cat('bailing\n') - # log.fout(input$myTibRowCntrl$selected) + # log.fout(input$myTibRowCntrl$selected) return(NULL) #bail } rowIndex<-min(getTibNRow(),rowIndex) # compute matColIndex and update rowIndex, matColIndex - if(getColumnType()=='point'){ + if(identical(getColumnType(),'point')){ pts<-getTibPts() matColIndex<-length(pts[[rowIndex]])/2 updateSelected( matCol=matColIndex, rowIndex=rowIndex) @@ -100,19 +100,22 @@ observeEvent( input$myTibRowCntrl$selected, { updateSelected( rowIndex=rowIndex) } } - # log.fout(input$myTibRowCntrl$selected) + # log.fout(input$myTibRowCntrl$selected) } }) # rowPicker => the tib row order observeEvent( input$myTibRowCntrl$order,{ log.fin(input$myTibRowCntrl$order) - if( getTibEditState()==TRUE & !all(diff(input$myTibRowCntrl$order)==1)){ + if( getTibEditState()==TRUE & !all(diff(input$myTibRowCntrl$order)==1)){ ordering<-input$myTibRowCntrl$order log.val(ordering) name<-getAssetName() row<-getTibRow() columnName<-getTibColumnName() + if(is.null(columnName)){ + return(NULL) + } newPtDefs<-getPtDefs() tib<-newPtDefs$tib[[name]] tib<-tib[ordering,] @@ -131,8 +134,8 @@ observeEvent( input$myTibRowCntrl$order,{ # rowPicker => rowGroupsDB observeEvent( input$myTibRowCntrl$group,{ - if( getTibEditState()==TRUE ){ - # log.fin(input$myTibRowCntrl$group) + if( getTibEditState()==TRUE && !is.null(getTibColumnName())){ + log.fin(input$myTibRowCntrl$group) group<-input$myTibRowCntrl$group # if(length(group)>0) # log.val(format(paste(group,collapse=","))) @@ -149,7 +152,7 @@ observeEvent( input$myTibRowCntrl$group,{ rowGroupsDB(db) # cat('now rowGroupsDB=') # print(rowGroupsDB()) - # log.fout(input$myTibRowCntrl$group) + log.fout(input$myTibRowCntrl$group) } }) @@ -158,7 +161,7 @@ observeEvent( input$myTibRowCntrl$group,{ observeEvent(getAssetName(),{ #reload rowpicker aname<-getAssetName() if(!is.null(aname)){ - # log.fin("reload rowpicker") + log.fin("reload rowpicker") # log.val(aname) # group<-input$myTibRowCntrl$group # if(length(group)>0){ @@ -203,7 +206,7 @@ observeEvent(getAssetName(),{ #reload rowpicker # } else { # cat('group is empty\n') # } - # log.fout("reload picker") + log.fout("reload picker") } }) From 60f27ded3a3dc959a904c4b5543f7e6cc2f56f9c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 18 Mar 2020 13:29:29 -0400 Subject: [PATCH 012/263] cosmetic --- inst/App/leftPanel/mid/serverAce.R | 2 +- inst/App/rightPanel/menu/cmdNewColumn.R | 3 ++- .../selector/serverAssetSelection.R | 27 ++++++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/inst/App/leftPanel/mid/serverAce.R b/inst/App/leftPanel/mid/serverAce.R index bfc104eb..6c943984 100644 --- a/inst/App/leftPanel/mid/serverAce.R +++ b/inst/App/leftPanel/mid/serverAce.R @@ -1,7 +1,7 @@ observeEvent(input$messageFromAce, { - cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") + # cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") if(length(input$messageFromAce$sender)>0){ if(length(input$messageFromAce$code)>0){ # returning code setCode(input$messageFromAce$code) # only place where request$code is set diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 0a8131ad..7eebfc8f 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -66,9 +66,10 @@ observeEvent(input$commitNewCol, { error = function(e) {}) rtv } - # browser() + treatAs<-input$modalColTreatAs newVal<-input$modalAttrValue + #checks if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ # check name syntax diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 07943fc0..ec7c2601 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -8,9 +8,9 @@ selectedAsset <- reactiveValues( tabId="bogus", - name=NULL, # name of current point array + name=NULL, # name of current point array aka. assetName rowIndex=1, - columnName=NULL, # currently used only by tibbleEditor and could be placed there. + columnName=NULL, # matCol=0, # ptColName=NULL, # !!! KLUDGE for now. should this default to last col? probably not selIndex=1, # only used is to determine if in matrix or point mode !! @@ -19,7 +19,6 @@ selectedAsset <- reactiveValues( ) - getSelIndex<-reactive({ selectedAsset$selIndex }) @@ -33,8 +32,22 @@ observeEvent(getTibNRow(),{ getAssetName<-reactive({selectedAsset$name}) #allow to be null only if tib is null getTibTabId<-reactive({ selectedAsset$tabId}) -getTibColumnName<-reactive({ selectedAsset$columnName }) -getTib<-reactive({ getPtDefs() %$$% 'tib' %$$% getAssetName() }) + +getAssetNames<-reactive({ names(getPtDefs()$tib) }) + +getTibColumnName<-reactive({ + # if(is.null( selectedAsset$columnName)|| !(selectedAsset$columnName %in% names(tib))){ + # selectedAsset$columnName<-tail(names(getTib()),1) + # } + selectedAsset$columnName +}) + +# returns the tib corresponding to selectedAsset$name +# ie. getPtDefs$tib[[ selectedAsset$name ]] +getTib<-reactive({ + getPtDefs() %$$% 'tib' %$$% getAssetName() +}) + getTibColPos<-reactive({ which(names(getTib())==selectedAsset$columnName )}) getTibPtColPos<-reactive({ which(names(getTib())==selectedAsset$ptColName )}) getTibNRow<-reactive({ @@ -81,7 +94,7 @@ getTibMatColMax<-reactive({ #' cmd.add.asset #' resetSelectedTibbleName<-function(tibs, name){ - # log.fin(resetSelectedTibbleName) + # log.fin(resetSelectedTibbleName) if(hasError()){ return(NULL) # never change selection when in error state } @@ -145,7 +158,7 @@ resetSelectedTibbleName<-function(tibs, name){ if( selectedAsset$name==transformTag){ selectedAsset$transformType='Translate' } - # log.fout(resetSelectedTibbleName) + # log.fout(resetSelectedTibbleName) } From 34a5fe673f95d882c503b4bbc38dbeaf12667630 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 18 Mar 2020 13:30:08 -0400 Subject: [PATCH 013/263] rebuild ptrrmd mode --- inst/App/www/Acejs/mode-ptrrmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/www/Acejs/mode-ptrrmd.js b/inst/App/www/Acejs/mode-ptrrmd.js index 46fc90d5..70afafaf 100644 --- a/inst/App/www/Acejs/mode-ptrrmd.js +++ b/inst/App/www/Acejs/mode-ptrrmd.js @@ -1 +1 @@ -ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+o+")(\\.)(prototype)(\\.)("+o+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:r},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/cstyle").CstyleBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t="[_:a-zA-Z\u00c0-\uffff][-_:.a-zA-Z0-9\u00c0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getSelectionRange().start,a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(o.column/.test(r.getLine(o.row).slice(o.column)))return;while(!u(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var c=a.getCurrentTokenRow(),h=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var p=f.value;c==o.row&&(p=p.substring(0,o.column-h));if(this.voidElements.hasOwnProperty(p.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){if(f.value=="/>")return;while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};r.start.row==r.end.row&&(l.column=r.end.column);while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,a.start.row==a.end.row&&a.start.column"},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/xml_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",f=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t,n){"use strict";var r={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e){if(typeof e[t]!="string")continue;var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});r.hasOwnProperty(n)||(r[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,r){this.completionsDefined||this.defineCompletions();var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(e==="ruleset"){var s=t.getLine(n.row).substr(0,n.column);return/:[^;]+$/.test(s)?(/([\w\-]+):[^:]*$/.test(s),this.getPropertyValueCompletions(e,t,n,r)):this.getPropertyCompletions(e,t,n,r)}return[]},this.getPropertyCompletions=function(e,t,n,i){var s=Object.keys(r);return s.map(function(e){return{caption:e,snippet:e+": $0;",meta:"property",score:Number.MAX_VALUE}})},this.getPropertyValueCompletions=function(e,t,n,i){var s=t.getLine(n.row).substr(0,n.column),o=(/([\w\-]+):[^:]*$/.exec(s)||{})[1];if(!o)return[];var u=[];return o in r&&typeof r[o]=="object"&&(u=Object.keys(r[o])),u.map(function(e){return{caption:e,snippet:e,meta:"property value",score:Number.MAX_VALUE}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.$completer=new a,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules((new o({jsx:!1})).getRules(),"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}function c(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"attribute-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:{manifest:1},head:{},title:{},base:{href:1,target:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},noscript:{href:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},section:{},nav:{},article:{pubdate:1},aside:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},header:{},footer:{},address:{},main:{},p:{},hr:{},pre:{},blockquote:{cite:1},ol:{start:1,reversed:1},ul:{},li:{value:1},dl:{},dt:{},dd:{},figure:{},figcaption:{},div:{},a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},em:{},strong:{},small:{},s:{},cite:{},q:{cite:1},dfn:{},abbr:{},data:{},time:{datetime:1},code:{},"var":{},samp:{},kbd:{},sub:{},sup:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{},bdo:{},span:{},br:{},wbr:{},ins:{cite:1,datetime:1},del:{cite:1,datetime:1},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},embed:{src:1,height:1,width:1,type:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},param:{name:1,value:1},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},source:{src:1,type:1,media:1},track:{kind:1,src:1,srclang:1,label:1,"default":1},canvas:{width:1,height:1},map:{name:1},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},svg:{},math:{},table:{summary:1},caption:{},colgroup:{span:1},col:{span:1},tbody:{},thead:{},tfoot:{},tr:{},td:{headers:1,rowspan:1,colspan:1},th:{headers:1,rowspan:1,colspan:1,scope:1},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},fieldset:{disabled:1,form:1,name:1},legend:{},label:{form:1,"for":1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},datalist:{},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},output:{"for":1,form:1,name:1},progress:{value:1,max:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},details:{open:1},summary:{},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},menu:{type:1,label:1},dialog:{open:1}},a=Object.keys(u),h=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open"))return this.getTagCompletions(e,t,n,r);if(f(i,"tag-whitespace")||f(i,"attribute-name"))return this.getAttributeCompletions(e,t,n,r);if(f(i,"attribute-value"))return this.getAttributeValueCompletions(e,t,n,r);var s=t.getLine(n.row).substr(0,n.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,n,r):[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompletions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(Object.keys(u[i]))),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})},this.getAttributeValueCompletions=function(e,t,n,r){var i=l(t,n),s=c(t,n);if(!i)return[];var o=[];return i in u&&s in u[i]&&typeof u[i][s]=="object"&&(o=Object.keys(u[i][s])),o.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:Number.MAX_VALUE}})},this.getHTMLEntityCompletions=function(e,t,n,r){var i=["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"];return i.map(function(e){return{caption:e,snippet:e,meta:"html entity",score:Number.MAX_VALUE}})}}).call(h.prototype),t.HtmlCompletions=h}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/ptr_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|")),n=i.arrayToMap("animate|animateColor|animateMotion|animateTransform|set".split("|")),r=i.arrayToMap("desc|metadata|title".split("|")),s=i.arrayToMap("feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feFlood|feGaussianBlur|feImage|feMerge|feMorphology|feOffset|feSpecularLighting|feTile|feTurbulence".split("|")),u=i.arrayToMap("linearGradient|radialGradient".split("|")),a=i.arrayToMap("circle|ellipse|line|path|polygon|polyline|rect".split("|")),f=i.arrayToMap("ptR|tagR|svg|svgR|defs|g|Merge|symbol|use".split("|")),l=i.arrayToMap("altGlyph|textPath|tref|tspan|text".split("|")),c=i.arrayToMap("filter".split("|")),h=i.arrayToMap("mask|marker".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:["identifier","text","keyword.operator"],regex:"([a-zA-Z.][a-zA-Z0-9._]*\\b)(\\s*)(=)"},{onMatch:function(i){return e[i]?"keyword":t[i]?"constant.language":n[i]?".bold.italic.svgRAN":r[i]?".bold.italic.svgRME":s[i]?".bold.italic.svgRFE":u[i]?".bold.italic.svgRGR":a[i]?".bold.italic.svgRSH":f[i]?".bold.italic.svgRCO":l[i]?".bold.italic.svgRTX":c[i]?".bold.italic.svgRFI":h[i]?".bold.italic.svgRMM":i=="..."||i.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var p=(new o("comment")).getRules();for(var d=0;dn)return-1;if(e===n){if(tr)return-1}return 0}function r(e,t){var r=n(e.location.start.line,e.location.start.column,t.row,t.column),i=n(t.row,t.column,e.location.end.line,e.location.end.column);return n(e.location.start.line,e.location.start.column,t.row,t.column)==1&&n(t.row,t.column,e.location.end.line,e.location.end.column)==1}function i(e,r,i){if(r){var s=n(e.location.start.line,e.location.start.column,r.row,r.column),o=n(r.row,r.column,e.location.end.line,e.location.end.column);if(n(e.location.start.line,e.location.start.column,r.row,r.column)==1&&n(r.row,r.column,e.location.end.line,e.location.end.column)==1){var u=[];!i||(u=i.filter(function(e){return e instanceof l}).map(function(e){e.token})),t.push({token:e.token,location:e.location,attrs:u})}}}function s(){t=[]}function o(t,n){e.push({message:t,location:n,type:"warning"})}function u(t,n){e.push({message:t,location:n,type:"error"})}function a(){e=[]}function f(e,t){console.log("\n"+e+" Result:\n"+JSON.stringify(t)+"\n")}function l(e,t){this.token=e,this.location=t}function c(e,t){this.token=e,this.location=t}function h(e){e?console.log("location: "+e.start.line+","+e.start.column):console.log("location is null")}function y(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function b(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b)}function w(e,n){function qo(){return e.substring(Po,Do)}function Ro(){return Qo(Po,Do)}function Uo(t,n){throw n=n!==void 0?n:Qo(Po,Do),Zo([Jo(t)],e.substring(Po,Do),n)}function zo(e,t){throw t=t!==void 0?t:Qo(Po,Do),Yo(e,t)}function Wo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xo(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Vo(){return{type:"any"}}function $o(){return{type:"end"}}function Jo(e){return{type:"other",description:e}}function Ko(t){var n=Ho[t],r;if(n)return n;r=t-1;while(!Ho[r])r--;n=Ho[r],n={line:n.line,column:n.column};while(rBo&&(Bo=Do,jo=[]),jo.push(e)}function Yo(e,t){return new b(e,null,null,t)}function Zo(e,t,n){return new b(b.buildMessage(e,t),e,t,n)}function eu(){var e;return e=su(),e}function tu(){var t,n,r;return t=Do,e.charCodeAt(Do)===13?(n=f,Do++):(n=i,Fo===0&&Go(h)),n===i&&(n=null),n!==i?(e.charCodeAt(Do)===10?(r=m,Do++):(r=i,Fo===0&&Go(g)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function nu(){var t,n;return t=Do,Fo++,e.length>Do?(n=e.charAt(Do),Do++):(n=i,Fo===0&&Go(y)),Fo--,n===i?t=void 0:(Do=t,t=i),t}function ru(){var t,n,r;return t=Do,n=sa(),n!==i?(r=tu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=tu(),t===i&&(e.charCodeAt(Do)===59?(t=w,Do++):(t=i,Fo===0&&Go(E)))),t}function iu(){var e,t,n,r,s,o,u,a,f,l;e=Do,t=Pu();if(t!==i){n=Do,r=ou();if(r!==i){s=[],o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);while(o!==i)s.push(o),o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);s!==i?(r=[r,s],n=r):(Do=n,n=i)}else Do=n,n=i;n===i&&(n=null),n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function su(){var e,t,n,r;return e=Do,t=iu(),t!==i?(n=Pu(),n!==i?(r=nu(),r!==i?(t=[t,n,r],e=t):(Do=e,e=i)):(Do=e,e=i)):(Do=e,e=i),e}function ou(){var t,n,r,s;return t=Eu(),t===i&&(t=Do,n=Do,e.charCodeAt(Do)===33?(r=S,Do++):(r=i,Fo===0&&Go(x)),r!==i?(s=Bu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(n=null),n!==i?(r=Mu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function uu(){var t;return t=Ru(),t===i&&(t=na(),t===i&&(t=$u(),t===i&&(t=Vu(),t===i&&(t=Xu(),t===i&&(t=zu(),t===i&&(e.substr(Do,4)===T?(t=T,Do+=4):(t=i,Fo===0&&Go(N)),t===i&&(e.substr(Do,2)===C?(t=C,Do+=2):(t=i,Fo===0&&Go(k)),t===i&&(e.substr(Do,3)===L?(t=L,Do+=3):(t=i,Fo===0&&Go(A)),t===i&&(e.substr(Do,3)===O?(t=O,Do+=3):(t=i,Fo===0&&Go(M)),t===i&&(e.substr(Do,4)===_?(t=_,Do+=4):(t=i,Fo===0&&Go(D)),t===i&&(e.substr(Do,5)===P?(t=P,Do+=5):(t=i,Fo===0&&Go(H)),t===i&&(e.substr(Do,4)===B?(t=B,Do+=4):(t=i,Fo===0&&Go(j)),t===i&&(e.substr(Do,5)===F?(t=F,Do+=5):(t=i,Fo===0&&Go(I))))))))))))))),t}function au(){var t,n,r,s,o,u,a,f,l,c,h,p,d,v;return t=Do,e.charCodeAt(Do)===123?(n=q,Do++):(n=i,Fo===0&&Go(R)),n!==i?(r=Pu(),r!==i?(s=iu(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===125?(u=U,Do++):(u=i,Fo===0&&Go(z)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Bu(),h!==i?(e.substr(Do,4)===Q?(p=Q,Do+=4):(p=i,Fo===0&&Go(G)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=Ru(),u!==i?(a=Pu(),a!==i?(e.substr(Do,2)===et?(f=et,Do+=2):(f=i,Fo===0&&Go(tt)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Pu(),h!==i?(e.charCodeAt(Do)===41?(p=J,Do++):(p=i,Fo===0&&Go(K)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=hu(),u===i&&(u=null),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===43?(n=at,Do++):(n=i,Fo===0&&Go(ft)),n===i&&(e.charCodeAt(Do)===45?(n=lt,Do++):(n=i,Fo===0&&Go(ct)),n===i&&(e.charCodeAt(Do)===126?(n=ht,Do++):(n=i,Fo===0&&Go(pt)))),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i))))))))),t}function fu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Ru(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function lu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=fu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function cu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=fu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=wt()),t=n,t}function hu(){var e,t,n,r,s,o;e=Do,t=fu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function pu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function du(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=pu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function vu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=pu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=Et()),t=n,t}function mu(){var e,t,n,r,s,o;e=Do,t=pu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function gu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.charCodeAt(Do)===91?(r=St,Do++):(r=i,Fo===0&&Go(xt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===93?(a=Tt,Do++):(a=i,Fo===0&&Go(Nt)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function yu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.substr(Do,2)===Ct?(r=Ct,Do+=2):(r=i,Fo===0&&Go(kt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.substr(Do,2)===Lt?(a=Lt,Do+=2):(a=i,Fo===0&&Go(At)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function bu(){var t,n,r,s,o,u;return t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=mu(),s===i&&(s=null),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function wu(){var e,t,n,r,s,o;e=Do,t=au(),t===i&&(t=uu());if(t!==i){n=[],r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Eu(){var t,n,r,s,o,u,a;return t=Do,n=qu(),n!==i?(e.charCodeAt(Do)===40?(r=V,Do++):(r=i,Fo===0&&Go($)),r!==i?(s=Pu(),s!==i?(o=Lu(),o===i&&(o=null),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===41?(a=J,Do++):(a=i,Fo===0&&Go(K)),a===i&&(a=nu()),a!==i?(Po=t,n=Ot(n,o,a),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Su(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(Po=t,n=Mt(n),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function xu(){var t,n;return t=Eu(),t===i&&(t=ou(),t===i&&(t=Do,e.substr(Do,3)===mt?(n=mt,Do+=3):(n=i,Fo===0&&Go(gt)),n!==i&&(Po=t,n=_t()),t=n)),t}function Tu(){var e;return e=Su(),e===i&&(e=xu()),e}function Nu(){var t,n,r,s;return t=Do,n=Do,e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r!==i?(s=Pu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i?(r=Tu(),r!==i?(Po=t,n=Dt(n,r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function Cu(){var t,n,r;return t=Do,n=Pu(),n!==i?(e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r===i&&(r=Tu()),r!==i?(Po=t,n=Pt(r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function ku(){var e,t,n;return e=Do,t=Bu(),t!==i?(n=Nu(),n===i&&(n=Cu()),n!==i?(Po=e,t=Ht(n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Lu(){var e,t,n,r;e=Do,t=Tu();if(t!==i){n=[],r=ku();while(r!==i)n.push(r),r=ku();n!==i?(Po=e,t=Bt(t,n),e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Au(){var t;return jt.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Ft)),t===i&&(t=ju()),t}function Ou(){var t,n,r,s;t=Do,e.charCodeAt(Do)===37?(n=It,Do++):(n=i,Fo===0&&Go(qt));if(n!==i){r=[],s=Au();while(s!==i)r.push(s),s=Au();r!==i?(e.charCodeAt(Do)===37?(s=It,Do++):(s=i,Fo===0&&Go(qt)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;return t===i&&(e.substr(Do,3)===Rt?(t=Rt,Do+=3):(t=i,Fo===0&&Go(Ut)),t===i&&(e.substr(Do,3)===zt?(t=zt,Do+=3):(t=i,Fo===0&&Go(Wt)),t===i&&(e.substr(Do,3)===Xt?(t=Xt,Do+=3):(t=i,Fo===0&&Go(Vt)),t===i&&(e.substr(Do,2)===$t?(t=$t,Do+=2):(t=i,Fo===0&&Go(Jt)),t===i&&(e.substr(Do,2)===Kt?(t=Kt,Do+=2):(t=i,Fo===0&&Go(Qt)),t===i&&(e.substr(Do,2)===Gt?(t=Gt,Do+=2):(t=i,Fo===0&&Go(Yt)),t===i&&(e.substr(Do,2)===Zt?(t=Zt,Do+=2):(t=i,Fo===0&&Go(en)),t===i&&(e.substr(Do,2)===tn?(t=tn,Do+=2):(t=i,Fo===0&&Go(nn)),t===i&&(e.substr(Do,2)===rn?(t=rn,Do+=2):(t=i,Fo===0&&Go(sn)),t===i&&(e.substr(Do,2)===on?(t=on,Do+=2):(t=i,Fo===0&&Go(un)),t===i&&(e.substr(Do,2)===an?(t=an,Do+=2):(t=i,Fo===0&&Go(fn)),t===i&&(e.substr(Do,2)===ln?(t=ln,Do+=2):(t=i,Fo===0&&Go(cn)),t===i&&(e.substr(Do,2)===hn?(t=hn,Do+=2):(t=i,Fo===0&&Go(pn)),t===i&&(e.charCodeAt(Do)===36?(t=dn,Do++):(t=i,Fo===0&&Go(vn)),t===i&&(e.charCodeAt(Do)===64?(t=mn,Do++):(t=i,Fo===0&&Go(gn)),t===i&&(e.charCodeAt(Do)===94?(t=yn,Do++):(t=i,Fo===0&&Go(bn)),t===i&&(e.charCodeAt(Do)===58?(t=wn,Do++):(t=i,Fo===0&&Go(En)),t===i&&(e.charCodeAt(Do)===42?(t=Sn,Do++):(t=i,Fo===0&&Go(xn)),t===i&&(e.charCodeAt(Do)===47?(t=Tn,Do++):(t=i,Fo===0&&Go(Nn)),t===i&&(e.charCodeAt(Do)===43?(t=at,Do++):(t=i,Fo===0&&Go(ft)),t===i&&(e.charCodeAt(Do)===45?(t=lt,Do++):(t=i,Fo===0&&Go(ct)),t===i&&(e.charCodeAt(Do)===62?(t=Cn,Do++):(t=i,Fo===0&&Go(kn)),t===i&&(e.charCodeAt(Do)===60?(t=Ln,Do++):(t=i,Fo===0&&Go(An)),t===i&&(e.charCodeAt(Do)===38?(t=On,Do++):(t=i,Fo===0&&Go(Mn)),t===i&&(e.charCodeAt(Do)===124?(t=_n,Do++):(t=i,Fo===0&&Go(Dn)),t===i&&(e.charCodeAt(Do)===126?(t=ht,Do++):(t=i,Fo===0&&Go(pt)),t===i&&(e.charCodeAt(Do)===61?(t=dt,Do++):(t=i,Fo===0&&Go(vt))))))))))))))))))))))))))))),t}function Mu(){var e,t,n,r,s,o,u,a,f;e=Do,t=wu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function _u(){var t;return Pn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Hn)),t}function Du(){var t;return Bn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(jn)),t}function Pu(){var e,t;e=[],t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));while(t!==i)e.push(t),t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));return e}function Hu(){var e,t;e=[],t=Du(),t===i&&(t=sa());while(t!==i)e.push(t),t=Du(),t===i&&(t=sa());return e}function Bu(){var e,t;e=[],t=Du();while(t!==i)e.push(t),t=Du();return e}function ju(){var t;return Fn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(In)),t}function Fu(){var t,n,r,s;return t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n===i&&(e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n===i&&(e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n===i&&(e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n===i&&(e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n===i&&(e.substr(Do,4)===B?(n=B,Do+=4):(n=i,Fo===0&&Go(j)),n===i&&(e.substr(Do,2)===et?(n=et,Do+=2):(n=i,Fo===0&&Go(tt)))))))),n!==i?(r=Do,Fo++,s=Uu(),s===i&&(s=ju()),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Iu(){var t,n,r,s;t=Do,n=ju(),n===i&&(n=Do,e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn)),r!==i?(s=ju(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn))));if(n!==i){r=[],s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));while(s!==i)r.push(s),s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));r!==i?(Po=t,n=Wn(n,r),t=n):(Do=t,t=i)}else Do=t,t=i;return t}function qu(){var t;return e.substr(Do,19)===Xn?(t=Xn,Do+=19):(t=i,Fo===0&&Go(Vn)),t===i&&(e.substr(Do,18)===$n?(t=$n,Do+=18):(t=i,Fo===0&&Go(Jn)),t===i&&(e.substr(Do,17)===Kn?(t=Kn,Do+=17):(t=i,Fo===0&&Go(Qn)),t===i&&(e.substr(Do,17)===Gn?(t=Gn,Do+=17):(t=i,Fo===0&&Go(Yn)),t===i&&(e.substr(Do,16)===Zn?(t=Zn,Do+=16):(t=i,Fo===0&&Go(er)),t===i&&(e.substr(Do,16)===tr?(t=tr,Do+=16):(t=i,Fo===0&&Go(nr)),t===i&&(e.substr(Do,16)===rr?(t=rr,Do+=16):(t=i,Fo===0&&Go(ir)),t===i&&(e.substr(Do,14)===sr?(t=sr,Do+=14):(t=i,Fo===0&&Go(or)),t===i&&(e.substr(Do,14)===ur?(t=ur,Do+=14):(t=i,Fo===0&&Go(ar)),t===i&&(e.substr(Do,14)===fr?(t=fr,Do+=14):(t=i,Fo===0&&Go(lr)),t===i&&(e.substr(Do,14)===cr?(t=cr,Do+=14):(t=i,Fo===0&&Go(hr)),t===i&&(e.substr(Do,14)===pr?(t=pr,Do+=14):(t=i,Fo===0&&Go(dr)),t===i&&(e.substr(Do,13)===vr?(t=vr,Do+=13):(t=i,Fo===0&&Go(mr)),t===i&&(e.substr(Do,13)===gr?(t=gr,Do+=13):(t=i,Fo===0&&Go(yr)),t===i&&(e.substr(Do,13)===br?(t=br,Do+=13):(t=i,Fo===0&&Go(wr)),t===i&&(e.substr(Do,13)===Er?(t=Er,Do+=13):(t=i,Fo===0&&Go(Sr)),t===i&&(e.substr(Do,13)===xr?(t=xr,Do+=13):(t=i,Fo===0&&Go(Tr)),t===i&&(e.substr(Do,13)===Nr?(t=Nr,Do+=13):(t=i,Fo===0&&Go(Cr)),t===i&&(e.substr(Do,13)===kr?(t=kr,Do+=13):(t=i,Fo===0&&Go(Lr)),t===i&&(e.substr(Do,12)===Ar?(t=Ar,Do+=12):(t=i,Fo===0&&Go(Or)),t===i&&(e.substr(Do,12)===Mr?(t=Mr,Do+=12):(t=i,Fo===0&&Go(_r)),t===i&&(e.substr(Do,12)===Dr?(t=Dr,Do+=12):(t=i,Fo===0&&Go(Pr)),t===i&&(e.substr(Do,12)===Hr?(t=Hr,Do+=12):(t=i,Fo===0&&Go(Br)),t===i&&(e.substr(Do,12)===jr?(t=jr,Do+=12):(t=i,Fo===0&&Go(Fr)),t===i&&(e.substr(Do,11)===Ir?(t=Ir,Do+=11):(t=i,Fo===0&&Go(qr)),t===i&&(e.substr(Do,11)===Rr?(t=Rr,Do+=11):(t=i,Fo===0&&Go(Ur)),t===i&&(e.substr(Do,11)===zr?(t=zr,Do+=11):(t=i,Fo===0&&Go(Wr)),t===i&&(e.substr(Do,11)===Xr?(t=Xr,Do+=11):(t=i,Fo===0&&Go(Vr)),t===i&&(e.substr(Do,9)===$r?(t=$r,Do+=9):(t=i,Fo===0&&Go(Jr)),t===i&&(e.substr(Do,8)===Kr?(t=Kr,Do+=8):(t=i,Fo===0&&Go(Qr)),t===i&&(e.substr(Do,8)===Gr?(t=Gr,Do+=8):(t=i,Fo===0&&Go(Yr)),t===i&&(e.substr(Do,8)===Zr?(t=Zr,Do+=8):(t=i,Fo===0&&Go(ei)),t===i&&(e.substr(Do,8)===ti?(t=ti,Do+=8):(t=i,Fo===0&&Go(ni)),t===i&&(e.substr(Do,8)===ri?(t=ri,Do+=8):(t=i,Fo===0&&Go(ii)),t===i&&(e.substr(Do,8)===si?(t=si,Do+=8):(t=i,Fo===0&&Go(oi)),t===i&&(e.substr(Do,8)===ui?(t=ui,Do+=8):(t=i,Fo===0&&Go(ai)),t===i&&(e.substr(Do,7)===fi?(t=fi,Do+=7):(t=i,Fo===0&&Go(li)),t===i&&(e.substr(Do,7)===ci?(t=ci,Do+=7):(t=i,Fo===0&&Go(hi)),t===i&&(e.substr(Do,7)===pi?(t=pi,Do+=7):(t=i,Fo===0&&Go(di)),t===i&&(e.substr(Do,7)===vi?(t=vi,Do+=7):(t=i,Fo===0&&Go(mi)),t===i&&(e.substr(Do,7)===gi?(t=gi,Do+=7):(t=i,Fo===0&&Go(yi)),t===i&&(e.substr(Do,7)===bi?(t=bi,Do+=7):(t=i,Fo===0&&Go(wi)),t===i&&(e.substr(Do,7)===Ei?(t=Ei,Do+=7):(t=i,Fo===0&&Go(Si)),t===i&&(e.substr(Do,7)===xi?(t=xi,Do+=7):(t=i,Fo===0&&Go(Ti)),t===i&&(e.substr(Do,7)===Ni?(t=Ni,Do+=7):(t=i,Fo===0&&Go(Ci)),t===i&&(e.substr(Do,7)===ki?(t=ki,Do+=7):(t=i,Fo===0&&Go(Li)),t===i&&(e.substr(Do,7)===Ai?(t=Ai,Do+=7):(t=i,Fo===0&&Go(Oi)),t===i&&(e.substr(Do,7)===Mi?(t=Mi,Do+=7):(t=i,Fo===0&&Go(_i)),t===i&&(e.substr(Do,6)===Di?(t=Di,Do+=6):(t=i,Fo===0&&Go(Pi)),t===i&&(e.substr(Do,6)===Hi?(t=Hi,Do+=6):(t=i,Fo===0&&Go(Bi)),t===i&&(e.substr(Do,6)===ji?(t=ji,Do+=6):(t=i,Fo===0&&Go(Fi)),t===i&&(e.substr(Do,6)===Ii?(t=Ii,Do+=6):(t=i,Fo===0&&Go(qi)),t===i&&(e.substr(Do,6)===Ri?(t=Ri,Do+=6):(t=i,Fo===0&&Go(Ui)),t===i&&(e.substr(Do,6)===zi?(t=zi,Do+=6):(t=i,Fo===0&&Go(Wi)),t===i&&(e.substr(Do,6)===Xi?(t=Xi,Do+=6):(t=i,Fo===0&&Go(Vi)),t===i&&(e.substr(Do,6)===$i?(t=$i,Do+=6):(t=i,Fo===0&&Go(Ji)),t===i&&(e.substr(Do,5)===Ki?(t=Ki,Do+=5):(t=i,Fo===0&&Go(Qi)),t===i&&(e.substr(Do,5)===Gi?(t=Gi,Do+=5):(t=i,Fo===0&&Go(Yi)),t===i&&(e.substr(Do,5)===Zi?(t=Zi,Do+=5):(t=i,Fo===0&&Go(es)),t===i&&(e.substr(Do,5)===ts?(t=ts,Do+=5):(t=i,Fo===0&&Go(ns)),t===i&&(e.substr(Do,5)===rs?(t=rs,Do+=5):(t=i,Fo===0&&Go(is)),t===i&&(e.substr(Do,5)===ss?(t=ss,Do+=5):(t=i,Fo===0&&Go(os)),t===i&&(e.substr(Do,5)===us?(t=us,Do+=5):(t=i,Fo===0&&Go(as)),t===i&&(e.substr(Do,5)===fs?(t=fs,Do+=5):(t=i,Fo===0&&Go(ls)),t===i&&(e.substr(Do,4)===cs?(t=cs,Do+=4):(t=i,Fo===0&&Go(hs)),t===i&&(e.substr(Do,4)===ps?(t=ps,Do+=4):(t=i,Fo===0&&Go(ds)),t===i&&(e.substr(Do,4)===vs?(t=vs,Do+=4):(t=i,Fo===0&&Go(ms)),t===i&&(e.substr(Do,4)===gs?(t=gs,Do+=4):(t=i,Fo===0&&Go(ys)),t===i&&(e.substr(Do,4)===bs?(t=bs,Do+=4):(t=i,Fo===0&&Go(ws)),t===i&&(e.substr(Do,4)===Es?(t=Es,Do+=4):(t=i,Fo===0&&Go(Ss)),t===i&&(e.substr(Do,4)===xs?(t=xs,Do+=4):(t=i,Fo===0&&Go(Ts)),t===i&&(e.substr(Do,4)===Ns?(t=Ns,Do+=4):(t=i,Fo===0&&Go(Cs)),t===i&&(e.substr(Do,4)===ks?(t=ks,Do+=4):(t=i,Fo===0&&Go(Ls)),t===i&&(e.substr(Do,4)===As?(t=As,Do+=4):(t=i,Fo===0&&Go(Os)),t===i&&(e.substr(Do,4)===Ms?(t=Ms,Do+=4):(t=i,Fo===0&&Go(_s)),t===i&&(e.substr(Do,4)===Ds?(t=Ds,Do+=4):(t=i,Fo===0&&Go(Ps)),t===i&&(e.substr(Do,3)===Hs?(t=Hs,Do+=3):(t=i,Fo===0&&Go(Bs)),t===i&&(e.substr(Do,3)===js?(t=js,Do+=3):(t=i,Fo===0&&Go(Fs)),t===i&&(e.substr(Do,3)===Is?(t=Is,Do+=3):(t=i,Fo===0&&Go(qs)),t===i&&(e.charCodeAt(Do)===97?(t=Rs,Do++):(t=i,Fo===0&&Go(Us)),t===i&&(e.charCodeAt(Do)===103?(t=zs,Do++):(t=i,Fo===0&&Go(Ws)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),t}function Ru(){var e,t,n;return e=Do,t=Do,Fo++,n=Fu(),Fo--,n===i?t=void 0:(Do=t,t=i),t!==i?(n=Iu(),n!==i?(Po=e,t=Xs(t,n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Uu(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t}function zu(){var t,n,r;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;return n!==i?(Js.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Ks)),r===i&&(r=null),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Wu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===69?(n=Qs,Do++):(n=i,Fo===0&&Go(Gs)),n===i&&(e.charCodeAt(Do)===101?(n=Ys,Do++):(n=i,Fo===0&&Go(Zs))),n!==i?(e.charCodeAt(Do)===43?(r=at,Do++):(r=i,Fo===0&&Go(ft)),r===i&&(e.charCodeAt(Do)===45?(r=lt,Do++):(r=i,Fo===0&&Go(ct))),r===i&&(r=null),r!==i?(s=zu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Xu(){var t,n,r,s,o,u;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;if(n!==i){e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn));if(r!==i){s=[],o=Uu();while(o!==i)s.push(o),o=Uu();s!==i?(o=Wu(),o===i&&(o=null),o!==i?(Js.test(e.charAt(Do))?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(Ks)),u===i&&(u=null),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;if(t===i){t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;n!==i?(r=Wu(),r===i&&(r=null),r!==i?(Js.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(Ks)),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i);if(t===i){t=Do,e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn));if(n!==i){r=[],s=Uu();if(s!==i)while(s!==i)r.push(s),s=Uu();else r=i;r!==i?(s=Wu(),s===i&&(s=null),s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}}return t}function Vu(){var t,n,r;return t=Do,n=zu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,n=Xu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function $u(){var t,n,r,s,o;t=Do,e.charCodeAt(Do)===48?(n=no,Do++):(n=i,Fo===0&&Go(ro));if(n!==i){e.charCodeAt(Do)===120?(r=io,Do++):(r=i,Fo===0&&Go(so)),r===i&&(e.charCodeAt(Do)===88?(r=oo,Do++):(r=i,Fo===0&&Go(uo)));if(r!==i){s=[],o=Ju();if(o!==i)while(o!==i)s.push(o),o=Ju();else s=i;s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;return t}function Ju(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t===i&&(ao.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(fo)),t===i&&(lo.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(co)))),t}function Ku(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(r=Ju(),r!==i?(s=Ju(),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Qu(){var t,n,r,s,o;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(vo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(mo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(go.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(yo)),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i))),t}function Gu(){var t,n,r,s,o,u,a,f,l;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(s=Ju(),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(e.charCodeAt(Do)===123?(s=q,Do++):(s=i,Fo===0&&Go(R)),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(f=Ju(),f!==i?(e.charCodeAt(Do)===125?(l=U,Do++):(l=i,Fo===0&&Go(z)),l!==i?(n=[n,r,s,o,u,a,f,l],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)),t}function Yu(){var t,n,r;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(Eo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(So)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Gu(),t===i&&(t=Ku(),t===i&&(t=Qu()))),t}function Zu(){var t;return t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt))),t}function ea(){var t,n,r,s;return t=Do,n=Zu(),n!==i?(r=Do,Fo++,s=Zu(),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(e.charCodeAt(Do)===44?(t=yt,Do++):(t=i,Fo===0&&Go(bt))),t}function ta(){var e,t,n,r,s,o;e=Do,t=Pu();if(t!==i){n=[],r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);if(r!==i)while(r!==i)n.push(r),r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);else n=i;n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function na(){var t,n,r,s;t=Do,e.charCodeAt(Do)===34?(n=xo,Do++):(n=i,Fo===0&&Go(To));if(n!==i){r=[],s=ra();while(s!==i)r.push(s),s=ra();r!==i?(e.charCodeAt(Do)===34?(s=xo,Do++):(s=i,Fo===0&&Go(To)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;if(t===i){t=Do,e.charCodeAt(Do)===39?(n=No,Do++):(n=i,Fo===0&&Go(Co));if(n!==i){r=[],s=ia();while(s!==i)r.push(s),s=ia();r!==i?(e.charCodeAt(Do)===39?(s=No,Do++):(s=i,Fo===0&&Go(Co)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}return t}function ra(){var t,n,r;return t=Do,n=Do,Fo++,ko.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Lo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function ia(){var t,n,r;return t=Do,n=Do,Fo++,Ao.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Oo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function sa(){var t,n,r,s,o,u;t=Do,e.charCodeAt(Do)===35?(n=Mo,Do++):(n=i,Fo===0&&Go(_o));if(n!==i){r=[],s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);while(s!==i)r.push(s),s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);r!==i?(n=[n,r],t=n):(Do=t,t=i)}else Do=t,t=i;return t}n=n!==void 0?n:{};var i={},s={start:eu},a=eu,f="\r",h=Wo("\r",!1),m="\n",g=Wo("\n",!1),y=Vo(),w=";",E=Wo(";",!1),S="!",x=Wo("!",!1),T="NULL",N=Wo("NULL",!1),C="NA",k=Wo("NA",!1),L="Inf",A=Wo("Inf",!1),O="NaN",M=Wo("NaN",!1),_="TRUE",D=Wo("TRUE",!1),P="FALSE",H=Wo("FALSE",!1),B="next",j=Wo("next",!1),F="break",I=Wo("break",!1),q="{",R=Wo("{",!1),U="}",z=Wo("}",!1),W="if",X=Wo("if",!1),V="(",$=Wo("(",!1),J=")",K=Wo(")",!1),Q="else",G=Wo("else",!1),Y="for",Z=Wo("for",!1),et="in",tt=Wo("in",!1),nt="while",rt=Wo("while",!1),it="repeat",st=Wo("repeat",!1),ot="function",ut=Wo("function",!1),at="+",ft=Wo("+",!1),lt="-",ct=Wo("-",!1),ht="~",pt=Wo("~",!1),dt="=",vt=Wo("=",!1),mt="...",gt=Wo("...",!1),yt=",",bt=Wo(",",!1),wt=function(){return u("comma issues",Ro()),"comma"},Et=function(){return u("comma issues",Ro()),"comma"},St="[",xt=Wo("[",!1),Tt="]",Nt=Wo("]",!1),Ct="[[",kt=Wo("[[",!1),Lt="]]",At=Wo("]]",!1),Ot=function(e,i,s){var a,f,h,m,g=e;if(i)for(a=0;a<:+&*\-.$=\/]/,Ft=Xo([">","<",":","+","&","*","-",".","$","=","/"],!1,!1),It="%",qt=Wo("%",!1),Rt="<<-",Ut=Wo("<<-",!1),zt="->>",Wt=Wo("->>",!1),Xt=":::",Vt=Wo(":::",!1),$t="<-",Jt=Wo("<-",!1),Kt="==",Qt=Wo("==",!1),Gt="::",Yt=Wo("::",!1),Zt=">=",en=Wo(">=",!1),tn="!=",nn=Wo("!=",!1),rn="||",sn=Wo("||",!1),on="&&",un=Wo("&&",!1),an=":=",fn=Wo(":=",!1),ln="<=",cn=Wo("<=",!1),hn="->",pn=Wo("->",!1),dn="$",vn=Wo("$",!1),mn="@",gn=Wo("@",!1),yn="^",bn=Wo("^",!1),wn=":",En=Wo(":",!1),Sn="*",xn=Wo("*",!1),Tn="/",Nn=Wo("/",!1),Cn=">",kn=Wo(">",!1),Ln="<",An=Wo("<",!1),On="&",Mn=Wo("&",!1),_n="|",Dn=Wo("|",!1),Pn=/^[\n\r\u2028\u2029]/,Hn=Xo(["\n","\r","\u2028","\u2029"],!1,!1),Bn=/^[\t\x0B\f \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/,jn=Xo([" ","\x0b","\f"," ","\u00a0","\ufeff","\u1680","\u180e",["\u2000","\u200a"],"\u202f","\u205f","\u3000"],!1,!1),Fn=/^[a-zA-Z]/,In=Xo([["a","z"],["A","Z"]],!1,!1),qn=".",Rn=Wo(".",!1),Un="_",zn=Wo("_",!1),Wn=function(e,t){var n=t;return n?(n.unshift(e),n=n.join("")):n=e,n},Xn="feComponentTransfer",Vn=Wo("feComponentTransfer",!1),$n="feSpecularLighting",Jn=Wo("feSpecularLighting",!1),Kn="feDiffuseLighting",Qn=Wo("feDiffuseLighting",!1),Gn="feDisplacementMap",Yn=Wo("feDisplacementMap",!1),Zn="animateTransform",er=Wo("animateTransform",!1),tr="feConvolveMatrix",nr=Wo("feConvolveMatrix",!1),rr="font.face.format",ir=Wo("font.face.format",!1),sr="feDistantLight",or=Wo("feDistantLight",!1),ur="feGaussianBlur",ar=Wo("feGaussianBlur",!1),fr="font.face.name",lr=Wo("font.face.name",!1),cr="linearGradient",hr=Wo("linearGradient",!1),pr="radialGradient",dr=Wo("radialGradient",!1),vr="animateMotion",mr=Wo("animateMotion",!1),gr="color.profile",yr=Wo("color.profile",!1),br="feColorMatrix",wr=Wo("feColorMatrix",!1),Er="font.face.src",Sr=Wo("font.face.src",!1),xr="font.face.uri",Tr=Wo("font.face.uri",!1),Nr="foreignObject",Cr=Wo("foreignObject",!1),kr="missing.glyph",Lr=Wo("missing.glyph",!1),Ar="altGlyphItem",Or=Wo("altGlyphItem",!1),Mr="animateColor",_r=Wo("animateColor",!1),Dr="feMorphology",Pr=Wo("feMorphology",!1),Hr="fePointLight",Br=Wo("fePointLight",!1),jr="feTurbulence",Fr=Wo("feTurbulence",!1),Ir="altGlyphDef",qr=Wo("altGlyphDef",!1),Rr="feComposite",Ur=Wo("feComposite",!1),zr="feMergeNode",Wr=Wo("feMergeNode",!1),Xr="feSpotLight",Vr=Wo("feSpotLight",!1),$r="font.face",Jr=Wo("font.face",!1),Kr="altGlyph",Qr=Wo("altGlyph",!1),Gr="clipPath",Yr=Wo("clipPath",!1),Zr="feOffset",ei=Wo("feOffset",!1),ti="glyphRef",ni=Wo("glyphRef",!1),ri="metadata",ii=Wo("metadata",!1),si="polyline",oi=Wo("polyline",!1),ui="textPath",ai=Wo("textPath",!1),fi="animate",li=Wo("animate",!1),ci="ellipse",hi=Wo("ellipse",!1),pi="feBlend",di=Wo("feBlend",!1),vi="feFlood",mi=Wo("feFlood",!1),gi="feFuncA",yi=Wo("feFuncA",!1),bi="feFuncB",wi=Wo("feFuncB",!1),Ei="feFuncG",Si=Wo("feFuncG",!1),xi="feFuncR",Ti=Wo("feFuncR",!1),Ni="feImage",Ci=Wo("feImage",!1),ki="feMerge",Li=Wo("feMerge",!1),Ai="pattern",Oi=Wo("pattern",!1),Mi="polygon",_i=Wo("polygon",!1),Di="circle",Pi=Wo("circle",!1),Hi="cursor",Bi=Wo("cursor",!1),ji="feTile",Fi=Wo("feTile",!1),Ii="filter",qi=Wo("filter",!1),Ri="marker",Ui=Wo("marker",!1),zi="script",Wi=Wo("script",!1),Xi="switch",Vi=Wo("switch",!1),$i="symbol",Ji=Wo("symbol",!1),Ki="glyph",Qi=Wo("glyph",!1),Gi="hkern",Yi=Wo("hkern",!1),Zi="image",es=Wo("image",!1),ts="mpath",ns=Wo("mpath",!1),rs="style",is=Wo("style",!1),ss="title",os=Wo("title",!1),us="tspan",as=Wo("tspan",!1),fs="vkern",ls=Wo("vkern",!1),cs="defs",hs=Wo("defs",!1),ps="desc",ds=Wo("desc",!1),vs="font",ms=Wo("font",!1),gs="line",ys=Wo("line",!1),bs="mask",ws=Wo("mask",!1),Es="path",Ss=Wo("path",!1),xs="rect",Ts=Wo("rect",!1),Ns="stop",Cs=Wo("stop",!1),ks="text",Ls=Wo("text",!1),As="tref",Os=Wo("tref",!1),Ms="view",_s=Wo("view",!1),Ds="svgR",Ps=Wo("svgR",!1),Hs="set",Bs=Wo("set",!1),js="svg",Fs=Wo("svg",!1),Is="use",qs=Wo("use",!1),Rs="a",Us=Wo("a",!1),zs="g",Ws=Wo("g",!1),Xs=function(e,t){var n=t;return n},Vs=/^[0-9]/,$s=Xo([["0","9"]],!1,!1),Js=/^[Ll]/,Ks=Xo(["L","l"],!1,!1),Qs="E",Gs=Wo("E",!1),Ys="e",Zs=Wo("e",!1),eo="i",to=Wo("i",!1),no="0",ro=Wo("0",!1),io="x",so=Wo("x",!1),oo="X",uo=Wo("X",!1),ao=/^[a-f]/,fo=Xo([["a","f"]],!1,!1),lo=/^[A-F]/,co=Xo([["A","F"]],!1,!1),ho="\\",po=Wo("\\",!1),vo=/^[0-3]/,mo=Xo([["0","3"]],!1,!1),go=/^[0-7]/,yo=Xo([["0","7"]],!1,!1),bo="u",wo=Wo("u",!1),Eo=/^[abtnfrv"'\\]/,So=Xo(["a","b","t","n","f","r","v",'"',"'","\\"],!1,!1),xo='"',To=Wo('"',!1),No="'",Co=Wo("'",!1),ko=/^["]/,Lo=Xo(['"'],!1,!1),Ao=/^[']/,Oo=Xo(["'"],!1,!1),Mo="#",_o=Wo("#",!1),Do=0,Po=0,Ho=[{line:1,column:1}],Bo=0,jo=[],Fo=0,Io;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}Io=a();if(Io!==i&&Do===e.length)return Io;throw Io!==i&&Do0&&(result=w(t,n),w(t,n))}catch(s){if(s instanceof b){var o="error";s.message&&s.location.start.line&&u("Unexpected Symbol: "+s.found,s.location,"error")}}return e.forEach(function(e){var t=e.message,n=e.location,r=e.type;i.push({row:n.start.line-1,column:n.start.column-1,text:t,type:r})}),i}function S(r,i){e.length=0,t.length=0,"object"==typeof r&&(r=undefined),r=r||"";var s={};i&&(s={cursorPos:{row:i.row+1,column:i.column+1}});var o={tok:"",pos:{line:-1,col:-1}};try{if(r&&"string"==typeof r&&r.length>0){result=w(r,s);for(var a=0,f=t.length;a0){var i=r[0],s=p[i],o=v[i];available=s.concat(o)}return available}function T(e,t){return S(e,t).tok}var e=[],t=[];Array.prototype.hasValue=function(e){var t;for(t=0;t0){for(n=1,r=1;n-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.PtrStyleBehaviour=p}),ace.define("ace/mode/folding/ptrstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[|\()[^\}\]\)]*$/,this.foldingStopMarker=/^[^\[\{\(]*(\}|\]|\))/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/ptr",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/ptr_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/ptr_completions","ace/worker/worker_client","ace/mode/behaviour/ptrstyle","ace/mode/folding/ptrstyle"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("./text_highlight_rules").TextHighlightRules,u=e("./ptr_highlight_rules").PtrHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("./ptr_completions").PtrCompletions,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/ptrstyle").PtrStyleBehaviour,h=e("./folding/ptrstyle").FoldMode,p=function(){this.HighlightRules=u,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h,this.$completer=new f};i.inherits(p,s),function(){this.lineCommentStart="#",this.$id="ace/mode/ptr",this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/ptr_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("errors",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(p.prototype),t.Mode=p}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+h("]")+")(\\]\\s*\\[)("+h("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+h("]")+")(\\]\\()"+'((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)'+'(\\s*"'+h('"')+'"\\s*)?'+"(\\))"},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{defaultToken:"support.function"}]}),this.embedRules(o,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(a,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(f,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(u,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(c,"ptrcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"snippetcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(s,"textcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};r.inherits(d,s),t.PtrrmdHighlightRules=d}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?r[0]=="`"?e.bgTokenizer.getState(n)=="start"?"end":"start":"start":""},this.getFoldWidgetRange=function(e,t,n){function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(/[^#]/)}var r=e.getLine(n),i=r.length,o=e.getLength(),u=n,a=n;if(!r.match(this.foldingStartMarker))return;if(r[0]=="`"){if(e.bgTokenizer.getState(n)!=="start"){while(++n0){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(n,r.length,u,0)}var f,c="markup.heading";if(l(n)){var p=h();while(++n=p)break}a=n-(!f||["=","-"].indexOf(f.value[0])==-1?1:2);if(a>u)while(a>u&&/^\s*$/.test(e.getLine(a)))a--;if(a>u){var v=e.getLine(a).length;return new s(u,i,a,v)}}}}.call(o.prototype)}),ace.define("ace/mode/ptrrmd",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/ptr","ace/mode/snippets","ace/mode/ptrrmd_highlight_rules","ace/mode/folding/markdown"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./xml").Mode,u=e("./html").Mode,a=e("./ptr").Mode,f=e("./snippets").Mode,l=e("./ptrrmd_highlight_rules").PtrrmdHighlightRules,c=e("./folding/markdown").FoldMode,h=function(){this.HighlightRules=l,this.createModeDelegates({"js-":s,"xml-":o,"html-":u,"ptr-":a,"snippet-":f}),this.foldingRules=new c,this.$behaviour=this.$defaultBehaviour};r.inherits(h,i),function(){this.type="text",this.blockComment={start:""},this.getNextLineIndent=function(e,t,n){if(e=="listblock"){var r=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!r)return"";var i=r[2];return i||(i=parseInt(r[3],10)+1+"."),r[1]+i+r[4]}return this.$getIndent(t)},this.$id="ace/mode/ptrrmd"}.call(h.prototype),t.Mode=h}) \ No newline at end of file +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+o+")(\\.)(prototype)(\\.)("+o+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:r},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/cstyle").CstyleBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t="[_:a-zA-Z\u00c0-\uffff][-_:.a-zA-Z0-9\u00c0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getSelectionRange().start,a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(o.column/.test(r.getLine(o.row).slice(o.column)))return;while(!u(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var c=a.getCurrentTokenRow(),h=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var p=f.value;c==o.row&&(p=p.substring(0,o.column-h));if(this.voidElements.hasOwnProperty(p.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){if(f.value=="/>")return;while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};r.start.row==r.end.row&&(l.column=r.end.column);while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,a.start.row==a.end.row&&a.start.column"},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/xml_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",f=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t,n){"use strict";var r={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e){if(typeof e[t]!="string")continue;var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});r.hasOwnProperty(n)||(r[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,r){this.completionsDefined||this.defineCompletions();var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(e==="ruleset"){var s=t.getLine(n.row).substr(0,n.column);return/:[^;]+$/.test(s)?(/([\w\-]+):[^:]*$/.test(s),this.getPropertyValueCompletions(e,t,n,r)):this.getPropertyCompletions(e,t,n,r)}return[]},this.getPropertyCompletions=function(e,t,n,i){var s=Object.keys(r);return s.map(function(e){return{caption:e,snippet:e+": $0;",meta:"property",score:Number.MAX_VALUE}})},this.getPropertyValueCompletions=function(e,t,n,i){var s=t.getLine(n.row).substr(0,n.column),o=(/([\w\-]+):[^:]*$/.exec(s)||{})[1];if(!o)return[];var u=[];return o in r&&typeof r[o]=="object"&&(u=Object.keys(r[o])),u.map(function(e){return{caption:e,snippet:e,meta:"property value",score:Number.MAX_VALUE}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.$completer=new a,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules((new o({jsx:!1})).getRules(),"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}function c(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"attribute-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:{manifest:1},head:{},title:{},base:{href:1,target:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},noscript:{href:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},section:{},nav:{},article:{pubdate:1},aside:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},header:{},footer:{},address:{},main:{},p:{},hr:{},pre:{},blockquote:{cite:1},ol:{start:1,reversed:1},ul:{},li:{value:1},dl:{},dt:{},dd:{},figure:{},figcaption:{},div:{},a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},em:{},strong:{},small:{},s:{},cite:{},q:{cite:1},dfn:{},abbr:{},data:{},time:{datetime:1},code:{},"var":{},samp:{},kbd:{},sub:{},sup:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{},bdo:{},span:{},br:{},wbr:{},ins:{cite:1,datetime:1},del:{cite:1,datetime:1},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},embed:{src:1,height:1,width:1,type:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},param:{name:1,value:1},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},source:{src:1,type:1,media:1},track:{kind:1,src:1,srclang:1,label:1,"default":1},canvas:{width:1,height:1},map:{name:1},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},svg:{},math:{},table:{summary:1},caption:{},colgroup:{span:1},col:{span:1},tbody:{},thead:{},tfoot:{},tr:{},td:{headers:1,rowspan:1,colspan:1},th:{headers:1,rowspan:1,colspan:1,scope:1},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},fieldset:{disabled:1,form:1,name:1},legend:{},label:{form:1,"for":1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},datalist:{},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},output:{"for":1,form:1,name:1},progress:{value:1,max:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},details:{open:1},summary:{},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},menu:{type:1,label:1},dialog:{open:1}},a=Object.keys(u),h=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open"))return this.getTagCompletions(e,t,n,r);if(f(i,"tag-whitespace")||f(i,"attribute-name"))return this.getAttributeCompletions(e,t,n,r);if(f(i,"attribute-value"))return this.getAttributeValueCompletions(e,t,n,r);var s=t.getLine(n.row).substr(0,n.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,n,r):[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompletions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(Object.keys(u[i]))),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})},this.getAttributeValueCompletions=function(e,t,n,r){var i=l(t,n),s=c(t,n);if(!i)return[];var o=[];return i in u&&s in u[i]&&typeof u[i][s]=="object"&&(o=Object.keys(u[i][s])),o.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:Number.MAX_VALUE}})},this.getHTMLEntityCompletions=function(e,t,n,r){var i=["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"];return i.map(function(e){return{caption:e,snippet:e,meta:"html entity",score:Number.MAX_VALUE}})}}).call(h.prototype),t.HtmlCompletions=h}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/ptr_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|")),n=i.arrayToMap("animate|animateColor|animateMotion|animateTransform|set".split("|")),r=i.arrayToMap("desc|metadata|title".split("|")),s=i.arrayToMap("feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feFlood|feGaussianBlur|feImage|feMerge|feMorphology|feOffset|feSpecularLighting|feTile|feTurbulence".split("|")),u=i.arrayToMap("linearGradient|radialGradient".split("|")),a=i.arrayToMap("circle|ellipse|line|path|polygon|polyline|rect".split("|")),f=i.arrayToMap("ptR|tagR|svg|svgR|defs|g|Merge|symbol|use".split("|")),l=i.arrayToMap("altGlyph|textPath|tref|tspan|text".split("|")),c=i.arrayToMap("filter".split("|")),h=i.arrayToMap("mask|marker".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:["identifier","text","keyword.operator"],regex:"([a-zA-Z.][a-zA-Z0-9._]*\\b)(\\s*)(=)"},{onMatch:function(i){return e[i]?"keyword":t[i]?"constant.language":n[i]?".bold.italic.svgRAN":r[i]?".bold.italic.svgRME":s[i]?".bold.italic.svgRFE":u[i]?".bold.italic.svgRGR":a[i]?".bold.italic.svgRSH":f[i]?".bold.italic.svgRCO":l[i]?".bold.italic.svgRTX":c[i]?".bold.italic.svgRFI":h[i]?".bold.italic.svgRMM":i=="..."||i.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var p=(new o("comment")).getRules();for(var d=0;dn)return-1;if(e===n){if(tr)return-1}return 0}function r(e,t){var r=n(e.location.start.line,e.location.start.column,t.row,t.column),i=n(t.row,t.column,e.location.end.line,e.location.end.column);return n(e.location.start.line,e.location.start.column,t.row,t.column)==1&&n(t.row,t.column,e.location.end.line,e.location.end.column)==1}function i(e,r,i){if(r){var s=n(e.location.start.line,e.location.start.column,r.row,r.column),o=n(r.row,r.column,e.location.end.line,e.location.end.column);if(n(e.location.start.line,e.location.start.column,r.row,r.column)==1&&n(r.row,r.column,e.location.end.line,e.location.end.column)==1){var u=[];!i||(u=i.filter(function(e){return e instanceof l}).map(function(e){e.token})),t.push({token:e.token,location:e.location,attrs:u})}}}function s(){t=[]}function o(t,n){e.push({message:t,location:n,type:"warning"})}function u(t,n){e.push({message:t,location:n,type:"error"})}function a(){e=[]}function f(e,t){console.log("\n"+e+" Result:\n"+JSON.stringify(t)+"\n")}function l(e,t){this.token=e,this.location=t}function c(e,t){this.token=e,this.location=t}function h(e){e?console.log("location: "+e.start.line+","+e.start.column):console.log("location is null")}function y(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function b(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b)}function w(e,n){function qo(){return e.substring(Po,Do)}function Ro(){return Qo(Po,Do)}function Uo(t,n){throw n=n!==void 0?n:Qo(Po,Do),Zo([Jo(t)],e.substring(Po,Do),n)}function zo(e,t){throw t=t!==void 0?t:Qo(Po,Do),Yo(e,t)}function Wo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xo(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Vo(){return{type:"any"}}function $o(){return{type:"end"}}function Jo(e){return{type:"other",description:e}}function Ko(t){var n=Ho[t],r;if(n)return n;r=t-1;while(!Ho[r])r--;n=Ho[r],n={line:n.line,column:n.column};while(rBo&&(Bo=Do,jo=[]),jo.push(e)}function Yo(e,t){return new b(e,null,null,t)}function Zo(e,t,n){return new b(b.buildMessage(e,t),e,t,n)}function eu(){var e;return e=su(),e}function tu(){var t,n,r;return t=Do,e.charCodeAt(Do)===13?(n=f,Do++):(n=i,Fo===0&&Go(h)),n===i&&(n=null),n!==i?(e.charCodeAt(Do)===10?(r=m,Do++):(r=i,Fo===0&&Go(g)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function nu(){var t,n;return t=Do,Fo++,e.length>Do?(n=e.charAt(Do),Do++):(n=i,Fo===0&&Go(y)),Fo--,n===i?t=void 0:(Do=t,t=i),t}function ru(){var t,n,r;return t=Do,n=sa(),n!==i?(r=tu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=tu(),t===i&&(e.charCodeAt(Do)===59?(t=w,Do++):(t=i,Fo===0&&Go(E)))),t}function iu(){var e,t,n,r,s,o,u,a,f,l;e=Do,t=Pu();if(t!==i){n=Do,r=ou();if(r!==i){s=[],o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);while(o!==i)s.push(o),o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);s!==i?(r=[r,s],n=r):(Do=n,n=i)}else Do=n,n=i;n===i&&(n=null),n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function su(){var e,t,n,r;return e=Do,t=iu(),t!==i?(n=Pu(),n!==i?(r=nu(),r!==i?(t=[t,n,r],e=t):(Do=e,e=i)):(Do=e,e=i)):(Do=e,e=i),e}function ou(){var t,n,r,s;return t=Eu(),t===i&&(t=Do,n=Do,e.charCodeAt(Do)===33?(r=S,Do++):(r=i,Fo===0&&Go(x)),r!==i?(s=Bu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(n=null),n!==i?(r=Mu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function uu(){var t;return t=Ru(),t===i&&(t=na(),t===i&&(t=$u(),t===i&&(t=Vu(),t===i&&(t=Xu(),t===i&&(t=zu(),t===i&&(e.substr(Do,4)===T?(t=T,Do+=4):(t=i,Fo===0&&Go(N)),t===i&&(e.substr(Do,2)===C?(t=C,Do+=2):(t=i,Fo===0&&Go(k)),t===i&&(e.substr(Do,3)===L?(t=L,Do+=3):(t=i,Fo===0&&Go(A)),t===i&&(e.substr(Do,3)===O?(t=O,Do+=3):(t=i,Fo===0&&Go(M)),t===i&&(e.substr(Do,4)===_?(t=_,Do+=4):(t=i,Fo===0&&Go(D)),t===i&&(e.substr(Do,5)===P?(t=P,Do+=5):(t=i,Fo===0&&Go(H)),t===i&&(e.substr(Do,4)===B?(t=B,Do+=4):(t=i,Fo===0&&Go(j)),t===i&&(e.substr(Do,5)===F?(t=F,Do+=5):(t=i,Fo===0&&Go(I))))))))))))))),t}function au(){var t,n,r,s,o,u,a,f,l,c,h,p,d,v;return t=Do,e.charCodeAt(Do)===123?(n=q,Do++):(n=i,Fo===0&&Go(R)),n!==i?(r=Pu(),r!==i?(s=iu(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===125?(u=U,Do++):(u=i,Fo===0&&Go(z)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Bu(),h!==i?(e.substr(Do,4)===Q?(p=Q,Do+=4):(p=i,Fo===0&&Go(G)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=Ru(),u!==i?(a=Pu(),a!==i?(e.substr(Do,2)===et?(f=et,Do+=2):(f=i,Fo===0&&Go(tt)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Pu(),h!==i?(e.charCodeAt(Do)===41?(p=J,Do++):(p=i,Fo===0&&Go(K)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=hu(),u===i&&(u=null),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===43?(n=at,Do++):(n=i,Fo===0&&Go(ft)),n===i&&(e.charCodeAt(Do)===45?(n=lt,Do++):(n=i,Fo===0&&Go(ct)),n===i&&(e.charCodeAt(Do)===126?(n=ht,Do++):(n=i,Fo===0&&Go(pt)))),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i))))))))),t}function fu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Ru(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function lu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=fu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function cu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=fu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=wt()),t=n,t}function hu(){var e,t,n,r,s,o;e=Do,t=fu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function pu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function du(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=pu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function vu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=pu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=Et()),t=n,t}function mu(){var e,t,n,r,s,o;e=Do,t=pu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function gu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.charCodeAt(Do)===91?(r=St,Do++):(r=i,Fo===0&&Go(xt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===93?(a=Tt,Do++):(a=i,Fo===0&&Go(Nt)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function yu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.substr(Do,2)===Ct?(r=Ct,Do+=2):(r=i,Fo===0&&Go(kt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.substr(Do,2)===Lt?(a=Lt,Do+=2):(a=i,Fo===0&&Go(At)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function bu(){var t,n,r,s,o,u;return t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=mu(),s===i&&(s=null),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function wu(){var e,t,n,r,s,o;e=Do,t=au(),t===i&&(t=uu());if(t!==i){n=[],r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Eu(){var t,n,r,s,o,u,a;return t=Do,n=qu(),n!==i?(e.charCodeAt(Do)===40?(r=V,Do++):(r=i,Fo===0&&Go($)),r!==i?(s=Pu(),s!==i?(o=Lu(),o===i&&(o=null),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===41?(a=J,Do++):(a=i,Fo===0&&Go(K)),a===i&&(a=nu()),a!==i?(Po=t,n=Ot(n,o,a),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Su(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(Po=t,n=Mt(n),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function xu(){var t,n;return t=Eu(),t===i&&(t=ou(),t===i&&(t=Do,e.substr(Do,3)===mt?(n=mt,Do+=3):(n=i,Fo===0&&Go(gt)),n!==i&&(Po=t,n=_t()),t=n)),t}function Tu(){var e;return e=Su(),e===i&&(e=xu()),e}function Nu(){var t,n,r,s;return t=Do,n=Do,e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r!==i?(s=Pu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i?(r=Tu(),r!==i?(Po=t,n=Dt(n,r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function Cu(){var t,n,r;return t=Do,n=Pu(),n!==i?(e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r===i&&(r=Tu()),r!==i?(Po=t,n=Pt(r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function ku(){var e,t,n;return e=Do,t=Bu(),t!==i?(n=Nu(),n===i&&(n=Cu()),n!==i?(Po=e,t=Ht(n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Lu(){var e,t,n,r;e=Do,t=Tu();if(t!==i){n=[],r=ku();while(r!==i)n.push(r),r=ku();n!==i?(Po=e,t=Bt(t,n),e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Au(){var t;return jt.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Ft)),t===i&&(t=ju()),t}function Ou(){var t,n,r,s;t=Do,e.charCodeAt(Do)===37?(n=It,Do++):(n=i,Fo===0&&Go(qt));if(n!==i){r=[],s=Au();while(s!==i)r.push(s),s=Au();r!==i?(e.charCodeAt(Do)===37?(s=It,Do++):(s=i,Fo===0&&Go(qt)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;return t===i&&(e.substr(Do,3)===Rt?(t=Rt,Do+=3):(t=i,Fo===0&&Go(Ut)),t===i&&(e.substr(Do,3)===zt?(t=zt,Do+=3):(t=i,Fo===0&&Go(Wt)),t===i&&(e.substr(Do,3)===Xt?(t=Xt,Do+=3):(t=i,Fo===0&&Go(Vt)),t===i&&(e.substr(Do,2)===$t?(t=$t,Do+=2):(t=i,Fo===0&&Go(Jt)),t===i&&(e.substr(Do,2)===Kt?(t=Kt,Do+=2):(t=i,Fo===0&&Go(Qt)),t===i&&(e.substr(Do,2)===Gt?(t=Gt,Do+=2):(t=i,Fo===0&&Go(Yt)),t===i&&(e.substr(Do,2)===Zt?(t=Zt,Do+=2):(t=i,Fo===0&&Go(en)),t===i&&(e.substr(Do,2)===tn?(t=tn,Do+=2):(t=i,Fo===0&&Go(nn)),t===i&&(e.substr(Do,2)===rn?(t=rn,Do+=2):(t=i,Fo===0&&Go(sn)),t===i&&(e.substr(Do,2)===on?(t=on,Do+=2):(t=i,Fo===0&&Go(un)),t===i&&(e.substr(Do,2)===an?(t=an,Do+=2):(t=i,Fo===0&&Go(fn)),t===i&&(e.substr(Do,2)===ln?(t=ln,Do+=2):(t=i,Fo===0&&Go(cn)),t===i&&(e.substr(Do,2)===hn?(t=hn,Do+=2):(t=i,Fo===0&&Go(pn)),t===i&&(e.charCodeAt(Do)===36?(t=dn,Do++):(t=i,Fo===0&&Go(vn)),t===i&&(e.charCodeAt(Do)===64?(t=mn,Do++):(t=i,Fo===0&&Go(gn)),t===i&&(e.charCodeAt(Do)===94?(t=yn,Do++):(t=i,Fo===0&&Go(bn)),t===i&&(e.charCodeAt(Do)===58?(t=wn,Do++):(t=i,Fo===0&&Go(En)),t===i&&(e.charCodeAt(Do)===42?(t=Sn,Do++):(t=i,Fo===0&&Go(xn)),t===i&&(e.charCodeAt(Do)===47?(t=Tn,Do++):(t=i,Fo===0&&Go(Nn)),t===i&&(e.charCodeAt(Do)===43?(t=at,Do++):(t=i,Fo===0&&Go(ft)),t===i&&(e.charCodeAt(Do)===45?(t=lt,Do++):(t=i,Fo===0&&Go(ct)),t===i&&(e.charCodeAt(Do)===62?(t=Cn,Do++):(t=i,Fo===0&&Go(kn)),t===i&&(e.charCodeAt(Do)===60?(t=Ln,Do++):(t=i,Fo===0&&Go(An)),t===i&&(e.charCodeAt(Do)===38?(t=On,Do++):(t=i,Fo===0&&Go(Mn)),t===i&&(e.charCodeAt(Do)===124?(t=_n,Do++):(t=i,Fo===0&&Go(Dn)),t===i&&(e.charCodeAt(Do)===126?(t=ht,Do++):(t=i,Fo===0&&Go(pt)),t===i&&(e.charCodeAt(Do)===61?(t=dt,Do++):(t=i,Fo===0&&Go(vt))))))))))))))))))))))))))))),t}function Mu(){var e,t,n,r,s,o,u,a,f;e=Do,t=wu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function _u(){var t;return Pn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Hn)),t}function Du(){var t;return Bn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(jn)),t}function Pu(){var e,t;e=[],t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));while(t!==i)e.push(t),t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));return e}function Hu(){var e,t;e=[],t=Du(),t===i&&(t=sa());while(t!==i)e.push(t),t=Du(),t===i&&(t=sa());return e}function Bu(){var e,t;e=[],t=Du();while(t!==i)e.push(t),t=Du();return e}function ju(){var t;return Fn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(In)),t}function Fu(){var t,n,r,s;return t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n===i&&(e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n===i&&(e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n===i&&(e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n===i&&(e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n===i&&(e.substr(Do,4)===B?(n=B,Do+=4):(n=i,Fo===0&&Go(j)),n===i&&(e.substr(Do,2)===et?(n=et,Do+=2):(n=i,Fo===0&&Go(tt)))))))),n!==i?(r=Do,Fo++,s=Uu(),s===i&&(s=ju()),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Iu(){var t,n,r,s;t=Do,n=ju(),n===i&&(n=Do,e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn)),r!==i?(s=ju(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn))));if(n!==i){r=[],s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));while(s!==i)r.push(s),s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));r!==i?(Po=t,n=Wn(n,r),t=n):(Do=t,t=i)}else Do=t,t=i;return t}function qu(){var t;return e.substr(Do,19)===Xn?(t=Xn,Do+=19):(t=i,Fo===0&&Go(Vn)),t===i&&(e.substr(Do,18)===$n?(t=$n,Do+=18):(t=i,Fo===0&&Go(Jn)),t===i&&(e.substr(Do,17)===Kn?(t=Kn,Do+=17):(t=i,Fo===0&&Go(Qn)),t===i&&(e.substr(Do,17)===Gn?(t=Gn,Do+=17):(t=i,Fo===0&&Go(Yn)),t===i&&(e.substr(Do,16)===Zn?(t=Zn,Do+=16):(t=i,Fo===0&&Go(er)),t===i&&(e.substr(Do,16)===tr?(t=tr,Do+=16):(t=i,Fo===0&&Go(nr)),t===i&&(e.substr(Do,16)===rr?(t=rr,Do+=16):(t=i,Fo===0&&Go(ir)),t===i&&(e.substr(Do,14)===sr?(t=sr,Do+=14):(t=i,Fo===0&&Go(or)),t===i&&(e.substr(Do,14)===ur?(t=ur,Do+=14):(t=i,Fo===0&&Go(ar)),t===i&&(e.substr(Do,14)===fr?(t=fr,Do+=14):(t=i,Fo===0&&Go(lr)),t===i&&(e.substr(Do,14)===cr?(t=cr,Do+=14):(t=i,Fo===0&&Go(hr)),t===i&&(e.substr(Do,14)===pr?(t=pr,Do+=14):(t=i,Fo===0&&Go(dr)),t===i&&(e.substr(Do,13)===vr?(t=vr,Do+=13):(t=i,Fo===0&&Go(mr)),t===i&&(e.substr(Do,13)===gr?(t=gr,Do+=13):(t=i,Fo===0&&Go(yr)),t===i&&(e.substr(Do,13)===br?(t=br,Do+=13):(t=i,Fo===0&&Go(wr)),t===i&&(e.substr(Do,13)===Er?(t=Er,Do+=13):(t=i,Fo===0&&Go(Sr)),t===i&&(e.substr(Do,13)===xr?(t=xr,Do+=13):(t=i,Fo===0&&Go(Tr)),t===i&&(e.substr(Do,13)===Nr?(t=Nr,Do+=13):(t=i,Fo===0&&Go(Cr)),t===i&&(e.substr(Do,13)===kr?(t=kr,Do+=13):(t=i,Fo===0&&Go(Lr)),t===i&&(e.substr(Do,12)===Ar?(t=Ar,Do+=12):(t=i,Fo===0&&Go(Or)),t===i&&(e.substr(Do,12)===Mr?(t=Mr,Do+=12):(t=i,Fo===0&&Go(_r)),t===i&&(e.substr(Do,12)===Dr?(t=Dr,Do+=12):(t=i,Fo===0&&Go(Pr)),t===i&&(e.substr(Do,12)===Hr?(t=Hr,Do+=12):(t=i,Fo===0&&Go(Br)),t===i&&(e.substr(Do,12)===jr?(t=jr,Do+=12):(t=i,Fo===0&&Go(Fr)),t===i&&(e.substr(Do,11)===Ir?(t=Ir,Do+=11):(t=i,Fo===0&&Go(qr)),t===i&&(e.substr(Do,11)===Rr?(t=Rr,Do+=11):(t=i,Fo===0&&Go(Ur)),t===i&&(e.substr(Do,11)===zr?(t=zr,Do+=11):(t=i,Fo===0&&Go(Wr)),t===i&&(e.substr(Do,11)===Xr?(t=Xr,Do+=11):(t=i,Fo===0&&Go(Vr)),t===i&&(e.substr(Do,9)===$r?(t=$r,Do+=9):(t=i,Fo===0&&Go(Jr)),t===i&&(e.substr(Do,8)===Kr?(t=Kr,Do+=8):(t=i,Fo===0&&Go(Qr)),t===i&&(e.substr(Do,8)===Gr?(t=Gr,Do+=8):(t=i,Fo===0&&Go(Yr)),t===i&&(e.substr(Do,8)===Zr?(t=Zr,Do+=8):(t=i,Fo===0&&Go(ei)),t===i&&(e.substr(Do,8)===ti?(t=ti,Do+=8):(t=i,Fo===0&&Go(ni)),t===i&&(e.substr(Do,8)===ri?(t=ri,Do+=8):(t=i,Fo===0&&Go(ii)),t===i&&(e.substr(Do,8)===si?(t=si,Do+=8):(t=i,Fo===0&&Go(oi)),t===i&&(e.substr(Do,8)===ui?(t=ui,Do+=8):(t=i,Fo===0&&Go(ai)),t===i&&(e.substr(Do,7)===fi?(t=fi,Do+=7):(t=i,Fo===0&&Go(li)),t===i&&(e.substr(Do,7)===ci?(t=ci,Do+=7):(t=i,Fo===0&&Go(hi)),t===i&&(e.substr(Do,7)===pi?(t=pi,Do+=7):(t=i,Fo===0&&Go(di)),t===i&&(e.substr(Do,7)===vi?(t=vi,Do+=7):(t=i,Fo===0&&Go(mi)),t===i&&(e.substr(Do,7)===gi?(t=gi,Do+=7):(t=i,Fo===0&&Go(yi)),t===i&&(e.substr(Do,7)===bi?(t=bi,Do+=7):(t=i,Fo===0&&Go(wi)),t===i&&(e.substr(Do,7)===Ei?(t=Ei,Do+=7):(t=i,Fo===0&&Go(Si)),t===i&&(e.substr(Do,7)===xi?(t=xi,Do+=7):(t=i,Fo===0&&Go(Ti)),t===i&&(e.substr(Do,7)===Ni?(t=Ni,Do+=7):(t=i,Fo===0&&Go(Ci)),t===i&&(e.substr(Do,7)===ki?(t=ki,Do+=7):(t=i,Fo===0&&Go(Li)),t===i&&(e.substr(Do,7)===Ai?(t=Ai,Do+=7):(t=i,Fo===0&&Go(Oi)),t===i&&(e.substr(Do,7)===Mi?(t=Mi,Do+=7):(t=i,Fo===0&&Go(_i)),t===i&&(e.substr(Do,6)===Di?(t=Di,Do+=6):(t=i,Fo===0&&Go(Pi)),t===i&&(e.substr(Do,6)===Hi?(t=Hi,Do+=6):(t=i,Fo===0&&Go(Bi)),t===i&&(e.substr(Do,6)===ji?(t=ji,Do+=6):(t=i,Fo===0&&Go(Fi)),t===i&&(e.substr(Do,6)===Ii?(t=Ii,Do+=6):(t=i,Fo===0&&Go(qi)),t===i&&(e.substr(Do,6)===Ri?(t=Ri,Do+=6):(t=i,Fo===0&&Go(Ui)),t===i&&(e.substr(Do,6)===zi?(t=zi,Do+=6):(t=i,Fo===0&&Go(Wi)),t===i&&(e.substr(Do,6)===Xi?(t=Xi,Do+=6):(t=i,Fo===0&&Go(Vi)),t===i&&(e.substr(Do,6)===$i?(t=$i,Do+=6):(t=i,Fo===0&&Go(Ji)),t===i&&(e.substr(Do,5)===Ki?(t=Ki,Do+=5):(t=i,Fo===0&&Go(Qi)),t===i&&(e.substr(Do,5)===Gi?(t=Gi,Do+=5):(t=i,Fo===0&&Go(Yi)),t===i&&(e.substr(Do,5)===Zi?(t=Zi,Do+=5):(t=i,Fo===0&&Go(es)),t===i&&(e.substr(Do,5)===ts?(t=ts,Do+=5):(t=i,Fo===0&&Go(ns)),t===i&&(e.substr(Do,5)===rs?(t=rs,Do+=5):(t=i,Fo===0&&Go(is)),t===i&&(e.substr(Do,5)===ss?(t=ss,Do+=5):(t=i,Fo===0&&Go(os)),t===i&&(e.substr(Do,5)===us?(t=us,Do+=5):(t=i,Fo===0&&Go(as)),t===i&&(e.substr(Do,5)===fs?(t=fs,Do+=5):(t=i,Fo===0&&Go(ls)),t===i&&(e.substr(Do,4)===cs?(t=cs,Do+=4):(t=i,Fo===0&&Go(hs)),t===i&&(e.substr(Do,4)===ps?(t=ps,Do+=4):(t=i,Fo===0&&Go(ds)),t===i&&(e.substr(Do,4)===vs?(t=vs,Do+=4):(t=i,Fo===0&&Go(ms)),t===i&&(e.substr(Do,4)===gs?(t=gs,Do+=4):(t=i,Fo===0&&Go(ys)),t===i&&(e.substr(Do,4)===bs?(t=bs,Do+=4):(t=i,Fo===0&&Go(ws)),t===i&&(e.substr(Do,4)===Es?(t=Es,Do+=4):(t=i,Fo===0&&Go(Ss)),t===i&&(e.substr(Do,4)===xs?(t=xs,Do+=4):(t=i,Fo===0&&Go(Ts)),t===i&&(e.substr(Do,4)===Ns?(t=Ns,Do+=4):(t=i,Fo===0&&Go(Cs)),t===i&&(e.substr(Do,4)===ks?(t=ks,Do+=4):(t=i,Fo===0&&Go(Ls)),t===i&&(e.substr(Do,4)===As?(t=As,Do+=4):(t=i,Fo===0&&Go(Os)),t===i&&(e.substr(Do,4)===Ms?(t=Ms,Do+=4):(t=i,Fo===0&&Go(_s)),t===i&&(e.substr(Do,4)===Ds?(t=Ds,Do+=4):(t=i,Fo===0&&Go(Ps)),t===i&&(e.substr(Do,3)===Hs?(t=Hs,Do+=3):(t=i,Fo===0&&Go(Bs)),t===i&&(e.substr(Do,3)===js?(t=js,Do+=3):(t=i,Fo===0&&Go(Fs)),t===i&&(e.substr(Do,3)===Is?(t=Is,Do+=3):(t=i,Fo===0&&Go(qs)),t===i&&(e.charCodeAt(Do)===97?(t=Rs,Do++):(t=i,Fo===0&&Go(Us)),t===i&&(e.charCodeAt(Do)===103?(t=zs,Do++):(t=i,Fo===0&&Go(Ws)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),t}function Ru(){var e,t,n;return e=Do,t=Do,Fo++,n=Fu(),Fo--,n===i?t=void 0:(Do=t,t=i),t!==i?(n=Iu(),n!==i?(Po=e,t=Xs(t,n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Uu(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t}function zu(){var t,n,r;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;return n!==i?(Js.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Ks)),r===i&&(r=null),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Wu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===69?(n=Qs,Do++):(n=i,Fo===0&&Go(Gs)),n===i&&(e.charCodeAt(Do)===101?(n=Ys,Do++):(n=i,Fo===0&&Go(Zs))),n!==i?(e.charCodeAt(Do)===43?(r=at,Do++):(r=i,Fo===0&&Go(ft)),r===i&&(e.charCodeAt(Do)===45?(r=lt,Do++):(r=i,Fo===0&&Go(ct))),r===i&&(r=null),r!==i?(s=zu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Xu(){var t,n,r,s,o,u;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;if(n!==i){e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn));if(r!==i){s=[],o=Uu();while(o!==i)s.push(o),o=Uu();s!==i?(o=Wu(),o===i&&(o=null),o!==i?(Js.test(e.charAt(Do))?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(Ks)),u===i&&(u=null),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;if(t===i){t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;n!==i?(r=Wu(),r===i&&(r=null),r!==i?(Js.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(Ks)),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i);if(t===i){t=Do,e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn));if(n!==i){r=[],s=Uu();if(s!==i)while(s!==i)r.push(s),s=Uu();else r=i;r!==i?(s=Wu(),s===i&&(s=null),s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}}return t}function Vu(){var t,n,r;return t=Do,n=zu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,n=Xu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function $u(){var t,n,r,s,o;t=Do,e.charCodeAt(Do)===48?(n=no,Do++):(n=i,Fo===0&&Go(ro));if(n!==i){e.charCodeAt(Do)===120?(r=io,Do++):(r=i,Fo===0&&Go(so)),r===i&&(e.charCodeAt(Do)===88?(r=oo,Do++):(r=i,Fo===0&&Go(uo)));if(r!==i){s=[],o=Ju();if(o!==i)while(o!==i)s.push(o),o=Ju();else s=i;s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;return t}function Ju(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t===i&&(ao.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(fo)),t===i&&(lo.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(co)))),t}function Ku(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(r=Ju(),r!==i?(s=Ju(),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Qu(){var t,n,r,s,o;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(vo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(mo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(go.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(yo)),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i))),t}function Gu(){var t,n,r,s,o,u,a,f,l;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(s=Ju(),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(e.charCodeAt(Do)===123?(s=q,Do++):(s=i,Fo===0&&Go(R)),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(f=Ju(),f!==i?(e.charCodeAt(Do)===125?(l=U,Do++):(l=i,Fo===0&&Go(z)),l!==i?(n=[n,r,s,o,u,a,f,l],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)),t}function Yu(){var t,n,r;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(Eo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(So)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Gu(),t===i&&(t=Ku(),t===i&&(t=Qu()))),t}function Zu(){var t;return t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt))),t}function ea(){var t,n,r,s;return t=Do,n=Zu(),n!==i?(r=Do,Fo++,s=Zu(),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(e.charCodeAt(Do)===44?(t=yt,Do++):(t=i,Fo===0&&Go(bt))),t}function ta(){var e,t,n,r,s,o;e=Do,t=Pu();if(t!==i){n=[],r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);if(r!==i)while(r!==i)n.push(r),r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);else n=i;n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function na(){var t,n,r,s;t=Do,e.charCodeAt(Do)===34?(n=xo,Do++):(n=i,Fo===0&&Go(To));if(n!==i){r=[],s=ra();while(s!==i)r.push(s),s=ra();r!==i?(e.charCodeAt(Do)===34?(s=xo,Do++):(s=i,Fo===0&&Go(To)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;if(t===i){t=Do,e.charCodeAt(Do)===39?(n=No,Do++):(n=i,Fo===0&&Go(Co));if(n!==i){r=[],s=ia();while(s!==i)r.push(s),s=ia();r!==i?(e.charCodeAt(Do)===39?(s=No,Do++):(s=i,Fo===0&&Go(Co)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}return t}function ra(){var t,n,r;return t=Do,n=Do,Fo++,ko.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Lo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function ia(){var t,n,r;return t=Do,n=Do,Fo++,Ao.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Oo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function sa(){var t,n,r,s,o,u;t=Do,e.charCodeAt(Do)===35?(n=Mo,Do++):(n=i,Fo===0&&Go(_o));if(n!==i){r=[],s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);while(s!==i)r.push(s),s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);r!==i?(n=[n,r],t=n):(Do=t,t=i)}else Do=t,t=i;return t}n=n!==void 0?n:{};var i={},s={start:eu},a=eu,f="\r",h=Wo("\r",!1),m="\n",g=Wo("\n",!1),y=Vo(),w=";",E=Wo(";",!1),S="!",x=Wo("!",!1),T="NULL",N=Wo("NULL",!1),C="NA",k=Wo("NA",!1),L="Inf",A=Wo("Inf",!1),O="NaN",M=Wo("NaN",!1),_="TRUE",D=Wo("TRUE",!1),P="FALSE",H=Wo("FALSE",!1),B="next",j=Wo("next",!1),F="break",I=Wo("break",!1),q="{",R=Wo("{",!1),U="}",z=Wo("}",!1),W="if",X=Wo("if",!1),V="(",$=Wo("(",!1),J=")",K=Wo(")",!1),Q="else",G=Wo("else",!1),Y="for",Z=Wo("for",!1),et="in",tt=Wo("in",!1),nt="while",rt=Wo("while",!1),it="repeat",st=Wo("repeat",!1),ot="function",ut=Wo("function",!1),at="+",ft=Wo("+",!1),lt="-",ct=Wo("-",!1),ht="~",pt=Wo("~",!1),dt="=",vt=Wo("=",!1),mt="...",gt=Wo("...",!1),yt=",",bt=Wo(",",!1),wt=function(){return u("comma issues",Ro()),"comma"},Et=function(){return u("comma issues",Ro()),"comma"},St="[",xt=Wo("[",!1),Tt="]",Nt=Wo("]",!1),Ct="[[",kt=Wo("[[",!1),Lt="]]",At=Wo("]]",!1),Ot=function(e,i,s){var a,f,h,m,g=e;if(i)for(a=0;a<:+&*\-.$=\/]/,Ft=Xo([">","<",":","+","&","*","-",".","$","=","/"],!1,!1),It="%",qt=Wo("%",!1),Rt="<<-",Ut=Wo("<<-",!1),zt="->>",Wt=Wo("->>",!1),Xt=":::",Vt=Wo(":::",!1),$t="<-",Jt=Wo("<-",!1),Kt="==",Qt=Wo("==",!1),Gt="::",Yt=Wo("::",!1),Zt=">=",en=Wo(">=",!1),tn="!=",nn=Wo("!=",!1),rn="||",sn=Wo("||",!1),on="&&",un=Wo("&&",!1),an=":=",fn=Wo(":=",!1),ln="<=",cn=Wo("<=",!1),hn="->",pn=Wo("->",!1),dn="$",vn=Wo("$",!1),mn="@",gn=Wo("@",!1),yn="^",bn=Wo("^",!1),wn=":",En=Wo(":",!1),Sn="*",xn=Wo("*",!1),Tn="/",Nn=Wo("/",!1),Cn=">",kn=Wo(">",!1),Ln="<",An=Wo("<",!1),On="&",Mn=Wo("&",!1),_n="|",Dn=Wo("|",!1),Pn=/^[\n\r\u2028\u2029]/,Hn=Xo(["\n","\r","\u2028","\u2029"],!1,!1),Bn=/^[\t\x0B\f \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/,jn=Xo([" ","\x0b","\f"," ","\u00a0","\ufeff","\u1680","\u180e",["\u2000","\u200a"],"\u202f","\u205f","\u3000"],!1,!1),Fn=/^[a-zA-Z]/,In=Xo([["a","z"],["A","Z"]],!1,!1),qn=".",Rn=Wo(".",!1),Un="_",zn=Wo("_",!1),Wn=function(e,t){var n=t;return n?(n.unshift(e),n=n.join("")):n=e,n},Xn="feComponentTransfer",Vn=Wo("feComponentTransfer",!1),$n="feSpecularLighting",Jn=Wo("feSpecularLighting",!1),Kn="feDiffuseLighting",Qn=Wo("feDiffuseLighting",!1),Gn="feDisplacementMap",Yn=Wo("feDisplacementMap",!1),Zn="animateTransform",er=Wo("animateTransform",!1),tr="feConvolveMatrix",nr=Wo("feConvolveMatrix",!1),rr="font.face.format",ir=Wo("font.face.format",!1),sr="feDistantLight",or=Wo("feDistantLight",!1),ur="feGaussianBlur",ar=Wo("feGaussianBlur",!1),fr="font.face.name",lr=Wo("font.face.name",!1),cr="linearGradient",hr=Wo("linearGradient",!1),pr="radialGradient",dr=Wo("radialGradient",!1),vr="animateMotion",mr=Wo("animateMotion",!1),gr="color.profile",yr=Wo("color.profile",!1),br="feColorMatrix",wr=Wo("feColorMatrix",!1),Er="font.face.src",Sr=Wo("font.face.src",!1),xr="font.face.uri",Tr=Wo("font.face.uri",!1),Nr="foreignObject",Cr=Wo("foreignObject",!1),kr="missing.glyph",Lr=Wo("missing.glyph",!1),Ar="altGlyphItem",Or=Wo("altGlyphItem",!1),Mr="animateColor",_r=Wo("animateColor",!1),Dr="feMorphology",Pr=Wo("feMorphology",!1),Hr="fePointLight",Br=Wo("fePointLight",!1),jr="feTurbulence",Fr=Wo("feTurbulence",!1),Ir="altGlyphDef",qr=Wo("altGlyphDef",!1),Rr="feComposite",Ur=Wo("feComposite",!1),zr="feMergeNode",Wr=Wo("feMergeNode",!1),Xr="feSpotLight",Vr=Wo("feSpotLight",!1),$r="font.face",Jr=Wo("font.face",!1),Kr="altGlyph",Qr=Wo("altGlyph",!1),Gr="clipPath",Yr=Wo("clipPath",!1),Zr="feOffset",ei=Wo("feOffset",!1),ti="glyphRef",ni=Wo("glyphRef",!1),ri="metadata",ii=Wo("metadata",!1),si="polyline",oi=Wo("polyline",!1),ui="textPath",ai=Wo("textPath",!1),fi="animate",li=Wo("animate",!1),ci="ellipse",hi=Wo("ellipse",!1),pi="feBlend",di=Wo("feBlend",!1),vi="feFlood",mi=Wo("feFlood",!1),gi="feFuncA",yi=Wo("feFuncA",!1),bi="feFuncB",wi=Wo("feFuncB",!1),Ei="feFuncG",Si=Wo("feFuncG",!1),xi="feFuncR",Ti=Wo("feFuncR",!1),Ni="feImage",Ci=Wo("feImage",!1),ki="feMerge",Li=Wo("feMerge",!1),Ai="pattern",Oi=Wo("pattern",!1),Mi="polygon",_i=Wo("polygon",!1),Di="circle",Pi=Wo("circle",!1),Hi="cursor",Bi=Wo("cursor",!1),ji="feTile",Fi=Wo("feTile",!1),Ii="filter",qi=Wo("filter",!1),Ri="marker",Ui=Wo("marker",!1),zi="script",Wi=Wo("script",!1),Xi="switch",Vi=Wo("switch",!1),$i="symbol",Ji=Wo("symbol",!1),Ki="glyph",Qi=Wo("glyph",!1),Gi="hkern",Yi=Wo("hkern",!1),Zi="image",es=Wo("image",!1),ts="mpath",ns=Wo("mpath",!1),rs="style",is=Wo("style",!1),ss="title",os=Wo("title",!1),us="tspan",as=Wo("tspan",!1),fs="vkern",ls=Wo("vkern",!1),cs="defs",hs=Wo("defs",!1),ps="desc",ds=Wo("desc",!1),vs="font",ms=Wo("font",!1),gs="line",ys=Wo("line",!1),bs="mask",ws=Wo("mask",!1),Es="path",Ss=Wo("path",!1),xs="rect",Ts=Wo("rect",!1),Ns="stop",Cs=Wo("stop",!1),ks="text",Ls=Wo("text",!1),As="tref",Os=Wo("tref",!1),Ms="view",_s=Wo("view",!1),Ds="svgR",Ps=Wo("svgR",!1),Hs="set",Bs=Wo("set",!1),js="svg",Fs=Wo("svg",!1),Is="use",qs=Wo("use",!1),Rs="a",Us=Wo("a",!1),zs="g",Ws=Wo("g",!1),Xs=function(e,t){var n=t;return n},Vs=/^[0-9]/,$s=Xo([["0","9"]],!1,!1),Js=/^[Ll]/,Ks=Xo(["L","l"],!1,!1),Qs="E",Gs=Wo("E",!1),Ys="e",Zs=Wo("e",!1),eo="i",to=Wo("i",!1),no="0",ro=Wo("0",!1),io="x",so=Wo("x",!1),oo="X",uo=Wo("X",!1),ao=/^[a-f]/,fo=Xo([["a","f"]],!1,!1),lo=/^[A-F]/,co=Xo([["A","F"]],!1,!1),ho="\\",po=Wo("\\",!1),vo=/^[0-3]/,mo=Xo([["0","3"]],!1,!1),go=/^[0-7]/,yo=Xo([["0","7"]],!1,!1),bo="u",wo=Wo("u",!1),Eo=/^[abtnfrv"'\\]/,So=Xo(["a","b","t","n","f","r","v",'"',"'","\\"],!1,!1),xo='"',To=Wo('"',!1),No="'",Co=Wo("'",!1),ko=/^["]/,Lo=Xo(['"'],!1,!1),Ao=/^[']/,Oo=Xo(["'"],!1,!1),Mo="#",_o=Wo("#",!1),Do=0,Po=0,Ho=[{line:1,column:1}],Bo=0,jo=[],Fo=0,Io;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}Io=a();if(Io!==i&&Do===e.length)return Io;throw Io!==i&&Do0&&(result=w(t,n),w(t,n))}catch(s){if(s instanceof b){var o="error";s.message&&s.location.start.line&&u("Unexpected Symbol: "+s.found,s.location,"error")}}return e.forEach(function(e){var t=e.message,n=e.location,r=e.type;i.push({row:n.start.line-1,column:n.start.column-1,text:t,type:r})}),i}function S(r,i){e.length=0,t.length=0,"object"==typeof r&&(r=undefined),r=r||"";var s={};i&&(s={cursorPos:{row:i.row+1,column:i.column+1}});var o={tok:"",pos:{line:-1,col:-1}};try{if(r&&"string"==typeof r&&r.length>0){result=w(r,s);for(var a=0,f=t.length;a0){var i=r[0],s=p[i],o=v[i];available=s.concat(o)}return available}function T(e,t){return S(e,t).tok}var e=[],t=[];Array.prototype.hasValue=function(e){var t;for(t=0;t0){for(n=1,r=1;n-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.PtrStyleBehaviour=p}),ace.define("ace/mode/folding/ptrstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[|\()[^\}\]\)]*$/,this.foldingStopMarker=/^[^\[\{\(]*(\}|\]|\))/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/ptr",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/ptr_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/ptr_completions","ace/worker/worker_client","ace/mode/behaviour/ptrstyle","ace/mode/folding/ptrstyle"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("./text_highlight_rules").TextHighlightRules,u=e("./ptr_highlight_rules").PtrHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("./ptr_completions").PtrCompletions,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/ptrstyle").PtrStyleBehaviour,h=e("./folding/ptrstyle").FoldMode,p=function(){this.HighlightRules=u,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h,this.$completer=new f};i.inherits(p,s),function(){this.lineCommentStart="#",this.$id="ace/mode/ptr",this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/ptr_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("errors",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(p.prototype),t.Mode=p}),ace.define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{onMatch:function(n){return e[n]?"keyword":t[n]?"constant.language":n=="..."||n.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var n=(new o("comment")).getRules();for(var r=0;rl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+p("]")+")(\\]\\s*\\[)("+p("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+p("]")+")(\\]\\()"+'((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)'+'(\\s*"'+p('"')+'"\\s*)?'+"(\\))"},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{defaultToken:"support.function"}]}),this.embedRules(o,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(a,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(f,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(u,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(c,"ptrcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(c,"rcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"snippetcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(s,"textcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};r.inherits(v,s),t.PtrrmdHighlightRules=v}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?r[0]=="`"?e.bgTokenizer.getState(n)=="start"?"end":"start":"start":""},this.getFoldWidgetRange=function(e,t,n){function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(/[^#]/)}var r=e.getLine(n),i=r.length,o=e.getLength(),u=n,a=n;if(!r.match(this.foldingStartMarker))return;if(r[0]=="`"){if(e.bgTokenizer.getState(n)!=="start"){while(++n0){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(n,r.length,u,0)}var f,c="markup.heading";if(l(n)){var p=h();while(++n=p)break}a=n-(!f||["=","-"].indexOf(f.value[0])==-1?1:2);if(a>u)while(a>u&&/^\s*$/.test(e.getLine(a)))a--;if(a>u){var v=e.getLine(a).length;return new s(u,i,a,v)}}}}.call(o.prototype)}),ace.define("ace/mode/behaviour/ptrrmdstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},u=function(){this.inherit(s),this.add("star","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i==="*"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);return f!==""&&f!=="*"&&n.getWrapBehavioursEnabled()?o(a,f,"*","*"):{text:"*"}}})};r.inherits(u,s),t.PtrrmdStyleBehaviour=u}),ace.define("ace/mode/ptrrmd",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/ptr","ace/mode/r","ace/mode/snippets","ace/mode/ptrrmd_highlight_rules","ace/mode/folding/markdown","ace/mode/behaviour/ptrrmdstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./xml").Mode,u=e("./html").Mode,a=e("./ptr").Mode,f=e("./r").Mode,l=e("./snippets").Mode,c=e("./ptrrmd_highlight_rules").PtrrmdHighlightRules,h=e("./folding/markdown").FoldMode,p=e("./behaviour/ptrrmdstyle").PtrrmdStyleBehaviour,d=function(){this.HighlightRules=c,this.createModeDelegates({"js-":s,"xml-":o,"html-":u,"ptr-":a,"r-":f,"snippet-":l}),this.foldingRules=new h,this.$behaviour=new p};r.inherits(d,i),function(){this.type="text",this.blockComment={start:""},this.getNextLineIndent=function(e,t,n){if(e=="listblock"){var r=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!r)return"";var i=r[2];return i||(i=parseInt(r[3],10)+1+"."),r[1]+i+r[4]}return this.$getIndent(t)},this.$id="ace/mode/ptrrmd"}.call(d.prototype),t.Mode=d}) \ No newline at end of file From 58157cd426dc0aa36c1f99165e14b696fe14c02b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sun, 19 Apr 2020 16:32:04 -0400 Subject: [PATCH 014/263] added condition that row.tib is of size selectedAsset --- .../selector/serverAssetSelectionDB.R | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelectionDB.R b/inst/App/rightPanel/selector/serverAssetSelectionDB.R index 9e233754..61b90e7a 100644 --- a/inst/App/rightPanel/selector/serverAssetSelectionDB.R +++ b/inst/App/rightPanel/selector/serverAssetSelectionDB.R @@ -1,17 +1,5 @@ -# serverAssetDB<-reactiveValues( -# tib=tibble( -# tabId="NULL", -# name="NULL", -# rowIndex=1, # row in tibble -# columnName="NULL", # currently used only by tibbleEditor and could be placed there. -# matCol=0, # colIndex of the current matrix. -# ptColName="NULL", # !!! KLUDGE for now. should this default to last col? -# selIndex=1, # only used when current col is points, -# transformType='Translate', -# ptScriptSel=preprocChoices[1] -# )[0,] -# ) + serverAssetDB<-reactiveValues( tib=initialServerAssetDB() ) @@ -49,11 +37,11 @@ restoreAssetState<-function(nextTabId){ row.tib<-serverAssetDB$tib } if(length(row.tib)==0){ - cat(" length(row.tib)==0\n"); browser() #should never happen + cat(" length(row.tib)==0\n"); + browser() #should never happen } - if(nrow(row.tib)==0){ + if(nrow(row.tib)==0 || length(row.tib) Date: Tue, 21 Apr 2020 16:01:05 -0400 Subject: [PATCH 015/263] force selectedWidget to be character --- inst/App/util/dbInitiatizers.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index ab44fd26..18924749 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -66,7 +66,7 @@ initialServerAssetDB<-function(){ } initialWidgetDB<-function(){ - tibble(tabId='Tab0', name='x',column='y',type='character',minVal=NA, maxVal=NA,step=1, selectedWidget=NA)[0,] + tibble(tabId='Tab0', name='x',column='y',type='character',minVal=NA, maxVal=NA,step=1, selectedWidget='radio')[0,] } initialRowGroupDB<-function(){ From 8c0660cff322898dd1afb4374a9e24875791369b Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 16:26:09 -0400 Subject: [PATCH 016/263] edited isPoints to be more robust --- inst/App/util/utilColumnType.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inst/App/util/utilColumnType.R b/inst/App/util/utilColumnType.R index 5273c2e6..ef05ae86 100644 --- a/inst/App/util/utilColumnType.R +++ b/inst/App/util/utilColumnType.R @@ -15,10 +15,10 @@ isColorString <- function(x) { })) } -# sole caller: listColType (below) +# takes a column x and checks if the entries are all 2x* matrices of numerics isPoints<-function(x){ - points<-!is.null(x) && all(unlist(lapply(x, function(m){ - is.matrix(m) && dim(m)[1]==2 + points<-is.list(x) && all(unlist(lapply(x, function(m){ + is.matrix(m) && dim(m)[1]==2 # && all(apply(m,1,is.numeric)) }))) points } @@ -37,6 +37,7 @@ charColType<-function(x){ #sole caller: extractColType (below) listColType<-function(x){ + lens<- sapply(x, length) if(isPoints(x)){ return("point") @@ -70,6 +71,7 @@ listColType<-function(x){ # callers: PanelCoordinator::getColumnType, preProcValidate::assertConsistantTibPair extractColType<-function( column ){ + if(is.list(column)){ return(listColType(column)) } else { From acec9b009e9c06698912dabaa68e8eacbdb663b1 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 16:54:47 -0400 Subject: [PATCH 017/263] use isPoints to identify pt-colums to move back replace tib[[i,j]] with tib[[j]][[[i]]] --- inst/App/util/format.R | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/inst/App/util/format.R b/inst/App/util/format.R index 33941483..c7f2922f 100644 --- a/inst/App/util/format.R +++ b/inst/App/util/format.R @@ -1,12 +1,6 @@ -# used solely in fmtTribble -getTibColClass<-function(tib){ #used by fmtTribble - colTypes<-sapply(1:ncol(tib), function(j)class(tib[[j]])) - mats<-sapply(1:ncol(tib), function(j)"matrix"==class(tib[[1,j]])) - colTypes[mats]<-'matrix' - colTypes -} + toStrPtR0<-function(x,...){ UseMethod("toStrPtR0") } @@ -68,21 +62,22 @@ toStrPtR0.list<-function(x, digits=0, ...){ # the set tib to be cbind( tib[[,-ind]], tib[[,ind]]) # to do: tibble name # used by fmtTibbleList (below) -fmtTribble<-function(tib, tibName, movePtsBack=TRUE, indent=" ", ...){ +fmtTribble<-function(tib, tibName, movePts2Back=TRUE, indent=" ", ...){ #this moves the points to the rear + n=2 # indent factor of 2 tabs indentName<-paste0(rep(indent, n=n),collapse="") - if(movePtsBack){ - cl<-getTibColClass(tib) - indx<-c(which(cl!='matrix'), which(cl=='matrix')) + if(movePts2Back){ + cl<-sapply(1:ncol(tib), function(n)isPoints(tib[[n]]) ) + indx<-c(which(cl==FALSE), which(cl==TRUE)) #reorders the indices + tib<-tib[,indx] #reorder tib columns } - tib<-tib[,indx] n<-names(tib) nn<-matrix(paste0("~",n),1) tmp<-sapply(1:ncol(tib), function(j){ sapply(1:nrow(tib),function(i){ - toStrPtR0(tib[[i,j]]) + toStrPtR0( tib[[j]][[i]] ) }) }) tmp<-rbind(nn,tmp) @@ -128,6 +123,7 @@ fmtMat<-function(tib, tibName, indent=" ", ...){ # used only by ptDef2ReplacementList fmtTibbleList<-function(tibList, mats, as.Tribble){ + as.Tribble<-unlist(as.Tribble) tmp<-sapply(names(tibList), function(nm){ if(mats[nm]==TRUE){ From 795281057815393b170e06cc96e1f8c0fe0545fa Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:02:33 -0400 Subject: [PATCH 018/263] 1. added extractPointColumnIndices 2. trimPtDigits: now using isPoints to find pt cols and relplace [[i,j]] with [[j]][[i]] --- inst/App/util/utilptR.R | 74 ++++++++++++----------------------------- 1 file changed, 22 insertions(+), 52 deletions(-) diff --git a/inst/App/util/utilptR.R b/inst/App/util/utilptR.R index 101d9f11..4b7cc67d 100755 --- a/inst/App/util/utilptR.R +++ b/inst/App/util/utilptR.R @@ -1,4 +1,18 @@ +#returns col indices of tib corresponding to points +# used by serverAssetSellection.R and serverAssetSellectionDB.R +extractPointColumnIndices<-function(tib){ + if(length(names(tib))==0){ + vals<-F + } else{ + vals<-sapply(names(tib), + function(n){ + isPoints(tib[[n]]) + } + ) + } + which(vals) +} # sole caller: getDef (below) getDefPos<-function(txt, defTag){ @@ -40,19 +54,13 @@ ex.getPtDefs<-function(src, useTribbleFormat, ptTag="ptR" ){ try({ ptDefTxt1<-getDef(src, defTag=ptTag) if( is.null(ptDefTxt1)){ - #cat('\n===========ptDefTxt1 is NULL\n') - #stop("failed to fint ptR") - ptDefs$tib<-list() } else { - # cat('\n===========ptDefTxt1 is NOT NULL\n') eval(parse(text=ptDefTxt1)) #stupid eval to obtain the points #!!!KLUDGE first kludge (undo later) - - ptDefs$tib<-get(ptTag) #at this stage we have ptR as a list of tibbles, each tibble containings points with name same as tib - ptDefs$mats<-sapply(ptDefs$tib,is.matrix) #record what is a matrix + ptDefs$mats<-sapply(ptDefs$tib,is.matrix) #record what is a matrix (vs a tib) nms<-names(ptDefs$tib) for(n in nms){ #convert matrics to tibbles v<-ptDefs$tib[[n]] @@ -107,58 +115,20 @@ ptDef2ReplacementList<-function(name, newPtDef, txt){ # name arg not used??? pt.repl<-paste0(pt.repl,' \n \n') } } - replacementList<-c(replacementList, list(list(rng=pt.Pos, txt= pt.repl))) replacementList } - - -# sole caller: updateAceExtDef -trimPtDigits<-function(newtib){ #!!! trim to 3 significant digits - for(nm in names(newtib)){ - for( j in ncol( newtib[[nm]] )){ - if( is.matrix(newtib[[nm]][[1,j]]) && dim(newtib[[nm]][[1,j]])[1]==2){ - for( i in nrow( newtib[[nm]] )){ - newtib[[nm]][[i,j]]<-matrix( signif(newtib[[nm]][[i,j]],3 ), 2) +trimPtDigits<-function(tibs){ #!!! trim to 3 significant digits + for(nm in names(tibs)){ + for( j in ncol( tibs[[nm]] )){ + if( isPoints(tibs[[nm]][[j]])){ + for( i in nrow( tibs[[nm]] )){ + tibs[[nm]][[j]][[i]]<-matrix( signif(tibs[[nm]][[j]][[i]],3 ), 2) } } } } - newtib + tibs } - -# -# # NOT Used!! -# # this could be used when opening a file -# ## choices -# choices2ColType<-function( choices, column){ -# ct<-NULL -# lastVal<-last(choices) -# cv=class(lastVal) -# ct<-list(cv) -# if(is.character(cv) && isColor(lastVal)){ -# ct<-list('colorPicker') -# } -# if(column %in% c('opacity' )){ -# ct<-list('slider','decimal',0,1) -# } -# ct -# } -# -# # NOT Used!! -# # this would be used when adding an new column -# val2ColType<-function(val, column){ -# tmp<-type.convert(val) -# cv=class(lastVal) -# ct<-list(cv) -# if(is.character(cv) && isColor(lastVal)){ -# ct<-list('colorPicker') -# } -# if(column %in% c('opacity' )){ -# ct<-list('slider','decimal',0,1) -# } -# ct -# } -# From d0822848c4abdbddcb64440bc4b4446066042e23 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:03:31 -0400 Subject: [PATCH 019/263] replace [[row, col]] with [[col]][[row]] --- inst/App/util/utilTibble.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/App/util/utilTibble.R b/inst/App/util/utilTibble.R index ffb394cd..41abb59d 100644 --- a/inst/App/util/utilTibble.R +++ b/inst/App/util/utilTibble.R @@ -28,10 +28,10 @@ tagTib<-function(tib, ptColIndex, rowIndex=nrow(tib), matCol){ # cat('-----------------inside tagTib-------------') tmp<-bind_rows(tib[1:rowIndex,], tib[rowIndex:nrow(tib),]) - pts<-tmp[[rowIndex, ptColIndex]] + pts<-tmp[[ ptColIndex]][[rowIndex]] if(matCol>0){ - tmp[[rowIndex,ptColIndex]]<-matrix(pts[,1:(matCol)],2) - tmp[[(rowIndex+1),ptColIndex]]<-matrix(pts[,-(1:(matCol))],2) + tmp[[ ptColIndex]][[rowIndex]]<-matrix(pts[,1:(matCol)],2) + tmp[[ ptColIndex]][[rowIndex+1]]<-matrix(pts[,-(1:(matCol))],2) } tmp From 050fca8d55d5a76d8d05ee852c9a4d1274e781e9 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:06:19 -0400 Subject: [PATCH 020/263] replace [[row, col]] with [[col]][[row]] --- inst/App/rightPanel/footer/serverFooterRight.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/footer/serverFooterRight.R b/inst/App/rightPanel/footer/serverFooterRight.R index 7e866511..80fdd846 100644 --- a/inst/App/rightPanel/footer/serverFooterRight.R +++ b/inst/App/rightPanel/footer/serverFooterRight.R @@ -121,9 +121,9 @@ observeEvent( returnValue4ModuleRtFtr$removePt(), { #get row, col if(matCol>=1){ row<-getTibRow() - m<-matrix(ptDefs$tib[[selection]][[ row, getTibPtColPos() ]][,-matCol],2) + m<-matrix(ptDefs$tib[[selection]][[getTibPtColPos() ]][[row]] [,-matCol],2) #!!! probably need some checking here - ptDefs$tib[[selection]][[ row, getTibPtColPos() ]]<-m + ptDefs$tib[[selection]] [[getTibPtColPos() ]][[ row]]<-m matCol<-min(matCol, length(m)/2) newPtDefs<-ptDefs sender='points.deletePoint' From b56128d9e2805260f3e16b00edb036bd68ebe7c8 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:06:47 -0400 Subject: [PATCH 021/263] logging --- inst/App/rightPanel/mid/serverRowIndexCtrl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mid/serverRowIndexCtrl.R b/inst/App/rightPanel/mid/serverRowIndexCtrl.R index 365e42d5..a665762e 100644 --- a/inst/App/rightPanel/mid/serverRowIndexCtrl.R +++ b/inst/App/rightPanel/mid/serverRowIndexCtrl.R @@ -206,7 +206,7 @@ observeEvent(getAssetName(),{ #reload rowpicker # } else { # cat('group is empty\n') # } - log.fout("reload picker") + log.fout("reload rowpicker") } }) From 331ff3b2a8349522a5beef833f9ec5633056393c Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:08:55 -0400 Subject: [PATCH 022/263] rmove pts<-... as it is not used --- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 5038514c..4d170f4e 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -17,12 +17,15 @@ mouseCmdAddPt<-function(mssg){ rowIndex<-getTibRow() matColIndx<-getTibMatCol() + if( length( getPointMax())>1){ stop('getPointMax is too big')} #should never happen - pts<-ptDefs[[ selection]][[rowIndex,getTibColPos()]] + + + #pts<-ptDefs$tib[[selection]][[rowIndex,getTibColPos()]] if(!is.na(getPointMax()) && getTibMatColMax() >= getPointMax() ){ #need to split? #split tibs<-ptDefs$tib - tib<-tibs[[selection]] + tib<-tibs[[selection]] tib<-bind_rows(tib[1:rowIndex,], tib[rowIndex:nrow(tib),]) rowIndex<-rowIndex+1 tib[[getTibColumnName()]][[rowIndex]]<-matrix(0,2,0) From 19cfa33ae0310488a6ebf25a72f82f997c9585b0 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:09:49 -0400 Subject: [PATCH 023/263] replace indexing [[i,j]] with [[j]][[i]] --- inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R index 281734a2..013d0200 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R @@ -13,7 +13,7 @@ mouseCmdMoveMatrix<-function(mssg){ tmp<-unlist(str_split(id,"_")) row<-as.numeric(tail(tmp,1)) #this should be the same as selected row index selection<-getAssetName() - matColIndx<-ncol(newPtDefs$tib[[selection]][[ row, getTibPtColPos() ]]) + matColIndx<-ncol(newPtDefs$tib[[selection]][[getTibPtColPos()]][[ row ]]) # Todo: for inter tib move support # selection -> 1 or more selections @@ -99,15 +99,15 @@ mouseCmdMoveMatrix<-function(mssg){ column_Name= names( tibs[[ctx$name]] )[ ctx$column ] )['onMoveMat'] if(is.null(txt)){ - m<-tibs[[ctx$name]][[ ctx$row, ctx$column ]] - tibs[[ctx$name]][[ ctx$row, ctx$column ]]<-m+dxy + m<-tibs[[ctx$name]][[ctx$column ]][[ctx$row ]] + tibs[[ctx$name]][[ctx$column ]][[ctx$row ]]<-m+dxy } else { context<-c(ctx, list(tibs=tibs)) tibs<-eval(parse(text=txt), ppenv ) validateTibLists(getPtDefs()$tib, tibs) } } - matCol<-ncol(tibs[[getAssetName()]][row, getTibPtColPos()] ) + matCol<-ncol(tibs[[getAssetName()]][[getTibPtColPos()]][[row]] ) newPtDefs$tib<-tibs # cat('ContextList updateAceExtDef\n') updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=row, matCol=matCol)) From 8342b7054c3582e0d381cf5f6b785e888debefb2 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:10:28 -0400 Subject: [PATCH 024/263] replace [[row, col]] with [[col]][[row]] --- inst/App/rightPanel/mouse/serverMouseCmdMovePt.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R index c8629034..49ae1f04 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R @@ -43,7 +43,7 @@ mouseCmdMovePt<- function(mssg){ alert(err) }) } else { - newPtDefs$tib[[selection]][[ rowIndex, getTibPtColPos() ]][,matColIndx]<-newPt + newPtDefs$tib[[selection]][[getTibPtColPos()]][[ rowIndex ]][,matColIndx]<-newPt if(!is.null(newPtDefs)){ #update only upon success updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matColIndx)) } From 751eea13912af04ed5a0da9eb33b430727970d20 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:11:14 -0400 Subject: [PATCH 025/263] replace [[row,col]] with [[col]][[row]] --- inst/App/rightPanel/preProc/serverPreProcMatMove.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/preProc/serverPreProcMatMove.R b/inst/App/rightPanel/preProc/serverPreProcMatMove.R index 61b574a1..cebe9a8f 100644 --- a/inst/App/rightPanel/preProc/serverPreProcMatMove.R +++ b/inst/App/rightPanel/preProc/serverPreProcMatMove.R @@ -14,11 +14,11 @@ moveMatrix<-function(dxy=getDxy(), context=context ){ if( is_scalar_numeric(rowIndex) && rowIndex>0 && rowIndex<=nrow(tib) && - is_scalar_numeric(ncol( tib[[ rowIndex, columnIndex]])) + is_scalar_numeric(ncol( tib[[columnIndex]][[rowIndex]])) ){ - m<- tib[[rowIndex, columnIndex ]] - m<-m+dxy - tib[[rowIndex, columnIndex ]]<-tib[[rowIndex, columnIndex ]]+dxy + # m<- tib[[columnIndex]][[rowIndex]] + # m<-m+dxy + tib[[columnIndex]][[rowIndex]]<-tib[[columnIndex]][[rowIndex]]+dxy } tibs[[assetName]]<-tib From 5b0e2f498e04c69811ce6156da4ceff8b972954a Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:11:47 -0400 Subject: [PATCH 026/263] [[i,j]] => [[j]][[i]] --- inst/App/rightPanel/preProc/serverPreProcPtsInsert.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/preProc/serverPreProcPtsInsert.R b/inst/App/rightPanel/preProc/serverPreProcPtsInsert.R index e4cf1717..5a90e5ec 100644 --- a/inst/App/rightPanel/preProc/serverPreProcPtsInsert.R +++ b/inst/App/rightPanel/preProc/serverPreProcPtsInsert.R @@ -18,9 +18,9 @@ insertPoint<-function(pt, context=context ){ rowIndex>0 && rowIndex<=nrow(tib) ){ - pts<-tib[[rowIndex,columnIndex]] + pts<-tib[[columnIndex]][[rowIndex]] pts<-append(pts,pt,2*(matColIndex)) - tib[[rowIndex,columnIndex]]<-matrix(pts,2) + tib[[columnIndex]][[rowIndex]]<-matrix(pts,2) tibs[[assetName]]<-tib } } From 88254215cb470b46d80166577ecaa0b2854e168c Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:12:13 -0400 Subject: [PATCH 027/263] [[i,j]]->[[j]][[i]] --- inst/App/rightPanel/preProc/serverPreProcPtsMove.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/preProc/serverPreProcPtsMove.R b/inst/App/rightPanel/preProc/serverPreProcPtsMove.R index a468320c..8a15def7 100644 --- a/inst/App/rightPanel/preProc/serverPreProcPtsMove.R +++ b/inst/App/rightPanel/preProc/serverPreProcPtsMove.R @@ -17,7 +17,7 @@ movePoint<-function(pt, context=context ){ rowIndex>0 && rowIndex<=nrow(tib) ){ - tib[[rowIndex,columnIndex]][,matColIndex] <-pt + tib[[columnIndex]][[rowIndex]][,matColIndex] <-pt tibs[[assetName]]<-tib } } From 6592f3ab3a13d086ca25b08386b2ce9ebc73fd9a Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:13:08 -0400 Subject: [PATCH 028/263] handle case when chosenRightPanel is null --- inst/App/rightPanel/serverPanelDispatch.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/serverPanelDispatch.R b/inst/App/rightPanel/serverPanelDispatch.R index d1db5fff..a8ec584c 100644 --- a/inst/App/rightPanel/serverPanelDispatch.R +++ b/inst/App/rightPanel/serverPanelDispatch.R @@ -21,6 +21,9 @@ output$BottomRightPanel<-renderUI({ output$MidRightPanel<-renderUI({ # cat(">---> output$MidRightPanel\n") chosenRightMidPanel<-getRightMidPanel() + if(is.null(chosenRightMidPanel)){ + chosenRightMidPanel<-'NA' + } # cat("chosenRightMidPanel=",format(chosenRightMidPanel),"\n") if (chosenRightMidPanel=='point'){ # cat("chosenRightMidPanel=1\n") @@ -64,7 +67,7 @@ output$MidRightPanel<-renderUI({ div( img(src="ptR/pointRLogo.SVG") ) #Todo add something about sponsors. } else { - # cat("chosenRightMidPanel=11\n") + cat("chosenRightMidPanel=11\n") div( img(src="ptR/pointRLogo.SVG")) } From ff347e72cdbec880f89bb9991aab18eba057c2ef Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:13:55 -0400 Subject: [PATCH 029/263] remove pts line as not used --- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 4d170f4e..2a59605c 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -20,8 +20,6 @@ mouseCmdAddPt<-function(mssg){ if( length( getPointMax())>1){ stop('getPointMax is too big')} #should never happen - - #pts<-ptDefs$tib[[selection]][[rowIndex,getTibColPos()]] if(!is.na(getPointMax()) && getTibMatColMax() >= getPointMax() ){ #need to split? #split tibs<-ptDefs$tib From 1181afa40026cd60f5d46224b25588f26c2ecc00 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:16:00 -0400 Subject: [PATCH 030/263] use extractPointColumnIndices to get point columns --- inst/App/rightPanel/selector/serverAssetSelection.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index ec7c2601..0b27664d 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -118,8 +118,7 @@ resetSelectedTibbleName<-function(tibs, name){ rowIndex=nrow( tib ) selectedAsset$rowIndex=rowIndex # next we try to extract a pt column for the selected tib - ptIndxs<-sapply(seq_along(names(tib)),function(j) is.matrix(tib[[rowIndex,j]]) && dim(tib[[rowIndex,j]])[1]==2) - ptIndxs<-which(ptIndxs==TRUE) + ptIndxs<-extractPointColumnIndices(tib) if(length(ptIndxs)>0){ ptColNames<-names(tib)[ptIndxs] if(!is.null(selectedAsset$columnName) && selectedAsset$columnName %in% ptColNames){ From 86cce5c826a3c79792c792747122b62a8375a4ac Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:30:38 -0400 Subject: [PATCH 031/263] now using extractPointColumns Indices --- .../selector/serverAssetSelectionDB.R | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelectionDB.R b/inst/App/rightPanel/selector/serverAssetSelectionDB.R index 9e233754..d849d2df 100644 --- a/inst/App/rightPanel/selector/serverAssetSelectionDB.R +++ b/inst/App/rightPanel/selector/serverAssetSelectionDB.R @@ -51,7 +51,7 @@ restoreAssetState<-function(nextTabId){ if(length(row.tib)==0){ cat(" length(row.tib)==0\n"); browser() #should never happen } - if(nrow(row.tib)==0){ + if(nrow(row.tib)==0 || length(row.tib) 0){ ptColIndex<-ptIndxs[1] entry<-tib[[rowIndex,ptColIndex]] ptColName<- names(tib)[ptColIndex] + columnName<-ptColName matCol<-ncol(entry) selIndex=1 } else { ptColName<-NULL matCol<-0 } - columnName<-ptColName + if(name==transformTag){ transformType='Translate' } From 2ce3064ed6e757902c1bdf0d62ddc96fd622ba72 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 17:33:39 -0400 Subject: [PATCH 032/263] use chosenWidget, to get add_row(..., selectedWidget=chosenWidget) --- .../rightPanel/selector/serverWidgetHandler.R | 59 +++++++++++-------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index 0ffaf4a4..ca373ce6 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -53,31 +53,36 @@ getPageWidgetDB<-function(pageId ){ filter(db, tabId==pageId ) } +# called soley by getWidget getRowWidgetDB<-reactive({ - # browser() + log.fin(getRowWidgetDB) pageId<- input$pages if(length(pageId>0)){ wdb<-widgetDB() - tibName<-getAssetName() - colName<-getTibColumnName() - row<-filter(wdb, tabId==pageId & name==tibName & column==colName) + tibName<-getAssetName() + colName<-getTibColumnName() + row<-filter(wdb, tabId==pageId & name==tibName & column==colName) - if(nrow(row)!=1){ #not there or multiple occurances - if(nrow(row)>1){ # remove multiple occurances - wdb<-filter(wdb, !(tabId==pageId & name==tibName & column==colName)) + if(nrow(row)!=1){ #something is messed up: not there or multiple occurances + if(nrow(row)>1){ # remove multiple occurances + wdb<-filter(wdb, !(tabId==pageId & name==tibName & column==colName)) + } + # and add back a default + colType<-getColumnType() + widgets<-type2WidgetChoices(colType) + chosenWidget<-widgets[1] + wdb<-add_row(wdb, + tabId=pageId, name=tibName, + column=colName, type=colType, + minVal=NA, maxVal=NA, + step=1, selectedWidget=chosenWidget + ) + widgetDB(wdb) + row<-filter(wdb, tabId==pageId & name==tibName & column==colName) } - # add back a default - colType<-getColumnType() - widgets<-type2WidgetChoices(colType) - selectedWidget<-widgets[1] - wdb<-add_row(wdb, tabId=pageId, name=tibName, column=colName, - minVal=NA, maxVal=NA, step=1, - selectedWidget=selectedWidget) - widgetDB(wdb) - row<-filter(wdb, tabId==pageId & name==tibName & column==colName) - } + log.fout(getRowWidgetDB) row - } + } }) @@ -88,8 +93,9 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, minVal=NA, maxVal=NA, step=1, selectedWidget='radio'){ # use current tib and col pageId<- input$pages tibName<-getAssetName() - colName<-getTibColumnName() + colName<-getTibColumnName() + # browser() log.fin(updateWidgetChoicesRow) if(length(pageId)>0){ @@ -108,11 +114,13 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, } else { # not there, or multiple rows? colType<-getColumnType() widgets<-type2WidgetChoices(colType) - if(!selectedWidget %in% widgets){ - selectedWidget<-widgets[1] + chosenWidget Date: Tue, 21 Apr 2020 17:34:25 -0400 Subject: [PATCH 033/263] added extraneous code for edge case of null column type --- inst/App/rightPanel/serverPanelCoordinator.R | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/inst/App/rightPanel/serverPanelCoordinator.R b/inst/App/rightPanel/serverPanelCoordinator.R index e2d852b4..64268d80 100644 --- a/inst/App/rightPanel/serverPanelCoordinator.R +++ b/inst/App/rightPanel/serverPanelCoordinator.R @@ -59,15 +59,15 @@ getNameType<-reactive({ # 3. getTibEntry, getTibEntryChoices # and use it only for whether or not the column is a 'points' column. getColumnType<-reactive({ + ctype=NULL colName<-getTibColumnName() # i.e. selectedAsset$columnName - if(is.null(colName)){ - return(NULL) - } - columnValues<-getTib()[[colName]] - if(!is.null(columnValues)){ - return(extractColType(columnValues)) + if(!is.null(colName)){ + columnValues<-getTib()[[colName]] + if(!is.null(columnValues)){ + ctype=extractColType(columnValues) + } } - return(NULL) + return(ctype) }) # returns the state: 'point', 'matrix', 'value', transformTag, RPanelTag, errorPanelTag @@ -79,7 +79,9 @@ getPlotState<-reactive({ nameType<-getNameType() if(identical(nameType,tibTag)){ colType<-getColumnType() - if(identical(colType,'point')){ + if(!is.null(colType)){ + rtv<-NULL #should never happen!!! + } else if(identical(colType,'point')){ rtv<-c('point', 'matrix')[ getSelIndex() ] } else { rtv<-'value' From a1cd4c8980876fc0c08bf6467f0b3643ab19cd76 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 18:35:01 -0400 Subject: [PATCH 034/263] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f3f7786f..75de5a66 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2019-12-30 Title: pointR -Version: 0.4.2.0 +Version: 0.4.2.1 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR From 626e557d7c50935380010a07fb9e9720b17820cb Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 18:36:59 -0400 Subject: [PATCH 035/263] Bugfix, !is.null(colType) shoud be is.null(colType) --- inst/App/rightPanel/serverPanelCoordinator.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/serverPanelCoordinator.R b/inst/App/rightPanel/serverPanelCoordinator.R index 64268d80..3ff3e86b 100644 --- a/inst/App/rightPanel/serverPanelCoordinator.R +++ b/inst/App/rightPanel/serverPanelCoordinator.R @@ -79,7 +79,7 @@ getPlotState<-reactive({ nameType<-getNameType() if(identical(nameType,tibTag)){ colType<-getColumnType() - if(!is.null(colType)){ + if(is.null(colType)){ rtv<-NULL #should never happen!!! } else if(identical(colType,'point')){ rtv<-c('point', 'matrix')[ getSelIndex() ] From f64c688fae17719c74797c60789628abf9e39bbb Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 21 Apr 2020 18:37:29 -0400 Subject: [PATCH 036/263] cosemetic cleansing --- .../rightPanel/mouse/serverMouseCmdAddPt.R | 2 +- .../mouse/serverMouseCmdFindPoint.R | 1 - .../selector/serverAssetSelectionDB.R | 5 --- .../rightPanel/selector/serverWidgetHandler.R | 43 ------------------- 4 files changed, 1 insertion(+), 50 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 2a59605c..50d837c4 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -7,7 +7,7 @@ mouseCmdAddPt<-function(mssg){ replacementList<-list() ptDefs<-getPtDefs() updateRowPicker(session, "myTibRowCntrl", removeEntireGroup=TRUE) - # tibs<-getPtDefs()$tib + sender='PointsBar.mouse.add' diff --git a/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R b/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R index e7e6268c..a3cabdfc 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R @@ -52,7 +52,6 @@ mouseCmdFindPoint<-function(mssg){ } if( mssg$ctrlKey==TRUE){ #add row to rowGroupsDB - # browser() if( getAssetName()==toName ){ if( getTibRow()==toRow){ updateRowPicker(session, "myTibRowCntrl", toggleGroup = toRow) diff --git a/inst/App/rightPanel/selector/serverAssetSelectionDB.R b/inst/App/rightPanel/selector/serverAssetSelectionDB.R index 82fb8af4..18b60ea0 100644 --- a/inst/App/rightPanel/selector/serverAssetSelectionDB.R +++ b/inst/App/rightPanel/selector/serverAssetSelectionDB.R @@ -74,11 +74,6 @@ newAssetSelection<-function( tabId, choices, tibs){ } else { tib<-tibs[[name]] rowIndex=nrow( tib ) - # ptIndxs<-sapply( seq_along(names(tib)),function(j){ - # is.matrix(tib[[rowIndex,j]]) && dim(tib[[rowIndex,j]])[1]==2 - # } - # ) - # ptIndxs<-which(ptIndxs==T) columnName<-tail(names(tib),1) ptIndxs<-extractPointColumnIndices(tib) if(length(ptIndxs)>0){ diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index ca373ce6..f5773df1 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -1,9 +1,5 @@ -# handler<-reactiveValues( -# choices=initialWidgetDB() -# # choices=tibble(tabId='Tab0', name='x',column='y',type='character',minVal=NA, maxVal=NA,step=1, selectedWidget=NA)[0,] -# ) widgetDB<-reactiveVal( initialWidgetDB() @@ -124,22 +120,6 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, } widgetDB(wdb) log.fout(updateWidgetChoicesRow) - # rowNo<-which( - # handler$choices$tabId==tabId & - # handler$choices$name==tibName & - # handler$choices$column==colName - # ) - # if(length(rowNo)>0){ #not much changes, just replace selected (assuming selected in colVal) - # nn<-names(match.call()[-1]) - # for(n in nn){ - # handler$choices[[n]][rowNo]<-get(n) - # } - # } else { #remove the row - # widgets<-type2WidgetChoices(colType) - # - # tmp<-handler$choices[!(handler$choices$tabId==tabId & handler$choices$name==tibName & handler$choices$column==colName),] - # handler$choices<-add_row(tmp, tabId=tabId, name=tibName, column=colName, minVal=minVal, maxVal=maxVal, step=step, selectedWidget=selectedWidget) - # } } } @@ -147,7 +127,6 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, getWidgetChoices<-reactive({ colType<-getColumnType() - # browser() widgetChoices<-type2WidgetChoices(colType) }) @@ -156,28 +135,6 @@ getWidgetChoices<-reactive({ # then moduleEdTib (lines 108, 128), bothconditon by getTibEditState()==TRUE getWidget<-reactive({ cat('entering getWidget\n') - # widgets<-getWidgetChoices() - # widget<-widgets[1] - # colName<-getTibColumnName() - # columnValues<-getTib()[[colName]] - # row<-filter(widgetDB(), - # tabId==getTibTabId() & - # name==getAssetName() & - # column==getTibColumnName() - # ) - # if(nrow(row)==0 ){ - # selectedWidget<-getWidgetChoices()[1] - # } else if(nrow(row)=1 ){ # found - # selectedWidget<-row$selectedWidget - # if( !(selectedWidget %in% widgets) ){ - # browser() - # selectedWidget<-getWidgetChoices()[1] - # } - # } else { # stop - # browser() - # stop('corrupted widgets') - # } - # browser() rtv<-getRowWidgetDB()$selectedWidget # browser() cat('leaving getWidget\n') From b7ea7ffb4fc17a6d05fdde63ec26c67cd9e58393 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 22 Apr 2020 18:35:39 -0400 Subject: [PATCH 037/263] Update README.md polishing installation instructions --- README.md | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fc5ee6c1..033ecd9d 100644 --- a/README.md +++ b/README.md @@ -5,26 +5,48 @@ - Removes the dependency on the local browser - Provides independent windows for help - Provides an integrated approach for building **shiny custom inputs** - - Prepackaged installations **ptR** are readily available for *mac* and *linux* (dmg and deb). These can be found on the release page https://github.com/mslegrand/ptR/releases + - ***Videos on pointR*** can be found at http://mslegrand.github.io/pointRmedia/. - ***Related information*** can be found at http://mslegrand.github.io/svgR/. - ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki +## Some Points on pointR +- pointR is a shiny server application +- pointR uses the ACE editor for coding +- pointR is intended to ease the writing of R scripts using svgR. +- pointR is an attempt to bridge the gap between coding and point&click. +- svgR bridges the gap between R and SVG + +## Some Points on ptR +- ptR is an Electron wrapper around pointR +- ptR is javascript (since Electron is) +- Electron is required for full functionality (such as building shiny input controls) + + ## Installation -We strongly recommend installing **ptR** from one of the installations packages found at https://github.com/mslegrand/ptR/releases. +We strongly recommend installing **ptR** from one of the installations packages (deb, dmg, msis) found at https://github.com/mslegrand/ptR/releases. Prior to installation, you may want to -consider installing **pandoc** and the R package **tidyverse**. +consider +- installing [R](https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu) +- installing either i or ii + - i [pandoc](https://pandoc.org)and placing it on your path) + - ii [RStudio] +- from withing the R interpreter, installing the R package [tidyverse ](https://www.tidyverse.org) Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. -## Some Points on pointR -- pointR is a shiny server application -- pointR uses the ACE editor for coding -- pointR is intended to ease the writing of R scripts using svgR. -- pointR is an attempt to bridge the gap between coding and point&click. -- svgR bridges the gap between R and SVG +## Building from Source + +0. This can be painful. +1. [Download pointR](https://github.com/mslegrand/pointR) and build the **pointR** library +2. [Download ptR](https://github.com/mslegrand/ptR) and place in a folder (like pointR-electron/ptRMigrate) +3. cd to ptRMigrate and edit script ./build/mklib.sh to copy the ptR lib to 2 locations (for testing & production) +4. Install node.js, npm, electon +5. from terminal run **npm start** + +**NOTE** I've built on linux and mac, but not window. # Reporting issues @@ -41,7 +63,7 @@ To quote from TrestleTech: *As with any online application, it is a genuinely ba NOTICE -Copyright (c) 2018 M. S. Legrand. All rights reserved +Copyright (c) 2020 M. S. Legrand. All rights reserved The pointR package as a whole is distributed under the GPL-3 License, GNU GENERAL PUBLIC LICENSE version 3, see below. From 98def82017b9b189bde318cd2582bca99582f552 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 22 Apr 2020 18:42:50 -0400 Subject: [PATCH 038/263] Update README.md syntax fix --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 033ecd9d..536b2cba 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # pointR and ptR -- **pointR** is an R package providing a *shiny-based* minimalist ide for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning. -- **ptR** is an **electron** wrapper around **pointR**. Using **electron** - - Removes the dependency on the local browser +- **pointR** is an R package providing a *shiny-based* minimalist IDE for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning. +- **ptR** is an **Electron** wrapper around **pointR**. +- Using **Electron** + - Removes potential hiccups by removing and dependency on the local browser - Provides independent windows for help - Provides an integrated approach for building **shiny custom inputs** @@ -31,7 +32,7 @@ Prior to installation, you may want to consider - installing [R](https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu) - installing either i or ii - - i [pandoc](https://pandoc.org)and placing it on your path) + - i [pandoc](https://pandoc.org) (and placing it on your path) - ii [RStudio] - from withing the R interpreter, installing the R package [tidyverse ](https://www.tidyverse.org) @@ -46,7 +47,7 @@ Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio 4. Install node.js, npm, electon 5. from terminal run **npm start** -**NOTE** I've built on linux and mac, but not window. +**NOTE** I've built both on linux and mac, but not windows. # Reporting issues From 525023a79c9f40a5aa022c46d136d98819019df6 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 22 Apr 2020 18:44:44 -0400 Subject: [PATCH 039/263] Update README.md fonts --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 536b2cba..6a9b2ad7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# pointR and ptR +## pointR and ptR - **pointR** is an R package providing a *shiny-based* minimalist IDE for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning. - **ptR** is an **Electron** wrapper around **pointR**. @@ -50,17 +50,17 @@ Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio **NOTE** I've built both on linux and mac, but not windows. -# Reporting issues +## Reporting issues Please report any bugs/issue in the [Github Issue tracker](https://github.com/mslegrand/pointR) #Contributing If you wish to contribute to the pointR project, now is the time. Thanks. -# Caution +## Caution To quote from TrestleTech: *As with any online application, it is a genuinely bad idea to allow arbitrary users to execute code on your server.* **BE CAREFUL!!** -# Licensing +## Licensing NOTICE From 36376edab5c8bdb240fbe29d1e3906885d359d73 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 24 Apr 2020 21:06:26 -0400 Subject: [PATCH 040/263] Update README.md --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6a9b2ad7..564d9331 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,25 @@ - Electron is required for full functionality (such as building shiny input controls) -## Installation +## User Installation -We strongly recommend installing **ptR** from one of the installations packages (deb, dmg, msis) found at https://github.com/mslegrand/ptR/releases. +We strongly recommend installing **ptR** from one of the installations packages (deb, dmg, msis) found at https://github.com/mslegrand/ptR/releases. But before installing, there are a few requirements to be successful. -Prior to installation, you may want to -consider -- installing [R](https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu) -- installing either i or ii +### Pre-Installation + +- If not already installed, install [R](https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu) +- Pandoc is required. This can be done by installing either i or ii - i [pandoc](https://pandoc.org) (and placing it on your path) - - ii [RStudio] -- from withing the R interpreter, installing the R package [tidyverse ](https://www.tidyverse.org) + - ii [RStudio](https://rstudio.com/products/rstudio/download/) (RStudio contains a copy of pandoc) +- The R package [tidyverse ](https://www.tidyverse.org) is required. This can be installed in 2 ways + - i from a terminal, open R and inside the R interpretor issue the command + **install.packages('tidyverse'**, then when finished issue command quit() and close terminal + - ii open **RSTudio** (by clicking on it's icon) and then select the *packages tab* From there click on + *install* and in the popup type tidyverse. When finished, close **RStudio**. +### Installation + +- go to https://github.com/mslegrand/ptR/releases and download the appropriate installer (dmg for mac, isis for windows and deb for most linux) +- after downloading, double click on the installer and be patient. Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. From bc6d892e9ee380821f77b5dd5b493bf0f09547ac Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 25 Apr 2020 13:22:18 -0400 Subject: [PATCH 041/263] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 564d9331..cc6910c7 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,12 @@ We strongly recommend installing **ptR** from one of the installations packages ### Installation - go to https://github.com/mslegrand/ptR/releases and download the appropriate installer (dmg for mac, isis for windows and deb for most linux) -- after downloading, double click on the installer and be patient. +- after downlo=ading, double click on the installer and be patient. + +### Post-Instalation + +- Upon opening, ptR will look for additiona R-=packages that it requires. If some of these packages are missing, you will be prompted to either quit or let ptR install them for you. When completed, the ptR IDE will start. + Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. From 298276f1a7e8872c51d0de11f6aae63f61b45db2 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Fri, 1 May 2020 16:32:26 -0400 Subject: [PATCH 042/263] For unknown reasons we can no longer loads an svg, so added workaround to insert pointRLogo.SVG directly --- inst/App/global.R | 2 +- inst/App/leftPanel/menu/cmdAbout.R | 2 +- inst/App/rightPanel/serverPanelDispatch.R | 8 ++++---- inst/App/ui.R | 9 ++++++--- inst/App/util/pointRLogoSVG.R | 20 ++++++++++++++++++++ 5 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 inst/App/util/pointRLogoSVG.R diff --git a/inst/App/global.R b/inst/App/global.R index 4e316683..cb695bbd 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -84,7 +84,7 @@ source("util/extNmode.R") source("util/logger.R") #---used to build the UI portion - +source('util/pointRLogoSVG.R') source("fileIO/genShinyFilesOpenButtons.R") source("fileIO/genShinyFilesSaveButtons.R") source("leftPanel/menu/UIProjectTemplateMenu.R") diff --git a/inst/App/leftPanel/menu/cmdAbout.R b/inst/App/leftPanel/menu/cmdAbout.R index baf0a72a..55f0735e 100644 --- a/inst/App/leftPanel/menu/cmdAbout.R +++ b/inst/App/leftPanel/menu/cmdAbout.R @@ -6,7 +6,7 @@ cmdAbout<-function(){ modalAbout <- function(..., size = "m" ) { modalDialog( - div( img(src="ptR/pointRLogo.SVG")), + div( pointRLogoSVG()), div( p(version, align="right")), div( width="100%", p(paste( diff --git a/inst/App/rightPanel/serverPanelDispatch.R b/inst/App/rightPanel/serverPanelDispatch.R index a8ec584c..b4886438 100644 --- a/inst/App/rightPanel/serverPanelDispatch.R +++ b/inst/App/rightPanel/serverPanelDispatch.R @@ -53,22 +53,22 @@ output$MidRightPanel<-renderUI({ # cat('************ inside output$MidRightPanel: aptRunner***************\n') moduleLogUI("aptRunnerLogMod", input, output) } else { - div( img(src="ptR/pointRLogo.SVG") ) + div( pointRLogoSVG() ) } } else if( chosenRightMidPanel == rmdPanelTag ){ # cat("chosenRightMidPanel=8\n") modulePlotRmdUI("rmdMod", input, output) } else if(chosenRightMidPanel == textPanelTag){ # cat("chosenRightMidPanel=9\n") - div( img(src="ptR/pointRLogo.SVG") ) + div( pointRLogoSVG() ) #Todo add something about sponsors. } else if(chosenRightMidPanel == snippetPanelTag){ # cat("chosenRightMidPanel=10\n") - div( img(src="ptR/pointRLogo.SVG") ) + div( pointRLogoSVG() ) #Todo add something about sponsors. } else { cat("chosenRightMidPanel=11\n") - div( img(src="ptR/pointRLogo.SVG")) + div( pointRLogoSVG()) } diff --git a/inst/App/ui.R b/inst/App/ui.R index 258c5850..5c2db207 100755 --- a/inst/App/ui.R +++ b/inst/App/ui.R @@ -62,7 +62,7 @@ shinyUI( buildLeftMenu(if(usingElectron){""} else {version}), #-------left menu end------------ #-------left content begin-------- - + # absolutePanel(id="logo.left", top=145, left=0, width="100%", img(src="ptR/pointRLogo.SVG") ), div( id='aceTabSet', class="container", tabsetPanel(id='pages') ), @@ -74,7 +74,9 @@ shinyUI( top=105, left=0, width="100%", "class"="headerPanel", draggable=FALSE, height="30px", buildHToolBar(bar2) ), - absolutePanel(id="logo.left", top=145, left=0, width="100%", img(src="ptR/pointRLogo.SVG") ), + absolutePanel(id="logo.left", top=145, left=0, width="100%", pointRLogoSVG()), + #img(id="logo.left", src="ptR/pointRLogo.SVG") , + #), div( id='snippetToolBarContainer', "class"="cSnippetToolBarContainer", #draggable=FALSE , tags$ul( id='dndSnippetList', "class"="cSnippetToolBarList", NULL @@ -170,7 +172,8 @@ shinyUI( #---right bootstrap page begin-------------- bootstrapPage( buildRightMenu(), - absolutePanel(id="logo.left", top=145, left=0, width="100%", img(src="ptR/pointRLogo.SVG") ), + absolutePanel(id="logo.right", top=145, left=0, width="100%", pointRLogoSVG()), + # HTML(' ' )), div(newPreProcDropDown()), uiOutput("BottomRightPanel"), uiOutput("TopRightPanel"), diff --git a/inst/App/util/pointRLogoSVG.R b/inst/App/util/pointRLogoSVG.R new file mode 100644 index 00000000..60c09cad --- /dev/null +++ b/inst/App/util/pointRLogoSVG.R @@ -0,0 +1,20 @@ +pointRLogoSVG<-function(){HTML(" + + + + + + + + + + + + + + pointR + + + + " +)} \ No newline at end of file From b41b470f11899f9f3f0e44ada578ddb3f5f62d37 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Sun, 3 May 2020 19:55:04 -0400 Subject: [PATCH 043/263] bug fix: make graph unselectable --- inst/App/rightPanel/mid/moduleSVGR.R | 4 +++- inst/App/www/customStyle.css | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/mid/moduleSVGR.R b/inst/App/rightPanel/mid/moduleSVGR.R index d153d978..60b7ebcc 100644 --- a/inst/App/rightPanel/mid/moduleSVGR.R +++ b/inst/App/rightPanel/mid/moduleSVGR.R @@ -55,13 +55,15 @@ svgToolsScript<-function(type){ xy=scaleFactor*c(x,0)+c(5,5), x, text.anchor="start", alignment.baseline="hanging" , - transform=paste0('scale(',1/scaleFactor ,')') + transform=paste0('scale(',1/scaleFactor ,')'), + class="unselectable" ) ), lapply(ys, function(y)text(font.size=10, xy=scaleFactor*c(0,y)+c(5,-5), y, text.anchor="start", alignment.baseline="baseline", + class="unselectable", transform=paste0('scale(',1/scaleFactor ,')') )) ) } diff --git a/inst/App/www/customStyle.css b/inst/App/www/customStyle.css index 199c3a5c..0ebab940 100644 --- a/inst/App/www/customStyle.css +++ b/inst/App/www/customStyle.css @@ -14,7 +14,14 @@ font-style: normal; .irs-min, .irs-max{ color: #00FFFF; } - +.unselectable { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} h1{ font-family: 'Arial', cursive; font-weight: 400; From 31e16db1b5d1a0485fa280f4807c458a645a6298 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Sun, 3 May 2020 19:57:50 -0400 Subject: [PATCH 044/263] use crosshair cursor for point mode --- inst/App/rightPanel/mid/serverPlotBarPoints.R | 2 +- inst/App/www/IOjs/tagDragIO.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/mid/serverPlotBarPoints.R b/inst/App/rightPanel/mid/serverPlotBarPoints.R index e906cb7f..9254a0ce 100755 --- a/inst/App/rightPanel/mid/serverPlotBarPoints.R +++ b/inst/App/rightPanel/mid/serverPlotBarPoints.R @@ -81,7 +81,7 @@ newPtLayer % Date: Tue, 5 May 2020 17:51:18 -0400 Subject: [PATCH 045/263] bug fix: tib[[x,y]] => tib[[y]][[x]] --- inst/App/rightPanel/footer/serverFooterRight.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/App/rightPanel/footer/serverFooterRight.R b/inst/App/rightPanel/footer/serverFooterRight.R index 80fdd846..afa64b3a 100644 --- a/inst/App/rightPanel/footer/serverFooterRight.R +++ b/inst/App/rightPanel/footer/serverFooterRight.R @@ -29,7 +29,7 @@ observeEvent( updateRowPicker(session, "myTibRowCntrl", insertRow=rowIndex+1, selectRow=rowIndex+1) newTib<-bind_rows(tib[1:rowIndex,], tib[rowIndex:nrow(tib),]) rowIndex=rowIndex+1 - matCol<-ncol(newTib[[rowIndex, getTibPtColPos()]]) + matCol<-ncol(newTib[[ getTibPtColPos()]][[rowIndex]]) pts<-newTib[[getTibPtColPos()]] #!!!! NOT USED????? ptDefs$tib[[selection]]<-newTib tabId<-getTibTabId() @@ -60,7 +60,7 @@ observeEvent( #adjust position rowIndex<-min(rowIndex, nrow(newTib)) - matCol<-ncol(newTib[[rowIndex, getTibPtColPos()]]) + matCol<-ncol(newTib[[getTibPtColPos()]][[rowIndex]]) if(length(matCol)==0){matCol=0} updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matCol ) ) } @@ -81,7 +81,7 @@ observeEvent( returnValue4ModuleRtFtr$tagMoveUp(),{ #adjust position rowIndex<-rowIndex-1 - matCol<-ncol(newTib[[rowIndex, getTibPtColPos()]]) + matCol<-ncol(newTib[[ getTibPtColPos()]][[rowIndex]]) if(length(matCol)==0){matCol=0} updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matCol ) ) } @@ -102,7 +102,7 @@ observeEvent( returnValue4ModuleRtFtr$tagMoveDown(),{ #adjust position rowIndex<-rowIndex+1 - matCol<-ncol(newTib[[rowIndex, getTibPtColPos()]]) + matCol<-ncol(newTib[[getTibPtColPos()]][[rowIndex]]) if(length(matCol)==0){matCol=0} updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matCol ) ) } @@ -149,13 +149,13 @@ observeEvent( returnValue4ModuleRtFtr$tagPt(), { updateRowPicker(session, "myTibRowCntrl", insertRow=rowIndex+1, selectRow=rowIndex+1) - m<-tib[[ rowIndex, getTibPtColPos() ]] + m<-tib[[getTibPtColPos() ]][[ rowIndex]] ptDefs$mats[selection]<-FALSE # no longer a matrix input! newTib<-tagTib(tib, getTibPtColPos(), rowIndex, matCol) rowIndex<-rowIndex+1 - matCol<-length(newTib[[rowIndex, getTibPtColPos()]])/2 + matCol<-length(newTib[[getTibPtColPos()]][[rowIndex]])/2 ptDefs$tib[[selection]]<-newTib tabId<-getTibTabId() From 9c1648e607b1b2355c934550654caaf010b10ecf Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 5 May 2020 17:52:37 -0400 Subject: [PATCH 046/263] remove list entry option from modal --- inst/App/rightPanel/menu/cmdNewColumn.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 7eebfc8f..f327ec98 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -11,7 +11,7 @@ addNewColModal <- function(errMssg=NULL) { div( class='ptR2', awesomeRadio('modalColTreatAs', 'Initialize Column Values as ', choices = list( - ' a character string'='string','a single number'='number','a vector or list'='expression', + ' a single character string'='string','a single number'='number','a vector'='expression', 'a matrix of points'='points' , 'the result of a preprocessing script'='script' ) , inline = TRUE @@ -69,7 +69,7 @@ observeEvent(input$commitNewCol, { treatAs<-input$modalColTreatAs newVal<-input$modalAttrValue - + # browser() #checks if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ # check name syntax @@ -87,6 +87,7 @@ observeEvent(input$commitNewCol, { showModal(addNewColModal( errMssg="Unable to evaluate expression") ) } else { # checks passed #add name to tib + cat('treatAs=', format(treatAs),'\n') cat('newVal=', format(newVal),'\n') newPtDefs<-getPtDefs() @@ -94,6 +95,7 @@ observeEvent(input$commitNewCol, { # browser() if(treatAs=='script'){ # apply script sequentially to newPtDefs # extract onNewRowScript + # browser() script_Name<-input$modalColPreProcScript tb<-filter(preProcScriptDB$attrs, scriptName==script_Name) scripts<-unlist(tb$script) @@ -105,7 +107,7 @@ observeEvent(input$commitNewCol, { tryCatch({ # 1. newPtDefs<-getPtDefs() #newPtDefs<-getPtDefs() - #browser() + # browser() # 2. tibs<-newPtDefs$tib @@ -158,7 +160,7 @@ observeEvent(input$commitNewCol, { newVal<-list(matrix(0,2,0)) } else if ( treatAs=='expression'){ newVal<-list(eval(parse(text=newVal))) # to do: validate!!! - } + } # newVal is ready to insert newPtDefs$tib[[getAssetName()]]<-add_column(newPtDefs$tib[[getAssetName()]], !!(newColName):=newVal ) From b8bf5792265c343466ae436bed828b35d2faae2a Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 5 May 2020 17:53:49 -0400 Subject: [PATCH 047/263] getTibMatCol if null set to 0 --- inst/App/rightPanel/selector/serverAssetSelection.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 0b27664d..cc6930b4 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -63,7 +63,12 @@ atLeast2Rows<-reactive({ }) getTibRow<-reactive({selectedAsset$rowIndex}) -getTibMatCol<-reactive({ selectedAsset$matCol }) +getTibMatCol<-reactive({ + if(is.null(selectedAsset$matCol)){ + selectedAsset$matCol<-0 + } + selectedAsset$matCol +}) getTibPtsNCol<-reactive({ sapply(getTibPts(),ncol)} ) getTransformType<-reactive({ @@ -111,7 +116,7 @@ resetSelectedTibbleName<-function(tibs, name){ selectedAsset$rowIndex=0 selectedAsset$ptColName=NULL selectedAsset$columnName=NULL - selectedAsset$matCol=NULL + selectedAsset$matCol=1 } else { tib<-getPtDefs()$tib[[selectedAsset$name]] # set row @@ -128,6 +133,7 @@ resetSelectedTibbleName<-function(tibs, name){ } entry<-tib[[ptColName]][[rowIndex]] matColIndex<-ncol(entry) + # browser() selectedAsset$matCol<-matColIndex selectedAsset$ptColName=ptColName if(is.null(selectedAsset$selIndex) || selectedAsset$selIndex!=2){ @@ -179,6 +185,7 @@ updateSelected<-function( name, rowIndex, columnName, matCol, ptColName, selInd selectedAsset$rowIndex=rowIndex } if(!missing(matCol)){ + # browser() selectedAsset$matCol=matCol } if(!missing(selIndex)){ From 95d354fa9c442abd7cc3212a2684f19733ea58b0 Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 5 May 2020 17:55:17 -0400 Subject: [PATCH 048/263] get orderingreorder width --- inst/App/rightPanel/selector/serverWidgetHandler.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index f5773df1..cf5400f5 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -21,8 +21,8 @@ type2WidgetChoices<-function(colType){ point=c('radio','picker'), character=c('radio','picker'), #'switch', 'toggle'), character.list= c('radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range - character.list.2= c('slider','radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range - character.list.vec= c('radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range + character.list.2= c('picker','slider','radio'), #, "multiInput", 'picker', 'checkbox'), #range + character.list.vec= c('picker','radio'), #, "multiInput", 'picker', 'checkbox'), #range integer=c('radio','picker','slider', "numeric"), #,'knob' numeric=c('radio','picker','slider', "numeric"), #,'knob' numeric.list=c('radio','picker'), #,'slider', "numeric"), #,'knob' From d024e647d2b7084b2194f1800c84ab2757a559dd Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 5 May 2020 17:56:23 -0400 Subject: [PATCH 049/263] seperated slider widget treatment form other widgets --- inst/App/rightPanel/header/moduleEdTib.R | 113 ++++++++++++----------- 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index 89c52afd..c4c70fb0 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -122,70 +122,77 @@ moduleEdTib<-function(input, output, session, output$columnEntryUI<-renderUI({ if( getTibEditState()==TRUE ){ - # cat("\nEntering----------output$colEntryUI---------------\n") - # cat("\nInitial value of getRowIndex", format(getRowIndex()), "\n") - # cat('--calling ---getWidget2----------\n') + cat("\nEntering----------output$colEntryUI---------------\n") + cat("\nInitial value of getRowIndex", format(getRowIndex()), "\n") + cat('--calling ---getWidget2----------\n') widget<-getWidget() - # cat("widget=",format(widget),"\n") - # cat("getTibEntry()=",format(getTibEntry()),"\n") - # cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") + cat("widget=",format(widget),"\n") + cat("getTibEntry()=",format(getTibEntry()),"\n") + cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") if(!is.null(widget) && !is.null(getTibEntry()) && !is.null(getTibEntryChoices())){ selected<-getTibEntry() - # cat("length(selected)= ", length(selected), "\n") - if(length(selected)>1 ){ - selected<-paste("c(", paste(format(selected), collapse="," ),')') + choices<-getTibEntryChoices() + if(widget=='slider'){ + # cat('xxx widget=', format(widget),"\n") + sliderInput( + inputId=ns("entrySlider"),label = NULL, min=0,max = 100, value = as.numeric(selected) + ) + } else { + if(length(selected)>1 ){ + selected<-paste("c(", paste(format(selected), collapse="," ),')') + } + choices<-lapply(choices, function(val){ + if(length(val)>1){ + val<-paste('c(', paste(format(val), collapse="," ),')') + } + val + }) + choices<-sort(unique(unlist( choices ))) + if(widget=='radio'){ + # cat('xxx widget=', format(widget),"\n") + radioGroupButtons(inputId=ns("entryRadio"), + choices=choices, + selected=selected, + justified=TRUE + ) + } else if (widget=='picker'){ + # cat('xxx widget=', format(widget),"\n") + div( "class"="ptR2", width='800px', + selectizeInput(ns("entryValue"), label=NULL, + choices=choices, selected=selected, + options = list(create = TRUE, allowEmptyOption=FALSE, maxItems=1, width='200px') + ) + ) + } else if(widget=='colourable') { + # cat('xxx widget=', format(widget),"\n") + colourInput( + ns("entryColour"), label=NULL, value=selected + ) + } else if(widget=='numeric'){ + # cat('xxx widget=', format(widget),"\n") + numericInput( + ns('entryNumeric'), label = NULL, min=1, max = 100, value = as.numeric(selected) + ) + } else if(widget=='knob'){ + # cat('xxx widget=', format(widget),"\n") + cat('value is ',selected, '\n') + div(knobInput( + ns('entryKnob'), label = NULL, min=1, max = 100, value = as.numeric(selected), width=100, height=100 + )) + } } + # cat("length(selected)= ", length(selected), "\n") + # cat("length(selected)= ", length(selected), "\n") # cat("(selected)= ", format(selected), "\n") - choices<-getTibEntryChoices() - choices<-lapply(choices, function(val){ - if(length(val)>1){ - val<-paste('c(', paste(format(val), collapse="," ),')') - } - val - }) + + - choices<-sort(unique(unlist( choices ))) #getTibEntryChoices() #) #)) # cat('inside moduleEdTib::output$colEntryUI if widget==...\n') - if(widget=='radio'){ - # cat('xxx widget=', format(widget),"\n") - radioGroupButtons(inputId=ns("entryRadio"), - choices=choices, - selected=selected, - justified=TRUE - ) - } else if (widget=='picker'){ - # cat('xxx widget=', format(widget),"\n") - div( "class"="ptR2", width='800px', - selectizeInput(ns("entryValue"), label=NULL, - choices=choices, selected=selected, - options = list(create = TRUE, allowEmptyOption=FALSE, maxItems=1, width='200px') - ) - ) - } else if(widget=='colourable') { - # cat('xxx widget=', format(widget),"\n") - colourInput( - ns("entryColour"), label=NULL, value=selected - ) - } else if(widget=='numeric'){ - # cat('xxx widget=', format(widget),"\n") - numericInput( - ns('entryNumeric'), label = NULL, min=1, max = 100, value = as.numeric(selected) - ) - } else if(widget=='slider'){ - # cat('xxx widget=', format(widget),"\n") - sliderInput( - inputId=ns("entrySlider"),label = NULL, min=1,max = 100, value = as.numeric(selected) - ) - } else if(widget=='knob'){ - # cat('xxx widget=', format(widget),"\n") - div(knobInput( - ns('entryKnob'), label = NULL, min=1, max = 100, value = as.numeric(selected), width=100, height=100 - )) - } + # else if( widget=='spectrum'){ # spectrumInput( # inputId = ns("entrySpectrum"), From c5b77cdf00a153f6418b4c5ab63392c6fda847ab Mon Sep 17 00:00:00 2001 From: stephen legrand Date: Tue, 5 May 2020 18:01:03 -0400 Subject: [PATCH 050/263] use columntype to decide how to set value in Tib col --- inst/App/rightPanel/header/serverEdTib.R | 57 +++++++++++++----------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/inst/App/rightPanel/header/serverEdTib.R b/inst/App/rightPanel/header/serverEdTib.R index d39ddeba..f700518f 100644 --- a/inst/App/rightPanel/header/serverEdTib.R +++ b/inst/App/rightPanel/header/serverEdTib.R @@ -92,23 +92,29 @@ observeEvent(returnValue4ModuleEdTib$entryValue(),{ if( getTibEditState()==TRUE ){ log.fin(returnValue4ModuleEdTib$entryValue() ) entry<-returnValue4ModuleEdTib$entryValue() + # if(length(entry)==0 || is.na(entry) ){ return(NULL) } - if(identical(getColumnType(),'point')){ entry<-which(entry==c('point','matrix')) if(length(entry)){ updateSelected(selIndex =entry) } - } else { - if(isNumericString(entry)){ - entry<-as.numeric(entry) - } else if (getColumnType() %in% + return(NULL) + } + # format entry according to columnType + if (identical(getColumnType(),'integer')){ + entry=as.integer(entry) + } else if (identical(getColumnType(),'numeric')){ + entry=as.numeric(entry) + } else if (identical(getColumnType(),'logical')){ + entry=as.logical(entry) + } else if (length(entry)==1 && getColumnType() %in% c("character.list", "character.list.2", "character.list.vec", "numeric.list", "numeric.list.2", "integer.list.2", "numeric.list.vec", "integer.list.vec") - ){ + ){ bad<-TRUE tryCatch({ entry<-eval(parse(text=entry)) #TODO!!!!!!!!!!!!! Better Error check??? @@ -118,28 +124,27 @@ observeEvent(returnValue4ModuleEdTib$entryValue(),{ triggerRefresh('cmd.commit') # this works but move to the last row. return(NULL) #TODO !!!! force reset dropdown value in modulueEdTib (refresh or commit?) } - } - name<-getAssetName() - newPtDefs<-getPtDefs() - columnName<-getTibColumnName() - rowIndex<-getTibRow() - good<-all(!sapply(list(name, newPtDefs, columnName, rowIndex), is.null)) - stopifnot(good) - tib<-newPtDefs$tib[[name]] - stopifnot( - 0 Date: Tue, 5 May 2020 19:54:10 -0400 Subject: [PATCH 051/263] remove fucntion pointRLogoSVG() --- inst/App/leftPanel/menu/cmdAbout.R | 3 ++- inst/App/rightPanel/serverPanelDispatch.R | 9 +++++---- inst/App/ui.R | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/inst/App/leftPanel/menu/cmdAbout.R b/inst/App/leftPanel/menu/cmdAbout.R index 55f0735e..31d13fb0 100644 --- a/inst/App/leftPanel/menu/cmdAbout.R +++ b/inst/App/leftPanel/menu/cmdAbout.R @@ -6,7 +6,8 @@ cmdAbout<-function(){ modalAbout <- function(..., size = "m" ) { modalDialog( - div( pointRLogoSVG()), + # div( pointRLogoSVG()), + div(img(src="ptR/pointRlogo.svg")), div( p(version, align="right")), div( width="100%", p(paste( diff --git a/inst/App/rightPanel/serverPanelDispatch.R b/inst/App/rightPanel/serverPanelDispatch.R index b4886438..c0377bc0 100644 --- a/inst/App/rightPanel/serverPanelDispatch.R +++ b/inst/App/rightPanel/serverPanelDispatch.R @@ -53,22 +53,23 @@ output$MidRightPanel<-renderUI({ # cat('************ inside output$MidRightPanel: aptRunner***************\n') moduleLogUI("aptRunnerLogMod", input, output) } else { - div( pointRLogoSVG() ) + div(img(src="ptR/pointRlogo.svg")) } } else if( chosenRightMidPanel == rmdPanelTag ){ # cat("chosenRightMidPanel=8\n") modulePlotRmdUI("rmdMod", input, output) } else if(chosenRightMidPanel == textPanelTag){ # cat("chosenRightMidPanel=9\n") - div( pointRLogoSVG() ) + div(img(src="ptR/pointRlogo.svg")) #Todo add something about sponsors. } else if(chosenRightMidPanel == snippetPanelTag){ # cat("chosenRightMidPanel=10\n") - div( pointRLogoSVG() ) + div(img(src="ptR/pointRlogo.svg")) #Todo add something about sponsors. } else { cat("chosenRightMidPanel=11\n") - div( pointRLogoSVG()) + div(img(src="ptR/pointRlogo.svg")) + # div( pointRLogoSVG()) } diff --git a/inst/App/ui.R b/inst/App/ui.R index 5c2db207..098df157 100755 --- a/inst/App/ui.R +++ b/inst/App/ui.R @@ -74,7 +74,8 @@ shinyUI( top=105, left=0, width="100%", "class"="headerPanel", draggable=FALSE, height="30px", buildHToolBar(bar2) ), - absolutePanel(id="logo.left", top=145, left=0, width="100%", pointRLogoSVG()), + absolutePanel(id="logo.left", top=145, left=0, width="100%", #pointRLogoSVG()), + div(img(src="ptR/pointRlogo.svg"))), #img(id="logo.left", src="ptR/pointRLogo.SVG") , #), div( id='snippetToolBarContainer', "class"="cSnippetToolBarContainer", #draggable=FALSE , @@ -172,7 +173,8 @@ shinyUI( #---right bootstrap page begin-------------- bootstrapPage( buildRightMenu(), - absolutePanel(id="logo.right", top=145, left=0, width="100%", pointRLogoSVG()), + absolutePanel(id="logo.right", top=145, left=0, width="100%", #pointRLogoSVG()), + div(img(src="ptR/pointRlogo.svg"))), # HTML(' ' )), div(newPreProcDropDown()), uiOutput("BottomRightPanel"), From 7f8a516e1c71728ef1abdd5881e766dfb4855125 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 6 May 2020 10:03:25 -0400 Subject: [PATCH 052/263] remove sampleProjects --- inst/App/rightPanel/header/moduleEdTib.R | 45 +- .../.workspace/PTR-TABID3f943c89a3ab.rda | Bin 797 -> 0 bytes .../FeymanGraphs/.workspace/currentTab.rda | Bin 83 -> 0 bytes inst/App/sampleProjects/FeymanGraphs/Feyman.R | 16 - .../FeymanGraphs/FeymanGraphs.pprj | 12 - .../.workspace/PTR-TABID308f46cf0aa0.rda | Bin 1678 -> 0 bytes .../autoArrow/.workspace/currentTab.rda | Bin 74 -> 0 bytes inst/App/sampleProjects/autoArrow/autoArrow.R | 70 -- .../sampleProjects/autoArrow/autoArrow.pprj | 12 - .../autoArrow/aux/preprocAts/fromToLinking.R | 50 - .../.workspace/PTR-TABID4b7e4150e02.rda | Bin 3142 -> 0 bytes .../.workspace/PTR-TABID4b7e4cc8fe1e.rda | Bin 892 -> 0 bytes .../.workspace/PTR-TABID4b7e614fe62f.rda | Bin 1254 -> 0 bytes .../diagramMaker/.workspace/currentTab.rda | Bin 74 -> 0 bytes .../.workspace/loadedDnippets.rda | Bin 209 -> 0 bytes .../sampleProjects/diagramMaker/arrow.cmp.R | 48 - .../sampleProjects/diagramMaker/arrowTest.R | 25 - .../diagramMaker/aux/dnds/reactiveFlow.dnds | 168 ---- .../diagramMaker/aux/dnds/sampleShapes.dnds | 527 ----------- .../diagramMaker/aux/preprocPts/snapTo50.R | 32 - .../App/sampleProjects/diagramMaker/balloon.R | 29 - .../diagramMaker/develObjects.R | 114 --- .../diagramMaker/diagramMaker.pprj | 12 - .../App/sampleProjects/diagramMaker/ideas.Rmd | 485 ---------- .../sampleProjects/diagramMaker/ideas.html | 860 ------------------ inst/App/sampleProjects/diagramMaker/main.R | 41 - .../diagramMaker/roundedPolylineExample.R | 79 -- .../.workspace/PTR-TABID29191090a434.rda | Bin 1548 -> 0 bytes .../.workspace/PTR-TABID2919a413d66.rda | Bin 1123 -> 0 bytes .../.workspace/PTR-TABID5bd14765978b.rda | Bin 978 -> 0 bytes .../pythag/.workspace/currentTab.rda | Bin 83 -> 0 bytes .../pythag/aux/preprocPts/snap50.R | 33 - .../pythag/aux/preprocPts/snapto1.R | 45 - .../pythag/aux/preprocPts/snapto5.R | 39 - .../pythag/fredkin_switch_gate.R | 72 -- .../pythag/fredkin_switch_gate2.R | 93 -- inst/App/sampleProjects/pythag/pythag.pprj | 12 - .../.workspace/PTR-TABID25d9190dff34.rda | Bin 631 -> 0 bytes .../.workspace/PTR-TABID25d96494b000.rda | Bin 704 -> 0 bytes .../.workspace/PTR-TABID3a76585f47c.rda | Bin 642 -> 0 bytes .../.workspace/PTR-TABIDa9527235bba.rda | Bin 1190 -> 0 bytes .../.workspace/PTR-TABIDa954e443c9d.rda | Bin 931 -> 0 bytes .../.workspace/loadedDnippets.rda | Bin 199 -> 0 bytes inst/App/sampleProjects/shinyDialInput/app.R | 23 - .../shinyDialInput/aux/dnds/jstools.dnds | 450 --------- .../shinyDialInput/aux/dnds/sampleShapes.dnds | 527 ----------- .../sampleProjects/shinyDialInput/test.SVG | 11 - .../sampleProjects/shinyDialInput/widget.pprj | 1 - .../shinyDialInput/widgetCntrl.R | 89 -- .../shinyDialInput/widget_svg.R | 103 --- .../shinyDialInput/www/widget.js | 74 -- .../.workspace/PTR-TABID25d9190dff34.rda | Bin 631 -> 0 bytes .../.workspace/PTR-TABID25d96494b000.rda | Bin 704 -> 0 bytes .../.workspace/PTR-TABID3a76585f47c.rda | Bin 642 -> 0 bytes .../.workspace/PTR-TABIDa9527235bba.rda | Bin 1190 -> 0 bytes .../.workspace/PTR-TABIDa954e443c9d.rda | Bin 931 -> 0 bytes .../.workspace/loadedDnippets.rda | Bin 199 -> 0 bytes .../shinyDialInputOptimized/app.R | 23 - .../aux/dnds/jstools.dnds | 450 --------- .../aux/dnds/sampleShapes.dnds | 527 ----------- .../shinyDialInputOptimized/test.SVG | 11 - .../shinyDialInputOptimized/widget.pprj | 1 - .../shinyDialInputOptimized/widgetCntrl.R | 45 - .../shinyDialInputOptimized/widget_svg.R | 74 -- .../shinyDialInputOptimized/www/widget.js | 84 -- .../.workspace/PTR-TABID1b8a789c513.rda | Bin 1074 -> 0 bytes .../.workspace/PTR-TABID41cd6cdad2c7.rda | Bin 1605 -> 0 bytes .../.workspace/PTR-TABID704c2e20c007.rda | Bin 1705 -> 0 bytes .../.workspace/PTR-TABIDa9527235bba.rda | Bin 1362 -> 0 bytes .../shinyQuibitCtrl/.workspace/currentTab.rda | Bin 72 -> 0 bytes .../.workspace/loadedDnippets.rda | Bin 219 -> 0 bytes inst/App/sampleProjects/shinyQuibitCtrl/app.R | 39 - .../shinyQuibitCtrl/aux/dnds/jstools.dnds | 450 --------- .../aux/dnds/sampleShapes.dnds | 527 ----------- .../shinyQuibitCtrl/circularArc.R | 36 - .../sampleProjects/shinyQuibitCtrl/pieShape.R | 36 - .../shinyQuibitCtrl/pieShape2.R | 38 - .../shinyQuibitCtrl/shinyInput.pprj | 22 - .../shinyQuibitCtrl/shinyInputCntrl.R | 104 --- .../shinyQuibitCtrl/shinyInput_svg.R | 69 -- .../sampleProjects/shinyQuibitCtrl/test.SVG | 11 - .../shinyQuibitCtrl/www/shinyInput.js | 78 -- .../.workspace/PTR-TABID308f3cc5ee2a.rda | Bin 1103 -> 0 bytes .../zSortingShapes1/.workspace/currentTab.rda | Bin 74 -> 0 bytes .../zSortingShapes1/zSortShapes1.R | 35 - .../zSortingShapes1/zSortingShapes1.pprj | 12 - .../.workspace/PTR-TABID308f438db7e.rda | Bin 1533 -> 0 bytes .../zSortingShapes2/.workspace/currentTab.rda | Bin 73 -> 0 bytes .../aux/preprocAts/displayseq.R | 40 - .../zSortingShapes2/zSortingShapes2.R | 63 -- .../zSortingShapes2/zSortingShapes2.pprj | 12 - 91 files changed, 4 insertions(+), 6980 deletions(-) delete mode 100644 inst/App/sampleProjects/FeymanGraphs/.workspace/PTR-TABID3f943c89a3ab.rda delete mode 100644 inst/App/sampleProjects/FeymanGraphs/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/FeymanGraphs/Feyman.R delete mode 100644 inst/App/sampleProjects/FeymanGraphs/FeymanGraphs.pprj delete mode 100644 inst/App/sampleProjects/autoArrow/.workspace/PTR-TABID308f46cf0aa0.rda delete mode 100644 inst/App/sampleProjects/autoArrow/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/autoArrow/autoArrow.R delete mode 100644 inst/App/sampleProjects/autoArrow/autoArrow.pprj delete mode 100644 inst/App/sampleProjects/autoArrow/aux/preprocAts/fromToLinking.R delete mode 100644 inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e4150e02.rda delete mode 100644 inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e4cc8fe1e.rda delete mode 100644 inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e614fe62f.rda delete mode 100644 inst/App/sampleProjects/diagramMaker/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/diagramMaker/.workspace/loadedDnippets.rda delete mode 100644 inst/App/sampleProjects/diagramMaker/arrow.cmp.R delete mode 100644 inst/App/sampleProjects/diagramMaker/arrowTest.R delete mode 100644 inst/App/sampleProjects/diagramMaker/aux/dnds/reactiveFlow.dnds delete mode 100644 inst/App/sampleProjects/diagramMaker/aux/dnds/sampleShapes.dnds delete mode 100644 inst/App/sampleProjects/diagramMaker/aux/preprocPts/snapTo50.R delete mode 100644 inst/App/sampleProjects/diagramMaker/balloon.R delete mode 100644 inst/App/sampleProjects/diagramMaker/develObjects.R delete mode 100644 inst/App/sampleProjects/diagramMaker/diagramMaker.pprj delete mode 100644 inst/App/sampleProjects/diagramMaker/ideas.Rmd delete mode 100644 inst/App/sampleProjects/diagramMaker/ideas.html delete mode 100644 inst/App/sampleProjects/diagramMaker/main.R delete mode 100644 inst/App/sampleProjects/diagramMaker/roundedPolylineExample.R delete mode 100644 inst/App/sampleProjects/pythag/.workspace/PTR-TABID29191090a434.rda delete mode 100644 inst/App/sampleProjects/pythag/.workspace/PTR-TABID2919a413d66.rda delete mode 100644 inst/App/sampleProjects/pythag/.workspace/PTR-TABID5bd14765978b.rda delete mode 100644 inst/App/sampleProjects/pythag/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/pythag/aux/preprocPts/snap50.R delete mode 100644 inst/App/sampleProjects/pythag/aux/preprocPts/snapto1.R delete mode 100644 inst/App/sampleProjects/pythag/aux/preprocPts/snapto5.R delete mode 100644 inst/App/sampleProjects/pythag/fredkin_switch_gate.R delete mode 100644 inst/App/sampleProjects/pythag/fredkin_switch_gate2.R delete mode 100644 inst/App/sampleProjects/pythag/pythag.pprj delete mode 100644 inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABID25d9190dff34.rda delete mode 100644 inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABID25d96494b000.rda delete mode 100644 inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABID3a76585f47c.rda delete mode 100644 inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABIDa9527235bba.rda delete mode 100644 inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABIDa954e443c9d.rda delete mode 100644 inst/App/sampleProjects/shinyDialInput/.workspace/loadedDnippets.rda delete mode 100644 inst/App/sampleProjects/shinyDialInput/app.R delete mode 100644 inst/App/sampleProjects/shinyDialInput/aux/dnds/jstools.dnds delete mode 100644 inst/App/sampleProjects/shinyDialInput/aux/dnds/sampleShapes.dnds delete mode 100644 inst/App/sampleProjects/shinyDialInput/test.SVG delete mode 100644 inst/App/sampleProjects/shinyDialInput/widget.pprj delete mode 100644 inst/App/sampleProjects/shinyDialInput/widgetCntrl.R delete mode 100644 inst/App/sampleProjects/shinyDialInput/widget_svg.R delete mode 100644 inst/App/sampleProjects/shinyDialInput/www/widget.js delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID25d9190dff34.rda delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID25d96494b000.rda delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID3a76585f47c.rda delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABIDa9527235bba.rda delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABIDa954e443c9d.rda delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/.workspace/loadedDnippets.rda delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/app.R delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/aux/dnds/jstools.dnds delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/aux/dnds/sampleShapes.dnds delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/test.SVG delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/widget.pprj delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/widgetCntrl.R delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/widget_svg.R delete mode 100644 inst/App/sampleProjects/shinyDialInputOptimized/www/widget.js delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID1b8a789c513.rda delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID41cd6cdad2c7.rda delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID704c2e20c007.rda delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABIDa9527235bba.rda delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/.workspace/loadedDnippets.rda delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/app.R delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/jstools.dnds delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/sampleShapes.dnds delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/circularArc.R delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/pieShape.R delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/pieShape2.R delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/shinyInput.pprj delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/shinyInputCntrl.R delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/shinyInput_svg.R delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/test.SVG delete mode 100644 inst/App/sampleProjects/shinyQuibitCtrl/www/shinyInput.js delete mode 100644 inst/App/sampleProjects/zSortingShapes1/.workspace/PTR-TABID308f3cc5ee2a.rda delete mode 100644 inst/App/sampleProjects/zSortingShapes1/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/zSortingShapes1/zSortShapes1.R delete mode 100644 inst/App/sampleProjects/zSortingShapes1/zSortingShapes1.pprj delete mode 100644 inst/App/sampleProjects/zSortingShapes2/.workspace/PTR-TABID308f438db7e.rda delete mode 100644 inst/App/sampleProjects/zSortingShapes2/.workspace/currentTab.rda delete mode 100644 inst/App/sampleProjects/zSortingShapes2/aux/preprocAts/displayseq.R delete mode 100644 inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.R delete mode 100644 inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.pprj diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index c4c70fb0..51e89bad 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -181,18 +181,7 @@ moduleEdTib<-function(input, output, session, )) } } - # cat("length(selected)= ", length(selected), "\n") - - # cat("length(selected)= ", length(selected), "\n") - # cat("(selected)= ", format(selected), "\n") - - - - #getTibEntryChoices() - #) - #)) - # cat('inside moduleEdTib::output$colEntryUI if widget==...\n') - + # else if( widget=='spectrum'){ # spectrumInput( # inputId = ns("entrySpectrum"), @@ -211,19 +200,7 @@ moduleEdTib<-function(input, output, session, } }) - # output$matColIndexUI<-renderUI({ - # selected<-getTibEntry() %AND% getMatColMax() %AND% getMatColIndex() - # if(!is.null(selected) && getTibEntry()=='point'){ - # matColIndex=getMatColIndex() - # matColMax=getMatColMax() - # matColMin=ifelse(matColMax==0, 0, 1) - # numericInput(ns("matColIndex"), label="Mat Col", value= matColIndex, - # min=matColMin, max=matColMax, step=1, - # width= '80px' - # ) - # } - # }) - # + #---asset name--- observeEvent(c( name(), nameChoices() ), { #update the name @@ -234,17 +211,7 @@ moduleEdTib<-function(input, output, session, # cat('transformPanelContainer hide \n') hideElement('transformPanelContainer') } - # toggleElement( - # id='transformPanelContainer' , - # condition=(!is.null(name()) && name()==transformTag) - # ) - - # updateRadioGroupButtons(session, inputId=ns("name" ), - # choices=nameChoices(), selected=name() - # ) - - # cat('moduleEdTib observer:: name()=', format(name()),"\n") - + if(length(nameChoices())>0 && !is.null(name()) && nchar(name())>0 && !(name() %in% c( transformTag, RPanelTag, errorPanelTag, svgPanelTag)) ){ # cat('headEdTib show\n') showElement('headEdTib') @@ -253,11 +220,7 @@ moduleEdTib<-function(input, output, session, hideElement('headEdTib') hideElement(ns('headEdTib')) } - # toggleElement( - # id='headEdTib' , - # condition=!(name() %in% c( transformTag, RPanelTag, errorPanelTag, svgPanelTag)) - # ) - # cat('byre\n') + }) diff --git a/inst/App/sampleProjects/FeymanGraphs/.workspace/PTR-TABID3f943c89a3ab.rda b/inst/App/sampleProjects/FeymanGraphs/.workspace/PTR-TABID3f943c89a3ab.rda deleted file mode 100644 index 1f210838b5df3009e94ed754b92851dc9a25d1ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 797 zcmV+&1LFK2iwFP!000001C>=ho zgSW{^P8*9Pj%=4UFKoYMzh^&YzhIk_)JtMuK%^)+-* zLb3om%mv(IAg~7VYwB-#KAO2lu}9FE~>!71pOcPxd&(5AyWAVEJ2GhN&Mn$g`uU zrvIo5-M$C+UYyGR58R{FmAu>8%Ol%o&V^bKLqWIkrlwX3ITdrOBy}0p#*~xVRP@Lg zqoaLJaN<%{7BUTV`*XZfsN_UQ0?=VDkHGmZ_2B@7!)YWLZ%Sgf+!42Ea8z{2C201k z!6xD{k)E!!L6cCeh>m~GAOp4RBWm2q-(M0TKz6_fM^Y9xWwPmA#)H#1(mL~|P9cG3 z1{cW>%x|kI=oAc|vq39#LAQU-pu_y+f(P(eZPGc9`D} z!b0FPHgPUo&Z1JfIjRmYK0;@6)B`omTHESz>Xyz=r-<;_K!4Rzz#W#wxMZN{%1V9# zWs@mVG?@aq$xMt(2CkdDBz|A#Zn+^X=e?LBf&`Hd9gjpHnr`Uo^|S`m?UjQ{kwP~g zr$AQal8(&hEYk^S_=WgohzxTmJ0>JVdWJF}Z6&y8N&q>coJ4slQO`!c$jfL)Z_u0MM-CM1Ar{r?E zmE1~xDYvo;!`$k3C;R0_F1Nf6lMT2Zz`c~alUsx5qob2{`DADJ;8jg;bYIlXu8y$| z3`GiscM|Z~<@4R$=Xl7y9mc%zY*c9j_kM(kuOxEC=PXV7;CGvL7-my781>pEC7y9= zO-FB{taM1t-1VA1tcA4jJ&!+Bxy1gO-ezk&5`@}^Uxnvw61;S(mb7G+p#lUmC zVL*^+Q*)r9P%FYNq81uc+eRINdc-A6BE$;hDnn%;U8|rIFVZMrShx?)E9jWmAR_k*w!ALtQWnIT(YQ}-x&0szT7*;)7tw%BV-1T`1OzNw@6*w_ z(&2iXyhId0ocN$lcm`<5@?4^YVUT-~UhqBYN;eC-jRQH3oB+yRkuG(?Kb>jl&Xyla;im%Hq*o~)`=47fxQpG88h=nJe zB5;dOUhDO0y(-4Y!Ju%WB2zWhT79dssnu$FsidK5=?Z+-b;n(+Z%5#r{e4}Z2OFCJ zHX5}I*fpttM$U#ISU_Lz%z=%jp;h&)U4G7|XBWN`LiN49=3a9S`l10=H;oK*XfbY2 zFUBFXZoIA=^UzwO3QMk6Gg!0lxPy^<9+_=6jk+<1-P9XewVB;4vj*oqnMUy!KSYuhlN1tU$?!vJz~Up&&e!@kYt5`xMz}yHCnQ{d{AtI0!Q{=q1RVu}%8F8^gRNrVpovBPTkeJ0?w$(}A*>-GQu-NGjaq)S>>DsTYz60xtHIDwM?b>31kz+` zw0r|?pwX9V`}tu=ssaL)1xYpZjdm%dgKLN?Vf7ERv} z+Us*M_ZTHEZxuwlP>2)3$Gop13se=pEl3;iD;yR=Tbt21GF`YRKwKnJxEY4OD2gH) z2X)+UoxTZ``VRKhWNhOnYqen&J~knf@zFza=#PDqV2*j|KAw(W=(|hAVe{8++@%H~)UX|Bjhn z_0lAhXE)DQWtB}&(n|B;Yc!eQvm6XZcSJX~P&^-2<|~!6P~G+^B9s^Du;|W(2Pq$o zmlp6v%H-oyblYdf1*;5O)Vpz_n4awo8Sc!yyFm6o9NSshNK)r(z&+vZ6Yntm%7M5n zCzz|^EfxoNBO*S8$dOkhFd6l^$0{6m4&taj&hTh(j7KEqew^Wo=@C@;cwZSdcA>Dv zo>0)vCPA)Okx9{WOzQ`^X#|ag?I}Y zKD-eQT#LkqXg$MrXUInx7IZS8I{s#!GkYvI3Y2RML*J1!{Aq>_X*G1*#KP});MHz1 z&rfZ4MiqI;BI<(~wNK2!Rs575qgD#PCMiMR8^`Y=Nw6mA=`^JvX-W~Td0M5UBvnen zOl3HorWDMp9ASGH?_IH6n%?(gNeQsy+vK>9eG*hG*NQ8U0*y~Ey(mdZMDs&Q2)&$= z;j=soWgO~$kL@%GPiCYLCO(R diff --git a/inst/App/sampleProjects/autoArrow/.workspace/currentTab.rda b/inst/App/sampleProjects/autoArrow/.workspace/currentTab.rda deleted file mode 100644 index 39dd3a6ce144a9e0aca9d88e2f2ac6f0ea5b21b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74 zcmb2|=3oE==I#ec2?+^l32DhG32CfGk`d0%cS>{{co-GZQW6p$uv}WisOY#$vCnUw a-Z3_@OtrL=nQWb%Yz%=PH}u#5jQ{{O8y8*x diff --git a/inst/App/sampleProjects/autoArrow/autoArrow.R b/inst/App/sampleProjects/autoArrow/autoArrow.R deleted file mode 100644 index 56dda29a..00000000 --- a/inst/App/sampleProjects/autoArrow/autoArrow.R +++ /dev/null @@ -1,70 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(800,600) - -# 1. ensure that the attribute preprocessor for circle$id -# is set to 'fromtolinking' -# 2. When a new circle is created via a mouse click, -# an id will be generated for that circle -# 3. To create an arrow connecting a two circles: -# i. Select the id of first circle while pressing the 'a' key -# ii. Select the id of second circle while pressing the 'b' key -# note: if step ii is not done, the arrow will point to the last to circle - -# Defined by mouse: edit with care! -ptR<-list( - circle= tribble( - ~id, ~fill, ~cxy, - 'yemedaxb', '#E06262', matrix( c(c(367.5,330)), 2), - 'jfnwfdhl', '#EAFF00', matrix( c(c(315.5,183)), 2), - 'ncipjeju', '#FF00EA', matrix( c(c(191,200)), 2), - 'tqtyjzpm', '#0CC9C9', matrix( c(c(485,151)), 2), - 'udrtlyzw', '#61E619', matrix( c(c(382.5,62)), 2), - 'chmnkvnq', '#099161', matrix( c(c(508,293)), 2), - 'rdkqglru', '#FF0000', matrix( c(c(67,89)), 2), - 'pkztfnpg', '#0011FF', matrix( c(c(137,380)), 2) - ), - links= tribble( - ~fromId, ~toId, ~points, - 'tqtyjzpm', 'udrtlyzw', matrix(0,2,0), - 'tqtyjzpm', 'yemedaxb', matrix(0,2,0), - 'chmnkvnq', 'tqtyjzpm', matrix(0,2,0), - 'cfqzzhcj', 'rdkqglru', matrix(0,2,0), - 'rdkqglru', 'cfqzzhcj', matrix(0,2,0), - 'japgmptb', 'ncipjeju', matrix(0,2,0), - 'japgmptb', 'jfnwfdhl', matrix(0,2,0), - 'ncipjeju', 'rdkqglru', matrix(0,2,0), - 'pkztfnpg', 'jfnwfdhl', matrix(0,2,0) - ) -) - -arrs<-ptR$links %>% - inner_join( ptR$circle, by=c('fromId'='id') )%>% - inner_join( ptR$circle, by=c('toId'='id') ) %>% - select(c(5,7)) %>% - rename(p1=cxy.x, p2=cxy.y) - - -R=50 - - -arrow%SRfd-6DVupN^cFot@`zm%RPP znwy(@XYQT%-@o{b|bITpIF(Ey*HVT3=rZBRUW?c|=c`Sc*bM<>Fovg4l;^p=L3kDM65x>X@ z7+sKKE=Wof5RyYal1kgUBrX|6`B2@FfnXCtemn7#T6g*Sc=!RfwJlw>wnJbOJdI%#Kad85+f~x{_axo#11b=dp z4_Sis2nxuCNXf#&{1U`|3Cd$hFv$x6CM=nVFJ(MR z^S!0@ESq0gFbXh?dazWZtI`A!NUqEoh0q*N^IBzFYXj@BNFAsgz{8#s!uod~y-r&Z)1$4PSATvRbDqa%_z~4>f5; zYJTiW@4WU0Ad9%9`_RS6pMpOyUlGF~a0kj9ri!VApoURyeCDIIwbGY`g?oGJ`wua` z4>xzn{^s`Py@M?X^5b2&-P$1=dyfzIH}|0MZ0u;7F&&zB=Nvj3W8rhCPP84aF%;TIg-(YU?6;6G~2LT(D*sp`^nCAx87rI0LAV5UQpSOG5=0T88`3fKdBo zDq+o_<}!#x5VPjUB+Dm_d%uWdR>lhZV#-p0(0Fpr`%)TW#&I2($=3u9{y|(}Apm$U zgZ(UPXfa`{`qT#~4|OU+ToTr-I>!ja&`1#ENJG|fl+u_Ov_sIs&|v}45M&^fx{tX3 zgIXTUBzDFGBwCUm3aMfJxJcES<`R%TP61D{gl5h;MN@uUM~zvC%hc=jvS}KY^py6J zkpqSkmF!&_LB-i41&Oc&P+`cKfDpu!GWS|XV-#TNvx23VR}WAQdN7ZCAE(ET0sN#8 zOEVdu{KYcHIvo<3!eWp8+3;Z&s~&_GB%jpnMPLbz((;C;Q9{uro$f~O!9TU9ae*j{ zIG6nnm67b6S%(k%f&E3d>n?Y@j)mB0D|Mq`|L~#SYoH!`JOR0tuDjB8T;K&Z$g3O7 zL)`DAJY^jhHa7f(^*gZPU}?vhF}|n9T&#hVDqz>samBd53}%^4ly*vEfvEyTyh+GY ziP6etV{u8j#B`YPxkm1X@U4~$Gpv?5P*4x)#vjgM< zVpYyAj-oIh_Lp`2S=E-Y_6v3uS52XnphNSI=3xo5d)i#bLeq9(<%Gsk?0CNRxAfMl zE|3GNLeQJIjiD~-{H-(Fc{I@u`{4!Iyn?^Gu({-t#&-#cjzKdb6#{~f;D%A~`PfB@ zhAp4M=EYD*|r85(|XI#YN{w?G64>Dd;@vxMPDU;qz5*H2ik?XlYsBkJWwe$P1s>!&*t| z#GpAGV`+i{7yc8k`i4++%^oU5;lw596IE-T&JO;mywG3T2kVSjrq`~H7iAGl2ht`@ z$Y^zZyAGfR>Y_iyX9?Xr0C@xJikTv_`t3!j8c$X|fZ2Fr8rJQ(No2MNqapBoX}9=c zbbRbMb&d%pS#!U2dq?Do*?ujFe#JSybEO;`sDoukL}S~e+x?;h`sH)EF4F_6+exR9 z_!hd?Tekl_>`@UklS4bGvaI9YSGXiVDG*#WaELP#C~GCJ3oli#%m^4@8z3KUZxA@o zch6=m`3kV^l7e4eFeTrBL|8?kw7aH{Ua}WvCP@jNOA=95I4|g-X0on}ndC|hg|p7s zWu4E7f=zN&+^o9iO0}Th(!2;+FRqR2g6q#i*Ef~*Ix1^6SYvTr0@hr>a|G)&>TL?F z%V+1;2G!**{Fe>UWtc7l=*Okp>xbu`(L#{Sh5tkEymSM-bO)8`cooPTRW;Cn;;UD{ zbwT(QY;)h#&a0`N3$XX=OR;yt;+T)x*n5C4XRQOS-WK7T+VV#S>hn|Z03U*BN?3%y z30PKdvHX#Ok~osNE(V;e|!Owno+?476E+sHh_0jpjb@VJ)lLyJvGo2;5;WsDDF zE}7rf*Xfa?C)fJmPk6fO0mDm=)K~AwQgx);0Jy}(_*eEj@|nnOStM}z_hm;FY)lhB zq^q9PgTzueH3C`;{9as9b6ToRNb2>p{YhbS*xUT?L?ZEKkpliq9{1wPwyDN@c|9aCLeW)<(OV`{!WYJ)l<2@Gp^8k&n(So@5$ak+Z$;6B|%%g2dWz7a-6F~&p}EHM1JYup_OV_f3?7_ z(BnFAZk2{LajbPn>c#;)n9G>v?1~4rnlf*V%OhB8|DJgS>sKNPcWKJvOO9%Nz|$Qz z+RZOfr{=q^k?)O$k@BuQYSz|z+0nGQ(yBjiRaUj{r$QQIwc&xO>rC{|hT?xH_dod8 zjQfv_Q8#{qe{&a~pS#L=yLLcc^lh2%-!uZy;J^EJGvaubOd6(L8iYT#-)AxqQI>PD zm{Wf%G`!DRyh!fjc{aoSZHtSyczVjPKW(uoV9O3S%#T~lgon(q-VN&OKT;`KzORn2 z!3wpQV^bV+ksM62Qs$GkOv8cSwRl;6kHQe3zi+W&8&M=_!|)G%8l2#ny(xEVDh%MlP(P}vcnqt`pEVFs zI5qx;qTpG>vi}t!98cd)rW7=%vH<-2X_bo7RH+EHN_{(-QgB|SItNrz!Ze!p`!hw6 zG|6JNug)kf;vumqZu#8)03NxUTniq`2h%1iN+Z|5Rs@}cDVe;kLM;RPr@zp6nncGn gNe`1b%gPGV1eItO!tyv^2)6(EFJR|Ny2UF10Cj*0Q~&?~ diff --git a/inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e4cc8fe1e.rda b/inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e4cc8fe1e.rda deleted file mode 100644 index c187f0e9eceb762688ff01af4f527ebc6aed7c7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmV-?1B3h@iwFP!000001C>?VZre5(R-Cv+G^_~F!`5LJ9CBf~P;Af3mZGS!WebAl zVnL92OK&Oak42ag1(H7Krropbz4i`!f^F1+mc*t@Duj;y@B7a`NxgL)$JutaA8a|> zUH$5Gf192jymXw-V=Z`k?di4U>^Qsn|I>@<<-zp$=d+W;;0O*0d3gihf+pNTsa#Ei z{b9so7|KODJU$+V6wd^Xf5meU!vHhJc`~@vYL6;Y^E6#-r%JS;t-lxz1QwYmm$S>h zYa~U(Yzaa_-@ShG`ha*pj7I+9Xw-MzeRKjhG=UHW8H)Kr!Yc$JRcJ+3ga{V!jhm{= z*9VMB<+%v0CrZ#DV2}$4y-PVwl=KTB#+qAu=g0oo*Uk~@yE;Uki?@m<*KbNKw4d>X zKx82mj}hS^pcw~=A`nn2q?~0lo|F+vAP=HFyr@DDZ*cg%KhS?;y^iwNeD(ct-``kC zCHNdBy@V&wv*E#thANu$0*1-F!QN2DCcXX9=u|(w0pL#;}@@yH*K?#}ME_{Fc=x8}b)6*!R$E4c4wY$`n{dusOBkAL5~$F|mY zY{G{;IfvDSy2DQ$?UNJjt|F?MN6Gem=h<^iazCAIlC$MjV;P-AY9=82q)2}>Jijm6 z@bJ%DvXv(ir9 zrK(e(TXNp1j@dxgM%tt$a7cMuaCSP4zI78EgGs}yz$f}x!3jtrXsWmvC>)%H75B{I zsJy~UFzgo=n~N7%MW&Y)jrDOpH~Brb$XMTX6}3a^_ph;(pss-F3x?{8U*+fehKqQb zrAFt8twpZ@?{tRZh?2><|D?ZS8f diff --git a/inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e614fe62f.rda b/inst/App/sampleProjects/diagramMaker/.workspace/PTR-TABID4b7e614fe62f.rda deleted file mode 100644 index 2df6507bb72d92f3730116747e87fe28345c55c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1254 zcmV6g3jZ7oqEdaH&RZkqSo&r@hGD6Hk*zv zJGz>263nNVGThN`UOqqY+rw_xgtuepI!h+h$L;+9PjUF#`w9D;9bWEdkpAop-;x*y zhBr5&WWw;51`Y@}W`vIoA5r|dp7P7*2O(j+ts92qI^o3gLYxV*Cqy0&jT6If?@N5& z{O<+^pCu1l*)em!(}cvFf#V{&2ysg8+Yp7{K6cH%(=q+FJ#o!_+fWVbpS-68{i@9HJx6z`NXQF|?k_7!MNe!t4Zl_44vs?>!1c52@)u7eSW6rp` z()$LN-GZxOi>+dd?Pl*Cv9BtV4T&h2ta7n*pkPJSCLY5S`n=YF&4ujrEz=%Ivks8E z{iagRGh503!Y;l~DQ1i$@yeF1zH8b;OJwDEU^>0Q(yX}0utmqhKYIvHxHZd&(qzU~ zwrUS;bLfhmw1#TbJ2q|0k~wf-*w|cl-phvUrfCyXbN;U@t$MhRxd7*lKrg)~BG8&2;p z70X`dlDcM59EI+83t3%TZm20YwhoGv znKE-70cD}XQ@a?quPKUIh&W#LiY_a)*_enp)mKKH`yW3`v_%Z(3+L+dN_Ims8uJmw^9Nb_rNsQRNW-IFm&|u^ zueSe$=Uv09e|fe3e)0bfta`n6U#mSidr$RZKG%zmQ~I*2RKz0h35l>!?V5w&&sK#x@^_oS}wLI3P|$q6UnMI|8A~prACfXgjMRyT=)bI zVSI*}Pf5xXddQJ?9^}|w4I}IdO|e2hs-fBR0`ajbxEhRNIH{EXyEQO^>m!FY{bKwX zVhr;u9Kv4)D7HhMow~OPjjrdZ(s@$XDFyIx4NLjAN%#t~phBqOP{ZeOfK?al*5J5U z`LqVXO$yXG_~~0_uSB3AX)w%iST_7g4fd0862&FQAA88Z3uuy7!Y!n*AW_}AQ%J|y zzgz5|KB6S3tlt(AHcn>hauI^yzB-*(2+F2(_?+;nltNOb6oP_MPUjVZw<)J6oT%9K zASTtg_k@I@C=Kz|7^RpU264bDsQNH?0pA*BRG*PxRCQTMN_+jj5Xe2K=BK7=DSrHOxmM!4eNZUrD-sVpjxUn%vyG9>#> Qpqlo_U)8w>5`_=|0P%ZzH2?qr diff --git a/inst/App/sampleProjects/diagramMaker/.workspace/currentTab.rda b/inst/App/sampleProjects/diagramMaker/.workspace/currentTab.rda deleted file mode 100644 index 127b32255bd01fd3aeff3117363edec9b7ca3643..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74 zcmb2|=3oE==I#ec2?+^l32DhG32CfGk`d0%cS>{{co-GZQW6p$uv}WisOY#$vCnUw ao|@;gm1%8inJd%WG8t^tPczs6jQ{{WG8Y~I diff --git a/inst/App/sampleProjects/diagramMaker/.workspace/loadedDnippets.rda b/inst/App/sampleProjects/diagramMaker/.workspace/loadedDnippets.rda deleted file mode 100644 index 1c28c524135838db25dd523ad57f59936556ebb7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmV;?051O@iwFP!000001C@?H4}vfd#j6D(BqkC+hjejpWnptt6E}0xBE<41EvTcP z96S&Pi4G3EyLY+Ydp$aY5K5?p)x?pQhkdZxpjx7s;#+jxAU5_ji}O@4T@}pt8BgG% zAl<@MC - - - - - - - - - - - - - - -svgR in a Markdown Doc - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
-

alternatives to append

-
    -
  • get and modify and replace last entry
  • -
  • get and modify and append last entry
  • -
-
-
-

Bugs and distractions

-
    -
  • saved files appear are now starred on loading, -
      -
    • but menu for named shows saveAs , with save greyed out.
    • -
  • -
  • dnds missplaced -
      -
    • selects from current cursor pos to drop pos and replaces all with snippet
    • -
  • -
  • working directory is not the directory to the project -
      -
    • getwd()
    • -
    • used to return “/opt/ptr/resources/library/pointR/App”
    • -
    • now returns “/home/sup/” instead of “/home/sup/AA/diagramMaker”
    • -
    • getDirPath seems to return the path to the project, however, -
        -
      • cannot use inside user-ptr code
      • -
      • cannot set at start up, since we do sourcing there
      • -
      • set at each commit?
      • -
    • -
  • -
  • CLOSES WINDOW ON control + x (very BAD)
  • -
  • Rmd -
      -
    • lacking xxx bracing macro (but has quote macro: “xxx” and {xxx} and (xxx) )
    • -
    • no syntax checks inside code blocks
    • -
    • need short cut ctrl+tab to tab line
    • -
    • no dnds for R-codeblocks and svgR-code blocks
    • -
    • For .Rmd files, canvas should scroll to last edit (but how??)
    • -
    • CRASHES WHEN SELECTION OPEN IN BROWSER (on laptop) -
        -
      • (but not on desktop machine)
      • -
    • -
  • -
  • save on commit option? (or commit on save?)
  • -
  • lacking zoom for both editor and canvas
  • -
-
-
-

What to create

-
    -
  • text -
      -
    • doc title
    • -
    • bold
    • -
    • big
    • -
    • small
    • -
  • -
  • shapes -
      -
    • rectangles -
        -
      • square corners
      • -
      • rounded corners
      • -
    • -
    • reactives -
        -
      • source (aka value)
      • -
      • conductor (aka expression)
      • -
      • endpoint (aka observer)
      • -
    • -
    • data
    • -
    • circle -
        -
      • empty
      • -
      • bullet
      • -
    • -
    • braces -
        -
      • curly
      • -
      • square
      • -
    • -
    • balloons -
        -
      • square
      • -
      • oval
      • -
    • -
  • -
  • arrows -
      -
    • sqpuare
    • -
    • rounded
    • -
    • labeled
    • -
  • -
  • shadows ?
  • -
-
-
-

What is needed in the final diagram product

-
    -
  • add icons for objects -
      -
    • (perhaps just the function, or fn + pmap)
    • -
  • -
  • add icons for arrows -
      -
    • (perhaps just the function, or fn + pmap)
    • -
  • -
  • include source files for objects and arrows -
      -
    • objects take pointPairs (wh computed internally)
    • -
    • arrows take point sequences
    • -
  • -
  • have tibbles to contain objects,
  • -
  • have tibbles to contain arrows
  • -
  • add snapping for objects
  • -
  • add snapping for arrows
  • -
  • arrow types -
      -
    • plain
    • -
    • animated
    • -
  • -
-
-
-

rectangles

-
WH=c(300,200)
-svgR(
-    wh=WH,
-    rect(xy=c(50,50),wh=c(200,50), fill='none',stroke='green'),
-    rect(xy=c(50,150), wh=c(200,50), fill='none', stroke='red',rx=20)
-)
- - - -
-
-

reactive source

-
-

Using polygon

-
WH=c(300,200)
-
-points<-c(0,0, 100, 0,  150, 50, 100, 100, 0,100)+c(50,50)
-svgR(
-    wh=WH,
-    polygon(points=points, fill='none',stroke='blue', stroke.width=2)
-    
-)
- - - -
-
-

Using path

-
WH=c(300,200)
-
-m<-c("M", c(150,50))
-polyPortion<-c("l", 100, 0, 50, 50, -50, 50, -100,0)
-d=c(m,polyPortion, 'Z')
-svgR(
-    wh=WH,
-   path(d=d, fill='none', stroke='blue', stroke.width=2)
-    
-)
- - - -

Proposal: if wh is the bounding box, then the base should be w-h/2, so we create a fn called reactiveSource as

-
reactiveSource %<c-% function(xy, wh, fill='none', stroke= 'black', ...){
-    
-    m<-c('M',xy)
-    dz<-wh[2]/2
-    dx<-wh[1]-dz
-    
-    polyPortion<-c('l', dx,0,  dz,dz, -dz,dz, -dx, 0 )
-    d<-c(m, polyPortion, 'Z')
-    
-    path(d=d, fill=fill, stroke=stroke, ...)
-} 
-
WH=c(300,200)
-svgR(wh=WH,
- reactiveSource( xy=c(50,50), wh=c(200,50), stroke.width=2)
-
-)
- - - -
-
-

With points arg

-
reactiveSource %<c-% function( points, fill='none', stroke= 'black', ...){
-    xy<-apply(points,1,min)
-    wh<-abs(apply(points,1,diff))
-    m<-c( 'M',points[,1] )
-    dz<-wh[2]/2
-    dx<-wh[1]-dz
-    polyPortion<-c('l', dx,0,  dz,dz, -dz,dz, -dx, 0 )
-    d<-c(m, polyPortion, 'Z')
-    path(d=d, fill=fill, stroke=stroke, ...)
-} 
-
WH=c(400,200)
-svgR(wh=WH,
- reactiveSource( points=matrix(c(50,50,350,150),2), stroke.width=2, fill='pink')
-
-)
- - - -
-
-
-

reactive expression

-
WH=c(300,200)
-
-m<-c("M", c(150,50))
-polyPortion<-c("l", 100, 0, 50, 50, -50, 50, -100,0)
-arcPortion<-c('a', c(50,50), 180, 1,1, c(0,-100))
-d=c(m,polyPortion, arcPortion)
-svgR(
-    wh=WH,
-   path(d=d, fill='none', stroke='blue', stroke.width=2)
-    
-)
- - - -
-

reactive expression as a compound

-
reactiveExpression %<c-% function(xy, wh, fill='none', stroke= 'black', ...){
-    
-   
-    dz<-wh[2]/2
-    dx<-wh[1]-2*dz
-    m<-c('M',xy+c(dz,0))
-    polyPortion<-c('l', dx,0,  dz,dz, -dz,dz, -dx, 0 )
-    arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz))
-    d<-c(m, polyPortion, arcPortion)
-    
-    path(d=d, fill=fill, stroke=stroke, ... )
-} 
-
WH<-c(300,200)
-svgR(
-    reactiveExpression( xy= c(50,50), wh=c(200,50), stroke.width=2)
-)
- - - -
-
-

reactive expression as a compound with points arg

-
reactiveExpression %<c-% function(points, fill='none', stroke= 'black', ...){
-     xy<-apply(points,1,min)
-    wh<-abs(apply(points,1,diff))
-   
-   
-    dz<-wh[2]/2
-    dx<-wh[1]-2*dz
-    m<-c('M',xy+c(dz,0))
-    polyPortion<-c('l', dx,0,  dz,dz, -dz,dz, -dx, 0 )
-    arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz))
-    d<-c(m, polyPortion, arcPortion)
-    
-    path(d=d, fill=fill, stroke=stroke, ... )
-} 
-
WH<-c(300,200)
-svgR(
-    reactiveExpression( points=matrix(c(50,50,200,150),2), stroke.width=2, fill='orange')
-)
- - - -
-
-
-

reactive observer

-
WH=c(300,200)
-
-m<-c("M", c(150,50))
-polyPortion<-c("l", 100, 0, 0, 100,  -100,0)
-arcPortion<-c('a', c(50,50), 180, 1,1, c(0,-100))
-d=c(m,polyPortion, arcPortion)
-svgR(
-    wh=WH,
-   path(d=d, fill='none', stroke='blue', stroke.width=2)
-    
-)
- - - -
-

reactive observer as a compound

-
reactiveObserver %<c-% function(xy, wh, fill='none', stroke= 'black', ...){
-    
-   
-    dz<-wh[2]/2
-    dx<-wh[1]-dz
-    m<-c('M',xy+c(dz,0))
-    polyPortion<-c('l', dx,0,  0,2*dz, -dx, 0 )
-    arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz))
-    d<-c(m, polyPortion, arcPortion)
-    
-    
-    path(d=d, fill=fill, stroke=stroke, ... )
-} 
-
WH<-c(300,200)
-svgR(
-    reactiveObserver( xy= c(50,50), wh=c(200,50), stroke.width=2)
-)
- - - -
-
-

reactive iobserver with points

-
reactiveObserver %<c-% function(points, fill='none', stroke= 'black', ...){
-    
-    xy<-apply(points,1,min)
-    wh<-abs(apply(points,1,diff))
-    dz<-wh[2]/2
-    dx<-wh[1]-dz
-    m<-c('M',xy+c(dz,0))
-    polyPortion<-c('l', dx,0,  0,2*dz, -dx, 0 )
-    arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz))
-    d<-c(m, polyPortion, arcPortion)
-    
-    
-    path(d=d, fill=fill, stroke=stroke, ... )
-} 
-
WH<-c(300,200)
-svgR(
-    reactiveObserver( points=matrix(c(50,50,290,150),2), stroke.width=2, fill='yellow')
-)
- - - -
-
-
-

Text

-

To add text to the above, we can either

-
    -
  1. return a list with object and text
  2. -
  3. return a groub with object and text
  4. -
-
-
-

arrows

-
roundedPolyLine%<c-%function(x, r=5, ...){
-  nx<-length(x)
-  if(nx<4){
-    return(NULL)
-  }
-  n<-ncol(x)
-  if(n==2){
-    return(path(d=c("M", x[,1], "L", x[,n]), ...))
-  }
-
-  dv<-x[,-n]-x[,-1]
-  d<-apply( dv ,2, function(x)sqrt(sum(x)^2) )
-  lambda<-sapply(r/d, function(x)min(x,.5))
-  
-  m<- n-1
-  if(m==2){
-    mA<-matrix(c(lambda[1],1-lambda[1]),2,1)
-    mB<-matrix(c(1-lambda[2],lambda[2]),2,1)
-  } else {
-    mA<- rbind(diag(lambda[-m]),0) + rbind(0,diag(1-lambda[-m]))
-    mB<- rbind(0,diag(lambda[-1])) + rbind(diag(1-lambda[-1]),0)
-  } 
-  a<-x[,-n]%*%mA
-  b<-x[,-1]%*%mB   
-  rL<-rep("L", n-2)
-  rQ<-rep("Q", n-2)
-  if(m==2){
-    rr<-c(rL,a,rQ,x[,2],b)
-  } else {
-    rr<-rbind(rL, a, rQ, x[,-c(1,n)], b)
-  }
-  path(d=c("M", x[,1], rr, "L", x[,n]),  ...)
-  }
-
WH<-c(500,300)
-svgR(
-wh=WH,
-roundedPolyLine(
-  x=matrix(c(100,100,100,200,300,200),2),
-  r=10, 
-  fill='none',
-  stroke='red',
-  marker.end=
-      marker( viewBox=c(0, 0, 10, 10), refXY=c(9,5), 
-            markerWidth=6, markerHeight=6, orient="auto",
-            path( d=c("M", 0, 0, "L", 10, 5, "L", 0, 10, "z") )
-     
-      )
-      )
-)
-

-

### alternatively including marker in arrow def

-
arrow %<c-% function(x, r=5, ...){
-nx<-length(x)
-if(nx<4){
-  return(NULL)
-}
-n<-ncol(x)
-if(n==2){
-  return(path(d=c("M", x[,1], "L", x[,n]), ...))
-}
-
-dv<-x[,-n]-x[,-1]
-d<-apply( dv ,2, function(x)sqrt(sum(x)^2) )
-lambda<-sapply(r/d, function(x)min(x,.5))
-
-m<- n-1
-if(m==2){
-  mA<-matrix(c(lambda[1],1-lambda[1]),2,1)
-  mB<-matrix(c(1-lambda[2],lambda[2]),2,1)
-} else {
-  mA<- rbind(diag(lambda[-m]),0) + rbind(0,diag(1-lambda[-m]))
-  mB<- rbind(0,diag(lambda[-1])) + rbind(diag(1-lambda[-1]),0)
-} 
-a<-x[,-n]%*%mA
-b<-x[,-1]%*%mB   
-rL<-rep("L", n-2)
-rQ<-rep("Q", n-2)
-if(m==2){
-  rr<-c(rL,a,rQ,x[,2],b)
-} else {
-  rr<-rbind(rL, a, rQ, x[,-c(1,n)], b)
-}
- 
-  path(
-      d=c("M", x[,1], rr, "L", x[,n]),  
-      fill='none',
-      marker.end= marker( viewBox=c(0, 0, 10, 10), refXY=c(9,5), 
-            markerWidth=6, markerHeight=6, orient="auto",
-            path( d=c("M", 0, 0, "L", 10, 5, "L", 0, 10, "z") )
-     
-      ),
-  ...)
- 
-}
-
WH<-c(500,300)
-svgR(
-wh=WH,
-arrow(
-  x=matrix(c(100,100,100,200,300,200),2)
- 
-  )
-)
-

-
- - - - -
- - - - - - - - diff --git a/inst/App/sampleProjects/diagramMaker/main.R b/inst/App/sampleProjects/diagramMaker/main.R deleted file mode 100644 index 043b1e30..00000000 --- a/inst/App/sampleProjects/diagramMaker/main.R +++ /dev/null @@ -1,41 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(800,800) - -source('develObjects.R') - - -#Defined by mouse: edit with care! -ptR<-list( - source=tibble( - label = c('source','source','source','source','source','source','source','source','source','source','source','source','source two','source','source','source','source','source'), - points = list(matrix( c(c(97,53),c(283,123)), 2), matrix( c(c(450,550),c(300,600)), 2), matrix( c(c(750,150),c(650,250)), 2), matrix( c(c(200,550),c(150,500)), 2), matrix( c(c(250,400),c(150,450)), 2), matrix( c(c(650,600),c(650,450)), 2), matrix( c(c(300,450),c(400,500)), 2), matrix( c(c(350,700),c(450,650)), 2), matrix( c(c(650,400),c(700,450)), 2), matrix( c(c(150,150)), 2), matrix( c(c(650,100),c(550,200)), 2), matrix( c(c(700,350),c(650,300)), 2), matrix( c(c(100,200),c(250,300)), 2), matrix( c(c(500,500),c(600,400)), 2), matrix( c(c(150,700),c(250,600)), 2), matrix( c(c(150,150),c(250,200)), 2), matrix( c(c(350,50),c(450,150)), 2), matrix( c(c(50,150),c(150,250)), 2)) - ), - observer=tibble( - points = list(matrix( c(c(351,260),c(430,175)), 2), matrix( c(c(450,350),c(550,200)), 2)) - ), - expression=tibble( - points = list(matrix( c(c(157,281),c(296,346)), 2), matrix( c(c(379,309),c(428,357)), 2)) - ), - arrows=tibble( - points = list(matrix( c(c(282,87),c(318,87),c(349,211),c(433,210)), 2), matrix( c(c(250,250),c(350,250),c(350,300),c(450,300)), 2), matrix( c(c(261,113)), 2)) - ), - block=tibble( - points = list(matrix( c(c(72,296),c(555,622)), 2)) - ) -) - -svgR(wh=WH , - #your custom code goes here - pmap(ptR$source, reactiveSource, fill='yellow'), - pmap(ptR$observer, reactiveObserver), - pmap(ptR$expression, reactiveExpression), - pmap(ptR$arrows, arrow), - pmap(ptR$block, block) - -) - - - - - diff --git a/inst/App/sampleProjects/diagramMaker/roundedPolylineExample.R b/inst/App/sampleProjects/diagramMaker/roundedPolylineExample.R deleted file mode 100644 index 88765602..00000000 --- a/inst/App/sampleProjects/diagramMaker/roundedPolylineExample.R +++ /dev/null @@ -1,79 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -WH<-c(600,620) - -#Defined by mouse: edit with care! -ptR<-list( - x=matrix( - c(c( 100,100 ),c( 100,400 ),c( 300,400 ),c( 233.5,314 )),2), - y=matrix( - c(c( 202.5,211 ),c( 207.5,89 ),c( 319.5,90 ),c( 327.5,207 ),c( 403.5,196 ),c( 443.5,93 ),c( 498.5,299 ),c( 465.5,364 )), 2), - z=matrix( - c(c( 333.5,450 ),c( 399.5,353 )),2) -) - - -roundedPolyLine%dg>@|3-e7e1}|M=zeR=r(oZmw-qDl?0~y$AOVxUW>MRu*8qwR^BvJJ`Pe_<^B8&12`27xA&6njU0_>zr$?)G2y9FDE}UJ^X9_~B+n zU3m|)5vN7g{2zhep$?68cHG-DG(~aWi;pp7*wCIm+N!zwTBBjYZD`sudVsrrh&|Ma z(SQsY{tjW!=LjV_K5u&~T^8Dm2_-#E+px^$Ng!eVub zMZ>gAXcR(15J0Q$zf%WRRd!R;T9Y~(FbEwLGje$U0cI}sBTgj$>;=T8AcLoRTAKSC_Z98*o(>r#|vM-nZ+P zfrPs^2nP<%(F(7dy>WQzeH9waD<(-iNd^}lEx z9zwso_Jx$&LRm{TOnub1pFJ`q1Q5q#uDj#d2Kd5uX~E)LdMNj4lx)yTkUj}{o%ye^ zZLMbD>I9B^R85Kt0=pWL5LeT+0YT)VJ@)bFJ{j9$md$4JrL&nJfxx~Y$ zM=(QuOtDm$^hxc+CQN(~_eiKhDs(HC6N~)rWr_vUQ#!6sUD#641oBDc=?p?c%?W?` zoX(4Nm${)f?G*BQ_^_Heb3z|>3;dJ_Fi+SbX$WC^!lj8MvczxBw^%cPHMq?JQ-oWB zmnwb@(^L>mfNW=|KcOMkjjbMvV%G`Wr!Xz{Qqn(%E={C{e7aCa+fdY*oov7VPPRXI zC)@A2lWH(ZC!d7_>VzzSdM|nk`zyWk%JZ-scbyOi=bW>ylW+%*cDYjf{?Cb8+2z#u zd8KQkzArLYN5gW!bI+2MQ&K6@g?xS!-G~P@~&nV=T^b&~AtHt!LW2vLpsN?zMLlQFH+imtlZ^EVD-nD65Ni_e!j zPu}BQLI($Nq;zhUb#euKS&~KkM-uEn7gPx)IVGdVp@$Ww7E9tVv%FOj!C?wqr^2sK zgxwc~0%uBKhJ$?IuS#P0h8+&VT;iX0;G4mtBr24falwGllzSuN_A$U*X=^>|dj%J{G%o#)h z-WTtwx)*wCxoPmR-YX_0IJw#UNHAoV3pzZ*nbaBh;m=M`WI5xECCwPek;0HF diff --git a/inst/App/sampleProjects/pythag/.workspace/PTR-TABID2919a413d66.rda b/inst/App/sampleProjects/pythag/.workspace/PTR-TABID2919a413d66.rda deleted file mode 100644 index 0dc826c3fa238aa8685a4e29577f0527bc04f4fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1123 zcmV-p1f2UHiwFP!000001HD#lZ`(EyR_r82G_1&wHhaN7sOX1Csq9$JTQkJiyyZjl zB?yvWDNqanEix7nSyD+lwlJ*QpV%MRFWfKKc6y;CD$ZLAi~u3sJ;%Fyjwe!YbxqTn zT61wuYc9a6_OyR=dU)}6v%S@F_I6%tT4M#YuV602oYUsDC3rqNK09fh^?y7(=C*v2EH?S|@Wj%kBq)xr3FE}l&)@8~TywkAv0+-e{?a%gmoy;Q7{taX9CPxW zK`<2tB;pw^V&sJ$iIe@7Pq{F4!@m9FdfdS_Gt?iD^;las!^OA+5USeqYBp3>>9ganB*9Lk$ z%q@Mu_FI^*^Y=`cU2CJOV`smm>q))LiPt-SlgIT@6!}m`ZX1{5z!fwMOm6*}Cj~gv z%q*m2Ok=0#!h(0sFSfxgy9RbMaCZjC1q-i88zb%^#!%dQJqz!x4H+T9+RU{RiiOwf z7Lb*_{bqeC9Xlm7n~k0F`Txl<;tCV`FimY8+QN3ABVhMj6LTAO8Awv!@2$P;_d77w z&i6BE#&WZ6mnH$_a@RUkTUVoMombspps4MWUCCE5!zh8lhT73 z<&K@3d2eS(_a?G?AL2ZgtJ-G87n3KqRSl$mF*Q&&k&IDC@)mMB4+!qu6@1oqKQg#( z)z0muGll~0!x8_$8>DKpm~F7U8ovK~=GD-c#`jzvPr~4cOpe7pj>>S4O>|-6(UhUQ z|LU&qyDznZ!C{eFT~^BK)1fEeScxAK=#Pry-_sgA`D=!}oF}#PFAVMWOZ}lg0nIz@ zKNeGcFTx2N5uQtPQ>8Z)!+ewPlH`iA1odb7*OZh~P8grh&?Tj9%66+iYnd%DglTw( zkeN3=v0{zeYt(o^RSFv(plG{OleGCpr9l<~G$L~0E14UdnB;(Pm(fUstS!*s5a-xx z4Ws-NT@#6ZSwj=?7zr38B|b@i8`>f{y)HvG zI*TJ|^Q>-DA@EfVi^NZ%e*{&K6lypNCx-zhaw}G9a8Ry%UW4FQ5nSisH#fqbrbIz= zOJGj?YT&PHup9d0QBXWM`n1zu-x75OdkmcItQtJ`-s@Ok$$S79UFQpppg%f#F zrwTk(#aMAr4W%dl)2ho4>1-2`MS)~&>&v#^vR}AguKiyU9=tvq^nZK*qIKBpygWKFjI~`vpX1oUQ8U(!ZG1mEzr1K(zJAj`?Rr7y@c5|v z^7zCgj@Vx~AmDY^PvE>sE-)QvNu6v|r$6dFBGsm?K9JFyvj3o`) zo{f7~Z(VDDN@4bf&3nGxcH3?@{W-b!{e<0c%ko(O)`)?y#=s$?(1kru(5QnM;z0iy zfo=<6hAo%KLv&xX)zAu94SPsK3A~rR?A%)>y^E+6y{D+f2Ql&Cm*|~|y%f@>$4uuMyJGSbE_NG#ty(tHdl!Ml7Ua)8rA%;GT3LP*Z8q1W(2;$Ne!Q|X}XOHLvY5()peS&K@WS$KDJ>1LLT z*81_Ym0DXYI)mA{yvx~Q$$Lk;F&k5r=f}?5od>kG$f3Uot}2(Rt9EFcV6!l);CTWXh8LDq}S*In{ z1D`KeU}<^ly6dX%N@N?H1eDz(e9B>39Fr2dvfsBvL}JOhhOxd@fHxvCS$KG!gAeiU zfKw1Yr)a`kl6d_f=k_Wb6$3H_%|5QMsd!H0SZ7tCNrXpO*I~CpPVlPEsdaxj|Aq(w zasVOtlCr2J)9Yx+_~bH)wa&w;P9cFO6)u)PvG5G5pi`*uoXz@C0J;NrD|EE9d{m+E zdxoxa^6L+l9jHVR`N+Zo!s5bTRcQP=+)ScE;14{!umjHGQo2i2eNJ+8XNiu%zh3O0 zIpQ=Z*>5XEjM+>#k^+KxSxia}ic6X4N5AY+Aw`!8Sh~!_q~zd3ms5h@M2!RyE$6+b z5J4t!2m^IYT0s=(yTF{$U{nrDA%)%iTme~?OFDAdXPM4~M!%A<43YT~%FKj>Socr{ zsI7$H3I&ik^<~T<=FC4QBPhkUTOz1e*!U9VmzsI6NM$EWv4-)_e>NFkU6Tp`07;wc A?f?J) diff --git a/inst/App/sampleProjects/pythag/.workspace/currentTab.rda b/inst/App/sampleProjects/pythag/.workspace/currentTab.rda deleted file mode 100644 index b986518f86b905ad7ed45e96da94b99677e803f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 83 zcmb2|=3oE==I#ec2?+^l32DhG32CfGl0RhrHrYN_?)mCd!mE2$r$LFy;mnBxhYoNq jabh~7tHUeg+vCe%WxjWXE6^+egl8KH diff --git a/inst/App/sampleProjects/pythag/aux/preprocPts/snap50.R b/inst/App/sampleProjects/pythag/aux/preprocPts/snap50.R deleted file mode 100644 index a8cdfe67..00000000 --- a/inst/App/sampleProjects/pythag/aux/preprocPts/snap50.R +++ /dev/null @@ -1,33 +0,0 @@ -preprocPts<-list( - onNewPt = function( pt, context, WH, keys){ - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse click - - # apply your point manipulations here - - pt<-50*round(pt/50) - tibs<-insertPoint(pt=pt, context=context ) - tibs # always return tibs - }, - onMovePt = function( pt, context, WH, keys){ - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - pt<-50*round(pt/50) - tibs<-movePoint(pt=pt, context=context ) - tibs # always return tibs - }, - onMoveMat = function( pt, context, WH, keys){ - # template for point insertion precprossing - - dxy=getDxy() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - dxy<-50*round(dxy/50) - tibs<-moveMatrix(dxy=dxy, context=context ) - tibs # always return tibs - } -) diff --git a/inst/App/sampleProjects/pythag/aux/preprocPts/snapto1.R b/inst/App/sampleProjects/pythag/aux/preprocPts/snapto1.R deleted file mode 100644 index 37c898a7..00000000 --- a/inst/App/sampleProjects/pythag/aux/preprocPts/snapto1.R +++ /dev/null @@ -1,45 +0,0 @@ -preprocPts<-list( - onNewPt = function( pt, context, WH, keys){ - - - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse click - - # apply your point manipulations here - - pt<-1*round(pt/1) - tibs<-insertPoint(pt=pt, context=context ) - tibs # always return tibs - - - }, - onMovePt = function( pt, context, WH, keys){ - - - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - pt<-1*round(pt/1) - tibs<-movePoint(pt=pt, context=context ) - tibs # always return tibs - - - }, - onMoveMat = function( pt, context, WH, keys){ - - - # template for point insertion precprossing - - dxy=getDxy() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - dxy<-1*round(dxy/1) - tibs<-moveMatrix(dxy=dxy, context=context ) - tibs # always return tibs - - - } -) diff --git a/inst/App/sampleProjects/pythag/aux/preprocPts/snapto5.R b/inst/App/sampleProjects/pythag/aux/preprocPts/snapto5.R deleted file mode 100644 index 8a14f378..00000000 --- a/inst/App/sampleProjects/pythag/aux/preprocPts/snapto5.R +++ /dev/null @@ -1,39 +0,0 @@ -preprocPts<-list( - onNewPt = function( pt, context, WH, keys){ - - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse click - - # apply your point manipulations here - - pt<-5*round(pt/5) - tibs<-insertPoint(pt=pt, context=context ) - tibs # always return tibs - - }, - onMovePt = function( pt, context, WH, keys){ - - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - pt<-5*round(pt/5) - tibs<-movePoint(pt=pt, context=context ) - tibs # always return tibs - - }, - onMoveMat = function( pt, context, WH, keys){ - - # template for point insertion precprossing - - dxy=getDxy() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - dxy<-5*round(dxy/5) - tibs<-moveMatrix(dxy=dxy, context=context ) - tibs # always return tibs - - } -) diff --git a/inst/App/sampleProjects/pythag/fredkin_switch_gate.R b/inst/App/sampleProjects/pythag/fredkin_switch_gate.R deleted file mode 100644 index 1626e290..00000000 --- a/inst/App/sampleProjects/pythag/fredkin_switch_gate.R +++ /dev/null @@ -1,72 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(500,500) - -# Defined by mouse: edit with care! -ptR<-list( - xy= tribble( - ~points, - matrix( c(c(100,100),c(100,300)), 2) - ), - ul= tribble( - ~points, - matrix( c(c(100,100)), 2) - ) -) - -ds<-50 -ss<-seq(from=100, length.out=7, by=ds) -br<-ds*sqrt(2)/2 -d1<- - -svgR(wh=WH, - lapply(ss, function(s){ - line( - xy1=c(ss[1], s), - xy2=c(ss[7], s), - stroke.dasharray=8, - stroke='green', - stroke.width=2 - ) - }), - lapply(ss, function(s){ - line( - xy1=c(s,ss[1]), - xy2=c(s,ss[7]), - stroke.dasharray=8, - stroke='green', - stroke.width=2 - ) - }), - rect(xy=ss[1]*c(1,1), wh=c(ds,ds), fill='#AA0000'), - polygon( - points=c( - c(ss[1], ss[6]), - c(ss[1], ss[7]), - c(ss[2], ss[7]) - ), - fill='#AA0000' - ), - rect(xy=c(ss[4], ss[6]), wh=c(3*ds,ds), fill='#AA0000'), - polygon( - points=c( - c(ss[4], ss[1]), - c(ss[5], ss[2]), - c(ss[7], ss[2]), - c(ss[7], ss[1]) - ), - fill='#AA0000' - ), - line( - xy1=c(ss[4], ss[4]), - xy2=c(ss[7], ss[4]), - stroke='#AA0000', - stroke.width=10 - ), - line( - xy1=c(ss[1], ss[4]), - xy2=c(ss[1], ss[7]), - stroke='#AA0000', - stroke.width=10 - ) -) diff --git a/inst/App/sampleProjects/pythag/fredkin_switch_gate2.R b/inst/App/sampleProjects/pythag/fredkin_switch_gate2.R deleted file mode 100644 index 53efe8d0..00000000 --- a/inst/App/sampleProjects/pythag/fredkin_switch_gate2.R +++ /dev/null @@ -1,93 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,600) - -# Defined by mouse: edit with care! -ptR<-list( - blockers= tribble( - ~points, - matrix( c(c(2,2),c(2,3),c(3,3),c(3,2)), 2), - matrix( c(c(5,2),c(6,3),c(8,3),c(8,2)), 2), - matrix( c(c(2,7),c(2,8),c(3,8)), 2), - matrix( c(c(5,7),c(8,7),c(8,8),c(5,8)), 2), - matrix(0,2,0) - ), - lineBlockers= tribble( - ~points, - matrix( c(c(2,5),c(2,8)), 2), - matrix( c(c(6,5),c(8,5)), 2) - ), - pathDescriptors= tribble( - ~points, - matrix( c(c(1,4),c(9,4)), 2), - matrix( c(c(4,1),c(4,9)), 2), - matrix( c(c(1,4),c(3,4),c(3,7),c(4,7),c(4,9)), 2), - matrix( c(c(4,1),c(4,3),c(5,3),c(5,6),c(9,6)), 2) - ) -) - -lineg %-;Yuhjsb}n6s9!j9?E@e=Sz9f)@wCe^PEnT-fG*CiF zGP+mAK8Zzb%Sg(_FWY|0e$Rf)e!(``v140pStF36^LogJUGt;yu=sUlG1v|8Bj)j;4os*A79I!KWitUE zFj!RL1(h~735PexmxJ@BLxrp%jF%UZ)A87W(7^bc&!{IwBQji~xMi(()i`M=ag6Io zg$Q%0E$oZi>y;Ni3fPQeb0#EnvB@mJQw9Rtz+vUk`*L%G>RN4;5htE-h=iwhHtY0k zm1ok@%ij;Sw6IJZ(w65Owwc$1MPL3$CylmoqFW1_MkPKr7f%|b)!cN~$?0~ku@0Tu za>^mtDAJFN^7p6>+dm($t8rG9ziMT&ENohq+T~)lQ66z2Y4KqU?oFrz9S|m`zGS>5 z$+&C9+;feiVo2tYurD+=H2Xx_NqQPhJT(a{CU-T`RWlt^Wivg$CPIK5f&-?c%xlST zpeKyGqrgvm_H>_20WUSqm!Fx_Q(Z_((0I-kUC)ALlBGs_>CJtOQZKTSj>&_2VTVzn z3V9^304E#xl}4M)nYmsj@trX-?<~&zT)8Q#E-)UW)fBbCyj%Z&Xv(RTyI+YAVY5Z@ z@005G-FX;dP diff --git a/inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABID25d96494b000.rda b/inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABID25d96494b000.rda deleted file mode 100644 index 6a9b00d0586f12b9522c0f41f32e07693c8beb2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 704 zcmV;x0zds9iwFP!000001C>+lYTGarb(?l2{!t2Tx3vsv!k{svX&Bw0u&{OQj|D~v zNuc{z6icmz?EF zw%wGkJ^5_NXUSP{s`9(t9rO+cC+|9EFJ8jqS4YQ3!&a*$30FDI9y4I)+u_N{VTxgh zg#MgT!AP?w$@R?f&2J}PW?&@|tPCyvB6!FEo7Q=R>C|`U<|OR-t~*ojPePU8^}*Gc z1_H;l{uxO>|BLI%#p5vxPbexA7e#$W_{IB%Cn6-kWy{kl(r3L}KeRevfN}x^dgx5u<|E=b3rFNpuL~$5+S6p#VtS6!u2?W*w(GswO{di~ z!m93k%HgbYppE7K1{`MYX*?dJk}LswP(BbRgk?S05~ zUs*N}ih>d1T4hgzTUVH%Gc+6Am^B3$cA(}STO8(nFhM!{#9}kE3q+KcXVHMl{~l{{ z(;`PPM4DO&iv2S=%JM2Bg4ES)ifl@+Vm2B~liX*^_AwfGYH^7;jmfz@g}eoeXK~u0 z5Z&ZeS~M*pw=HS}GHFfj-bve6jY{O6#2gVb@s33YF&U4jQTX~01lN$oNvYiel>sr+ z=thA?D7c>gKR09;mg1`l;ZdCCS5*P)-PunmQ4!5!90d)d)L6hjiq&8A%D;Q%BR9goxePI>t z!(QFww6Sn)%XVn1X_w!!zqUWHU$D(_5}KGIz><^r`_B2!CC6V}$8lDjwT%^LbuIqf z){lL?%X+Uk>rP3(cY1@%gF)w0_xuQ*ygPn>JbHWLYuq(9$qhwWU_>Gu^w1b;Zbh#o!WmV9)G+0d z>IUs<0#@slY1sB_N3B-7QQC-Iw73muG!7-zADBAXAb3 zOk{)!oP+cQ=8B1iLc?y5a?dRe%Rah>jD2CT@v(~mXg~RIbi{$)Vja; zevPCA)dvFR>NHe5#v>*sgE`M^c5Itm0WU3%t20I}bQiJ`EMBl_S6{hVmZe40h3BqC zO;9YIl6$wp_D!K0xg)Ryk`MgKqJ2i93C$(GHAMbZAQ&%{yFj%A6De9=pdt8IH~-Ha z3mg>uO9qi4n`U>`0Ku$yoEHT0p)tbn cL=#S+A0iI25hEN_Jnet~1GloTpNa+m00}TOW&i*H diff --git a/inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABIDa9527235bba.rda b/inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABIDa9527235bba.rda deleted file mode 100644 index 7d435b4151d28ddd389ece9109073e87dd82e5be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1190 zcmV;X1X=qZiwFP!000001FcqlPuoTqPl2|=e^f|q_fk#jtxSr|9LF&UG#lQQf+~bOINHaZ;#aYgD(TUMV``)mMJ zJ`Ag^R&_+Z9*E@cXMWK$+Nkp=*8l#mQu<`=mqQWdp$C8Zv=ceeL`D0yrlgXf-sA!z z4w|AUr~5komd*W(-a&%#y093r~B_}@0H!Nw{azmhHf-9#FS|*tdQ}YN_QBzg0euBm`>dB z#6|<1M0Q&iMdCY^kZ#Ccwf53P6xF_tHZWVprpnmX`G-3+>K}`Sagdz5YJ9$GxNNWN_p%@dsbi7)Cy$FcH>!Y>usDbOi7P_bN!@# z1*4zrngnEB=UH2KNc+wy&J$ANO{k9g_UV4&X??vd%-65W3zUHeuISrVhUik?x63~5^+hiN2+FsPkBj2t z1P@pM)3CRRYuy;Q)%y3q=Jk;?C=2A0v&-3)mru>5k&6d-yu}K;0h5Y1+=gK`^u&M1 zA3|9k#f95!^(1lv?mGes#M9ZeYBjv(R=rv8U^$Waklv4_(zW;FgZ7aVfS+h)nTISm zgwc_>=7KG%-gK#Fb?%S)RHl8?P5)nC2BkES9}Z@T6y;p4(#1LXKY@PFIQ~tJ_~9Sd z$ZJVbtAFEjhe2UmS;|%^a0b8=C(lzSxGG?8wvzGW>Ku3p_ep`H{MfmGl>M~8#^Mp~ zk#yA*Xa^VeAxp@|1#*B#aYC)Q^ZpkO=OB*32YL7!B3_|g77b1&VXE__sFNAMX9X@4 zyUahtDx^aw@DUpw1RjjjEDLlnw|rWl@G}WrC*-q*u*Y(sh};mEgP#rjd4YDBKO6*^ z#2cdKMFSQk=-M3ZLwtfHxYCQLm$P4$2=B8|x=khEjq~Cp=O7zOiN7WD zE+vw6DS^4msW{0wSaf;e;Hi}&UO@BXekKv_3_>4{`%Vblh>;LPyxKqf13{a5&pZqO E0NK4y+W-In diff --git a/inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABIDa954e443c9d.rda b/inst/App/sampleProjects/shinyDialInput/.workspace/PTR-TABIDa954e443c9d.rda deleted file mode 100644 index e3af9fa45aa0524405935e014cccb39369482821..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 931 zcmV;U16=$ciwFP!000001C>>6kK05L_Fb>4;t$nHZGl!uT}6lDlY)c9@u96yxoc2m zBtk?2;_Jqq*xPP)E$=$MP!;$s{6c;KFkaj7+Lx-WCBN)Ev(GcLJD&Z`bsXo|xpn)< zIlfhX-owXZyif5ya!#B9zVFYMKYzKryb7lD$u}2paq)HdBtpAue5%{_fB47b@^VtJ zCzeF z1+!@|d+BazMk=irLTCJniHM1qd`korWRWnj^8=CQx(2-SXYQE~*BV6R-JCZjZ(M@c z8i!BGIv1g4Qg|wqDV*0>d4*Ca$-(C`_C}@i2zeVY1D$7roYm9(68DC_r8ca+-;T`- z6Rqdy1V}I?a&5k*KmAC6!v=&le&)dh(~NTVJ6Hh%KW~FWI+e(rN2CDDoop%3fh3T@ z^S$p`In|G-rrr=GH64!0SLe@=LxEN%ikhLCZi#f(pp_YQbHkK>Ehlz^C2uguTtP&% zv~#aQtkY-ZzLiU@Gs$nR?mqC53B0GP4(X070hA|={#s@vPm!mrnuChAQkX~@wAHgkOdZ$ao>jhYyK(2@aO5^s9mjf&Wqv4xhS4p#T~qEcQyMd> zR(w_Yxz+#5tp8Q{jjMNn7}iItho7F&L=a^Fgym4%s zTF3E@6f-F1`aOI`@MELAT_nt;*Yx5(>-&1Qvv0}4KC1q>lQm~?qT>v9A0zaaMf|5p z|IXhB#;0{qga7by-hIG)KvE~i_9_Xw0acScZb;UQ!xX9$MP|OHt01bePkIwB-FsejjpVl1e5bYLsxEjw zY=h>(byv48A6~eVjaKNS - - - - - - diff --git a/inst/App/sampleProjects/shinyDialInput/widget.pprj b/inst/App/sampleProjects/shinyDialInput/widget.pprj deleted file mode 100644 index 273b901a..00000000 --- a/inst/App/sampleProjects/shinyDialInput/widget.pprj +++ /dev/null @@ -1 +0,0 @@ -{"pathToProj":["~/AA/widget"],"projName":["widget.pprj"],"projType":[[[[[["generic"]]]]]]} diff --git a/inst/App/sampleProjects/shinyDialInput/widgetCntrl.R b/inst/App/sampleProjects/shinyDialInput/widgetCntrl.R deleted file mode 100644 index b4fd54a7..00000000 --- a/inst/App/sampleProjects/shinyDialInput/widgetCntrl.R +++ /dev/null @@ -1,89 +0,0 @@ -library(shiny) -library(svgR) - -try({ removeInputHandler("widgetCntrlBinding") }) - -widgetSvgCntrl<-function(params){ - source('widget_svg.R', local=T)$value -} - -newWidgetCntrl<-function(WH, theta0, CXY, R, CMD ){ - svg<-widgetSvgCntrl(list(WH=WH, theta0=theta0, CXY=CXY, R=R, CMD=CMD)) - HTML(as.character(svg)) -} - -widgetCntrl<-function(inputId, wh, theta0=0){ - cxy<-c(.5,.9)*wh - r<-.4*wh[1] - CMD=sprintf('widgetCntrlBinding.clicked("%s", evt)',inputId) - tagList( - singleton(tags$head(tags$script(src = "widget.js"))), - div( id=inputId, - class="widgetCntrl", # - "data-theta"=theta0, # customize for initialization - 'data-x'=cxy[1], - 'data-y'=cxy[2], - newWidgetCntrl(WH=wh, theta0=theta0, CXY=cxy, R=r, CMD=CMD) - ) - ) -} - -updateWidgetCntrl<-function(session, inputId, wh=c(300,200), value=NULL){ - if(!is.null(value)){ - theta=value - cxy<-c(.5,.9)*wh - r<-.4*wh[1] - CMD=sprintf('widgetCntrlBinding.clicked("%s", evt)',inputId) - node<-as.character(newWidgetCntrl(WH=wh, theta0=theta, CXY=cxy, R=r, CMD=CMD)) - mssg<-list(value=node) - session$sendInputMessage(inputId, mssg) - } - - # mssg<-list(value=value) - # use theta to generate new svg script - # get new svg as script - # send message to name to update script - # return value of theta as list - - if(length(mssg)>0){ - session$sendInputMessage(inputId, mssg) - } -} - -shiny::registerInputHandler( - "widgetCntrlBinding", - function(val, shinysession, name) { - - if(is.null(val) || is.null(val$dXY$x)) { - return(NULL) - } else { - # Parse return value from JSON into R format dataframe - # browser() - dxy<-val$dXY - theta<-90-(180*atan(dxy$x/dxy$y))/pi - cxy<-unlist(val$CXY) - # recompute WH from CXY as - wh<-cxy/c(.5,.9) - # then R by - r<-0.4*wh[1] - inputId<-name - CMD=sprintf('widgetCntrlBinding.clicked("%s", evt)',inputId) - node<-as.character(newWidgetCntrl(WH=wh, theta0=theta, CXY=cxy, R=r, CMD=CMD)) - mssg<-list(value=node) - shinysession$sendInputMessage(inputId, mssg) - - #xy <- jsonlite::fromJSON(x) - # convert xy into theta - - # get new svg as script - # send message to name to update script - # return value of theta as list - - # Extract the values of the data frame as a list - - - return(theta) - } - } -) - diff --git a/inst/App/sampleProjects/shinyDialInput/widget_svg.R b/inst/App/sampleProjects/shinyDialInput/widget_svg.R deleted file mode 100644 index 2ff20de6..00000000 --- a/inst/App/sampleProjects/shinyDialInput/widget_svg.R +++ /dev/null @@ -1,103 +0,0 @@ -library(svgR) -library(tidyverse) - - -WH<-c(400,200) -theta0<-45 -CXY<-c(.5,.9)*WH -R<-.4*WH[1] -CMD<-"" -R0<-10 - -#----------function override of params---------- -if(exists("params") ){ - for(n in names(params)){ - assign(n, params[[n]]) - } -} - -theta2pos<-function(theta, cxy=CXY, r=R){ - theta<-pi*theta/180 - cxy+r*c(cos(theta),-sin(theta)) -} - -pos2theta<-function(pos, cxy=CXY){ - pos<-pos-cxy - if(abs(pos[1])>.0001){ - theta<-pi/2 - } else { - theta<-atan(-pos[2]/pos[1]) - } - 180*(theta)/pi -} - -descriptor<-function(theta, cxy=CXY, r=R){ - d=list( - M=CXY, - L=theta2pos(0), - A=c( c(R,R), 180,0,0,theta2pos(theta)), - Z=1 - ) -} - -descriptor2<-function( dR=10){ - d=list( - M=CXY-c(R+dR,0), - A=c( c(R,R)+dR, 0,1,1,CXY+c(R+dR,0)), - L=CXY+c(R-dR,0), - A=c(c(R,R)-dR, 0,1,0,CXY+c(-R+dR,0)), - Z=0 - ) -} - - -svgR(wh=WH, - #your custom code goes here - g( - rect(xy=c(0,CXY[2]),wh=WH , fill='#AA88FF', - transform=list(rotate=c(0,CXY)) - ), - clip.path= clipPath( path(d=descriptor(180))) - ), - g( - path( d=descriptor(180),stroke='black', - stroke.width=2*R0, - fill=radialGradient(fxy=c(.5,.9),colors=c('lightblue', 'blue', 'black')), - onClick=CMD - ), - path( d=descriptor2(), stroke='black', - fill=linearGradient(colors=c('brown', 'white','yellow')), - onClick=CMD - ), - lapply(seq.int(from=0,to=180,by=10),function(i){ - xy1<-CXY+c(0,-R+R0) - xy2<-CXY+c(0,-R-R0) - xy3<-CXY+c(0,-R-2*R0) - g( - text(cxy=xy3,i, font.size=8), - line(xy1=xy1,xy2=xy2, stroke='black'), - transform=rotate(i-90,CXY), - onClick=CMD - ) - }) - ), - g( - line( xy1=CXY, xy2=CXY+c(0,-R+R0+2), stroke='white', stroke.width=2, - marker.end= - marker( - viewBox=c(0, 0, 10, 10), - refXY=c(10,5), - fill='white', - markerWidth=8, markerHeight=8, orient="auto", - path( d=c("M", 0, 0, "L", 10, 5, "L", 0, 10, "z") ) - ) - ), - transform=rotate(theta0-90,CXY) - ), - circle( cxy=CXY, r=R0, stroke='blue', - fill=radialGradient(colors=c('white','brown')) - ) -) - - - diff --git a/inst/App/sampleProjects/shinyDialInput/www/widget.js b/inst/App/sampleProjects/shinyDialInput/www/widget.js deleted file mode 100644 index 797f97f0..00000000 --- a/inst/App/sampleProjects/shinyDialInput/www/widget.js +++ /dev/null @@ -1,74 +0,0 @@ -// Javascript -//BEGIN: INPUT BINDING -var widgetCntrlBinding = new Shiny.InputBinding(); -$.extend(widgetCntrlBinding, { - find: function(scope) { - console.log('find'); - return $(scope).find(".widgetCntrl"); - }, - initialize: function(el){ - // Initialize any data values here - $(el).data('dXY',{ - x:Number($(el).attr("data-dx")), - y:Number($(el).attr("data-dy")) - }); - $(el).data('CXY',{ - x:Number($(el).attr("data-x")), - y:Number($(el).attr("data-y")) - }); - }, - getValue: function(el) {// used to return the value of the input control - //return $(el).data('dXY'); //we return mouse position relative to svg - return { - dXY:$(el).data('dXY'), - CXY:$(el).data('CXY') - }; - }, - setValue: function(el, value) { // used for updating input control - // theta value is assumed to be in degrees - $(el).data('dXY',value); - $(el).trigger("change"); - }, - subscribe: function(el, callback) { - // notify server whenever change - $(el).on("change.widgetCntrlBinding", function(e) { - callback(); - }); - }, - unsubscribe: function(el) { - $(el).off(".widgetCntrlBinding"); - }, - receiveMessage: function(el, data) { //called by server when updating - if(!!data.value){ - //var id=$(el).attr('id'); - var htm=data.value; //assumed to be in degrees - var node=jQuery.parseHTML( htm ); - $(el).empty().append(node); - //this.setValue($(el), data.value); //record value - } - }, - mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id +" svg"); - var pt= thisSVG.createSVGPoint(); - pt.x = x; - pt.y = y; - return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); - }, - clicked: function(ctrlId, evt ){ - var pt = this.mouse2pt(ctrlId, evt.clientX, evt.clientY); - var el = "#" + ctrlId; - this.setValue("#" + ctrlId, - { - x: pt.x-$(el).data("CXY").x, - y: pt.y-$(el).data("CXY").y - } - ); - }, - getType: function(el){ - return "widgetCntrlBinding"; - } -}); - -// register input binding -Shiny.inputBindings.register(widgetCntrlBinding); - diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID25d9190dff34.rda b/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID25d9190dff34.rda deleted file mode 100644 index 046f377c502c7e959dfeff3cc2ba73d4fd06d833..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 631 zcmV--0*L(|iwFP!000001C>-;Yuhjsb}n6s9!j9?E@e=Sz9f)@wCe^PEnT-fG*CiF zGP+mAK8Zzb%Sg(_FWY|0e$Rf)e!(``v140pStF36^LogJUGt;yu=sUlG1v|8Bj)j;4os*A79I!KWitUE zFj!RL1(h~735PexmxJ@BLxrp%jF%UZ)A87W(7^bc&!{IwBQji~xMi(()i`M=ag6Io zg$Q%0E$oZi>y;Ni3fPQeb0#EnvB@mJQw9Rtz+vUk`*L%G>RN4;5htE-h=iwhHtY0k zm1ok@%ij;Sw6IJZ(w65Owwc$1MPL3$CylmoqFW1_MkPKr7f%|b)!cN~$?0~ku@0Tu za>^mtDAJFN^7p6>+dm($t8rG9ziMT&ENohq+T~)lQ66z2Y4KqU?oFrz9S|m`zGS>5 z$+&C9+;feiVo2tYurD+=H2Xx_NqQPhJT(a{CU-T`RWlt^Wivg$CPIK5f&-?c%xlST zpeKyGqrgvm_H>_20WUSqm!Fx_Q(Z_((0I-kUC)ALlBGs_>CJtOQZKTSj>&_2VTVzn z3V9^304E#xl}4M)nYmsj@trX-?<~&zT)8Q#E-)UW)fBbCyj%Z&Xv(RTyI+YAVY5Z@ z@005G-FX;dP diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID25d96494b000.rda b/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABID25d96494b000.rda deleted file mode 100644 index 6a9b00d0586f12b9522c0f41f32e07693c8beb2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 704 zcmV;x0zds9iwFP!000001C>+lYTGarb(?l2{!t2Tx3vsv!k{svX&Bw0u&{OQj|D~v zNuc{z6icmz?EF zw%wGkJ^5_NXUSP{s`9(t9rO+cC+|9EFJ8jqS4YQ3!&a*$30FDI9y4I)+u_N{VTxgh zg#MgT!AP?w$@R?f&2J}PW?&@|tPCyvB6!FEo7Q=R>C|`U<|OR-t~*ojPePU8^}*Gc z1_H;l{uxO>|BLI%#p5vxPbexA7e#$W_{IB%Cn6-kWy{kl(r3L}KeRevfN}x^dgx5u<|E=b3rFNpuL~$5+S6p#VtS6!u2?W*w(GswO{di~ z!m93k%HgbYppE7K1{`MYX*?dJk}LswP(BbRgk?S05~ zUs*N}ih>d1T4hgzTUVH%Gc+6Am^B3$cA(}STO8(nFhM!{#9}kE3q+KcXVHMl{~l{{ z(;`PPM4DO&iv2S=%JM2Bg4ES)ifl@+Vm2B~liX*^_AwfGYH^7;jmfz@g}eoeXK~u0 z5Z&ZeS~M*pw=HS}GHFfj-bve6jY{O6#2gVb@s33YF&U4jQTX~01lN$oNvYiel>sr+ z=thA?D7c>gKR09;mg1`l;ZdCCS5*P)-PunmQ4!5!90d)d)L6hjiq&8A%D;Q%BR9goxePI>t z!(QFww6Sn)%XVn1X_w!!zqUWHU$D(_5}KGIz><^r`_B2!CC6V}$8lDjwT%^LbuIqf z){lL?%X+Uk>rP3(cY1@%gF)w0_xuQ*ygPn>JbHWLYuq(9$qhwWU_>Gu^w1b;Zbh#o!WmV9)G+0d z>IUs<0#@slY1sB_N3B-7QQC-Iw73muG!7-zADBAXAb3 zOk{)!oP+cQ=8B1iLc?y5a?dRe%Rah>jD2CT@v(~mXg~RIbi{$)Vja; zevPCA)dvFR>NHe5#v>*sgE`M^c5Itm0WU3%t20I}bQiJ`EMBl_S6{hVmZe40h3BqC zO;9YIl6$wp_D!K0xg)Ryk`MgKqJ2i93C$(GHAMbZAQ&%{yFj%A6De9=pdt8IH~-Ha z3mg>uO9qi4n`U>`0Ku$yoEHT0p)tbn cL=#S+A0iI25hEN_Jnet~1GloTpNa+m00}TOW&i*H diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABIDa9527235bba.rda b/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABIDa9527235bba.rda deleted file mode 100644 index 7d435b4151d28ddd389ece9109073e87dd82e5be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1190 zcmV;X1X=qZiwFP!000001FcqlPuoTqPl2|=e^f|q_fk#jtxSr|9LF&UG#lQQf+~bOINHaZ;#aYgD(TUMV``)mMJ zJ`Ag^R&_+Z9*E@cXMWK$+Nkp=*8l#mQu<`=mqQWdp$C8Zv=ceeL`D0yrlgXf-sA!z z4w|AUr~5komd*W(-a&%#y093r~B_}@0H!Nw{azmhHf-9#FS|*tdQ}YN_QBzg0euBm`>dB z#6|<1M0Q&iMdCY^kZ#Ccwf53P6xF_tHZWVprpnmX`G-3+>K}`Sagdz5YJ9$GxNNWN_p%@dsbi7)Cy$FcH>!Y>usDbOi7P_bN!@# z1*4zrngnEB=UH2KNc+wy&J$ANO{k9g_UV4&X??vd%-65W3zUHeuISrVhUik?x63~5^+hiN2+FsPkBj2t z1P@pM)3CRRYuy;Q)%y3q=Jk;?C=2A0v&-3)mru>5k&6d-yu}K;0h5Y1+=gK`^u&M1 zA3|9k#f95!^(1lv?mGes#M9ZeYBjv(R=rv8U^$Waklv4_(zW;FgZ7aVfS+h)nTISm zgwc_>=7KG%-gK#Fb?%S)RHl8?P5)nC2BkES9}Z@T6y;p4(#1LXKY@PFIQ~tJ_~9Sd z$ZJVbtAFEjhe2UmS;|%^a0b8=C(lzSxGG?8wvzGW>Ku3p_ep`H{MfmGl>M~8#^Mp~ zk#yA*Xa^VeAxp@|1#*B#aYC)Q^ZpkO=OB*32YL7!B3_|g77b1&VXE__sFNAMX9X@4 zyUahtDx^aw@DUpw1RjjjEDLlnw|rWl@G}WrC*-q*u*Y(sh};mEgP#rjd4YDBKO6*^ z#2cdKMFSQk=-M3ZLwtfHxYCQLm$P4$2=B8|x=khEjq~Cp=O7zOiN7WD zE+vw6DS^4msW{0wSaf;e;Hi}&UO@BXekKv_3_>4{`%Vblh>;LPyxKqf13{a5&pZqO E0NK4y+W-In diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABIDa954e443c9d.rda b/inst/App/sampleProjects/shinyDialInputOptimized/.workspace/PTR-TABIDa954e443c9d.rda deleted file mode 100644 index e3af9fa45aa0524405935e014cccb39369482821..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 931 zcmV;U16=$ciwFP!000001C>>6kK05L_Fb>4;t$nHZGl!uT}6lDlY)c9@u96yxoc2m zBtk?2;_Jqq*xPP)E$=$MP!;$s{6c;KFkaj7+Lx-WCBN)Ev(GcLJD&Z`bsXo|xpn)< zIlfhX-owXZyif5ya!#B9zVFYMKYzKryb7lD$u}2paq)HdBtpAue5%{_fB47b@^VtJ zCzeF z1+!@|d+BazMk=irLTCJniHM1qd`korWRWnj^8=CQx(2-SXYQE~*BV6R-JCZjZ(M@c z8i!BGIv1g4Qg|wqDV*0>d4*Ca$-(C`_C}@i2zeVY1D$7roYm9(68DC_r8ca+-;T`- z6Rqdy1V}I?a&5k*KmAC6!v=&le&)dh(~NTVJ6Hh%KW~FWI+e(rN2CDDoop%3fh3T@ z^S$p`In|G-rrr=GH64!0SLe@=LxEN%ikhLCZi#f(pp_YQbHkK>Ehlz^C2uguTtP&% zv~#aQtkY-ZzLiU@Gs$nR?mqC53B0GP4(X070hA|={#s@vPm!mrnuChAQkX~@wAHgkOdZ$ao>jhYyK(2@aO5^s9mjf&Wqv4xhS4p#T~qEcQyMd> zR(w_Yxz+#5tp8Q{jjMNn7}iItho7F&L=a^Fgym4%s zTF3E@6f-F1`aOI`@MELAT_nt;*Yx5(>-&1Qvv0}4KC1q>lQm~?qT>v9A0zaaMf|5p z|IXhB#;0{qga7by-hIG)KvE~i_9_Xw0acScZb;UQ!xX9$MP|OHt01bePkIwB-FsejjpVl1e5bYLsxEjw zY=h>(byv48A6~eVjaKNS - - - - - - diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/widget.pprj b/inst/App/sampleProjects/shinyDialInputOptimized/widget.pprj deleted file mode 100644 index 273b901a..00000000 --- a/inst/App/sampleProjects/shinyDialInputOptimized/widget.pprj +++ /dev/null @@ -1 +0,0 @@ -{"pathToProj":["~/AA/widget"],"projName":["widget.pprj"],"projType":[[[[[["generic"]]]]]]} diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/widgetCntrl.R b/inst/App/sampleProjects/shinyDialInputOptimized/widgetCntrl.R deleted file mode 100644 index 225399c4..00000000 --- a/inst/App/sampleProjects/shinyDialInputOptimized/widgetCntrl.R +++ /dev/null @@ -1,45 +0,0 @@ -library(shiny) -library(svgR) - -widgetSvgCntrl<-function(args){ - source('widget_svg.R', local=T)$value -} - -newWidgetCntrl<-function(WH, theta0, CXY, R, CMD ){ - svg<-widgetSvgCntrl(list(WH=WH, theta0=theta0, CXY=CXY, R=R, CMD=CMD)) - HTML(as.character(svg)) -} - -widgetCntrl<-function(inputId, wh, theta0=0){ - cxy<-c(.5,.9)*wh - r<-.4*wh[1] -# SCRIPT<-' -# function clicked(evt, ctrlId){ -# // compute theta (in radians) -# var theta = widgetCntrlBinding.mouse2theta(ctrlId, evt.clientX, evt.clientY); -# widgetCntrlBinding.updateNeedle(ctrlId,theta ); -# //update value -# theta=Math.round((180 *theta) / Math.PI ); -# widgetCntrlBinding.setValue("#" + ctrlId, theta); -# }' - CMD=sprintf('widgetCntrlBinding.clicked("%s", evt)',inputId) - tagList( - singleton(tags$head(tags$script(src = "widget.js"))), - div( id=inputId, - class="widgetCntrl", # - "data-theta"=theta0, # customize for initialization - 'data-x'=cxy[1], - 'data-y'=cxy[2], - 'data-r'=r, - newWidgetCntrl(WH=wh, theta0=theta0, CXY=cxy, R=r, CMD=CMD) - ) - ) -} - -updateWidgetCntrl<-function(session, inputId, value=NULL){ - mssg<-list(value=value) - if(length(mssg)>0){ - session$sendInputMessage(inputId, mssg) - } -} - diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/widget_svg.R b/inst/App/sampleProjects/shinyDialInputOptimized/widget_svg.R deleted file mode 100644 index 293660a5..00000000 --- a/inst/App/sampleProjects/shinyDialInputOptimized/widget_svg.R +++ /dev/null @@ -1,74 +0,0 @@ -library(svgR) -library(tidyverse) - - -WH<-c(400,200) -theta0<-45 -CXY<-c(.5,.9)*WH -R<-.4*WH[1] -CMD<-"" - -if(exists("argv")){ - list2env(argv, envir = environment()) -} - - -theta2pos<-function(theta, cxy=CXY, r=R){ - theta<-pi*theta/180 - cxy+r*c(cos(theta),-sin(theta)) -} - -pos2theta<-function(pos, cxy=CXY){ - pos<-pos-cxy - if(abs(pos[1])>.0001){ - theta<-pi/2 - } else { - theta<-atan(-pos[2]/pos[1]) - } - 180*(theta)/pi -} - -descriptor<-function(theta, cxy=CXY, r=R){ - d=list( - M=CXY, - L=theta2pos(0), - A=c( c(R,R), 180,0,0,theta2pos(theta)), - Z=1 - ) -} - -descriptor2<-function(theta, cxy=CXY, r=R){ - d=list( - M=theta2pos(0), - A=c( c(R,R), 180,0,0,theta2pos(theta)) - ) -} - - -tmp<-as.character(svgR(wh=WH, - #your custom code goes here - - - path( - d=descriptor(180), - stroke='#0000FF', - stroke.width=2, - fill='none' - ), - path( - d=descriptor(180), - stroke='#AA00FF', - stroke.width=20, - fill='none', - onClick=CMD - ), - line( xy1=CXY, xy2=theta2pos(theta0), stroke='red', stroke.width=5), - circle( cxy=theta2pos(theta0), r=10, fill='lightblue'), - circle( cxy=CXY, r=10, fill='lightblue') -)) - -cat(tmp) - -tmp - - diff --git a/inst/App/sampleProjects/shinyDialInputOptimized/www/widget.js b/inst/App/sampleProjects/shinyDialInputOptimized/www/widget.js deleted file mode 100644 index d292659c..00000000 --- a/inst/App/sampleProjects/shinyDialInputOptimized/www/widget.js +++ /dev/null @@ -1,84 +0,0 @@ -// Javascript -//BEGIN: INPUT BINDING -var widgetCntrlBinding = new Shiny.InputBinding(); -$.extend(widgetCntrlBinding, { - find: function(scope) { - console.log('find'); - return $(scope).find(".widgetCntrl"); - }, - initialize: function(el){ - // Initialize any data values here - $(el).data("theta", $(el).attr("data-theta")); - $(el).data("R", $(el).attr("data-r")); - $(el).data('CXY',{ - x:Number($(el).attr("data-x")), - y:Number($(el).attr("data-y")) - }); - }, - getValue: function(el) {// used to return the value of the input control - return $(el).data('theta'); //we return only theta (in degrees) - }, - setValue: function(el, value) { // used for updating input control - // theta value is assumed to be in degrees - $(el).data('theta',value); - $(el).trigger("change"); - }, - subscribe: function(el, callback) { - // notify server whenever change - $(el).on("change.widgetCntrlBinding", function(e) { - callback(); - }); - }, - unsubscribe: function(el) { - $(el).off(".widgetCntrlBinding"); - }, - receiveMessage: function(el, data) { //called by server when updating - if(!!data.value){ - var id=$(el).attr('id'); - var theta=data.value; //assumed to be in degrees - this.updateNeedle(id, (Math.PI*theta)/180); //adjust image - this.setValue($(el), data.value); //record value - } - }, - mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id +" svg"); - var pt= thisSVG.createSVGPoint(); - pt.x = x; - pt.y = y; - return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); - }, - getCXY: function(id){ - return $("#"+id).data('CXY'); - }, - pts2theta:function(q, p){ //compute theta - return 0.5*Math.PI + Math.atan( (p.x-q.x)/(p.y-q.y) ); - }, - mouse2theta: function(id, x, y){ - var p=this.mouse2pt(id, x, y); - var q= $("#"+id).data('CXY'); - return this.pts2theta(q, p); - }, - polar2xy: function(q, theta, r){ - return { x:q.x + r*Math.cos(theta), y:q.y - r*Math.sin(theta)}; - }, - updateNeedle:function(id, theta){ // assumes theta in radians - var el='#'+id; - var r=$(el).data('R'); - var q= $(el).data('CXY'); - var p=this.polar2xy(q,theta,r); - $(el + " svg line").attr({"x2":p.x, "y2":p.y}); - $(el + " svg circle:first").attr({"cx":p.x, "cy":p.y}); - }, - clicked: function(ctrlId, evt ){ - // compute theta (in radians) - var theta = this.mouse2theta(ctrlId, evt.clientX, evt.clientY); - this.updateNeedle(ctrlId,theta ); - //update value - theta=Math.round((180 *theta) / Math.PI ); - this.setValue("#" + ctrlId, theta); - } -}); - -// register input binding -Shiny.inputBindings.register(widgetCntrlBinding); - diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID1b8a789c513.rda b/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID1b8a789c513.rda deleted file mode 100644 index a11713516e8c92d85842d606519309ea313908a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1074 zcmV-21kL*&iwFP!000001C>^5Z`(E$RhwjOG%U!Fc8_8MxU7IAM7C2m!!jVkmZlrv zFP#y459}K)F&0}{BuFZ@(FW^p*)QBL*mgxq*2Brt3XsKn&gHoeQKWyjEz8=lHa>vg zEf`u`zl?wC99!1iJunX7-i7;)wP|g`^TBX@-Wi`h8$5q9ImX`}e;0o9J4?Q3K z0am}$r#|W*^r?qDU#rDWT_?=z!dpNkdTSUOltTQZ$}gLvaZb7)K;vID_GZg!l#_O z84WV{O3gYC%)@JKE8Am%Q<*>y-f?rQ``lTSo7VS#U%P4Dhn;PRQrB zCxfWqK521Oj_@TZ*-u++ZVs`E3;JP;#wjc~R*-uwa>gQ3P@7>j{sQ(QqDCYk`fKj0 z{KL6mVm4m#(&s_jr&hpcEsm=*mb`#2lqIxy!R7-vUlwJSEjq1cK5S7loJ$wvqqVRj zT__+o1ePSJ2mZW8!{L<8(pus>6CA#Z1mlfzD-iyYML8Hd}ZH>s7 z&C5MP1JR;sE*k>%P_`0u(v;LlT~Y&;q%oHbfptl}<(Ej5(q`R{G$L_+RE=WHiR|VG zCrXwp`8toNWIxvIOE}S3(jY$4M2J-#+$+3~!u;H7_}gU@W*Yq6;bme5(5r?-zkxyW-Tj~c0LtV~6=Dkj0QC(DxBvhE diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID41cd6cdad2c7.rda b/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID41cd6cdad2c7.rda deleted file mode 100644 index 4556a66c5298669a643eff4d139042e5cb19ae08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1605 zcmV-L2D{OZ`(u|&)CXTBc`G;UMBvyl}UB9)Y+y9P^SpG7e*#l zN|TL|snRa?lh~beHh1T|Fjeqb_+)$pJ^}FD*%zPPblohq$vyAS@1Fbl^4w`O8s{75 z-^c%J__eY2wEz9~H;u-7mvM0e|2FXNT;oDx9Y3$^_Yb!FyZ5>e?%eW&ul#@pxBahC z;b^1$&vt0G!(;+&k)`e3-L?oLw&=1nlkM4TW-YxVfyS4L0Oqj+IY)F#h0mi@RyFH? zx7+0L?z7$A{e$j)-*MXQ?%w{>KDpQ3d(ho`F>R zTPWP-UFW(7a|tYPSNpceYlq-7!sQMbWz3gR!d&4eDKrb6di;cmBnB@|#_pCf-on^M z$w6kEk?Vzug`yDwFO?ZM0DU5tppaq3H= zG|@1VWwzWy*}9v9%@%pw`)SWhDHq_Xh)wN|kWGP0A`>ixB*P<6v9KhJNBwYBuq|ET zR_mq?K!mQ))Lh^;2Kh_@P(`iSDs;*O1S)5-DXM=B7)eIBhy+H&9Z?%9c@jG{@N&>* zVdRH-YBHmO_#tIu2ZF|PJ)Z+J1ZGQ@!<~zDijMwo6oVIfdDyW*;IO01 zcyaU4?lqbe;#-G>^tckYgI=c^eY)Z;O5cQfCi+7T1kP*KgWj+js5cu4(M z_5nw@SR!%P5N3{Zi!%TW)R#Oosm&{fDw5XEdBH4rEXt(K+N_ugT#H4HtHoz*b@_Iv zqLk6-B-@xO@FczQu~TyJA)3My5Q2{DpsBr3h)PtkuNOSORC*_7vhpOY>FEHOQ7^h{Q`djIx-} zVUpQYrZKmXpCouzZ>Q42JPKL_kM*LdAfJE?6HRM|Rka7M60XH!I?fkPiH>5s-m^!Y zAn~&aqUimmfa*bvM4aH6`ErxoAW?u&nbyzpz$_=7RH{^VjI-x+pc3%geiAWRPIxN4 zIlijr)_Q^Kg;^J*isA{y{h#+aWdhl2;+n`v{XL8h?0)}=t5^wR!c>-TS;cjT z{Yj2^o~NSDhoQyYiX+_peOL!c{k-*b%$~_AM)^399dVgaamAAc|+D7N*=A!xSKPxYq z>k_Xo`;Zzc(n`Cf6de*?NHiHJ z)e=D`X$-xPrXV~eNkIxT$*U{^qy0#0kAzH;xT5$_D|{+#;pM{mj<2}BV(-kNU|j8A zORT~9KnwB>t=PzNq;s1|#PH=;714Pq%H8n&lbXVEfu0%&e!&GOhX40}ppiy;C=mbv DbPg_= diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID704c2e20c007.rda b/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABID704c2e20c007.rda deleted file mode 100644 index b240f0e5c4ebf94bc01d08db8390b6cfaee6cb86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1705 zcmV;a23GkWiwFP!000001Fcv8Z_`E;4}*g0X^08f7qlO4X;JLeNz;gliPdaCg~(L8 zswrd2v`tt05+B%Sb9YYKv1+-n;kpbMIb$G+M3J#n#2k z@Vf%9t(9kokGo&BTJK$l#Rhz@!S_PzQfn2SH}?+@x`z)Q4tMVM@3;dp=)3*?U0@hm zDE(G9Set$nl1-7sn-3mr3ZJr*A&V1Pd40qr4|)e6d^J;$f2xWu#*)`bh8@r&j`@kH zby-HSoJ|kP)e8}^fJ$N+hJ@v7#7P*iekVkvg&wFy#I8iq$Ex+W1r(FDzXEFtv>!VProq))Q&!bp{sz^fDn^#;mx zB{HgfA9`6XT{Fjuh&g3)QcY_Wr#&~I?n~mC?c1VlquZVhCZzRs$IcYmsE;iB|I@am zvxKtf^=7~d6Ot#cQ~^hTQ9-zb2Lf23gc@RLJqxvS-*L?^`}S79Z>fT~=GI1^g1L|OPGM91Vn&__uO4iF=K zEI;Ui2mwzU)e$o2_w73wME0KT?rLDHA!sX9=}V;z-EsrMrqYM-K6eI{*6U(`$PxA+ zFJZ?j$l1BpI*qg)Yt1Z29GXxrq>**+1`w6xf5zf6G-|b+xSXiSR3m}>QBHKr)LaHV zdb?ZeQ}0&3X8lrQp%BnXb*t2U+EMzoKmnChFe}cwAk5Q-o&o_+NqL-=DvbbuK+Fl? z(ghKuu$QHpcnTC5JSIE}b%ZHM(uQ&G9w$?9hVa^j4IV7Jv-R;RAf#ikk(O=3$wII5 ztC@-(OM)O3hgO4ftYnaAD@K#oflwsK*elk`c$a@&x3(vi0zU2zI=-^ZSCAXuFQR^ zqsvG0rrNj8@~zyjZ-<3n&2=rO0iF7C%E`&OEWN2{{zGTr%AX6?*D|kG|A9|y`9F?# z3hTV@=g$6_nq7_~0J~Tg$eW7IYC@JkVufRmMy=MR_o_q&6Mk-CBO~6J(17fabX19W zPvWDYm+?Mo@TeH!8OgaHH@IrKkENfdp~1%R4`naPnAaQ35H697b;&K?KZDta$dSGZ z;dJ+;I+QTqgoh__E_0(PQwiXc1}~P6qF@iQkcZIVL&MZWq2o zjMX?JgF%-t5V-jImKhN9``Lx5m;S& zBOk{^^b{o~aGo+GFOu+b?uVND0tVsqX diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABIDa9527235bba.rda b/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/PTR-TABIDa9527235bba.rda deleted file mode 100644 index a661cf3858b7f190ccaee8088dd3003ae0b0bb94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1362 zcmV-Y1+DrYiwFP!000001Em*xZ`(xNdvv2lOhemvO#E@`RK;HH)CsHDqdwpU=L;cC(i_#fg9K=iTq}+%yd1l5yz@e6PT( zvGV=Fx9)wzxOfAA4S24@bHTW5titcj?m^Ez*nYIPgCA_QziNNE)$e1#n~EoY%KX;m zh>gjnm?WFq+nZuU<8&`hCbIPUvp5?zd%$}wll%H_L$9))ONr!F)RhMj?Q_gi3*>vY zsUbQ(q-QH1%+gQCy^`|&BNV}8(8-|&$;h;w)yz!&VI*D zu#m*F)^J3)v>Jb`IVi9^r)4{6?I98*B7r1f!(Ow^qf8um8!hUfmg`a5eA02nZy+Wn zW9umktt0!VwyhYCHlLV#I~}(%PQRP z2Ns!8A%(S;6W45H|862!1IDcw(HO;eOoWw_?ShysECe0KR_qjdkB{S%6I+pAnlE)K zah#$a8j&a=90d#<88RXO!O8N}s`Q#>LdpIJC!{kE#R_JrgL;0;L2^VS7JimW)V`b0 z+^rl7Nn?<-99UnsaypQ^9amaoEIFN7P=$brf(eS@3L0z3cG{Z1d$+d%Rso1GAChez z_#Oaa;L`z#1hG&^2Lmnm&`+}3IbJ3m`Vr*SDzf#|&zvuSCw}+XX`N_r8{zsO?JT`Qa&}6ZQyR*V-|{vOcaK{qkhox+L^HJB3EXuwPaTaz zGIP-LA02eK>!25)yCm+Q0gWQRk&-B4(}shfd5c0ry45fDvkrWbmsiE>Z}Xu>z<#pO zEcG+}(~+Nv6gHj-GXYj@wyYj-9E%7`@{Yr<%yVJ(mdW)2 zRHBPx5@|leSju;m#m~sJE8n6{*?V6nS5#NMVNAbmtQ*>^Z}#S1)!|A?bp_J*G4!gW z_)iu7)xVa&*9)gs|AqBGgDT4|!`I*6H}mJpbtPdmmg03`yegS2r{gu0KYM-%! zc%w!f!?{zCE(eSEFW~k; zCENuT1Q;){*B96k2~OwrGly_vtjMn_j2N-0K6?}*oK?ZJqM&Tbglkv7s#0OfDiva( zG6&O&g7YfRFiZ-K31eD~`?kUe3^OAi)S{VT5(4|F=;UP_p{9PUsK3GlWKo6iks<_G zmXS9K?t4Kjd6nOUX)~wCsqNQ`5F^zw~Q5A(}3sf!!m#;)SmLrP4 U8;1apY-;@TABL1+=E@BK04Oq+n*aa+ diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/currentTab.rda b/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/currentTab.rda deleted file mode 100644 index 9b69586b4e555d93575813e1a7b9c027fee653bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72 zcmb2|=3oE==I#ec2?+^l32Dre);Op!XJ>TGUdK8?k>N-Wj}FfqhbR>V6%X?x7f)V3 ZYH(8N;+;cAH?LffV2Fr4_ud+4002#98h8Kz diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/loadedDnippets.rda b/inst/App/sampleProjects/shinyQuibitCtrl/.workspace/loadedDnippets.rda deleted file mode 100644 index bcdafe728bbca11efe8fd79ea270fe12877f073c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 219 zcmV<103`n(iwFP!000001C>w94uUWctn!EuO*DRo^r{yVV&VsgCf>|Ki(twlv?$*E za#|D(kv_)%Rxl_5NW4IOsmLVPS0Mn?2imh)6`>&fC299)002t;Vz>YR diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/app.R b/inst/App/sampleProjects/shinyQuibitCtrl/app.R deleted file mode 100644 index 79fe9595..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/app.R +++ /dev/null @@ -1,39 +0,0 @@ -library(shiny) -source("shinyInputCntrl.R") - -ui<-fluidPage( - shinyInputCntrl(inputId='myshinyInput', wh=c(400,200), Z=c(2-2i, 2+2i) ), - h3('current Value'), - textOutput('currentValue'), - textInput(inputId='updateValue','update value', ''), - actionButton('updateButton', label='press to update value') -) - -server<-function(input,output,session){ - output$currentValue<-renderText( - paste('c(', paste(as.character(round(input$myshinyInput, digits=2)), collapse=", "), ')') - ) - - observeEvent(input$updateButton,{ - value<-input$updateValue - print('update button pressed') - tryCatch({ - - value<-eval(parse(text=value)) - - if(length(value)!=2 || class(value)!='complex'){ - stop('invalid input') - } - - updateShinyInputCntrl(session, 'myshinyInput', wh=c(400,200), Z=value) - }, - error=function(e){ - # do nothing , record error - print('error') - }) - } - - ) -} - -shinyApp(ui=ui, server=server) diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/jstools.dnds b/inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/jstools.dnds deleted file mode 100644 index baf3ee98..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/jstools.dnds +++ /dev/null @@ -1,450 +0,0 @@ ---- -title: "Dnd Snippet" -author: "Anonymous" -date: "TODAY" -output: dnd_snippet ---- - - -********************* - - -POPUP -``` -add mouse2pt function -``` -SNIPPET -``` -mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id +" svg"); - var pt= thisSVG.createSVGPoint(); - pt.x = x; - pt.y = y; - return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); -} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-WH[1]*.2 -CXY=WH*c(.3,.5) - - -svgR(wh=WH, - circle(cxy=CXY+c(-R,-R), r=R/4, fill='#00FFFF'), - circle(cxy=CXY+c(-R,+R), r=R/4, fill='#00FFFF'), - circle( - cxy=CXY, - r=R, - fill='#00FFFF' - ), - rect(xy=CXY-c(0,R), wh=c(.5,.6)*WH, fill='#00FFFF'), - line(xy1=CXY-c(0,R),xy2=CXY+c(0,R), stroke='black'), - line(xy1=CXY-c(R,0),xy2=CXY, stroke='black'), - #polygon(points=WH*c(c(.1,.5),c(.25,.2),c(.25,.8)), fill='#00FFFF'), - text(cxy=WH/2, "xy") -) -``` -********************* - -POPUP -``` -add mouse click -``` -SNIPPET -``` -clicked: function(ctrlId, evt ){ - ${0:0} -} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-WH[1]*.2 -CXY=WH*c(.3,.5) -svgR(wh=WH, stroke="#00FFFF", fill="none", - circle(cxy=CXY+c(-R,-R), r=R/4, fill='#00FFFF'), - circle(cxy=CXY+c(-R,+R), r=R/4, fill='#00FFFF'), - g( - polygon( - points=c(WH)*c( - c(.0,.0),c(.2,.5), c(.05,.3), c(.05,.6), - c(-.05,.6),c(-.05,.3), c(-.2,.5) - ), - stroke="#00FFFF" - ), - lapply(c(0,45,135,180), function(theta){ - line(xy1=c(.1,0)*WH, xy2=c(.3,0)*WH, stroke="#00FFFF", - transform=list(rotate=-theta) - ) - }), - transform=list( translate=WH*c(.6,.45), rotate=65) - ) -) -``` - -****************** -POPUP -``` -replace node -``` -SNIPPET -``` - var htm=data.${1,value}; //value - var node=jQuery.parseHTML( htm ); - ${0,(el)}.empty().append(node); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-.06*WH[1] -d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) - -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - #circle(cxy=WH*c(.2,.2), fill="#00FFFF", r=R), - #circle(cxy=WH*c(.8,.2), fill="#00FFFF", r=R), - #rect(xy=WH*c(.16,.32), fill="#00FFFF", wh=c(.6,.16)*WH), - text(xy=WH*c(.16,.38),'html', stroke.width=1, fill="#00FFFF"), - circle(cxy=WH*(c(1,1)-c(.2,.2)), r=R), - path(d=d, stroke="#00FFFF", - marker.end=marker(viewBox=c(0, 0, 10, 10), refXY=c(1,5), stroke.width=1, fill="#00FFFF", - markerWidth=4, markerHeight=5, orient="auto", - path( d=c("M", 0, 0, "L", 9, 5, "L", 0, 9, "z") ) - ) - ) -) -``` -****************** -****************** -POPUP -``` -get attribute -``` -SNIPPET -``` - var attr = $(el).attr(`${1:data-Z}`); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-.06*WH[1] -d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) - -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - text(xy=WH*c(.2,.38),'attr', stroke.width=1, fill="#00FFFF"), - path(d=d, stroke="#00FFFF", - marker.end=marker(viewBox=c(0, 0, 10, 10), refXY=c(1,5), stroke.width=1, fill="#00FFFF", - markerWidth=4, markerHeight=5, orient="auto", - path( d=c("M", 0, 0, "L", 9, 5, "L", 0, 9, "z") ) - ) - ) -) -``` -****************** -****************** -POPUP -``` -get element data -``` -SNIPPET -``` - var htm=data.${1,value}; //value - var node=jQuery.parseHTML( htm ); - ${0,(el)}.empty().append(node); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-.06*WH[1] -d<-list(M=WH*c(.8,.42), Q=WH*c(c(.8,.8),c(.2,.8))) - -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - lapply(1:5, function(i){ - ellipse( - cxy=c(.6, .8-i*.1)*WH, - rxy=c(.2,.1)*WH, - stroke='black', - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ) - }) -) -``` -****************** - -****************** -POPUP -``` -set element data -``` -SNIPPET -``` - var htm=data.${1,value}; //value - var node=jQuery.parseHTML( htm ); - ${0,(el)}.empty().append(node); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-.06*WH[1] -d<-list(M=WH*c(.8,.85), Q=WH*c(c(.12,.85),c(.12,.52))) - -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - polygon(points=WH*c(c(.25,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.1,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - lapply(1:5, function(i){ - ellipse( - cxy=c(.6, .8-i*.1)*WH, - rxy=c(.2,.1)*WH, - stroke='black', - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ) - }) -) -``` - -********************* - - -********************* - - -POPUP -``` -To string -``` -SNIPPET -``` -JSON.stringify(${1:obj}) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -r=WH[2]/3 -lft=WH[1]/2-1.5*r -top<-WH[2]/2-r -bot<-WH[2]/2+r -svgR(wh=WH, - polygon(points=WH*c(c(.25,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.1,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - circle( - cxy=WH/2, - r=WH[2]/3, - stroke='none', - fill='#00FFFF' - ), - path( - d=list( - M=c(.4,.8)*WH, - C=c( c(.6,1.2),c(.9,.2), c(.8,.9))*WH - ), - stroke='#00FFFF', - stroke.width=1, - fill='none' - ), - g( - lapply(1:3, function(i){ - ellipse(cxy=WH*c(.5, .1), rxy=i*c(8,3), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask(circle(cxy=WH/2, r=WH[2]/3), fill='white' ) - ), - g( - lapply(1:5, function(i){ - ellipse(cxy=WH*c(.7, .5), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask( - circle(cxy=WH/2, r=WH[2]/3, fill='white'), - ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black') - ) - ), - g( - lapply(1:5, function(i){ - ellipse(cxy=WH*c(.3, .3), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask( - circle(cxy=WH/2, r=WH[2]/3, fill='white'), - ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black'), - ellipse(cxy=WH*c(.7, .5), rxy=5*c(3,5), fill='black') - ) - ) -) -``` -********************* - - -POPUP -``` -From string -``` -SNIPPET -``` -JSON.parse(${1:obj}) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -r=WH[2]/3 -lft=WH[1]/2-1.5*r -top<-WH[2]/2-r -bot<-WH[2]/2+r -svgR(wh=WH, - polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - circle( - cxy=WH/2, - r=WH[2]/3, - stroke='none', - fill='#00FFFF' - ), - path( - d=list( - M=c(.4,.8)*WH, - C=c( c(.6,1.2),c(.9,.2), c(.8,.9))*WH - ), - stroke='#00FFFF', - stroke.width=1, - fill='none' - ), - g( - lapply(1:3, function(i){ - ellipse(cxy=WH*c(.5, .1), rxy=i*c(8,3), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask(circle(cxy=WH/2, r=WH[2]/3), fill='white' ) - ), - g( - lapply(1:5, function(i){ - ellipse(cxy=WH*c(.7, .5), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask( - circle(cxy=WH/2, r=WH[2]/3, fill='white'), - ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black') - ) - ), - g( - lapply(1:5, function(i){ - ellipse(cxy=WH*c(.3, .3), rxy=i*c(3,5), fill='none', stroke='#000000', stroke.width=.5) - }), - mask=mask( - circle(cxy=WH/2, r=WH[2]/3, fill='white'), - ellipse(cxy=WH*c(.5, .1), rxy=3*c(8,3), fill='black'), - ellipse(cxy=WH*c(.7, .5), rxy=5*c(3,5), fill='black') - ) - ) -) -``` - -********************* - - -POPUP -``` -LOG -``` -SNIPPET -``` -console.log(${1:'text '+} ${0:value}); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - rect(xy=c(.3,.35)*WH, wh=WH*c(.5,.3), fill='#00FFFF'), - ellipse( - cxy=c(.8,.5)*WH, - rxy=c(.05,.15)*WH, - fill='#00FFFF' - ), - ellipse( - cxy=c(.3,.5)*WH, - rxy=c(.05,.15)*WH, - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ), - ellipse( - cxy=c(.3,.5)*WH, - rxy=.5*c(.05,.15)*WH, - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ), - polygon(points=c( c(.5,.35), c(.6,.4), c(.7,.2), c(.6,.15))*WH, - fill='#00FFFF') -) -``` -********************* - -POPUP -``` -Trigger -``` -SNIPPET -``` -${1:$(el)}.trigger(${0:"change"}); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -X=c(.2,.4,.6,.8) -D<-list( - M=c(.2,.2), - Q=c( ) -) -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - path(d=c("M",c(10,5), "Q", c(5,20), c(25,25) , "T", c(40,5)) , fill='#00FFFF'), - path(d=c("M",c(12,8), "Q", c(8,20), c(25,22) , "T", c(36,8)) , fill='black'), - path(d=c( "M", c(24,8), "C", c(22,10), c(30,10), c( 18,18), "Q" , c(30,15), c(28,10), c(32,10), c(32,8)),fill='#00FFFF') - - -) -``` -****************** - - - - diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/sampleShapes.dnds b/inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/sampleShapes.dnds deleted file mode 100644 index 0034e180..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/aux/dnds/sampleShapes.dnds +++ /dev/null @@ -1,527 +0,0 @@ ---- -title: "Samples" -author: "Anonymous" -date: "TODAY" -output: dnd_snippet ---- - -- Individual drippets are seperate by lines consisting of three or more stars (*) -- Each drippet consists of 3 entries, with each entry having a title and a value (block) -- The title consists of a single line followed by a colon (:) -- titles are *Hint:*, *SNIPPET*, *SVGR* - - The values are blocks defined by 3 backtics *````* - - Two drippets are shown below to help you get started - -********************* - - -POPUP -``` -Sample Circle -``` -SNIPPET -``` -circle( - cxy=${1:WH/2}, - r=${2:WH[2]/3}, - stroke='black', - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - circle( - cxy=WH/2, - r=WH[2]/3, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - - - -POPUP -``` -Sample Ellipse -``` -SNIPPET -``` -ellipse( - cxy=${1:WH/2}, - rxy=${2:c(.4,.3)*WH}, - stroke=${3:'black'}, - fill=${4:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - ellipse( - cxy=WH/2, - rxy=c(.3,.2)*WH, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - -********************* - - - -POPUP -``` -Sample Rectangle -``` -SNIPPET -``` -rect( - xy=${1:WH/2}, - wh=${2:c(.47,.3)*WH}, - stroke='black', - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - rect( - xy=WH/2, - wh=c(.4,.2)*WH, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - - - - -POPUP -``` -Sample Centered Rectangle -``` -SNIPPET -``` -rect( - cxy=${1:WH/2}, - wh=${2:c(.47,.3)*WH}, - stroke='black', - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - rect( - cxy=WH/2, - wh=c(.4,.2)*WH, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Line Segment -``` -SNIPPET -``` -line( - xy1=${1:c(0,0)}, - xy2=${2:WH}, - stroke=${3:'black'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line( - xy1=c(.2,0.8)*WH, - xy2=c(.8,0.2)*WH, - stroke='#00FFFF', - stroke.width=2 - ) -) -``` -********************* -********************* -POPUP -``` -Sample PolyLine (Connected Line Segments) -``` -SNIPPET -``` -polyline( - points=${1:WH*matrix(c(.25,.25,.5,.5,.75,.25),2)}, - stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - polyline( - points=WH*matrix(c(.25,.25,.5,.8,.75,.25),2), - stroke.width=2, - stroke='#00FFFF', - fill='none' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Polygon -``` -SNIPPET -``` -polygon( - points=${1:WH*matrix(c(.25,.75,.5,.5,.75,.75),2)}, - stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - polygon( - points=WH*matrix(c(.25,.75,.5,.25,.75,.75),2), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Text -``` -SNIPPET -``` -text( - ${1:'hello world'}, - xy=${2:WH/2}, - stroke=${3:'black'}, - font.size=${4:36}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - text( - 'Text', - xy=WH/2, - stroke='#00FFFF', - font.size=10, - fill='#00FFFF' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Text -``` -SNIPPET -``` - text( - ${1:'hello world'}, - cxy=${2:WH/2}, - stroke=${3:'black'}, - font.size=${4:36}, - fill=${5:'none'} - )${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - text( - 'Text', - cxy=WH/2, - stroke='#00FFFF', - font.size=10, - fill='#00FFFF' - ) -) -``` -********************* -****************** -POPUP -``` -Sample Arc -``` -SNIPPET -``` - path( - d=list( - M=${1:c(.5,.2)*WH}, - A=${2:c(2.3*WH, 180,1,0,c(.8,.5)*WH)} - ), - stroke=${3:'#0000FF'}, - stroke.width=${4:2}, - fill=${5:'none'} - )${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! -ptR<-list( - x=tribble( - ~points, - matrix(NA,2,0) - ) -) -svgR(wh=WH, - path( - d=list( - M=c(.5,.2)*WH, - A=c(.3*WH, 180,1,0,c(.8,.5)*WH) - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -*********************** -****************** -POPUP -``` -Sample Quadratic Bezier -``` -SNIPPET -``` -path( - d=list( - ${1:M=c(.2,.2)*WH,} - Q=${2:c( c(.5,1.5),c(.8,.2))*WH} - ), - stroke=${3:'#000FF'}, - stroke.width=${4:1}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! -ptR<-list( - x=tribble( - ~points, - matrix(NA,2,0) - ) -) -svgR(wh=WH, - path( - d=list( - M=c(.2,.2)*WH, - Q=c( c(.5,1.5)*WH,c(.8,.2)*WH) - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -*********************** -****************** -POPUP -``` -Sample Extended Quadratic Bezier -``` -SNIPPET -``` -path( - d=list( - ${1:M=c(.3,.1)*WH,} - Q=${2:c( c(1,.7),c(.5,.7))*WH}, - T=${3:c(.7,.1)*WH} - ), - stroke=${4:'#0000FF'}, - stroke.width=${5:1}, - fill=${6:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! -ptR<-list( - x=tribble( - ~points, - matrix(NA,2,0) - ) -) -svgR(wh=WH, - path( - d=list( - M=c(.3,.1)*WH, - Q=c( c(1,.7),c(.5,.7))*WH, - T=c(.7,.1)*WH - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -*********************** - -POPUP -``` -Sample Cubic Bezier -``` -SNIPPET -``` -path( - d=list( - ${1:M=c(.2,.9)*WH,} - C=${2:c( c(.3,-1),c(.7,2), c(.8,.2))*WH} - ), - stroke=${3:'#0000FF'}, - stroke.width=${4:1}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - path( - d=list( - M=c(.2,.9)*WH, - C=c( c(.3,-1),c(.7,2), c(.8,.2))*WH - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* -*********************** - -POPUP -``` -Sample Extended Cubic Bezier -``` -SNIPPET -``` -path( - d=list( - M=c(.2,.6)*WH, - C=c( c(.4,.0),c(.4,.8), c(.5,.8))*WH, - S=c( c(.6,.0),c(.8,.6))*WH - ), - stroke=${3:'#0000FF'}, - stroke.width=${4:1}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - path( - d=list( - M=c(.2,.6)*WH, - C=c( c(.4,.0),c(.4,.8), c(.5,.8))*WH, - S=c( c(.6,.0),c(.8,.6))*WH - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - - diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/circularArc.R b/inst/App/sampleProjects/shinyQuibitCtrl/circularArc.R deleted file mode 100644 index 87da31a3..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/circularArc.R +++ /dev/null @@ -1,36 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -# Defined by mouse: edit with care! -ptR<-list( - x= tribble( - ~points, - matrix(0,2,0) - ) -) - - -pieShape<-function(cxy, R=min(cxy), theta1=0, theta2=2*pi){ - P0=c(cos(theta1),-sin(theta1))*R+cxy - P1=c(cos(theta2),-sin(theta2))*R+cxy - largeArc=ifelse( (theta2-theta1)>pi, 1,0) - sf=0 - d=list( - M=P0, - A=c( c(R,R), 0, largeArc, sf, P1) - ) -} - -R=100 - -svgR(wh=WH, - #your custom code goes here - circle(cxy=WH/2, R=R, fill='lightblue') , - path( - d=pieShape(cxy=WH/2,R=R, 0, 3*pi/4), - stroke='#0000FF', - stroke.width=20, - fill='none' - ) -) diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/pieShape.R b/inst/App/sampleProjects/shinyQuibitCtrl/pieShape.R deleted file mode 100644 index f7b6afb9..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/pieShape.R +++ /dev/null @@ -1,36 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,600) - -# Defined by mouse: edit with care! -ptR<-list( - x= tribble( - ~points, - matrix( c(c(69,71)), 2), - matrix(0,2,0) - ) -) - - -pieShape<-function(cxy, R=min(cxy), theta1=0, theta2=2*pi){ - P0=c(cos(theta1),-sin(theta1))*R+cxy - P1=c(cos(theta2),-sin(theta2))*R+cxy - largeArc=ifelse( (theta2-theta1)>pi, 1,0) - sf=0 - d=list( - M=cxy, - L=P0, - A=c( c(R,R), 0, largeArc, sf, P1), - Z=0 - ) -} - -svgR(wh=WH, - #your custom code goes here - path( - d=pieShape(cxy=WH/2,R=100, 0, 3*pi/2), - stroke='#0000FF', - stroke.width=2, - fill='lightblue' - ) -) diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/pieShape2.R b/inst/App/sampleProjects/shinyQuibitCtrl/pieShape2.R deleted file mode 100644 index dc2cb521..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/pieShape2.R +++ /dev/null @@ -1,38 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -# Defined by mouse: edit with care! -ptR<-list( - x= tribble( - ~points, - matrix(0,2,0) - ) -) - -pieShape2<-function(cxy, R=min(cxy), thetas=c(0,2*pi), dR=30){ - thetas=sort(thetas%%(2*pi)) - RI=R-dR - P=t(matrix(c( cos(thetas), -sin(thetas)),2)) - PP=P*RI + cxy - P= P*R +cxy - largeArc=ifelse(diff(thetas)>pi,1,0) - sf=0 - d=list( - M=P[,1], - A=c( c(R,R), 0, largeArc, sf, P[,2]), - L=PP[,2], - A=c( c(RI,RI), 0, largeArc, 1-sf, PP[,1]), - Z=0 - ) -} - -svgR(wh=WH, - #your custom code goes here - path( - d=pieShape2(cxy=WH/2,R=100, thetas=c(0, 5*pi/4)), - stroke='#0000FF', - stroke.width=2, - fill='lightblue' - ) -) diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/shinyInput.pprj b/inst/App/sampleProjects/shinyQuibitCtrl/shinyInput.pprj deleted file mode 100644 index ccd1344d..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/shinyInput.pprj +++ /dev/null @@ -1,22 +0,0 @@ -{ - "pathToProj": [ - "/home/sup/AA/shinyInput" - ], - "projName": [ - "shinyInput.pprj" - ], - "projType": [ - [ - [ - [ - [ - [ - "generic" - ] - ] - ] - ] - ] - ] -} - diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/shinyInputCntrl.R b/inst/App/sampleProjects/shinyQuibitCtrl/shinyInputCntrl.R deleted file mode 100644 index c502b160..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/shinyInputCntrl.R +++ /dev/null @@ -1,104 +0,0 @@ -library(shiny) -library(svgR) -library(jsonlite) - -try({ removeInputHandler("shinyInputCntrlBinding") }) - -#helper functions - -Normalize<-function(Z){ - S2<-sum(Mod(Z)^2) - if(S2>0){ - Z<-Z/sqrt(S2) - } - Z -} - -# use toJSON for non-trivial initialization -ZtoJSON<-function(Z){ - toJSON(data.frame(re=Re(Z),im=Im(Z))) -} - -# wrapper around svgR code -shinyInputSvgCntrl<-function(params){ - source('shinyInput_svg.R', local=T)$value -} - -# return svg given params -newShinyInputCntrl<-function(ID, WH, CMDS, Z){ - svg<-shinyInputSvgCntrl( - params=list(ID=ID, WH=WH, CMDS=CMDS, Z=Z ) - ) - tmp<-HTML(as.character(svg)) - return(tmp) -} - -# definition of what to call for the given mouse events -id2CMDS<-function(inputId){ - c( - sprintf('shinyInputCntrlBinding.clicked("%s", %d, evt);',inputId, 0 ), - sprintf('shinyInputCntrlBinding.clicked("%s", %d, evt);',inputId, 1 ) - ) -} - -# Cntrl constructor to insert in app ui -shinyInputCntrl<-function(inputId, wh=c(50,100), Z=c(1+0i, 1+1i) ){ - Z<-Normalize(Z) - #CMDS<-paste0("alert('qubit |", c(0,1), "> selected')") - CMDS=id2CMDS(inputId) - - tagList( - singleton(tags$head(tags$script(src = "shinyInput.js"))), - div( id=inputId, - class="shinyInputCntrl", - # customize for initializationby attaching property(s) to this div - 'data-Z'=ZtoJSON(Z), - newShinyInputCntrl(ID=inputId, WH=wh, CMDS=CMDS, Z=Z) - ) - ) -} - -# server to client update -updateShinyInputCntrl<-function(session, inputId, wh=c(200,400), Z=NULL){ - # validate input - if(length(Z)!=2){ - cat('bad dim') - return(NULL) - } - - # normalize first - Z<-Normalize(Z) - # CMDS<-paste0("alert('qubit |", c(0,1), "> selected')") - CMDS=id2CMDS(inputId) - #recreate the entire svg - node<-as.character(newShinyInputCntrl(ID=inputId, WH=wh, CMDS=CMDS, Z=Z)) - mssg<-list(value=node, Z=ZtoJSON(Z)) - session$sendInputMessage(inputId, mssg) -} - - -# preprocess data returned to server from the client -shiny::registerInputHandler( - "shinyInputCntrlBinding", - function(value, shinysession, inputId) { - if(is.null(value) ) { - return("NULL") - } else { - ZDF<-fromJSON(value$Z) - print(ZDF) - if(nrow(ZDF)<2){ - return(NULL) - } - Z=complex(nrow(ZDF), ZDF$re, ZDF$im) - Index=1+value$Index - L<-1-sum(Mod(Z[ Index])^2) - LL<- sum(Mod(Z[-Index])^2) - Z[-Index]<-sqrt(L/LL)*Z[-Index] - print("ZZ") - print(Z) - updateShinyInputCntrl(shinysession, inputId, wh=c(200,400), Z=Z) - return(Z) - } - } -) - diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/shinyInput_svg.R b/inst/App/sampleProjects/shinyQuibitCtrl/shinyInput_svg.R deleted file mode 100644 index b85815db..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/shinyInput_svg.R +++ /dev/null @@ -1,69 +0,0 @@ -library(svgR) -library(tidyverse) - -#-------- params ---------------------- -#` default params -WH<-c(400,800) -CMDS<-paste0("alert('|", c(0,1), "> selected')") -Z<-c( 0+1i, 1-0i) -L<-sqrt(sum(Mod(Z)^2)) -Z<-Z/L -ID<-'myQubitbit' - -#----------function override of params---------- -if(exists("params") ){ - for(n in names(params)){ - assign(n, params[[n]]) - } -} - -#-----any R helper code goes here-------------------------- - - -pieShape<-function(cxy, R=1, thetas=c(0, 2*pi)){ - thetas<-sort(thetas%%(2*pi)) - P<-t(matrix( c(cos(thetas), -sin(thetas)),2)) - P<-P*R+cxy - largeArc=0 - sf=ifelse( diff(thetas)>=pi, 1,0) - d=list( - M=cxy, - L=P[,1], - A=c( c(R,R), 0, largeArc, sf, P[,2]), - Z=0 - ) -} - -stroke.width=10/WH[1] - - -cmplx % - - - - - - diff --git a/inst/App/sampleProjects/shinyQuibitCtrl/www/shinyInput.js b/inst/App/sampleProjects/shinyQuibitCtrl/www/shinyInput.js deleted file mode 100644 index 7d4fa9c2..00000000 --- a/inst/App/sampleProjects/shinyQuibitCtrl/www/shinyInput.js +++ /dev/null @@ -1,78 +0,0 @@ -// JAVASCRIPT - -//INPUT BINDING -var shinyInputCntrlBinding = new Shiny.InputBinding(); -$.extend(shinyInputCntrlBinding, { - find: function(scope) { - console.log('find'); - return $(scope).find(".shinyInputCntrl"); - }, - initialize: function(el){ - // Initialize any data values here - // here we initial Z and the current Index - let iniZ=$(el).attr(`data-Z`); //extract attribute - $(el).data("Z", JSON.parse(iniZ)); //convert to an object and attach - $(el).data('Index',0); // set index - }, - getValue: function(el) { - // used to return the value of this input control - // here we Z and which index was changed - return { - Z: JSON.stringify($(el).data('Z')), - Index: $(el).data('Index') - }; - }, - setValue: function(el, index, value) { - // used for updating input control - let Z=$(el).data("Z"); - $(el).index=index; - Z[index]={ - re:value[0], - im:value[1] - } - $(el).data('Z',Z); - $(el).data('Index',index); - $(el).trigger("change"); - }, - subscribe: function(el, callback) { - // notify server whenever change - $(el).on("change.shinyInputCntrlBinding", function(e) { - callback(); - }); - }, - unsubscribe: function(el) { - $(el).off(".shinyInputCntrlBinding"); - }, - receiveMessage: function(el, data) { //called by server when updating - if(!!data.value){ - var htm=data.value; //htm is string represented a node - var node=jQuery.parseHTML( htm ); - $(el).empty().append(node); - - $(el).data("Z", data.Z); - // alternatively, set value but be careful about index - } - }, - mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id ); - thisSVG=document.querySelector("svg#" + id ); - var pt= thisSVG.createSVGPoint(); - pt.x = x; - pt.y = y; - return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); - }, - clicked: function(ctrlId, index, evt){ - let svgId=ctrlId + index; - let pt = this.mouse2pt(svgId, evt.clientX, evt.clientY); - let el = "#" + ctrlId; - let value =[pt.x, - pt.y] ; - this.setValue(el, index, value); - }, - getType: function(el){ - return "shinyInputCntrlBinding"; - } -}); - -// REGISTER INPUT BINDING -Shiny.inputBindings.register(shinyInputCntrlBinding); - diff --git a/inst/App/sampleProjects/zSortingShapes1/.workspace/PTR-TABID308f3cc5ee2a.rda b/inst/App/sampleProjects/zSortingShapes1/.workspace/PTR-TABID308f3cc5ee2a.rda deleted file mode 100644 index 641b6faecf75360381118fc0a63a8de1e7269120..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1103 zcmV-V1hD%biwFP!000001C>_WZrer>rDHpRSu}9r#J!*o3%G$Pn6fF#7ZtG3rj3R8 zB`_?t?(1qf5*OhOyDLjfk+$#si+*9gpzUx;S|np9F#&=*b7sz5_Qu~#!!TBj)rTv_ z>N*aM^>nkZ3Mt^OVGv7jQg z>yvE$f>j?*&D9dZRE2`B?XgMe@ap(H#a$_FB82t@Jm zH~^c>B<4vd@gYb+kjX4!ipLQWsF--5K!iL3GWR+2iOfpK00EH)VjrzW{!EfLZJ8HL z7>x*>Qj9dl$c)9<5H5Z2$T%gEqm-hPCn&~@JRHP{&Pl{`X_{uDE>GL&pe&P+MV~04 z)6Aso`9mjQ=i>p)i8YQ+*FNs%6g|6h*lAEy)7Tjd&dwaCN#Qy@ zyLYT9zRxInAI@Sh=yuLm0VOtTz6`$GH1wzxQ46N!`?w`JtIlm)cLmg8@!l%R$XfIiUnRkjN!u?Rjuo?U=~J|#2=3- zd!1dYwQ`qQbcjWv-CSyYV6SiH&zuVG)%-WKM*8u*JaM$bThzt0MoPB7dbpT}2m5RqiGgB;^{)6?!VcyFvj}0ez7ONJPvo=oD)CZPfriu1tIlVztG* VU4`{{co-GZQW6p$uv}WisOY#$vCnUw a-Z3_@%ws1{E?c?Mt&`!`X6}DBKqCNGHyPOg diff --git a/inst/App/sampleProjects/zSortingShapes1/zSortShapes1.R b/inst/App/sampleProjects/zSortingShapes1/zSortShapes1.R deleted file mode 100644 index 12e8944d..00000000 --- a/inst/App/sampleProjects/zSortingShapes1/zSortShapes1.R +++ /dev/null @@ -1,35 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -# We place all items in the same tibble, using a helper function -# to determine which shape to render. -# Thus z-sorting can again be accomplished by simply -# drag and drop the rows - - -ptR<-list( - x= tribble( - ~shape, ~fill, ~points, - 'ellipse', 'red', matrix( c(c(173,122),c(275,172)), 2), - 'rect', '#001EFF', matrix( c(c(113,63),c(278,141)), 2), - 'ellipse', '#FFEE00', matrix( c(c(208,86),c(298,148)), 2), - 'rect', '#00FF33', matrix( c(c(222,145),c(342,222)), 2) - ) -) - - -ffn %ypORnD_Skdt3PBB-dKk3=O<^U8)pa4j-PMa-F|z!OPpN_d{gNp zudcsw{p7&zVL$R{{N$<^a>0T@Z-^rrx2p8!DFE)LMzTjYHWvwAW-b2dF^6M5ZN!&@ z)25kGf|2PZuy9$eAio7`&q6({PL;P9q+=G>$`#a1?orN*wrb zLa@WBD;|LX91ui3k3}&BauXc~2ou5t3j<3U1jsEW34z##SjaHIs&r0R9C>)!qi+Cq zoMv%3kl#4Z2Xh!wff_hQ@zi%hFK((Z0K;iOD2HsY>xP`bnq;PdqFmBppu15sF^Uo4 zc%Y0B9!4naBM$Mxr%;tXV`WOt0(`DEGMm!MbJ}M?GL3!+%kmwfFbm0?yAblXW+YCZ zZg?yf4HK#9+ed<{m6HtlTr*;!{JHKk&&%oS$<#{K*2yps148|EDP3PXI6CS++foGb zG1#0mklSz@TXxsl>a?3p3$>a#_^Ll-K6QBl_Sj%39B)J=se@a49jmof!G`YmHDO_j zU2EB$!|qOvZg;HCZUyV}i_sXfs}y_GmO0&KExlW7uO*pK2;fb&8{2}niJHhN zL(^S!1D*200G~`#3p9Gf=q29KOP|U0fWlTlI zTBtt?TzOzMpj49rZT^xg%Ln>-W8$&kVsi*?_aht&YB$!`)-6Vw&0O`@#F<)#%8|c( z#&HmPaMHf#MMT%RmjspFDt=h0y;Yb+O7FOTEUFXvM8NRVTkboB%MT59VLW6)ze-iT zzw7E{i-{P z0n;Aikk6a+5~DudO_DJ=VaMuR=Wu`JDFx9MzRaIn=|KSv#AH>>WNO~q$q}u z{mPGVK&T;1MVMWH`9=@cR z^oxpAk|$UUQ}Kg}7zfb8v-w=D2>p=c+sQ4)-{2Uo06pqab=YkRc_Q^g?w?Jge3Gj= zS^{5IWRW-wy;m>`Sqc?7{DL}$<2q{qs}*rjARkmjaIXQ=sqpI?ZhI5#noE4;EkV%=G zmJH~wOnH$mn^YX#q+%2%6LMNIaMR=^hF=AFfd{Od_d~^r)xSEDe`suyfMiY495XT~ z2c^$t;(2L{Vpnj?aRhuvcc`Nx@2BaMy~m8cG;yDJeMzf@a(Ov-F<}CwM?h j@vW8w%+VIUByvl|{7@GqJ4;Cos(zX%YYc1a$4- diff --git a/inst/App/sampleProjects/zSortingShapes2/.workspace/currentTab.rda b/inst/App/sampleProjects/zSortingShapes2/.workspace/currentTab.rda deleted file mode 100644 index 3bb82fc09c70834fd48e2fd570a726de3501a560..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73 zcmb2|=3oE==I#ec2?+^l32DhG32CfGk`d0%cS>{{co-GZQW6p$uv}7NRCL^>*ylG- Z?--j{rrI$vP0wd585E8B4p{?D000ZW7AXJ# diff --git a/inst/App/sampleProjects/zSortingShapes2/aux/preprocAts/displayseq.R b/inst/App/sampleProjects/zSortingShapes2/aux/preprocAts/displayseq.R deleted file mode 100644 index db0a6240..00000000 --- a/inst/App/sampleProjects/zSortingShapes2/aux/preprocAts/displayseq.R +++ /dev/null @@ -1,40 +0,0 @@ -preprocPts<-list( - onNewRow = function( pt, context, WH, keys){ - - - - # template for value precprossing on row change - - value<-getAttrValue() # current value - - # apply your value manipulations here - value<-paste0(sample(letters, 8, replace=TRUE), collapse="") - tib<-context$tibs[['displayseq']] - row<-getLastRow(tib) - row$id<-value - tib<-appendLastRow(tib,row) - context$tibs[['displayseq']]<-tib - tibs<-setAttrValue(value=value, context=context ) - tibs # always return tibs - - - - }, - onChangeRow = function( pt, context, WH, keys){ - - - - # template for value precprossing on row change - - value<-getAttrValue() # pt contains coordinates derived from the mouse click - - - tibs<-setAttrValue(value=value, context=context ) - - - tibs # always return tibs - - - - } -) diff --git a/inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.R b/inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.R deleted file mode 100644 index 04e77c36..00000000 --- a/inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.R +++ /dev/null @@ -1,63 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(600,400) - -# We use 2 tibbles to contain the shapes together with an id -# The id generated by the onNewRow preprocessor applied -# to both rect$id and ellipse$id. In addition, the -# onNewRow preprocessor adds that id to the displaySeq -# In the svg these shapes are set (as symbols) and -# rendered according to the ordering on displaySeq - -# Thus drag and drop of row of displaySeq sets the -# the z-ordering - -# Defined by mouse: edit with care! -ptR<-list( - rect= tribble( - ~id, ~fill, ~xy, - 'dhntgdem', '#AEE8B1', matrix( c(c(108,164)), 2), - 'zfhimecr', 'lightblue', matrix( c(c(296,21)), 2), - 'ocwjdior', '#206C85', matrix( c(c(165,192)), 2), - 'lbbpkvjd', '#B929CC', matrix( c(c(146,67)), 2), - 'mrkuwaiz', '#E4AEE8', matrix( c(c(266,302)), 2), - 'eiifapod', '#E8E1AE', matrix( c(c(506,53)), 2) - ), - ellipse= tribble( - ~id, ~fill, ~cxy, - 'viyfiqbw', 'red', matrix( c(c(362,72)), 2), - 'asduepwi', 'blue', matrix( c(c(65,149)), 2), - 'nokwucfm', 'blue', matrix( c(c(474,203)), 2), - 'zlitdkjw', '#00FF73', matrix( c(c(474,287)), 2) - ), - displayseq= tribble( - ~id, ~points, - 'zfhimecr', matrix(0,2,0), - 'lbbpkvjd', matrix(0,2,0), - 'asduepwi', matrix(0,2,0), - 'zlitdkjw', matrix(0,2,0), - 'mrkuwaiz', matrix(0,2,0), - 'viyfiqbw', matrix(0,2,0), - 'ocwjdior', matrix(0,2,0), - 'dhntgdem', matrix(0,2,0), - 'nokwucfm', matrix(0,2,0), - 'eiifapod', matrix(0,2,0) - ) -) - - -svgR(wh=WH, - - # sets shapes to referenced (but not rendered here) - pmap(ptR$rect, compose(symbol,rect), wh=c(100,100) ) , - pmap(ptR$ellipse, compose(symbol,ellipse), rxy=c(100,50),fill=rrgb()), - - # renders the referenced shapes in the tib displaySeq - pmap( - ptR$displayseq, function(id,points){ - use(xlink.href=paste0('#',id)) - } - ) -) - - diff --git a/inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.pprj b/inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.pprj deleted file mode 100644 index f9fc59e4..00000000 --- a/inst/App/sampleProjects/zSortingShapes2/zSortingShapes2.pprj +++ /dev/null @@ -1,12 +0,0 @@ -{ - "pathToProj": [ - "~/A0Samples/zSortingShapes2" - ], - "projName": [ - "zSortingShapes2.pprj" - ], - "projType": [ - "generic" - ] -} - From 3e718568a4840267fdeb2c688d69680ce67d72a5 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 6 May 2020 10:27:00 -0400 Subject: [PATCH 053/263] Remove sampleProjects from pointR --- inst/App/global.R | 1 - inst/App/leftPanel/menu/UIProjectSampleMenu.R | 9 -- inst/App/leftPanel/menu/serverEditBar.R | 10 +- inst/App/leftPanel/pproj/pprojModalSample.R | 103 ------------------ inst/App/server.R | 1 - inst/App/util/loadTemplates.R | 8 +- 6 files changed, 9 insertions(+), 123 deletions(-) delete mode 100644 inst/App/leftPanel/menu/UIProjectSampleMenu.R delete mode 100644 inst/App/leftPanel/pproj/pprojModalSample.R diff --git a/inst/App/global.R b/inst/App/global.R index cb695bbd..d377daf8 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -88,7 +88,6 @@ source('util/pointRLogoSVG.R') source("fileIO/genShinyFilesOpenButtons.R") source("fileIO/genShinyFilesSaveButtons.R") source("leftPanel/menu/UIProjectTemplateMenu.R") -source("leftPanel/menu/UIProjectSampleMenu.R") source("leftPanel/menu/UIbuildLeftMenu.R") source("leftPanel/mid/UIcontextMenu.R") diff --git a/inst/App/leftPanel/menu/UIProjectSampleMenu.R b/inst/App/leftPanel/menu/UIProjectSampleMenu.R deleted file mode 100644 index 66cbc861..00000000 --- a/inst/App/leftPanel/menu/UIProjectSampleMenu.R +++ /dev/null @@ -1,9 +0,0 @@ - -UIProjectSampleMenu<-function(){ - projTemplateNames<-dir(filePath(ptRPath, "App","sampleProjects")) - - tmp<-lapply(projTemplateNames, function(prjname){ - shinyDMDMenu::menuItem(prjname, value=paste0('projectSample-',prjname)) - }) - do.call(tagList, tmp) -} \ No newline at end of file diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index 9dbf6755..43054e03 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -47,11 +47,11 @@ observeEvent( input$editNavBar, { showModal(newProjShinyCntrlModal(projTemplateName=templateName)) dirtyDMDM(session, "editNavBar") } - if(grepl("projectSample-",fileCmd)){ - projectName<- str_split(fileCmd,'-')[[1]][2] - showModal(sampleProjModal(projectName=projectName)) - dirtyDMDM(session, "editNavBar") - } + # if(grepl("projectSample-",fileCmd)){ + # projectName<- str_split(fileCmd,'-')[[1]][2] + # showModal(sampleProjModal(projectName=projectName)) + # dirtyDMDM(session, "editNavBar") + # } if(fileCmd=="openProject"){ #-----open dirtyDMDM(session, "editNavBar") cmdFileOpenProject() diff --git a/inst/App/leftPanel/pproj/pprojModalSample.R b/inst/App/leftPanel/pproj/pprojModalSample.R deleted file mode 100644 index cdd28616..00000000 --- a/inst/App/leftPanel/pproj/pprojModalSample.R +++ /dev/null @@ -1,103 +0,0 @@ -# ---beging code to inserted in ptR------------------------------- -sampleProjModal <- function(failed = 0, mssg=NULL, datapath=NULL, projectName=NULL) { - - shinyDirChoose(input, id='browseForDir', roots=c(home='~')) - observeEvent(input$browseForDir,{ - datapath<-parseDirPath(c(home='~'), input$browseForDir) - if(length(datapath)==0 || nchar(datapath)==0 ){ - datapath='~' - } else{ - updateTextInput(session,inputId = "parentProjDirectoryName", value=datapath) - } - }) - modalDialog( - h2('Import a new sample project'), - if(failed==1){ - h4(mssg) - }, - div( - h2(paste("Project Name:", projectName)) - ), - #span('Create the project as a subdirectory of:)'), - if(failed==2){ - h4(mssg) - }, - div( style="visibility:hidden", - textInput(inputId="modalProjName", "Project Name", - value = projectName - ) - ) , - div( style="display:inline-block", - textInput(inputId="parentProjDirectoryName", label="Path to project:", - value=datapath, - placeholder = 'The parent directory for this pointR project' - )), - div( style="display:inline-block", - shinyDirButton(id= 'browseForDir', label="browse", title='Browse...', FALSE) - ), - footer = tagList( - modalButton("Cancel"), - actionButton("modalSampleProjOk", "OK") - ) - ) -} - - - -observeEvent(input$modalSampleProjOk, { - # Check that data object exists and is data frame. - - projectName<-input$modalProjName - if(!is.null(projectName)){ - projectName<-str_trim(projectName) - if(nchar(projectName)==0){projectName<-NULL } - } - datapath<-input$parentProjDirectoryName - if(!is.null(datapath)){ - datapath<-str_trim(datapath) - if(nchar(datapath)==0){datapath<-NULL } - } - pathToProjParent<-datapath - pathToProj<-file.path(datapath,projectName) - - if (is.null(projectName) ) { - mssg='Please specify the project name' - showModal(sampleProjModal(failed = 1, mssg=mssg, datapath=datapath, projectName = projectName)) - } else if (is.null(datapath) ) { - mssg='Please specify the project path' - showModal(sampleProjModal(failed = 1, mssg=mssg, datapath=datapath, projectName = projectName)) - } else if(file.access(datapath, mode=0)< 0){ - mssg<- paste('This path specified below does not exist. Please specify a different project path') - showModal(sampleProjModal(failed = 2, mssg=mssg, datapath=datapath, projectName= projectName)) - } else if( file.access(datapath, mode=2)<0 ){ - mssg<- paste('This path specified below is not writable. Please specify a different project path') - showModal(sampleProjModal(failed = 2, mssg=mssg, datapath=datapath, projectName= projectName)) - } else if( file.access(pathToProj, mode=0)==0 ){ - mssg<- paste('Cannot create',pathToProj,'. That dir already exists. Please specify a different project path') - showModal(sampleProjModal(failed = 2, mssg=mssg, datapath=datapath, projectName= projectName)) - } else { - # try to add file and workspace, if not writable , return fail - - projSourcePath<- projSamplesPaths[projectName] - projectName.pprj<-dir(projSourcePath,pattern=".pprj$") - - # 0. close current project - closeCurrentProj() - - # 1. copy project - dir_copy( projSourcePath, pathToProjParent) - - # 2. open copied project - fullpathProjName<-file.path(pathToProjParent, projectName, projectName.pprj) - ptRproj<-read_json(fullpathProjName, simplifyVector = TRUE) - pprj(ptRproj) - - # 3. setup - setUpProj(projName=projectName.pprj, pathToProj=pathToProj, projType='other') - - #invoke startup - requestStartUp() - removeModal() - - } -}) diff --git a/inst/App/server.R b/inst/App/server.R index c5cbed45..b361908d 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -147,7 +147,6 @@ shinyServer(function(input, output,session) { source("leftPanel/pproj/pprojOpen.R", local=TRUE) source("leftPanel/pproj/pprojClose.R", local=TRUE) source("leftPanel/pproj/pprojModalNew.R", local=TRUE) - source("leftPanel/pproj/pprojModalSample.R", local=TRUE) source("leftPanel/menu/cmdFileExportSvg.R", local=TRUE) source("leftPanel/menu/cmdOptionsTheme.R", local=TRUE) diff --git a/inst/App/util/loadTemplates.R b/inst/App/util/loadTemplates.R index ccd6261b..df77ed2f 100644 --- a/inst/App/util/loadTemplates.R +++ b/inst/App/util/loadTemplates.R @@ -16,9 +16,9 @@ projTemplatesPaths<-sapply( projTemplateNames, function(x){ filePath(ptRPath, "App","projectTemplates", x ) }) -projSamplesNames<-dir(filePath(ptRPath, "App","sampleProjects")) -projSamplesPaths<-sapply( projSamplesNames, function(x){ - filePath(ptRPath, "App","sampleProjects", x ) -}) +# projSamplesNames<-dir(filePath(ptRPath, "App","sampleProjects")) +# projSamplesPaths<-sapply( projSamplesNames, function(x){ +# filePath(ptRPath, "App","sampleProjects", x ) +# }) \ No newline at end of file From 0ee95018c9d10065965cf3911102d844be1124b6 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 6 May 2020 10:48:40 -0400 Subject: [PATCH 054/263] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index cc6910c7..e9dc8a5b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ - Provides independent windows for help - Provides an integrated approach for building **shiny custom inputs** -- ***Videos on pointR*** can be found at http://mslegrand.github.io/pointRmedia/. - ***Related information*** can be found at http://mslegrand.github.io/svgR/. - ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki From 8c15b4d1e8b2a5f951ba052aec1f99648a171abe Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 6 May 2020 10:50:18 -0400 Subject: [PATCH 055/263] Update README.md put installation first --- README.md | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e9dc8a5b..96be94cd 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,3 @@ -## pointR and ptR - -- **pointR** is an R package providing a *shiny-based* minimalist IDE for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning. -- **ptR** is an **Electron** wrapper around **pointR**. -- Using **Electron** - - Removes potential hiccups by removing and dependency on the local browser - - Provides independent windows for help - - Provides an integrated approach for building **shiny custom inputs** - -- ***Related information*** can be found at http://mslegrand.github.io/svgR/. -- ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki - -## Some Points on pointR -- pointR is a shiny server application -- pointR uses the ACE editor for coding -- pointR is intended to ease the writing of R scripts using svgR. -- pointR is an attempt to bridge the gap between coding and point&click. -- svgR bridges the gap between R and SVG - -## Some Points on ptR -- ptR is an Electron wrapper around pointR -- ptR is javascript (since Electron is) -- Electron is required for full functionality (such as building shiny input controls) - ## User Installation @@ -50,6 +26,32 @@ We strongly recommend installing **ptR** from one of the installations packages Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. +## pointR and ptR + +- **pointR** is an R package providing a *shiny-based* minimalist IDE for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning. +- **ptR** is an **Electron** wrapper around **pointR**. +- Using **Electron** + - Removes potential hiccups by removing and dependency on the local browser + - Provides independent windows for help + - Provides an integrated approach for building **shiny custom inputs** + +- ***Related information*** can be found at http://mslegrand.github.io/svgR/. +- ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki + +## Some Points on pointR +- pointR is a shiny server application +- pointR uses the ACE editor for coding +- pointR is intended to ease the writing of R scripts using svgR. +- pointR is an attempt to bridge the gap between coding and point&click. +- svgR bridges the gap between R and SVG + +## Some Points on ptR +- ptR is an Electron wrapper around pointR +- ptR is javascript (since Electron is) +- Electron is required for full functionality (such as building shiny input controls) + + + ## Building from Source 0. This can be painful. From a8633c4bb80ff74beb7a5239c31bb3275f5bf271 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 6 May 2020 13:52:55 -0400 Subject: [PATCH 056/263] replace NA by 0 --- .../shinyInputControl/aux/dnds/sampleShapes.dnds | 6 +++--- inst/App/templates/sampleShapes.dnds | 6 +++--- inst/App/templates/samples.dnds | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds index 0034e180..c85c7c3e 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds @@ -344,7 +344,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, @@ -385,7 +385,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, @@ -427,7 +427,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, diff --git a/inst/App/templates/sampleShapes.dnds b/inst/App/templates/sampleShapes.dnds index 0b43e6a1..248fbc19 100644 --- a/inst/App/templates/sampleShapes.dnds +++ b/inst/App/templates/sampleShapes.dnds @@ -344,7 +344,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, @@ -385,7 +385,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, @@ -427,7 +427,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, diff --git a/inst/App/templates/samples.dnds b/inst/App/templates/samples.dnds index f71b9f9c..cee4fe96 100644 --- a/inst/App/templates/samples.dnds +++ b/inst/App/templates/samples.dnds @@ -37,7 +37,7 @@ WH<-c(48,32) ptR<-list( x=tribble( ~points, - matrix(NA,2,0) + matrix(0,2,0) ) ) svgR(wh=WH, From 5eff94e213f3da234671832c2b9ddf874ee1c322 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 6 May 2020 13:53:55 -0400 Subject: [PATCH 057/263] bug fix: [[x,y]] => [[y]][[x]] --- inst/App/util/format.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/App/util/format.R b/inst/App/util/format.R index c7f2922f..c97f101d 100644 --- a/inst/App/util/format.R +++ b/inst/App/util/format.R @@ -116,7 +116,8 @@ fmtTibble<-function(tib, tibName, is.mat=FALSE, indent=" ", ...){ fmtMat<-function(tib, tibName, indent=" ", ...){ n=2 # indent factor of 2 tabs indentName<-paste0(rep(indent, n=n),collapse="") - m<-tib[[1,tibName]] + # m<-tib[[1,tibName]] + m<-tib[[tibName]][[1]] tmp<-paste0(indentName, tibName, "= ", toStrPtR0.matrix(m)) tmp } From 0ea53368b149ec41390bce22b83bc295f83cb3b8 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 11 May 2020 13:29:53 -0400 Subject: [PATCH 058/263] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96be94cd..6effbacc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## User Installation -We strongly recommend installing **ptR** from one of the installations packages (deb, dmg, msis) found at https://github.com/mslegrand/ptR/releases. But before installing, there are a few requirements to be successful. +We strongly recommend installing **ptR** from one of the installations packages (deb, dmg, msis) found at https://github.com/mslegrand/pointR/releases. But before installing, there are a few requirements to be successful. ### Pre-Installation From 453633a843f983204e24920e3879f48d299d1fed Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 11 May 2020 17:53:58 -0400 Subject: [PATCH 059/263] Update README.md now point to github.io --- README.md | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 6effbacc..72b2edcf 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,7 @@ -## User Installation +## Installation -We strongly recommend installing **ptR** from one of the installations packages (deb, dmg, msis) found at https://github.com/mslegrand/pointR/releases. But before installing, there are a few requirements to be successful. - -### Pre-Installation - -- If not already installed, install [R](https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu) -- Pandoc is required. This can be done by installing either i or ii - - i [pandoc](https://pandoc.org) (and placing it on your path) - - ii [RStudio](https://rstudio.com/products/rstudio/download/) (RStudio contains a copy of pandoc) -- The R package [tidyverse ](https://www.tidyverse.org) is required. This can be installed in 2 ways - - i from a terminal, open R and inside the R interpretor issue the command - **install.packages('tidyverse'**, then when finished issue command quit() and close terminal - - ii open **RSTudio** (by clicking on it's icon) and then select the *packages tab* From there click on - *install* and in the popup type tidyverse. When finished, close **RStudio**. -### Installation - -- go to https://github.com/mslegrand/ptR/releases and download the appropriate installer (dmg for mac, isis for windows and deb for most linux) -- after downlo=ading, double click on the installer and be patient. - -### Post-Instalation - -- Upon opening, ptR will look for additiona R-=packages that it requires. If some of these packages are missing, you will be prompted to either quit or let ptR install them for you. When completed, the ptR IDE will start. - - -Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio** installation. +For a full featured install go to http://mslegrand.github.io/pointR/. There you will find package installers for linux, mac and windows. ## pointR and ptR @@ -54,14 +31,14 @@ Note, **pandoc** is used for **knitr** and is normally included in the **Rstudio ## Building from Source -0. This can be painful. +0. Warning, you might find this painful. 1. [Download pointR](https://github.com/mslegrand/pointR) and build the **pointR** library 2. [Download ptR](https://github.com/mslegrand/ptR) and place in a folder (like pointR-electron/ptRMigrate) 3. cd to ptRMigrate and edit script ./build/mklib.sh to copy the ptR lib to 2 locations (for testing & production) 4. Install node.js, npm, electon 5. from terminal run **npm start** -**NOTE** I've built both on linux and mac, but not windows. +**NOTE** I've built both on linux and mac machines, but not windows. ## Reporting issues From 98d5bcfcf1cbdb440e3e1b5346c206b998fadf44 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 14 May 2020 13:47:41 -0400 Subject: [PATCH 060/263] uncommented moveByX, moveByY, it seems that these are necessary for dragging to work properly --- inst/App/www/IOjs/tagDragIO.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/www/IOjs/tagDragIO.js b/inst/App/www/IOjs/tagDragIO.js index fb0621b4..141a27b7 100644 --- a/inst/App/www/IOjs/tagDragIO.js +++ b/inst/App/www/IOjs/tagDragIO.js @@ -55,8 +55,8 @@ PtRPanelTagDrag.prototype.deselectElement = function (evt) { if(this.selectedElement !== 0){ evt.stopPropagation(); -// var movedByX = evt.clientX - this.origX; -// var movedByY = evt.clientY - this.origY; + var movedByX = evt.clientX - this.origX; + var movedByY = evt.clientY - this.origY; this.selectedElement.style.cursor="default"; this.svg.parentNode.style.cursor=="default"; var dxy=[ movedByX, movedByY]; From d424b14f2a4430f385551563b33c1ad2dff5ee7b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 14 May 2020 13:56:14 -0400 Subject: [PATCH 061/263] added gradientUnits to gradients --- inst/App/templates/fill.dnds | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inst/App/templates/fill.dnds b/inst/App/templates/fill.dnds index fa55b32e..baddd304 100644 --- a/inst/App/templates/fill.dnds +++ b/inst/App/templates/fill.dnds @@ -25,7 +25,8 @@ SNIPPET linearGradient( xy1=${1:c(0,0)}, xy2=${2:c(0,1)}, - colors=${0:c('#00AAAA', '#00000')} + colors=${3:c('#00AAAA', '#00000')}, + gradientUnits=${0:"objectBoundingBox"} ) ``` SVGR @@ -58,9 +59,10 @@ Radial Gradient SNIPPET ``` radialGradient( - cxy=c(.5,.7)*.5, - fxy=c(1,1)*.5, - colors=${0:c('#FFFFFF', '#00AAAA')} + cxy=${1:c(.5,.7)*.5}, + fxy=${2:c(1,1)*.5}, + colors=${3:c('#FFFFFF', '#00AAAA')}, + gradientUnits=${0:"objectBoundingBox"} ) ``` SVGR From a1c1dd6ddf3485a15a0245e8f8e1fd4bbd2ba58b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 16 May 2020 19:51:04 -0400 Subject: [PATCH 062/263] added reference to RStudio shinh and to electron --- inst/App/leftPanel/menu/cmdAbout.R | 1 + 1 file changed, 1 insertion(+) diff --git a/inst/App/leftPanel/menu/cmdAbout.R b/inst/App/leftPanel/menu/cmdAbout.R index 31d13fb0..dc8c091f 100644 --- a/inst/App/leftPanel/menu/cmdAbout.R +++ b/inst/App/leftPanel/menu/cmdAbout.R @@ -12,6 +12,7 @@ modalAbout <- function(..., size = "m" ) { div( width="100%", p(paste( "The purpose of this application is to provide an open-flexible tool for creating SVG using the svgR package.", + "This tool is built using the RStudio Shiny server and Electron as a wrapper", "The svgR package is an R package to for creating SVG graphics.", "SVG is short for scalar vector graphics.", "Applications include Shiny apps, Rdocs, or even generating a plain SVG file.")), From 4e1b6fe86482b2396e4b50d93fbbd0ba164be9c9 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 16 May 2020 19:53:35 -0400 Subject: [PATCH 063/263] replace ctrlKey with shiftKey --- inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R | 4 ++-- inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R | 2 +- inst/App/rightPanel/mouse/serverMouseCmdValue.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R b/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R index a3cabdfc..8e4071ba 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R @@ -3,7 +3,7 @@ mouseCmdFindPoint<-function(mssg){ pt<- as.numeric(unlist(mssg$vec)) } - + browser() fromColumnName<-getTibColumnName() fromCol<-getTib()[[fromColumnName]] fromColType<-extractColType( fromCol) @@ -51,7 +51,7 @@ mouseCmdFindPoint<-function(mssg){ } } - if( mssg$ctrlKey==TRUE){ #add row to rowGroupsDB + if( mssg$shiftKey==TRUE){ #add row to rowGroupsDB if( getAssetName()==toName ){ if( getTibRow()==toRow){ updateRowPicker(session, "myTibRowCntrl", toggleGroup = toRow) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R index 013d0200..e36e6730 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R @@ -57,7 +57,7 @@ mouseCmdMoveMatrix<-function(mssg){ ) pageId<-getTibTabId() - if( mssg$ctrlKey==TRUE){ + if( mssg$shiftKey==TRUE){ if(getTibRow()!=row){ updateRowPicker(session, "myTibRowCntrl", addToGroup = row, selectRow = row ) } else { diff --git a/inst/App/rightPanel/mouse/serverMouseCmdValue.R b/inst/App/rightPanel/mouse/serverMouseCmdValue.R index 24cf63df..a5a18b1b 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdValue.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdValue.R @@ -8,7 +8,7 @@ mouseCmdValue<- function(mssg){ tmp<-unlist(str_split(mssg$id,"_")) row<-as.numeric(tail(tmp,1)) - if( mssg$ctrlKey==TRUE){ #add row to rowGroupsDB + if( mssg$shiftKey==TRUE){ #add row to rowGroupsDB if(getTibRow()!=row){ updateRowPicker(session, "myTibRowCntrl", addToGroup = row, selectRow = row ) } else { From cfe56178eb5f73809d4da0f014bed01a57810eca Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sun, 17 May 2020 15:58:53 -0400 Subject: [PATCH 064/263] added updateRowPicker for max points --- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 50d837c4..a850fb50 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -22,6 +22,7 @@ mouseCmdAddPt<-function(mssg){ if(!is.na(getPointMax()) && getTibMatColMax() >= getPointMax() ){ #need to split? #split + updateRowPicker(session, "myTibRowCntrl", insertRow=rowIndex+1, selectRow=rowIndex+1) tibs<-ptDefs$tib tib<-tibs[[selection]] tib<-bind_rows(tib[1:rowIndex,], tib[rowIndex:nrow(tib),]) @@ -32,7 +33,8 @@ mouseCmdAddPt<-function(mssg){ ptDefs$tib<-tibs # since we just added a new row we must check if we need to # modify (preproc) the values in that row - + + scripts<-getPreProcOnNewRowScripts( getTibTabId(), selection) if(length(scripts)>0){ newTibs<-tibs # backup tibs, From 82031eb4f39bf2deff9c385468af872c3b7bbe3d Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 1 Jun 2020 18:56:38 -0400 Subject: [PATCH 065/263] bug fix, clean out old preprocs when updating --- inst/App/rightPanel/menu/cmdFileImportPreProc.R | 9 ++++++++- inst/App/rightPanel/preProc/modalPreprocEditor.R | 2 ++ inst/App/rightPanel/preProc/serverAuxPreproc.R | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdFileImportPreProc.R b/inst/App/rightPanel/menu/cmdFileImportPreProc.R index 38f9e66b..ed4c5c73 100644 --- a/inst/App/rightPanel/menu/cmdFileImportPreProc.R +++ b/inst/App/rightPanel/menu/cmdFileImportPreProc.R @@ -10,6 +10,11 @@ cmdPreProcAtsImport<-function(){ loadPreProc<-function(datapath, type){ extractBodyWithComments<-function(fn){ tt<-capture.output(print(fn)) + blanks1<-grepl('^ *$',tt) + blanks2<-c(blanks1[-1], FALSE) + bad<-blanks1 & blanks2 + tt<-tt[!bad] + tt<-sub('^( )( )*','',tt) #eat all indents :() tt<-paste(tt, collapse="\n") pos1<-str_locate_all(tt,'\\{')[[1]][1] if(length(pos1)==0) {stop('ill formed preproc')} @@ -18,7 +23,6 @@ loadPreProc<-function(datapath, type){ pos1<-pos1[1]+1 pos2<-pos2[length(pos2)]-1 substr(tt,pos1,pos2) - } tryCatch({ @@ -33,6 +37,9 @@ loadPreProc<-function(datapath, type){ } preProcList<-sapply(preProcList, extractBodyWithComments) + + + # remove 1st 2 spaces of each line if(type=='points'){ auxPath<-getPreProcPPAuxPath() } else { diff --git a/inst/App/rightPanel/preProc/modalPreprocEditor.R b/inst/App/rightPanel/preProc/modalPreprocEditor.R index af042bf8..f1d9e47a 100644 --- a/inst/App/rightPanel/preProc/modalPreprocEditor.R +++ b/inst/App/rightPanel/preProc/modalPreprocEditor.R @@ -71,6 +71,7 @@ observeEvent( input$modalPreprocEditorCommitOk,{ cmds<-preprocChoices[[type]] aceIds<-paste0('preProcAce-', cmds) scripts<-lapply(aceIds, function(x){input[[x]]}) + names(scripts)<-cmds if(type=='points'){ filePath<-file.path(getPreProcPPAuxPath(), preprocName) @@ -78,6 +79,7 @@ observeEvent( input$modalPreprocEditorCommitOk,{ filePath<-file.path(getPreProcPAAuxPath(), preprocName) } writeAuxPreprocPoints(filePath, scripts) + readAuxPreProcs() removeModal() diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index 3fd52b9d..5e3f1200 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -21,7 +21,13 @@ observeEvent(nrow(preProcScriptDB$attrs),{ loadAuxPreProc<-function(fullName){ extractBodyWithComments<-function(fn){ + tt<-capture.output(print(fn)) + blanks1<-grepl('^ *$',tt) + blanks2<-c(blanks1[-1], FALSE) + bad<-blanks1 & blanks2 + tt<-tt[!bad] + tt<-sub('^( )( )*','',tt) #eat all indents :() tt<-paste(tt, collapse="\n") pos1<-str_locate_all(tt,'\\{')[[1]][1] if(length(pos1)==0) {stop('ill formed preproc')} @@ -42,12 +48,14 @@ loadAuxPreProc<-function(fullName){ # todo better message } ppscripts<-lapply(preProcList, extractBodyWithComments) - scriptName=sub('\\.R$','',basename(fullName)) - tb<-tibble(scriptName=scriptName, cmd=names(preProcList), script=ppscripts) + script.Name=sub('\\.R$','',basename(fullName)) + tb<-tibble(scriptName=script.Name, cmd=names(preProcList), script=ppscripts) - if( "preprocPts"==basename(dirname(fullName))){ + if( "preprocPts"== basename(dirname(fullName))){ + preProcScriptDB$points<-filter(preProcScriptDB$points, scriptName!=script.Name) preProcScriptDB$points<-rbind(preProcScriptDB$points, tb) } else if( "preprocAts"==basename(dirname(fullName))){ + preProcScriptDB$attrs<-filter(preProcScriptDB$attrs, scriptName!=script.Name) preProcScriptDB$attrs<-rbind(preProcScriptDB$attrs, tb) } }, @@ -144,7 +152,7 @@ observeEvent(input$preProcDropDown, { writeAuxPreprocPoints<-function(filePath, scripts){ txt0<-paste(names(scripts),'= function( pt, context, WH, keys){\n',scripts,"\n}", collapse=",\n") - str_split(txt0, '\n')[[1]]->lines + unlist(str_split(txt0, '\n'))->lines paste0(" ", lines,collapse="\n")->txt1 txt<-paste0('preprocPts<-list(\n', txt1, "\n)") writeLines(txt, filePath) From 58b814d6a255e25df302f6d6056dac40ece8a012 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 2 Jun 2020 15:03:22 -0400 Subject: [PATCH 066/263] sve button now calls saveAs if file is unnamed --- inst/App/leftPanel/toolbar/cmdHToolBar.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/toolbar/cmdHToolBar.R b/inst/App/leftPanel/toolbar/cmdHToolBar.R index 00ee137f..59de3723 100644 --- a/inst/App/leftPanel/toolbar/cmdHToolBar.R +++ b/inst/App/leftPanel/toolbar/cmdHToolBar.R @@ -4,7 +4,14 @@ observeEvent( input$tbNewFile ,{ }, ignoreInit = TRUE) observeEvent( input$tbSaveFile ,{ - cmdFileSave() + tabId<-input$pages + docFilePath<-getFileDescriptor(tabId )$filePath + if(!is.null(docFilePath) && !docFilePath=='?'){ + cmdFileSave() + } else { + cmdFileSaveAs() + } + }, ignoreInit = TRUE) observeEvent( input$tbCloseFile ,{ From 4195137ea5f61650c5b24c21f9c02b6d66b806dc Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 2 Jun 2020 15:04:08 -0400 Subject: [PATCH 067/263] remove tooltip forfile paht from menu --- inst/App/rightPanel/serverOptions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/serverOptions.R b/inst/App/rightPanel/serverOptions.R index 356bdaf0..53ec63af 100644 --- a/inst/App/rightPanel/serverOptions.R +++ b/inst/App/rightPanel/serverOptions.R @@ -116,8 +116,8 @@ mkFileSubMenu<-function(subMenuLabel, prefix, fullFilePaths){ mkmenuitem<-function(label, value, hint){ shinyDMDMenu::menuItem( label=label, - value=value, - span(hint, class='tooltiptext') + value=value #, + # span(hint, class='tooltiptext') ) } items<-mapply(mkmenuitem, label=labels, value=values, hint=hints, From 3324ea32f463ad60758a55b81e071369cd166206 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 3 Jun 2020 14:32:48 -0400 Subject: [PATCH 068/263] explicitly add getDxy, context to environment for moveTo --- inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R index e36e6730..770b6c1a 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R @@ -89,6 +89,7 @@ mouseCmdMoveMatrix<-function(mssg){ matCol<-NULL getDxy<-function(){names(dxy)<-c('dx','dy'); dxy} ppenv<-list( + getDxy=getDxy, keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), WH=getSVGWH() ) @@ -103,7 +104,8 @@ mouseCmdMoveMatrix<-function(mssg){ tibs[[ctx$name]][[ctx$column ]][[ctx$row ]]<-m+dxy } else { context<-c(ctx, list(tibs=tibs)) - tibs<-eval(parse(text=txt), ppenv ) + tppenv<-c(ppenv,context) + tibs<-eval(parse(text=txt), tppenv ) validateTibLists(getPtDefs()$tib, tibs) } } From f21661ff0ce0b1eee5691dd4320270087a6cec9c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 3 Jun 2020 14:33:26 -0400 Subject: [PATCH 069/263] explicity andd getPoint, context to environment for ptMove --- inst/App/rightPanel/mouse/serverMouseCmdMovePt.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R index 49ae1f04..414fbdf5 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R @@ -27,7 +27,9 @@ mouseCmdMovePt<- function(mssg){ ptIndex=matColIndx, tibs=getPtDefs()$tib ) - ppenv<-list( + ppenv<-list( + getPoint=getPoint, + context=context, keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), WH=getSVGWH() ) From 1e52fb8ba99338d515bd55709a019f3f0cb1d87f Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 3 Jun 2020 14:49:35 -0400 Subject: [PATCH 070/263] inserted into environments movePoint, insertPoint, moveMatrix --- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 1 + inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R | 1 + inst/App/rightPanel/mouse/serverMouseCmdMovePt.R | 1 + 3 files changed, 3 insertions(+) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index a850fb50..89df0357 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -86,6 +86,7 @@ mouseCmdAddPt<-function(mssg){ ) ppenv<-list( getPoint=getPoint, + insertPoint=insertPoint, context=context, keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), WH=getSVGWH() diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R index 770b6c1a..0f9c798c 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R @@ -90,6 +90,7 @@ mouseCmdMoveMatrix<-function(mssg){ getDxy<-function(){names(dxy)<-c('dx','dy'); dxy} ppenv<-list( getDxy=getDxy, + moveMatrix=moveMatrix, keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), WH=getSVGWH() ) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R index 414fbdf5..5be7d345 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R @@ -29,6 +29,7 @@ mouseCmdMovePt<- function(mssg){ ) ppenv<-list( getPoint=getPoint, + movePoint=movePoint, context=context, keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), WH=getSVGWH() From 61fcd8b6dea2b97eb535d26cdd0ec746c1ec35ba Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 1 Jul 2020 11:39:58 -0400 Subject: [PATCH 071/263] removed stringr lib call. --- inst/App/global.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/App/global.R b/inst/App/global.R index d377daf8..1e7d2b12 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -47,10 +47,11 @@ notNull<-function(...) { sapply( - c('shiny','shinyjs', 'R.utils', 'svgR', 'shinyAce', 'rowPicker', 'stringr', 'jsonlite', 'fs', + c('shiny','shinyjs', 'R.utils', 'svgR', 'shinyAce', 'jsonlite', 'rowPicker', 'fs', 'shinyDMDMenu', 'shinyFiles', 'shinythemes', 'colourpicker', 'shinyWidgets', 'bsplus','shinyjqui', 'knitr', 'tidyverse'), library, character.only=TRUE) +# 'stringr', , in "tidyverse" #library("RColorBrewer") # options(shiny.error = recover) From fcdd8d49be34e70bdaddc76d9f23a4da8ef58b8b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 1 Jul 2020 11:41:56 -0400 Subject: [PATCH 072/263] removed log of ui variable --- inst/App/www/Acejs/ptRaceInit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/www/Acejs/ptRaceInit.js b/inst/App/www/Acejs/ptRaceInit.js index 7525159a..0519736b 100644 --- a/inst/App/www/Acejs/ptRaceInit.js +++ b/inst/App/www/Acejs/ptRaceInit.js @@ -286,7 +286,7 @@ function ptRaceInit(data){ var pos = $el.data('aceEditor').renderer.screenToTextCoordinates(event.clientX, event.clientY); console.log("pos=" + JSON.stringify(pos)); - console.log("ui =\n" + JSON.stringify(ui)); + var txt = ui.draggable.attr("data-snippet"); console.log( 'txt=' + JSON.stringify(txt) From d9ef169386ff981b6f41760437629805180f30f3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sun, 5 Jul 2020 14:47:57 -0400 Subject: [PATCH 073/263] fix home for windows under electron --- inst/App/util/configIO.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inst/App/util/configIO.R b/inst/App/util/configIO.R index acc46437..f11a7afb 100644 --- a/inst/App/util/configIO.R +++ b/inst/App/util/configIO.R @@ -14,11 +14,12 @@ # this is used to locate the user pointR options dir optionDirPath<-function(){ - dirPath<-switch(Sys.info()[['sysname']], - Windows= '%localappdata%/ptR', - Linux = '~/.ptR', - Darwin = '~/.ptR' - ) + # dirPath<-switch(Sys.info()[['sysname']], + # Windows= '%localappdata%/ptR', + # Linux = '~/.ptR', + # Darwin = '~/.ptR' + # ) + dirPath<-paste0(homeDir,'/.ptR') # alternatively, using package fs: # dirPath=path_home('.ptR') # dir_create(path_home('.ptR')) From 3b620ae65b3004749d6694540a327b676b00135a Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 5 Aug 2020 17:43:03 -0400 Subject: [PATCH 074/263] normalize files to qvoid repeats (~ vs /usr/home..) --- inst/App/rightPanel/serverOptions.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/serverOptions.R b/inst/App/rightPanel/serverOptions.R index 53ec63af..cf7e5f24 100644 --- a/inst/App/rightPanel/serverOptions.R +++ b/inst/App/rightPanel/serverOptions.R @@ -109,6 +109,7 @@ mkFileSubMenu<-function(subMenuLabel, prefix, fullFilePaths){ } if(length(files)>0){ # 4 make submenu + files<-normalizePath(files) files<-unique(files) values<-paste(prefix,files, sep="-") labels<-basename(files) @@ -116,8 +117,8 @@ mkFileSubMenu<-function(subMenuLabel, prefix, fullFilePaths){ mkmenuitem<-function(label, value, hint){ shinyDMDMenu::menuItem( label=label, - value=value #, - # span(hint, class='tooltiptext') + value=value # , + # span(hint, class='tooltiptext') ) } items<-mapply(mkmenuitem, label=labels, value=values, hint=hints, From 083a757e2aa52b514d39bc4479eb351f7ae44e86 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 19 Sep 2020 20:43:08 -0400 Subject: [PATCH 075/263] Rewrite of preproc io --- .../App/rightPanel/preProc/serverAuxPreproc.R | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index 5e3f1200..93a6138e 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -21,22 +21,30 @@ observeEvent(nrow(preProcScriptDB$attrs),{ loadAuxPreProc<-function(fullName){ extractBodyWithComments<-function(fn){ - tt<-capture.output(print(fn)) + #remove blank lines blanks1<-grepl('^ *$',tt) blanks2<-c(blanks1[-1], FALSE) - bad<-blanks1 & blanks2 + bad<-blanks1 #& blanks2 tt<-tt[!bad] - tt<-sub('^( )( )*','',tt) #eat all indents :() + #drop function beginning + begPos<-1+min(grep('\\{',tt)) + # begPos + #drop function ending + endPos<-max(grep('\\}',tt))-1 + # endPos + tt<-tt[begPos:endPos] + + #remove indents + nn<-min(unlist(gregexpr('\\S+',tt))) + + tt<-substring(tt,nn) + tt<-paste(tt, collapse="\n") - pos1<-str_locate_all(tt,'\\{')[[1]][1] - if(length(pos1)==0) {stop('ill formed preproc')} - pos2<-str_locate_all(tt,'\\}')[[1]] - if(length(pos2)==0) {stop('ill formed preproc')} - pos1<-pos1[1]+1 - pos2<-pos2[length(pos2)]-1 - substr(tt,pos1,pos2) + + tt } + tryCatch({ preProcList<-source(fullName, local=T)$value #check preProcList @@ -47,7 +55,9 @@ loadAuxPreProc<-function(fullName){ stop('ill-formed preprocessor') # todo better message } + ppscripts<-lapply(preProcList, extractBodyWithComments) + script.Name=sub('\\.R$','',basename(fullName)) tb<-tibble(scriptName=script.Name, cmd=names(preProcList), script=ppscripts) @@ -110,6 +120,7 @@ readAuxPreProcs<-function( startup=TRUE){ # clear the menus clearPreProcEditMenu('points') clearPreProcEditMenu('attrs') + for(fp in preProcFilePaths){ loadAuxPreProc(fp) } @@ -151,9 +162,9 @@ observeEvent(input$preProcDropDown, { }) writeAuxPreprocPoints<-function(filePath, scripts){ - txt0<-paste(names(scripts),'= function( pt, context, WH, keys){\n',scripts,"\n}", collapse=",\n") + txt0<-paste0(names(scripts),'= function( pt, context, WH, keys){\n',scripts,"\n}", collapse=",\n") unlist(str_split(txt0, '\n'))->lines paste0(" ", lines,collapse="\n")->txt1 - txt<-paste0('preprocPts<-list(\n', txt1, "\n)") + txt<-paste0('preprocList<-list(\n', txt1, "\n)") writeLines(txt, filePath) } From 0e06cf353d126093fee8b8c004d19bd1882ab3e7 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Sep 2020 08:49:06 -0400 Subject: [PATCH 076/263] ReactiveChartBuilder --- .../.workspace/PTR-TABID46161bf7acd.rda | Bin 0 -> 922 bytes .../.workspace/PTR-TABID46162175add.rda | Bin 0 -> 927 bytes .../.workspace/PTR-TABID4b7e614fe62f.rda | Bin 1962 -> 0 bytes .../.workspace/currentTab.rda | Bin 73 -> 72 bytes .../reactiveChartBldr/Readme.Rmd | 25 ++++++++++++++++++ .../{main.R => reactiveChartBldr.R} | 0 .../reactiveChartBldr/reactiveChartBldr.pprj | 2 +- 7 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46161bf7acd.rda create mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46162175add.rda delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID4b7e614fe62f.rda create mode 100644 inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd rename inst/App/projectTemplates/reactiveChartBldr/{main.R => reactiveChartBldr.R} (100%) diff --git a/inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46161bf7acd.rda b/inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46161bf7acd.rda new file mode 100644 index 0000000000000000000000000000000000000000..1ff7fe4066628915132dea60c3a238f301bfadce GIT binary patch literal 922 zcmV;L17-XliwFP!000001HD#TZ`(E$R+Fe*G_1&wEp3NAaOgvAz?XCwx?*V1TTnDW zkr|G=^l1PkomgBXQ6TAyUfTYa{;K|r{(^4Dlo*Rl)24nH0a`xacWyj9r1UEAJa66G z@YcL_AOCv(%h9v$ea~ClMxldq3+EM7*u>`#gVC@%di>;I|F?U0@7)bgey354c%XHv z+0_60b$=lEKM*O|FF4E9uqzXmm$lGmxm5kfMbR%Rtr28JN)^by02(Pag{KJ>>PZ@l z^GI)q5w6!!&1gnnFO;yMEALYl3M$H$oQ{X>z(|V47SuqOmBE+K?S$>;e_Q7ldvQipGf$FK+F`GF_n;r3iu@`)bK$!Wm2^Q zLMmT-iiKec3t%yHEhO0^S}UVUuz72@^J{0f-A0vm2Y+}dL12a}n8LgeASL7Z3dU3j zK9egLhAEFuztS#fW3_Q#TC-&D_<4sQcKGte3v!#3ST_<)q~aNgcnoCBL6QUnkcANr zXX`gdg64A3N)B=M+bH(8nRW{l#LTL7EpdoptlXjZ**a6 z9Fs?M3WmMmunTcORZ`PGIyBAkW-|G2J7k78Wle2F%l|)9DM1}Uif=M(sh(O~l_y+e zqp~nMw;Y{_r;{u{#HE@%9R&&LK_0{0&2=zIxPW>P_6TA%{-K0|zr w0+>7Ld%Q^TTQeHaF@`Z`3vz4y7Hdr&XQ0F+lrZu}KA~>6MBxbP{4MP^r>{ zPIuRB->5HkFJ2wnvfuQ2LL2;+{ek_p{Q|Z(PQoRjR3%cBywCIIc^}(vocvCrD7qdk zM@!N56}*jBj>ZS^<0x9%z+el{bv&E(=|{#n;w0ph zXEXokuin6!KSTn)XN}Y_jD0Hgyb5|!d+6<1+p}fXSY%c)5WeRGOF*89XDM^Auej?C z1>>369%e6KyJ6F z)QQTucyh4!%jm_Q2qZjvyk`u?={GLCX4(}IY zgnUmwYM79i(y^gjoJcLGHC}==nwk^pQ)Y$lQ}je>OmU^CWzzYA3-j+O7>a5s1v!~0 zfl{bctO?T~8DOy~7Sg3sztW-HG4!E1-WW^0mevZWNuOJ*=9M5#jB~1}Vx0 zxx#m1vP?pO=eC&ULVAXo1dq<5u8tkkzUU1M-d)fEmvzJqqhE^I0It~0YgH#-B=tFV z)_`fDDjQePYv!!XQW?fT8bvy@e1|L}-Dz7Jew-{?LYU2-MW^~=TtT$bOtE-y8_t!S1BUy)n2;S;IEbKw&wEf}{A zY;wpe?q-LRe#Fj1&3@Zqi*Udot>|w$G}G9drXn{wWM;UisO4mF{~hzVYm9`#9TVU6 zZ75!i6XUY++}1g_J2{C_d8S|DP-~x^1TWN~=Hk5e*`YHA&y1?bI~~%(C|E|Mp1-ce z#{6|FJ2Pum-ssSJ;rZ4FbN}e&5*JCFfH{y1m2E;S`q>54a z7Ho6PeT%I>vj@t|nk<<~K5bhLNMkX+2te6atsGc%VVRRj{VP*#h@CH>@-Yv>)-6y1 zVVwp44Fdrc^_6u3e-@Gfn~IjdjTRv%jkah}NvmUSHmUNx3oLH#{{tiQc_$hP005wm B&%OWv literal 0 HcmV?d00001 diff --git a/inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID4b7e614fe62f.rda b/inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID4b7e614fe62f.rda deleted file mode 100644 index 39b3fc806448c9b087590766200336a3adfb97f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1962 zcmV;b2UYkViwFP!000001MM1nZ`;OQdDy90tP7T8>xTXDgVMp0N<9-NSzuwa>tr!d zCxWfkZHHnz@lGOPl1Cg*mgJ$>KFhw=zQjJkw%;9j5=lSe#95mFB24ps@3(wB>l>?7 zD%~jESjFEfxGb%F)qh@pQYu})gFqec+jw6q-7Kx)^IosNU+-^i@9sPtJZ6vD4~Ohg zXNUw#GbMLc;CD@z2do*7qvqCDQ!wI4@0fkz5+S#JDw+ZD!p1%_ev%5CE34#2Bt;(e z@xSWzx+Oj7v!_tr2`L|69vu@OsL+%ch+q)2hzV2!gBkc<$YOAK7<;kw!V&NxNLMfh zTtL7Tw>SOrSMp6!^D#=FvX})GjPeV(n~;x2m}Kpa7_F$ zgUZ0?&QaCEaG(x-m!&*e%>-f;N2Kx;hTQl0gi+->K|Y^{PGqZlX~qB(8m0St(9Bt0jF+F$XiVIKMuUP!6S zCm{?NItP-2%lrstd<-MZlS-guRN1tw+F94!o#JI#Is~xLuC=XP)2lQby#|N^5>+C( z|Ji4MYd_Wg|6oI!SxJ(P1QD}Jd_3B(T8A$->rUn26Z=7@YN7aM-N&3)P~o&2 z5G>}j(y}{tt7=s(B~h8U-NP3)3_aiPu46;8bsJ+7{D^he@3&gd@tR{A6OT%_+p$rd zV2)M`;7n(zqN%X}T3@r>*w7IEsw%u>Q(2ia!us~QF==clhg3Lcr!t!{GouH5EF5+! zb-BdFng=tN7rJ~3r!xgKI(DN|tsTCwCKFd99@&jY8WAXPeQ({K&Z-tY*{mbSpF7_- zI~JWLK>PbTJ+UJ0&w5-)kB3^q#|+S^-Le7biH$!{pFgKIv;eg!#=wS*D5mZ^OjWLQ zh1!_vmD9|Y(SlBOSyi{3RB2Q(-5C+-R%n-2ZG$P+>R>&Y#Pch3R&`ztVkVB6xVSz% z<;qmZ2!8N20-d#t?a!SG%C@RWIxjGW6I#nzQT#+WS$2Z#S|2^B+R%Q2a&5bAwR%R+A;4S>ge@X5tJMHEZ?gNh6nmv5nBY*$W168=1J+I1@B zy|SuHqir`HtG2}WztotdRUcP16;~U{>WNw@Mg(E5>8u?<@>rxfAmWIL1`BC7U02}P zW0P$@?Iw+Z9n$WoyQ)TS_|3P7|GljY=T#==iu$uw4s})@+9~*gc_UXUnB$H#l-)A! zqj|X~tFyDnN=yIfbhL4?k*-?_SUxFNVZP0rYkF<#6n6h>eL=$5$G!JuUq-S_s}c7? z8RP0_=e(k<=xtwyq4@f7i-#}Sq$kZ=${+rH=3C0b(i=OuGI2c}o^_53uYK<-8R!1E zJ9n-K=aTBHdXEH~y^*DVWHkR>r{UH=&wy{IUakEXud9Yte6?J?Sopmo=Dof)HSLmY zo>S-}vsFuBYw=gs@F$;<#iq^bHXZnGAftOx#>+lc#a30ToOPFyL0e7N*UzAvJh{Fu$*wFKTH@`LBk#eMA~wPU)EyYL`V+aMTn0Xjk8h1iMeJpiz~ zoJjCk9sF5(w-w3F`iRM%VyskAKGMgJlAsVSxS(E$+SIw7z&AJwL%{=(E(3LF%E0kG z=O|HiA4nAWGj%#=EC(d?qA|LI#$#}qV5!NCR!#76NO5o9+-RxIp7aLsW<7B=@g|bp zNZQ&Pe6#4LPcY2Nor0_D*tf>#cG@@m&sc zu``|hD4C$@RezoegihsRFF8C_e&PN0=~#}+a#WV1vK*D=s4PciIV#IhS&qtbRF!_#5yF<@sJ1lmD7fCJ}k_>ifO8aGj=EVmDLrJ zBhod8Wd$+`dHB*Cdfq7z15VAU*iC1#{w;}PCJ&g;9F@C!G4r#Ae_bFu z+#d&F#_>r!E>Ka zvQ%s0(NW%IjmgydV~t2^kmHeyE=+g=FZ`PLc@&v0P>EP9S!6maLFhs=dWZlsr*wDm w6AC||oTPQ)e85GTH^?-{rv+-U>wi(8JAu)AuRuxW6AAzMA9f}%ProSu0L>`NH~;_u diff --git a/inst/App/projectTemplates/reactiveChartBldr/.workspace/currentTab.rda b/inst/App/projectTemplates/reactiveChartBldr/.workspace/currentTab.rda index 517a6962b529d202fa74dd23ffd6eff8932a9d3e..781bbec1996e52a131066bcb74d0ccb9ee6135c9 100644 GIT binary patch literal 72 zcmb2|=3oE==I#ec2?+^l35f|w32CfGk`d0%cS>{{co-GZSiB0DGAA}nP`E4LuI?`` YZ0u}&c!|m9BTqyaa__vfw+0#j0O+9>Z2$lO literal 73 zcmb2|=3oE==I#ec2?+^l32Dre);Op!XJ>TGUdK8?k>N-Wj}FfqhbR*T6%X?x7f)V3 as&dli>X{2Fx>wI=@G`8w^7WJr&;$TwE*i-I diff --git a/inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd b/inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd new file mode 100644 index 00000000..f62246e5 --- /dev/null +++ b/inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd @@ -0,0 +1,25 @@ +--- +title: 'Building a Reactive Chart' +author: 'author' +date: "2020-08-24" +output: html_document +--- + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +library(svgR) +``` + +# Building a Reactive Chart + +- To define position of shapes: + - add pairs of points to each tibble +- To instantiate a given shape: + - drag and drop snippet + - supply tibble corresponding to that shape +- commit to update drawing + + + + diff --git a/inst/App/projectTemplates/reactiveChartBldr/main.R b/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.R similarity index 100% rename from inst/App/projectTemplates/reactiveChartBldr/main.R rename to inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.R diff --git a/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj b/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj index 89500b9f..81d83807 100644 --- a/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj +++ b/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj @@ -1,6 +1,6 @@ { "pathToProj": [ - "/home/sup/AA/reactiveChartBldr" + "/Users/sup/Projects/pointR-shiny/pointR/inst/App/projectTemplates/reactiveChartBldr" ], "projName": [ "reactiveChartBldr.pprj" From 222bab71e430e2e66af7c1a4944f060de30b84f2 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Sep 2020 08:50:22 -0400 Subject: [PATCH 077/263] rename writeAuxPreprocPoints to write writeAuxPreprocList --- .../rightPanel/preProc/modalPreprocEditor.R | 2 +- inst/App/rightPanel/preProc/serverAuxPreproc.R | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/preProc/modalPreprocEditor.R b/inst/App/rightPanel/preProc/modalPreprocEditor.R index f1d9e47a..e90a113e 100644 --- a/inst/App/rightPanel/preProc/modalPreprocEditor.R +++ b/inst/App/rightPanel/preProc/modalPreprocEditor.R @@ -78,7 +78,7 @@ observeEvent( input$modalPreprocEditorCommitOk,{ } else { filePath<-file.path(getPreProcPAAuxPath(), preprocName) } - writeAuxPreprocPoints(filePath, scripts) + writeAuxPreprocList(filePath, scripts) readAuxPreProcs() removeModal() diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index 93a6138e..2381aa43 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -28,10 +28,22 @@ loadAuxPreProc<-function(fullName){ bad<-blanks1 #& blanks2 tt<-tt[!bad] #drop function beginning - begPos<-1+min(grep('\\{',tt)) + begPos<-min(grep('\\{',tt)) #todo handle case where { not found + if(grepl( "\\{\\s*$", tt[begPos])){ + begPos<-begPos+1 + } else { + bPos<-1+min(unlist(gregexpr('\\{',tt[begPos]))) + tt[begPos]<-substring(tt[begPos],nn) + } # begPos #drop function ending - endPos<-max(grep('\\}',tt))-1 + endPos<-max(grep('\\}',tt)) #todo handle case where } not found + if(grepl( "\\S+\\s*\\}\\s*$", tt[endPos])){ + ePos<- -1+max(unlist(gregexpr('\\}',tt[endPos]))) + tt[endPos]<-substring(tt[endPos],ePos) + } else { + endPos<-endPos-1 + } # endPos tt<-tt[begPos:endPos] @@ -161,7 +173,7 @@ observeEvent(input$preProcDropDown, { updateRadioButtons(session, "preProcChooser", choices=choices, selected=selected, ) }) -writeAuxPreprocPoints<-function(filePath, scripts){ +writeAuxPreprocList<-function(filePath, scripts){ txt0<-paste0(names(scripts),'= function( pt, context, WH, keys){\n',scripts,"\n}", collapse=",\n") unlist(str_split(txt0, '\n'))->lines paste0(" ", lines,collapse="\n")->txt1 From 72cf64bf7cee1b02c05ddfdf5bc5fdc5a73b7c50 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Sep 2020 17:57:45 -0400 Subject: [PATCH 078/263] added shinyalert for execption handling --- inst/App/global.R | 2 +- inst/App/leftPanel/pproj/pprojOpen.R | 2 +- inst/App/rightPanel/menu/cmdFileImportPreProc.R | 2 +- inst/App/rightPanel/menu/cmdNewColumn.R | 2 +- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 6 ++---- inst/App/rightPanel/preProc/preprocTrySetAttrValue.R | 8 ++++---- inst/App/rightPanel/preProc/serverAuxPreproc.R | 3 ++- inst/App/ui.R | 1 + 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/inst/App/global.R b/inst/App/global.R index 1e7d2b12..f31ece13 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -47,7 +47,7 @@ notNull<-function(...) { sapply( - c('shiny','shinyjs', 'R.utils', 'svgR', 'shinyAce', 'jsonlite', 'rowPicker', 'fs', + c('shiny','shinyjs', 'shinyalert', 'R.utils', 'svgR', 'shinyAce', 'jsonlite', 'rowPicker', 'fs', 'shinyDMDMenu', 'shinyFiles', 'shinythemes', 'colourpicker', 'shinyWidgets', 'bsplus','shinyjqui', 'knitr', 'tidyverse'), library, character.only=TRUE) diff --git a/inst/App/leftPanel/pproj/pprojOpen.R b/inst/App/leftPanel/pproj/pprojOpen.R index d8153894..2338294a 100644 --- a/inst/App/leftPanel/pproj/pprojOpen.R +++ b/inst/App/leftPanel/pproj/pprojOpen.R @@ -12,7 +12,7 @@ openProj<-function(projName, pathToProj, projType="generic"){ fullpathProjName=file.path(pathToProj, projName) if(!file.exists(fullpathProjName) ){ err<-paste0(format(fullpathProjName), " not found!" ) - alert(err) + shinyalert("open project Error",err, type="error") return(NULL) } closeCurrentProj() # this needs to complete prior to loading new proj diff --git a/inst/App/rightPanel/menu/cmdFileImportPreProc.R b/inst/App/rightPanel/menu/cmdFileImportPreProc.R index ed4c5c73..fd48dcd7 100644 --- a/inst/App/rightPanel/menu/cmdFileImportPreProc.R +++ b/inst/App/rightPanel/menu/cmdFileImportPreProc.R @@ -53,7 +53,7 @@ loadPreProc<-function(datapath, type){ error=function(e){ e<-c(e,traceback()) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("load preproc Error",err, type="error") }) } diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index f327ec98..3436881f 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -150,7 +150,7 @@ observeEvent(input$commitNewCol, { }, error=function(e){ e<-c('preproErr',e) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("preproc new column Error",err, type="error") }) } else { #not scripting # browser() diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 89df0357..626f5893 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -63,9 +63,8 @@ mouseCmdAddPt<-function(mssg){ } # all cols done successfully ptDefs$tib<-tibs # success, reset ptDefs }, error=function(e){ - e<-c('preproErr',e) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("preproc new point Error",err, type="error") }) } #end of scripts } # end of split @@ -98,9 +97,8 @@ mouseCmdAddPt<-function(mssg){ updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matColIndx+1)) } },error=function(e){ - e<-c('preproErr',e) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("preproc new point Error",err, type="error") }) } else { #no prepoc pts tib<-tibs[[selection]] diff --git a/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R b/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R index 82654f50..8e537496 100644 --- a/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R +++ b/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R @@ -38,9 +38,9 @@ preprocTrySetAttrValue<-function( cmd.Row, ptDefs, rowIndex, selection, mssg=NUL sender='applyTibEdit' updateAceExtDef(ptDefs, sender=sender, selector=list( name=context$name, rowIndex=context$row ) ) }, error=function(e){ - e<-c('preproErr',e) + e<-c('onChangeRow:',e) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("preproc value Errpr",err, type="error") }) log.fin(preprocTrySetAttrValue) } @@ -87,9 +87,9 @@ preprocTrySetAttrValueS<-function(scripts, ptDefs, rowIndex, selection){ } } }, error=function(e){ - e<-c('preproErr',e) + e<-c('preprocErr',e) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("preproc value Errpr",err, type="error") }) } \ No newline at end of file diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index 2381aa43..c888946e 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -82,9 +82,10 @@ loadAuxPreProc<-function(fullName){ } }, error=function(e){ + #e0<-paste('attn: err in prepro script',script.Name,"\n") e<-c(e,traceback()) err<-paste(unlist(e), collapse="\n", sep="\n") - alert(err) + shinyalert("preprocErr load",err, type="error") }) } diff --git a/inst/App/ui.R b/inst/App/ui.R index 098df157..b29a06e5 100755 --- a/inst/App/ui.R +++ b/inst/App/ui.R @@ -47,6 +47,7 @@ shinyUI( div( class="split-pane vertical-percent", useShinyjs(), + useShinyalert(), # extendShinyjs(script="www/menuHelper.js"), extendShinyjs(script="www/menuHelper.js", functions="triggerButtonOnEnter"), # used in cmdNewColumn.R; cmdNewAsset.R From 3a458c960579b31e1f77536ab6ab208539c023ad Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Sep 2020 18:22:06 -0400 Subject: [PATCH 079/263] bump version --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 75de5a66..f6219c2b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2019-12-30 Title: pointR -Version: 0.4.2.1 +Version: 0.4.2.3 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR @@ -20,6 +20,7 @@ Imports: shinyDMDMenu, shinyFiles, shinythemes, + shinyalert, colourpicker, shinyWidgets, bsplus, From 73a9105f785ff2be4d2e47084aadb5e9d61d5eff Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 22 Sep 2020 12:32:56 -0400 Subject: [PATCH 080/263] set keep.source=TRUE --- inst/App/rightPanel/preProc/serverAuxPreproc.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index c888946e..7d4089a5 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -22,7 +22,7 @@ observeEvent(nrow(preProcScriptDB$attrs),{ loadAuxPreProc<-function(fullName){ extractBodyWithComments<-function(fn){ tt<-capture.output(print(fn)) - #remove blank lines + # remove blank lines blanks1<-grepl('^ *$',tt) blanks2<-c(blanks1[-1], FALSE) bad<-blanks1 #& blanks2 @@ -53,19 +53,18 @@ loadAuxPreProc<-function(fullName){ tt<-substring(tt,nn) tt<-paste(tt, collapse="\n") - tt } tryCatch({ - preProcList<-source(fullName, local=T)$value + preProcList<-source(fullName, local=TRUE, keep.source=TRUE)$value #check preProcList if(is.null(preProcList) || any(match(names(preProcList), unlist(preprocChoices) , 0 )==0) ){ stop('ill-formed preprocessor') - # todo better message + # todo better error handle } ppscripts<-lapply(preProcList, extractBodyWithComments) From 0ce9a8fd441140503863416d1e080610d79e2fa7 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Sep 2020 19:55:58 -0400 Subject: [PATCH 081/263] style for footer text --- inst/App/ui.R | 3 ++- inst/App/www/customStyle.css | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inst/App/ui.R b/inst/App/ui.R index b29a06e5..0b79f0eb 100755 --- a/inst/App/ui.R +++ b/inst/App/ui.R @@ -107,8 +107,9 @@ shinyUI( actionButton("stopShinyApp", label = "Stop App", style="font-weight: 800; color: white; background-color: red; ") %>% bs_embed_tooltip(title = "Stop Shiny App") ) }, - absolutePanel( id='tribblePanel', left=180, bottom=-10, + absolutePanel( id='tribblePanel', left=180, bottom=-10, class='ptRFootertText', awesomeRadio('useTribble', NULL, choices=c('Tribble','Tibble'), + selected = "Tribble", inline = TRUE, status='success') ), diff --git a/inst/App/www/customStyle.css b/inst/App/www/customStyle.css index 0ebab940..a57df7d8 100644 --- a/inst/App/www/customStyle.css +++ b/inst/App/www/customStyle.css @@ -220,6 +220,10 @@ overflow-y: auto; color: #00ffff; width: 110px; } +.ptRFootertText { + font-size: 14px; + color: #00ffff; +} #tagValBar-entryValue .formControl.selectized { width:260px; } From c2e14f6c5770130ffc71e2098e49425f00180604 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Sep 2020 19:59:52 -0400 Subject: [PATCH 082/263] added some safety checks for getPreProcScriptName --- inst/App/rightPanel/preProc/serverPreProcDB.R | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/preProc/serverPreProcDB.R b/inst/App/rightPanel/preProc/serverPreProcDB.R index 0d9d421b..56c0a7ec 100644 --- a/inst/App/rightPanel/preProc/serverPreProcDB.R +++ b/inst/App/rightPanel/preProc/serverPreProcDB.R @@ -8,7 +8,7 @@ getPreProcScript<-reactive({ script_Name<-getPreProcScriptName( tab_Id=getTibTabId(), tib_Name=getAssetName(),column_Name= getTibColumnName() ) - if(script_Name!='none'){ + if(!is.null(script_Name) && script_Name!='none'){ if(getColumnType()=='point'){ tb<-filter(preProcScriptDB$points, scriptName==script_Name) } else { @@ -78,8 +78,13 @@ setPreProcScriptName<-function(tab_Id, tib_Name, column_Name, script_Name){ } getPreProcScriptName<-function(tab_Id, tib_Name, column_Name){ + if(any(sapply(c(tab_Id, tib_Name, column_Name), is.null)) + || tab_Id=='bogus') + { + return( "none") + } ppDB<-preProcPageDB() - ppDB<-filter(ppDB, + ppDB<-filter(ppDB, tabId==tab_Id &tibName==tib_Name & colName==column_Name ) if(nrow(ppDB)>0){ From 2ea64032e6093e7ddf769bba714dd34a17501bf5 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Sep 2020 20:00:56 -0400 Subject: [PATCH 083/263] added getScriptName --- inst/App/rightPanel/footer/serverFooterRight.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/footer/serverFooterRight.R b/inst/App/rightPanel/footer/serverFooterRight.R index afa64b3a..82212fa9 100644 --- a/inst/App/rightPanel/footer/serverFooterRight.R +++ b/inst/App/rightPanel/footer/serverFooterRight.R @@ -12,7 +12,10 @@ returnValue4ModuleRtFtr<-callModule( rtv<-getRightMidPanel(); rtv }), - hasPreProcChoices=hasPreProcChoices + hasPreProcChoices=hasPreProcChoices , + getScriptName=reactive({ + getPreProcScriptName(tab_Id=getTibTabId(), tib_Name=getAssetName(),column_Name= getTibColumnName()) + }) ) #-----------BUTTON EVENTS-------------------- @@ -218,4 +221,3 @@ observeEvent( returnValue4ModuleRtFtr$tagSetValue(),{ updateAceExtDef(newPtDefs, sender=sender ) }) - From c33170da6ead9b105156598e03d0dbbf3f36b22c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Sep 2020 20:02:41 -0400 Subject: [PATCH 084/263] adding name of current preproc script to footer --- .../App/rightPanel/footer/moduleFooterRight.R | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/inst/App/rightPanel/footer/moduleFooterRight.R b/inst/App/rightPanel/footer/moduleFooterRight.R index 8069dd9b..ce4a0cb8 100644 --- a/inst/App/rightPanel/footer/moduleFooterRight.R +++ b/inst/App/rightPanel/footer/moduleFooterRight.R @@ -7,15 +7,25 @@ moduleFooterRight<-function(input, output, session, getTibEditState, getPointMax, getPanelState, - hasPreProcChoices + hasPreProcChoices, + getScriptName ){ output$footer<-renderUI({ footerPanelState<-getPanelState() if(hasPreProcChoices()){ leftPtButtons= 50 + scriptName=getScriptName() + if(scriptName!="none"){ + scriptName=paste("Preproc:", scriptName) + } else { + scriptName="" + } + + } else { leftPtButtons= 0 + scriptName='' } if(!is.null( footerPanelState )){ @@ -32,7 +42,8 @@ moduleFooterRight<-function(input, output, session, span(span('class'="icon-circle"), span('class'="icon-fork")) %>% bs_embed_tooltip(title = "Split Select") ), status='primary' - ) + ), + span( scriptName, class='ptRFootertText', inline=TRUE) ), absolutePanel( right=90, bottom=10, width=110, absolutePanel( left=0, bottom=0, 'class'='ptR2', style="font-weight: bold; color: #00FFFF;", span('max pts/row:')), @@ -53,7 +64,8 @@ moduleFooterRight<-function(input, output, session, span(span('class'="icon-window-minimize"), span('class'="icon-clone")) %>% bs_embed_tooltip(title = "Clone Row") ), status='primary' - ) + ), + span( scriptName, class='ptRFootertText', inline=TRUE) ) ) } else if (footerPanelState=='value'){ @@ -65,8 +77,10 @@ moduleFooterRight<-function(input, output, session, span(span('class'="icon-right"), span('class'="icon-columns")) %>% bs_embed_tooltip(title = "Set Value") ), status='primary' - ) + ), + span( scriptName, class='ptRFootertText', inline=TRUE) ) + ) } else { NULL From e2c7426f3e834b6ea28cb72c91f9599f9fd23b4b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 29 Sep 2020 13:33:51 -0400 Subject: [PATCH 085/263] reinit preprocscriptDB upon project change --- inst/App/leftPanel/pproj/pprojUtil.R | 3 ++- inst/App/util/dbInitiatizers.R | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index 45206042..1416acc8 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -31,7 +31,8 @@ closeCurrentProj<-function(){ # reinit dbs resetDnippetsDB() - # preProcDB$points<-initialPreprocDB() + preProcScriptDB$points=initialPreProcScriptDB() + preProcScriptDB$attrs= initialPreProcScriptDB() fileDescDB(initialFileDescDB()) svgGridDB( initialSvgGridDB() ) useTribbleFormatDB( initialTribbleDB() ) diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index 18924749..d7a87745 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -9,9 +9,8 @@ initialFileDescDB<-function(){tibble( } -initialPreprocDB<-function(){ - points=tibble( tabId="bogus", tibName="bogus", ptColName='bogus', cmd="bogus", script='bogus')[0,] - points +initialPreProcScriptDB<-function(){ + tibble( scriptName='bogus', cmd="bogus", script='bogus')[0,] } initialPreProcPageDB<-function(){ From 019e6e9725c69fc081998d9d298387b983864b1e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 29 Sep 2020 16:18:34 -0400 Subject: [PATCH 086/263] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f6219c2b..0390a7b2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2019-12-30 Title: pointR -Version: 0.4.2.3 +Version: 0.4.3 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR From 5616ac1b133476308dc95dc3120a910e968efa94 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 30 Sep 2020 17:57:13 -0400 Subject: [PATCH 087/263] improved rowIndex handling: try to match value when changing tibs --- .../selector/serverAssetSelection.R | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index cc6930b4..34875a81 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -103,8 +103,18 @@ resetSelectedTibbleName<-function(tibs, name){ if(hasError()){ return(NULL) # never change selection when in error state } + choices<-getRightPanelChoices() # cat("resetSelectedTibbleName:: choices=", paste(choices, collapse=", "),"\n") + aName<-getAssetName() + if( !is.null(aName) && !is.null(getTibRow()) + && !is.null(tibs[[aName]]) && getTibRow()0 && selectedAsset$rowIndex>0){ + rowIndex<-min( selectedAsset$rowIndex,nrow( tib )) + } else { + rowIndex<-nrow( tib ) + } + + if(length(srchVal)==1 && !identical(aName, selectedAsset$name)){ + pos<-grep(srchVal,tib[[selectedAsset$columnName]]) + if(length(pos)>0){ + rowIndex<-tail(pos) + } + } + selectedAsset$rowIndex=rowIndex # next we try to extract a pt column for the selected tib ptIndxs<-extractPointColumnIndices(tib) @@ -159,11 +181,13 @@ resetSelectedTibbleName<-function(tibs, name){ } } } + resetRowPickeR() if( selectedAsset$name==transformTag){ selectedAsset$transformType='Translate' } - # log.fout(resetSelectedTibbleName) + + # log.fout(resetSelectedTibbleName) } @@ -198,7 +222,6 @@ updateSelected<-function( name, rowIndex, columnName, matCol, ptColName, selInd if(!is.null(selectedAsset$row) && !is.null(columnName ) && !is.null(selectedAsset$name )){ m<-getPtDefs()$tib[[ selectedAsset$name ]][[columnName]][[selectedAsset$row]] matCol<-selectedAsset$matCol - # cat('matCol=',format(matCol),'\n') if(length(m>0)){ matCol=min(matCol, ncol(m)) } else { From 40d351f3d9b40e48295a0dc7eb2dba5efce27c6e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 30 Sep 2020 20:29:07 -0400 Subject: [PATCH 088/263] added some tooltips --- inst/App/rightPanel/footer/moduleFooterRight.R | 4 ++-- inst/App/ui.R | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/App/rightPanel/footer/moduleFooterRight.R b/inst/App/rightPanel/footer/moduleFooterRight.R index ce4a0cb8..99c1270b 100644 --- a/inst/App/rightPanel/footer/moduleFooterRight.R +++ b/inst/App/rightPanel/footer/moduleFooterRight.R @@ -74,8 +74,8 @@ moduleFooterRight<-function(input, output, session, actionGroupButtons( inputIds=c(session$ns("tagSetValue" )), labels=list( - span(span('class'="icon-right"), span('class'="icon-columns")) %>% bs_embed_tooltip(title = "Set Value") - ), + span(span('class'="icon-right"), span('class'="icon-columns")) %>% bs_embed_tooltip(title = "Set Selected to Value") + ) , status='primary' ), span( scriptName, class='ptRFootertText', inline=TRUE) diff --git a/inst/App/ui.R b/inst/App/ui.R index 0b79f0eb..b6ef55b2 100755 --- a/inst/App/ui.R +++ b/inst/App/ui.R @@ -122,8 +122,8 @@ shinyUI( label = NULL, choices = c(), selected = c() - ) - ), + ) + ) , #style = "unite", icon=icon("option-vertical", lib = "glyphicon"), #icon=icon("wrench", lib = "glyphicon"), @@ -134,7 +134,7 @@ shinyUI( enter = animations$fading_entrances$fadeInLeftBig, exit = animations$fading_exits$fadeOutRightBig ) - ) + ) %>% bs_embed_tooltip(title="dnds selection tool", placement = "top") ) ), @@ -178,7 +178,7 @@ shinyUI( absolutePanel(id="logo.right", top=145, left=0, width="100%", #pointRLogoSVG()), div(img(src="ptR/pointRlogo.svg"))), # HTML(' ' )), - div(newPreProcDropDown()), + div(newPreProcDropDown())%>% bs_embed_tooltip(title="preproc selection tool", placement = "top"), uiOutput("BottomRightPanel"), uiOutput("TopRightPanel"), div( id="midRightPanels", class="cMidPanel ctop140", From 751087d8ce0c4757720e20f72408e4c8669fc2bb Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 2 Oct 2020 18:59:47 -0400 Subject: [PATCH 089/263] creates .templates as a subdir of .ptR dir --- inst/App/util/configIO.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/App/util/configIO.R b/inst/App/util/configIO.R index f11a7afb..be0f99d5 100644 --- a/inst/App/util/configIO.R +++ b/inst/App/util/configIO.R @@ -35,6 +35,10 @@ optionDirPath<-function(){ if(!file.exists(workSpaceDir)){ dir.create(workSpaceDir) } + templateDir<-file.path(dirPath,'.templates') + if(!file.exists(templateDir)){ + dir.create(templateDir) + } pth<-file.path(dirPath,'aux') #file,pa if(!file.exists(pth)){ dir.create(pth) } pth<-file.path(dirPath,'aux','dnds') From 6a369e918cb7eb2e2a3f9defeb390b8ff6cc7753 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 2 Oct 2020 19:00:38 -0400 Subject: [PATCH 090/263] place colourable as first choice for colourable cols --- inst/App/rightPanel/selector/serverWidgetHandler.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index cf5400f5..4e263211 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -23,6 +23,7 @@ type2WidgetChoices<-function(colType){ character.list= c('radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range character.list.2= c('picker','slider','radio'), #, "multiInput", 'picker', 'checkbox'), #range character.list.vec= c('picker','radio'), #, "multiInput", 'picker', 'checkbox'), #range + #percentage, percentage.list.2 integer=c('radio','picker','slider', "numeric"), #,'knob' numeric=c('radio','picker','slider', "numeric"), #,'knob' numeric.list=c('radio','picker'), #,'slider', "numeric"), #,'knob' @@ -30,7 +31,8 @@ type2WidgetChoices<-function(colType){ integer.list.2=c('slider'), numeric.list.vec=c('radio','picker'), #,'slider', "numeric"), #,'knob' integer.list.vec=c('radio','picker'), #,'slider', "numeric"), - colourable=c('radio','picker', 'colourable') , #'spectrum', 'colorSelectorInput' ), + integer.list=c('radio','picker'), + colourable=c('colourable','radio','picker' ) , #'spectrum', 'colorSelectorInput' ), other=c('radio','picker'), other.list=c('radio','picker') )[[colType]] @@ -110,7 +112,7 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, } else { # not there, or multiple rows? colType<-getColumnType() widgets<-type2WidgetChoices(colType) - chosenWidget Date: Fri, 2 Oct 2020 19:02:54 -0400 Subject: [PATCH 091/263] add to menu 'add template', 'remove template' --- .../leftPanel/menu/UIProjectTemplateMenu.R | 66 +++++++++++++++++-- inst/App/leftPanel/menu/UIbuildLeftMenu.R | 15 +++-- inst/App/leftPanel/menu/serverEditBar.R | 27 +++++++- 3 files changed, 95 insertions(+), 13 deletions(-) diff --git a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R index ff98476b..6795960b 100644 --- a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R +++ b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R @@ -1,9 +1,63 @@ UIProjectTemplateMenu<-function(){ - projTemplateNames<-dir(filePath(ptRPath, "App","projectTemplates")) - - tmp<-lapply(projTemplateNames, function(prjname){ - shinyDMDMenu::menuItem(prjname, value=paste0('projectTemplate-',prjname)) - }) + projTemplatePaths<-list.dirs( + file.path(ptRPath, "App","projectTemplates"), full.names = TRUE, recursive = FALSE + ) + userTemplatePaths<-list.dirs( + file.path(homeDir, '.ptR','.templates'), full.names = TRUE, recursive = FALSE + ) + templatePaths<-c(projTemplatePaths,userTemplatePaths) + templateNames<-basename(templatePaths) + templatePaths<-paste0('projectTemplate-',templatePaths) + tmp<-mapply(shinyDMDMenu::menuItem, templateNames, value=templatePaths,SIMPLIFY=FALSE) do.call(tagList, tmp) -} \ No newline at end of file + +} + + + +UIRemoveUserTemplate<-function(){ + userTemplatePaths<-list.dirs( + file.path(homeDir, '.ptR','.templates'), full.names = TRUE, recursive = FALSE + ) + userTemplateNames<-basename(userTemplatePaths) + userTemplatePaths<-paste0('removeTemplate-',userTemplatePaths) + tmp<-mapply(shinyDMDMenu::menuItem, userTemplateNames, value=userTemplatePaths, SIMPLIFY=FALSE) + do.call(tagList, tmp) + +} + + +updateNewProjectMenu<-function(session){ + # 1 remove menuDropdown + removeDMDM(session=session, menuBarId="editNavBar", entry='New Project') + #recreate dropdow + submenu<-menuDropdown('New Project', + shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), + shinyDMDMenu::menuItem('Clone of Existing Project', value='newCloneProject'), + shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), + UIProjectTemplateMenu() + ) + # 4 insertsubmenu + if(!is.null(submenu)){ + insertAfterDMDM( + session, menuBarId = "editNavBar", + entry="New File", submenu= submenu + ) + } +} +updateRemoveTemplateMenu<-function(session){ + # 1 remove menuDropdown + removeDMDM(session=session, menuBarId="editNavBar", entry="Remove from Template Menu") + #recreate dropdow + submenu<-menuDropdown("Remove from Template Menu", + UIRemoveUserTemplate() + ) + # 4 insertsubmenu + if(!is.null(submenu)){ + insertAfterDMDM( + session, menuBarId = "editNavBar", + entry="addTemplate", submenu= submenu + ) + } +} diff --git a/inst/App/leftPanel/menu/UIbuildLeftMenu.R b/inst/App/leftPanel/menu/UIbuildLeftMenu.R index be93bf01..d008e02f 100644 --- a/inst/App/leftPanel/menu/UIbuildLeftMenu.R +++ b/inst/App/leftPanel/menu/UIbuildLeftMenu.R @@ -27,10 +27,8 @@ buildLeftMenu<-function(version){ menuDropdown('New Project', shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), shinyDMDMenu::menuItem('Clone of Existing Project', value='newCloneProject'), - #shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), + shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), UIProjectTemplateMenu() - - ), # menuDropdown('Sample Project', UIProjectSampleMenu()), menuDropdown("Recent Projects"), @@ -62,20 +60,25 @@ buildLeftMenu<-function(version){ # shinyDMDMenu::menuItem('Delete Tibble', value='cmdDeleteTibble') # ), menuDropdown( - 'Edit', + 'Options', menuDropdown( - "Options", + "Editor", shinyDMDMenu::menuItem("Theme" ), shinyDMDMenu::menuItem("Font Size"), shinyDMDMenu::menuItem("Adjust Tabs", value="adjustTabs"), shinyDMDMenu::menuItem("Toggle White Space", value="toggleWhiteSpace"), shinyDMDMenu::menuItem(defaultOpts$tabType) ), - menuDivider(), + #menuDivider(), menuDropdown( "Import Addin", shinyDMDMenu::menuItem("Snippets", value="importSnippetFile"), shinyDMDMenu::menuItem("Drag&Drops", value='importDndSnippetsFile') + ), + menuDropdown( + "Manage Template Menu", + shinyDMDMenu::menuItem("Add Current Project to Template Menu", value="addTemplate"), + shinyDMDMenu::menuDropdown("Remove from Template Menu", UIRemoveUserTemplate()) ) ), menuDropdown( diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index 43054e03..5ced7d08 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -5,7 +5,32 @@ observeEvent( input$editNavBar, { fileCmd<-getLeftMenuCmd() if(length(fileCmd)>0){ - + if( fileCmd =="addTemplate"){ + # cat('******* addTemplate\n') + # get projectPath + source<-getProjectFullPath() + source=dirname(source) + # getProject Name + name<-basename(source) # should be same as editOption$currentProjectName) + name<-sub("\\.pprj$",'',name) + target<-file.path(homeDir, '.ptR','.templates',name) + # cat('source=',source,"\n") + # cat('target=',target,"\n") + copyDirectory(from=source, to=target, private=TRUE, recursive=TRUE) + # copy to .ptR + # update menus + updateNewProjectMenu(session) + updateRemoveTemplateMenu(session) + } + if(grepl("removeTemplate-",fileCmd)){ + target<- str_split(fileCmd,'-')[[1]][2] + # delete templatePath + # unlink(target) + dir_delete(target) + # update menus + updateNewProjectMenu(session) + updateRemoveTemplateMenu(session) + } if( fileCmd %in% c("newPtrTibScript", "newPtRMatScript", "newPtRSVGScript", "newRScript" )){ #-----new cmdFileNewPtR(fileCmd) dirtyDMDM(session, "editNavBar") From 1d4c58d932dfc722578fec1ab4d97bb1d49cfae3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 11:39:08 -0400 Subject: [PATCH 092/263] remove reactiveChartBldr project from startup menu --- .../reactiveChartBldr/reactiveChartBldr.R | 34 ------------------- .../reactiveChartBldr/reactiveChartBldr.pprj | 12 ------- 2 files changed, 46 deletions(-) delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.R delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj diff --git a/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.R b/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.R deleted file mode 100644 index e966c165..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.R +++ /dev/null @@ -1,34 +0,0 @@ -library(svgR) -library(tidyverse) -WH<-c(800,800) - -source('develObjects.R') - - -#Defined by mouse: edit with care! -ptR<-list( - source=tibble( - points = list(matrix(0,2,0)) - ), - observer=tibble( - points = list(matrix(0,2,0)) - ), - expression=tibble( - points = list(matrix(0,2,0)) - ), - arrows=tibble( - points = list(matrix(0,2,0)) - ), - block=tibble( - points = list(matrix(0,2,0)) - ) -) - -svgR(wh=WH, - NULL # your custom code goes here -) - - - - - diff --git a/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj b/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj deleted file mode 100644 index 81d83807..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/reactiveChartBldr.pprj +++ /dev/null @@ -1,12 +0,0 @@ -{ - "pathToProj": [ - "/Users/sup/Projects/pointR-shiny/pointR/inst/App/projectTemplates/reactiveChartBldr" - ], - "projName": [ - "reactiveChartBldr.pprj" - ], - "projType": [ - "generic" - ] -} - From d08c359b52bc15c5589bea7b686e3a6d97be005a Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 11:40:06 -0400 Subject: [PATCH 093/263] removing reactiveChartBldr from initial projects --- .../.workspace/PTR-TABID46161bf7acd.rda | Bin 922 -> 0 bytes .../.workspace/PTR-TABID46162175add.rda | Bin 927 -> 0 bytes .../.workspace/currentTab.rda | Bin 72 -> 0 bytes .../.workspace/loadedDnippets.rda | Bin 208 -> 0 bytes .../reactiveChartBldr/Readme.Rmd | 25 - .../aux/dnds/reactiveFlow.dnds | 166 ------ .../aux/dnds/sampleShapes.dnds | 527 ------------------ .../aux/preprocPts/snapTo50.R | 32 -- .../reactiveChartBldr/develObjects.R | 131 ----- 9 files changed, 881 deletions(-) delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46161bf7acd.rda delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46162175add.rda delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/currentTab.rda delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/.workspace/loadedDnippets.rda delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/aux/dnds/reactiveFlow.dnds delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/aux/dnds/sampleShapes.dnds delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/aux/preprocPts/snapTo50.R delete mode 100644 inst/App/projectTemplates/reactiveChartBldr/develObjects.R diff --git a/inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46161bf7acd.rda b/inst/App/projectTemplates/reactiveChartBldr/.workspace/PTR-TABID46161bf7acd.rda deleted file mode 100644 index 1ff7fe4066628915132dea60c3a238f301bfadce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 922 zcmV;L17-XliwFP!000001HD#TZ`(E$R+Fe*G_1&wEp3NAaOgvAz?XCwx?*V1TTnDW zkr|G=^l1PkomgBXQ6TAyUfTYa{;K|r{(^4Dlo*Rl)24nH0a`xacWyj9r1UEAJa66G z@YcL_AOCv(%h9v$ea~ClMxldq3+EM7*u>`#gVC@%di>;I|F?U0@7)bgey354c%XHv z+0_60b$=lEKM*O|FF4E9uqzXmm$lGmxm5kfMbR%Rtr28JN)^by02(Pag{KJ>>PZ@l z^GI)q5w6!!&1gnnFO;yMEALYl3M$H$oQ{X>z(|V47SuqOmBE+K?S$>;e_Q7ldvQipGf$FK+F`GF_n;r3iu@`)bK$!Wm2^Q zLMmT-iiKec3t%yHEhO0^S}UVUuz72@^J{0f-A0vm2Y+}dL12a}n8LgeASL7Z3dU3j zK9egLhAEFuztS#fW3_Q#TC-&D_<4sQcKGte3v!#3ST_<)q~aNgcnoCBL6QUnkcANr zXX`gdg64A3N)B=M+bH(8nRW{l#LTL7EpdoptlXjZ**a6 z9Fs?M3WmMmunTcORZ`PGIyBAkW-|G2J7k78Wle2F%l|)9DM1}Uif=M(sh(O~l_y+e zqp~nMw;Y{_r;{u{#HE@%9R&&LK_0{0&2=zIxPW>P_6TA%{-K0|zr w0+>7Ld%Q^TTQeHaF@`Z`3vz4y7Hdr&XQ0F+lrZu}KA~>6MBxbP{4MP^r>{ zPIuRB->5HkFJ2wnvfuQ2LL2;+{ek_p{Q|Z(PQoRjR3%cBywCIIc^}(vocvCrD7qdk zM@!N56}*jBj>ZS^<0x9%z+el{bv&E(=|{#n;w0ph zXEXokuin6!KSTn)XN}Y_jD0Hgyb5|!d+6<1+p}fXSY%c)5WeRGOF*89XDM^Auej?C z1>>369%e6KyJ6F z)QQTucyh4!%jm_Q2qZjvyk`u?={GLCX4(}IY zgnUmwYM79i(y^gjoJcLGHC}==nwk^pQ)Y$lQ}je>OmU^CWzzYA3-j+O7>a5s1v!~0 zfl{bctO?T~8DOy~7Sg3sztW-HG4!E1-WW^0mevZWNuOJ*=9M5#jB~1}Vx0 zxx#m1vP?pO=eC&ULVAXo1dq<5u8tkkzUU1M-d)fEmvzJqqhE^I0It~0YgH#-B=tFV z)_`fDDjQePYv!!XQW?fT8bvy@e1|L}-Dz7Jew-{?LYU2-MW^~=TtT$bOtE-y8_t!S1BUy)n2;S;IEbKw&wEf}{A zY;wpe?q-LRe#Fj1&3@Zqi*Udot>|w$G}G9drXn{wWM;UisO4mF{~hzVYm9`#9TVU6 zZ75!i6XUY++}1g_J2{C_d8S|DP-~x^1TWN~=Hk5e*`YHA&y1?bI~~%(C|E|Mp1-ce z#{6|FJ2Pum-ssSJ;rZ4FbN}e&5*JCFfH{y1m2E;S`q>54a z7Ho6PeT%I>vj@t|nk<<~K5bhLNMkX+2te6atsGc%VVRRj{VP*#h@CH>@-Yv>)-6y1 zVVwp44Fdrc^_6u3e-@Gfn~IjdjTRv%jkah}NvmUSHmUNx3oLH#{{tiQc_$hP005wm B&%OWv diff --git a/inst/App/projectTemplates/reactiveChartBldr/.workspace/currentTab.rda b/inst/App/projectTemplates/reactiveChartBldr/.workspace/currentTab.rda deleted file mode 100644 index 781bbec1996e52a131066bcb74d0ccb9ee6135c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72 zcmb2|=3oE==I#ec2?+^l35f|w32CfGk`d0%cS>{{co-GZSiB0DGAA}nP`E4LuI?`` YZ0u}&c!|m9BTqyaa__vfw+0#j0O+9>Z2$lO diff --git a/inst/App/projectTemplates/reactiveChartBldr/.workspace/loadedDnippets.rda b/inst/App/projectTemplates/reactiveChartBldr/.workspace/loadedDnippets.rda deleted file mode 100644 index e5eedcc75a47234a14abdd0191a444ffa954d603..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmV;>05AU^iwFP!000001C>up4uUWct@4SGm`FT_bgN4=;R0&n&WyCACgqd1s7p@{ z4hRd0E?jhG-t>LilTQe-h~;8+a3s$05U(r*7T=?P8_86Vrt z(n`t_j2K9)WsQ`cLdQWpZ`DsMP1Drlh(v-OBCLMtnu|QMv_}@Ae)Jg_2vgMslKKTs K{jdg-0RRBh)Lm5o diff --git a/inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd b/inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd deleted file mode 100644 index f62246e5..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/Readme.Rmd +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: 'Building a Reactive Chart' -author: 'author' -date: "2020-08-24" -output: html_document ---- - - -```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = TRUE) -library(svgR) -``` - -# Building a Reactive Chart - -- To define position of shapes: - - add pairs of points to each tibble -- To instantiate a given shape: - - drag and drop snippet - - supply tibble corresponding to that shape -- commit to update drawing - - - - diff --git a/inst/App/projectTemplates/reactiveChartBldr/aux/dnds/reactiveFlow.dnds b/inst/App/projectTemplates/reactiveChartBldr/aux/dnds/reactiveFlow.dnds deleted file mode 100644 index 7363f7bc..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/aux/dnds/reactiveFlow.dnds +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: "Dnd Snippet" -author: "Anonymous" -date: "TODAY" -output: dnd_snippet ---- - -- Individual drippets are seperate by lines consisting of three or more stars (*) -- Each drippet consists of 3 entries, with each entry having a title and a value (block) - - The title consists of a single line followed by a colon (:) - - titles are *POPUP*, *SNIPPET*, *SVGR* - - The values are blocks defined by 3 backtics *````* -- Two drippets are shown below to help you get started - - -********************* - - -POPUP -``` -Block -``` -SNIPPET -``` - pmap(ptR$${1:block}, block) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, fill='none', stroke='#00FFFF', stroke.width=2, - rect( - cxy=WH/2, - wh=WH/1.5 - - ), - text(cxy=WH/2, 'B', fill='#00FFFF') -) -``` -********************* - -POPUP -``` -reactiveSource -``` -SNIPPET -``` -pmap(ptR$${1:source}, reactiveSource) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -xy<-c(.2,.2)*WH -wwh<-c(.6,.6)*WH -m<-c('M',xy) -dz<-wwh[2]/2 -dx<-wwh[1]-dz -polyPortion<-c('l', dx,0, dz,dz, -dz,dz, -dx, 0 ) -d<-c(m, polyPortion, 'Z') - -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - g( - path(d=d), - text(cxy=WH/2, 'S') - ) -) -``` -****************** -POPUP -``` -reactiveObserver -``` -SNIPPET -``` -pmap(ptR$${1:observer}, reactiveObserver) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -xy<-c(.2,.2)*WH -wwh<-c(.6,.6)*WH -m<-c('M',xy) -dz<-wwh[2]/2 -dx<-wwh[1]-dz -polyPortion<-c('l', dx,0, dz,dz, -dz,dz, -dx, 0 ) -d<-c(m, polyPortion, 'Z') - - - m<-c('M',xy+c(dz,0)) - polyPortion<-c('l', dx,0, 0,2*dz, -dx, 0 ) - arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz)) - d<-c(m, polyPortion, arcPortion) -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - g( - path(d=d ), - text(cxy=xy+wwh/2, "O") - ) -) -``` -****************** -POPUP -``` -reactiveExpression -``` -SNIPPET -``` -pmap(ptR$${1:expression}, reactiveExpression) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -xy<-c(.2,.2)*WH -wwh<-c(.5,.6)*WH -m<-c('M',xy) -dz<-wwh[2]/2 -dx<-wwh[1]-dz -polyPortion<-c('l', dx,0, dz,dz, -dz,dz, -dx, 0 ) -d<-c(m, polyPortion, 'Z') - - - m<-c('M',xy+c(dz,0)) - polyPortion<-c('l', dx,0, dz,dz, -dz,dz, -dx, 0 ) - arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz)) - d<-c(m, polyPortion, arcPortion) - -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - g( - path(d=d ), - text(cxy=WH/2, "E") - ) -) -``` -****************** -POPUP -``` -Arrow -``` -SNIPPET -``` -pmap(ptR$${1:arrows}, arrow) -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -stroke="#00FFFF" -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - path( - d=c("M", c(.1,.7)*WH, "L", c(c(.5,.7), c(.5,.5), c(.8,.5))*WH), - fill='none', stroke=stroke, - marker.end= marker( viewBox=c(0, -1, 12, 12), refXY=c(9,5), stroke=stroke, fill=stroke, - markerWidth=4, markerHeight=4, orient="auto", - path( d=c("M", 0, 0, "L", 10, 5, "L", 0, 10, "z") ) - - ) - ) -) -``` -****************** - diff --git a/inst/App/projectTemplates/reactiveChartBldr/aux/dnds/sampleShapes.dnds b/inst/App/projectTemplates/reactiveChartBldr/aux/dnds/sampleShapes.dnds deleted file mode 100644 index c85c7c3e..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/aux/dnds/sampleShapes.dnds +++ /dev/null @@ -1,527 +0,0 @@ ---- -title: "Samples" -author: "Anonymous" -date: "TODAY" -output: dnd_snippet ---- - -- Individual drippets are seperate by lines consisting of three or more stars (*) -- Each drippet consists of 3 entries, with each entry having a title and a value (block) -- The title consists of a single line followed by a colon (:) -- titles are *Hint:*, *SNIPPET*, *SVGR* - - The values are blocks defined by 3 backtics *````* - - Two drippets are shown below to help you get started - -********************* - - -POPUP -``` -Sample Circle -``` -SNIPPET -``` -circle( - cxy=${1:WH/2}, - r=${2:WH[2]/3}, - stroke='black', - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - circle( - cxy=WH/2, - r=WH[2]/3, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - - - -POPUP -``` -Sample Ellipse -``` -SNIPPET -``` -ellipse( - cxy=${1:WH/2}, - rxy=${2:c(.4,.3)*WH}, - stroke=${3:'black'}, - fill=${4:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - ellipse( - cxy=WH/2, - rxy=c(.3,.2)*WH, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - -********************* - - - -POPUP -``` -Sample Rectangle -``` -SNIPPET -``` -rect( - xy=${1:WH/2}, - wh=${2:c(.47,.3)*WH}, - stroke='black', - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - rect( - xy=WH/2, - wh=c(.4,.2)*WH, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - - - - -POPUP -``` -Sample Centered Rectangle -``` -SNIPPET -``` -rect( - cxy=${1:WH/2}, - wh=${2:c(.47,.3)*WH}, - stroke='black', - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - rect( - cxy=WH/2, - wh=c(.4,.2)*WH, - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Line Segment -``` -SNIPPET -``` -line( - xy1=${1:c(0,0)}, - xy2=${2:WH}, - stroke=${3:'black'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line( - xy1=c(.2,0.8)*WH, - xy2=c(.8,0.2)*WH, - stroke='#00FFFF', - stroke.width=2 - ) -) -``` -********************* -********************* -POPUP -``` -Sample PolyLine (Connected Line Segments) -``` -SNIPPET -``` -polyline( - points=${1:WH*matrix(c(.25,.25,.5,.5,.75,.25),2)}, - stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - polyline( - points=WH*matrix(c(.25,.25,.5,.8,.75,.25),2), - stroke.width=2, - stroke='#00FFFF', - fill='none' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Polygon -``` -SNIPPET -``` -polygon( - points=${1:WH*matrix(c(.25,.75,.5,.5,.75,.75),2)}, - stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - polygon( - points=WH*matrix(c(.25,.75,.5,.25,.75,.75),2), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Text -``` -SNIPPET -``` -text( - ${1:'hello world'}, - xy=${2:WH/2}, - stroke=${3:'black'}, - font.size=${4:36}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - text( - 'Text', - xy=WH/2, - stroke='#00FFFF', - font.size=10, - fill='#00FFFF' - ) -) -``` -********************* -********************* -POPUP -``` -Sample Text -``` -SNIPPET -``` - text( - ${1:'hello world'}, - cxy=${2:WH/2}, - stroke=${3:'black'}, - font.size=${4:36}, - fill=${5:'none'} - )${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), - text( - 'Text', - cxy=WH/2, - stroke='#00FFFF', - font.size=10, - fill='#00FFFF' - ) -) -``` -********************* -****************** -POPUP -``` -Sample Arc -``` -SNIPPET -``` - path( - d=list( - M=${1:c(.5,.2)*WH}, - A=${2:c(2.3*WH, 180,1,0,c(.8,.5)*WH)} - ), - stroke=${3:'#0000FF'}, - stroke.width=${4:2}, - fill=${5:'none'} - )${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! -ptR<-list( - x=tribble( - ~points, - matrix(0,2,0) - ) -) -svgR(wh=WH, - path( - d=list( - M=c(.5,.2)*WH, - A=c(.3*WH, 180,1,0,c(.8,.5)*WH) - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -*********************** -****************** -POPUP -``` -Sample Quadratic Bezier -``` -SNIPPET -``` -path( - d=list( - ${1:M=c(.2,.2)*WH,} - Q=${2:c( c(.5,1.5),c(.8,.2))*WH} - ), - stroke=${3:'#000FF'}, - stroke.width=${4:1}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! -ptR<-list( - x=tribble( - ~points, - matrix(0,2,0) - ) -) -svgR(wh=WH, - path( - d=list( - M=c(.2,.2)*WH, - Q=c( c(.5,1.5)*WH,c(.8,.2)*WH) - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -*********************** -****************** -POPUP -``` -Sample Extended Quadratic Bezier -``` -SNIPPET -``` -path( - d=list( - ${1:M=c(.3,.1)*WH,} - Q=${2:c( c(1,.7),c(.5,.7))*WH}, - T=${3:c(.7,.1)*WH} - ), - stroke=${4:'#0000FF'}, - stroke.width=${5:1}, - fill=${6:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! -ptR<-list( - x=tribble( - ~points, - matrix(0,2,0) - ) -) -svgR(wh=WH, - path( - d=list( - M=c(.3,.1)*WH, - Q=c( c(1,.7),c(.5,.7))*WH, - T=c(.7,.1)*WH - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -*********************** - -POPUP -``` -Sample Cubic Bezier -``` -SNIPPET -``` -path( - d=list( - ${1:M=c(.2,.9)*WH,} - C=${2:c( c(.3,-1),c(.7,2), c(.8,.2))*WH} - ), - stroke=${3:'#0000FF'}, - stroke.width=${4:1}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - path( - d=list( - M=c(.2,.9)*WH, - C=c( c(.3,-1),c(.7,2), c(.8,.2))*WH - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* -*********************** - -POPUP -``` -Sample Extended Cubic Bezier -``` -SNIPPET -``` -path( - d=list( - M=c(.2,.6)*WH, - C=c( c(.4,.0),c(.4,.8), c(.5,.8))*WH, - S=c( c(.6,.0),c(.8,.6))*WH - ), - stroke=${3:'#0000FF'}, - stroke.width=${4:1}, - fill=${5:'none'} -)${0:} -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -svgR(wh=WH, -#your custom code goes here - path( - d=list( - M=c(.2,.6)*WH, - C=c( c(.4,.0),c(.4,.8), c(.5,.8))*WH, - S=c( c(.6,.0),c(.8,.6))*WH - ), - stroke='#00FFFF', - stroke.width=2, - fill='none' - ) -) -``` -********************* - - diff --git a/inst/App/projectTemplates/reactiveChartBldr/aux/preprocPts/snapTo50.R b/inst/App/projectTemplates/reactiveChartBldr/aux/preprocPts/snapTo50.R deleted file mode 100644 index 5728bffa..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/aux/preprocPts/snapTo50.R +++ /dev/null @@ -1,32 +0,0 @@ -preprocPts<-list( - onNewPt = function( pt, context, WH, keys){ - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse click - - # apply your point manipulations here - pt<-50*round(pt/50) - tibs<-insertPoint(pt=pt, context=context ) - tibs # always return tibs - }, - onMovePt = function( pt, context, WH, keys){ - # template for point insertion precprossing - - pt<-getPoint() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - pt<-50*round(pt/50) - tibs<-movePoint(pt=pt, context=context ) - tibs # always return tibs - }, - onMoveMat = function( pt, context, WH, keys){ - # template for point insertion precprossing - - dxy=getDxy() # pt contains coordinates derived from the mouse move - - #apply your point manipulations here - dxy<-50*round(dxy/50) - tibs<-moveMatrix(dxy=dxy, context=context ) - tibs # always return tibs - } -) diff --git a/inst/App/projectTemplates/reactiveChartBldr/develObjects.R b/inst/App/projectTemplates/reactiveChartBldr/develObjects.R deleted file mode 100644 index b2e3ffe2..00000000 --- a/inst/App/projectTemplates/reactiveChartBldr/develObjects.R +++ /dev/null @@ -1,131 +0,0 @@ -library(svgR) -library(tidyverse) - - - -block %=2 ){ - xy<-apply(points,1,min) - wh<-abs(apply(points,1,diff)) - g( - rect(xy=xy, wh=wh, fill=fill, stroke=stroke, ...), - text(stroke=stroke, cxy=xy+wh/2, label, ...) - - ) - } else{ - NULL - } -} - -reactiveSource %=2 ){ - xy<-apply(points,1,min) - wh<-abs(apply(points,1,diff)) - - m<-c('M',xy) - dz<-wh[2]/2 - dx<-wh[1]-dz - - polyPortion<-c('l', dx,0, dz,dz, -dz,dz, -dx, 0 ) - d<-c(m, polyPortion, 'Z') - g( - path(d=d, fill=fill, stroke=stroke), - text(cxy=xy+wh/2, label) - ) - } else{ - NULL - } -} - - -reactiveObserver %=2 ){ - xy<-apply(points,1,min) - wh<-abs(apply(points,1,diff)) - - dz<-wh[2]/2 - dx<-wh[1]-dz - m<-c('M',xy+c(dz,0)) - polyPortion<-c('l', dx,0, 0,2*dz, -dx, 0 ) - arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz)) - d<-c(m, polyPortion, arcPortion) - g( - path(d=d, fill=fill, stroke=stroke, ... ), - text(cxy=xy+wh/2, label) - ) - } else{ - NULL - } -} - -reactiveExpression %=2 ){ - xy<-apply(points,1,min) - wh<-abs(apply(points,1,diff)) - - - dz<-wh[2]/2 - dx<-wh[1]-2*dz - m<-c('M',xy+c(dz,0)) - polyPortion<-c('l', dx,0, dz,dz, -dz,dz, -dx, 0 ) - arcPortion<-c('a', c(dz,dz), 180, 1,1, c(0, -2*dz)) - d<-c(m, polyPortion, arcPortion) - g( - path(d=d, fill=fill, stroke=stroke, ... ), - text(cxy=xy+wh/2, label) - ) - } else{ - NULL - } -} - -arrow %=2 ){ - x<-points - nx<-length(x) - if(nx<4){ - return(NULL) - } - n<-ncol(x) - if(n==2){ - return(path(d=c("M", x[,1], "L", x[,n]), ...)) - } - - dv<-x[,-n]-x[,-1] - d<-apply( dv ,2, function(x)sqrt(sum(x)^2) ) - lambda<-sapply(r/d, function(x)min(x,.5)) - - m<- n-1 - if(m==2){ - mA<-matrix(c(lambda[1],1-lambda[1]),2,1) - mB<-matrix(c(1-lambda[2],lambda[2]),2,1) - } else { - mA<- rbind(diag(lambda[-m]),0) + rbind(0,diag(1-lambda[-m])) - mB<- rbind(0,diag(lambda[-1])) + rbind(diag(1-lambda[-1]),0) - } - a<-x[,-n]%*%mA - b<-x[,-1]%*%mB - rL<-rep("L", n-2) - rQ<-rep("Q", n-2) - if(m==2){ - rr<-c(rL,a,rQ,x[,2],b) - } else { - rr<-rbind(rL, a, rQ, x[,-c(1,n)], b) - } - path( - d=c("M", x[,1], rr, "L", x[,n]), - fill='none', stroke=stroke, - marker.end= marker( viewBox=c(0, 0, 10, 10), refXY=c(9,5), stroke=stroke, fill=stroke, - markerWidth=6, markerHeight=6, orient="auto", - path( d=c("M", 0, 0, "L", 10, 5, "L", 0, 10, "z") ) - - ), - ...) - } else{ - NULL - } -} - - - - From 2cd0c668399a8f7014107d8264a9c66ff2f79803 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 11:41:06 -0400 Subject: [PATCH 094/263] edit newProject menu --- inst/App/leftPanel/menu/UIProjectTemplateMenu.R | 4 ++-- inst/App/leftPanel/menu/UIbuildLeftMenu.R | 2 +- inst/App/leftPanel/menu/serverEditBar.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R index 6795960b..27229971 100644 --- a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R +++ b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R @@ -35,7 +35,7 @@ updateNewProjectMenu<-function(session){ submenu<-menuDropdown('New Project', shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), shinyDMDMenu::menuItem('Clone of Existing Project', value='newCloneProject'), - shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), + # shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), UIProjectTemplateMenu() ) # 4 insertsubmenu @@ -49,7 +49,7 @@ updateNewProjectMenu<-function(session){ updateRemoveTemplateMenu<-function(session){ # 1 remove menuDropdown removeDMDM(session=session, menuBarId="editNavBar", entry="Remove from Template Menu") - #recreate dropdow + #recreate dropdown submenu<-menuDropdown("Remove from Template Menu", UIRemoveUserTemplate() ) diff --git a/inst/App/leftPanel/menu/UIbuildLeftMenu.R b/inst/App/leftPanel/menu/UIbuildLeftMenu.R index d008e02f..0a236421 100644 --- a/inst/App/leftPanel/menu/UIbuildLeftMenu.R +++ b/inst/App/leftPanel/menu/UIbuildLeftMenu.R @@ -27,7 +27,7 @@ buildLeftMenu<-function(version){ menuDropdown('New Project', shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), shinyDMDMenu::menuItem('Clone of Existing Project', value='newCloneProject'), - shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), + # shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), UIProjectTemplateMenu() ), # menuDropdown('Sample Project', UIProjectSampleMenu()), diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index 5ced7d08..fbe8fbae 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -25,7 +25,7 @@ observeEvent( input$editNavBar, { if(grepl("removeTemplate-",fileCmd)){ target<- str_split(fileCmd,'-')[[1]][2] # delete templatePath - # unlink(target) + # file.remove(target,recursive=TRUE) dir_delete(target) # update menus updateNewProjectMenu(session) From 1c34adb5c8b9bb508bdef3e5f1c8cca923f628d5 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 16:39:16 -0400 Subject: [PATCH 095/263] enable/disable user templates as appropriate --- inst/App/fileIO/observeRequestStartUp.R | 12 +++++---- .../leftPanel/menu/UIProjectTemplateMenu.R | 25 ++++++++++++------- inst/App/leftPanel/menu/UIbuildLeftMenu.R | 5 ++-- inst/App/leftPanel/menu/serverEditBar.R | 12 +++------ 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/inst/App/fileIO/observeRequestStartUp.R b/inst/App/fileIO/observeRequestStartUp.R index 2ea9fd74..c938abbd 100644 --- a/inst/App/fileIO/observeRequestStartUp.R +++ b/inst/App/fileIO/observeRequestStartUp.R @@ -11,11 +11,13 @@ observeEvent(trigger$startup, { } else { } - disableDMDM( - session, - menuBarId="editNavBar", - entry="customControl" - ) + # disableDMDM( + # session, + # menuBarId="editNavBar", # can't find customControl + # entry="customControl" + # ) + updateNewProjectMenu(session) + updateRemoveTemplateMenu(session) log.fout(startup) }, priority=100) diff --git a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R index 27229971..0c0445dd 100644 --- a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R +++ b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R @@ -20,11 +20,14 @@ UIRemoveUserTemplate<-function(){ userTemplatePaths<-list.dirs( file.path(homeDir, '.ptR','.templates'), full.names = TRUE, recursive = FALSE ) - userTemplateNames<-basename(userTemplatePaths) - userTemplatePaths<-paste0('removeTemplate-',userTemplatePaths) - tmp<-mapply(shinyDMDMenu::menuItem, userTemplateNames, value=userTemplatePaths, SIMPLIFY=FALSE) - do.call(tagList, tmp) - + if(length(userTemplatePaths)==0){ + NULL + } else { + userTemplateNames<-basename(userTemplatePaths) + userTemplatePaths<-paste0('removeTemplate-',userTemplatePaths) + tmp<-mapply(shinyDMDMenu::menuItem, userTemplateNames, value=userTemplatePaths, SIMPLIFY=FALSE) + do.call(tagList, tmp) + } } @@ -48,16 +51,20 @@ updateNewProjectMenu<-function(session){ } updateRemoveTemplateMenu<-function(session){ # 1 remove menuDropdown - removeDMDM(session=session, menuBarId="editNavBar", entry="Remove from Template Menu") + removeDMDM(session=session, menuBarId="editNavBar", entry="Remove from Menu") #recreate dropdown - submenu<-menuDropdown("Remove from Template Menu", - UIRemoveUserTemplate() + templateMenuList<-UIRemoveUserTemplate() + submenu<-menuDropdown("Remove from Menu", + templateMenuList ) # 4 insertsubmenu - if(!is.null(submenu)){ + #if(!is.null(UIRemoveUserTemplate())){ insertAfterDMDM( session, menuBarId = "editNavBar", entry="addTemplate", submenu= submenu ) + #} + if(is.null(templateMenuList)){ + disableDMDM(session, menuBarId="editNavBar", entry="Remove from Menu") } } diff --git a/inst/App/leftPanel/menu/UIbuildLeftMenu.R b/inst/App/leftPanel/menu/UIbuildLeftMenu.R index 0a236421..659252f1 100644 --- a/inst/App/leftPanel/menu/UIbuildLeftMenu.R +++ b/inst/App/leftPanel/menu/UIbuildLeftMenu.R @@ -30,7 +30,6 @@ buildLeftMenu<-function(version){ # shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), UIProjectTemplateMenu() ), - # menuDropdown('Sample Project', UIProjectSampleMenu()), menuDropdown("Recent Projects"), menuDivider(), shinyDMDMenu::menuItem("Open File", value='openFile'), @@ -77,8 +76,8 @@ buildLeftMenu<-function(version){ ), menuDropdown( "Manage Template Menu", - shinyDMDMenu::menuItem("Add Current Project to Template Menu", value="addTemplate"), - shinyDMDMenu::menuDropdown("Remove from Template Menu", UIRemoveUserTemplate()) + shinyDMDMenu::menuItem("Add Current Project", value="addTemplate"), + shinyDMDMenu::menuDropdown("Remove from Menu", UIRemoveUserTemplate()) ) ), menuDropdown( diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index fbe8fbae..cf54f0cd 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -68,15 +68,10 @@ observeEvent( input$editNavBar, { dirtyDMDM(session, "editNavBar") } if(grepl("projectTemplate-",fileCmd)){ - templateName<- str_split(fileCmd,'-')[[1]][2] - showModal(newProjShinyCntrlModal(projTemplateName=templateName)) + templatePath<- str_split(fileCmd,'-')[[1]][2] + showModal(newProjShinyCntrlModal(projTemplatePath=templatePath)) dirtyDMDM(session, "editNavBar") } - # if(grepl("projectSample-",fileCmd)){ - # projectName<- str_split(fileCmd,'-')[[1]][2] - # showModal(sampleProjModal(projectName=projectName)) - # dirtyDMDM(session, "editNavBar") - # } if(fileCmd=="openProject"){ #-----open dirtyDMDM(session, "editNavBar") cmdFileOpenProject() @@ -332,13 +327,14 @@ observeEvent( editOption$currentProjectName, { if(length(editOption$currentProjectName)==0){ title='project: ' disableDMDM(session, "editNavBar", 'closeProject') + disableDMDM(session, "editNavBar", 'addTemplate') } else { title=paste0('project: ', editOption$currentProjectName) enableDMDM(session, "editNavBar", 'closeProject') + enableDMDM(session, "editNavBar", 'addTemplate') } renameDMDM(session, menuBarId="editNavBar", entry='project', newLabel=title, newValue='project') - }, ignoreNULL = FALSE) # -----------ACE EDITOR------------------------ From a2bfad38ac72bb4ba111de0712f8fe7fba5d29ce Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 16:40:07 -0400 Subject: [PATCH 096/263] rework new proj template modal --- inst/App/leftPanel/pproj/pprojModalNewCntrl.R | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/inst/App/leftPanel/pproj/pprojModalNewCntrl.R b/inst/App/leftPanel/pproj/pprojModalNewCntrl.R index b9e47d1c..2c05e574 100644 --- a/inst/App/leftPanel/pproj/pprojModalNewCntrl.R +++ b/inst/App/leftPanel/pproj/pprojModalNewCntrl.R @@ -1,8 +1,8 @@ # ---beging code to inserted in ptR------------------------------- -newProjShinyCntrlModal <- function(failed = 0, mssg=NULL, datapath=NULL, projectName=NULL, projTemplateName) { +newProjShinyCntrlModal <- function(failed = 0, mssg=NULL, datapath=NULL, projectName=NULL, projTemplatePath) { #shinyDirChoose(input, id='browseForDir', roots=c(wd='~'), filetypes='') # cat('>----> newProjShinyCntrlModal\n') - requestedProjTemplateName(projTemplateName) + requestedProjTemplatePath(projTemplatePath) shinyDirChoose(input, id='browseForDir', roots=c(home='~')) observeEvent(input$browseForDir,{ datapath<-parseDirPath(c(home='~'), input$browseForDir) @@ -15,7 +15,7 @@ newProjShinyCntrlModal <- function(failed = 0, mssg=NULL, datapath=NULL, project # cat('>----> modalDialog\n') modalDialog( h4('Create a new Project using the template '), - h2( projTemplateName), + h2( basename(projTemplatePath)), if(failed==1){ h4(mssg) }, @@ -42,13 +42,13 @@ newProjShinyCntrlModal <- function(failed = 0, mssg=NULL, datapath=NULL, project ) } -requestedProjTemplateName<-reactiveVal("") +requestedProjTemplatePath<-reactiveVal("") #to do: proj name should be restricted to letters, numbers, '.' and spaces. #to do: proj dir should be restricted to letters, numbers, '.' and spaces. observeEvent(input$modalNewShinyCntrlProjOk, { # Check that data object exists and is data frame. - templateName<-requestedProjTemplateName() + templatePath<-requestedProjTemplatePath() projectName<-input$modalProjName if(!is.null(projectName)){ projectName<-str_trim(projectName) @@ -79,7 +79,7 @@ observeEvent(input$modalNewShinyCntrlProjOk, { } if(failed!=0){ showModal(newProjShinyCntrlModal(failed = failed, mssg=mssg, datapath=datapath, - projectName = projectName, projTemplateName=templateName)) + projectName = projectName, projTemplatePath=templateName)) } else { # try to add file and workspace, if not writable , return fail @@ -91,17 +91,19 @@ observeEvent(input$modalNewShinyCntrlProjOk, { # 3 register in recent projects. # prepare to process - templateName<-requestedProjTemplateName() - templatePath<- projTemplatesPaths[templateName] # the clone path of this project. + templatePath<-requestedProjTemplatePath() + #templatePath<- templateName #projTemplatesPaths[templateName] # the clone path of this project. templateName.pprj<-dir(templatePath,pattern=".pprj$") pathToProjParent<-datapath # input$parentProjDirectoryName # parent directory of new project projName<-gsub('\\.pprj$','',projectName) # the name of of new project - projNameExt<-paste0(projName,'.pprj') + projNameExt<-paste0(projName,'.pprj') # put extension back # 0. close current project closeCurrentProj() + sourceProject<- path_join(c(templatePath, templateName.pprj)) + # 1. clone project fullpathProjName<-copyAndRenameProject( sourceProject= path_join(c(templatePath, templateName.pprj)), From a11ebe2f76567a8bda697f4d36877006319ca238 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 16:41:04 -0400 Subject: [PATCH 097/263] indexing bug fix for setting tib value --- inst/App/rightPanel/preProc/preProcSetAttr.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/preProc/preProcSetAttr.R b/inst/App/rightPanel/preProc/preProcSetAttr.R index d03d69db..a8ae4099 100644 --- a/inst/App/rightPanel/preProc/preProcSetAttr.R +++ b/inst/App/rightPanel/preProc/preProcSetAttr.R @@ -11,7 +11,7 @@ setAttrValue<-function( value, context){ tib<-tibs[[ assetName ]] rowIndex<- context$row columnIndex<-context$column - tib[[rowIndex,columnIndex]]<-value + tib[[columnIndex]][[rowIndex]]<-value tibs[[ assetName ]]<-tib } return(tibs) From 4093cd527dda2abdb579d7fad34d3ee2eb8f234b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 16:53:49 -0400 Subject: [PATCH 098/263] bug fix for values set by preproc script --- inst/App/rightPanel/menu/cmdNewColumn.R | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 3436881f..754fbb29 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -60,7 +60,6 @@ observeEvent(input$commitNewCol, { rtv<-TRUE tryCatch({ eval(parse(text=txt)) - # parse(text=txt) rtv<-FALSE }, error = function(e) {}) @@ -69,7 +68,6 @@ observeEvent(input$commitNewCol, { treatAs<-input$modalColTreatAs newVal<-input$modalAttrValue - # browser() #checks if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ # check name syntax @@ -87,15 +85,10 @@ observeEvent(input$commitNewCol, { showModal(addNewColModal( errMssg="Unable to evaluate expression") ) } else { # checks passed #add name to tib - - cat('treatAs=', format(treatAs),'\n') - cat('newVal=', format(newVal),'\n') newPtDefs<-getPtDefs() newColName<-input$modalAttrName - # browser() if(treatAs=='script'){ # apply script sequentially to newPtDefs # extract onNewRowScript - # browser() script_Name<-input$modalColPreProcScript tb<-filter(preProcScriptDB$attrs, scriptName==script_Name) scripts<-unlist(tb$script) @@ -106,9 +99,7 @@ observeEvent(input$commitNewCol, { #One strategy tryCatch({ # 1. newPtDefs<-getPtDefs() - #newPtDefs<-getPtDefs() - # browser() - + # 2. tibs<-newPtDefs$tib # 3. @@ -135,22 +126,23 @@ observeEvent(input$commitNewCol, { keys=list(altKey=FALSE, shiftKey=FALSE, ctrlKey=FALSE, metaKey=FALSE, keycode=NULL) ) for(rowIndex in 1:nrow(tib)){ - #browser() ppenv$context$row<-rowIndex ppenv$context$tibs<-tibs tibs<-eval(parse(text=txt), ppenv ) #ppenv$tibs<-tibs + } # 7. check if tibs is valid validateTibLists(getPtDefs()$tib, tibs) newPtDefs$tib<-tibs sender='cmd.add.column' - #browser() - #updateAceExtDef(newPtDefs, sender=sender, selector=list( name=newColName ) ) + #set the column to use specified script + setPreProcScriptName(tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, script_Name=script_Name) + # updateAceExtDef(newPtDefs, sender=sender, selector=list( name=newColName ) ) #NO! THIS UPDATE CAN CAUSE MESSAGING LOOP }, error=function(e){ e<-c('preproErr',e) err<-paste(unlist(e), collapse="\n", sep="\n") - shinyalert("preproc new column Error",err, type="error") + shinyalert("preproc new column Error",err, type="error") # may want to put this in a scrollable modal }) } else { #not scripting # browser() From fa469af2243441a8c6d3d525897d3455a6a5b13e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 20:42:01 -0400 Subject: [PATCH 099/263] Turnoff logger --- inst/App/util/logger.R | 63 +++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index fcae1563..1ad94ca9 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,36 +1,43 @@ +SHOW_DEBUG_LOG=FALSE + log.fin<-function(x){ - cat( - '>>>', - '------', - deparse(substitute(x)), - '------\n', - sep="" - ) + if(SHOW_DEBUG_LOG){ + cat( + '>>>', + '------', + deparse(substitute(x)), + '------\n', + sep="" + ) + } } log.fout<-function(x){ - cat( - '<<<', - '------', - deparse(substitute(x)), - '------\n', - sep="" - ) -} -log.val<-function(x){ - tryCatch( + if(SHOW_DEBUG_LOG){ cat( - ' ', + '<<<', + '------', deparse(substitute(x)), - '=', - format(x), - '\n', + '------\n', sep="" - ), - error=function(e){ - print(e) - } - - ) - + ) + } +} +log.val<-function(x){ + if(SHOW_DEBUG_LOG){ + tryCatch( + cat( + ' ', + deparse(substitute(x)), + '=', + format(x), + '\n', + sep="" + ), + error=function(e){ + print(e) + } + + ) + } } \ No newline at end of file From 5b3043c2eaddc6666cde48357f3cbd1662db302b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 20:43:20 -0400 Subject: [PATCH 100/263] commment out debug info --- inst/App/fileIO/serverFileDescriptor.R | 2 +- inst/App/rightPanel/header/moduleEdAsset.R | 2 +- inst/App/rightPanel/header/moduleEdTib.R | 20 +++++++++++++------- inst/App/rightPanel/header/serverEdTib.R | 2 +- inst/App/server.R | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/inst/App/fileIO/serverFileDescriptor.R b/inst/App/fileIO/serverFileDescriptor.R index 7c2d939f..6871e4fa 100644 --- a/inst/App/fileIO/serverFileDescriptor.R +++ b/inst/App/fileIO/serverFileDescriptor.R @@ -121,7 +121,7 @@ setFileDescSaved<-function(pageId, fileSaveStatus){ fd[fd$tabId==pageId,"isSaved"]<-fileSaveStatus fileDescDB(fd) } - cat('setFileDescSaved: pageId=',pageId,', savedStatus=',fileSaveStatus,"\n") + # cat('setFileDescSaved: pageId=',pageId,', savedStatus=',fileSaveStatus,"\n") sendFileTabsMessage(tabId=pageId, sender='savedStatus', saveStatus=fileSaveStatus) log.fout(setFileDescSaved) diff --git a/inst/App/rightPanel/header/moduleEdAsset.R b/inst/App/rightPanel/header/moduleEdAsset.R index 27c1abc0..61ec4415 100644 --- a/inst/App/rightPanel/header/moduleEdAsset.R +++ b/inst/App/rightPanel/header/moduleEdAsset.R @@ -28,7 +28,7 @@ moduleEdAsset<-function(input, output, session, output$dataSetUI<-renderUI({ if( length(nameChoices() )>0){ butts<- nameChoices() - isolate(print(butts)) + # isolate(print(butts)) radioGroupButtons(inputId=ns("name"), choices=butts, selected=name(), justified=TRUE) } diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index 51e89bad..755a0c80 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -122,13 +122,13 @@ moduleEdTib<-function(input, output, session, output$columnEntryUI<-renderUI({ if( getTibEditState()==TRUE ){ - cat("\nEntering----------output$colEntryUI---------------\n") - cat("\nInitial value of getRowIndex", format(getRowIndex()), "\n") - cat('--calling ---getWidget2----------\n') + # cat("\nEntering----------output$colEntryUI---------------\n") + # cat("\nInitial value of getRowIndex", format(getRowIndex()), "\n") + # cat('--calling ---getWidget2----------\n') widget<-getWidget() - cat("widget=",format(widget),"\n") - cat("getTibEntry()=",format(getTibEntry()),"\n") - cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") + # cat("widget=",format(widget),"\n") + # cat("getTibEntry()=",format(getTibEntry()),"\n") + # cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") if(!is.null(widget) && !is.null(getTibEntry()) && !is.null(getTibEntryChoices())){ selected<-getTibEntry() choices<-getTibEntryChoices() @@ -175,10 +175,16 @@ moduleEdTib<-function(input, output, session, ) } else if(widget=='knob'){ # cat('xxx widget=', format(widget),"\n") - cat('value is ',selected, '\n') + # cat('value is ',selected, '\n') div(knobInput( ns('entryKnob'), label = NULL, min=1, max = 100, value = as.numeric(selected), width=100, height=100 )) + } else if(widget=='immutable'){ + radioGroupButtons(inputId=ns("entryMutable"), + choices=selected, + selected=selected, + justified=TRUE + ) } } diff --git a/inst/App/rightPanel/header/serverEdTib.R b/inst/App/rightPanel/header/serverEdTib.R index f700518f..c8614351 100644 --- a/inst/App/rightPanel/header/serverEdTib.R +++ b/inst/App/rightPanel/header/serverEdTib.R @@ -48,7 +48,7 @@ observeEvent(returnValue4ModuleEdTib$selectedWidget(), { if( getTibEditState()==TRUE && !is.null( returnValue4ModuleEdTib$selectedWidget() )){ log.fin(returnValue4ModuleEdTib$selectedWidget()) selectedWidget<-returnValue4ModuleEdTib$selectedWidget() - log.val(selectedWidget) + # log.val(selectedWidget) updateWidgetChoicesRow( selectedWidget=returnValue4ModuleEdTib$selectedWidget()) log.fout(returnValue4ModuleEdTib$selectedWidget()) } diff --git a/inst/App/server.R b/inst/App/server.R index b361908d..8006d340 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -14,7 +14,7 @@ shinyServer(function(input, output,session) { # utility functions--------------- setwd(path_join(c(ptRPath,"App"))) - cat("--------------begin server-------------\ngetwd()=",getwd(),"\n") + # cat("--------------begin server-------------\ngetwd()=",getwd(),"\n") source("util/dbInitiatizers.R") source("util/format.R") From ca47be5757aa86e01987e3b9292714f3f8fa1d9a Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 20:46:52 -0400 Subject: [PATCH 101/263] add immutable widget to db --- .../rightPanel/selector/serverWidgetHandler.R | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index 4e263211..c3b72767 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -1,6 +1,4 @@ - - widgetDB<-reactiveVal( initialWidgetDB() ) @@ -13,8 +11,6 @@ removePageWidgetDB<-function(pageId){ } - - type2WidgetChoices<-function(colType){ if(!is.null(colType)){ choices<-list( @@ -51,7 +47,7 @@ getPageWidgetDB<-function(pageId ){ filter(db, tabId==pageId ) } -# called soley by getWidget +# called soley by getWidget: returns a single row from the widgetDB getRowWidgetDB<-reactive({ log.fin(getRowWidgetDB) pageId<- input$pages @@ -62,12 +58,13 @@ getRowWidgetDB<-reactive({ row<-filter(wdb, tabId==pageId & name==tibName & column==colName) if(nrow(row)!=1){ #something is messed up: not there or multiple occurances + # begin patch if(nrow(row)>1){ # remove multiple occurances wdb<-filter(wdb, !(tabId==pageId & name==tibName & column==colName)) } # and add back a default - colType<-getColumnType() - widgets<-type2WidgetChoices(colType) + colType<-getColumnType() + widgets<-getWidgetChoices() chosenWidget<-widgets[1] wdb<-add_row(wdb, tabId=pageId, name=tibName, @@ -77,7 +74,7 @@ getRowWidgetDB<-reactive({ ) widgetDB(wdb) row<-filter(wdb, tabId==pageId & name==tibName & column==colName) - } + } # end of patch log.fout(getRowWidgetDB) row } @@ -89,11 +86,12 @@ getRowWidgetDB<-reactive({ # TODO: rewrite to update just minVal or maxVal or step or selectedWidget updateWidgetChoicesRow<-function(#tibName, colName, colType, minVal=NA, maxVal=NA, step=1, selectedWidget='radio'){ # use current tib and col + + # can we really trust the following? pageId<- input$pages tibName<-getAssetName() - colName<-getTibColumnName() - # browser() + log.fin(updateWidgetChoicesRow) if(length(pageId)>0){ @@ -110,8 +108,7 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, wdb[[n]][rowNo]<-get(n) } } else { # not there, or multiple rows? - colType<-getColumnType() - widgets<-type2WidgetChoices(colType) + widgets<-getWidgetChoices() chosenWidget<-selectedWidget #kludge to avoid name clash if(!chosenWidget %in% widgets){ chosenWidget<-widgets[1] @@ -130,18 +127,22 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, getWidgetChoices<-reactive({ colType<-getColumnType() widgetChoices<-type2WidgetChoices(colType) + tabId<- getTibTabId() + tibName<-getAssetName() + colName<-getTibColumnName() + scriptName<-getPreProcScriptName(tab_Id=tabId, tib_Name=tibName, column_Name=colName) + if(getPlotState()=='value' && !is.null(scriptName) ){ + widgetChoices<- c( "immutable", widgetChoices) + } + widgetChoices }) # called by # serverEdTib init (line 33) # then moduleEdTib (lines 108, 128), bothconditon by getTibEditState()==TRUE getWidget<-reactive({ - cat('entering getWidget\n') rtv<-getRowWidgetDB()$selectedWidget - # browser() - cat('leaving getWidget\n') rtv - #return(selectedWidget) }) # getWidgetVal<-reactive({ @@ -151,7 +152,6 @@ getWidget<-reactive({ # }) getPointMax<-reactive({ - # cat('\n---Entering -getPointMax---------\n') selectedTabId<-getTibTabId() colMax<-filter(widgetDB(), @@ -160,7 +160,6 @@ getPointMax<-reactive({ column==getTibColumnName() )$maxVal - # colMax<-filter(handler$choices, tabId== getTibTabId() , name==getAssetName(), column==getTibColumnName())$maxVal if(length(colMax)==0 ){ #or length(colMax)!=1 NA } else { From 2782958a4d26f979705fa691cda36addce996a07 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 6 Oct 2020 20:47:21 -0400 Subject: [PATCH 102/263] bump version --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0390a7b2..24418cd8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2019-12-30 Title: pointR -Version: 0.4.3 +Version: 0.4.4 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR @@ -30,7 +30,7 @@ Imports: shinyjqui Suggests: testthat -RoxygenNote: 6.1.1 +RoxygenNote: 7.1.1 Remotes: mslegrand/shinyDMDMenu, mslegrand/svgR, From 4234fd8987f2b7befb011e0f4c92a6b5a04b4e77 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 7 Oct 2020 17:03:05 -0400 Subject: [PATCH 103/263] ace modified to remove the use of bold for element tags (bold causes cursor alignment issues on the mac but not on linux) --- inst/App/www/Acejs/mode-dnippets.js | 2 +- inst/App/www/Acejs/mode-javascript.js | 0 inst/App/www/Acejs/mode-ptr.js | 2 +- inst/App/www/Acejs/mode-snippets.js | 0 inst/App/www/Acejs/shinyAce.css | 0 inst/App/www/Acejs/snippets/dnippets.js | 0 inst/App/www/Acejs/snippets/ptr.js | 0 inst/App/www/Acejs/snippets/ptrrmd.js | 0 inst/App/www/Acejs/worker-ptr.js | 0 9 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 inst/App/www/Acejs/mode-dnippets.js mode change 100644 => 100755 inst/App/www/Acejs/mode-javascript.js mode change 100644 => 100755 inst/App/www/Acejs/mode-ptr.js mode change 100644 => 100755 inst/App/www/Acejs/mode-snippets.js mode change 100644 => 100755 inst/App/www/Acejs/shinyAce.css mode change 100644 => 100755 inst/App/www/Acejs/snippets/dnippets.js mode change 100644 => 100755 inst/App/www/Acejs/snippets/ptr.js mode change 100644 => 100755 inst/App/www/Acejs/snippets/ptrrmd.js mode change 100644 => 100755 inst/App/www/Acejs/worker-ptr.js diff --git a/inst/App/www/Acejs/mode-dnippets.js b/inst/App/www/Acejs/mode-dnippets.js old mode 100644 new mode 100755 index 2dc10bf9..d10bb25a --- a/inst/App/www/Acejs/mode-dnippets.js +++ b/inst/App/www/Acejs/mode-dnippets.js @@ -1 +1 @@ -ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+o+")(\\.)(prototype)(\\.)("+o+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:r},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/cstyle").CstyleBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t="[_:a-zA-Z\u00c0-\uffff][-_:.a-zA-Z0-9\u00c0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getSelectionRange().start,a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(o.column/.test(r.getLine(o.row).slice(o.column)))return;while(!u(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var c=a.getCurrentTokenRow(),h=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var p=f.value;c==o.row&&(p=p.substring(0,o.column-h));if(this.voidElements.hasOwnProperty(p.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){if(f.value=="/>")return;while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};r.start.row==r.end.row&&(l.column=r.end.column);while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,a.start.row==a.end.row&&a.start.column"},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/xml_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",f=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t,n){"use strict";var r={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e){if(typeof e[t]!="string")continue;var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});r.hasOwnProperty(n)||(r[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,r){this.completionsDefined||this.defineCompletions();var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(e==="ruleset"){var s=t.getLine(n.row).substr(0,n.column);return/:[^;]+$/.test(s)?(/([\w\-]+):[^:]*$/.test(s),this.getPropertyValueCompletions(e,t,n,r)):this.getPropertyCompletions(e,t,n,r)}return[]},this.getPropertyCompletions=function(e,t,n,i){var s=Object.keys(r);return s.map(function(e){return{caption:e,snippet:e+": $0;",meta:"property",score:Number.MAX_VALUE}})},this.getPropertyValueCompletions=function(e,t,n,i){var s=t.getLine(n.row).substr(0,n.column),o=(/([\w\-]+):[^:]*$/.exec(s)||{})[1];if(!o)return[];var u=[];return o in r&&typeof r[o]=="object"&&(u=Object.keys(r[o])),u.map(function(e){return{caption:e,snippet:e,meta:"property value",score:Number.MAX_VALUE}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.$completer=new a,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules((new o({jsx:!1})).getRules(),"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}function c(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"attribute-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:{manifest:1},head:{},title:{},base:{href:1,target:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},noscript:{href:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},section:{},nav:{},article:{pubdate:1},aside:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},header:{},footer:{},address:{},main:{},p:{},hr:{},pre:{},blockquote:{cite:1},ol:{start:1,reversed:1},ul:{},li:{value:1},dl:{},dt:{},dd:{},figure:{},figcaption:{},div:{},a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},em:{},strong:{},small:{},s:{},cite:{},q:{cite:1},dfn:{},abbr:{},data:{},time:{datetime:1},code:{},"var":{},samp:{},kbd:{},sub:{},sup:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{},bdo:{},span:{},br:{},wbr:{},ins:{cite:1,datetime:1},del:{cite:1,datetime:1},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},embed:{src:1,height:1,width:1,type:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},param:{name:1,value:1},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},source:{src:1,type:1,media:1},track:{kind:1,src:1,srclang:1,label:1,"default":1},canvas:{width:1,height:1},map:{name:1},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},svg:{},math:{},table:{summary:1},caption:{},colgroup:{span:1},col:{span:1},tbody:{},thead:{},tfoot:{},tr:{},td:{headers:1,rowspan:1,colspan:1},th:{headers:1,rowspan:1,colspan:1,scope:1},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},fieldset:{disabled:1,form:1,name:1},legend:{},label:{form:1,"for":1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},datalist:{},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},output:{"for":1,form:1,name:1},progress:{value:1,max:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},details:{open:1},summary:{},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},menu:{type:1,label:1},dialog:{open:1}},a=Object.keys(u),h=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open"))return this.getTagCompletions(e,t,n,r);if(f(i,"tag-whitespace")||f(i,"attribute-name"))return this.getAttributeCompletions(e,t,n,r);if(f(i,"attribute-value"))return this.getAttributeValueCompletions(e,t,n,r);var s=t.getLine(n.row).substr(0,n.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,n,r):[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompletions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(Object.keys(u[i]))),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})},this.getAttributeValueCompletions=function(e,t,n,r){var i=l(t,n),s=c(t,n);if(!i)return[];var o=[];return i in u&&s in u[i]&&typeof u[i][s]=="object"&&(o=Object.keys(u[i][s])),o.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:Number.MAX_VALUE}})},this.getHTMLEntityCompletions=function(e,t,n,r){var i=["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"];return i.map(function(e){return{caption:e,snippet:e,meta:"html entity",score:Number.MAX_VALUE}})}}).call(h.prototype),t.HtmlCompletions=h}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/ptr_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|")),n=i.arrayToMap("animate|animateColor|animateMotion|animateTransform|set".split("|")),r=i.arrayToMap("desc|metadata|title".split("|")),s=i.arrayToMap("feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feFlood|feGaussianBlur|feImage|feMerge|feMorphology|feOffset|feSpecularLighting|feTile|feTurbulence".split("|")),u=i.arrayToMap("linearGradient|radialGradient".split("|")),a=i.arrayToMap("circle|ellipse|line|path|polygon|polyline|rect".split("|")),f=i.arrayToMap("ptR|tagR|svg|svgR|defs|g|Merge|symbol|use".split("|")),l=i.arrayToMap("altGlyph|textPath|tref|tspan|text".split("|")),c=i.arrayToMap("filter".split("|")),h=i.arrayToMap("mask|marker".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:["identifier","text","keyword.operator"],regex:"([a-zA-Z.][a-zA-Z0-9._]*\\b)(\\s*)(=)"},{onMatch:function(i){return e[i]?"keyword":t[i]?"constant.language":n[i]?".bold.italic.svgRAN":r[i]?".bold.italic.svgRME":s[i]?".bold.italic.svgRFE":u[i]?".bold.italic.svgRGR":a[i]?".bold.italic.svgRSH":f[i]?".bold.italic.svgRCO":l[i]?".bold.italic.svgRTX":c[i]?".bold.italic.svgRFI":h[i]?".bold.italic.svgRMM":i=="..."||i.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var p=(new o("comment")).getRules();for(var d=0;dn)return-1;if(e===n){if(tr)return-1}return 0}function r(e,t){var r=n(e.location.start.line,e.location.start.column,t.row,t.column),i=n(t.row,t.column,e.location.end.line,e.location.end.column);return n(e.location.start.line,e.location.start.column,t.row,t.column)==1&&n(t.row,t.column,e.location.end.line,e.location.end.column)==1}function i(e,r,i){if(r){var s=n(e.location.start.line,e.location.start.column,r.row,r.column),o=n(r.row,r.column,e.location.end.line,e.location.end.column);if(n(e.location.start.line,e.location.start.column,r.row,r.column)==1&&n(r.row,r.column,e.location.end.line,e.location.end.column)==1){var u=[];!i||(u=i.filter(function(e){return e instanceof l}).map(function(e){e.token})),t.push({token:e.token,location:e.location,attrs:u})}}}function s(){t=[]}function o(t,n){e.push({message:t,location:n,type:"warning"})}function u(t,n){e.push({message:t,location:n,type:"error"})}function a(){e=[]}function f(e,t){console.log("\n"+e+" Result:\n"+JSON.stringify(t)+"\n")}function l(e,t){this.token=e,this.location=t}function c(e,t){this.token=e,this.location=t}function h(e){e?console.log("location: "+e.start.line+","+e.start.column):console.log("location is null")}function y(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function b(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b)}function w(e,n){function qo(){return e.substring(Po,Do)}function Ro(){return Qo(Po,Do)}function Uo(t,n){throw n=n!==void 0?n:Qo(Po,Do),Zo([Jo(t)],e.substring(Po,Do),n)}function zo(e,t){throw t=t!==void 0?t:Qo(Po,Do),Yo(e,t)}function Wo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xo(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Vo(){return{type:"any"}}function $o(){return{type:"end"}}function Jo(e){return{type:"other",description:e}}function Ko(t){var n=Ho[t],r;if(n)return n;r=t-1;while(!Ho[r])r--;n=Ho[r],n={line:n.line,column:n.column};while(rBo&&(Bo=Do,jo=[]),jo.push(e)}function Yo(e,t){return new b(e,null,null,t)}function Zo(e,t,n){return new b(b.buildMessage(e,t),e,t,n)}function eu(){var e;return e=su(),e}function tu(){var t,n,r;return t=Do,e.charCodeAt(Do)===13?(n=f,Do++):(n=i,Fo===0&&Go(h)),n===i&&(n=null),n!==i?(e.charCodeAt(Do)===10?(r=m,Do++):(r=i,Fo===0&&Go(g)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function nu(){var t,n;return t=Do,Fo++,e.length>Do?(n=e.charAt(Do),Do++):(n=i,Fo===0&&Go(y)),Fo--,n===i?t=void 0:(Do=t,t=i),t}function ru(){var t,n,r;return t=Do,n=sa(),n!==i?(r=tu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=tu(),t===i&&(e.charCodeAt(Do)===59?(t=w,Do++):(t=i,Fo===0&&Go(E)))),t}function iu(){var e,t,n,r,s,o,u,a,f,l;e=Do,t=Pu();if(t!==i){n=Do,r=ou();if(r!==i){s=[],o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);while(o!==i)s.push(o),o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);s!==i?(r=[r,s],n=r):(Do=n,n=i)}else Do=n,n=i;n===i&&(n=null),n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function su(){var e,t,n,r;return e=Do,t=iu(),t!==i?(n=Pu(),n!==i?(r=nu(),r!==i?(t=[t,n,r],e=t):(Do=e,e=i)):(Do=e,e=i)):(Do=e,e=i),e}function ou(){var t,n,r,s;return t=Eu(),t===i&&(t=Do,n=Do,e.charCodeAt(Do)===33?(r=S,Do++):(r=i,Fo===0&&Go(x)),r!==i?(s=Bu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(n=null),n!==i?(r=Mu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function uu(){var t;return t=Ru(),t===i&&(t=na(),t===i&&(t=$u(),t===i&&(t=Vu(),t===i&&(t=Xu(),t===i&&(t=zu(),t===i&&(e.substr(Do,4)===T?(t=T,Do+=4):(t=i,Fo===0&&Go(N)),t===i&&(e.substr(Do,2)===C?(t=C,Do+=2):(t=i,Fo===0&&Go(k)),t===i&&(e.substr(Do,3)===L?(t=L,Do+=3):(t=i,Fo===0&&Go(A)),t===i&&(e.substr(Do,3)===O?(t=O,Do+=3):(t=i,Fo===0&&Go(M)),t===i&&(e.substr(Do,4)===_?(t=_,Do+=4):(t=i,Fo===0&&Go(D)),t===i&&(e.substr(Do,5)===P?(t=P,Do+=5):(t=i,Fo===0&&Go(H)),t===i&&(e.substr(Do,4)===B?(t=B,Do+=4):(t=i,Fo===0&&Go(j)),t===i&&(e.substr(Do,5)===F?(t=F,Do+=5):(t=i,Fo===0&&Go(I))))))))))))))),t}function au(){var t,n,r,s,o,u,a,f,l,c,h,p,d,v;return t=Do,e.charCodeAt(Do)===123?(n=q,Do++):(n=i,Fo===0&&Go(R)),n!==i?(r=Pu(),r!==i?(s=iu(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===125?(u=U,Do++):(u=i,Fo===0&&Go(z)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Bu(),h!==i?(e.substr(Do,4)===Q?(p=Q,Do+=4):(p=i,Fo===0&&Go(G)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=Ru(),u!==i?(a=Pu(),a!==i?(e.substr(Do,2)===et?(f=et,Do+=2):(f=i,Fo===0&&Go(tt)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Pu(),h!==i?(e.charCodeAt(Do)===41?(p=J,Do++):(p=i,Fo===0&&Go(K)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=hu(),u===i&&(u=null),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===43?(n=at,Do++):(n=i,Fo===0&&Go(ft)),n===i&&(e.charCodeAt(Do)===45?(n=lt,Do++):(n=i,Fo===0&&Go(ct)),n===i&&(e.charCodeAt(Do)===126?(n=ht,Do++):(n=i,Fo===0&&Go(pt)))),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i))))))))),t}function fu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Ru(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function lu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=fu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function cu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=fu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=wt()),t=n,t}function hu(){var e,t,n,r,s,o;e=Do,t=fu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function pu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function du(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=pu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function vu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=pu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=Et()),t=n,t}function mu(){var e,t,n,r,s,o;e=Do,t=pu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function gu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.charCodeAt(Do)===91?(r=St,Do++):(r=i,Fo===0&&Go(xt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===93?(a=Tt,Do++):(a=i,Fo===0&&Go(Nt)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function yu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.substr(Do,2)===Ct?(r=Ct,Do+=2):(r=i,Fo===0&&Go(kt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.substr(Do,2)===Lt?(a=Lt,Do+=2):(a=i,Fo===0&&Go(At)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function bu(){var t,n,r,s,o,u;return t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=mu(),s===i&&(s=null),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function wu(){var e,t,n,r,s,o;e=Do,t=au(),t===i&&(t=uu());if(t!==i){n=[],r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Eu(){var t,n,r,s,o,u,a;return t=Do,n=qu(),n!==i?(e.charCodeAt(Do)===40?(r=V,Do++):(r=i,Fo===0&&Go($)),r!==i?(s=Pu(),s!==i?(o=Lu(),o===i&&(o=null),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===41?(a=J,Do++):(a=i,Fo===0&&Go(K)),a===i&&(a=nu()),a!==i?(Po=t,n=Ot(n,o,a),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Su(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(Po=t,n=Mt(n),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function xu(){var t,n;return t=Eu(),t===i&&(t=ou(),t===i&&(t=Do,e.substr(Do,3)===mt?(n=mt,Do+=3):(n=i,Fo===0&&Go(gt)),n!==i&&(Po=t,n=_t()),t=n)),t}function Tu(){var e;return e=Su(),e===i&&(e=xu()),e}function Nu(){var t,n,r,s;return t=Do,n=Do,e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r!==i?(s=Pu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i?(r=Tu(),r!==i?(Po=t,n=Dt(n,r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function Cu(){var t,n,r;return t=Do,n=Pu(),n!==i?(e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r===i&&(r=Tu()),r!==i?(Po=t,n=Pt(r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function ku(){var e,t,n;return e=Do,t=Bu(),t!==i?(n=Nu(),n===i&&(n=Cu()),n!==i?(Po=e,t=Ht(n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Lu(){var e,t,n,r;e=Do,t=Tu();if(t!==i){n=[],r=ku();while(r!==i)n.push(r),r=ku();n!==i?(Po=e,t=Bt(t,n),e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Au(){var t;return jt.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Ft)),t===i&&(t=ju()),t}function Ou(){var t,n,r,s;t=Do,e.charCodeAt(Do)===37?(n=It,Do++):(n=i,Fo===0&&Go(qt));if(n!==i){r=[],s=Au();while(s!==i)r.push(s),s=Au();r!==i?(e.charCodeAt(Do)===37?(s=It,Do++):(s=i,Fo===0&&Go(qt)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;return t===i&&(e.substr(Do,3)===Rt?(t=Rt,Do+=3):(t=i,Fo===0&&Go(Ut)),t===i&&(e.substr(Do,3)===zt?(t=zt,Do+=3):(t=i,Fo===0&&Go(Wt)),t===i&&(e.substr(Do,3)===Xt?(t=Xt,Do+=3):(t=i,Fo===0&&Go(Vt)),t===i&&(e.substr(Do,2)===$t?(t=$t,Do+=2):(t=i,Fo===0&&Go(Jt)),t===i&&(e.substr(Do,2)===Kt?(t=Kt,Do+=2):(t=i,Fo===0&&Go(Qt)),t===i&&(e.substr(Do,2)===Gt?(t=Gt,Do+=2):(t=i,Fo===0&&Go(Yt)),t===i&&(e.substr(Do,2)===Zt?(t=Zt,Do+=2):(t=i,Fo===0&&Go(en)),t===i&&(e.substr(Do,2)===tn?(t=tn,Do+=2):(t=i,Fo===0&&Go(nn)),t===i&&(e.substr(Do,2)===rn?(t=rn,Do+=2):(t=i,Fo===0&&Go(sn)),t===i&&(e.substr(Do,2)===on?(t=on,Do+=2):(t=i,Fo===0&&Go(un)),t===i&&(e.substr(Do,2)===an?(t=an,Do+=2):(t=i,Fo===0&&Go(fn)),t===i&&(e.substr(Do,2)===ln?(t=ln,Do+=2):(t=i,Fo===0&&Go(cn)),t===i&&(e.substr(Do,2)===hn?(t=hn,Do+=2):(t=i,Fo===0&&Go(pn)),t===i&&(e.charCodeAt(Do)===36?(t=dn,Do++):(t=i,Fo===0&&Go(vn)),t===i&&(e.charCodeAt(Do)===64?(t=mn,Do++):(t=i,Fo===0&&Go(gn)),t===i&&(e.charCodeAt(Do)===94?(t=yn,Do++):(t=i,Fo===0&&Go(bn)),t===i&&(e.charCodeAt(Do)===58?(t=wn,Do++):(t=i,Fo===0&&Go(En)),t===i&&(e.charCodeAt(Do)===42?(t=Sn,Do++):(t=i,Fo===0&&Go(xn)),t===i&&(e.charCodeAt(Do)===47?(t=Tn,Do++):(t=i,Fo===0&&Go(Nn)),t===i&&(e.charCodeAt(Do)===43?(t=at,Do++):(t=i,Fo===0&&Go(ft)),t===i&&(e.charCodeAt(Do)===45?(t=lt,Do++):(t=i,Fo===0&&Go(ct)),t===i&&(e.charCodeAt(Do)===62?(t=Cn,Do++):(t=i,Fo===0&&Go(kn)),t===i&&(e.charCodeAt(Do)===60?(t=Ln,Do++):(t=i,Fo===0&&Go(An)),t===i&&(e.charCodeAt(Do)===38?(t=On,Do++):(t=i,Fo===0&&Go(Mn)),t===i&&(e.charCodeAt(Do)===124?(t=_n,Do++):(t=i,Fo===0&&Go(Dn)),t===i&&(e.charCodeAt(Do)===126?(t=ht,Do++):(t=i,Fo===0&&Go(pt)),t===i&&(e.charCodeAt(Do)===61?(t=dt,Do++):(t=i,Fo===0&&Go(vt))))))))))))))))))))))))))))),t}function Mu(){var e,t,n,r,s,o,u,a,f;e=Do,t=wu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function _u(){var t;return Pn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Hn)),t}function Du(){var t;return Bn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(jn)),t}function Pu(){var e,t;e=[],t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));while(t!==i)e.push(t),t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));return e}function Hu(){var e,t;e=[],t=Du(),t===i&&(t=sa());while(t!==i)e.push(t),t=Du(),t===i&&(t=sa());return e}function Bu(){var e,t;e=[],t=Du();while(t!==i)e.push(t),t=Du();return e}function ju(){var t;return Fn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(In)),t}function Fu(){var t,n,r,s;return t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n===i&&(e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n===i&&(e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n===i&&(e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n===i&&(e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n===i&&(e.substr(Do,4)===B?(n=B,Do+=4):(n=i,Fo===0&&Go(j)),n===i&&(e.substr(Do,2)===et?(n=et,Do+=2):(n=i,Fo===0&&Go(tt)))))))),n!==i?(r=Do,Fo++,s=Uu(),s===i&&(s=ju()),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Iu(){var t,n,r,s;t=Do,n=ju(),n===i&&(n=Do,e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn)),r!==i?(s=ju(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn))));if(n!==i){r=[],s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));while(s!==i)r.push(s),s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));r!==i?(Po=t,n=Wn(n,r),t=n):(Do=t,t=i)}else Do=t,t=i;return t}function qu(){var t;return e.substr(Do,19)===Xn?(t=Xn,Do+=19):(t=i,Fo===0&&Go(Vn)),t===i&&(e.substr(Do,18)===$n?(t=$n,Do+=18):(t=i,Fo===0&&Go(Jn)),t===i&&(e.substr(Do,17)===Kn?(t=Kn,Do+=17):(t=i,Fo===0&&Go(Qn)),t===i&&(e.substr(Do,17)===Gn?(t=Gn,Do+=17):(t=i,Fo===0&&Go(Yn)),t===i&&(e.substr(Do,16)===Zn?(t=Zn,Do+=16):(t=i,Fo===0&&Go(er)),t===i&&(e.substr(Do,16)===tr?(t=tr,Do+=16):(t=i,Fo===0&&Go(nr)),t===i&&(e.substr(Do,16)===rr?(t=rr,Do+=16):(t=i,Fo===0&&Go(ir)),t===i&&(e.substr(Do,14)===sr?(t=sr,Do+=14):(t=i,Fo===0&&Go(or)),t===i&&(e.substr(Do,14)===ur?(t=ur,Do+=14):(t=i,Fo===0&&Go(ar)),t===i&&(e.substr(Do,14)===fr?(t=fr,Do+=14):(t=i,Fo===0&&Go(lr)),t===i&&(e.substr(Do,14)===cr?(t=cr,Do+=14):(t=i,Fo===0&&Go(hr)),t===i&&(e.substr(Do,14)===pr?(t=pr,Do+=14):(t=i,Fo===0&&Go(dr)),t===i&&(e.substr(Do,13)===vr?(t=vr,Do+=13):(t=i,Fo===0&&Go(mr)),t===i&&(e.substr(Do,13)===gr?(t=gr,Do+=13):(t=i,Fo===0&&Go(yr)),t===i&&(e.substr(Do,13)===br?(t=br,Do+=13):(t=i,Fo===0&&Go(wr)),t===i&&(e.substr(Do,13)===Er?(t=Er,Do+=13):(t=i,Fo===0&&Go(Sr)),t===i&&(e.substr(Do,13)===xr?(t=xr,Do+=13):(t=i,Fo===0&&Go(Tr)),t===i&&(e.substr(Do,13)===Nr?(t=Nr,Do+=13):(t=i,Fo===0&&Go(Cr)),t===i&&(e.substr(Do,13)===kr?(t=kr,Do+=13):(t=i,Fo===0&&Go(Lr)),t===i&&(e.substr(Do,12)===Ar?(t=Ar,Do+=12):(t=i,Fo===0&&Go(Or)),t===i&&(e.substr(Do,12)===Mr?(t=Mr,Do+=12):(t=i,Fo===0&&Go(_r)),t===i&&(e.substr(Do,12)===Dr?(t=Dr,Do+=12):(t=i,Fo===0&&Go(Pr)),t===i&&(e.substr(Do,12)===Hr?(t=Hr,Do+=12):(t=i,Fo===0&&Go(Br)),t===i&&(e.substr(Do,12)===jr?(t=jr,Do+=12):(t=i,Fo===0&&Go(Fr)),t===i&&(e.substr(Do,11)===Ir?(t=Ir,Do+=11):(t=i,Fo===0&&Go(qr)),t===i&&(e.substr(Do,11)===Rr?(t=Rr,Do+=11):(t=i,Fo===0&&Go(Ur)),t===i&&(e.substr(Do,11)===zr?(t=zr,Do+=11):(t=i,Fo===0&&Go(Wr)),t===i&&(e.substr(Do,11)===Xr?(t=Xr,Do+=11):(t=i,Fo===0&&Go(Vr)),t===i&&(e.substr(Do,9)===$r?(t=$r,Do+=9):(t=i,Fo===0&&Go(Jr)),t===i&&(e.substr(Do,8)===Kr?(t=Kr,Do+=8):(t=i,Fo===0&&Go(Qr)),t===i&&(e.substr(Do,8)===Gr?(t=Gr,Do+=8):(t=i,Fo===0&&Go(Yr)),t===i&&(e.substr(Do,8)===Zr?(t=Zr,Do+=8):(t=i,Fo===0&&Go(ei)),t===i&&(e.substr(Do,8)===ti?(t=ti,Do+=8):(t=i,Fo===0&&Go(ni)),t===i&&(e.substr(Do,8)===ri?(t=ri,Do+=8):(t=i,Fo===0&&Go(ii)),t===i&&(e.substr(Do,8)===si?(t=si,Do+=8):(t=i,Fo===0&&Go(oi)),t===i&&(e.substr(Do,8)===ui?(t=ui,Do+=8):(t=i,Fo===0&&Go(ai)),t===i&&(e.substr(Do,7)===fi?(t=fi,Do+=7):(t=i,Fo===0&&Go(li)),t===i&&(e.substr(Do,7)===ci?(t=ci,Do+=7):(t=i,Fo===0&&Go(hi)),t===i&&(e.substr(Do,7)===pi?(t=pi,Do+=7):(t=i,Fo===0&&Go(di)),t===i&&(e.substr(Do,7)===vi?(t=vi,Do+=7):(t=i,Fo===0&&Go(mi)),t===i&&(e.substr(Do,7)===gi?(t=gi,Do+=7):(t=i,Fo===0&&Go(yi)),t===i&&(e.substr(Do,7)===bi?(t=bi,Do+=7):(t=i,Fo===0&&Go(wi)),t===i&&(e.substr(Do,7)===Ei?(t=Ei,Do+=7):(t=i,Fo===0&&Go(Si)),t===i&&(e.substr(Do,7)===xi?(t=xi,Do+=7):(t=i,Fo===0&&Go(Ti)),t===i&&(e.substr(Do,7)===Ni?(t=Ni,Do+=7):(t=i,Fo===0&&Go(Ci)),t===i&&(e.substr(Do,7)===ki?(t=ki,Do+=7):(t=i,Fo===0&&Go(Li)),t===i&&(e.substr(Do,7)===Ai?(t=Ai,Do+=7):(t=i,Fo===0&&Go(Oi)),t===i&&(e.substr(Do,7)===Mi?(t=Mi,Do+=7):(t=i,Fo===0&&Go(_i)),t===i&&(e.substr(Do,6)===Di?(t=Di,Do+=6):(t=i,Fo===0&&Go(Pi)),t===i&&(e.substr(Do,6)===Hi?(t=Hi,Do+=6):(t=i,Fo===0&&Go(Bi)),t===i&&(e.substr(Do,6)===ji?(t=ji,Do+=6):(t=i,Fo===0&&Go(Fi)),t===i&&(e.substr(Do,6)===Ii?(t=Ii,Do+=6):(t=i,Fo===0&&Go(qi)),t===i&&(e.substr(Do,6)===Ri?(t=Ri,Do+=6):(t=i,Fo===0&&Go(Ui)),t===i&&(e.substr(Do,6)===zi?(t=zi,Do+=6):(t=i,Fo===0&&Go(Wi)),t===i&&(e.substr(Do,6)===Xi?(t=Xi,Do+=6):(t=i,Fo===0&&Go(Vi)),t===i&&(e.substr(Do,6)===$i?(t=$i,Do+=6):(t=i,Fo===0&&Go(Ji)),t===i&&(e.substr(Do,5)===Ki?(t=Ki,Do+=5):(t=i,Fo===0&&Go(Qi)),t===i&&(e.substr(Do,5)===Gi?(t=Gi,Do+=5):(t=i,Fo===0&&Go(Yi)),t===i&&(e.substr(Do,5)===Zi?(t=Zi,Do+=5):(t=i,Fo===0&&Go(es)),t===i&&(e.substr(Do,5)===ts?(t=ts,Do+=5):(t=i,Fo===0&&Go(ns)),t===i&&(e.substr(Do,5)===rs?(t=rs,Do+=5):(t=i,Fo===0&&Go(is)),t===i&&(e.substr(Do,5)===ss?(t=ss,Do+=5):(t=i,Fo===0&&Go(os)),t===i&&(e.substr(Do,5)===us?(t=us,Do+=5):(t=i,Fo===0&&Go(as)),t===i&&(e.substr(Do,5)===fs?(t=fs,Do+=5):(t=i,Fo===0&&Go(ls)),t===i&&(e.substr(Do,4)===cs?(t=cs,Do+=4):(t=i,Fo===0&&Go(hs)),t===i&&(e.substr(Do,4)===ps?(t=ps,Do+=4):(t=i,Fo===0&&Go(ds)),t===i&&(e.substr(Do,4)===vs?(t=vs,Do+=4):(t=i,Fo===0&&Go(ms)),t===i&&(e.substr(Do,4)===gs?(t=gs,Do+=4):(t=i,Fo===0&&Go(ys)),t===i&&(e.substr(Do,4)===bs?(t=bs,Do+=4):(t=i,Fo===0&&Go(ws)),t===i&&(e.substr(Do,4)===Es?(t=Es,Do+=4):(t=i,Fo===0&&Go(Ss)),t===i&&(e.substr(Do,4)===xs?(t=xs,Do+=4):(t=i,Fo===0&&Go(Ts)),t===i&&(e.substr(Do,4)===Ns?(t=Ns,Do+=4):(t=i,Fo===0&&Go(Cs)),t===i&&(e.substr(Do,4)===ks?(t=ks,Do+=4):(t=i,Fo===0&&Go(Ls)),t===i&&(e.substr(Do,4)===As?(t=As,Do+=4):(t=i,Fo===0&&Go(Os)),t===i&&(e.substr(Do,4)===Ms?(t=Ms,Do+=4):(t=i,Fo===0&&Go(_s)),t===i&&(e.substr(Do,4)===Ds?(t=Ds,Do+=4):(t=i,Fo===0&&Go(Ps)),t===i&&(e.substr(Do,3)===Hs?(t=Hs,Do+=3):(t=i,Fo===0&&Go(Bs)),t===i&&(e.substr(Do,3)===js?(t=js,Do+=3):(t=i,Fo===0&&Go(Fs)),t===i&&(e.substr(Do,3)===Is?(t=Is,Do+=3):(t=i,Fo===0&&Go(qs)),t===i&&(e.charCodeAt(Do)===97?(t=Rs,Do++):(t=i,Fo===0&&Go(Us)),t===i&&(e.charCodeAt(Do)===103?(t=zs,Do++):(t=i,Fo===0&&Go(Ws)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),t}function Ru(){var e,t,n;return e=Do,t=Do,Fo++,n=Fu(),Fo--,n===i?t=void 0:(Do=t,t=i),t!==i?(n=Iu(),n!==i?(Po=e,t=Xs(t,n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Uu(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t}function zu(){var t,n,r;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;return n!==i?(Js.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Ks)),r===i&&(r=null),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Wu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===69?(n=Qs,Do++):(n=i,Fo===0&&Go(Gs)),n===i&&(e.charCodeAt(Do)===101?(n=Ys,Do++):(n=i,Fo===0&&Go(Zs))),n!==i?(e.charCodeAt(Do)===43?(r=at,Do++):(r=i,Fo===0&&Go(ft)),r===i&&(e.charCodeAt(Do)===45?(r=lt,Do++):(r=i,Fo===0&&Go(ct))),r===i&&(r=null),r!==i?(s=zu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Xu(){var t,n,r,s,o,u;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;if(n!==i){e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn));if(r!==i){s=[],o=Uu();while(o!==i)s.push(o),o=Uu();s!==i?(o=Wu(),o===i&&(o=null),o!==i?(Js.test(e.charAt(Do))?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(Ks)),u===i&&(u=null),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;if(t===i){t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;n!==i?(r=Wu(),r===i&&(r=null),r!==i?(Js.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(Ks)),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i);if(t===i){t=Do,e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn));if(n!==i){r=[],s=Uu();if(s!==i)while(s!==i)r.push(s),s=Uu();else r=i;r!==i?(s=Wu(),s===i&&(s=null),s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}}return t}function Vu(){var t,n,r;return t=Do,n=zu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,n=Xu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function $u(){var t,n,r,s,o;t=Do,e.charCodeAt(Do)===48?(n=no,Do++):(n=i,Fo===0&&Go(ro));if(n!==i){e.charCodeAt(Do)===120?(r=io,Do++):(r=i,Fo===0&&Go(so)),r===i&&(e.charCodeAt(Do)===88?(r=oo,Do++):(r=i,Fo===0&&Go(uo)));if(r!==i){s=[],o=Ju();if(o!==i)while(o!==i)s.push(o),o=Ju();else s=i;s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;return t}function Ju(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t===i&&(ao.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(fo)),t===i&&(lo.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(co)))),t}function Ku(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(r=Ju(),r!==i?(s=Ju(),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Qu(){var t,n,r,s,o;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(vo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(mo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(go.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(yo)),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i))),t}function Gu(){var t,n,r,s,o,u,a,f,l;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(s=Ju(),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(e.charCodeAt(Do)===123?(s=q,Do++):(s=i,Fo===0&&Go(R)),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(f=Ju(),f!==i?(e.charCodeAt(Do)===125?(l=U,Do++):(l=i,Fo===0&&Go(z)),l!==i?(n=[n,r,s,o,u,a,f,l],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)),t}function Yu(){var t,n,r;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(Eo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(So)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Gu(),t===i&&(t=Ku(),t===i&&(t=Qu()))),t}function Zu(){var t;return t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt))),t}function ea(){var t,n,r,s;return t=Do,n=Zu(),n!==i?(r=Do,Fo++,s=Zu(),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(e.charCodeAt(Do)===44?(t=yt,Do++):(t=i,Fo===0&&Go(bt))),t}function ta(){var e,t,n,r,s,o;e=Do,t=Pu();if(t!==i){n=[],r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);if(r!==i)while(r!==i)n.push(r),r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);else n=i;n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function na(){var t,n,r,s;t=Do,e.charCodeAt(Do)===34?(n=xo,Do++):(n=i,Fo===0&&Go(To));if(n!==i){r=[],s=ra();while(s!==i)r.push(s),s=ra();r!==i?(e.charCodeAt(Do)===34?(s=xo,Do++):(s=i,Fo===0&&Go(To)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;if(t===i){t=Do,e.charCodeAt(Do)===39?(n=No,Do++):(n=i,Fo===0&&Go(Co));if(n!==i){r=[],s=ia();while(s!==i)r.push(s),s=ia();r!==i?(e.charCodeAt(Do)===39?(s=No,Do++):(s=i,Fo===0&&Go(Co)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}return t}function ra(){var t,n,r;return t=Do,n=Do,Fo++,ko.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Lo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function ia(){var t,n,r;return t=Do,n=Do,Fo++,Ao.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Oo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function sa(){var t,n,r,s,o,u;t=Do,e.charCodeAt(Do)===35?(n=Mo,Do++):(n=i,Fo===0&&Go(_o));if(n!==i){r=[],s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);while(s!==i)r.push(s),s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);r!==i?(n=[n,r],t=n):(Do=t,t=i)}else Do=t,t=i;return t}n=n!==void 0?n:{};var i={},s={start:eu},a=eu,f="\r",h=Wo("\r",!1),m="\n",g=Wo("\n",!1),y=Vo(),w=";",E=Wo(";",!1),S="!",x=Wo("!",!1),T="NULL",N=Wo("NULL",!1),C="NA",k=Wo("NA",!1),L="Inf",A=Wo("Inf",!1),O="NaN",M=Wo("NaN",!1),_="TRUE",D=Wo("TRUE",!1),P="FALSE",H=Wo("FALSE",!1),B="next",j=Wo("next",!1),F="break",I=Wo("break",!1),q="{",R=Wo("{",!1),U="}",z=Wo("}",!1),W="if",X=Wo("if",!1),V="(",$=Wo("(",!1),J=")",K=Wo(")",!1),Q="else",G=Wo("else",!1),Y="for",Z=Wo("for",!1),et="in",tt=Wo("in",!1),nt="while",rt=Wo("while",!1),it="repeat",st=Wo("repeat",!1),ot="function",ut=Wo("function",!1),at="+",ft=Wo("+",!1),lt="-",ct=Wo("-",!1),ht="~",pt=Wo("~",!1),dt="=",vt=Wo("=",!1),mt="...",gt=Wo("...",!1),yt=",",bt=Wo(",",!1),wt=function(){return u("comma issues",Ro()),"comma"},Et=function(){return u("comma issues",Ro()),"comma"},St="[",xt=Wo("[",!1),Tt="]",Nt=Wo("]",!1),Ct="[[",kt=Wo("[[",!1),Lt="]]",At=Wo("]]",!1),Ot=function(e,i,s){var a,f,h,m,g=e;if(i)for(a=0;a<:+&*\-.$=\/]/,Ft=Xo([">","<",":","+","&","*","-",".","$","=","/"],!1,!1),It="%",qt=Wo("%",!1),Rt="<<-",Ut=Wo("<<-",!1),zt="->>",Wt=Wo("->>",!1),Xt=":::",Vt=Wo(":::",!1),$t="<-",Jt=Wo("<-",!1),Kt="==",Qt=Wo("==",!1),Gt="::",Yt=Wo("::",!1),Zt=">=",en=Wo(">=",!1),tn="!=",nn=Wo("!=",!1),rn="||",sn=Wo("||",!1),on="&&",un=Wo("&&",!1),an=":=",fn=Wo(":=",!1),ln="<=",cn=Wo("<=",!1),hn="->",pn=Wo("->",!1),dn="$",vn=Wo("$",!1),mn="@",gn=Wo("@",!1),yn="^",bn=Wo("^",!1),wn=":",En=Wo(":",!1),Sn="*",xn=Wo("*",!1),Tn="/",Nn=Wo("/",!1),Cn=">",kn=Wo(">",!1),Ln="<",An=Wo("<",!1),On="&",Mn=Wo("&",!1),_n="|",Dn=Wo("|",!1),Pn=/^[\n\r\u2028\u2029]/,Hn=Xo(["\n","\r","\u2028","\u2029"],!1,!1),Bn=/^[\t\x0B\f \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/,jn=Xo([" ","\x0b","\f"," ","\u00a0","\ufeff","\u1680","\u180e",["\u2000","\u200a"],"\u202f","\u205f","\u3000"],!1,!1),Fn=/^[a-zA-Z]/,In=Xo([["a","z"],["A","Z"]],!1,!1),qn=".",Rn=Wo(".",!1),Un="_",zn=Wo("_",!1),Wn=function(e,t){var n=t;return n?(n.unshift(e),n=n.join("")):n=e,n},Xn="feComponentTransfer",Vn=Wo("feComponentTransfer",!1),$n="feSpecularLighting",Jn=Wo("feSpecularLighting",!1),Kn="feDiffuseLighting",Qn=Wo("feDiffuseLighting",!1),Gn="feDisplacementMap",Yn=Wo("feDisplacementMap",!1),Zn="animateTransform",er=Wo("animateTransform",!1),tr="feConvolveMatrix",nr=Wo("feConvolveMatrix",!1),rr="font.face.format",ir=Wo("font.face.format",!1),sr="feDistantLight",or=Wo("feDistantLight",!1),ur="feGaussianBlur",ar=Wo("feGaussianBlur",!1),fr="font.face.name",lr=Wo("font.face.name",!1),cr="linearGradient",hr=Wo("linearGradient",!1),pr="radialGradient",dr=Wo("radialGradient",!1),vr="animateMotion",mr=Wo("animateMotion",!1),gr="color.profile",yr=Wo("color.profile",!1),br="feColorMatrix",wr=Wo("feColorMatrix",!1),Er="font.face.src",Sr=Wo("font.face.src",!1),xr="font.face.uri",Tr=Wo("font.face.uri",!1),Nr="foreignObject",Cr=Wo("foreignObject",!1),kr="missing.glyph",Lr=Wo("missing.glyph",!1),Ar="altGlyphItem",Or=Wo("altGlyphItem",!1),Mr="animateColor",_r=Wo("animateColor",!1),Dr="feMorphology",Pr=Wo("feMorphology",!1),Hr="fePointLight",Br=Wo("fePointLight",!1),jr="feTurbulence",Fr=Wo("feTurbulence",!1),Ir="altGlyphDef",qr=Wo("altGlyphDef",!1),Rr="feComposite",Ur=Wo("feComposite",!1),zr="feMergeNode",Wr=Wo("feMergeNode",!1),Xr="feSpotLight",Vr=Wo("feSpotLight",!1),$r="font.face",Jr=Wo("font.face",!1),Kr="altGlyph",Qr=Wo("altGlyph",!1),Gr="clipPath",Yr=Wo("clipPath",!1),Zr="feOffset",ei=Wo("feOffset",!1),ti="glyphRef",ni=Wo("glyphRef",!1),ri="metadata",ii=Wo("metadata",!1),si="polyline",oi=Wo("polyline",!1),ui="textPath",ai=Wo("textPath",!1),fi="animate",li=Wo("animate",!1),ci="ellipse",hi=Wo("ellipse",!1),pi="feBlend",di=Wo("feBlend",!1),vi="feFlood",mi=Wo("feFlood",!1),gi="feFuncA",yi=Wo("feFuncA",!1),bi="feFuncB",wi=Wo("feFuncB",!1),Ei="feFuncG",Si=Wo("feFuncG",!1),xi="feFuncR",Ti=Wo("feFuncR",!1),Ni="feImage",Ci=Wo("feImage",!1),ki="feMerge",Li=Wo("feMerge",!1),Ai="pattern",Oi=Wo("pattern",!1),Mi="polygon",_i=Wo("polygon",!1),Di="circle",Pi=Wo("circle",!1),Hi="cursor",Bi=Wo("cursor",!1),ji="feTile",Fi=Wo("feTile",!1),Ii="filter",qi=Wo("filter",!1),Ri="marker",Ui=Wo("marker",!1),zi="script",Wi=Wo("script",!1),Xi="switch",Vi=Wo("switch",!1),$i="symbol",Ji=Wo("symbol",!1),Ki="glyph",Qi=Wo("glyph",!1),Gi="hkern",Yi=Wo("hkern",!1),Zi="image",es=Wo("image",!1),ts="mpath",ns=Wo("mpath",!1),rs="style",is=Wo("style",!1),ss="title",os=Wo("title",!1),us="tspan",as=Wo("tspan",!1),fs="vkern",ls=Wo("vkern",!1),cs="defs",hs=Wo("defs",!1),ps="desc",ds=Wo("desc",!1),vs="font",ms=Wo("font",!1),gs="line",ys=Wo("line",!1),bs="mask",ws=Wo("mask",!1),Es="path",Ss=Wo("path",!1),xs="rect",Ts=Wo("rect",!1),Ns="stop",Cs=Wo("stop",!1),ks="text",Ls=Wo("text",!1),As="tref",Os=Wo("tref",!1),Ms="view",_s=Wo("view",!1),Ds="svgR",Ps=Wo("svgR",!1),Hs="set",Bs=Wo("set",!1),js="svg",Fs=Wo("svg",!1),Is="use",qs=Wo("use",!1),Rs="a",Us=Wo("a",!1),zs="g",Ws=Wo("g",!1),Xs=function(e,t){var n=t;return n},Vs=/^[0-9]/,$s=Xo([["0","9"]],!1,!1),Js=/^[Ll]/,Ks=Xo(["L","l"],!1,!1),Qs="E",Gs=Wo("E",!1),Ys="e",Zs=Wo("e",!1),eo="i",to=Wo("i",!1),no="0",ro=Wo("0",!1),io="x",so=Wo("x",!1),oo="X",uo=Wo("X",!1),ao=/^[a-f]/,fo=Xo([["a","f"]],!1,!1),lo=/^[A-F]/,co=Xo([["A","F"]],!1,!1),ho="\\",po=Wo("\\",!1),vo=/^[0-3]/,mo=Xo([["0","3"]],!1,!1),go=/^[0-7]/,yo=Xo([["0","7"]],!1,!1),bo="u",wo=Wo("u",!1),Eo=/^[abtnfrv"'\\]/,So=Xo(["a","b","t","n","f","r","v",'"',"'","\\"],!1,!1),xo='"',To=Wo('"',!1),No="'",Co=Wo("'",!1),ko=/^["]/,Lo=Xo(['"'],!1,!1),Ao=/^[']/,Oo=Xo(["'"],!1,!1),Mo="#",_o=Wo("#",!1),Do=0,Po=0,Ho=[{line:1,column:1}],Bo=0,jo=[],Fo=0,Io;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}Io=a();if(Io!==i&&Do===e.length)return Io;throw Io!==i&&Do0&&(result=w(t,n),w(t,n))}catch(s){if(s instanceof b){var o="error";s.message&&s.location.start.line&&u("Unexpected Symbol: "+s.found,s.location,"error")}}return e.forEach(function(e){var t=e.message,n=e.location,r=e.type;i.push({row:n.start.line-1,column:n.start.column-1,text:t,type:r})}),i}function S(r,i){e.length=0,t.length=0,"object"==typeof r&&(r=undefined),r=r||"";var s={};i&&(s={cursorPos:{row:i.row+1,column:i.column+1}});var o={tok:"",pos:{line:-1,col:-1}};try{if(r&&"string"==typeof r&&r.length>0){result=w(r,s);for(var a=0,f=t.length;a0){var i=r[0],s=p[i],o=v[i];available=s.concat(o)}return available}function T(e,t){return S(e,t).tok}var e=[],t=[];Array.prototype.hasValue=function(e){var t;for(t=0;t0){for(n=1,r=1;n-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.PtrStyleBehaviour=p}),ace.define("ace/mode/folding/ptrstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[|\()[^\}\]\)]*$/,this.foldingStopMarker=/^[^\[\{\(]*(\}|\]|\))/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/ptr",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/ptr_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/ptr_completions","ace/worker/worker_client","ace/mode/behaviour/ptrstyle","ace/mode/folding/ptrstyle"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("./text_highlight_rules").TextHighlightRules,u=e("./ptr_highlight_rules").PtrHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("./ptr_completions").PtrCompletions,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/ptrstyle").PtrStyleBehaviour,h=e("./folding/ptrstyle").FoldMode,p=function(){this.HighlightRules=u,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h,this.$completer=new f};i.inherits(p,s),function(){this.lineCommentStart="#",this.$id="ace/mode/ptr",this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/ptr_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("errors",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(p.prototype),t.Mode=p}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],SVGR:[{token:"support.function",regex:"^\\s*```\\s*",push:"ptrcode-start"},{token:"constant.language.escape",regex:"",next:"start"}],SNIPPET:[{token:"support.function",regex:"^\\s*```\\s*",push:"snippetcode-start"},{token:"constant.language.escape",regex:"",next:"start"}],POPUP:[{token:"support.function",regex:"^\\s*```\\s*",push:"textcode-start"},{token:"constant.language.escape",regex:"",next:"start"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{defaultToken:"support.function"}]}),this.embedRules(c,"ptrcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"snippetcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(s,"textcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};r.inherits(d,s),t.DnippetsHighlightRules=d}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?r[0]=="`"?e.bgTokenizer.getState(n)=="start"?"end":"start":"start":""},this.getFoldWidgetRange=function(e,t,n){function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(/[^#]/)}var r=e.getLine(n),i=r.length,o=e.getLength(),u=n,a=n;if(!r.match(this.foldingStartMarker))return;if(r[0]=="`"){if(e.bgTokenizer.getState(n)!=="start"){while(++n0){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(n,r.length,u,0)}var f,c="markup.heading";if(l(n)){var p=h();while(++n=p)break}a=n-(!f||["=","-"].indexOf(f.value[0])==-1?1:2);if(a>u)while(a>u&&/^\s*$/.test(e.getLine(a)))a--;if(a>u){var v=e.getLine(a).length;return new s(u,i,a,v)}}}}.call(o.prototype)}),ace.define("ace/mode/dnippets",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/ptr","ace/mode/snippets","ace/mode/dnippets_highlight_rules","ace/mode/folding/markdown"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./xml").Mode,u=e("./html").Mode,a=e("./ptr").Mode,f=e("./snippets").Mode,l=e("./dnippets_highlight_rules").DnippetsHighlightRules,c=e("./folding/markdown").FoldMode,h=function(){this.HighlightRules=l,this.createModeDelegates({"js-":s,"xml-":o,"html-":u,"ptr-":a,"snippet-":f}),this.foldingRules=new c,this.$behaviour=this.$defaultBehaviour};r.inherits(h,i),function(){this.type="text",this.blockComment={start:""},this.getNextLineIndent=function(e,t,n){if(e=="listblock"){var r=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!r)return"";var i=r[2];return i||(i=parseInt(r[3],10)+1+"."),r[1]+i+r[4]}return this.$getIndent(t)},this.$id="ace/mode/dnippets"}.call(h.prototype),t.Mode=h}) \ No newline at end of file +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+o+")(\\.)(prototype)(\\.)("+o+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+o+")(\\.)("+o+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:r},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/cstyle").CstyleBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){var t="[_:a-zA-Z\u00c0-\uffff][-_:.a-zA-Z0-9\u00c0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+t+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+t+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:t},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getSelectionRange().start,a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(o.column/.test(r.getLine(o.row).slice(o.column)))return;while(!u(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var c=a.getCurrentTokenRow(),h=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var p=f.value;c==o.row&&(p=p.substring(0,o.column-h));if(this.voidElements.hasOwnProperty(p.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){if(f.value=="/>")return;while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};r.start.row==r.end.row&&(l.column=r.end.column);while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,a.start.row==a.end.row&&a.start.column"},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/xml_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",f=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t,n){"use strict";var r={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e){if(typeof e[t]!="string")continue;var n=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});r.hasOwnProperty(n)||(r[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,r){this.completionsDefined||this.defineCompletions();var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(e==="ruleset"){var s=t.getLine(n.row).substr(0,n.column);return/:[^;]+$/.test(s)?(/([\w\-]+):[^:]*$/.test(s),this.getPropertyValueCompletions(e,t,n,r)):this.getPropertyCompletions(e,t,n,r)}return[]},this.getPropertyCompletions=function(e,t,n,i){var s=Object.keys(r);return s.map(function(e){return{caption:e,snippet:e+": $0;",meta:"property",score:Number.MAX_VALUE}})},this.getPropertyValueCompletions=function(e,t,n,i){var s=t.getLine(n.row).substr(0,n.column),o=(/([\w\-]+):[^:]*$/.exec(s)||{})[1];if(!o)return[];var u=[];return o in r&&typeof r[o]=="object"&&(u=Object.keys(r[o])),u.map(function(e){return{caption:e,snippet:e,meta:"property value",score:Number.MAX_VALUE}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.$completer=new a,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules((new o({jsx:!1})).getRules(),"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}function c(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"attribute-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:{manifest:1},head:{},title:{},base:{href:1,target:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},noscript:{href:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},section:{},nav:{},article:{pubdate:1},aside:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},header:{},footer:{},address:{},main:{},p:{},hr:{},pre:{},blockquote:{cite:1},ol:{start:1,reversed:1},ul:{},li:{value:1},dl:{},dt:{},dd:{},figure:{},figcaption:{},div:{},a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},em:{},strong:{},small:{},s:{},cite:{},q:{cite:1},dfn:{},abbr:{},data:{},time:{datetime:1},code:{},"var":{},samp:{},kbd:{},sub:{},sup:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{},bdo:{},span:{},br:{},wbr:{},ins:{cite:1,datetime:1},del:{cite:1,datetime:1},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},embed:{src:1,height:1,width:1,type:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},param:{name:1,value:1},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},source:{src:1,type:1,media:1},track:{kind:1,src:1,srclang:1,label:1,"default":1},canvas:{width:1,height:1},map:{name:1},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},svg:{},math:{},table:{summary:1},caption:{},colgroup:{span:1},col:{span:1},tbody:{},thead:{},tfoot:{},tr:{},td:{headers:1,rowspan:1,colspan:1},th:{headers:1,rowspan:1,colspan:1,scope:1},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},fieldset:{disabled:1,form:1,name:1},legend:{},label:{form:1,"for":1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},datalist:{},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},output:{"for":1,form:1,name:1},progress:{value:1,max:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},details:{open:1},summary:{},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},menu:{type:1,label:1},dialog:{open:1}},a=Object.keys(u),h=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);if(!i)return[];if(f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open"))return this.getTagCompletions(e,t,n,r);if(f(i,"tag-whitespace")||f(i,"attribute-name"))return this.getAttributeCompletions(e,t,n,r);if(f(i,"attribute-value"))return this.getAttributeValueCompletions(e,t,n,r);var s=t.getLine(n.row).substr(0,n.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,n,r):[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompletions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(Object.keys(u[i]))),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})},this.getAttributeValueCompletions=function(e,t,n,r){var i=l(t,n),s=c(t,n);if(!i)return[];var o=[];return i in u&&s in u[i]&&typeof u[i][s]=="object"&&(o=Object.keys(u[i][s])),o.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:Number.MAX_VALUE}})},this.getHTMLEntityCompletions=function(e,t,n,r){var i=["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"];return i.map(function(e){return{caption:e,snippet:e,meta:"html entity",score:Number.MAX_VALUE}})}}).call(h.prototype),t.HtmlCompletions=h}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/ptr_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|")),n=i.arrayToMap("animate|animateColor|animateMotion|animateTransform|set".split("|")),r=i.arrayToMap("desc|metadata|title".split("|")),s=i.arrayToMap("feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feFlood|feGaussianBlur|feImage|feMerge|feMorphology|feOffset|feSpecularLighting|feTile|feTurbulence".split("|")),u=i.arrayToMap("linearGradient|radialGradient".split("|")),a=i.arrayToMap("circle|ellipse|line|path|polygon|polyline|rect".split("|")),f=i.arrayToMap("ptR|tagR|svg|svgR|defs|g|Merge|symbol|use".split("|")),l=i.arrayToMap("altGlyph|textPath|tref|tspan|text".split("|")),c=i.arrayToMap("filter".split("|")),h=i.arrayToMap("mask|marker".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:["identifier","text","keyword.operator"],regex:"([a-zA-Z.][a-zA-Z0-9._]*\\b)(\\s*)(=)"},{onMatch:function(i){return e[i]?"keyword":t[i]?"constant.language":n[i]?".italic.svgRAN":r[i]?".italic.svgRME":s[i]?".italic.svgRFE":u[i]?".italic.svgRGR":a[i]?".italic.svgRSH":f[i]?".italic.svgRCO":l[i]?".italic.svgRTX":c[i]?".italic.svgRFI":h[i]?".italic.svgRMM":i=="..."||i.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var p=(new o("comment")).getRules();for(var d=0;dn)return-1;if(e===n){if(tr)return-1}return 0}function r(e,t){var r=n(e.location.start.line,e.location.start.column,t.row,t.column),i=n(t.row,t.column,e.location.end.line,e.location.end.column);return n(e.location.start.line,e.location.start.column,t.row,t.column)==1&&n(t.row,t.column,e.location.end.line,e.location.end.column)==1}function i(e,r,i){if(r){var s=n(e.location.start.line,e.location.start.column,r.row,r.column),o=n(r.row,r.column,e.location.end.line,e.location.end.column);if(n(e.location.start.line,e.location.start.column,r.row,r.column)==1&&n(r.row,r.column,e.location.end.line,e.location.end.column)==1){var u=[];!i||(u=i.filter(function(e){return e instanceof l}).map(function(e){e.token})),t.push({token:e.token,location:e.location,attrs:u})}}}function s(){t=[]}function o(t,n){e.push({message:t,location:n,type:"warning"})}function u(t,n){e.push({message:t,location:n,type:"error"})}function a(){e=[]}function f(e,t){console.log("\n"+e+" Result:\n"+JSON.stringify(t)+"\n")}function l(e,t){this.token=e,this.location=t}function c(e,t){this.token=e,this.location=t}function h(e){e?console.log("location: "+e.start.line+","+e.start.column):console.log("location is null")}function y(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function b(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b)}function w(e,n){function qo(){return e.substring(Po,Do)}function Ro(){return Qo(Po,Do)}function Uo(t,n){throw n=n!==void 0?n:Qo(Po,Do),Zo([Jo(t)],e.substring(Po,Do),n)}function zo(e,t){throw t=t!==void 0?t:Qo(Po,Do),Yo(e,t)}function Wo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xo(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Vo(){return{type:"any"}}function $o(){return{type:"end"}}function Jo(e){return{type:"other",description:e}}function Ko(t){var n=Ho[t],r;if(n)return n;r=t-1;while(!Ho[r])r--;n=Ho[r],n={line:n.line,column:n.column};while(rBo&&(Bo=Do,jo=[]),jo.push(e)}function Yo(e,t){return new b(e,null,null,t)}function Zo(e,t,n){return new b(b.buildMessage(e,t),e,t,n)}function eu(){var e;return e=su(),e}function tu(){var t,n,r;return t=Do,e.charCodeAt(Do)===13?(n=f,Do++):(n=i,Fo===0&&Go(h)),n===i&&(n=null),n!==i?(e.charCodeAt(Do)===10?(r=m,Do++):(r=i,Fo===0&&Go(g)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function nu(){var t,n;return t=Do,Fo++,e.length>Do?(n=e.charAt(Do),Do++):(n=i,Fo===0&&Go(y)),Fo--,n===i?t=void 0:(Do=t,t=i),t}function ru(){var t,n,r;return t=Do,n=sa(),n!==i?(r=tu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=tu(),t===i&&(e.charCodeAt(Do)===59?(t=w,Do++):(t=i,Fo===0&&Go(E)))),t}function iu(){var e,t,n,r,s,o,u,a,f,l;e=Do,t=Pu();if(t!==i){n=Do,r=ou();if(r!==i){s=[],o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);while(o!==i)s.push(o),o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);s!==i?(r=[r,s],n=r):(Do=n,n=i)}else Do=n,n=i;n===i&&(n=null),n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function su(){var e,t,n,r;return e=Do,t=iu(),t!==i?(n=Pu(),n!==i?(r=nu(),r!==i?(t=[t,n,r],e=t):(Do=e,e=i)):(Do=e,e=i)):(Do=e,e=i),e}function ou(){var t,n,r,s;return t=Eu(),t===i&&(t=Do,n=Do,e.charCodeAt(Do)===33?(r=S,Do++):(r=i,Fo===0&&Go(x)),r!==i?(s=Bu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(n=null),n!==i?(r=Mu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function uu(){var t;return t=Ru(),t===i&&(t=na(),t===i&&(t=$u(),t===i&&(t=Vu(),t===i&&(t=Xu(),t===i&&(t=zu(),t===i&&(e.substr(Do,4)===T?(t=T,Do+=4):(t=i,Fo===0&&Go(N)),t===i&&(e.substr(Do,2)===C?(t=C,Do+=2):(t=i,Fo===0&&Go(k)),t===i&&(e.substr(Do,3)===L?(t=L,Do+=3):(t=i,Fo===0&&Go(A)),t===i&&(e.substr(Do,3)===O?(t=O,Do+=3):(t=i,Fo===0&&Go(M)),t===i&&(e.substr(Do,4)===_?(t=_,Do+=4):(t=i,Fo===0&&Go(D)),t===i&&(e.substr(Do,5)===P?(t=P,Do+=5):(t=i,Fo===0&&Go(H)),t===i&&(e.substr(Do,4)===B?(t=B,Do+=4):(t=i,Fo===0&&Go(j)),t===i&&(e.substr(Do,5)===F?(t=F,Do+=5):(t=i,Fo===0&&Go(I))))))))))))))),t}function au(){var t,n,r,s,o,u,a,f,l,c,h,p,d,v;return t=Do,e.charCodeAt(Do)===123?(n=q,Do++):(n=i,Fo===0&&Go(R)),n!==i?(r=Pu(),r!==i?(s=iu(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===125?(u=U,Do++):(u=i,Fo===0&&Go(z)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Bu(),h!==i?(e.substr(Do,4)===Q?(p=Q,Do+=4):(p=i,Fo===0&&Go(G)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=Ru(),u!==i?(a=Pu(),a!==i?(e.substr(Do,2)===et?(f=et,Do+=2):(f=i,Fo===0&&Go(tt)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Pu(),h!==i?(e.charCodeAt(Do)===41?(p=J,Do++):(p=i,Fo===0&&Go(K)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=hu(),u===i&&(u=null),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===43?(n=at,Do++):(n=i,Fo===0&&Go(ft)),n===i&&(e.charCodeAt(Do)===45?(n=lt,Do++):(n=i,Fo===0&&Go(ct)),n===i&&(e.charCodeAt(Do)===126?(n=ht,Do++):(n=i,Fo===0&&Go(pt)))),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i))))))))),t}function fu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Ru(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function lu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=fu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function cu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=fu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=wt()),t=n,t}function hu(){var e,t,n,r,s,o;e=Do,t=fu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function pu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function du(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=pu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function vu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=pu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=Et()),t=n,t}function mu(){var e,t,n,r,s,o;e=Do,t=pu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function gu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.charCodeAt(Do)===91?(r=St,Do++):(r=i,Fo===0&&Go(xt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===93?(a=Tt,Do++):(a=i,Fo===0&&Go(Nt)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function yu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.substr(Do,2)===Ct?(r=Ct,Do+=2):(r=i,Fo===0&&Go(kt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.substr(Do,2)===Lt?(a=Lt,Do+=2):(a=i,Fo===0&&Go(At)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function bu(){var t,n,r,s,o,u;return t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=mu(),s===i&&(s=null),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function wu(){var e,t,n,r,s,o;e=Do,t=au(),t===i&&(t=uu());if(t!==i){n=[],r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Eu(){var t,n,r,s,o,u,a;return t=Do,n=qu(),n!==i?(e.charCodeAt(Do)===40?(r=V,Do++):(r=i,Fo===0&&Go($)),r!==i?(s=Pu(),s!==i?(o=Lu(),o===i&&(o=null),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===41?(a=J,Do++):(a=i,Fo===0&&Go(K)),a===i&&(a=nu()),a!==i?(Po=t,n=Ot(n,o,a),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Su(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(Po=t,n=Mt(n),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function xu(){var t,n;return t=Eu(),t===i&&(t=ou(),t===i&&(t=Do,e.substr(Do,3)===mt?(n=mt,Do+=3):(n=i,Fo===0&&Go(gt)),n!==i&&(Po=t,n=_t()),t=n)),t}function Tu(){var e;return e=Su(),e===i&&(e=xu()),e}function Nu(){var t,n,r,s;return t=Do,n=Do,e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r!==i?(s=Pu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i?(r=Tu(),r!==i?(Po=t,n=Dt(n,r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function Cu(){var t,n,r;return t=Do,n=Pu(),n!==i?(e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r===i&&(r=Tu()),r!==i?(Po=t,n=Pt(r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function ku(){var e,t,n;return e=Do,t=Bu(),t!==i?(n=Nu(),n===i&&(n=Cu()),n!==i?(Po=e,t=Ht(n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Lu(){var e,t,n,r;e=Do,t=Tu();if(t!==i){n=[],r=ku();while(r!==i)n.push(r),r=ku();n!==i?(Po=e,t=Bt(t,n),e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Au(){var t;return jt.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Ft)),t===i&&(t=ju()),t}function Ou(){var t,n,r,s;t=Do,e.charCodeAt(Do)===37?(n=It,Do++):(n=i,Fo===0&&Go(qt));if(n!==i){r=[],s=Au();while(s!==i)r.push(s),s=Au();r!==i?(e.charCodeAt(Do)===37?(s=It,Do++):(s=i,Fo===0&&Go(qt)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;return t===i&&(e.substr(Do,3)===Rt?(t=Rt,Do+=3):(t=i,Fo===0&&Go(Ut)),t===i&&(e.substr(Do,3)===zt?(t=zt,Do+=3):(t=i,Fo===0&&Go(Wt)),t===i&&(e.substr(Do,3)===Xt?(t=Xt,Do+=3):(t=i,Fo===0&&Go(Vt)),t===i&&(e.substr(Do,2)===$t?(t=$t,Do+=2):(t=i,Fo===0&&Go(Jt)),t===i&&(e.substr(Do,2)===Kt?(t=Kt,Do+=2):(t=i,Fo===0&&Go(Qt)),t===i&&(e.substr(Do,2)===Gt?(t=Gt,Do+=2):(t=i,Fo===0&&Go(Yt)),t===i&&(e.substr(Do,2)===Zt?(t=Zt,Do+=2):(t=i,Fo===0&&Go(en)),t===i&&(e.substr(Do,2)===tn?(t=tn,Do+=2):(t=i,Fo===0&&Go(nn)),t===i&&(e.substr(Do,2)===rn?(t=rn,Do+=2):(t=i,Fo===0&&Go(sn)),t===i&&(e.substr(Do,2)===on?(t=on,Do+=2):(t=i,Fo===0&&Go(un)),t===i&&(e.substr(Do,2)===an?(t=an,Do+=2):(t=i,Fo===0&&Go(fn)),t===i&&(e.substr(Do,2)===ln?(t=ln,Do+=2):(t=i,Fo===0&&Go(cn)),t===i&&(e.substr(Do,2)===hn?(t=hn,Do+=2):(t=i,Fo===0&&Go(pn)),t===i&&(e.charCodeAt(Do)===36?(t=dn,Do++):(t=i,Fo===0&&Go(vn)),t===i&&(e.charCodeAt(Do)===64?(t=mn,Do++):(t=i,Fo===0&&Go(gn)),t===i&&(e.charCodeAt(Do)===94?(t=yn,Do++):(t=i,Fo===0&&Go(bn)),t===i&&(e.charCodeAt(Do)===58?(t=wn,Do++):(t=i,Fo===0&&Go(En)),t===i&&(e.charCodeAt(Do)===42?(t=Sn,Do++):(t=i,Fo===0&&Go(xn)),t===i&&(e.charCodeAt(Do)===47?(t=Tn,Do++):(t=i,Fo===0&&Go(Nn)),t===i&&(e.charCodeAt(Do)===43?(t=at,Do++):(t=i,Fo===0&&Go(ft)),t===i&&(e.charCodeAt(Do)===45?(t=lt,Do++):(t=i,Fo===0&&Go(ct)),t===i&&(e.charCodeAt(Do)===62?(t=Cn,Do++):(t=i,Fo===0&&Go(kn)),t===i&&(e.charCodeAt(Do)===60?(t=Ln,Do++):(t=i,Fo===0&&Go(An)),t===i&&(e.charCodeAt(Do)===38?(t=On,Do++):(t=i,Fo===0&&Go(Mn)),t===i&&(e.charCodeAt(Do)===124?(t=_n,Do++):(t=i,Fo===0&&Go(Dn)),t===i&&(e.charCodeAt(Do)===126?(t=ht,Do++):(t=i,Fo===0&&Go(pt)),t===i&&(e.charCodeAt(Do)===61?(t=dt,Do++):(t=i,Fo===0&&Go(vt))))))))))))))))))))))))))))),t}function Mu(){var e,t,n,r,s,o,u,a,f;e=Do,t=wu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function _u(){var t;return Pn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Hn)),t}function Du(){var t;return Bn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(jn)),t}function Pu(){var e,t;e=[],t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));while(t!==i)e.push(t),t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));return e}function Hu(){var e,t;e=[],t=Du(),t===i&&(t=sa());while(t!==i)e.push(t),t=Du(),t===i&&(t=sa());return e}function Bu(){var e,t;e=[],t=Du();while(t!==i)e.push(t),t=Du();return e}function ju(){var t;return Fn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(In)),t}function Fu(){var t,n,r,s;return t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n===i&&(e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n===i&&(e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n===i&&(e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n===i&&(e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n===i&&(e.substr(Do,4)===B?(n=B,Do+=4):(n=i,Fo===0&&Go(j)),n===i&&(e.substr(Do,2)===et?(n=et,Do+=2):(n=i,Fo===0&&Go(tt)))))))),n!==i?(r=Do,Fo++,s=Uu(),s===i&&(s=ju()),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Iu(){var t,n,r,s;t=Do,n=ju(),n===i&&(n=Do,e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn)),r!==i?(s=ju(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn))));if(n!==i){r=[],s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));while(s!==i)r.push(s),s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));r!==i?(Po=t,n=Wn(n,r),t=n):(Do=t,t=i)}else Do=t,t=i;return t}function qu(){var t;return e.substr(Do,19)===Xn?(t=Xn,Do+=19):(t=i,Fo===0&&Go(Vn)),t===i&&(e.substr(Do,18)===$n?(t=$n,Do+=18):(t=i,Fo===0&&Go(Jn)),t===i&&(e.substr(Do,17)===Kn?(t=Kn,Do+=17):(t=i,Fo===0&&Go(Qn)),t===i&&(e.substr(Do,17)===Gn?(t=Gn,Do+=17):(t=i,Fo===0&&Go(Yn)),t===i&&(e.substr(Do,16)===Zn?(t=Zn,Do+=16):(t=i,Fo===0&&Go(er)),t===i&&(e.substr(Do,16)===tr?(t=tr,Do+=16):(t=i,Fo===0&&Go(nr)),t===i&&(e.substr(Do,16)===rr?(t=rr,Do+=16):(t=i,Fo===0&&Go(ir)),t===i&&(e.substr(Do,14)===sr?(t=sr,Do+=14):(t=i,Fo===0&&Go(or)),t===i&&(e.substr(Do,14)===ur?(t=ur,Do+=14):(t=i,Fo===0&&Go(ar)),t===i&&(e.substr(Do,14)===fr?(t=fr,Do+=14):(t=i,Fo===0&&Go(lr)),t===i&&(e.substr(Do,14)===cr?(t=cr,Do+=14):(t=i,Fo===0&&Go(hr)),t===i&&(e.substr(Do,14)===pr?(t=pr,Do+=14):(t=i,Fo===0&&Go(dr)),t===i&&(e.substr(Do,13)===vr?(t=vr,Do+=13):(t=i,Fo===0&&Go(mr)),t===i&&(e.substr(Do,13)===gr?(t=gr,Do+=13):(t=i,Fo===0&&Go(yr)),t===i&&(e.substr(Do,13)===br?(t=br,Do+=13):(t=i,Fo===0&&Go(wr)),t===i&&(e.substr(Do,13)===Er?(t=Er,Do+=13):(t=i,Fo===0&&Go(Sr)),t===i&&(e.substr(Do,13)===xr?(t=xr,Do+=13):(t=i,Fo===0&&Go(Tr)),t===i&&(e.substr(Do,13)===Nr?(t=Nr,Do+=13):(t=i,Fo===0&&Go(Cr)),t===i&&(e.substr(Do,13)===kr?(t=kr,Do+=13):(t=i,Fo===0&&Go(Lr)),t===i&&(e.substr(Do,12)===Ar?(t=Ar,Do+=12):(t=i,Fo===0&&Go(Or)),t===i&&(e.substr(Do,12)===Mr?(t=Mr,Do+=12):(t=i,Fo===0&&Go(_r)),t===i&&(e.substr(Do,12)===Dr?(t=Dr,Do+=12):(t=i,Fo===0&&Go(Pr)),t===i&&(e.substr(Do,12)===Hr?(t=Hr,Do+=12):(t=i,Fo===0&&Go(Br)),t===i&&(e.substr(Do,12)===jr?(t=jr,Do+=12):(t=i,Fo===0&&Go(Fr)),t===i&&(e.substr(Do,11)===Ir?(t=Ir,Do+=11):(t=i,Fo===0&&Go(qr)),t===i&&(e.substr(Do,11)===Rr?(t=Rr,Do+=11):(t=i,Fo===0&&Go(Ur)),t===i&&(e.substr(Do,11)===zr?(t=zr,Do+=11):(t=i,Fo===0&&Go(Wr)),t===i&&(e.substr(Do,11)===Xr?(t=Xr,Do+=11):(t=i,Fo===0&&Go(Vr)),t===i&&(e.substr(Do,9)===$r?(t=$r,Do+=9):(t=i,Fo===0&&Go(Jr)),t===i&&(e.substr(Do,8)===Kr?(t=Kr,Do+=8):(t=i,Fo===0&&Go(Qr)),t===i&&(e.substr(Do,8)===Gr?(t=Gr,Do+=8):(t=i,Fo===0&&Go(Yr)),t===i&&(e.substr(Do,8)===Zr?(t=Zr,Do+=8):(t=i,Fo===0&&Go(ei)),t===i&&(e.substr(Do,8)===ti?(t=ti,Do+=8):(t=i,Fo===0&&Go(ni)),t===i&&(e.substr(Do,8)===ri?(t=ri,Do+=8):(t=i,Fo===0&&Go(ii)),t===i&&(e.substr(Do,8)===si?(t=si,Do+=8):(t=i,Fo===0&&Go(oi)),t===i&&(e.substr(Do,8)===ui?(t=ui,Do+=8):(t=i,Fo===0&&Go(ai)),t===i&&(e.substr(Do,7)===fi?(t=fi,Do+=7):(t=i,Fo===0&&Go(li)),t===i&&(e.substr(Do,7)===ci?(t=ci,Do+=7):(t=i,Fo===0&&Go(hi)),t===i&&(e.substr(Do,7)===pi?(t=pi,Do+=7):(t=i,Fo===0&&Go(di)),t===i&&(e.substr(Do,7)===vi?(t=vi,Do+=7):(t=i,Fo===0&&Go(mi)),t===i&&(e.substr(Do,7)===gi?(t=gi,Do+=7):(t=i,Fo===0&&Go(yi)),t===i&&(e.substr(Do,7)===bi?(t=bi,Do+=7):(t=i,Fo===0&&Go(wi)),t===i&&(e.substr(Do,7)===Ei?(t=Ei,Do+=7):(t=i,Fo===0&&Go(Si)),t===i&&(e.substr(Do,7)===xi?(t=xi,Do+=7):(t=i,Fo===0&&Go(Ti)),t===i&&(e.substr(Do,7)===Ni?(t=Ni,Do+=7):(t=i,Fo===0&&Go(Ci)),t===i&&(e.substr(Do,7)===ki?(t=ki,Do+=7):(t=i,Fo===0&&Go(Li)),t===i&&(e.substr(Do,7)===Ai?(t=Ai,Do+=7):(t=i,Fo===0&&Go(Oi)),t===i&&(e.substr(Do,7)===Mi?(t=Mi,Do+=7):(t=i,Fo===0&&Go(_i)),t===i&&(e.substr(Do,6)===Di?(t=Di,Do+=6):(t=i,Fo===0&&Go(Pi)),t===i&&(e.substr(Do,6)===Hi?(t=Hi,Do+=6):(t=i,Fo===0&&Go(Bi)),t===i&&(e.substr(Do,6)===ji?(t=ji,Do+=6):(t=i,Fo===0&&Go(Fi)),t===i&&(e.substr(Do,6)===Ii?(t=Ii,Do+=6):(t=i,Fo===0&&Go(qi)),t===i&&(e.substr(Do,6)===Ri?(t=Ri,Do+=6):(t=i,Fo===0&&Go(Ui)),t===i&&(e.substr(Do,6)===zi?(t=zi,Do+=6):(t=i,Fo===0&&Go(Wi)),t===i&&(e.substr(Do,6)===Xi?(t=Xi,Do+=6):(t=i,Fo===0&&Go(Vi)),t===i&&(e.substr(Do,6)===$i?(t=$i,Do+=6):(t=i,Fo===0&&Go(Ji)),t===i&&(e.substr(Do,5)===Ki?(t=Ki,Do+=5):(t=i,Fo===0&&Go(Qi)),t===i&&(e.substr(Do,5)===Gi?(t=Gi,Do+=5):(t=i,Fo===0&&Go(Yi)),t===i&&(e.substr(Do,5)===Zi?(t=Zi,Do+=5):(t=i,Fo===0&&Go(es)),t===i&&(e.substr(Do,5)===ts?(t=ts,Do+=5):(t=i,Fo===0&&Go(ns)),t===i&&(e.substr(Do,5)===rs?(t=rs,Do+=5):(t=i,Fo===0&&Go(is)),t===i&&(e.substr(Do,5)===ss?(t=ss,Do+=5):(t=i,Fo===0&&Go(os)),t===i&&(e.substr(Do,5)===us?(t=us,Do+=5):(t=i,Fo===0&&Go(as)),t===i&&(e.substr(Do,5)===fs?(t=fs,Do+=5):(t=i,Fo===0&&Go(ls)),t===i&&(e.substr(Do,4)===cs?(t=cs,Do+=4):(t=i,Fo===0&&Go(hs)),t===i&&(e.substr(Do,4)===ps?(t=ps,Do+=4):(t=i,Fo===0&&Go(ds)),t===i&&(e.substr(Do,4)===vs?(t=vs,Do+=4):(t=i,Fo===0&&Go(ms)),t===i&&(e.substr(Do,4)===gs?(t=gs,Do+=4):(t=i,Fo===0&&Go(ys)),t===i&&(e.substr(Do,4)===bs?(t=bs,Do+=4):(t=i,Fo===0&&Go(ws)),t===i&&(e.substr(Do,4)===Es?(t=Es,Do+=4):(t=i,Fo===0&&Go(Ss)),t===i&&(e.substr(Do,4)===xs?(t=xs,Do+=4):(t=i,Fo===0&&Go(Ts)),t===i&&(e.substr(Do,4)===Ns?(t=Ns,Do+=4):(t=i,Fo===0&&Go(Cs)),t===i&&(e.substr(Do,4)===ks?(t=ks,Do+=4):(t=i,Fo===0&&Go(Ls)),t===i&&(e.substr(Do,4)===As?(t=As,Do+=4):(t=i,Fo===0&&Go(Os)),t===i&&(e.substr(Do,4)===Ms?(t=Ms,Do+=4):(t=i,Fo===0&&Go(_s)),t===i&&(e.substr(Do,4)===Ds?(t=Ds,Do+=4):(t=i,Fo===0&&Go(Ps)),t===i&&(e.substr(Do,3)===Hs?(t=Hs,Do+=3):(t=i,Fo===0&&Go(Bs)),t===i&&(e.substr(Do,3)===js?(t=js,Do+=3):(t=i,Fo===0&&Go(Fs)),t===i&&(e.substr(Do,3)===Is?(t=Is,Do+=3):(t=i,Fo===0&&Go(qs)),t===i&&(e.charCodeAt(Do)===97?(t=Rs,Do++):(t=i,Fo===0&&Go(Us)),t===i&&(e.charCodeAt(Do)===103?(t=zs,Do++):(t=i,Fo===0&&Go(Ws)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),t}function Ru(){var e,t,n;return e=Do,t=Do,Fo++,n=Fu(),Fo--,n===i?t=void 0:(Do=t,t=i),t!==i?(n=Iu(),n!==i?(Po=e,t=Xs(t,n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Uu(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t}function zu(){var t,n,r;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;return n!==i?(Js.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Ks)),r===i&&(r=null),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Wu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===69?(n=Qs,Do++):(n=i,Fo===0&&Go(Gs)),n===i&&(e.charCodeAt(Do)===101?(n=Ys,Do++):(n=i,Fo===0&&Go(Zs))),n!==i?(e.charCodeAt(Do)===43?(r=at,Do++):(r=i,Fo===0&&Go(ft)),r===i&&(e.charCodeAt(Do)===45?(r=lt,Do++):(r=i,Fo===0&&Go(ct))),r===i&&(r=null),r!==i?(s=zu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Xu(){var t,n,r,s,o,u;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;if(n!==i){e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn));if(r!==i){s=[],o=Uu();while(o!==i)s.push(o),o=Uu();s!==i?(o=Wu(),o===i&&(o=null),o!==i?(Js.test(e.charAt(Do))?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(Ks)),u===i&&(u=null),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;if(t===i){t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;n!==i?(r=Wu(),r===i&&(r=null),r!==i?(Js.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(Ks)),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i);if(t===i){t=Do,e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn));if(n!==i){r=[],s=Uu();if(s!==i)while(s!==i)r.push(s),s=Uu();else r=i;r!==i?(s=Wu(),s===i&&(s=null),s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}}return t}function Vu(){var t,n,r;return t=Do,n=zu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,n=Xu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function $u(){var t,n,r,s,o;t=Do,e.charCodeAt(Do)===48?(n=no,Do++):(n=i,Fo===0&&Go(ro));if(n!==i){e.charCodeAt(Do)===120?(r=io,Do++):(r=i,Fo===0&&Go(so)),r===i&&(e.charCodeAt(Do)===88?(r=oo,Do++):(r=i,Fo===0&&Go(uo)));if(r!==i){s=[],o=Ju();if(o!==i)while(o!==i)s.push(o),o=Ju();else s=i;s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;return t}function Ju(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t===i&&(ao.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(fo)),t===i&&(lo.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(co)))),t}function Ku(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(r=Ju(),r!==i?(s=Ju(),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Qu(){var t,n,r,s,o;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(vo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(mo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(go.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(yo)),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i))),t}function Gu(){var t,n,r,s,o,u,a,f,l;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(s=Ju(),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(e.charCodeAt(Do)===123?(s=q,Do++):(s=i,Fo===0&&Go(R)),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(f=Ju(),f!==i?(e.charCodeAt(Do)===125?(l=U,Do++):(l=i,Fo===0&&Go(z)),l!==i?(n=[n,r,s,o,u,a,f,l],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)),t}function Yu(){var t,n,r;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(Eo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(So)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Gu(),t===i&&(t=Ku(),t===i&&(t=Qu()))),t}function Zu(){var t;return t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt))),t}function ea(){var t,n,r,s;return t=Do,n=Zu(),n!==i?(r=Do,Fo++,s=Zu(),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(e.charCodeAt(Do)===44?(t=yt,Do++):(t=i,Fo===0&&Go(bt))),t}function ta(){var e,t,n,r,s,o;e=Do,t=Pu();if(t!==i){n=[],r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);if(r!==i)while(r!==i)n.push(r),r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);else n=i;n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function na(){var t,n,r,s;t=Do,e.charCodeAt(Do)===34?(n=xo,Do++):(n=i,Fo===0&&Go(To));if(n!==i){r=[],s=ra();while(s!==i)r.push(s),s=ra();r!==i?(e.charCodeAt(Do)===34?(s=xo,Do++):(s=i,Fo===0&&Go(To)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;if(t===i){t=Do,e.charCodeAt(Do)===39?(n=No,Do++):(n=i,Fo===0&&Go(Co));if(n!==i){r=[],s=ia();while(s!==i)r.push(s),s=ia();r!==i?(e.charCodeAt(Do)===39?(s=No,Do++):(s=i,Fo===0&&Go(Co)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}return t}function ra(){var t,n,r;return t=Do,n=Do,Fo++,ko.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Lo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function ia(){var t,n,r;return t=Do,n=Do,Fo++,Ao.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Oo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function sa(){var t,n,r,s,o,u;t=Do,e.charCodeAt(Do)===35?(n=Mo,Do++):(n=i,Fo===0&&Go(_o));if(n!==i){r=[],s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);while(s!==i)r.push(s),s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);r!==i?(n=[n,r],t=n):(Do=t,t=i)}else Do=t,t=i;return t}n=n!==void 0?n:{};var i={},s={start:eu},a=eu,f="\r",h=Wo("\r",!1),m="\n",g=Wo("\n",!1),y=Vo(),w=";",E=Wo(";",!1),S="!",x=Wo("!",!1),T="NULL",N=Wo("NULL",!1),C="NA",k=Wo("NA",!1),L="Inf",A=Wo("Inf",!1),O="NaN",M=Wo("NaN",!1),_="TRUE",D=Wo("TRUE",!1),P="FALSE",H=Wo("FALSE",!1),B="next",j=Wo("next",!1),F="break",I=Wo("break",!1),q="{",R=Wo("{",!1),U="}",z=Wo("}",!1),W="if",X=Wo("if",!1),V="(",$=Wo("(",!1),J=")",K=Wo(")",!1),Q="else",G=Wo("else",!1),Y="for",Z=Wo("for",!1),et="in",tt=Wo("in",!1),nt="while",rt=Wo("while",!1),it="repeat",st=Wo("repeat",!1),ot="function",ut=Wo("function",!1),at="+",ft=Wo("+",!1),lt="-",ct=Wo("-",!1),ht="~",pt=Wo("~",!1),dt="=",vt=Wo("=",!1),mt="...",gt=Wo("...",!1),yt=",",bt=Wo(",",!1),wt=function(){return u("comma issues",Ro()),"comma"},Et=function(){return u("comma issues",Ro()),"comma"},St="[",xt=Wo("[",!1),Tt="]",Nt=Wo("]",!1),Ct="[[",kt=Wo("[[",!1),Lt="]]",At=Wo("]]",!1),Ot=function(e,i,s){var a,f,h,m,g=e;if(i)for(a=0;a<:+&*\-.$=\/]/,Ft=Xo([">","<",":","+","&","*","-",".","$","=","/"],!1,!1),It="%",qt=Wo("%",!1),Rt="<<-",Ut=Wo("<<-",!1),zt="->>",Wt=Wo("->>",!1),Xt=":::",Vt=Wo(":::",!1),$t="<-",Jt=Wo("<-",!1),Kt="==",Qt=Wo("==",!1),Gt="::",Yt=Wo("::",!1),Zt=">=",en=Wo(">=",!1),tn="!=",nn=Wo("!=",!1),rn="||",sn=Wo("||",!1),on="&&",un=Wo("&&",!1),an=":=",fn=Wo(":=",!1),ln="<=",cn=Wo("<=",!1),hn="->",pn=Wo("->",!1),dn="$",vn=Wo("$",!1),mn="@",gn=Wo("@",!1),yn="^",bn=Wo("^",!1),wn=":",En=Wo(":",!1),Sn="*",xn=Wo("*",!1),Tn="/",Nn=Wo("/",!1),Cn=">",kn=Wo(">",!1),Ln="<",An=Wo("<",!1),On="&",Mn=Wo("&",!1),_n="|",Dn=Wo("|",!1),Pn=/^[\n\r\u2028\u2029]/,Hn=Xo(["\n","\r","\u2028","\u2029"],!1,!1),Bn=/^[\t\x0B\f \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/,jn=Xo([" ","\x0b","\f"," ","\u00a0","\ufeff","\u1680","\u180e",["\u2000","\u200a"],"\u202f","\u205f","\u3000"],!1,!1),Fn=/^[a-zA-Z]/,In=Xo([["a","z"],["A","Z"]],!1,!1),qn=".",Rn=Wo(".",!1),Un="_",zn=Wo("_",!1),Wn=function(e,t){var n=t;return n?(n.unshift(e),n=n.join("")):n=e,n},Xn="feComponentTransfer",Vn=Wo("feComponentTransfer",!1),$n="feSpecularLighting",Jn=Wo("feSpecularLighting",!1),Kn="feDiffuseLighting",Qn=Wo("feDiffuseLighting",!1),Gn="feDisplacementMap",Yn=Wo("feDisplacementMap",!1),Zn="animateTransform",er=Wo("animateTransform",!1),tr="feConvolveMatrix",nr=Wo("feConvolveMatrix",!1),rr="font.face.format",ir=Wo("font.face.format",!1),sr="feDistantLight",or=Wo("feDistantLight",!1),ur="feGaussianBlur",ar=Wo("feGaussianBlur",!1),fr="font.face.name",lr=Wo("font.face.name",!1),cr="linearGradient",hr=Wo("linearGradient",!1),pr="radialGradient",dr=Wo("radialGradient",!1),vr="animateMotion",mr=Wo("animateMotion",!1),gr="color.profile",yr=Wo("color.profile",!1),br="feColorMatrix",wr=Wo("feColorMatrix",!1),Er="font.face.src",Sr=Wo("font.face.src",!1),xr="font.face.uri",Tr=Wo("font.face.uri",!1),Nr="foreignObject",Cr=Wo("foreignObject",!1),kr="missing.glyph",Lr=Wo("missing.glyph",!1),Ar="altGlyphItem",Or=Wo("altGlyphItem",!1),Mr="animateColor",_r=Wo("animateColor",!1),Dr="feMorphology",Pr=Wo("feMorphology",!1),Hr="fePointLight",Br=Wo("fePointLight",!1),jr="feTurbulence",Fr=Wo("feTurbulence",!1),Ir="altGlyphDef",qr=Wo("altGlyphDef",!1),Rr="feComposite",Ur=Wo("feComposite",!1),zr="feMergeNode",Wr=Wo("feMergeNode",!1),Xr="feSpotLight",Vr=Wo("feSpotLight",!1),$r="font.face",Jr=Wo("font.face",!1),Kr="altGlyph",Qr=Wo("altGlyph",!1),Gr="clipPath",Yr=Wo("clipPath",!1),Zr="feOffset",ei=Wo("feOffset",!1),ti="glyphRef",ni=Wo("glyphRef",!1),ri="metadata",ii=Wo("metadata",!1),si="polyline",oi=Wo("polyline",!1),ui="textPath",ai=Wo("textPath",!1),fi="animate",li=Wo("animate",!1),ci="ellipse",hi=Wo("ellipse",!1),pi="feBlend",di=Wo("feBlend",!1),vi="feFlood",mi=Wo("feFlood",!1),gi="feFuncA",yi=Wo("feFuncA",!1),bi="feFuncB",wi=Wo("feFuncB",!1),Ei="feFuncG",Si=Wo("feFuncG",!1),xi="feFuncR",Ti=Wo("feFuncR",!1),Ni="feImage",Ci=Wo("feImage",!1),ki="feMerge",Li=Wo("feMerge",!1),Ai="pattern",Oi=Wo("pattern",!1),Mi="polygon",_i=Wo("polygon",!1),Di="circle",Pi=Wo("circle",!1),Hi="cursor",Bi=Wo("cursor",!1),ji="feTile",Fi=Wo("feTile",!1),Ii="filter",qi=Wo("filter",!1),Ri="marker",Ui=Wo("marker",!1),zi="script",Wi=Wo("script",!1),Xi="switch",Vi=Wo("switch",!1),$i="symbol",Ji=Wo("symbol",!1),Ki="glyph",Qi=Wo("glyph",!1),Gi="hkern",Yi=Wo("hkern",!1),Zi="image",es=Wo("image",!1),ts="mpath",ns=Wo("mpath",!1),rs="style",is=Wo("style",!1),ss="title",os=Wo("title",!1),us="tspan",as=Wo("tspan",!1),fs="vkern",ls=Wo("vkern",!1),cs="defs",hs=Wo("defs",!1),ps="desc",ds=Wo("desc",!1),vs="font",ms=Wo("font",!1),gs="line",ys=Wo("line",!1),bs="mask",ws=Wo("mask",!1),Es="path",Ss=Wo("path",!1),xs="rect",Ts=Wo("rect",!1),Ns="stop",Cs=Wo("stop",!1),ks="text",Ls=Wo("text",!1),As="tref",Os=Wo("tref",!1),Ms="view",_s=Wo("view",!1),Ds="svgR",Ps=Wo("svgR",!1),Hs="set",Bs=Wo("set",!1),js="svg",Fs=Wo("svg",!1),Is="use",qs=Wo("use",!1),Rs="a",Us=Wo("a",!1),zs="g",Ws=Wo("g",!1),Xs=function(e,t){var n=t;return n},Vs=/^[0-9]/,$s=Xo([["0","9"]],!1,!1),Js=/^[Ll]/,Ks=Xo(["L","l"],!1,!1),Qs="E",Gs=Wo("E",!1),Ys="e",Zs=Wo("e",!1),eo="i",to=Wo("i",!1),no="0",ro=Wo("0",!1),io="x",so=Wo("x",!1),oo="X",uo=Wo("X",!1),ao=/^[a-f]/,fo=Xo([["a","f"]],!1,!1),lo=/^[A-F]/,co=Xo([["A","F"]],!1,!1),ho="\\",po=Wo("\\",!1),vo=/^[0-3]/,mo=Xo([["0","3"]],!1,!1),go=/^[0-7]/,yo=Xo([["0","7"]],!1,!1),bo="u",wo=Wo("u",!1),Eo=/^[abtnfrv"'\\]/,So=Xo(["a","b","t","n","f","r","v",'"',"'","\\"],!1,!1),xo='"',To=Wo('"',!1),No="'",Co=Wo("'",!1),ko=/^["]/,Lo=Xo(['"'],!1,!1),Ao=/^[']/,Oo=Xo(["'"],!1,!1),Mo="#",_o=Wo("#",!1),Do=0,Po=0,Ho=[{line:1,column:1}],Bo=0,jo=[],Fo=0,Io;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}Io=a();if(Io!==i&&Do===e.length)return Io;throw Io!==i&&Do0&&(result=w(t,n),w(t,n))}catch(s){if(s instanceof b){var o="error";s.message&&s.location.start.line&&u("Unexpected Symbol: "+s.found,s.location,"error")}}return e.forEach(function(e){var t=e.message,n=e.location,r=e.type;i.push({row:n.start.line-1,column:n.start.column-1,text:t,type:r})}),i}function S(r,i){e.length=0,t.length=0,"object"==typeof r&&(r=undefined),r=r||"";var s={};i&&(s={cursorPos:{row:i.row+1,column:i.column+1}});var o={tok:"",pos:{line:-1,col:-1}};try{if(r&&"string"==typeof r&&r.length>0){result=w(r,s);for(var a=0,f=t.length;a0){var i=r[0],s=p[i],o=v[i];available=s.concat(o)}return available}function T(e,t){return S(e,t).tok}var e=[],t=[];Array.prototype.hasValue=function(e){var t;for(t=0;t0){for(n=1,r=1;n-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.PtrStyleBehaviour=p}),ace.define("ace/mode/folding/ptrstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[|\()[^\}\]\)]*$/,this.foldingStopMarker=/^[^\[\{\(]*(\}|\]|\))/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/ptr",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/ptr_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/ptr_completions","ace/worker/worker_client","ace/mode/behaviour/ptrstyle","ace/mode/folding/ptrstyle"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("./text_highlight_rules").TextHighlightRules,u=e("./ptr_highlight_rules").PtrHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("./ptr_completions").PtrCompletions,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/ptrstyle").PtrStyleBehaviour,h=e("./folding/ptrstyle").FoldMode,p=function(){this.HighlightRules=u,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h,this.$completer=new f};i.inherits(p,s),function(){this.lineCommentStart="#",this.$id="ace/mode/ptr",this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/ptr_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("errors",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(p.prototype),t.Mode=p}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],SVGR:[{token:"support.function",regex:"^\\s*```\\s*",push:"ptrcode-start"},{token:"constant.language.escape",regex:"",next:"start"}],SNIPPET:[{token:"support.function",regex:"^\\s*```\\s*",push:"snippetcode-start"},{token:"constant.language.escape",regex:"",next:"start"}],POPUP:[{token:"support.function",regex:"^\\s*```\\s*",push:"textcode-start"},{token:"constant.language.escape",regex:"",next:"start"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{defaultToken:"support.function"}]}),this.embedRules(c,"ptrcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"snippetcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(s,"textcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};r.inherits(d,s),t.DnippetsHighlightRules=d}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?r[0]=="`"?e.bgTokenizer.getState(n)=="start"?"end":"start":"start":""},this.getFoldWidgetRange=function(e,t,n){function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(/[^#]/)}var r=e.getLine(n),i=r.length,o=e.getLength(),u=n,a=n;if(!r.match(this.foldingStartMarker))return;if(r[0]=="`"){if(e.bgTokenizer.getState(n)!=="start"){while(++n0){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(n,r.length,u,0)}var f,c="markup.heading";if(l(n)){var p=h();while(++n=p)break}a=n-(!f||["=","-"].indexOf(f.value[0])==-1?1:2);if(a>u)while(a>u&&/^\s*$/.test(e.getLine(a)))a--;if(a>u){var v=e.getLine(a).length;return new s(u,i,a,v)}}}}.call(o.prototype)}),ace.define("ace/mode/dnippets",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/ptr","ace/mode/snippets","ace/mode/dnippets_highlight_rules","ace/mode/folding/markdown"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./xml").Mode,u=e("./html").Mode,a=e("./ptr").Mode,f=e("./snippets").Mode,l=e("./dnippets_highlight_rules").DnippetsHighlightRules,c=e("./folding/markdown").FoldMode,h=function(){this.HighlightRules=l,this.createModeDelegates({"js-":s,"xml-":o,"html-":u,"ptr-":a,"snippet-":f}),this.foldingRules=new c,this.$behaviour=this.$defaultBehaviour};r.inherits(h,i),function(){this.type="text",this.blockComment={start:""},this.getNextLineIndent=function(e,t,n){if(e=="listblock"){var r=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!r)return"";var i=r[2];return i||(i=parseInt(r[3],10)+1+"."),r[1]+i+r[4]}return this.$getIndent(t)},this.$id="ace/mode/dnippets"}.call(h.prototype),t.Mode=h}) \ No newline at end of file diff --git a/inst/App/www/Acejs/mode-javascript.js b/inst/App/www/Acejs/mode-javascript.js old mode 100644 new mode 100755 diff --git a/inst/App/www/Acejs/mode-ptr.js b/inst/App/www/Acejs/mode-ptr.js old mode 100644 new mode 100755 index 0d63c459..18b8f117 --- a/inst/App/www/Acejs/mode-ptr.js +++ b/inst/App/www/Acejs/mode-ptr.js @@ -1 +1 @@ -ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/ptr_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|")),n=i.arrayToMap("animate|animateColor|animateMotion|animateTransform|set".split("|")),r=i.arrayToMap("desc|metadata|title".split("|")),s=i.arrayToMap("feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feFlood|feGaussianBlur|feImage|feMerge|feMorphology|feOffset|feSpecularLighting|feTile|feTurbulence".split("|")),u=i.arrayToMap("linearGradient|radialGradient".split("|")),a=i.arrayToMap("circle|ellipse|line|path|polygon|polyline|rect".split("|")),f=i.arrayToMap("ptR|tagR|svg|svgR|defs|g|Merge|symbol|use".split("|")),l=i.arrayToMap("altGlyph|textPath|tref|tspan|text".split("|")),c=i.arrayToMap("filter".split("|")),h=i.arrayToMap("mask|marker".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:["identifier","text","keyword.operator"],regex:"([a-zA-Z.][a-zA-Z0-9._]*\\b)(\\s*)(=)"},{onMatch:function(i){return e[i]?"keyword":t[i]?"constant.language":n[i]?".bold.italic.svgRAN":r[i]?".bold.italic.svgRME":s[i]?".bold.italic.svgRFE":u[i]?".bold.italic.svgRGR":a[i]?".bold.italic.svgRSH":f[i]?".bold.italic.svgRCO":l[i]?".bold.italic.svgRTX":c[i]?".bold.italic.svgRFI":h[i]?".bold.italic.svgRMM":i=="..."||i.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var p=(new o("comment")).getRules();for(var d=0;dn)return-1;if(e===n){if(tr)return-1}return 0}function r(e,t){var r=n(e.location.start.line,e.location.start.column,t.row,t.column),i=n(t.row,t.column,e.location.end.line,e.location.end.column);return n(e.location.start.line,e.location.start.column,t.row,t.column)==1&&n(t.row,t.column,e.location.end.line,e.location.end.column)==1}function i(e,r,i){if(r){var s=n(e.location.start.line,e.location.start.column,r.row,r.column),o=n(r.row,r.column,e.location.end.line,e.location.end.column);if(n(e.location.start.line,e.location.start.column,r.row,r.column)==1&&n(r.row,r.column,e.location.end.line,e.location.end.column)==1){var u=[];!i||(u=i.filter(function(e){return e instanceof l}).map(function(e){e.token})),t.push({token:e.token,location:e.location,attrs:u})}}}function s(){t=[]}function o(t,n){e.push({message:t,location:n,type:"warning"})}function u(t,n){e.push({message:t,location:n,type:"error"})}function a(){e=[]}function f(e,t){console.log("\n"+e+" Result:\n"+JSON.stringify(t)+"\n")}function l(e,t){this.token=e,this.location=t}function c(e,t){this.token=e,this.location=t}function h(e){e?console.log("location: "+e.start.line+","+e.start.column):console.log("location is null")}function y(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function b(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b)}function w(e,n){function qo(){return e.substring(Po,Do)}function Ro(){return Qo(Po,Do)}function Uo(t,n){throw n=n!==void 0?n:Qo(Po,Do),Zo([Jo(t)],e.substring(Po,Do),n)}function zo(e,t){throw t=t!==void 0?t:Qo(Po,Do),Yo(e,t)}function Wo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xo(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Vo(){return{type:"any"}}function $o(){return{type:"end"}}function Jo(e){return{type:"other",description:e}}function Ko(t){var n=Ho[t],r;if(n)return n;r=t-1;while(!Ho[r])r--;n=Ho[r],n={line:n.line,column:n.column};while(rBo&&(Bo=Do,jo=[]),jo.push(e)}function Yo(e,t){return new b(e,null,null,t)}function Zo(e,t,n){return new b(b.buildMessage(e,t),e,t,n)}function eu(){var e;return e=su(),e}function tu(){var t,n,r;return t=Do,e.charCodeAt(Do)===13?(n=f,Do++):(n=i,Fo===0&&Go(h)),n===i&&(n=null),n!==i?(e.charCodeAt(Do)===10?(r=m,Do++):(r=i,Fo===0&&Go(g)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function nu(){var t,n;return t=Do,Fo++,e.length>Do?(n=e.charAt(Do),Do++):(n=i,Fo===0&&Go(y)),Fo--,n===i?t=void 0:(Do=t,t=i),t}function ru(){var t,n,r;return t=Do,n=sa(),n!==i?(r=tu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=tu(),t===i&&(e.charCodeAt(Do)===59?(t=w,Do++):(t=i,Fo===0&&Go(E)))),t}function iu(){var e,t,n,r,s,o,u,a,f,l;e=Do,t=Pu();if(t!==i){n=Do,r=ou();if(r!==i){s=[],o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);while(o!==i)s.push(o),o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);s!==i?(r=[r,s],n=r):(Do=n,n=i)}else Do=n,n=i;n===i&&(n=null),n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function su(){var e,t,n,r;return e=Do,t=iu(),t!==i?(n=Pu(),n!==i?(r=nu(),r!==i?(t=[t,n,r],e=t):(Do=e,e=i)):(Do=e,e=i)):(Do=e,e=i),e}function ou(){var t,n,r,s;return t=Eu(),t===i&&(t=Do,n=Do,e.charCodeAt(Do)===33?(r=S,Do++):(r=i,Fo===0&&Go(x)),r!==i?(s=Bu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(n=null),n!==i?(r=Mu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function uu(){var t;return t=Ru(),t===i&&(t=na(),t===i&&(t=$u(),t===i&&(t=Vu(),t===i&&(t=Xu(),t===i&&(t=zu(),t===i&&(e.substr(Do,4)===T?(t=T,Do+=4):(t=i,Fo===0&&Go(N)),t===i&&(e.substr(Do,2)===C?(t=C,Do+=2):(t=i,Fo===0&&Go(k)),t===i&&(e.substr(Do,3)===L?(t=L,Do+=3):(t=i,Fo===0&&Go(A)),t===i&&(e.substr(Do,3)===O?(t=O,Do+=3):(t=i,Fo===0&&Go(M)),t===i&&(e.substr(Do,4)===_?(t=_,Do+=4):(t=i,Fo===0&&Go(D)),t===i&&(e.substr(Do,5)===P?(t=P,Do+=5):(t=i,Fo===0&&Go(H)),t===i&&(e.substr(Do,4)===B?(t=B,Do+=4):(t=i,Fo===0&&Go(j)),t===i&&(e.substr(Do,5)===F?(t=F,Do+=5):(t=i,Fo===0&&Go(I))))))))))))))),t}function au(){var t,n,r,s,o,u,a,f,l,c,h,p,d,v;return t=Do,e.charCodeAt(Do)===123?(n=q,Do++):(n=i,Fo===0&&Go(R)),n!==i?(r=Pu(),r!==i?(s=iu(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===125?(u=U,Do++):(u=i,Fo===0&&Go(z)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Bu(),h!==i?(e.substr(Do,4)===Q?(p=Q,Do+=4):(p=i,Fo===0&&Go(G)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=Ru(),u!==i?(a=Pu(),a!==i?(e.substr(Do,2)===et?(f=et,Do+=2):(f=i,Fo===0&&Go(tt)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Pu(),h!==i?(e.charCodeAt(Do)===41?(p=J,Do++):(p=i,Fo===0&&Go(K)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=hu(),u===i&&(u=null),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===43?(n=at,Do++):(n=i,Fo===0&&Go(ft)),n===i&&(e.charCodeAt(Do)===45?(n=lt,Do++):(n=i,Fo===0&&Go(ct)),n===i&&(e.charCodeAt(Do)===126?(n=ht,Do++):(n=i,Fo===0&&Go(pt)))),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i))))))))),t}function fu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Ru(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function lu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=fu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function cu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=fu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=wt()),t=n,t}function hu(){var e,t,n,r,s,o;e=Do,t=fu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function pu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function du(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=pu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function vu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=pu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=Et()),t=n,t}function mu(){var e,t,n,r,s,o;e=Do,t=pu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function gu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.charCodeAt(Do)===91?(r=St,Do++):(r=i,Fo===0&&Go(xt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===93?(a=Tt,Do++):(a=i,Fo===0&&Go(Nt)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function yu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.substr(Do,2)===Ct?(r=Ct,Do+=2):(r=i,Fo===0&&Go(kt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.substr(Do,2)===Lt?(a=Lt,Do+=2):(a=i,Fo===0&&Go(At)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function bu(){var t,n,r,s,o,u;return t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=mu(),s===i&&(s=null),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function wu(){var e,t,n,r,s,o;e=Do,t=au(),t===i&&(t=uu());if(t!==i){n=[],r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Eu(){var t,n,r,s,o,u,a;return t=Do,n=qu(),n!==i?(e.charCodeAt(Do)===40?(r=V,Do++):(r=i,Fo===0&&Go($)),r!==i?(s=Pu(),s!==i?(o=Lu(),o===i&&(o=null),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===41?(a=J,Do++):(a=i,Fo===0&&Go(K)),a===i&&(a=nu()),a!==i?(Po=t,n=Ot(n,o,a),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Su(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(Po=t,n=Mt(n),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function xu(){var t,n;return t=Eu(),t===i&&(t=ou(),t===i&&(t=Do,e.substr(Do,3)===mt?(n=mt,Do+=3):(n=i,Fo===0&&Go(gt)),n!==i&&(Po=t,n=_t()),t=n)),t}function Tu(){var e;return e=Su(),e===i&&(e=xu()),e}function Nu(){var t,n,r,s;return t=Do,n=Do,e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r!==i?(s=Pu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i?(r=Tu(),r!==i?(Po=t,n=Dt(n,r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function Cu(){var t,n,r;return t=Do,n=Pu(),n!==i?(e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r===i&&(r=Tu()),r!==i?(Po=t,n=Pt(r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function ku(){var e,t,n;return e=Do,t=Bu(),t!==i?(n=Nu(),n===i&&(n=Cu()),n!==i?(Po=e,t=Ht(n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Lu(){var e,t,n,r;e=Do,t=Tu();if(t!==i){n=[],r=ku();while(r!==i)n.push(r),r=ku();n!==i?(Po=e,t=Bt(t,n),e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Au(){var t;return jt.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Ft)),t===i&&(t=ju()),t}function Ou(){var t,n,r,s;t=Do,e.charCodeAt(Do)===37?(n=It,Do++):(n=i,Fo===0&&Go(qt));if(n!==i){r=[],s=Au();while(s!==i)r.push(s),s=Au();r!==i?(e.charCodeAt(Do)===37?(s=It,Do++):(s=i,Fo===0&&Go(qt)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;return t===i&&(e.substr(Do,3)===Rt?(t=Rt,Do+=3):(t=i,Fo===0&&Go(Ut)),t===i&&(e.substr(Do,3)===zt?(t=zt,Do+=3):(t=i,Fo===0&&Go(Wt)),t===i&&(e.substr(Do,3)===Xt?(t=Xt,Do+=3):(t=i,Fo===0&&Go(Vt)),t===i&&(e.substr(Do,2)===$t?(t=$t,Do+=2):(t=i,Fo===0&&Go(Jt)),t===i&&(e.substr(Do,2)===Kt?(t=Kt,Do+=2):(t=i,Fo===0&&Go(Qt)),t===i&&(e.substr(Do,2)===Gt?(t=Gt,Do+=2):(t=i,Fo===0&&Go(Yt)),t===i&&(e.substr(Do,2)===Zt?(t=Zt,Do+=2):(t=i,Fo===0&&Go(en)),t===i&&(e.substr(Do,2)===tn?(t=tn,Do+=2):(t=i,Fo===0&&Go(nn)),t===i&&(e.substr(Do,2)===rn?(t=rn,Do+=2):(t=i,Fo===0&&Go(sn)),t===i&&(e.substr(Do,2)===on?(t=on,Do+=2):(t=i,Fo===0&&Go(un)),t===i&&(e.substr(Do,2)===an?(t=an,Do+=2):(t=i,Fo===0&&Go(fn)),t===i&&(e.substr(Do,2)===ln?(t=ln,Do+=2):(t=i,Fo===0&&Go(cn)),t===i&&(e.substr(Do,2)===hn?(t=hn,Do+=2):(t=i,Fo===0&&Go(pn)),t===i&&(e.charCodeAt(Do)===36?(t=dn,Do++):(t=i,Fo===0&&Go(vn)),t===i&&(e.charCodeAt(Do)===64?(t=mn,Do++):(t=i,Fo===0&&Go(gn)),t===i&&(e.charCodeAt(Do)===94?(t=yn,Do++):(t=i,Fo===0&&Go(bn)),t===i&&(e.charCodeAt(Do)===58?(t=wn,Do++):(t=i,Fo===0&&Go(En)),t===i&&(e.charCodeAt(Do)===42?(t=Sn,Do++):(t=i,Fo===0&&Go(xn)),t===i&&(e.charCodeAt(Do)===47?(t=Tn,Do++):(t=i,Fo===0&&Go(Nn)),t===i&&(e.charCodeAt(Do)===43?(t=at,Do++):(t=i,Fo===0&&Go(ft)),t===i&&(e.charCodeAt(Do)===45?(t=lt,Do++):(t=i,Fo===0&&Go(ct)),t===i&&(e.charCodeAt(Do)===62?(t=Cn,Do++):(t=i,Fo===0&&Go(kn)),t===i&&(e.charCodeAt(Do)===60?(t=Ln,Do++):(t=i,Fo===0&&Go(An)),t===i&&(e.charCodeAt(Do)===38?(t=On,Do++):(t=i,Fo===0&&Go(Mn)),t===i&&(e.charCodeAt(Do)===124?(t=_n,Do++):(t=i,Fo===0&&Go(Dn)),t===i&&(e.charCodeAt(Do)===126?(t=ht,Do++):(t=i,Fo===0&&Go(pt)),t===i&&(e.charCodeAt(Do)===61?(t=dt,Do++):(t=i,Fo===0&&Go(vt))))))))))))))))))))))))))))),t}function Mu(){var e,t,n,r,s,o,u,a,f;e=Do,t=wu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function _u(){var t;return Pn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Hn)),t}function Du(){var t;return Bn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(jn)),t}function Pu(){var e,t;e=[],t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));while(t!==i)e.push(t),t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));return e}function Hu(){var e,t;e=[],t=Du(),t===i&&(t=sa());while(t!==i)e.push(t),t=Du(),t===i&&(t=sa());return e}function Bu(){var e,t;e=[],t=Du();while(t!==i)e.push(t),t=Du();return e}function ju(){var t;return Fn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(In)),t}function Fu(){var t,n,r,s;return t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n===i&&(e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n===i&&(e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n===i&&(e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n===i&&(e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n===i&&(e.substr(Do,4)===B?(n=B,Do+=4):(n=i,Fo===0&&Go(j)),n===i&&(e.substr(Do,2)===et?(n=et,Do+=2):(n=i,Fo===0&&Go(tt)))))))),n!==i?(r=Do,Fo++,s=Uu(),s===i&&(s=ju()),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Iu(){var t,n,r,s;t=Do,n=ju(),n===i&&(n=Do,e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn)),r!==i?(s=ju(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn))));if(n!==i){r=[],s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));while(s!==i)r.push(s),s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));r!==i?(Po=t,n=Wn(n,r),t=n):(Do=t,t=i)}else Do=t,t=i;return t}function qu(){var t;return e.substr(Do,19)===Xn?(t=Xn,Do+=19):(t=i,Fo===0&&Go(Vn)),t===i&&(e.substr(Do,18)===$n?(t=$n,Do+=18):(t=i,Fo===0&&Go(Jn)),t===i&&(e.substr(Do,17)===Kn?(t=Kn,Do+=17):(t=i,Fo===0&&Go(Qn)),t===i&&(e.substr(Do,17)===Gn?(t=Gn,Do+=17):(t=i,Fo===0&&Go(Yn)),t===i&&(e.substr(Do,16)===Zn?(t=Zn,Do+=16):(t=i,Fo===0&&Go(er)),t===i&&(e.substr(Do,16)===tr?(t=tr,Do+=16):(t=i,Fo===0&&Go(nr)),t===i&&(e.substr(Do,16)===rr?(t=rr,Do+=16):(t=i,Fo===0&&Go(ir)),t===i&&(e.substr(Do,14)===sr?(t=sr,Do+=14):(t=i,Fo===0&&Go(or)),t===i&&(e.substr(Do,14)===ur?(t=ur,Do+=14):(t=i,Fo===0&&Go(ar)),t===i&&(e.substr(Do,14)===fr?(t=fr,Do+=14):(t=i,Fo===0&&Go(lr)),t===i&&(e.substr(Do,14)===cr?(t=cr,Do+=14):(t=i,Fo===0&&Go(hr)),t===i&&(e.substr(Do,14)===pr?(t=pr,Do+=14):(t=i,Fo===0&&Go(dr)),t===i&&(e.substr(Do,13)===vr?(t=vr,Do+=13):(t=i,Fo===0&&Go(mr)),t===i&&(e.substr(Do,13)===gr?(t=gr,Do+=13):(t=i,Fo===0&&Go(yr)),t===i&&(e.substr(Do,13)===br?(t=br,Do+=13):(t=i,Fo===0&&Go(wr)),t===i&&(e.substr(Do,13)===Er?(t=Er,Do+=13):(t=i,Fo===0&&Go(Sr)),t===i&&(e.substr(Do,13)===xr?(t=xr,Do+=13):(t=i,Fo===0&&Go(Tr)),t===i&&(e.substr(Do,13)===Nr?(t=Nr,Do+=13):(t=i,Fo===0&&Go(Cr)),t===i&&(e.substr(Do,13)===kr?(t=kr,Do+=13):(t=i,Fo===0&&Go(Lr)),t===i&&(e.substr(Do,12)===Ar?(t=Ar,Do+=12):(t=i,Fo===0&&Go(Or)),t===i&&(e.substr(Do,12)===Mr?(t=Mr,Do+=12):(t=i,Fo===0&&Go(_r)),t===i&&(e.substr(Do,12)===Dr?(t=Dr,Do+=12):(t=i,Fo===0&&Go(Pr)),t===i&&(e.substr(Do,12)===Hr?(t=Hr,Do+=12):(t=i,Fo===0&&Go(Br)),t===i&&(e.substr(Do,12)===jr?(t=jr,Do+=12):(t=i,Fo===0&&Go(Fr)),t===i&&(e.substr(Do,11)===Ir?(t=Ir,Do+=11):(t=i,Fo===0&&Go(qr)),t===i&&(e.substr(Do,11)===Rr?(t=Rr,Do+=11):(t=i,Fo===0&&Go(Ur)),t===i&&(e.substr(Do,11)===zr?(t=zr,Do+=11):(t=i,Fo===0&&Go(Wr)),t===i&&(e.substr(Do,11)===Xr?(t=Xr,Do+=11):(t=i,Fo===0&&Go(Vr)),t===i&&(e.substr(Do,9)===$r?(t=$r,Do+=9):(t=i,Fo===0&&Go(Jr)),t===i&&(e.substr(Do,8)===Kr?(t=Kr,Do+=8):(t=i,Fo===0&&Go(Qr)),t===i&&(e.substr(Do,8)===Gr?(t=Gr,Do+=8):(t=i,Fo===0&&Go(Yr)),t===i&&(e.substr(Do,8)===Zr?(t=Zr,Do+=8):(t=i,Fo===0&&Go(ei)),t===i&&(e.substr(Do,8)===ti?(t=ti,Do+=8):(t=i,Fo===0&&Go(ni)),t===i&&(e.substr(Do,8)===ri?(t=ri,Do+=8):(t=i,Fo===0&&Go(ii)),t===i&&(e.substr(Do,8)===si?(t=si,Do+=8):(t=i,Fo===0&&Go(oi)),t===i&&(e.substr(Do,8)===ui?(t=ui,Do+=8):(t=i,Fo===0&&Go(ai)),t===i&&(e.substr(Do,7)===fi?(t=fi,Do+=7):(t=i,Fo===0&&Go(li)),t===i&&(e.substr(Do,7)===ci?(t=ci,Do+=7):(t=i,Fo===0&&Go(hi)),t===i&&(e.substr(Do,7)===pi?(t=pi,Do+=7):(t=i,Fo===0&&Go(di)),t===i&&(e.substr(Do,7)===vi?(t=vi,Do+=7):(t=i,Fo===0&&Go(mi)),t===i&&(e.substr(Do,7)===gi?(t=gi,Do+=7):(t=i,Fo===0&&Go(yi)),t===i&&(e.substr(Do,7)===bi?(t=bi,Do+=7):(t=i,Fo===0&&Go(wi)),t===i&&(e.substr(Do,7)===Ei?(t=Ei,Do+=7):(t=i,Fo===0&&Go(Si)),t===i&&(e.substr(Do,7)===xi?(t=xi,Do+=7):(t=i,Fo===0&&Go(Ti)),t===i&&(e.substr(Do,7)===Ni?(t=Ni,Do+=7):(t=i,Fo===0&&Go(Ci)),t===i&&(e.substr(Do,7)===ki?(t=ki,Do+=7):(t=i,Fo===0&&Go(Li)),t===i&&(e.substr(Do,7)===Ai?(t=Ai,Do+=7):(t=i,Fo===0&&Go(Oi)),t===i&&(e.substr(Do,7)===Mi?(t=Mi,Do+=7):(t=i,Fo===0&&Go(_i)),t===i&&(e.substr(Do,6)===Di?(t=Di,Do+=6):(t=i,Fo===0&&Go(Pi)),t===i&&(e.substr(Do,6)===Hi?(t=Hi,Do+=6):(t=i,Fo===0&&Go(Bi)),t===i&&(e.substr(Do,6)===ji?(t=ji,Do+=6):(t=i,Fo===0&&Go(Fi)),t===i&&(e.substr(Do,6)===Ii?(t=Ii,Do+=6):(t=i,Fo===0&&Go(qi)),t===i&&(e.substr(Do,6)===Ri?(t=Ri,Do+=6):(t=i,Fo===0&&Go(Ui)),t===i&&(e.substr(Do,6)===zi?(t=zi,Do+=6):(t=i,Fo===0&&Go(Wi)),t===i&&(e.substr(Do,6)===Xi?(t=Xi,Do+=6):(t=i,Fo===0&&Go(Vi)),t===i&&(e.substr(Do,6)===$i?(t=$i,Do+=6):(t=i,Fo===0&&Go(Ji)),t===i&&(e.substr(Do,5)===Ki?(t=Ki,Do+=5):(t=i,Fo===0&&Go(Qi)),t===i&&(e.substr(Do,5)===Gi?(t=Gi,Do+=5):(t=i,Fo===0&&Go(Yi)),t===i&&(e.substr(Do,5)===Zi?(t=Zi,Do+=5):(t=i,Fo===0&&Go(es)),t===i&&(e.substr(Do,5)===ts?(t=ts,Do+=5):(t=i,Fo===0&&Go(ns)),t===i&&(e.substr(Do,5)===rs?(t=rs,Do+=5):(t=i,Fo===0&&Go(is)),t===i&&(e.substr(Do,5)===ss?(t=ss,Do+=5):(t=i,Fo===0&&Go(os)),t===i&&(e.substr(Do,5)===us?(t=us,Do+=5):(t=i,Fo===0&&Go(as)),t===i&&(e.substr(Do,5)===fs?(t=fs,Do+=5):(t=i,Fo===0&&Go(ls)),t===i&&(e.substr(Do,4)===cs?(t=cs,Do+=4):(t=i,Fo===0&&Go(hs)),t===i&&(e.substr(Do,4)===ps?(t=ps,Do+=4):(t=i,Fo===0&&Go(ds)),t===i&&(e.substr(Do,4)===vs?(t=vs,Do+=4):(t=i,Fo===0&&Go(ms)),t===i&&(e.substr(Do,4)===gs?(t=gs,Do+=4):(t=i,Fo===0&&Go(ys)),t===i&&(e.substr(Do,4)===bs?(t=bs,Do+=4):(t=i,Fo===0&&Go(ws)),t===i&&(e.substr(Do,4)===Es?(t=Es,Do+=4):(t=i,Fo===0&&Go(Ss)),t===i&&(e.substr(Do,4)===xs?(t=xs,Do+=4):(t=i,Fo===0&&Go(Ts)),t===i&&(e.substr(Do,4)===Ns?(t=Ns,Do+=4):(t=i,Fo===0&&Go(Cs)),t===i&&(e.substr(Do,4)===ks?(t=ks,Do+=4):(t=i,Fo===0&&Go(Ls)),t===i&&(e.substr(Do,4)===As?(t=As,Do+=4):(t=i,Fo===0&&Go(Os)),t===i&&(e.substr(Do,4)===Ms?(t=Ms,Do+=4):(t=i,Fo===0&&Go(_s)),t===i&&(e.substr(Do,4)===Ds?(t=Ds,Do+=4):(t=i,Fo===0&&Go(Ps)),t===i&&(e.substr(Do,3)===Hs?(t=Hs,Do+=3):(t=i,Fo===0&&Go(Bs)),t===i&&(e.substr(Do,3)===js?(t=js,Do+=3):(t=i,Fo===0&&Go(Fs)),t===i&&(e.substr(Do,3)===Is?(t=Is,Do+=3):(t=i,Fo===0&&Go(qs)),t===i&&(e.charCodeAt(Do)===97?(t=Rs,Do++):(t=i,Fo===0&&Go(Us)),t===i&&(e.charCodeAt(Do)===103?(t=zs,Do++):(t=i,Fo===0&&Go(Ws)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),t}function Ru(){var e,t,n;return e=Do,t=Do,Fo++,n=Fu(),Fo--,n===i?t=void 0:(Do=t,t=i),t!==i?(n=Iu(),n!==i?(Po=e,t=Xs(t,n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Uu(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t}function zu(){var t,n,r;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;return n!==i?(Js.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Ks)),r===i&&(r=null),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Wu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===69?(n=Qs,Do++):(n=i,Fo===0&&Go(Gs)),n===i&&(e.charCodeAt(Do)===101?(n=Ys,Do++):(n=i,Fo===0&&Go(Zs))),n!==i?(e.charCodeAt(Do)===43?(r=at,Do++):(r=i,Fo===0&&Go(ft)),r===i&&(e.charCodeAt(Do)===45?(r=lt,Do++):(r=i,Fo===0&&Go(ct))),r===i&&(r=null),r!==i?(s=zu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Xu(){var t,n,r,s,o,u;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;if(n!==i){e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn));if(r!==i){s=[],o=Uu();while(o!==i)s.push(o),o=Uu();s!==i?(o=Wu(),o===i&&(o=null),o!==i?(Js.test(e.charAt(Do))?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(Ks)),u===i&&(u=null),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;if(t===i){t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;n!==i?(r=Wu(),r===i&&(r=null),r!==i?(Js.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(Ks)),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i);if(t===i){t=Do,e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn));if(n!==i){r=[],s=Uu();if(s!==i)while(s!==i)r.push(s),s=Uu();else r=i;r!==i?(s=Wu(),s===i&&(s=null),s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}}return t}function Vu(){var t,n,r;return t=Do,n=zu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,n=Xu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function $u(){var t,n,r,s,o;t=Do,e.charCodeAt(Do)===48?(n=no,Do++):(n=i,Fo===0&&Go(ro));if(n!==i){e.charCodeAt(Do)===120?(r=io,Do++):(r=i,Fo===0&&Go(so)),r===i&&(e.charCodeAt(Do)===88?(r=oo,Do++):(r=i,Fo===0&&Go(uo)));if(r!==i){s=[],o=Ju();if(o!==i)while(o!==i)s.push(o),o=Ju();else s=i;s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;return t}function Ju(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t===i&&(ao.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(fo)),t===i&&(lo.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(co)))),t}function Ku(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(r=Ju(),r!==i?(s=Ju(),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Qu(){var t,n,r,s,o;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(vo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(mo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(go.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(yo)),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i))),t}function Gu(){var t,n,r,s,o,u,a,f,l;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(s=Ju(),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(e.charCodeAt(Do)===123?(s=q,Do++):(s=i,Fo===0&&Go(R)),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(f=Ju(),f!==i?(e.charCodeAt(Do)===125?(l=U,Do++):(l=i,Fo===0&&Go(z)),l!==i?(n=[n,r,s,o,u,a,f,l],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)),t}function Yu(){var t,n,r;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(Eo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(So)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Gu(),t===i&&(t=Ku(),t===i&&(t=Qu()))),t}function Zu(){var t;return t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt))),t}function ea(){var t,n,r,s;return t=Do,n=Zu(),n!==i?(r=Do,Fo++,s=Zu(),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(e.charCodeAt(Do)===44?(t=yt,Do++):(t=i,Fo===0&&Go(bt))),t}function ta(){var e,t,n,r,s,o;e=Do,t=Pu();if(t!==i){n=[],r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);if(r!==i)while(r!==i)n.push(r),r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);else n=i;n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function na(){var t,n,r,s;t=Do,e.charCodeAt(Do)===34?(n=xo,Do++):(n=i,Fo===0&&Go(To));if(n!==i){r=[],s=ra();while(s!==i)r.push(s),s=ra();r!==i?(e.charCodeAt(Do)===34?(s=xo,Do++):(s=i,Fo===0&&Go(To)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;if(t===i){t=Do,e.charCodeAt(Do)===39?(n=No,Do++):(n=i,Fo===0&&Go(Co));if(n!==i){r=[],s=ia();while(s!==i)r.push(s),s=ia();r!==i?(e.charCodeAt(Do)===39?(s=No,Do++):(s=i,Fo===0&&Go(Co)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}return t}function ra(){var t,n,r;return t=Do,n=Do,Fo++,ko.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Lo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function ia(){var t,n,r;return t=Do,n=Do,Fo++,Ao.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Oo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function sa(){var t,n,r,s,o,u;t=Do,e.charCodeAt(Do)===35?(n=Mo,Do++):(n=i,Fo===0&&Go(_o));if(n!==i){r=[],s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);while(s!==i)r.push(s),s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);r!==i?(n=[n,r],t=n):(Do=t,t=i)}else Do=t,t=i;return t}n=n!==void 0?n:{};var i={},s={start:eu},a=eu,f="\r",h=Wo("\r",!1),m="\n",g=Wo("\n",!1),y=Vo(),w=";",E=Wo(";",!1),S="!",x=Wo("!",!1),T="NULL",N=Wo("NULL",!1),C="NA",k=Wo("NA",!1),L="Inf",A=Wo("Inf",!1),O="NaN",M=Wo("NaN",!1),_="TRUE",D=Wo("TRUE",!1),P="FALSE",H=Wo("FALSE",!1),B="next",j=Wo("next",!1),F="break",I=Wo("break",!1),q="{",R=Wo("{",!1),U="}",z=Wo("}",!1),W="if",X=Wo("if",!1),V="(",$=Wo("(",!1),J=")",K=Wo(")",!1),Q="else",G=Wo("else",!1),Y="for",Z=Wo("for",!1),et="in",tt=Wo("in",!1),nt="while",rt=Wo("while",!1),it="repeat",st=Wo("repeat",!1),ot="function",ut=Wo("function",!1),at="+",ft=Wo("+",!1),lt="-",ct=Wo("-",!1),ht="~",pt=Wo("~",!1),dt="=",vt=Wo("=",!1),mt="...",gt=Wo("...",!1),yt=",",bt=Wo(",",!1),wt=function(){return u("comma issues",Ro()),"comma"},Et=function(){return u("comma issues",Ro()),"comma"},St="[",xt=Wo("[",!1),Tt="]",Nt=Wo("]",!1),Ct="[[",kt=Wo("[[",!1),Lt="]]",At=Wo("]]",!1),Ot=function(e,i,s){var a,f,h,m,g=e;if(i)for(a=0;a<:+&*\-.$=\/]/,Ft=Xo([">","<",":","+","&","*","-",".","$","=","/"],!1,!1),It="%",qt=Wo("%",!1),Rt="<<-",Ut=Wo("<<-",!1),zt="->>",Wt=Wo("->>",!1),Xt=":::",Vt=Wo(":::",!1),$t="<-",Jt=Wo("<-",!1),Kt="==",Qt=Wo("==",!1),Gt="::",Yt=Wo("::",!1),Zt=">=",en=Wo(">=",!1),tn="!=",nn=Wo("!=",!1),rn="||",sn=Wo("||",!1),on="&&",un=Wo("&&",!1),an=":=",fn=Wo(":=",!1),ln="<=",cn=Wo("<=",!1),hn="->",pn=Wo("->",!1),dn="$",vn=Wo("$",!1),mn="@",gn=Wo("@",!1),yn="^",bn=Wo("^",!1),wn=":",En=Wo(":",!1),Sn="*",xn=Wo("*",!1),Tn="/",Nn=Wo("/",!1),Cn=">",kn=Wo(">",!1),Ln="<",An=Wo("<",!1),On="&",Mn=Wo("&",!1),_n="|",Dn=Wo("|",!1),Pn=/^[\n\r\u2028\u2029]/,Hn=Xo(["\n","\r","\u2028","\u2029"],!1,!1),Bn=/^[\t\x0B\f \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/,jn=Xo([" ","\x0b","\f"," ","\u00a0","\ufeff","\u1680","\u180e",["\u2000","\u200a"],"\u202f","\u205f","\u3000"],!1,!1),Fn=/^[a-zA-Z]/,In=Xo([["a","z"],["A","Z"]],!1,!1),qn=".",Rn=Wo(".",!1),Un="_",zn=Wo("_",!1),Wn=function(e,t){var n=t;return n?(n.unshift(e),n=n.join("")):n=e,n},Xn="feComponentTransfer",Vn=Wo("feComponentTransfer",!1),$n="feSpecularLighting",Jn=Wo("feSpecularLighting",!1),Kn="feDiffuseLighting",Qn=Wo("feDiffuseLighting",!1),Gn="feDisplacementMap",Yn=Wo("feDisplacementMap",!1),Zn="animateTransform",er=Wo("animateTransform",!1),tr="feConvolveMatrix",nr=Wo("feConvolveMatrix",!1),rr="font.face.format",ir=Wo("font.face.format",!1),sr="feDistantLight",or=Wo("feDistantLight",!1),ur="feGaussianBlur",ar=Wo("feGaussianBlur",!1),fr="font.face.name",lr=Wo("font.face.name",!1),cr="linearGradient",hr=Wo("linearGradient",!1),pr="radialGradient",dr=Wo("radialGradient",!1),vr="animateMotion",mr=Wo("animateMotion",!1),gr="color.profile",yr=Wo("color.profile",!1),br="feColorMatrix",wr=Wo("feColorMatrix",!1),Er="font.face.src",Sr=Wo("font.face.src",!1),xr="font.face.uri",Tr=Wo("font.face.uri",!1),Nr="foreignObject",Cr=Wo("foreignObject",!1),kr="missing.glyph",Lr=Wo("missing.glyph",!1),Ar="altGlyphItem",Or=Wo("altGlyphItem",!1),Mr="animateColor",_r=Wo("animateColor",!1),Dr="feMorphology",Pr=Wo("feMorphology",!1),Hr="fePointLight",Br=Wo("fePointLight",!1),jr="feTurbulence",Fr=Wo("feTurbulence",!1),Ir="altGlyphDef",qr=Wo("altGlyphDef",!1),Rr="feComposite",Ur=Wo("feComposite",!1),zr="feMergeNode",Wr=Wo("feMergeNode",!1),Xr="feSpotLight",Vr=Wo("feSpotLight",!1),$r="font.face",Jr=Wo("font.face",!1),Kr="altGlyph",Qr=Wo("altGlyph",!1),Gr="clipPath",Yr=Wo("clipPath",!1),Zr="feOffset",ei=Wo("feOffset",!1),ti="glyphRef",ni=Wo("glyphRef",!1),ri="metadata",ii=Wo("metadata",!1),si="polyline",oi=Wo("polyline",!1),ui="textPath",ai=Wo("textPath",!1),fi="animate",li=Wo("animate",!1),ci="ellipse",hi=Wo("ellipse",!1),pi="feBlend",di=Wo("feBlend",!1),vi="feFlood",mi=Wo("feFlood",!1),gi="feFuncA",yi=Wo("feFuncA",!1),bi="feFuncB",wi=Wo("feFuncB",!1),Ei="feFuncG",Si=Wo("feFuncG",!1),xi="feFuncR",Ti=Wo("feFuncR",!1),Ni="feImage",Ci=Wo("feImage",!1),ki="feMerge",Li=Wo("feMerge",!1),Ai="pattern",Oi=Wo("pattern",!1),Mi="polygon",_i=Wo("polygon",!1),Di="circle",Pi=Wo("circle",!1),Hi="cursor",Bi=Wo("cursor",!1),ji="feTile",Fi=Wo("feTile",!1),Ii="filter",qi=Wo("filter",!1),Ri="marker",Ui=Wo("marker",!1),zi="script",Wi=Wo("script",!1),Xi="switch",Vi=Wo("switch",!1),$i="symbol",Ji=Wo("symbol",!1),Ki="glyph",Qi=Wo("glyph",!1),Gi="hkern",Yi=Wo("hkern",!1),Zi="image",es=Wo("image",!1),ts="mpath",ns=Wo("mpath",!1),rs="style",is=Wo("style",!1),ss="title",os=Wo("title",!1),us="tspan",as=Wo("tspan",!1),fs="vkern",ls=Wo("vkern",!1),cs="defs",hs=Wo("defs",!1),ps="desc",ds=Wo("desc",!1),vs="font",ms=Wo("font",!1),gs="line",ys=Wo("line",!1),bs="mask",ws=Wo("mask",!1),Es="path",Ss=Wo("path",!1),xs="rect",Ts=Wo("rect",!1),Ns="stop",Cs=Wo("stop",!1),ks="text",Ls=Wo("text",!1),As="tref",Os=Wo("tref",!1),Ms="view",_s=Wo("view",!1),Ds="svgR",Ps=Wo("svgR",!1),Hs="set",Bs=Wo("set",!1),js="svg",Fs=Wo("svg",!1),Is="use",qs=Wo("use",!1),Rs="a",Us=Wo("a",!1),zs="g",Ws=Wo("g",!1),Xs=function(e,t){var n=t;return n},Vs=/^[0-9]/,$s=Xo([["0","9"]],!1,!1),Js=/^[Ll]/,Ks=Xo(["L","l"],!1,!1),Qs="E",Gs=Wo("E",!1),Ys="e",Zs=Wo("e",!1),eo="i",to=Wo("i",!1),no="0",ro=Wo("0",!1),io="x",so=Wo("x",!1),oo="X",uo=Wo("X",!1),ao=/^[a-f]/,fo=Xo([["a","f"]],!1,!1),lo=/^[A-F]/,co=Xo([["A","F"]],!1,!1),ho="\\",po=Wo("\\",!1),vo=/^[0-3]/,mo=Xo([["0","3"]],!1,!1),go=/^[0-7]/,yo=Xo([["0","7"]],!1,!1),bo="u",wo=Wo("u",!1),Eo=/^[abtnfrv"'\\]/,So=Xo(["a","b","t","n","f","r","v",'"',"'","\\"],!1,!1),xo='"',To=Wo('"',!1),No="'",Co=Wo("'",!1),ko=/^["]/,Lo=Xo(['"'],!1,!1),Ao=/^[']/,Oo=Xo(["'"],!1,!1),Mo="#",_o=Wo("#",!1),Do=0,Po=0,Ho=[{line:1,column:1}],Bo=0,jo=[],Fo=0,Io;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}Io=a();if(Io!==i&&Do===e.length)return Io;throw Io!==i&&Do0&&(result=w(t,n),w(t,n))}catch(s){if(s instanceof b){var o="error";s.message&&s.location.start.line&&u("Unexpected Symbol: "+s.found,s.location,"error")}}return e.forEach(function(e){var t=e.message,n=e.location,r=e.type;i.push({row:n.start.line-1,column:n.start.column-1,text:t,type:r})}),i}function S(r,i){e.length=0,t.length=0,"object"==typeof r&&(r=undefined),r=r||"";var s={};i&&(s={cursorPos:{row:i.row+1,column:i.column+1}});var o={tok:"",pos:{line:-1,col:-1}};try{if(r&&"string"==typeof r&&r.length>0){result=w(r,s);for(var a=0,f=t.length;a0){var i=r[0],s=p[i],o=v[i];available=s.concat(o)}return available}function T(e,t){return S(e,t).tok}var e=[],t=[];Array.prototype.hasValue=function(e){var t;for(t=0;t0){for(n=1,r=1;n-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.PtrStyleBehaviour=p}),ace.define("ace/mode/folding/ptrstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[|\()[^\}\]\)]*$/,this.foldingStopMarker=/^[^\[\{\(]*(\}|\]|\))/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/ptr",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/ptr_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/ptr_completions","ace/worker/worker_client","ace/mode/behaviour/ptrstyle","ace/mode/folding/ptrstyle"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("./text_highlight_rules").TextHighlightRules,u=e("./ptr_highlight_rules").PtrHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("./ptr_completions").PtrCompletions,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/ptrstyle").PtrStyleBehaviour,h=e("./folding/ptrstyle").FoldMode,p=function(){this.HighlightRules=u,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h,this.$completer=new f};i.inherits(p,s),function(){this.lineCommentStart="#",this.$id="ace/mode/ptr",this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/ptr_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("errors",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(p.prototype),t.Mode=p}) \ No newline at end of file +ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/ptr_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|")),n=i.arrayToMap("animate|animateColor|animateMotion|animateTransform|set".split("|")),r=i.arrayToMap("desc|metadata|title".split("|")),s=i.arrayToMap("feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feFlood|feGaussianBlur|feImage|feMerge|feMorphology|feOffset|feSpecularLighting|feTile|feTurbulence".split("|")),u=i.arrayToMap("linearGradient|radialGradient".split("|")),a=i.arrayToMap("circle|ellipse|line|path|polygon|polyline|rect".split("|")),f=i.arrayToMap("ptR|tagR|svg|svgR|defs|g|Merge|symbol|use".split("|")),l=i.arrayToMap("altGlyph|textPath|tref|tspan|text".split("|")),c=i.arrayToMap("filter".split("|")),h=i.arrayToMap("mask|marker".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:["identifier","text","keyword.operator"],regex:"([a-zA-Z.][a-zA-Z0-9._]*\\b)(\\s*)(=)"},{onMatch:function(i){return e[i]?"keyword":t[i]?"constant.language":n[i]?".italic.svgRAN":r[i]?".italic.svgRME":s[i]?".italic.svgRFE":u[i]?".italic.svgRGR":a[i]?".italic.svgRSH":f[i]?".italic.svgRCO":l[i]?".italic.svgRTX":c[i]?".italic.svgRFI":h[i]?".italic.svgRMM":i=="..."||i.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var p=(new o("comment")).getRules();for(var d=0;dn)return-1;if(e===n){if(tr)return-1}return 0}function r(e,t){var r=n(e.location.start.line,e.location.start.column,t.row,t.column),i=n(t.row,t.column,e.location.end.line,e.location.end.column);return n(e.location.start.line,e.location.start.column,t.row,t.column)==1&&n(t.row,t.column,e.location.end.line,e.location.end.column)==1}function i(e,r,i){if(r){var s=n(e.location.start.line,e.location.start.column,r.row,r.column),o=n(r.row,r.column,e.location.end.line,e.location.end.column);if(n(e.location.start.line,e.location.start.column,r.row,r.column)==1&&n(r.row,r.column,e.location.end.line,e.location.end.column)==1){var u=[];!i||(u=i.filter(function(e){return e instanceof l}).map(function(e){e.token})),t.push({token:e.token,location:e.location,attrs:u})}}}function s(){t=[]}function o(t,n){e.push({message:t,location:n,type:"warning"})}function u(t,n){e.push({message:t,location:n,type:"error"})}function a(){e=[]}function f(e,t){console.log("\n"+e+" Result:\n"+JSON.stringify(t)+"\n")}function l(e,t){this.token=e,this.location=t}function c(e,t){this.token=e,this.location=t}function h(e){e?console.log("location: "+e.start.line+","+e.start.column):console.log("location is null")}function y(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function b(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b)}function w(e,n){function qo(){return e.substring(Po,Do)}function Ro(){return Qo(Po,Do)}function Uo(t,n){throw n=n!==void 0?n:Qo(Po,Do),Zo([Jo(t)],e.substring(Po,Do),n)}function zo(e,t){throw t=t!==void 0?t:Qo(Po,Do),Yo(e,t)}function Wo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xo(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Vo(){return{type:"any"}}function $o(){return{type:"end"}}function Jo(e){return{type:"other",description:e}}function Ko(t){var n=Ho[t],r;if(n)return n;r=t-1;while(!Ho[r])r--;n=Ho[r],n={line:n.line,column:n.column};while(rBo&&(Bo=Do,jo=[]),jo.push(e)}function Yo(e,t){return new b(e,null,null,t)}function Zo(e,t,n){return new b(b.buildMessage(e,t),e,t,n)}function eu(){var e;return e=su(),e}function tu(){var t,n,r;return t=Do,e.charCodeAt(Do)===13?(n=f,Do++):(n=i,Fo===0&&Go(h)),n===i&&(n=null),n!==i?(e.charCodeAt(Do)===10?(r=m,Do++):(r=i,Fo===0&&Go(g)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function nu(){var t,n;return t=Do,Fo++,e.length>Do?(n=e.charAt(Do),Do++):(n=i,Fo===0&&Go(y)),Fo--,n===i?t=void 0:(Do=t,t=i),t}function ru(){var t,n,r;return t=Do,n=sa(),n!==i?(r=tu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=tu(),t===i&&(e.charCodeAt(Do)===59?(t=w,Do++):(t=i,Fo===0&&Go(E)))),t}function iu(){var e,t,n,r,s,o,u,a,f,l;e=Do,t=Pu();if(t!==i){n=Do,r=ou();if(r!==i){s=[],o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);while(o!==i)s.push(o),o=Do,u=Bu(),u!==i?(a=ru(),a!==i?(f=Pu(),f!==i?(l=ou(),l!==i?(u=[u,a,f,l],o=u):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i)):(Do=o,o=i);s!==i?(r=[r,s],n=r):(Do=n,n=i)}else Do=n,n=i;n===i&&(n=null),n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function su(){var e,t,n,r;return e=Do,t=iu(),t!==i?(n=Pu(),n!==i?(r=nu(),r!==i?(t=[t,n,r],e=t):(Do=e,e=i)):(Do=e,e=i)):(Do=e,e=i),e}function ou(){var t,n,r,s;return t=Eu(),t===i&&(t=Do,n=Do,e.charCodeAt(Do)===33?(r=S,Do++):(r=i,Fo===0&&Go(x)),r!==i?(s=Bu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(n=null),n!==i?(r=Mu(),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function uu(){var t;return t=Ru(),t===i&&(t=na(),t===i&&(t=$u(),t===i&&(t=Vu(),t===i&&(t=Xu(),t===i&&(t=zu(),t===i&&(e.substr(Do,4)===T?(t=T,Do+=4):(t=i,Fo===0&&Go(N)),t===i&&(e.substr(Do,2)===C?(t=C,Do+=2):(t=i,Fo===0&&Go(k)),t===i&&(e.substr(Do,3)===L?(t=L,Do+=3):(t=i,Fo===0&&Go(A)),t===i&&(e.substr(Do,3)===O?(t=O,Do+=3):(t=i,Fo===0&&Go(M)),t===i&&(e.substr(Do,4)===_?(t=_,Do+=4):(t=i,Fo===0&&Go(D)),t===i&&(e.substr(Do,5)===P?(t=P,Do+=5):(t=i,Fo===0&&Go(H)),t===i&&(e.substr(Do,4)===B?(t=B,Do+=4):(t=i,Fo===0&&Go(j)),t===i&&(e.substr(Do,5)===F?(t=F,Do+=5):(t=i,Fo===0&&Go(I))))))))))))))),t}function au(){var t,n,r,s,o,u,a,f,l,c,h,p,d,v;return t=Do,e.charCodeAt(Do)===123?(n=q,Do++):(n=i,Fo===0&&Go(R)),n!==i?(r=Pu(),r!==i?(s=iu(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===125?(u=U,Do++):(u=i,Fo===0&&Go(z)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Bu(),h!==i?(e.substr(Do,4)===Q?(p=Q,Do+=4):(p=i,Fo===0&&Go(G)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=Ru(),u!==i?(a=Pu(),a!==i?(e.substr(Do,2)===et?(f=et,Do+=2):(f=i,Fo===0&&Go(tt)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(h=Pu(),h!==i?(e.charCodeAt(Do)===41?(p=J,Do++):(p=i,Fo===0&&Go(K)),p!==i?(d=Pu(),d!==i?(v=ou(),v!==i?(n=[n,r,s,o,u,a,f,l,c,h,p,d,v],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===40?(s=V,Do++):(s=i,Fo===0&&Go($)),s!==i?(o=Pu(),o!==i?(u=hu(),u===i&&(u=null),u!==i?(a=Pu(),a!==i?(e.charCodeAt(Do)===41?(f=J,Do++):(f=i,Fo===0&&Go(K)),f!==i?(l=Pu(),l!==i?(c=ou(),c!==i?(n=[n,r,s,o,u,a,f,l,c],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===43?(n=at,Do++):(n=i,Fo===0&&Go(ft)),n===i&&(e.charCodeAt(Do)===45?(n=lt,Do++):(n=i,Fo===0&&Go(ct)),n===i&&(e.charCodeAt(Do)===126?(n=ht,Do++):(n=i,Fo===0&&Go(pt)))),n!==i?(r=Pu(),r!==i?(s=ou(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i))))))))),t}function fu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Ru(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function lu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=fu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function cu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=fu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=wt()),t=n,t}function hu(){var e,t,n,r,s,o;e=Do,t=fu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=lu(),o===i&&(o=cu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function pu(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt)))),t}function du(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===44?(n=yt,Do++):(n=i,Fo===0&&Go(bt)),n!==i?(r=Pu(),r!==i?(s=pu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function vu(){var t,n,r,s;return t=Do,n=Do,r=Pu(),r!==i?(e.charCodeAt(Do)===44?(s=yt,Do++):(s=i,Fo===0&&Go(bt)),s===i&&(s=pu()),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i&&(Po=t,n=Et()),t=n,t}function mu(){var e,t,n,r,s,o;e=Do,t=pu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=du(),o===i&&(o=vu()),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function gu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.charCodeAt(Do)===91?(r=St,Do++):(r=i,Fo===0&&Go(xt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===93?(a=Tt,Do++):(a=i,Fo===0&&Go(Nt)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function yu(){var t,n,r,s,o,u,a;return t=Do,n=Bu(),n!==i?(e.substr(Do,2)===Ct?(r=Ct,Do+=2):(r=i,Fo===0&&Go(kt)),r!==i?(s=Pu(),s!==i?(o=ta(),o!==i?(u=Pu(),u!==i?(e.substr(Do,2)===Lt?(a=Lt,Do+=2):(a=i,Fo===0&&Go(At)),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function bu(){var t,n,r,s,o,u;return t=Do,e.charCodeAt(Do)===40?(n=V,Do++):(n=i,Fo===0&&Go($)),n!==i?(r=Pu(),r!==i?(s=mu(),s===i&&(s=null),s!==i?(o=Pu(),o!==i?(e.charCodeAt(Do)===41?(u=J,Do++):(u=i,Fo===0&&Go(K)),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function wu(){var e,t,n,r,s,o;e=Do,t=au(),t===i&&(t=uu());if(t!==i){n=[],r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Do,Fo++,o=ru(),Fo--,o===i?s=void 0:(Do=s,s=i),s!==i?(o=yu(),o===i&&(o=gu(),o===i&&(o=bu())),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Eu(){var t,n,r,s,o,u,a;return t=Do,n=qu(),n!==i?(e.charCodeAt(Do)===40?(r=V,Do++):(r=i,Fo===0&&Go($)),r!==i?(s=Pu(),s!==i?(o=Lu(),o===i&&(o=null),o!==i?(u=Pu(),u!==i?(e.charCodeAt(Do)===41?(a=J,Do++):(a=i,Fo===0&&Go(K)),a===i&&(a=nu()),a!==i?(Po=t,n=Ot(n,o,a),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Su(){var t,n,r,s,o,u;return t=Do,n=Ru(),n!==i?(r=Bu(),r!==i?(e.charCodeAt(Do)===61?(s=dt,Do++):(s=i,Fo===0&&Go(vt)),s!==i?(o=Pu(),o!==i?(u=ou(),u!==i?(Po=t,n=Mt(n),t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function xu(){var t,n;return t=Eu(),t===i&&(t=ou(),t===i&&(t=Do,e.substr(Do,3)===mt?(n=mt,Do+=3):(n=i,Fo===0&&Go(gt)),n!==i&&(Po=t,n=_t()),t=n)),t}function Tu(){var e;return e=Su(),e===i&&(e=xu()),e}function Nu(){var t,n,r,s;return t=Do,n=Do,e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r!==i?(s=Pu(),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n!==i?(r=Tu(),r!==i?(Po=t,n=Dt(n,r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function Cu(){var t,n,r;return t=Do,n=Pu(),n!==i?(e.charCodeAt(Do)===44?(r=yt,Do++):(r=i,Fo===0&&Go(bt)),r===i&&(r=Tu()),r!==i?(Po=t,n=Pt(r),t=n):(Do=t,t=i)):(Do=t,t=i),t}function ku(){var e,t,n;return e=Do,t=Bu(),t!==i?(n=Nu(),n===i&&(n=Cu()),n!==i?(Po=e,t=Ht(n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Lu(){var e,t,n,r;e=Do,t=Tu();if(t!==i){n=[],r=ku();while(r!==i)n.push(r),r=ku();n!==i?(Po=e,t=Bt(t,n),e=t):(Do=e,e=i)}else Do=e,e=i;return e}function Au(){var t;return jt.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Ft)),t===i&&(t=ju()),t}function Ou(){var t,n,r,s;t=Do,e.charCodeAt(Do)===37?(n=It,Do++):(n=i,Fo===0&&Go(qt));if(n!==i){r=[],s=Au();while(s!==i)r.push(s),s=Au();r!==i?(e.charCodeAt(Do)===37?(s=It,Do++):(s=i,Fo===0&&Go(qt)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;return t===i&&(e.substr(Do,3)===Rt?(t=Rt,Do+=3):(t=i,Fo===0&&Go(Ut)),t===i&&(e.substr(Do,3)===zt?(t=zt,Do+=3):(t=i,Fo===0&&Go(Wt)),t===i&&(e.substr(Do,3)===Xt?(t=Xt,Do+=3):(t=i,Fo===0&&Go(Vt)),t===i&&(e.substr(Do,2)===$t?(t=$t,Do+=2):(t=i,Fo===0&&Go(Jt)),t===i&&(e.substr(Do,2)===Kt?(t=Kt,Do+=2):(t=i,Fo===0&&Go(Qt)),t===i&&(e.substr(Do,2)===Gt?(t=Gt,Do+=2):(t=i,Fo===0&&Go(Yt)),t===i&&(e.substr(Do,2)===Zt?(t=Zt,Do+=2):(t=i,Fo===0&&Go(en)),t===i&&(e.substr(Do,2)===tn?(t=tn,Do+=2):(t=i,Fo===0&&Go(nn)),t===i&&(e.substr(Do,2)===rn?(t=rn,Do+=2):(t=i,Fo===0&&Go(sn)),t===i&&(e.substr(Do,2)===on?(t=on,Do+=2):(t=i,Fo===0&&Go(un)),t===i&&(e.substr(Do,2)===an?(t=an,Do+=2):(t=i,Fo===0&&Go(fn)),t===i&&(e.substr(Do,2)===ln?(t=ln,Do+=2):(t=i,Fo===0&&Go(cn)),t===i&&(e.substr(Do,2)===hn?(t=hn,Do+=2):(t=i,Fo===0&&Go(pn)),t===i&&(e.charCodeAt(Do)===36?(t=dn,Do++):(t=i,Fo===0&&Go(vn)),t===i&&(e.charCodeAt(Do)===64?(t=mn,Do++):(t=i,Fo===0&&Go(gn)),t===i&&(e.charCodeAt(Do)===94?(t=yn,Do++):(t=i,Fo===0&&Go(bn)),t===i&&(e.charCodeAt(Do)===58?(t=wn,Do++):(t=i,Fo===0&&Go(En)),t===i&&(e.charCodeAt(Do)===42?(t=Sn,Do++):(t=i,Fo===0&&Go(xn)),t===i&&(e.charCodeAt(Do)===47?(t=Tn,Do++):(t=i,Fo===0&&Go(Nn)),t===i&&(e.charCodeAt(Do)===43?(t=at,Do++):(t=i,Fo===0&&Go(ft)),t===i&&(e.charCodeAt(Do)===45?(t=lt,Do++):(t=i,Fo===0&&Go(ct)),t===i&&(e.charCodeAt(Do)===62?(t=Cn,Do++):(t=i,Fo===0&&Go(kn)),t===i&&(e.charCodeAt(Do)===60?(t=Ln,Do++):(t=i,Fo===0&&Go(An)),t===i&&(e.charCodeAt(Do)===38?(t=On,Do++):(t=i,Fo===0&&Go(Mn)),t===i&&(e.charCodeAt(Do)===124?(t=_n,Do++):(t=i,Fo===0&&Go(Dn)),t===i&&(e.charCodeAt(Do)===126?(t=ht,Do++):(t=i,Fo===0&&Go(pt)),t===i&&(e.charCodeAt(Do)===61?(t=dt,Do++):(t=i,Fo===0&&Go(vt))))))))))))))))))))))))))))),t}function Mu(){var e,t,n,r,s,o,u,a,f;e=Do,t=wu();if(t!==i){n=[],r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);while(r!==i)n.push(r),r=Do,s=Bu(),s!==i?(o=Ou(),o!==i?(u=Pu(),u!==i?(a=ou(),a!==i?(f=Bu(),f!==i?(s=[s,o,u,a,f],r=s):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i)):(Do=r,r=i);n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function _u(){var t;return Pn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(Hn)),t}function Du(){var t;return Bn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(jn)),t}function Pu(){var e,t;e=[],t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));while(t!==i)e.push(t),t=Du(),t===i&&(t=_u(),t===i&&(t=sa()));return e}function Hu(){var e,t;e=[],t=Du(),t===i&&(t=sa());while(t!==i)e.push(t),t=Du(),t===i&&(t=sa());return e}function Bu(){var e,t;e=[],t=Du();while(t!==i)e.push(t),t=Du();return e}function ju(){var t;return Fn.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(In)),t}function Fu(){var t,n,r,s;return t=Do,e.substr(Do,8)===ot?(n=ot,Do+=8):(n=i,Fo===0&&Go(ut)),n===i&&(e.substr(Do,2)===W?(n=W,Do+=2):(n=i,Fo===0&&Go(X)),n===i&&(e.substr(Do,3)===Y?(n=Y,Do+=3):(n=i,Fo===0&&Go(Z)),n===i&&(e.substr(Do,5)===nt?(n=nt,Do+=5):(n=i,Fo===0&&Go(rt)),n===i&&(e.substr(Do,6)===it?(n=it,Do+=6):(n=i,Fo===0&&Go(st)),n===i&&(e.substr(Do,4)===B?(n=B,Do+=4):(n=i,Fo===0&&Go(j)),n===i&&(e.substr(Do,2)===et?(n=et,Do+=2):(n=i,Fo===0&&Go(tt)))))))),n!==i?(r=Do,Fo++,s=Uu(),s===i&&(s=ju()),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Iu(){var t,n,r,s;t=Do,n=ju(),n===i&&(n=Do,e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn)),r!==i?(s=ju(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))),s!==i?(r=[r,s],n=r):(Do=n,n=i)):(Do=n,n=i),n===i&&(e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn))));if(n!==i){r=[],s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));while(s!==i)r.push(s),s=ju(),s===i&&(s=Uu(),s===i&&(e.charCodeAt(Do)===95?(s=Un,Do++):(s=i,Fo===0&&Go(zn)),s===i&&(e.charCodeAt(Do)===46?(s=qn,Do++):(s=i,Fo===0&&Go(Rn)))));r!==i?(Po=t,n=Wn(n,r),t=n):(Do=t,t=i)}else Do=t,t=i;return t}function qu(){var t;return e.substr(Do,19)===Xn?(t=Xn,Do+=19):(t=i,Fo===0&&Go(Vn)),t===i&&(e.substr(Do,18)===$n?(t=$n,Do+=18):(t=i,Fo===0&&Go(Jn)),t===i&&(e.substr(Do,17)===Kn?(t=Kn,Do+=17):(t=i,Fo===0&&Go(Qn)),t===i&&(e.substr(Do,17)===Gn?(t=Gn,Do+=17):(t=i,Fo===0&&Go(Yn)),t===i&&(e.substr(Do,16)===Zn?(t=Zn,Do+=16):(t=i,Fo===0&&Go(er)),t===i&&(e.substr(Do,16)===tr?(t=tr,Do+=16):(t=i,Fo===0&&Go(nr)),t===i&&(e.substr(Do,16)===rr?(t=rr,Do+=16):(t=i,Fo===0&&Go(ir)),t===i&&(e.substr(Do,14)===sr?(t=sr,Do+=14):(t=i,Fo===0&&Go(or)),t===i&&(e.substr(Do,14)===ur?(t=ur,Do+=14):(t=i,Fo===0&&Go(ar)),t===i&&(e.substr(Do,14)===fr?(t=fr,Do+=14):(t=i,Fo===0&&Go(lr)),t===i&&(e.substr(Do,14)===cr?(t=cr,Do+=14):(t=i,Fo===0&&Go(hr)),t===i&&(e.substr(Do,14)===pr?(t=pr,Do+=14):(t=i,Fo===0&&Go(dr)),t===i&&(e.substr(Do,13)===vr?(t=vr,Do+=13):(t=i,Fo===0&&Go(mr)),t===i&&(e.substr(Do,13)===gr?(t=gr,Do+=13):(t=i,Fo===0&&Go(yr)),t===i&&(e.substr(Do,13)===br?(t=br,Do+=13):(t=i,Fo===0&&Go(wr)),t===i&&(e.substr(Do,13)===Er?(t=Er,Do+=13):(t=i,Fo===0&&Go(Sr)),t===i&&(e.substr(Do,13)===xr?(t=xr,Do+=13):(t=i,Fo===0&&Go(Tr)),t===i&&(e.substr(Do,13)===Nr?(t=Nr,Do+=13):(t=i,Fo===0&&Go(Cr)),t===i&&(e.substr(Do,13)===kr?(t=kr,Do+=13):(t=i,Fo===0&&Go(Lr)),t===i&&(e.substr(Do,12)===Ar?(t=Ar,Do+=12):(t=i,Fo===0&&Go(Or)),t===i&&(e.substr(Do,12)===Mr?(t=Mr,Do+=12):(t=i,Fo===0&&Go(_r)),t===i&&(e.substr(Do,12)===Dr?(t=Dr,Do+=12):(t=i,Fo===0&&Go(Pr)),t===i&&(e.substr(Do,12)===Hr?(t=Hr,Do+=12):(t=i,Fo===0&&Go(Br)),t===i&&(e.substr(Do,12)===jr?(t=jr,Do+=12):(t=i,Fo===0&&Go(Fr)),t===i&&(e.substr(Do,11)===Ir?(t=Ir,Do+=11):(t=i,Fo===0&&Go(qr)),t===i&&(e.substr(Do,11)===Rr?(t=Rr,Do+=11):(t=i,Fo===0&&Go(Ur)),t===i&&(e.substr(Do,11)===zr?(t=zr,Do+=11):(t=i,Fo===0&&Go(Wr)),t===i&&(e.substr(Do,11)===Xr?(t=Xr,Do+=11):(t=i,Fo===0&&Go(Vr)),t===i&&(e.substr(Do,9)===$r?(t=$r,Do+=9):(t=i,Fo===0&&Go(Jr)),t===i&&(e.substr(Do,8)===Kr?(t=Kr,Do+=8):(t=i,Fo===0&&Go(Qr)),t===i&&(e.substr(Do,8)===Gr?(t=Gr,Do+=8):(t=i,Fo===0&&Go(Yr)),t===i&&(e.substr(Do,8)===Zr?(t=Zr,Do+=8):(t=i,Fo===0&&Go(ei)),t===i&&(e.substr(Do,8)===ti?(t=ti,Do+=8):(t=i,Fo===0&&Go(ni)),t===i&&(e.substr(Do,8)===ri?(t=ri,Do+=8):(t=i,Fo===0&&Go(ii)),t===i&&(e.substr(Do,8)===si?(t=si,Do+=8):(t=i,Fo===0&&Go(oi)),t===i&&(e.substr(Do,8)===ui?(t=ui,Do+=8):(t=i,Fo===0&&Go(ai)),t===i&&(e.substr(Do,7)===fi?(t=fi,Do+=7):(t=i,Fo===0&&Go(li)),t===i&&(e.substr(Do,7)===ci?(t=ci,Do+=7):(t=i,Fo===0&&Go(hi)),t===i&&(e.substr(Do,7)===pi?(t=pi,Do+=7):(t=i,Fo===0&&Go(di)),t===i&&(e.substr(Do,7)===vi?(t=vi,Do+=7):(t=i,Fo===0&&Go(mi)),t===i&&(e.substr(Do,7)===gi?(t=gi,Do+=7):(t=i,Fo===0&&Go(yi)),t===i&&(e.substr(Do,7)===bi?(t=bi,Do+=7):(t=i,Fo===0&&Go(wi)),t===i&&(e.substr(Do,7)===Ei?(t=Ei,Do+=7):(t=i,Fo===0&&Go(Si)),t===i&&(e.substr(Do,7)===xi?(t=xi,Do+=7):(t=i,Fo===0&&Go(Ti)),t===i&&(e.substr(Do,7)===Ni?(t=Ni,Do+=7):(t=i,Fo===0&&Go(Ci)),t===i&&(e.substr(Do,7)===ki?(t=ki,Do+=7):(t=i,Fo===0&&Go(Li)),t===i&&(e.substr(Do,7)===Ai?(t=Ai,Do+=7):(t=i,Fo===0&&Go(Oi)),t===i&&(e.substr(Do,7)===Mi?(t=Mi,Do+=7):(t=i,Fo===0&&Go(_i)),t===i&&(e.substr(Do,6)===Di?(t=Di,Do+=6):(t=i,Fo===0&&Go(Pi)),t===i&&(e.substr(Do,6)===Hi?(t=Hi,Do+=6):(t=i,Fo===0&&Go(Bi)),t===i&&(e.substr(Do,6)===ji?(t=ji,Do+=6):(t=i,Fo===0&&Go(Fi)),t===i&&(e.substr(Do,6)===Ii?(t=Ii,Do+=6):(t=i,Fo===0&&Go(qi)),t===i&&(e.substr(Do,6)===Ri?(t=Ri,Do+=6):(t=i,Fo===0&&Go(Ui)),t===i&&(e.substr(Do,6)===zi?(t=zi,Do+=6):(t=i,Fo===0&&Go(Wi)),t===i&&(e.substr(Do,6)===Xi?(t=Xi,Do+=6):(t=i,Fo===0&&Go(Vi)),t===i&&(e.substr(Do,6)===$i?(t=$i,Do+=6):(t=i,Fo===0&&Go(Ji)),t===i&&(e.substr(Do,5)===Ki?(t=Ki,Do+=5):(t=i,Fo===0&&Go(Qi)),t===i&&(e.substr(Do,5)===Gi?(t=Gi,Do+=5):(t=i,Fo===0&&Go(Yi)),t===i&&(e.substr(Do,5)===Zi?(t=Zi,Do+=5):(t=i,Fo===0&&Go(es)),t===i&&(e.substr(Do,5)===ts?(t=ts,Do+=5):(t=i,Fo===0&&Go(ns)),t===i&&(e.substr(Do,5)===rs?(t=rs,Do+=5):(t=i,Fo===0&&Go(is)),t===i&&(e.substr(Do,5)===ss?(t=ss,Do+=5):(t=i,Fo===0&&Go(os)),t===i&&(e.substr(Do,5)===us?(t=us,Do+=5):(t=i,Fo===0&&Go(as)),t===i&&(e.substr(Do,5)===fs?(t=fs,Do+=5):(t=i,Fo===0&&Go(ls)),t===i&&(e.substr(Do,4)===cs?(t=cs,Do+=4):(t=i,Fo===0&&Go(hs)),t===i&&(e.substr(Do,4)===ps?(t=ps,Do+=4):(t=i,Fo===0&&Go(ds)),t===i&&(e.substr(Do,4)===vs?(t=vs,Do+=4):(t=i,Fo===0&&Go(ms)),t===i&&(e.substr(Do,4)===gs?(t=gs,Do+=4):(t=i,Fo===0&&Go(ys)),t===i&&(e.substr(Do,4)===bs?(t=bs,Do+=4):(t=i,Fo===0&&Go(ws)),t===i&&(e.substr(Do,4)===Es?(t=Es,Do+=4):(t=i,Fo===0&&Go(Ss)),t===i&&(e.substr(Do,4)===xs?(t=xs,Do+=4):(t=i,Fo===0&&Go(Ts)),t===i&&(e.substr(Do,4)===Ns?(t=Ns,Do+=4):(t=i,Fo===0&&Go(Cs)),t===i&&(e.substr(Do,4)===ks?(t=ks,Do+=4):(t=i,Fo===0&&Go(Ls)),t===i&&(e.substr(Do,4)===As?(t=As,Do+=4):(t=i,Fo===0&&Go(Os)),t===i&&(e.substr(Do,4)===Ms?(t=Ms,Do+=4):(t=i,Fo===0&&Go(_s)),t===i&&(e.substr(Do,4)===Ds?(t=Ds,Do+=4):(t=i,Fo===0&&Go(Ps)),t===i&&(e.substr(Do,3)===Hs?(t=Hs,Do+=3):(t=i,Fo===0&&Go(Bs)),t===i&&(e.substr(Do,3)===js?(t=js,Do+=3):(t=i,Fo===0&&Go(Fs)),t===i&&(e.substr(Do,3)===Is?(t=Is,Do+=3):(t=i,Fo===0&&Go(qs)),t===i&&(e.charCodeAt(Do)===97?(t=Rs,Do++):(t=i,Fo===0&&Go(Us)),t===i&&(e.charCodeAt(Do)===103?(t=zs,Do++):(t=i,Fo===0&&Go(Ws)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),t}function Ru(){var e,t,n;return e=Do,t=Do,Fo++,n=Fu(),Fo--,n===i?t=void 0:(Do=t,t=i),t!==i?(n=Iu(),n!==i?(Po=e,t=Xs(t,n),e=t):(Do=e,e=i)):(Do=e,e=i),e}function Uu(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t}function zu(){var t,n,r;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;return n!==i?(Js.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Ks)),r===i&&(r=null),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function Wu(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===69?(n=Qs,Do++):(n=i,Fo===0&&Go(Gs)),n===i&&(e.charCodeAt(Do)===101?(n=Ys,Do++):(n=i,Fo===0&&Go(Zs))),n!==i?(e.charCodeAt(Do)===43?(r=at,Do++):(r=i,Fo===0&&Go(ft)),r===i&&(e.charCodeAt(Do)===45?(r=lt,Do++):(r=i,Fo===0&&Go(ct))),r===i&&(r=null),r!==i?(s=zu(),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Xu(){var t,n,r,s,o,u;t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;if(n!==i){e.charCodeAt(Do)===46?(r=qn,Do++):(r=i,Fo===0&&Go(Rn));if(r!==i){s=[],o=Uu();while(o!==i)s.push(o),o=Uu();s!==i?(o=Wu(),o===i&&(o=null),o!==i?(Js.test(e.charAt(Do))?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(Ks)),u===i&&(u=null),u!==i?(n=[n,r,s,o,u],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;if(t===i){t=Do,n=[],r=Uu();if(r!==i)while(r!==i)n.push(r),r=Uu();else n=i;n!==i?(r=Wu(),r===i&&(r=null),r!==i?(Js.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(Ks)),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i);if(t===i){t=Do,e.charCodeAt(Do)===46?(n=qn,Do++):(n=i,Fo===0&&Go(Rn));if(n!==i){r=[],s=Uu();if(s!==i)while(s!==i)r.push(s),s=Uu();else r=i;r!==i?(s=Wu(),s===i&&(s=null),s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}}return t}function Vu(){var t,n,r;return t=Do,n=zu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,n=Xu(),n!==i?(e.charCodeAt(Do)===105?(r=eo,Do++):(r=i,Fo===0&&Go(to)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i)),t}function $u(){var t,n,r,s,o;t=Do,e.charCodeAt(Do)===48?(n=no,Do++):(n=i,Fo===0&&Go(ro));if(n!==i){e.charCodeAt(Do)===120?(r=io,Do++):(r=i,Fo===0&&Go(so)),r===i&&(e.charCodeAt(Do)===88?(r=oo,Do++):(r=i,Fo===0&&Go(uo)));if(r!==i){s=[],o=Ju();if(o!==i)while(o!==i)s.push(o),o=Ju();else s=i;s!==i?(Js.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(Ks)),o===i&&(o=null),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}else Do=t,t=i;return t}function Ju(){var t;return Vs.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go($s)),t===i&&(ao.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(fo)),t===i&&(lo.test(e.charAt(Do))?(t=e.charAt(Do),Do++):(t=i,Fo===0&&Go(co)))),t}function Ku(){var t,n,r,s;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(r=Ju(),r!==i?(s=Ju(),s===i&&(s=null),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t}function Qu(){var t,n,r,s,o;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(vo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(mo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(go.test(e.charAt(Do))?(o=e.charAt(Do),Do++):(o=i,Fo===0&&Go(yo)),o!==i?(n=[n,r,s,o],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(go.test(e.charAt(Do))?(s=e.charAt(Do),Do++):(s=i,Fo===0&&Go(yo)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(go.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(yo)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i))),t}function Gu(){var t,n,r,s,o,u,a,f,l;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(s=Ju(),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(n=[n,r,s,o,u,a],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(e.charCodeAt(Do)===117?(r=bo,Do++):(r=i,Fo===0&&Go(wo)),r!==i?(e.charCodeAt(Do)===123?(s=q,Do++):(s=i,Fo===0&&Go(R)),s!==i?(o=Ju(),o!==i?(u=Ju(),u!==i?(a=Ju(),a!==i?(f=Ju(),f!==i?(e.charCodeAt(Do)===125?(l=U,Do++):(l=i,Fo===0&&Go(z)),l!==i?(n=[n,r,s,o,u,a,f,l],t=n):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)):(Do=t,t=i)),t}function Yu(){var t,n,r;return t=Do,e.charCodeAt(Do)===92?(n=ho,Do++):(n=i,Fo===0&&Go(po)),n!==i?(Eo.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(So)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(t=Gu(),t===i&&(t=Ku(),t===i&&(t=Qu()))),t}function Zu(){var t;return t=ou(),t===i&&(e.substr(Do,3)===mt?(t=mt,Do+=3):(t=i,Fo===0&&Go(gt))),t}function ea(){var t,n,r,s;return t=Do,n=Zu(),n!==i?(r=Do,Fo++,s=Zu(),Fo--,s===i?r=void 0:(Do=r,r=i),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t===i&&(e.charCodeAt(Do)===44?(t=yt,Do++):(t=i,Fo===0&&Go(bt))),t}function ta(){var e,t,n,r,s,o;e=Do,t=Pu();if(t!==i){n=[],r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);if(r!==i)while(r!==i)n.push(r),r=Do,s=ea(),s!==i?(o=Pu(),o!==i?(s=[s,o],r=s):(Do=r,r=i)):(Do=r,r=i);else n=i;n!==i?(t=[t,n],e=t):(Do=e,e=i)}else Do=e,e=i;return e}function na(){var t,n,r,s;t=Do,e.charCodeAt(Do)===34?(n=xo,Do++):(n=i,Fo===0&&Go(To));if(n!==i){r=[],s=ra();while(s!==i)r.push(s),s=ra();r!==i?(e.charCodeAt(Do)===34?(s=xo,Do++):(s=i,Fo===0&&Go(To)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i;if(t===i){t=Do,e.charCodeAt(Do)===39?(n=No,Do++):(n=i,Fo===0&&Go(Co));if(n!==i){r=[],s=ia();while(s!==i)r.push(s),s=ia();r!==i?(e.charCodeAt(Do)===39?(s=No,Do++):(s=i,Fo===0&&Go(Co)),s!==i?(n=[n,r,s],t=n):(Do=t,t=i)):(Do=t,t=i)}else Do=t,t=i}return t}function ra(){var t,n,r;return t=Do,n=Do,Fo++,ko.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Lo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function ia(){var t,n,r;return t=Do,n=Do,Fo++,Ao.test(e.charAt(Do))?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(Oo)),r===i&&(e.charCodeAt(Do)===92?(r=ho,Do++):(r=i,Fo===0&&Go(po))),Fo--,r===i?n=void 0:(Do=n,n=i),n!==i?(e.length>Do?(r=e.charAt(Do),Do++):(r=i,Fo===0&&Go(y)),r!==i?(n=[n,r],t=n):(Do=t,t=i)):(Do=t,t=i),t}function sa(){var t,n,r,s,o,u;t=Do,e.charCodeAt(Do)===35?(n=Mo,Do++):(n=i,Fo===0&&Go(_o));if(n!==i){r=[],s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);while(s!==i)r.push(s),s=Do,o=Do,Fo++,u=tu(),u===i&&(u=nu()),Fo--,u===i?o=void 0:(Do=o,o=i),o!==i?(e.length>Do?(u=e.charAt(Do),Do++):(u=i,Fo===0&&Go(y)),u!==i?(o=[o,u],s=o):(Do=s,s=i)):(Do=s,s=i);r!==i?(n=[n,r],t=n):(Do=t,t=i)}else Do=t,t=i;return t}n=n!==void 0?n:{};var i={},s={start:eu},a=eu,f="\r",h=Wo("\r",!1),m="\n",g=Wo("\n",!1),y=Vo(),w=";",E=Wo(";",!1),S="!",x=Wo("!",!1),T="NULL",N=Wo("NULL",!1),C="NA",k=Wo("NA",!1),L="Inf",A=Wo("Inf",!1),O="NaN",M=Wo("NaN",!1),_="TRUE",D=Wo("TRUE",!1),P="FALSE",H=Wo("FALSE",!1),B="next",j=Wo("next",!1),F="break",I=Wo("break",!1),q="{",R=Wo("{",!1),U="}",z=Wo("}",!1),W="if",X=Wo("if",!1),V="(",$=Wo("(",!1),J=")",K=Wo(")",!1),Q="else",G=Wo("else",!1),Y="for",Z=Wo("for",!1),et="in",tt=Wo("in",!1),nt="while",rt=Wo("while",!1),it="repeat",st=Wo("repeat",!1),ot="function",ut=Wo("function",!1),at="+",ft=Wo("+",!1),lt="-",ct=Wo("-",!1),ht="~",pt=Wo("~",!1),dt="=",vt=Wo("=",!1),mt="...",gt=Wo("...",!1),yt=",",bt=Wo(",",!1),wt=function(){return u("comma issues",Ro()),"comma"},Et=function(){return u("comma issues",Ro()),"comma"},St="[",xt=Wo("[",!1),Tt="]",Nt=Wo("]",!1),Ct="[[",kt=Wo("[[",!1),Lt="]]",At=Wo("]]",!1),Ot=function(e,i,s){var a,f,h,m,g=e;if(i)for(a=0;a<:+&*\-.$=\/]/,Ft=Xo([">","<",":","+","&","*","-",".","$","=","/"],!1,!1),It="%",qt=Wo("%",!1),Rt="<<-",Ut=Wo("<<-",!1),zt="->>",Wt=Wo("->>",!1),Xt=":::",Vt=Wo(":::",!1),$t="<-",Jt=Wo("<-",!1),Kt="==",Qt=Wo("==",!1),Gt="::",Yt=Wo("::",!1),Zt=">=",en=Wo(">=",!1),tn="!=",nn=Wo("!=",!1),rn="||",sn=Wo("||",!1),on="&&",un=Wo("&&",!1),an=":=",fn=Wo(":=",!1),ln="<=",cn=Wo("<=",!1),hn="->",pn=Wo("->",!1),dn="$",vn=Wo("$",!1),mn="@",gn=Wo("@",!1),yn="^",bn=Wo("^",!1),wn=":",En=Wo(":",!1),Sn="*",xn=Wo("*",!1),Tn="/",Nn=Wo("/",!1),Cn=">",kn=Wo(">",!1),Ln="<",An=Wo("<",!1),On="&",Mn=Wo("&",!1),_n="|",Dn=Wo("|",!1),Pn=/^[\n\r\u2028\u2029]/,Hn=Xo(["\n","\r","\u2028","\u2029"],!1,!1),Bn=/^[\t\x0B\f \xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/,jn=Xo([" ","\x0b","\f"," ","\u00a0","\ufeff","\u1680","\u180e",["\u2000","\u200a"],"\u202f","\u205f","\u3000"],!1,!1),Fn=/^[a-zA-Z]/,In=Xo([["a","z"],["A","Z"]],!1,!1),qn=".",Rn=Wo(".",!1),Un="_",zn=Wo("_",!1),Wn=function(e,t){var n=t;return n?(n.unshift(e),n=n.join("")):n=e,n},Xn="feComponentTransfer",Vn=Wo("feComponentTransfer",!1),$n="feSpecularLighting",Jn=Wo("feSpecularLighting",!1),Kn="feDiffuseLighting",Qn=Wo("feDiffuseLighting",!1),Gn="feDisplacementMap",Yn=Wo("feDisplacementMap",!1),Zn="animateTransform",er=Wo("animateTransform",!1),tr="feConvolveMatrix",nr=Wo("feConvolveMatrix",!1),rr="font.face.format",ir=Wo("font.face.format",!1),sr="feDistantLight",or=Wo("feDistantLight",!1),ur="feGaussianBlur",ar=Wo("feGaussianBlur",!1),fr="font.face.name",lr=Wo("font.face.name",!1),cr="linearGradient",hr=Wo("linearGradient",!1),pr="radialGradient",dr=Wo("radialGradient",!1),vr="animateMotion",mr=Wo("animateMotion",!1),gr="color.profile",yr=Wo("color.profile",!1),br="feColorMatrix",wr=Wo("feColorMatrix",!1),Er="font.face.src",Sr=Wo("font.face.src",!1),xr="font.face.uri",Tr=Wo("font.face.uri",!1),Nr="foreignObject",Cr=Wo("foreignObject",!1),kr="missing.glyph",Lr=Wo("missing.glyph",!1),Ar="altGlyphItem",Or=Wo("altGlyphItem",!1),Mr="animateColor",_r=Wo("animateColor",!1),Dr="feMorphology",Pr=Wo("feMorphology",!1),Hr="fePointLight",Br=Wo("fePointLight",!1),jr="feTurbulence",Fr=Wo("feTurbulence",!1),Ir="altGlyphDef",qr=Wo("altGlyphDef",!1),Rr="feComposite",Ur=Wo("feComposite",!1),zr="feMergeNode",Wr=Wo("feMergeNode",!1),Xr="feSpotLight",Vr=Wo("feSpotLight",!1),$r="font.face",Jr=Wo("font.face",!1),Kr="altGlyph",Qr=Wo("altGlyph",!1),Gr="clipPath",Yr=Wo("clipPath",!1),Zr="feOffset",ei=Wo("feOffset",!1),ti="glyphRef",ni=Wo("glyphRef",!1),ri="metadata",ii=Wo("metadata",!1),si="polyline",oi=Wo("polyline",!1),ui="textPath",ai=Wo("textPath",!1),fi="animate",li=Wo("animate",!1),ci="ellipse",hi=Wo("ellipse",!1),pi="feBlend",di=Wo("feBlend",!1),vi="feFlood",mi=Wo("feFlood",!1),gi="feFuncA",yi=Wo("feFuncA",!1),bi="feFuncB",wi=Wo("feFuncB",!1),Ei="feFuncG",Si=Wo("feFuncG",!1),xi="feFuncR",Ti=Wo("feFuncR",!1),Ni="feImage",Ci=Wo("feImage",!1),ki="feMerge",Li=Wo("feMerge",!1),Ai="pattern",Oi=Wo("pattern",!1),Mi="polygon",_i=Wo("polygon",!1),Di="circle",Pi=Wo("circle",!1),Hi="cursor",Bi=Wo("cursor",!1),ji="feTile",Fi=Wo("feTile",!1),Ii="filter",qi=Wo("filter",!1),Ri="marker",Ui=Wo("marker",!1),zi="script",Wi=Wo("script",!1),Xi="switch",Vi=Wo("switch",!1),$i="symbol",Ji=Wo("symbol",!1),Ki="glyph",Qi=Wo("glyph",!1),Gi="hkern",Yi=Wo("hkern",!1),Zi="image",es=Wo("image",!1),ts="mpath",ns=Wo("mpath",!1),rs="style",is=Wo("style",!1),ss="title",os=Wo("title",!1),us="tspan",as=Wo("tspan",!1),fs="vkern",ls=Wo("vkern",!1),cs="defs",hs=Wo("defs",!1),ps="desc",ds=Wo("desc",!1),vs="font",ms=Wo("font",!1),gs="line",ys=Wo("line",!1),bs="mask",ws=Wo("mask",!1),Es="path",Ss=Wo("path",!1),xs="rect",Ts=Wo("rect",!1),Ns="stop",Cs=Wo("stop",!1),ks="text",Ls=Wo("text",!1),As="tref",Os=Wo("tref",!1),Ms="view",_s=Wo("view",!1),Ds="svgR",Ps=Wo("svgR",!1),Hs="set",Bs=Wo("set",!1),js="svg",Fs=Wo("svg",!1),Is="use",qs=Wo("use",!1),Rs="a",Us=Wo("a",!1),zs="g",Ws=Wo("g",!1),Xs=function(e,t){var n=t;return n},Vs=/^[0-9]/,$s=Xo([["0","9"]],!1,!1),Js=/^[Ll]/,Ks=Xo(["L","l"],!1,!1),Qs="E",Gs=Wo("E",!1),Ys="e",Zs=Wo("e",!1),eo="i",to=Wo("i",!1),no="0",ro=Wo("0",!1),io="x",so=Wo("x",!1),oo="X",uo=Wo("X",!1),ao=/^[a-f]/,fo=Xo([["a","f"]],!1,!1),lo=/^[A-F]/,co=Xo([["A","F"]],!1,!1),ho="\\",po=Wo("\\",!1),vo=/^[0-3]/,mo=Xo([["0","3"]],!1,!1),go=/^[0-7]/,yo=Xo([["0","7"]],!1,!1),bo="u",wo=Wo("u",!1),Eo=/^[abtnfrv"'\\]/,So=Xo(["a","b","t","n","f","r","v",'"',"'","\\"],!1,!1),xo='"',To=Wo('"',!1),No="'",Co=Wo("'",!1),ko=/^["]/,Lo=Xo(['"'],!1,!1),Ao=/^[']/,Oo=Xo(["'"],!1,!1),Mo="#",_o=Wo("#",!1),Do=0,Po=0,Ho=[{line:1,column:1}],Bo=0,jo=[],Fo=0,Io;if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}Io=a();if(Io!==i&&Do===e.length)return Io;throw Io!==i&&Do0&&(result=w(t,n),w(t,n))}catch(s){if(s instanceof b){var o="error";s.message&&s.location.start.line&&u("Unexpected Symbol: "+s.found,s.location,"error")}}return e.forEach(function(e){var t=e.message,n=e.location,r=e.type;i.push({row:n.start.line-1,column:n.start.column-1,text:t,type:r})}),i}function S(r,i){e.length=0,t.length=0,"object"==typeof r&&(r=undefined),r=r||"";var s={};i&&(s={cursorPos:{row:i.row+1,column:i.column+1}});var o={tok:"",pos:{line:-1,col:-1}};try{if(r&&"string"==typeof r&&r.length>0){result=w(r,s);for(var a=0,f=t.length;a0){var i=r[0],s=p[i],o=v[i];available=s.concat(o)}return available}function T(e,t){return S(e,t).tok}var e=[],t=[];Array.prototype.hasValue=function(e){var t;for(t=0;t0){for(n=1,r=1;n-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.PtrStyleBehaviour=p}),ace.define("ace/mode/folding/ptrstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[|\()[^\}\]\)]*$/,this.foldingStopMarker=/^[^\[\{\(]*(\}|\]|\))/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/ptr",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/ptr_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/ptr_completions","ace/worker/worker_client","ace/mode/behaviour/ptrstyle","ace/mode/folding/ptrstyle"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("./text_highlight_rules").TextHighlightRules,u=e("./ptr_highlight_rules").PtrHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("./ptr_completions").PtrCompletions,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/ptrstyle").PtrStyleBehaviour,h=e("./folding/ptrstyle").FoldMode,p=function(){this.HighlightRules=u,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h,this.$completer=new f};i.inherits(p,s),function(){this.lineCommentStart="#",this.$id="ace/mode/ptr",this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/ptr_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("errors",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(p.prototype),t.Mode=p}) \ No newline at end of file diff --git a/inst/App/www/Acejs/mode-snippets.js b/inst/App/www/Acejs/mode-snippets.js old mode 100644 new mode 100755 diff --git a/inst/App/www/Acejs/shinyAce.css b/inst/App/www/Acejs/shinyAce.css old mode 100644 new mode 100755 diff --git a/inst/App/www/Acejs/snippets/dnippets.js b/inst/App/www/Acejs/snippets/dnippets.js old mode 100644 new mode 100755 diff --git a/inst/App/www/Acejs/snippets/ptr.js b/inst/App/www/Acejs/snippets/ptr.js old mode 100644 new mode 100755 diff --git a/inst/App/www/Acejs/snippets/ptrrmd.js b/inst/App/www/Acejs/snippets/ptrrmd.js old mode 100644 new mode 100755 diff --git a/inst/App/www/Acejs/worker-ptr.js b/inst/App/www/Acejs/worker-ptr.js old mode 100644 new mode 100755 From c09f1833b2a6c94d70dbe83c167b46498701d3ed Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 10 Oct 2020 17:50:45 -0400 Subject: [PATCH 104/263] Added feature to reload file if changed externally (valid for electron only) --- inst/App/fileIO/observeRequestStartUp.R | 18 ++++-- inst/App/fileIO/serverFileDescriptor.R | 12 ++++ inst/App/leftPanel/footer/serverButtons.R | 74 +++++++++++++++++++++++ 3 files changed, 98 insertions(+), 6 deletions(-) diff --git a/inst/App/fileIO/observeRequestStartUp.R b/inst/App/fileIO/observeRequestStartUp.R index c938abbd..01cceb82 100644 --- a/inst/App/fileIO/observeRequestStartUp.R +++ b/inst/App/fileIO/observeRequestStartUp.R @@ -11,13 +11,19 @@ observeEvent(trigger$startup, { } else { } - # disableDMDM( - # session, - # menuBarId="editNavBar", # can't find customControl - # entry="customControl" - # ) + updateNewProjectMenu(session) updateRemoveTemplateMenu(session) - + resetWatcher() log.fout(startup) }, priority=100) + + +resetWatcher<-reactive({ + if(usingElectron){ + allFilePaths<-getAllNamedFiles()$filePath + cat('pointR::resetWatcher: allFilePaths') + print(allFilePaths) + sendPtRManagerMessage(sender="cmd.electron", resetWatcher=allFilePaths) + } +}) \ No newline at end of file diff --git a/inst/App/fileIO/serverFileDescriptor.R b/inst/App/fileIO/serverFileDescriptor.R index 6871e4fa..27e34274 100644 --- a/inst/App/fileIO/serverFileDescriptor.R +++ b/inst/App/fileIO/serverFileDescriptor.R @@ -137,6 +137,15 @@ getAllNamedUnsavedFiles<-reactive({ fd }) +getAllNamedFiles <- function(){ + fd<-fileDescDB() + fd<-filter(fd, filePath!="?") + fd +} + + + + # get the saved status for the current page getFileSavedStatus<-reactive({ pageId<-input$pages @@ -177,3 +186,6 @@ removeFileDesc<-function(pageId, path=getWorkSpaceDir() ){ # cat('<---< removeFileDesc\n') } + + + diff --git a/inst/App/leftPanel/footer/serverButtons.R b/inst/App/leftPanel/footer/serverButtons.R index 51879193..09c36411 100755 --- a/inst/App/leftPanel/footer/serverButtons.R +++ b/inst/App/leftPanel/footer/serverButtons.R @@ -57,6 +57,80 @@ if(usingElectron){ appRunner$log<-c(appRunner$log, input$appLog$mssg) }, label="appLog") + + replaceContents<-function(aceId, contents){ + updateAceExt(id=aceId, sender='mause.add', setValue=contents, setDocFileSaved=TRUE) + } + externalReplacement<-reactiveValues( + aceId='', + newContents='' + ) + + #!!! move this elsewhere + observeEvent(input$fileChanged,{ + # cat('Observed Event: fileChanged') + changedFile<-input$fileChanged$mssg + + + fd<-fileDescDB() + tb<-filter(fd, filePath==changedFile) + # cat("fileChanged 2\n") + if(nrow(tb)>0){ + # cat("fileChanged 2\n") + pid<-tb$tabId + aceId<-tabID2aceID(pid) + # cat("aceId=",aceId) + oldeContents<-input[[aceId]] + # print(oldeContents) + newContents<-paste(readLines(changedFile), collapse = "\n") + if(newContents==oldeContents){ + # print("no update") + } else { + # print("update") + if(tb$isSaved){ + # print("auto-update") + replaceContents(aceId, newContents) + } else { + # ask + externalReplacement$newContents=newContents + externalReplacement$aceId=aceId + # print("ask to update") + fileName<-basename(changedFile) + showModal(updateChangedFileModal(fileName)) + } + } + } + + + + + + + + }) + #--------change modal------------------------------ + + updateChangedFileModal <- function(fileName='File') { + txt1<-paste(fileName,'has been modified on disk.' ) + txt2<-paste('Reload from disk?') + modalDialog( + span(txt1), + br(), + span(txt2), + footer = tagList( + modalButton("Keep as is"), + actionButton("updateChangedFileButton", "Reload") + ) + ) + } + + + + observeEvent(input$updateChangedFileButton, { + replaceContents(externalReplacement$aceId, externalReplacement$newContents) + removeModal() + }) + } From e31455f0fcba8cf9fe01a92f57144c45eca92755 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 10 Oct 2020 17:51:51 -0400 Subject: [PATCH 105/263] Added feature to reload file if changed externally (valid for electron only) --- inst/App/www/ptR/ptRManager.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/inst/App/www/ptR/ptRManager.js b/inst/App/www/ptR/ptRManager.js index 2875dffe..ca5f4a31 100644 --- a/inst/App/www/ptR/ptRManager.js +++ b/inst/App/www/ptR/ptRManager.js @@ -25,6 +25,25 @@ if(!!window.sendToElectron){ $('#ptRQuit').trigger('click'); }); + window.ipcRenderer.on( 'fileChanged', function(event, arg){ + console.log('fileChanged'); + //alert('fileChanged '+JSON.stringify(arg)); + Shiny.onInputChange('fileChanged', + { + mssg: arg, + rnd:Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5) + }); + + //$('#ptRQuit').trigger('click'); + }); + + window.ipcRenderer.on( 'fileDeleted', function(event, arg){ + console.log('fileDeleted'); + alert('fileDeleted '+JSON.stringify(arg)); + //$('#ptRQuit').trigger('click'); + }); + + } @@ -40,6 +59,12 @@ Shiny.addCustomMessageHandler( window.sendToElectron('cmdAppRun',data.app2RunPath, data.tabId); } } + if(!!data.resetWatcher){ + if(!!window.sendToElectron){ + console.log('resetWatcher sendToElectron'); + window.sendToElectron('resetWatcher',data.resetWatcher); + } + } if(!!data.app2stop){ if(!!window.sendToElectron){ window.sendToElectron('cmdStopAppRunner', data.app2stop, ""); @@ -62,7 +87,7 @@ Shiny.addCustomMessageHandler( window.sendToElectron('cmdOpenWindow',data.openWindow, ''); } } - } + } //end of electron handlers if(data.sender==="closePtRWindowNow"){ console.log('inside data.closePtRWindowNow'); if(!!window.sendToElectron ){ From 551a7dfd4c5eb05f033e2e67dd9fe1ae0231ee59 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:07:17 -0400 Subject: [PATCH 106/263] comment out alert --- inst/App/www/ptR/ptRManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/www/ptR/ptRManager.js b/inst/App/www/ptR/ptRManager.js index ca5f4a31..34e959da 100644 --- a/inst/App/www/ptR/ptRManager.js +++ b/inst/App/www/ptR/ptRManager.js @@ -39,7 +39,7 @@ if(!!window.sendToElectron){ window.ipcRenderer.on( 'fileDeleted', function(event, arg){ console.log('fileDeleted'); - alert('fileDeleted '+JSON.stringify(arg)); + //alert('fileDeleted '+JSON.stringify(arg)); //$('#ptRQuit').trigger('click'); }); From 733cd76118f50c6708c4713399cb4cabb0ed3e01 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:08:00 -0400 Subject: [PATCH 107/263] fix polygon and polyine dnds --- inst/App/templates/sampleShapes.dnds | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/templates/sampleShapes.dnds b/inst/App/templates/sampleShapes.dnds index 248fbc19..9cfe969e 100644 --- a/inst/App/templates/sampleShapes.dnds +++ b/inst/App/templates/sampleShapes.dnds @@ -197,8 +197,8 @@ SNIPPET polyline( points=${1:WH*matrix(c(.25,.25,.5,.5,.75,.25),2)}, stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} + stroke.width=${3:1}, + fill=${4:'none'} )${0:} ``` SVGR @@ -228,8 +228,8 @@ SNIPPET polygon( points=${1:WH*matrix(c(.25,.75,.5,.5,.75,.75),2)}, stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} + stroke.width=${3:1}, + fill=${4:'none'} )${0:} ``` SVGR From 20dee4cb89a528e2cdd30bf9bc45e399e56e0e2c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:09:13 -0400 Subject: [PATCH 108/263] remove the .pprj from the name prior to substitution in dnds @projectName@ --- inst/App/fileIO/dndSnippetLoader.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/App/fileIO/dndSnippetLoader.R b/inst/App/fileIO/dndSnippetLoader.R index 61a01706..4a646b20 100644 --- a/inst/App/fileIO/dndSnippetLoader.R +++ b/inst/App/fileIO/dndSnippetLoader.R @@ -121,8 +121,9 @@ dripplets2List2<-function(drps){ }) if(!is.null(editOption$currentProjectName)){ + cname<-sub('\\.pprj$','', editOption$currentProjectName) drps<-lapply(drps, function(dr){ - dr['snip']<-gsub('@projectName@', editOption$currentProjectName, dr['snip']) + dr['snip']<-gsub('@projectName@', cname , dr['snip']) dr }) } From 7878458c3e86ca376698e40186e70863d4f92539 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:09:54 -0400 Subject: [PATCH 109/263] normalize paths for watcher --- inst/App/fileIO/observeRequestStartUp.R | 5 +++-- inst/App/leftPanel/footer/serverButtons.R | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/inst/App/fileIO/observeRequestStartUp.R b/inst/App/fileIO/observeRequestStartUp.R index 01cceb82..1f66a191 100644 --- a/inst/App/fileIO/observeRequestStartUp.R +++ b/inst/App/fileIO/observeRequestStartUp.R @@ -22,8 +22,9 @@ observeEvent(trigger$startup, { resetWatcher<-reactive({ if(usingElectron){ allFilePaths<-getAllNamedFiles()$filePath - cat('pointR::resetWatcher: allFilePaths') - print(allFilePaths) + allFilePaths<-normalizePath(allFilePaths) + # cat('pointR::resetWatcher: allFilePaths') + # print(allFilePaths) sendPtRManagerMessage(sender="cmd.electron", resetWatcher=allFilePaths) } }) \ No newline at end of file diff --git a/inst/App/leftPanel/footer/serverButtons.R b/inst/App/leftPanel/footer/serverButtons.R index 09c36411..d727f268 100755 --- a/inst/App/leftPanel/footer/serverButtons.R +++ b/inst/App/leftPanel/footer/serverButtons.R @@ -73,6 +73,7 @@ if(usingElectron){ fd<-fileDescDB() + fd$filePath<-normalizePath(fd$filePath) tb<-filter(fd, filePath==changedFile) # cat("fileChanged 2\n") if(nrow(tb)>0){ From 8adf77a84c4629bae946350c415d6181e8dabea0 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:11:16 -0400 Subject: [PATCH 110/263] use variable initialValue as value for controls --- inst/App/projectTemplates/shinyInputControl/app.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/app.R b/inst/App/projectTemplates/shinyInputControl/app.R index aaf48dd3..5fadbbbf 100644 --- a/inst/App/projectTemplates/shinyInputControl/app.R +++ b/inst/App/projectTemplates/shinyInputControl/app.R @@ -1,15 +1,17 @@ library(shiny) source("shinyInputControl.R") +initialValue='200' + ui<-fluidPage( h1('Test App'), h3('current Value'), textOutput('currentValue'), - textInput(inputId='updateValue','update value', '200'), + textInput(inputId='updateValue','update value', initialValue), actionButton('updateButton', label='press to update value'), - shinyInputControl(inputId='myshinyInputControl', wh=c(400,400), value=200 ) + shinyInputControl(inputId='myshinyInputControl', wh=c(400,400), value= initialValue) ) server<-function(input,output,session){ From aacad16caa8715d8fc4154fae8b531d9f44efb4f Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:12:26 -0400 Subject: [PATCH 111/263] clean up presentation by adding box element --- .../shinyInputControl/readme.Rmd | 335 +++++++----------- 1 file changed, 133 insertions(+), 202 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/readme.Rmd b/inst/App/projectTemplates/shinyInputControl/readme.Rmd index f3a5c9f2..a60e6ef8 100644 --- a/inst/App/projectTemplates/shinyInputControl/readme.Rmd +++ b/inst/App/projectTemplates/shinyInputControl/readme.Rmd @@ -17,28 +17,62 @@ library(svgR) ### 1. Building your svg ```{r, results='asis', } +box % Date: Thu, 22 Oct 2020 14:13:10 -0400 Subject: [PATCH 112/263] set params$CMDS<-c(...) --- .../projectTemplates/shinyInputControl/shinyInputControl.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R index e9a6bd00..b72ef1aa 100644 --- a/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R +++ b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R @@ -11,10 +11,11 @@ try({ removeInputHandler("shinyInputControlBinding") }) # create simple wrapper around svgR code shinyInputControlSvgWrapper<-function(params){ - params$CMDS<-"alert('Wrapper: new command(s)')" + # STEP 4.2: replace params$CMDS as appropriate + params$CMDS<-c( + "alert('Wrapper: new command(s)')", #replace this + ) - # STEP 4.2: replace params$CMDS as appropriate - # fill the wrapper source('shinyInputControl_svg.R', local=T)$value } From e98155804dcb7e77cb60083ffd938b847fea6202 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:14:31 -0400 Subject: [PATCH 113/263] remove quote around CMDS[...] --- .../shinyInputControl/aux/dnds/mouseEvents.dnds | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds index a66e3db9..4e44329f 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/mouseEvents.dnds @@ -13,7 +13,7 @@ mouse click ``` SNIPPET ``` -onclick='CMDS[${0:1}]' +onclick=CMDS[${0:1}] ``` SVGR ``` @@ -53,7 +53,7 @@ mouse down ``` SNIPPET ``` -onmousedown='CMDS[${0:1}]' +onmousedown=CMDS[${0:1}] ``` SVGR ``` @@ -90,7 +90,7 @@ mouse up ``` SNIPPET ``` -onmouseup='CMDS[${0:1}]' +onmouseup=CMDS[${0:1}] ``` SVGR ``` @@ -126,7 +126,7 @@ mouse over ``` SNIPPET ``` -onmouseover='CMDS[${0:1}]' +onmouseover=CMDS[${0:1}] ``` SVGR ``` @@ -162,7 +162,7 @@ mouse move ``` SNIPPET ``` -onmousemove='CMDS[${0:1}]' +onmousemove=CMDS[${0:1}] ``` SVGR ``` @@ -198,7 +198,7 @@ mouse out ``` SNIPPET ``` -onmouseout='CMDS[${0:1}]' +onmouseout=CMDS[${0:1}] ``` SVGR ``` From 6a974655d21b74a6bb5b3309a1540dfb0be1b7f1 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:15:24 -0400 Subject: [PATCH 114/263] use @projectName@ in dnds --- .../App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds index a5e6d616..89580fc6 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds @@ -49,7 +49,7 @@ Forward click cmd (Step 4.2) ``` SNIPPET ``` -params$CMDS<-sprintf('shinyInputControlAABinding.clicked("%s", evt)',params$ID) +sprintf('@projectName@Binding.clicked("%s", "%s", evt)',params$ID, params$value) ``` SVGR ``` @@ -153,7 +153,7 @@ update (Step 7) SNIPPET ``` wh=${1:c(400,400)} -updateShinyInputControlAA(session=shinysession, inputId=inputId, wh=wh, value=value ) +update@projectName@(session=shinysession, inputId=inputId, wh=wh, value=value ) ``` SVGR ``` From ced4038357fd654cc4022506839e24902d18fd80 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:17:30 -0400 Subject: [PATCH 115/263] add extract attr from element --- .../shinyInputControl/aux/dnds/jstools.dnds | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds index 7f8896c8..62382a0b 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds @@ -4,16 +4,14 @@ author: "Anonymous" date: "TODAY" output: dnd_snippet --- - - ****************** POPUP ``` -get element data (Steps 3.2?) +extract element attribute (Steps 3.2?) ``` SNIPPET ``` - $(el).data('${0:(valueName)}'); + let value = $(el).attr('${0:value}'); ``` SVGR ``` @@ -23,21 +21,22 @@ ptR<-list( x=matrix(0,2,0) ) R<-.06*WH[1] -d<-list(M=WH*c(.8,.42), Q=WH*c(c(.8,.8),c(.2,.8))) +d<-list(M=WH*c(.65,.2), Q=WH*c(c(.25,.15),c(.25,.4))) +R<-.06*WH[1] +#d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - lapply(1:5, function(i){ - ellipse( - cxy=c(.6, .8-i*.1)*WH, - rxy=c(.2,.1)*WH, - stroke='black', - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ) - }) + #polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + + #rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), + path(d=d, stroke="#00FFFF", stroke.width=2, + marker.end=marker(viewBox=c(0, 0, 10, 10), + refXY=c(1,5), stroke.width=1, fill="#00FFFF", + markerWidth=4, markerHeight=5, orient="auto", + path( d=c("M", 0, 0, "L", 9, 5, "L", 0, 9, "z") ) + ) ), + text(xy=WH*c(.05,.9),'attr', fill="#00FFFF"), + text(xy=WH*c(.7,.4),'el', fill="#00FFFF") ) ``` ****************** @@ -47,7 +46,7 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", POPUP ``` -From String (step 3.2? 6.3.1?) +From String (step 2.2? 6.3.1?) ``` SNIPPET ``` @@ -110,15 +109,14 @@ svgR(wh=WH, ) ``` ********************* - ****************** POPUP ``` -set element data (Step 3.2?) +set element data (Step 2.3) ``` SNIPPET ``` - $(el).data('${1:(valueName)'}, ${0:(value)}); + $(el).data('${1:value'}, ${0:value}); ``` SVGR ``` @@ -146,16 +144,14 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", ) ``` -********************* - -******************** +****************** POPUP ``` -Trigger +get element data (Steps 3.2?) ``` SNIPPET ``` -${1:$(el)}.trigger(${0:"change"}); + $(el).data('${0:(valueName)}'); ``` SVGR ``` @@ -164,32 +160,38 @@ WH<-c(48,32) ptR<-list( x=matrix(0,2,0) ) -X=c(.2,.4,.6,.8) -D<-list( - M=c(.2,.2), - Q=c( ) -) -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - path(d=c("M",c(10,5), "Q", c(5,20), c(25,25) , "T", c(40,5)) , fill='#00FFFF'), - path(d=c("M",c(12,8), "Q", c(8,20), c(25,22) , "T", c(36,8)) , fill='black'), - path(d=c( "M", c(24,8), "C", c(22,10), c(30,10), c( 18,18), "Q" , c(30,15), c(28,10), c(32,10), c(32,8)),fill='#00FFFF') +R<-.06*WH[1] +d<-list(M=WH*c(.8,.42), Q=WH*c(c(.8,.8),c(.2,.8))) - +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + polygon(points=WH*c(c(.05,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), + rect(cxy=WH*c(.2,.5), wh=WH*c(.1,.1),fill="#00FFFF"), + lapply(1:5, function(i){ + ellipse( + cxy=c(.6, .8-i*.1)*WH, + rxy=c(.2,.1)*WH, + stroke='black', + fill='#00FFFF', + stroke='black', + stroke.width=.5 + ) + }) ) ``` ****************** + ********************* POPUP ``` -add mouse click (step 4.1) +add mouse click handler (step 4.1) ``` SNIPPET ``` -clicked: function(ctrlId, evt ){ - alert('hi from '+ ctrlId); -} +clicked: function(ctrlId, ${1:value,} evt ){ + alert('hi from '+ ctrlId +" my value is " + ${0:value}); +}, ``` SVGR ``` @@ -221,6 +223,8 @@ svgR(wh=WH, stroke="#00FFFF", fill="none", ) ``` + + ****************** ********************* @@ -232,8 +236,8 @@ add mouse2pt function SNIPPET ``` mouse2pt: function(id, x, y){ //method to convert mouse coord to svg coord - var thisSVG=document.querySelector("#" + id +" svg"); - var pt= thisSVG.createSVGPoint(); + let thisSVG=document.querySelector("#" + id +" svg"); + let pt= thisSVG.createSVGPoint(); pt.x = x; pt.y = y; return pt.matrixTransform(thisSVG.getScreenCTM().inverse()); @@ -265,6 +269,36 @@ svgR(wh=WH, ) ``` ********************* +******************** +POPUP +``` +Trigger +``` +SNIPPET +``` +${1:$(el)}.trigger(${0:"change"}); +``` +SVGR +``` +library(svgR) +WH<-c(48,32) +ptR<-list( + x=matrix(0,2,0) +) +X=c(.2,.4,.6,.8) +D<-list( + M=c(.2,.2), + Q=c( ) +) +svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", + path(d=c("M",c(10,5), "Q", c(5,20), c(25,25) , "T", c(40,5)) , fill='#00FFFF'), + path(d=c("M",c(12,8), "Q", c(8,20), c(25,22) , "T", c(36,8)) , fill='black'), + path(d=c( "M", c(24,8), "C", c(22,10), c(30,10), c( 18,18), "Q" , c(30,15), c(28,10), c(32,10), c(32,8)),fill='#00FFFF') + + +) +``` +****************** POPUP ``` @@ -272,7 +306,7 @@ extract value from data (6.3.1) ``` SNIPPET ``` -var value = data.value; +let value = data.value; ``` SVGR ``` @@ -316,7 +350,7 @@ replace svg tree (Step 6.4.3) ``` SNIPPET ``` -var node=data.${0:value}; //value +let node=data.${0:node}; //value $(el).empty().append(node); ``` SVGR @@ -351,7 +385,7 @@ set svg node attribute ``` SNIPPET ``` -var node=document.getElementById( ${1:nodeId}); +let node=document.getElementById( ${1:nodeId}); node.setAttribute('${2:attrName}', ${0:attrValue}); ``` SVGR @@ -365,7 +399,8 @@ R<-.06*WH[1] d<-list(M=WH*c(.2,.42), Q=WH*c(c(.2,.8),c(.5,.8))) svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", - text(xy=WH*c(.2,.38),'attr', stroke.width=1, fill="#00FFFF"), + text(xy=WH*c(.05,.38),'attr', stroke.width=1, fill="#00FFFF"), + text(xy=WH*c(.6,.9),'n', stroke.width=.5, fill="#00FFFF"), path(d=d, stroke="#00FFFF", marker.end=marker(viewBox=c(0, 0, 10, 10), refXY=c(1,5), stroke.width=1, fill="#00FFFF", markerWidth=4, markerHeight=5, orient="auto", @@ -376,41 +411,6 @@ svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fill="none", ``` ****************** -****************** -POPUP -``` -set element data (Step 3.2?) -``` -SNIPPET -``` - $(el).data('${1:(valueName)'}, ${0:(value)}); -``` -SVGR -``` -library(svgR) -WH<-c(48,32) -ptR<-list( - x=matrix(0,2,0) -) -R<-.06*WH[1] -d<-list(M=WH*c(.8,.85), Q=WH*c(c(.12,.85),c(.12,.52))) - -svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", - polygon(points=WH*c(c(.25,.5), c(.15,.3),c(.15,.7)),fill='#00FFFF'), - rect(cxy=WH*c(.1,.5), wh=WH*c(.1,.1),fill="#00FFFF"), - lapply(1:5, function(i){ - ellipse( - cxy=c(.6, .8-i*.1)*WH, - rxy=c(.2,.1)*WH, - stroke='black', - fill='#00FFFF', - stroke='black', - stroke.width=.5 - ) - }) -) -``` - ********************* From a2709c8e4a6eb8634d1f5b1c5688a06d7b122455 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 22 Oct 2020 14:18:22 -0400 Subject: [PATCH 116/263] clean up sampleShapes --- .../shinyInputControl/aux/dnds/sampleShapes.dnds | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds index c85c7c3e..9cfe969e 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/sampleShapes.dnds @@ -23,7 +23,7 @@ SNIPPET ``` circle( cxy=${1:WH/2}, - r=${2:WH[2]/3}, + r=${2:min(WH)/3}, stroke='black', fill=${3:'none'} )${0:} @@ -197,8 +197,8 @@ SNIPPET polyline( points=${1:WH*matrix(c(.25,.25,.5,.5,.75,.25),2)}, stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} + stroke.width=${3:1}, + fill=${4:'none'} )${0:} ``` SVGR @@ -228,8 +228,8 @@ SNIPPET polygon( points=${1:WH*matrix(c(.25,.75,.5,.5,.75,.75),2)}, stroke=${2:'black'}, - stroke.width=${2:1}, - fill=${3:'none'} + stroke.width=${3:1}, + fill=${4:'none'} )${0:} ``` SVGR @@ -329,7 +329,7 @@ SNIPPET path( d=list( M=${1:c(.5,.2)*WH}, - A=${2:c(2.3*WH, 180,1,0,c(.8,.5)*WH)} + A=${2:c(.3*WH, 180,1,0,c(.8,.5)*WH)} ), stroke=${3:'#0000FF'}, stroke.width=${4:2}, @@ -372,7 +372,7 @@ path( ${1:M=c(.2,.2)*WH,} Q=${2:c( c(.5,1.5),c(.8,.2))*WH} ), - stroke=${3:'#000FF'}, + stroke=${3:'#0000FF'}, stroke.width=${4:1}, fill=${5:'none'} )${0:} From daf625d633e556f2312505a52402c77246e32925 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 3 Nov 2020 08:16:48 -0500 Subject: [PATCH 117/263] Leading uppercase for @Projectname@ --- inst/App/fileIO/dndSnippetLoader.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inst/App/fileIO/dndSnippetLoader.R b/inst/App/fileIO/dndSnippetLoader.R index 4a646b20..da07600a 100644 --- a/inst/App/fileIO/dndSnippetLoader.R +++ b/inst/App/fileIO/dndSnippetLoader.R @@ -119,11 +119,16 @@ dripplets2List2<-function(drps){ rtv<-extractDripplet(dr) rtv }) - + s.upper<-function(s){ + paste(toupper(substring(s, 1, 1)), substring(s, 2), + sep = "", collapse = " ") + } if(!is.null(editOption$currentProjectName)){ cname<-sub('\\.pprj$','', editOption$currentProjectName) + Cname<-s.upper(cname) drps<-lapply(drps, function(dr){ dr['snip']<-gsub('@projectName@', cname , dr['snip']) + dr['snip']<-gsub('@ProjectName@', Cname , dr['snip']) dr }) } From ed2e4145c72eccca6a4091d94b1bf5666f5f0002 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 3 Nov 2020 08:18:11 -0500 Subject: [PATCH 118/263] reworked shinyInputControl template --- .../projectTemplates/shinyInputControl/app.R | 14 +- .../shinyInputControl/aux/dnds/cntl.dnds | 21 +- .../shinyInputControl/aux/dnds/jstools.dnds | 16 +- .../shinyInputControl/readme.Rmd | 515 ++++++++++++++---- .../shinyInputControl/shinyInputControl.R | 34 +- .../shinyInputControl/shinyInputControl_svg.R | 5 +- .../www/shinyInputControl.js | 20 +- 7 files changed, 481 insertions(+), 144 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/app.R b/inst/App/projectTemplates/shinyInputControl/app.R index 5fadbbbf..4dc12aa7 100644 --- a/inst/App/projectTemplates/shinyInputControl/app.R +++ b/inst/App/projectTemplates/shinyInputControl/app.R @@ -2,7 +2,8 @@ library(shiny) source("shinyInputControl.R") initialValue='200' - +inputId.1<-"shinyInputControlID-1" + ui<-fluidPage( h1('Test App'), h3('current Value'), @@ -11,24 +12,27 @@ ui<-fluidPage( textInput(inputId='updateValue','update value', initialValue), actionButton('updateButton', label='press to update value'), - shinyInputControl(inputId='myshinyInputControl', wh=c(400,400), value= initialValue) + shinyInputControl(inputId=inputId.1, value= initialValue) ) server<-function(input,output,session){ - output$currentValue<-renderText(input$myshinyInputControl) + output$currentValue<-renderText(input[[ inputId.1 ]]) observeEvent(input$updateButton,{ value<-input$updateValue tryCatch({ - # STEP 6.1: + # STEP 3.1: # 1. prepare value for update: + # for example: # for non-text values consider using either # i) value<-eval(parse(text=value)) # or if value is numeric # ii) value<-as.numeric(value) - # 2. add updateShinyInputControl + # 2. call updateShinyInputControl + # for example: + # updateShinyInputControl(session, inputId=inputId.1, value=value ) }, error=function(e){ diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds index 89580fc6..6c95c85a 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds @@ -15,7 +15,7 @@ output: dnd_snippet ****************** POPUP ``` -toJSON (Steps 3.1? 6.2?) +toJSON (Steps 2,2.1 3.2.1?) ``` SNIPPET ``` @@ -45,11 +45,11 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", POPUP ``` -Forward click cmd (Step 4.2) +Forward click cmd (Step 5.2) ``` SNIPPET ``` -sprintf('@projectName@Binding.clicked("%s", "%s", evt)',params$ID, params$value) +sprintf('@projectName@Binding.clicked("%s", "%s", evt)',params\$ID, mssg) ``` SVGR ``` @@ -83,7 +83,7 @@ svgR(wh=WH, stroke="#00FFFF", fill="none", ****************** POPUP ``` -fromJSON (Step 5.1?) +fromJSON (Step 6.1?) ``` SNIPPET ``` @@ -111,18 +111,18 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", POPUP ``` -Update (Step 6.2) +Update (Step 3.2) ``` SNIPPET ``` #1. Recreate svg Tree node<-as.character(@projectName@SvgWrapper( - params=list(ID=inputId, WH=wh, ${1:value}=value) #<<-- + params=list(ID=inputId, ${1:value}=value) # <<-- )) # 2. Form message mssg<-list(node=node, value=value) - #3. Send message to client - session$sendInputMessage(inputId, mssg) + # 3. Send message to client + session\$sendInputMessage(inputId, mssg) ``` SVGR @@ -148,12 +148,11 @@ svgR(wh=WH, stroke.width=3, stroke="#00FFFF", fill="#00FFFF", ****************** POPUP ``` -update (Step 7) +update svg (Step 7) ``` SNIPPET ``` -wh=${1:c(400,400)} -update@projectName@(session=shinysession, inputId=inputId, wh=wh, value=value ) +update@ProjectName@(session=shinysession, inputId=inputId, value=value ) ``` SVGR ``` diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds index 62382a0b..4521989e 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/jstools.dnds @@ -7,7 +7,7 @@ output: dnd_snippet ****************** POPUP ``` -extract element attribute (Steps 3.2?) +extract attribute (Steps 2.3.1) ``` SNIPPET ``` @@ -46,7 +46,7 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", POPUP ``` -From String (step 2.2? 6.3.1?) +From String (steps 3.2 3.3.2?) ``` SNIPPET ``` @@ -112,7 +112,7 @@ svgR(wh=WH, ****************** POPUP ``` -set element data (Step 2.3) +set element data (Step 3.3.3) ``` SNIPPET ``` @@ -147,11 +147,11 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", ****************** POPUP ``` -get element data (Steps 3.2?) +get element data ``` SNIPPET ``` - $(el).data('${0:(valueName)}'); + $(el).data('${0:value}'); ``` SVGR ``` @@ -185,12 +185,14 @@ svgR(wh=WH, #stroke.width=1, stroke="#00FFFF", fill="none", POPUP ``` -add mouse click handler (step 4.1) +add mouse click handler (step 5.1) ``` SNIPPET ``` clicked: function(ctrlId, ${1:value,} evt ){ - alert('hi from '+ ctrlId +" my value is " + ${0:value}); + alert('hi from '+ ctrlId +" my value is " + ${0:value}); //for testing + let el='#'+ctrlId; + // add code here }, ``` SVGR diff --git a/inst/App/projectTemplates/shinyInputControl/readme.Rmd b/inst/App/projectTemplates/shinyInputControl/readme.Rmd index a60e6ef8..b5529d8b 100644 --- a/inst/App/projectTemplates/shinyInputControl/readme.Rmd +++ b/inst/App/projectTemplates/shinyInputControl/readme.Rmd @@ -14,10 +14,12 @@ library(svgR) # Steps to Implement *shinyInputControl* +In what follows steps 1-3 address server to client, steps 4-6 address client to server. Step 7 involves client to server back to client. + ### 1. Building your svg -```{r, results='asis', } -box % Date: Tue, 1 Dec 2020 12:38:32 -0500 Subject: [PATCH 119/263] update comments for shinyInputControl template --- .../shinyInputControl/aux/dnds/cntl.dnds | 2 +- .../shinyInputControl/shinyInputControl.R | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds index 6c95c85a..2b0bd90a 100644 --- a/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds +++ b/inst/App/projectTemplates/shinyInputControl/aux/dnds/cntl.dnds @@ -19,7 +19,7 @@ toJSON (Steps 2,2.1 3.2.1?) ``` SNIPPET ``` - toJSON('${1:(value)'}, ${0:(value)}); + toJSON('${1:value'}}); ``` SVGR ``` diff --git a/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R index c5d3e6f6..7fe8f34b 100644 --- a/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R +++ b/inst/App/projectTemplates/shinyInputControl/shinyInputControl.R @@ -21,7 +21,11 @@ shinyInputControlSvgWrapper<-function(params){ } -# Control constructor to insert in app ui +#' Constructor for the shinyInputControl +#' +#' @param inputId the id of this shiny input +#' @param value the initial value for this control +#' export shinyInputControl<-function(inputId, value='whatever' ){ # note: use toJSON for non-trivial initializations # STEP 2.1 Place any preprocessing of (initial input) value(s) here @@ -45,8 +49,13 @@ shinyInputControl<-function(inputId, value='whatever' ){ ) } - -# server to client update +#' updateShinyInputControl +#' server to client update +#' +#' @param session the shiny session +#' @param inputId the control Id +#' @param value update with this value +#' @export updateShinyInputControl<-function(session, inputId, value='bogus'){ # Perform any value preprocessing here (toJSON if needed) # STEP 3.2 Using Braindead Update Approach: From 8795efb272b5707407f266de6f787f7930bf50fe Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 12 Dec 2020 16:39:59 -0500 Subject: [PATCH 120/263] hide edit preproc when no preproc is available --- .../leftPanel/dnippets/serverDnippetCntrl.R | 4 +-- .../App/rightPanel/preProc/serverAuxPreproc.R | 30 +++++++++++-------- inst/App/rightPanel/serverPanelCoordinator.R | 3 ++ inst/App/ui.R | 1 + 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/inst/App/leftPanel/dnippets/serverDnippetCntrl.R b/inst/App/leftPanel/dnippets/serverDnippetCntrl.R index 53906866..c884b170 100644 --- a/inst/App/leftPanel/dnippets/serverDnippetCntrl.R +++ b/inst/App/leftPanel/dnippets/serverDnippetCntrl.R @@ -42,7 +42,7 @@ observeEvent(c( getDnippetsAll(), dnippetsDB$usage, input$pages),{ hideElement('selectedDnippetButtonBoxContainer') } log.fout(c( getDnippetsAll(), getDnippetsSelected(), input$pages)) -}, label='getDnippetsAll+usage+pages') +}, label='getDnippetsAll+usage+pages', ignoreNULL = FALSE,) observeEvent(input$selectedDDDnippets,{ if(!is.null(input$pages)){ @@ -50,6 +50,6 @@ observeEvent(input$selectedDDDnippets,{ setDnippetsSelected(input$pages , selected) } -}, ignoreInit = TRUE, ignoreNULL = TRUE, label='selectedDDDnippets') +}, ignoreInit = TRUE, ignoreNULL = FALSE, label='selectedDDDnippets') diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index 7d4089a5..8403ca89 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -110,18 +110,24 @@ populatePreProcEditMenu<-function(type=points){ shinyDMDMenu::menuItem(nn, value=paste0('editPP-',type,'-',nn)) }) idd=trimws(paste0('dropDown-editPreProc-',type)) - afterEntry=ifelse(type=='points', 'cmdNewPP', 'cmdNewAP') - label=paste0('Edit preproc ',type) - shinyDMDMenu::insertAfterDMDM( - session, - menuBarId ="plotNavBar", - entry=afterEntry, - submenu= - do.call( - function(...){ menuDropdown( label,...) }, - kids - ) - ) + if(length(kids)>0){ + enableDMDM(session, 'plotNavBar',idd) + afterEntry=ifelse(type=='points', 'cmdNewPP', 'cmdNewAP') + label=paste0('Edit preproc ',type) + shinyDMDMenu::insertAfterDMDM( + session, + menuBarId ="plotNavBar", + entry=afterEntry, + submenu= + do.call( + function(...){ menuDropdown( label,...) }, + kids + ) + ) + } else { + disableDMDM(session, 'plotNavBar',idd) + } + } readAuxPreProcs<-function( startup=TRUE){ diff --git a/inst/App/rightPanel/serverPanelCoordinator.R b/inst/App/rightPanel/serverPanelCoordinator.R index 3ff3e86b..4a2b8310 100644 --- a/inst/App/rightPanel/serverPanelCoordinator.R +++ b/inst/App/rightPanel/serverPanelCoordinator.R @@ -78,6 +78,8 @@ getColumnType<-reactive({ getPlotState<-reactive({ nameType<-getNameType() if(identical(nameType,tibTag)){ + # Tools + enableDMDM(session, 'plotNavBar','Tools') colType<-getColumnType() if(is.null(colType)){ rtv<-NULL #should never happen!!! @@ -87,6 +89,7 @@ getPlotState<-reactive({ rtv<-'value' } } else { + disableDMDM(session, 'plotNavBar','Tools') rtv<-nameType } rtv diff --git a/inst/App/ui.R b/inst/App/ui.R index b6ef55b2..0e7479ef 100755 --- a/inst/App/ui.R +++ b/inst/App/ui.R @@ -13,6 +13,7 @@ library(shiny) # style="position: fixed; top: -100em" to keep hidden shinyUI( div( class="pretty-split-pane-frame", id="mySplitter", + #ondrop="dropHandler(ev)", singleton( tags$head( initResourcePaths(), From 49dca17ee86a0f2d135aecad45a88cae9f083029 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 17 Dec 2020 20:08:06 -0500 Subject: [PATCH 121/263] using jqScrollBar for asset and column buttons --- inst/App/global.R | 2 +- inst/App/rightPanel/header/moduleEdAsset.R | 7 ++++--- inst/App/rightPanel/header/moduleEdTib.R | 14 +++++++++----- inst/App/rightPanel/header/serverEdAsset.R | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/inst/App/global.R b/inst/App/global.R index f31ece13..77227732 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -48,7 +48,7 @@ notNull<-function(...) { sapply( c('shiny','shinyjs', 'shinyalert', 'R.utils', 'svgR', 'shinyAce', 'jsonlite', 'rowPicker', 'fs', - 'shinyDMDMenu', 'shinyFiles', 'shinythemes', 'colourpicker', 'shinyWidgets', + 'shinyDMDMenu', 'shinyFiles', 'shinythemes', 'colourpicker', 'shinyWidgets', 'jqScrollBar', 'bsplus','shinyjqui', 'knitr', 'tidyverse'), library, character.only=TRUE) # 'stringr', , in "tidyverse" diff --git a/inst/App/rightPanel/header/moduleEdAsset.R b/inst/App/rightPanel/header/moduleEdAsset.R index 61ec4415..2896d9e0 100644 --- a/inst/App/rightPanel/header/moduleEdAsset.R +++ b/inst/App/rightPanel/header/moduleEdAsset.R @@ -28,9 +28,10 @@ moduleEdAsset<-function(input, output, session, output$dataSetUI<-renderUI({ if( length(nameChoices() )>0){ butts<- nameChoices() - # isolate(print(butts)) - radioGroupButtons(inputId=ns("name"), choices=butts, selected=name(), - justified=TRUE) + #butts=mapply(function(x)list('r'),butts,SIMPLIFY = T,USE.NAMES = T) + jqScrollBar(inputId=ns("name"), choices =butts, selected=name()) + # radioGroupButtons(inputId=ns("name"), choices=butts, selected=name(), + # justified=TRUE) } }) diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index 755a0c80..950daca4 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -89,11 +89,15 @@ moduleEdTib<-function(input, output, session, #---columns output$columnUI<-renderUI({ if( getTibEditState()==TRUE ){ - if(!is.null(getColumnName()) && !is.null(getColumnNameChoices())){ - radioGroupButtons(inputId=ns("columnRadio"), - choices=as.list(getColumnNameChoices()), - selected=getColumnName() , - justified=TRUE) + if(!is.null(getColumnName()) && !is.null(getColumnNameChoices())){ + + + jqScrollBar(inputId=ns("columnRadio"), + choices =getColumnNameChoices(), selected=getColumnName()) + # radioGroupButtons(inputId=ns("columnRadio"), + # choices=as.list(getColumnNameChoices()), + # selected=getColumnName() , + # justified=TRUE) } } }) diff --git a/inst/App/rightPanel/header/serverEdAsset.R b/inst/App/rightPanel/header/serverEdAsset.R index abc277c8..11e0fbe6 100644 --- a/inst/App/rightPanel/header/serverEdAsset.R +++ b/inst/App/rightPanel/header/serverEdAsset.R @@ -27,7 +27,7 @@ observeEvent(returnValue4ModuleEdAsset$name(),{ } } } -,ignoreInit = TRUE) +,ignoreInit = FALSE) observeEvent( returnValue4ModuleEdAsset$newAsset(),{ showModal( addNewAssetModal() ) From 3d76b324cdc784ca263200a7e2b368eeb5532598 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 18 Dec 2020 14:27:28 -0500 Subject: [PATCH 122/263] radioGroupButtons => jqScrollBar --- inst/App/rightPanel/header/moduleEdTib.R | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index 950daca4..c5e1132b 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -154,11 +154,14 @@ moduleEdTib<-function(input, output, session, choices<-sort(unique(unlist( choices ))) if(widget=='radio'){ # cat('xxx widget=', format(widget),"\n") - radioGroupButtons(inputId=ns("entryRadio"), - choices=choices, - selected=selected, - justified=TRUE - ) + # radioGroupButtons(inputId=ns("entryRadio"), + # choices=choices, + # selected=selected, + # justified=TRUE + # ) + jqScrollBar(inputId=ns("entryRadio"), + choices =choices, selected=selected) + } else if (widget=='picker'){ # cat('xxx widget=', format(widget),"\n") div( "class"="ptR2", width='800px', From c1e21c0bf40597a59a40cfc5a1a5c20b4dadfd7c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Dec 2020 22:10:19 -0500 Subject: [PATCH 123/263] 1. added restrictMode, labelMode to displayOptions 2. added checkboxInput4Menu 3. implemented insertMode to control accidental point inserts --- inst/App/rightPanel/menu/buildRightMenuUI.R | 25 +++++-- inst/App/rightPanel/menu/serverPlotBar.R | 66 ++++++++++++------- inst/App/rightPanel/mid/serverPlotBarPoints.R | 26 ++++++-- .../App/rightPanel/mid/serverPlotBarTagDrag.R | 23 +++++-- .../rightPanel/mid/serverPlotBarTagValues.R | 17 +++-- inst/App/rightPanel/mid/serverSvgBackdrop.R | 1 - inst/App/rightPanel/mid/serverSvgGrid.R | 11 ++-- inst/App/rightPanel/serverDisplayOptions.R | 15 ++++- 8 files changed, 130 insertions(+), 54 deletions(-) diff --git a/inst/App/rightPanel/menu/buildRightMenuUI.R b/inst/App/rightPanel/menu/buildRightMenuUI.R index a4b91fd8..bb82c4ee 100644 --- a/inst/App/rightPanel/menu/buildRightMenuUI.R +++ b/inst/App/rightPanel/menu/buildRightMenuUI.R @@ -1,13 +1,28 @@ +checkBoxInput4Menu<-function (inputId, label, value = FALSE, width = NULL) +{ + value <- restoreInput(id = inputId, default = value) + inputTag <- tags$input(id = inputId, type = "checkbox") + if (!is.null(value) && value) + inputTag$attribs$checked <- "checked" + div(class = "form-group shiny-input-container", style = if (!is.null(width)) + paste0("width: ", validateCssUnit(width), "; margin-bottom:0;"), div(class = "checkbox", + tags$label(inputTag, tags$span(label)))) +} + buildRightMenu<-function(){ dmdMenuBarPage( menuBarId="plotNavBar", menuDropdown('Display', menuDropdown('Points', - shinyDMDMenu::menuItem('Show Points without Labels', value='cmdShowPointsNoLabels'), - shinyDMDMenu::menuItem('Show Points with Labels', value='cmdShowPointLabels') + shinyDMDMenu::menuItem( checkBoxInput4Menu('cmdLabelPoints', 'Label Points', FALSE, width="100px"), value="consolidate"), + shinyDMDMenu::menuItem( checkBoxInput4Menu('cmdRestrictRows', 'Restrict to Current Row', FALSE, width="150px"), value="consolidate"), + shinyDMDMenu::menuItem( checkBoxInput4Menu('cmdInsertEnabled', 'Insertion Enabled', TRUE, width="120px"), value="consolidate") + # shinyDMDMenu::menuItem('Show Points without Labels', value='cmdShowPointsNoLabels'), + # shinyDMDMenu::menuItem('Show Points with Labels', value='cmdShowPointLabels') ), menuDropdown( 'Grid', - shinyDMDMenu::menuItem('Show', value='cmdShowGrid'), + #shinyDMDMenu::menuItem('Show', value='cmdShowGrid'), + shinyDMDMenu::menuItem( checkBoxInput4Menu('cmdShowGrid', 'Show', FALSE, width="100px"), value="consolidate"), shinyDMDMenu::menuItem('Spacing', value='cmdAdjustGridSpacing') ) , @@ -23,8 +38,8 @@ buildRightMenu<-function(){ ) )) ), - shinyDMDMenu::menuItem( - checkboxInput('solidBackdrop', 'Solid', TRUE, width="100px"), value="consolidate" + shinyDMDMenu::menuItem( + checkBoxInput4Menu('solidBackdrop', 'Solid', TRUE, width="100px"), value="consolidate" ) ) ), diff --git a/inst/App/rightPanel/menu/serverPlotBar.R b/inst/App/rightPanel/menu/serverPlotBar.R index e5e476cc..e935182e 100644 --- a/inst/App/rightPanel/menu/serverPlotBar.R +++ b/inst/App/rightPanel/menu/serverPlotBar.R @@ -7,15 +7,15 @@ observeEvent(input$plotNavBar, { return(NULL) } - if(cmd == 'cmdShowGrid'){ - renameDMDM(session, "plotNavBar", "cmdShowGrid", "Hide Grid", newValue="cmdHideGrid") - setSvgGrid(input$pages, show=TRUE) - } - - if(cmd == 'cmdHideGrid'){ - renameDMDM(session, "plotNavBar", "cmdHideGrid", "Show Grid",newValue="cmdShowGrid") - setSvgGrid(input$pages, show=FALSE) - } + # if(cmd == 'cmdShowGrid'){ + # renameDMDM(session, "plotNavBar", "cmdShowGrid", "Hide Grid", newValue="cmdHideGrid") + # setSvgGrid(input$pages, show=TRUE) + # } + # + # if(cmd == 'cmdHideGrid'){ + # renameDMDM(session, "plotNavBar", "cmdHideGrid", "Show Grid",newValue="cmdShowGrid") + # setSvgGrid(input$pages, show=FALSE) + # } if(cmd == 'cmdAdjustGridSpacing'){ spacingChoices<-c(.01, .05, .1, .5 ,1, 5,50,100,500) @@ -45,19 +45,19 @@ observeEvent(input$plotNavBar, { setBackDrop(hide=FALSE) } - if(cmd == 'cmdShowPointsNoLabels'){ - disableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointsNoLabels") - enableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointLabels") - enableDMDM(session, menuBarId="plotNavBar", entry="cmdHidePoints") - setDisplayOption(ptMode='Normal') - } - - if(cmd == 'cmdShowPointLabels'){ - enableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointsNoLabels") - disableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointLabels") - enableDMDM(session, menuBarId="plotNavBar", entry="cmdHidePoints") - setDisplayOption(ptMode='Labeled') - } + # if(cmd == 'cmdShowPointsNoLabels'){ + # disableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointsNoLabels") + # enableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointLabels") + # enableDMDM(session, menuBarId="plotNavBar", entry="cmdHidePoints") + # setDisplayOption(ptMode='Normal') + # } + # + # if(cmd == 'cmdShowPointLabels'){ + # enableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointsNoLabels") + # disableDMDM(session, menuBarId="plotNavBar", entry="cmdShowPointLabels") + # enableDMDM(session, menuBarId="plotNavBar", entry="cmdHidePoints") + # setDisplayOption(ptMode='Labeled') + # } if(cmd == 'cmdNewColumn'){ showModal( addNewColModal() ) @@ -137,4 +137,26 @@ observeEvent(input$plotNavBar, { }) +observeEvent(input$cmdLabelPoints,{ + checked<-input$cmdLabelPoints + setDisplayOption(labelMode=checked) +}, ignoreNULL=TRUE) + +observeEvent(input$cmdInsertEnabled,{ + checked<-input$cmdInsertEnabled + setDisplayOption(insertMode=checked) +}, ignoreNULL=TRUE) + + +observeEvent(input$cmdRestrictRows,{ + checked<-input$cmdRestrictRows + setDisplayOption(restrictMode=checked) +}, ignoreNULL=TRUE) + +observeEvent(input$cmdShowGrid,{ + checked<-input$cmdShowGrid + setSvgGrid(input$pages, show=checked) +}, ignoreNULL=TRUE) + + diff --git a/inst/App/rightPanel/mid/serverPlotBarPoints.R b/inst/App/rightPanel/mid/serverPlotBarPoints.R index 9254a0ce..64821360 100755 --- a/inst/App/rightPanel/mid/serverPlotBarPoints.R +++ b/inst/App/rightPanel/mid/serverPlotBarPoints.R @@ -9,10 +9,19 @@ pts=NULL, rowIndex=NULL, matColIndex=NULL, - ptDisplayMode="Normal", + displayOptions=NULL, vbScaleFactor ){ - if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } + + + if(is.null(displayOptions)){ + return(NULL) + } + + displayOpt<-displayOptions + if(is.null(displayOpt)||is.null(displayOpt$labelMode) || is.null(displayOpt$restrictMode)){ return(NULL)} + + # if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } onMouseDownTxt='ptRPlotter_ptR_SVG_Point.selectPoint(evt)' if(is.null(pts) ){ return(NULL) } if(length(unlist(pts))<2){ return(NULL)} @@ -23,16 +32,19 @@ opacity[rowIndex]<-1 #form list of all point renderings + if(displayOptions$restrictMode==TRUE){ + rows=rowIndex + } else { + rows=1:length(pts) + } g( - lapply(seq(length(pts)), function(i){ + lapply(rows, function(i){ m<-pts[[i]] if(length(m)==0){ # or !is(m,'matrix') NULL } else { lapply(seq(ncol(m)), function(j){ #j is the matCol index - id<-paste("pd",ptName,i,j,sep="-") - pt<-m[,j] color=colorScheme['default'] @@ -54,7 +66,7 @@ onmousedown=onMouseDownTxt ) }, - if(ptDisplayMode=="Labeled"){ + if(displayOpt$labelMode==TRUE){ text(paste0(i,",",j), xy=c(10,-10), stroke='black', font.size=12, opacity=1, transform=list(scale=1/vbScaleFactor,translate=vbScaleFactor*pt)) @@ -104,7 +116,7 @@ statusPlotPoint<-callModule( pts=getTibPts(), #getPtDefs()$pts[[getPtName()]], rowIndex=getTibRow(), matColIndex=getTibMatCol(), - ptDisplayMode=getDisplayMode(), + displayOptions=getDisplayOptions(), vbScaleFactor=vbScaleFactor ) ) diff --git a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R index 9be42e93..51e77cf9 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R @@ -8,10 +8,16 @@ ptName=NULL, pts=NULL, rowIndex=NULL, - ptDisplayMode, + displayOptions=NULL, vbScaleFactor=1 ){ - if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } + #if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } + + if(is.null(displayOptions)){ + return(NULL) + } + displayOpt<-displayOptions + if(is.null(displayOpt)||is.null(displayOpt$labelMode) || is.null(displayOpt$restrictMode)){ return(NULL)} onMouseDownTxt="ptRPlotter_ptR_SVG_TagDrag.selectElement(evt)" @@ -30,7 +36,8 @@ offRows<-rowNums[-rowIndex] mRow<-pts[[rowIndex]] - list( + list( + if(displayOptions$restrictMode==FALSE){ lapply(offRows, function(i){ #non-selected rows m<-pts[[i]] if(length(m)==0){ @@ -45,7 +52,7 @@ pt=m[,j] g( circle(cxy=c(0,0), r=8), - if(ptDisplayMode=="Labeled"){ + if(displayOpt$labelMode==TRUE){ text( paste(i), xy=c(10,-10), stroke='black', font.size=12) } else { NULL @@ -55,7 +62,9 @@ }) ) } - }), + })} else { + NULL + }, if(length( mRow)==0){ NULL } else { #selected row=rowIndex @@ -68,7 +77,7 @@ pt=mRow[,j] g( circle(cxy=c(0,0), r=8), - if(ptDisplayMode=="Labeled"){ + if(displayOpt$labelMode==TRUE){ text( paste(rowIndex), xy=c(10,-10), stroke='black', font.size=12) } else { NULL @@ -94,7 +103,7 @@ statusPlotTagDrag<-callModule( ptName=getAssetName(), pts=getTibPts(), rowIndex=getTibRow(), - ptDisplayMode=getDisplayMode(), + displayOptions=getDisplayOptions(), vbScaleFactor ) } diff --git a/inst/App/rightPanel/mid/serverPlotBarTagValues.R b/inst/App/rightPanel/mid/serverPlotBarTagValues.R index ed8e3574..ffb8e494 100755 --- a/inst/App/rightPanel/mid/serverPlotBarTagValues.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagValues.R @@ -8,10 +8,17 @@ showPts.valTag %---> input$pages 5\n") tb<-getSvgGrid() if(length(tb$show)>0){ - if(tb$show){ - renameDMDM(session, "plotNavBar", "cmdShowGrid", "Hide Grid", newValue="cmdHideGrid") - }else{ - renameDMDM(session, "plotNavBar", "cmdHideGrid", "Show Grid",newValue="cmdShowGrid") - } + updateCheckboxInput(session, "cmdShowGrid", value = tb$show) + # if(tb$show){ + # renameDMDM(session, "plotNavBar", "cmdShowGrid", "Hide Grid", newValue="cmdHideGrid") + # }else{ + # renameDMDM(session, "plotNavBar", "cmdHideGrid", "Show Grid",newValue="cmdShowGrid") + # } } # cat("<---< input$pages 5\n") }) diff --git a/inst/App/rightPanel/serverDisplayOptions.R b/inst/App/rightPanel/serverDisplayOptions.R index ee6f10d1..0116646d 100644 --- a/inst/App/rightPanel/serverDisplayOptions.R +++ b/inst/App/rightPanel/serverDisplayOptions.R @@ -2,7 +2,9 @@ # controls display of svg rendering displayOptions<-reactiveValues( insertMode=TRUE, - ptMode="Normal" # can be 'Hidden', 'Normal', 'Labeled' + ptMode="Normal", # can be 'Hidden', 'Normal', 'Labeled' + labelMode=FALSE, + restrictMode=FALSE ) #displayMode<-reactive({displayOptions$ptMode}) @@ -22,7 +24,13 @@ getDisplayMode<-reactive({ }) -setDisplayOption<-function( insertMode, ptMode ){ +setDisplayOption<-function( insertMode, ptMode, labelMode, restrictMode ){ + if(!missing(labelMode)){ + displayOptions$labelMode<-labelMode + } + if(!missing(restrictMode)){ + displayOptions$restrictMode<-restrictMode + } if(!missing(insertMode)){ displayOptions$insertMode<-insertMode } @@ -30,6 +38,9 @@ setDisplayOption<-function( insertMode, ptMode ){ displayOptions$ptMode<-ptMode } } +getDisplayOptions<-reactive({ + tmp<-reactiveValuesToList(displayOptions) +}) From 39aaf0d7c78e940cac78ae5b69b1a1a51090d863 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Dec 2020 22:10:46 -0500 Subject: [PATCH 124/263] styling of ace tabs --- inst/App/www/customStyle.css | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/inst/App/www/customStyle.css b/inst/App/www/customStyle.css index a57df7d8..55ced4cb 100644 --- a/inst/App/www/customStyle.css +++ b/inst/App/www/customStyle.css @@ -193,10 +193,23 @@ padding-right: 2px; display: inline-block; overflow: hidden; } +.nav-tabs>li.active{ +padding-top: 0; +padding-bottom: 0; +} .nav-tabs>li.active>a{ -background-color: #111122; +/* background-color: #111122; font-weight: bold; color: #99ffff; +*/ +margin-top: 0; +margin-bottom: 0; +padding-top: 0; +padding-bottom: 0; +background: transparent url(images/ptr_selected_tab_bg.jpg) no-repeat -25px -3px; +font-size: 18px; +color: black; +height: 35px; } .nav-tabs>li>a{ background-color: #222244; From 9cc110ab442d883a202e6153d81c33f18b88128d Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 21 Dec 2020 22:11:19 -0500 Subject: [PATCH 125/263] styling of ace tabs --- inst/App/www/images/ptr_selected_tab_bg.jpg | Bin 0 -> 2853 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 inst/App/www/images/ptr_selected_tab_bg.jpg diff --git a/inst/App/www/images/ptr_selected_tab_bg.jpg b/inst/App/www/images/ptr_selected_tab_bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fae54ad5ae0e5d11fcab81e61def09e0d37d0a30 GIT binary patch literal 2853 zcmex=kBn zaw38vawLQQ2N(o77&I8aFf%GKFbOg;3o`yc!XOO_0!9XAg!38L**I8OIYE-<0zg?7 zE+(J{7&#%HV`Y?Be2IlkP*^lLG%RT$6EnMzh@v5fSYjZjQcz*z#3e^A0yRnjjbuVL zlYxPSjft5RWT=`T10yq#39=MwDyP-K|KTVLQQe-j zYIkFv$kKNQ6SsAjDHIuf4&rzd8eX7#Xo|IH=pF8YrTS&utYU90B`a65lxeNrA@E+jP)%H=kQv7N#u;i|)27>zgX{L6kag42?ao zoh#^j!iK=S!xN{^n&1v`(83$5);)-B)vVqSp|L&j#Obph$`GXiP}l9fp(7H#;YsSV zC4vy88c^58y%FQmy)o($aO92P81eUxt@jOyl8s#&oOS80*+l=vzy9oPX`|VF9Yn#qL(AK?i`uR`IdadsDUw*Ev{?mM5FT2UEx#oZ8 z_kR6tUmaI@GyOv3e+GqDvv=8L^BMl-)BG#{p8tL1=fC3N{~3Ojtg}DADLLLg`@{U! zqUw$NQfk$2)z@GDV{TqjbB!CQg~!bP{Ko#zZ_ay9R|;?M+_`)4vkkEqKSv~P{8!sk zKR?-fy6D44d3i5>t`P_7kjMcF$v?kw>FLpmirFA5S?|i5wn+npj{p2-va>KwPVL#d z{#ggh-Onbr0fh|z)%NPej2b)|6ogYn{~ej%QZYN$^9w)MegBD{>5Bk&;o={@AGxLn ziv7K^K7R456;sx;RlT&ER#~$)w|D#TlfD1eY~BCv{%7reiOwZjhi5Ps7untRKVmuQ zKSO)B?x{YdfBzY}R@CiDQk$@vFX3ayET=V=4QBZ=N?%We#fR9S2umMlk7-T)>U>No zlWW5>eu#mLdkRWNm5zo0Ss{>o<=Xly`n{S$6J4EsmsV-ky=VLNr}j&~y_oUUY@MGo uj+t)T{;SUZ`Ul2GrwfBWoPPYD!Jhl^OS}D|_4Zd4uJ1p=&{KB)|4jfGTj>-4 literal 0 HcmV?d00001 From 0f5328ed2378b6720633d952eb254d80caa4a932 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 24 Dec 2020 14:57:58 -0500 Subject: [PATCH 126/263] remove dangleing comma --- inst/App/fileIO/observeRequestStartUp.R | 1 + inst/App/fileIO/serverLoadWorkSpace.R | 3 +++ inst/App/fileIO/serverPage2Workspace.R | 4 +++- inst/App/leftPanel/mid/serverAce.R | 6 ++++-- inst/App/rightPanel/preProc/serverPreProcDB.R | 2 +- inst/App/server.R | 3 ++- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/inst/App/fileIO/observeRequestStartUp.R b/inst/App/fileIO/observeRequestStartUp.R index 1f66a191..b85b96e7 100644 --- a/inst/App/fileIO/observeRequestStartUp.R +++ b/inst/App/fileIO/observeRequestStartUp.R @@ -15,6 +15,7 @@ observeEvent(trigger$startup, { updateNewProjectMenu(session) updateRemoveTemplateMenu(session) resetWatcher() + aux$colChoiceSet<-readAuxCustColumns() log.fout(startup) }, priority=100) diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index a86b5c45..dd63c39a 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -137,6 +137,9 @@ restoreWorkSpace<-reactive({ tib<-extractDBFromPages(wsPages, "^fileDescriptor.", initTib=initialFileDescDB() ) fileDescDB(tib) + tib<-extractDBFromPages(wsPages, "^colSetPage.", initTib=initialColSetPageDB()) + colSetPageDB(tib) + if(!is.null(ptRproj)){ ptRproj$pathToProj<-editOption$currentProjectDirectory ptRproj$projName<-editOption$currentProjectName diff --git a/inst/App/fileIO/serverPage2Workspace.R b/inst/App/fileIO/serverPage2Workspace.R index 9205a015..2eac93de 100644 --- a/inst/App/fileIO/serverPage2Workspace.R +++ b/inst/App/fileIO/serverPage2Workspace.R @@ -14,6 +14,7 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ dnip<-getPageDnippetsDB(pageId) widg<-getPageWidgetDB(pageId) preprocPage<-getPagePreprocPageDB(pageId) + colSetPage<-getColSetPage(pageId) # print(widg) rtv<-c( fileDescriptor=getFileDescriptor(pageId), @@ -24,7 +25,8 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ trib=trib, dnip=dnip, widg=widg, - preprocPage=preprocPage + preprocPage=preprocPage, + colSetPage=colSetPage ) # ppE<-getPreProcPtEntries(pageId) diff --git a/inst/App/leftPanel/mid/serverAce.R b/inst/App/leftPanel/mid/serverAce.R index 6c943984..309293d6 100644 --- a/inst/App/leftPanel/mid/serverAce.R +++ b/inst/App/leftPanel/mid/serverAce.R @@ -1,7 +1,7 @@ observeEvent(input$messageFromAce, { - # cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") + cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") if(length(input$messageFromAce$sender)>0){ if(length(input$messageFromAce$code)>0){ # returning code setCode(input$messageFromAce$code) # only place where request$code is set @@ -34,12 +34,14 @@ observeEvent(input$messageFromAce, { 'cmd.commit', 'cmd.add.column', 'cmd.add.asset' ) # these all should redraw viewport ){ + cat('acein\n') processMssgFromAceMssgPageIn(sender, input$messageFromAce) } else if( sender %in% c( 'fileCmd.save', 'fileCmd.saveAs' ) ){ + cat('acesave\n') processMssgFromAceMssgPageOut(sender, input$messageFromAce) } else { setTrigger('redraw') @@ -56,7 +58,7 @@ observeEvent(input$messageFromAce, { } } } - # cat("<----< messageFromAce",'***** sender=',format(input$messageFromAce$sender),"\n\n") + cat("<----< messageFromAce",'***** sender=',format(input$messageFromAce$sender),"\n\n") }, priority = 90, ignoreNULL = TRUE, ignoreInit = TRUE, label='messageFromAce') diff --git a/inst/App/rightPanel/preProc/serverPreProcDB.R b/inst/App/rightPanel/preProc/serverPreProcDB.R index 56c0a7ec..cf64edc2 100644 --- a/inst/App/rightPanel/preProc/serverPreProcDB.R +++ b/inst/App/rightPanel/preProc/serverPreProcDB.R @@ -1,6 +1,6 @@ preProcPageDB<-reactiveVal( - tibble( tabId="bogus", tibName="bogus", colName='bogus', scriptName='bogus')[0,], + tibble( tabId="bogus", tibName="bogus", colName='bogus', scriptName='bogus')[0,] ) diff --git a/inst/App/server.R b/inst/App/server.R index 8006d340..dd46f52d 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -83,6 +83,7 @@ shinyServer(function(input, output,session) { #------------------rightPanel-------------------------------- source("rightPanel/selector/serverAssetSelectionDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcDB.R", local=TRUE) + source("rightPanel/preProc/serverColSetDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsInsert.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsMove.R", local=TRUE) source("rightPanel/preProc/serverPreProcMatMove.R", local=TRUE) @@ -108,7 +109,7 @@ shinyServer(function(input, output,session) { source("rightPanel/mouse/serverMouseClicks.R", local=TRUE) source("rightPanel/menu/cmdNewColumn.R", local=TRUE) source("rightPanel/menu/cmdNewAsset.R", local=TRUE) - + source("rightPanel/menu/modalCustColumn.R", local=TRUE) source("rightPanel/menu/cmdDeleteColumn.R", local=TRUE) source("rightPanel/menu/cmdFileImportPreProc.R", local=TRUE) source("rightPanel/menu/cmdFileExportPreProc.R", local=TRUE) From e16f971a7f4db131fe199673f7bb5e8fa029af0c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 24 Dec 2020 15:13:46 -0500 Subject: [PATCH 127/263] Add custom Choice Sets --- inst/App/rightPanel/header/serverEdTib.R | 4 +- inst/App/rightPanel/menu/buildRightMenuUI.R | 6 + inst/App/rightPanel/menu/cmdNewColumn.R | 72 +++++++++-- inst/App/rightPanel/menu/modalCustColumn.R | 117 ++++++++++++++++++ inst/App/rightPanel/menu/serverPlotBar.R | 40 ++++-- .../mouse/serverMouseCmdFindPoint.R | 2 +- inst/App/rightPanel/preProc/serverColSetDB.R | 39 ++++++ .../selector/serverAssetSelection.R | 28 ++++- inst/App/util/dbInitiatizers.R | 3 + inst/App/util/utilColumnType.R | 8 +- inst/App/www/customStyle.css | 14 +++ 11 files changed, 303 insertions(+), 30 deletions(-) create mode 100644 inst/App/rightPanel/menu/modalCustColumn.R create mode 100644 inst/App/rightPanel/preProc/serverColSetDB.R diff --git a/inst/App/rightPanel/header/serverEdTib.R b/inst/App/rightPanel/header/serverEdTib.R index c8614351..b2755e95 100644 --- a/inst/App/rightPanel/header/serverEdTib.R +++ b/inst/App/rightPanel/header/serverEdTib.R @@ -138,12 +138,12 @@ observeEvent(returnValue4ModuleEdTib$entryValue(),{ rowIndex<=nrow(tib) ) sender='applyTibEdit' - if(!identical(newPtDefs$tib[[getAssetName()]][[columnName ]][[rowIndex]],entry)){ newPtDefs$tib[[getAssetName()]][[columnName]][[rowIndex ]]<-entry updateAceExtDef(newPtDefs, sender=sender, selector=list( name=name, rowIndex=rowIndex, columnName=columnName ) ) } - log.fout(returnValue4ModuleEdTib$entryValue()) + + # log.fout(returnValue4ModuleEdTib$entryValue()) } },label='EdTib-rtv-entryValue', ignoreNULL = TRUE) diff --git a/inst/App/rightPanel/menu/buildRightMenuUI.R b/inst/App/rightPanel/menu/buildRightMenuUI.R index bb82c4ee..61bef51e 100644 --- a/inst/App/rightPanel/menu/buildRightMenuUI.R +++ b/inst/App/rightPanel/menu/buildRightMenuUI.R @@ -60,6 +60,12 @@ buildRightMenu<-function(){ shinyDMDMenu::menuItem('Import', value='cmdImportAP') #shinyDMDMenu::menuItem('Export', value='cmdExportAP'), #shinyDMDMenu::menuItem('Remove', value='cmdRemoveAP') + ), + shinyDMDMenu::menuDropdown( + "Custom Choice Sets", + shinyDMDMenu::menuItem('New', value='cmdNewColumnChoices'), + shinyDMDMenu::menuDropdown(id='dropDown-cmdEditColumnChoices','Edit Choice Set'), + shinyDMDMenu::menuItem('Import', value='cmdImportColumnChoices') ) ) ) #menubar end diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 754fbb29..474a7775 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -4,31 +4,54 @@ addNewColModal <- function(errMssg=NULL) { doOk<-"shinyjs.triggerButtonOnEnter(event,\"commitNewCol\")" ppscriptChoices<-unique(preProcScriptDB$attrs$scriptName) + colChoices<-names(aux$colChoiceSet) + colChoices<-unique(colChoices) + choices<-list( + ' a single character string'='string','a single number'='number','a vector'='expression', + 'a matrix of points'='points') + if(length(ppscriptChoices)>0){ + choices<-c(choices,list('using a preprocessing script'='script')) + } + if(length(aux$colChoiceSet)>0){ + choices<-c(choices,list('using a choice set'='choiceSet')) + } modalDialog( + size='l', onkeypress=doOk, span('Enter both a name for the new column and a value for its entries'), textInput("modalAttrName", "Enter the name for the new column"), div( class='ptR2', - awesomeRadio('modalColTreatAs', 'Initialize Column Values as ', - choices = list( - ' a single character string'='string','a single number'='number','a vector'='expression', - 'a matrix of points'='points' , 'the result of a preprocessing script'='script' - ) , + awesomeRadio('modalColTreatAs', 'Initialize Column Values as ', + choices = choices , inline = TRUE ) ), textInput("modalAttrValue", "Enter an entry value for the new column"), # pick from preproc list if(length(ppscriptChoices)>0){ - div( class='ptR2', - awesomeRadio('modalColPreProcScript', 'Set entry values using the script:', + div( class='ptR2', #awesomeRadio + pickerInput('modalColPreProcScript', 'Set entry values using the script:', choices = ppscriptChoices, - inline = TRUE + inline = FALSE ) ) } else { NULL }, + if(length(aux$colChoiceSet)>0){ + div( style="display:inline-block", + div(style="float:left;",pickerInput('modalColChooserSet', 'Choiceset:', + choices = colChoices, + inline = FALSE + )), + div(style="float:right;",pickerInput('modalColChooserValue', 'Choice value:', + choices = aux$colChoiceSet[[1]], + inline = FALSE + )) + ) + } else { + NULL + }, if(!is.null(errMssg)){ div(tags$b(errMssg, style = "color: red;")) @@ -45,17 +68,29 @@ observeEvent(input$modalColTreatAs,{ if(input$modalColTreatAs=='points'){ hideElement('modalAttrValue') hideElement('modalColPreProcScript') + hideElement('modalColChooserSet') + hideElement('modalColChooserValue') + } else if (input$modalColTreatAs=='script') { hideElement('modalAttrValue') showElement('modalColPreProcScript') + hideElement('modalColChooserSet') + hideElement('modalColChooserValue') + } else if (input$modalColTreatAs=='choiceSet') { + hideElement('modalAttrValue') + hideElement('modalColPreProcScript') + showElement('modalColChooserSet') + showElement('modalColChooserValue') } else { showElement('modalAttrValue') hideElement('modalColPreProcScript') + hideElement('modalColChooserSet') + hideElement('modalColChooserValue') } }) observeEvent(input$commitNewCol, { - + badExpr<-function(txt){ rtv<-TRUE tryCatch({ @@ -65,7 +100,6 @@ observeEvent(input$commitNewCol, { error = function(e) {}) rtv } - treatAs<-input$modalColTreatAs newVal<-input$modalAttrValue #checks @@ -76,7 +110,7 @@ observeEvent(input$commitNewCol, { # check name uniqueness showModal(addNewColModal( errMssg="Invalid Column Name: this name is already taken!") ) } else if( - (!(treatAs %in% c('script', 'points' ))) && + (!(treatAs %in% c('script', 'points', 'choiceSet' ))) && (!grepl(pattern = "^[[:graph:]]", input$modalAttrValue)) ){ # check value is printable @@ -145,7 +179,15 @@ observeEvent(input$commitNewCol, { shinyalert("preproc new column Error",err, type="error") # may want to put this in a scrollable modal }) } else { #not scripting - # browser() + if(treatAs=='choiceSet'){ + newVal<-input$modalColChooserValue + # restrict that value is restiricted to this list + colSet_Name<-input$modalColChooserSet + + #To do: perform additional checks !!! + + setColSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, colSet_Name=colSet_Name) + } if(treatAs=='number'){ newVal<-as.numeric(newVal) } else if ( treatAs=='points'){ @@ -153,11 +195,15 @@ observeEvent(input$commitNewCol, { } else if ( treatAs=='expression'){ newVal<-list(eval(parse(text=newVal))) # to do: validate!!! } + + # newVal is ready to insert + newPtDefs$tib[[getAssetName()]]<-add_column(newPtDefs$tib[[getAssetName()]], !!(newColName):=newVal ) - } + } + # updateAce and set selection to this column sender<-'cmd.add.column' updateAceExtDef(newPtDefs, sender=sender, selector=list( columnName = newColName ) ) diff --git a/inst/App/rightPanel/menu/modalCustColumn.R b/inst/App/rightPanel/menu/modalCustColumn.R new file mode 100644 index 00000000..d45b006f --- /dev/null +++ b/inst/App/rightPanel/menu/modalCustColumn.R @@ -0,0 +1,117 @@ +cmdCustColumnEdit<-function( custColumnName){ + showModal( + modalCustColumnEditor(custColumnName=custColumnName) + ) +} + +# todo + + +modalCustColumnEditor <- function( custColumnName, value="TRUE\nFALSE" ) { + #CustColumnModalType(type) + modalDialog( + div( id='custColumnBackPanelModalEdit', class='backPanel', style='padding:20px;', + textInput("modalCustColumnName", + label=span(style='color: #00ffff;', 'Name'), + value=custColumnName, + width='100%', + placeholder = 'Enter a name with at least 8 characters for this set of choices ' + ), + div( + aceEditor( + outputId="customColumnChoiceTxt", + height = "380px", + mode='r', + value=value + ) + ) + ), + title="CustColumn Editor", + easyClose = TRUE, + footer = tagList( + modalButton("Dismiss"), + actionButton("modalCustColumnEditorCommitOk", "Commit") + ) + ) +} + +observeEvent(input$modalCustColumnName,{ + CustColumnName<-input$modalCustColumnName + if(length(CustColumnName)==0 || nchar(CustColumnName)<8){ + hideElement("modalCustColumnEditorCommitOk") + } else { + showElement("modalCustColumnEditorCommitOk") + } +}) + +getCustColumnAuxPath<-reactive({file.path(getDirPath(),'aux','columnChoiceSets')}) + +writeAuxCustColumnList<-function(filePath, customColumnChoiceList){ + cat(customColumnChoiceList, file=filePath) +} + +readAuxCustColumns<-function(filePath){ + files<-dir(getCustColumnAuxPath(), pattern="*\\.txt$",full.names=TRUE ) + customChoiceList<-list() + customChoiceList<-lapply(files, function(f){ + scan(file=f, what=character(), quiet=TRUE) + }) + nms<-gsub('\\.txt','', basename(files)) + names(customChoiceList)<-nms + customChoiceList +} + + +observeEvent( input$modalCustColumnEditorCommitOk,{ + + CustColumnName<-input$modalCustColumnName + CustColumnName<-sub('\\.txt$','',CustColumnName) + CustColumnName<-paste0(CustColumnName,'.txt') + + customColumnChoiceList<-input$customColumnChoiceTxt + if(!dir.exists(getCustColumnAuxPath())){ + dir.create(getCustColumnAuxPath() ) + } + filePath<-file.path(getCustColumnAuxPath(), CustColumnName) + writeAuxCustColumnList(filePath, customColumnChoiceList) + aux$colChoiceSet<-readAuxCustColumns() + removeModal() +}) + +colSetPageDB<-reactiveVal( + tibble( tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus')[0,] +) + + +populateChoiceSetEditMenu<-function(choice){ + # append tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus' to colSetPageDB +} + +aux<-reactiveValues(colChoiceSet=list()) + +observeEvent(aux$colChoiceSet,{ + # reset submenu for dropDown-cmdEditColumnChoices + if(length(aux$colChoiceSet )==0){ + disableDMDM(session, 'plotNavBar','dropDown-cmdEditColumnChoices') + } else{ + kids<-lapply(names(aux$colChoiceSet), function(nn){ + shinyDMDMenu::menuItem(nn, value=paste0('editChoiceSet-',nn)) + }) + if(length(kids)>0){ + enableDMDM(session, 'plotNavBar','dropDown-cmdEditColumnChoices') + afterEntry='cmdNewColumnChoices' + label=paste0('Edit Choice Set') + shinyDMDMenu::removeDMDM(session, menuBarId ="plotNavBar", entry='Edit Choice Set', type='dropdown') + shinyDMDMenu::insertAfterDMDM( + session, + menuBarId ="plotNavBar", + entry=afterEntry, + submenu= + do.call( + function(...){ menuDropdown( label,...) }, + kids + ) + ) + } + } +}) \ No newline at end of file diff --git a/inst/App/rightPanel/menu/serverPlotBar.R b/inst/App/rightPanel/menu/serverPlotBar.R index e935182e..60e2bd94 100644 --- a/inst/App/rightPanel/menu/serverPlotBar.R +++ b/inst/App/rightPanel/menu/serverPlotBar.R @@ -62,7 +62,7 @@ observeEvent(input$plotNavBar, { if(cmd == 'cmdNewColumn'){ showModal( addNewColModal() ) } - + # -----PP if(cmd == 'cmdNewPP'){ # disable unless ... # columnName<-getTibColumnName() type='points' @@ -77,11 +77,7 @@ observeEvent(input$plotNavBar, { cmdPreProcPtsImport() dirtyDMDM(session, "plotNavBar") } - - # if(cmd=="cmdRemovePP"){ #-----save - # cmdPreProcPtsRemove('points') - # dirtyDMDM(session, "plotNavBar") - # } + # -----AP if(cmd == 'cmdNewAP'){ # disable unless ... log.fin(cmd == 'cmdNewAP' ) @@ -104,6 +100,29 @@ observeEvent(input$plotNavBar, { cmdPreProcAtsRemove('attrs') dirtyDMDM(session, "plotNavBar") } + # ----CC + if(cmd == 'cmdNewColumnChoices'){ # disable unless ... + log.fin(cmd == 'cmdNewColumnChoices' ) + type='attrs' + labels<-preprocChoices[[type]] + preprocScripts = fileTemplates[paste0(labels,'Template.R')] + names(preprocScripts)<-labels + cmdCustColumnEdit( custColumnName='') + dirtyDMDM(session, "plotNavBar") + log.fout(cmd == 'cmdNewAP') + dirtyDMDM(session, "plotNavBar") + } + + if(cmd == 'cmdImportColumnChoices'){ # disable unless ... + # cmdPreProcAtsImport() + # dirtyDMDM(session, "plotNavBar") + } + + # if(cmd=="cmdRemoveAP"){ #-----save + # cmdPreProcAtsRemove('attrs') + # dirtyDMDM(session, "plotNavBar") + # } + if(!is.null(cmd)){ dirtyDMDM(session, "plotNavBar") @@ -130,7 +149,14 @@ observeEvent(input$plotNavBar, { modalPreProcEditor( preprocScripts, preprocName, type=type ) ) } - + if( grepl( '^editChoiceSet-', cmd)){ + choiceSetName<-sub("^editChoiceSet-","",cmd) + choiceSet=aux$colChoiceSet[[choiceSetName]] + value=paste(choiceSet, collapse="\n") + showModal( + modalCustColumnEditor(custColumnName=choiceSetName, value=value) + ) + } diff --git a/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R b/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R index 8e4071ba..6ea434d3 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdFindPoint.R @@ -3,7 +3,7 @@ mouseCmdFindPoint<-function(mssg){ pt<- as.numeric(unlist(mssg$vec)) } - browser() + # browser() fromColumnName<-getTibColumnName() fromCol<-getTib()[[fromColumnName]] fromColType<-extractColType( fromCol) diff --git a/inst/App/rightPanel/preProc/serverColSetDB.R b/inst/App/rightPanel/preProc/serverColSetDB.R new file mode 100644 index 00000000..b6aeb530 --- /dev/null +++ b/inst/App/rightPanel/preProc/serverColSetDB.R @@ -0,0 +1,39 @@ + + +colSetPageDB<-reactiveVal( + tibble( tabId="bogus", tibName="bogus", colName='bogus', colSetName='bogus')[0,] +) + +getColSetPage<-function(pageId){ + db<-colSetPageDB() + filter(db, tabId==pageId ) +} + +getColSet4PageName<-function(tab_Id, tib_Name, column_Name){ + if(any(sapply(c(tab_Id, tib_Name, column_Name), is.null)) + || tab_Id=='bogus') + { + return( "none") + } + csDB<-colSetPageDB() + csDB<-filter(csDB, + tabId==tab_Id &tibName==tib_Name & colName==column_Name + ) + if(nrow(csDB)>0){ + csDB$colSetName + } else { + NULL + } +} + +setColSet4PageName<-function(tab_Id, tib_Name, column_Name, colSet_Name){ + csDB<-colSetPageDB() + csDB<-filter(csDB, !(tabId==tab_Id & + tibName==tib_Name & + colName==column_Name ) + ) + if(!is.null(colSet_Name)){ + csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, colSetName=colSet_Name)) + } + colSetPageDB(csDB) +} \ No newline at end of file diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 34875a81..067ff60b 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -243,13 +243,16 @@ getTibEntry<-reactive({ if( identical(getColumnType(), 'point')){ return( c('point','matrix')[getSelIndex()] ) } + entry<-NULL rowNum<-getTibRow() - if(is.null(rowNum)){ return( NULL)} - columnValues<-getTibEntryChoices() - if(1<=rowNum && rowNum<=length(columnValues) ){ - entry<-columnValues[[rowNum]] - } else { - entry<-NULL + if(length(rowNum)>0){ + columnValues<-getTib() %$$% getTibColumnName() + if(length(columnValues)>0){ + columnValues<-as.list(columnValues) + if(1<=rowNum && rowNum<=length(columnValues) ){ + entry<-columnValues[[rowNum]] + } + } } entry }) @@ -258,6 +261,19 @@ getTibEntryChoices<-reactive({ if( identical(getColumnType(), 'point')){ return( c('point', 'matrix')) } + tab_Id<-getTibTabId() + tib_Name<-getAssetName() + column_Name<-getTibColumnName() + if( length(tab_Id)>0 && length(tib_Name)>0){ + choiceSetName<-getColSet4PageName( tab_Id, tib_Name, column_Name) + if(length(choiceSetName)>0){ + choices<-aux$colChoiceSet[[choiceSetName]] + if(length(choices)>0){ + return(choices) + } + } + } + columnValues<-getTib() %$$% getTibColumnName() if(!is.null(columnValues)){ columnValues <- as.list(columnValues) diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index d7a87745..9dc2dc93 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -17,6 +17,9 @@ initialPreProcPageDB<-function(){ tibble( tabId="bogus", tibName="bogus", colName='bogus', scriptName='bogus')[0,] } +initialColSetPageDB<-function(){ + tibble( tabId="bogus", tibName="bogus", colName='bogus', colSetName='bogus')[0,] +} initialTribbleDB<-function(){ tibble( diff --git a/inst/App/util/utilColumnType.R b/inst/App/util/utilColumnType.R index ef05ae86..4fd12f73 100644 --- a/inst/App/util/utilColumnType.R +++ b/inst/App/util/utilColumnType.R @@ -69,7 +69,13 @@ listColType<-function(x){ return(paste0('other.list')) } -# callers: PanelCoordinator::getColumnType, preProcValidate::assertConsistantTibPair +# callers: +# PanelCoordinator::getColumnType, +# preProcValidate::assertConsistantTibPair +# serverPreProcDB::extractPreProcScript +# serverMouseCmdFindPoint::mouseCmdFindPoint +# serverMouseCmdMoveMatrix::mouseCmdMoveMatrix + extractColType<-function( column ){ if(is.list(column)){ diff --git a/inst/App/www/customStyle.css b/inst/App/www/customStyle.css index 55ced4cb..864b279d 100644 --- a/inst/App/www/customStyle.css +++ b/inst/App/www/customStyle.css @@ -28,6 +28,12 @@ font-weight: 400; line-height: 1.1; color: #48ca3b; } +.btn .ptR3{ +background-color: #FFFFFF; +color: #000000; +border-radius: 0px; +font-size: 12px; +} .btn{ background-color: #222244; color: #00ffff; @@ -237,6 +243,14 @@ overflow-y: auto; font-size: 14px; color: #00ffff; } +#modalColChooserSet button..btn.dropdown-toggle.btn-default{ + background-color:#FFFFFF; +} +button.btn.dropdown-toggle.btn-default{ + background-color:#FFFFFF; + color: #000000; + border-radius: 0; +} #tagValBar-entryValue .formControl.selectized { width:260px; } From e989c53d42d1519ac436916df46f343293630b6a Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Dec 2020 15:33:51 -0500 Subject: [PATCH 128/263] return NULL instead of 'none' --- inst/App/rightPanel/preProc/serverColSetDB.R | 2 +- inst/App/rightPanel/preProc/serverPreProcDB.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/App/rightPanel/preProc/serverColSetDB.R b/inst/App/rightPanel/preProc/serverColSetDB.R index b6aeb530..8b3261ea 100644 --- a/inst/App/rightPanel/preProc/serverColSetDB.R +++ b/inst/App/rightPanel/preProc/serverColSetDB.R @@ -13,7 +13,7 @@ getColSet4PageName<-function(tab_Id, tib_Name, column_Name){ if(any(sapply(c(tab_Id, tib_Name, column_Name), is.null)) || tab_Id=='bogus') { - return( "none") + return( NULL) } csDB<-colSetPageDB() csDB<-filter(csDB, diff --git a/inst/App/rightPanel/preProc/serverPreProcDB.R b/inst/App/rightPanel/preProc/serverPreProcDB.R index cf64edc2..a9bb7171 100644 --- a/inst/App/rightPanel/preProc/serverPreProcDB.R +++ b/inst/App/rightPanel/preProc/serverPreProcDB.R @@ -81,7 +81,7 @@ getPreProcScriptName<-function(tab_Id, tib_Name, column_Name){ if(any(sapply(c(tab_Id, tib_Name, column_Name), is.null)) || tab_Id=='bogus') { - return( "none") + return( NULL) } ppDB<-preProcPageDB() ppDB<-filter(ppDB, @@ -90,7 +90,7 @@ getPreProcScriptName<-function(tab_Id, tib_Name, column_Name){ if(nrow(ppDB)>0){ ppDB$scriptName } else { - "none" + NULL } } From 435adc499997c854c6dbab7e918873ac5ca45425 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Dec 2020 15:34:55 -0500 Subject: [PATCH 129/263] clean up modal dialog input for new column --- inst/App/rightPanel/menu/cmdNewColumn.R | 92 +++++++++++++++++-------- 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 474a7775..d53b52a9 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -1,7 +1,8 @@ #--------NEW COLUMN------------------------------ -addNewColModal <- function(errMssg=NULL) { +addNewColModal <- function(errMssg=NULL, treatAsSelect='string') { + log.val(treatAsSelect) doOk<-"shinyjs.triggerButtonOnEnter(event,\"commitNewCol\")" ppscriptChoices<-unique(preProcScriptDB$attrs$scriptName) colChoices<-names(aux$colChoiceSet) @@ -20,13 +21,17 @@ addNewColModal <- function(errMssg=NULL) { onkeypress=doOk, span('Enter both a name for the new column and a value for its entries'), textInput("modalAttrName", "Enter the name for the new column"), - div( class='ptR2', + div( class='ptR2',id='modalColTreatAsDiv', awesomeRadio('modalColTreatAs', 'Initialize Column Values as ', choices = choices , - inline = TRUE + inline = TRUE, + selected=treatAsSelect ) ), - textInput("modalAttrValue", "Enter an entry value for the new column"), + div( + textInput("modalAttrValue", "Enter an entry value for the new column" ) + ), + # pick from preproc list if(length(ppscriptChoices)>0){ div( class='ptR2', #awesomeRadio @@ -39,7 +44,7 @@ addNewColModal <- function(errMssg=NULL) { NULL }, if(length(aux$colChoiceSet)>0){ - div( style="display:inline-block", + div( style=paste0("display:inline-block;"), div(style="float:left;",pickerInput('modalColChooserSet', 'Choiceset:', choices = colChoices, inline = FALSE @@ -63,32 +68,63 @@ addNewColModal <- function(errMssg=NULL) { ) } +is.Non.Blank.Name<-reactiveVal(FALSE) +is.Non.Blank.Value<-reactiveVal(FALSE) -observeEvent(input$modalColTreatAs,{ - if(input$modalColTreatAs=='points'){ - hideElement('modalAttrValue') - hideElement('modalColPreProcScript') - hideElement('modalColChooserSet') - hideElement('modalColChooserValue') - - } else if (input$modalColTreatAs=='script') { - hideElement('modalAttrValue') - showElement('modalColPreProcScript') - hideElement('modalColChooserSet') - hideElement('modalColChooserValue') - } else if (input$modalColTreatAs=='choiceSet') { - hideElement('modalAttrValue') - hideElement('modalColPreProcScript') - showElement('modalColChooserSet') - showElement('modalColChooserValue') +observeEvent(input$modalAttrName,{ + str<-input$modalAttrName + is.Non.Blank.Name(nchar(str)>0) +}) +observeEvent(input$modalAttrValue,{ + str<-input$modalAttrValue + is.Non.Blank.Value(nchar(str)>0) +}) + + + + +observeEvent(c(is.Non.Blank.Name(),input$modalColTreatAs, is.Non.Blank.Value() ),{ + if( is.Non.Blank.Name()){ + showElement('modalColTreatAsDiv') + if( !(input$modalColTreatAs %in% c('string','number','expression')) || is.Non.Blank.Value() ){ + showElement('commitNewCol') + } else { + hideElement('commitNewCol') + } + if(input$modalColTreatAs=='points'){ + hideElement('modalAttrValue') + hideElement('modalColPreProcScript') + hideElement('modalColChooserSet') + hideElement('modalColChooserValue') + } else if (input$modalColTreatAs=='script') { + hideElement('modalAttrValue') + showElement('modalColPreProcScript') + hideElement('modalColChooserSet') + hideElement('modalColChooserValue') + } else if (input$modalColTreatAs=='choiceSet') { + hideElement('modalAttrValue') + hideElement('modalColPreProcScript') + showElement('modalColChooserSet') + showElement('modalColChooserValue') + } else { + showElement('modalAttrValue') + hideElement('modalColPreProcScript') + hideElement('modalColChooserSet') + hideElement('modalColChooserValue') + } } else { - showElement('modalAttrValue') + hideElement('modalColTreatAsDiv') + hideElement('modalAttrValue') hideElement('modalColPreProcScript') hideElement('modalColChooserSet') hideElement('modalColChooserValue') + hideElement('commitNewCol') } + }) + + observeEvent(input$commitNewCol, { badExpr<-function(txt){ @@ -105,18 +141,18 @@ observeEvent(input$commitNewCol, { #checks if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ # check name syntax - showModal(addNewColModal( errMssg="Invalid Column Name: must begin with a character") ) + showModal(addNewColModal( errMssg="Invalid Column Name: must begin with a character", treatAsSelect=treatAs) ) } else if( input$modalAttrName %in% names(getTib()) ){ # check name uniqueness - showModal(addNewColModal( errMssg="Invalid Column Name: this name is already taken!") ) + showModal(addNewColModal( errMssg="Invalid Column Name: this name is already taken!", treatAsSelect=treatAs) ) } else if( (!(treatAs %in% c('script', 'points', 'choiceSet' ))) && (!grepl(pattern = "^[[:graph:]]", input$modalAttrValue)) ){ # check value is printable - showModal(addNewColModal( errMssg="Invalid Column Value: must begin with printable character other than space") ) + showModal(addNewColModal( errMssg="Invalid Column Value: must begin with printable character other than space", treatAsSelect=treatAs) ) } else if( treatAs=='expression' && badExpr( input$modalAttrValue )==TRUE ){ - showModal(addNewColModal( errMssg="Unable to evaluate expression") ) + showModal(addNewColModal( errMssg="Unable to evaluate expression", treatAsSelect=treatAs) ) } else { # checks passed #add name to tib newPtDefs<-getPtDefs() @@ -185,7 +221,7 @@ observeEvent(input$commitNewCol, { colSet_Name<-input$modalColChooserSet #To do: perform additional checks !!! - + #updateWidgetChoicesRow( selectedWidget=returnValue4ModuleEdTib$selectedWidget()) setColSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, colSet_Name=colSet_Name) } if(treatAs=='number'){ From 19f0457a1baf59e63d46c8653e823410b6b19bc9 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 26 Dec 2020 17:32:01 -0500 Subject: [PATCH 130/263] added import column choice set --- inst/App/fileIO/genShinyFilesOpenButtons.R | 1 + inst/App/fileIO/observeRequestStartUp.R | 2 +- inst/App/fileIO/serverShinyFiles.R | 1 + inst/App/leftPanel/pproj/pprojUtil.R | 5 +- inst/App/rightPanel/header/moduleEdAsset.R | 6 +- inst/App/rightPanel/menu/buildRightMenuUI.R | 4 +- inst/App/rightPanel/menu/cmdChoiceSetImport.R | 96 +++++++++++++++++++ inst/App/rightPanel/menu/modalCustColumn.R | 29 +++--- inst/App/rightPanel/menu/serverPlotBar.R | 4 +- inst/App/rightPanel/preProc/serverColSetDB.R | 8 ++ inst/App/server.R | 1 + 11 files changed, 135 insertions(+), 22 deletions(-) create mode 100644 inst/App/rightPanel/menu/cmdChoiceSetImport.R diff --git a/inst/App/fileIO/genShinyFilesOpenButtons.R b/inst/App/fileIO/genShinyFilesOpenButtons.R index b9bfcc2f..8ef87bbf 100644 --- a/inst/App/fileIO/genShinyFilesOpenButtons.R +++ b/inst/App/fileIO/genShinyFilesOpenButtons.R @@ -9,6 +9,7 @@ UIGenShinyOpenFilesButtons<-function(){ shinyFilesButton("buttonFileOpen", label="", title="Open File", multiple=FALSE, class='hiddenButton'), shinyFilesButton("buttonFileOpenProject", label="", title="Select Project to Open", multiple=FALSE, class='hiddenButton'), + shinyFilesButton("buttonChoiceSetImport", label="", title="Import Choice Set", multiple=FALSE, class='hiddenButton'), shinyFilesButton("buttonSnippetImport", label="", title="Import Snippets", multiple=FALSE, class='hiddenButton'), shinyFilesButton("buttonDnippetImport", label="", title="Import Dnippets", multiple=FALSE, class='hiddenButton'), shinyFilesButton("buttonPreProcPtImport", label="", title="Import PreProcessors for points", multiple=FALSE, class='hiddenButton'), diff --git a/inst/App/fileIO/observeRequestStartUp.R b/inst/App/fileIO/observeRequestStartUp.R index b85b96e7..759149b3 100644 --- a/inst/App/fileIO/observeRequestStartUp.R +++ b/inst/App/fileIO/observeRequestStartUp.R @@ -15,7 +15,7 @@ observeEvent(trigger$startup, { updateNewProjectMenu(session) updateRemoveTemplateMenu(session) resetWatcher() - aux$colChoiceSet<-readAuxCustColumns() + readAuxChoices() log.fout(startup) }, priority=100) diff --git a/inst/App/fileIO/serverShinyFiles.R b/inst/App/fileIO/serverShinyFiles.R index 3c5c83fa..c982b7ac 100644 --- a/inst/App/fileIO/serverShinyFiles.R +++ b/inst/App/fileIO/serverShinyFiles.R @@ -29,6 +29,7 @@ shinyFileChoose(input,"buttonSnippetImport", session=session, roots=c(home="~") shinyFileChoose(input,"buttonDnippetImport", session=session, roots=c(home="~"), filetypes=c('dnds')) shinyFileChoose(input,"buttonPreProcPtImport", session=session, roots=c(home="~"), filetypes=c('R')) shinyFileChoose(input,"buttonPreProcAtImport", session=session, roots=c(home="~"), filetypes=c('R')) +shinyFileChoose(input,"buttonChoiceSetImport", session=session, roots=c(home="~"), filetypes=c('txt')) diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index 1416acc8..f74a8c39 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -33,6 +33,7 @@ closeCurrentProj<-function(){ resetDnippetsDB() preProcScriptDB$points=initialPreProcScriptDB() preProcScriptDB$attrs= initialPreProcScriptDB() + colSetPageDB(initialColSetPageDB() ) fileDescDB(initialFileDescDB()) svgGridDB( initialSvgGridDB() ) useTribbleFormatDB( initialTribbleDB() ) @@ -82,7 +83,7 @@ resetShinyFilesIOPaths<-function(pathToProj, resources='aux'){ "buttonSnippetImport", "buttonDnippetImport", "buttonPreProcPtImport", "buttonPreprocPtExport", "buttonPreprocAtExport", "buttonPreProcAtImport", - "buttonSvgExport") + "buttonChoiceSetImport", "buttonSvgExport") # first set to root for(id in c(fileIOIds, saveButtonFileNames)){ jscode<-setSfDir(id, path="") @@ -100,6 +101,8 @@ resetShinyFilesIOPaths<-function(pathToProj, resources='aux'){ jscode<-setSfDir(id, path= path_join( c(pathToProj, resourceDir, 'dnds' ))) } else if(id %in% c("buttonSnippetImport")){ jscode<-setSfDir(id, path= path_join( c(pathToProj,resourceDir, 'snip' ))) + } else if(id %in% c("buttonChoiceSetImport")){ + jscode<-setSfDir(id, path= path_join( c(pathToProj,resourceDir, 'choices' ))) } else { jscode<-setSfDir(id, path=pathToProj) } diff --git a/inst/App/rightPanel/header/moduleEdAsset.R b/inst/App/rightPanel/header/moduleEdAsset.R index 2896d9e0..f35b6612 100644 --- a/inst/App/rightPanel/header/moduleEdAsset.R +++ b/inst/App/rightPanel/header/moduleEdAsset.R @@ -26,10 +26,10 @@ moduleEdAsset<-function(input, output, session, ns <- session$ns #---assets output$dataSetUI<-renderUI({ - if( length(nameChoices() )>0){ + if( length(nameChoices() )>0 && length(name())>0 && name() %in% nameChoices() ){ butts<- nameChoices() - #butts=mapply(function(x)list('r'),butts,SIMPLIFY = T,USE.NAMES = T) - jqScrollBar(inputId=ns("name"), choices =butts, selected=name()) + selected=name() + jqScrollBar(inputId=ns("name"), choices =butts, selected =selected) # radioGroupButtons(inputId=ns("name"), choices=butts, selected=name(), # justified=TRUE) } diff --git a/inst/App/rightPanel/menu/buildRightMenuUI.R b/inst/App/rightPanel/menu/buildRightMenuUI.R index 61bef51e..41171216 100644 --- a/inst/App/rightPanel/menu/buildRightMenuUI.R +++ b/inst/App/rightPanel/menu/buildRightMenuUI.R @@ -62,9 +62,9 @@ buildRightMenu<-function(){ #shinyDMDMenu::menuItem('Remove', value='cmdRemoveAP') ), shinyDMDMenu::menuDropdown( - "Custom Choice Sets", + "Column Choice Sets", shinyDMDMenu::menuItem('New', value='cmdNewColumnChoices'), - shinyDMDMenu::menuDropdown(id='dropDown-cmdEditColumnChoices','Edit Choice Set'), + shinyDMDMenu::menuDropdown(id='dropDown-cmdEditColumnChoices', 'Edit Choices'), shinyDMDMenu::menuItem('Import', value='cmdImportColumnChoices') ) ) diff --git a/inst/App/rightPanel/menu/cmdChoiceSetImport.R b/inst/App/rightPanel/menu/cmdChoiceSetImport.R new file mode 100644 index 00000000..9d01da98 --- /dev/null +++ b/inst/App/rightPanel/menu/cmdChoiceSetImport.R @@ -0,0 +1,96 @@ +cmdChoiceSetImport<-function(){ + click('buttonChoiceSetImport') +} + +observeEvent(input$buttonChoiceSetImport,{ + fp.dt<-parseFilePaths(c(home='~'), input$buttonChoiceSetImport) + if(length(fp.dt)>0 && nrow(fp.dt)){ + datapath<-as.character(fp.dt$datapath[1]) + datapath<-gsub(pattern = '^NA/', "~/", datapath) + cat("datapath=",datapath,"\n") + #copy to aux + # get targetDir + targetDir<-getAuxChoicesPath() + if(!file.exists(targetDir)){ # we should probably place this elsewhere !!! + dir.create(targetDir, recursive=TRUE) + } + + targetName<-basename(datapath) + + target<-file.path(targetDir,targetName ) + + # file copy + file.copy(datapath, target, TRUE) + # relaod + readAuxChoices(targetDir) + } +}) + + +# loadPreProc<-function(datapath, type){ +# extractBodyWithComments<-function(fn){ +# tt<-capture.output(print(fn)) +# blanks1<-grepl('^ *$',tt) +# blanks2<-c(blanks1[-1], FALSE) +# bad<-blanks1 & blanks2 +# tt<-tt[!bad] +# tt<-sub('^( )( )*','',tt) #eat all indents :() +# tt<-paste(tt, collapse="\n") +# pos1<-str_locate_all(tt,'\\{')[[1]][1] +# if(length(pos1)==0) {stop('ill formed preproc')} +# pos2<-str_locate_all(tt,'\\}')[[1]] +# if(length(pos2)==0) {stop('ill formed preproc')} +# pos1<-pos1[1]+1 +# pos2<-pos2[length(pos2)]-1 +# substr(tt,pos1,pos2) +# } +# +# tryCatch({ +# preProcList<-source(datapath, local=T)$value +# #check preProcList +# +# if(is.null(preProcList) || +# !(setequal(names(preProcList), preprocChoices[[type]])) +# ){ +# stop('ill-formed preprocessor') +# # todo better message +# } +# +# preProcList<-sapply(preProcList, extractBodyWithComments) +# +# +# # remove 1st 2 spaces of each line +# if(type=='points'){ +# auxPath<-getPreProcPPAuxPath() +# } else { +# auxPath<-getPreProcPAAuxPath() +# } +# +# #if this works, copy datapath to aux and reload +# file.copy(datapath, auxPath, overwrite = TRUE) +# readAuxPreProcs() +# }, +# error=function(e){ +# e<-c(e,traceback()) +# err<-paste(unlist(e), collapse="\n", sep="\n") +# shinyalert("load preproc Error",err, type="error") +# }) +# } +# +# observeEvent(input$buttonPreProcPtImport,{ +# fp.dt<-parseFilePaths(c(home='~'), input$buttonPreProcPtImport) +# if(length(fp.dt)>0 && nrow(fp.dt)){ +# datapath<-as.character(fp.dt$datapath[1]) +# datapath<-gsub(pattern = '^NA/', "~/", datapath) +# loadPreProc(datapath, 'points') +# } +# }) +# +# observeEvent(input$buttonPreProcAtImport,{ +# fp.dt<-parseFilePaths(c(home='~'), input$buttonPreProcAtImport) +# if(length(fp.dt)>0 && nrow(fp.dt)){ +# datapath<-as.character(fp.dt$datapath[1]) +# datapath<-gsub(pattern = '^NA/', "~/", datapath) +# loadPreProc(datapath, 'attrs') +# } +# }) \ No newline at end of file diff --git a/inst/App/rightPanel/menu/modalCustColumn.R b/inst/App/rightPanel/menu/modalCustColumn.R index d45b006f..9064f305 100644 --- a/inst/App/rightPanel/menu/modalCustColumn.R +++ b/inst/App/rightPanel/menu/modalCustColumn.R @@ -44,21 +44,21 @@ observeEvent(input$modalCustColumnName,{ } }) -getCustColumnAuxPath<-reactive({file.path(getDirPath(),'aux','columnChoiceSets')}) +getAuxChoicesPath<-reactive({file.path(getDirPath(),'aux','choices')}) writeAuxCustColumnList<-function(filePath, customColumnChoiceList){ cat(customColumnChoiceList, file=filePath) } -readAuxCustColumns<-function(filePath){ - files<-dir(getCustColumnAuxPath(), pattern="*\\.txt$",full.names=TRUE ) +readAuxChoices<-function(filePath){ + files<-dir(getAuxChoicesPath(), pattern="*\\.txt$",full.names=TRUE ) customChoiceList<-list() customChoiceList<-lapply(files, function(f){ scan(file=f, what=character(), quiet=TRUE) }) nms<-gsub('\\.txt','', basename(files)) names(customChoiceList)<-nms - customChoiceList + aux$colChoiceSet<-customChoiceList } @@ -69,12 +69,12 @@ observeEvent( input$modalCustColumnEditorCommitOk,{ CustColumnName<-paste0(CustColumnName,'.txt') customColumnChoiceList<-input$customColumnChoiceTxt - if(!dir.exists(getCustColumnAuxPath())){ - dir.create(getCustColumnAuxPath() ) + if(!dir.exists(getAuxChoicesPath())){ + dir.create(getAuxChoicesPath() ) } - filePath<-file.path(getCustColumnAuxPath(), CustColumnName) + filePath<-file.path(getAuxChoicesPath(), CustColumnName) writeAuxCustColumnList(filePath, customColumnChoiceList) - aux$colChoiceSet<-readAuxCustColumns() + readAuxChoices() removeModal() }) @@ -92,16 +92,16 @@ aux<-reactiveValues(colChoiceSet=list()) observeEvent(aux$colChoiceSet,{ # reset submenu for dropDown-cmdEditColumnChoices if(length(aux$colChoiceSet )==0){ - disableDMDM(session, 'plotNavBar','dropDown-cmdEditColumnChoices') + removeDMDM(session, 'plotNavBar','Edit Choices') } else{ kids<-lapply(names(aux$colChoiceSet), function(nn){ shinyDMDMenu::menuItem(nn, value=paste0('editChoiceSet-',nn)) }) if(length(kids)>0){ - enableDMDM(session, 'plotNavBar','dropDown-cmdEditColumnChoices') + afterEntry='cmdNewColumnChoices' - label=paste0('Edit Choice Set') - shinyDMDMenu::removeDMDM(session, menuBarId ="plotNavBar", entry='Edit Choice Set', type='dropdown') + label=paste0('Edit Choices') + shinyDMDMenu::removeDMDM(session, "plotNavBar", 'Edit Choices') shinyDMDMenu::insertAfterDMDM( session, menuBarId ="plotNavBar", @@ -112,6 +112,9 @@ observeEvent(aux$colChoiceSet,{ kids ) ) + enableDMDM(session, 'plotNavBar','Edit Choices') } } -}) \ No newline at end of file +}) + + diff --git a/inst/App/rightPanel/menu/serverPlotBar.R b/inst/App/rightPanel/menu/serverPlotBar.R index 60e2bd94..caf75be8 100644 --- a/inst/App/rightPanel/menu/serverPlotBar.R +++ b/inst/App/rightPanel/menu/serverPlotBar.R @@ -114,8 +114,8 @@ observeEvent(input$plotNavBar, { } if(cmd == 'cmdImportColumnChoices'){ # disable unless ... - # cmdPreProcAtsImport() - # dirtyDMDM(session, "plotNavBar") + cmdChoiceSetImport() + dirtyDMDM(session, "plotNavBar") } # if(cmd=="cmdRemoveAP"){ #-----save diff --git a/inst/App/rightPanel/preProc/serverColSetDB.R b/inst/App/rightPanel/preProc/serverColSetDB.R index 8b3261ea..1e90be35 100644 --- a/inst/App/rightPanel/preProc/serverColSetDB.R +++ b/inst/App/rightPanel/preProc/serverColSetDB.R @@ -4,6 +4,14 @@ colSetPageDB<-reactiveVal( tibble( tabId="bogus", tibName="bogus", colName='bogus', colSetName='bogus')[0,] ) +observeEvent(colSetPageDB(),{ + if(nrow( colSetPageDB() )>0){ + enableDMDM(session, 'plotNavBar','Edit Choices') + } else{ + disableDMDM(session, 'plotNavBar',"Edit Choices") + } +}) + getColSetPage<-function(pageId){ db<-colSetPageDB() filter(db, tabId==pageId ) diff --git a/inst/App/server.R b/inst/App/server.R index dd46f52d..7a0d8a3f 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -114,6 +114,7 @@ shinyServer(function(input, output,session) { source("rightPanel/menu/cmdFileImportPreProc.R", local=TRUE) source("rightPanel/menu/cmdFileExportPreProc.R", local=TRUE) source("rightPanel/menu/cmdRemovePreProc.R", local=TRUE) + source("rightPanel/menu/cmdChoiceSetImport.R", local=TRUE) source("rightPanel/menu/serverPlotBar.R", local=TRUE) source("rightPanel/serverPanelCoordinator.R", local=TRUE) source("rightPanel/serverPanelDispatch.R", local=TRUE) From 0135d79f3dc1b66b1f1a76161aa702f964b4a6f7 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 11:11:47 -0500 Subject: [PATCH 131/263] moved files into choiceSet dir --- .../App/rightPanel/{menu => choiceSet}/cmdChoiceSetImport.R | 0 inst/App/rightPanel/{menu => choiceSet}/modalCustColumn.R | 0 inst/App/rightPanel/{preProc => choiceSet}/serverColSetDB.R | 0 inst/App/server.R | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename inst/App/rightPanel/{menu => choiceSet}/cmdChoiceSetImport.R (100%) rename inst/App/rightPanel/{menu => choiceSet}/modalCustColumn.R (100%) rename inst/App/rightPanel/{preProc => choiceSet}/serverColSetDB.R (100%) diff --git a/inst/App/rightPanel/menu/cmdChoiceSetImport.R b/inst/App/rightPanel/choiceSet/cmdChoiceSetImport.R similarity index 100% rename from inst/App/rightPanel/menu/cmdChoiceSetImport.R rename to inst/App/rightPanel/choiceSet/cmdChoiceSetImport.R diff --git a/inst/App/rightPanel/menu/modalCustColumn.R b/inst/App/rightPanel/choiceSet/modalCustColumn.R similarity index 100% rename from inst/App/rightPanel/menu/modalCustColumn.R rename to inst/App/rightPanel/choiceSet/modalCustColumn.R diff --git a/inst/App/rightPanel/preProc/serverColSetDB.R b/inst/App/rightPanel/choiceSet/serverColSetDB.R similarity index 100% rename from inst/App/rightPanel/preProc/serverColSetDB.R rename to inst/App/rightPanel/choiceSet/serverColSetDB.R diff --git a/inst/App/server.R b/inst/App/server.R index 7a0d8a3f..afe63a80 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -83,7 +83,7 @@ shinyServer(function(input, output,session) { #------------------rightPanel-------------------------------- source("rightPanel/selector/serverAssetSelectionDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcDB.R", local=TRUE) - source("rightPanel/preProc/serverColSetDB.R", local=TRUE) + source("rightPanel/choiceSet/serverColSetDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsInsert.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsMove.R", local=TRUE) source("rightPanel/preProc/serverPreProcMatMove.R", local=TRUE) @@ -109,12 +109,12 @@ shinyServer(function(input, output,session) { source("rightPanel/mouse/serverMouseClicks.R", local=TRUE) source("rightPanel/menu/cmdNewColumn.R", local=TRUE) source("rightPanel/menu/cmdNewAsset.R", local=TRUE) - source("rightPanel/menu/modalCustColumn.R", local=TRUE) + source("rightPanel/choiceSet/modalCustColumn.R", local=TRUE) source("rightPanel/menu/cmdDeleteColumn.R", local=TRUE) source("rightPanel/menu/cmdFileImportPreProc.R", local=TRUE) source("rightPanel/menu/cmdFileExportPreProc.R", local=TRUE) source("rightPanel/menu/cmdRemovePreProc.R", local=TRUE) - source("rightPanel/menu/cmdChoiceSetImport.R", local=TRUE) + source("rightPanel/choiceSet/cmdChoiceSetImport.R", local=TRUE) source("rightPanel/menu/serverPlotBar.R", local=TRUE) source("rightPanel/serverPanelCoordinator.R", local=TRUE) source("rightPanel/serverPanelDispatch.R", local=TRUE) From dbba21842eb2249c7e99408e18b41a2f72e8fe2e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 11:29:48 -0500 Subject: [PATCH 132/263] file rename to choiceSet --- .../rightPanel/choiceSet/{modalCustColumn.R => modalChoiceSet.R} | 0 .../choiceSet/{serverColSetDB.R => serverChoiceSetDB.R} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename inst/App/rightPanel/choiceSet/{modalCustColumn.R => modalChoiceSet.R} (100%) rename inst/App/rightPanel/choiceSet/{serverColSetDB.R => serverChoiceSetDB.R} (100%) diff --git a/inst/App/rightPanel/choiceSet/modalCustColumn.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R similarity index 100% rename from inst/App/rightPanel/choiceSet/modalCustColumn.R rename to inst/App/rightPanel/choiceSet/modalChoiceSet.R diff --git a/inst/App/rightPanel/choiceSet/serverColSetDB.R b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R similarity index 100% rename from inst/App/rightPanel/choiceSet/serverColSetDB.R rename to inst/App/rightPanel/choiceSet/serverChoiceSetDB.R From 055a596b3c31cede5db2da174caed9ac400612d1 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 11:30:47 -0500 Subject: [PATCH 133/263] file rename to choice set --- inst/App/server.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/server.R b/inst/App/server.R index afe63a80..598705a9 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -83,7 +83,7 @@ shinyServer(function(input, output,session) { #------------------rightPanel-------------------------------- source("rightPanel/selector/serverAssetSelectionDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcDB.R", local=TRUE) - source("rightPanel/choiceSet/serverColSetDB.R", local=TRUE) + source("rightPanel/choiceSet/serverChoiceSetDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsInsert.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsMove.R", local=TRUE) source("rightPanel/preProc/serverPreProcMatMove.R", local=TRUE) @@ -109,7 +109,7 @@ shinyServer(function(input, output,session) { source("rightPanel/mouse/serverMouseClicks.R", local=TRUE) source("rightPanel/menu/cmdNewColumn.R", local=TRUE) source("rightPanel/menu/cmdNewAsset.R", local=TRUE) - source("rightPanel/choiceSet/modalCustColumn.R", local=TRUE) + source("rightPanel/choiceSet/modalChoiceSet.R", local=TRUE) source("rightPanel/menu/cmdDeleteColumn.R", local=TRUE) source("rightPanel/menu/cmdFileImportPreProc.R", local=TRUE) source("rightPanel/menu/cmdFileExportPreProc.R", local=TRUE) From 1fd6e314bddce66f997d5e518b1ec32605949ecf Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 11:53:01 -0500 Subject: [PATCH 134/263] ColSet => ChoiceSet --- inst/App/fileIO/serverLoadWorkSpace.R | 4 ++-- inst/App/leftPanel/pproj/pprojUtil.R | 2 +- .../App/rightPanel/choiceSet/modalChoiceSet.R | 4 ++-- .../rightPanel/choiceSet/serverChoiceSetDB.R | 20 +++++++++---------- .../App/rightPanel/footer/moduleFooterRight.R | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index dd63c39a..4d0a3a7a 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -137,8 +137,8 @@ restoreWorkSpace<-reactive({ tib<-extractDBFromPages(wsPages, "^fileDescriptor.", initTib=initialFileDescDB() ) fileDescDB(tib) - tib<-extractDBFromPages(wsPages, "^colSetPage.", initTib=initialColSetPageDB()) - colSetPageDB(tib) + tib<-extractDBFromPages(wsPages, "^colSetPage.", initTib=initialChoiceSetPageDB()) + choiceSetPageDB(tib) if(!is.null(ptRproj)){ ptRproj$pathToProj<-editOption$currentProjectDirectory diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index f74a8c39..3348aab4 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -33,7 +33,7 @@ closeCurrentProj<-function(){ resetDnippetsDB() preProcScriptDB$points=initialPreProcScriptDB() preProcScriptDB$attrs= initialPreProcScriptDB() - colSetPageDB(initialColSetPageDB() ) + colSetPageDB(initialChoiceSetPageDB() ) fileDescDB(initialFileDescDB()) svgGridDB( initialSvgGridDB() ) useTribbleFormatDB( initialTribbleDB() ) diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index 9064f305..dee4b8f3 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -78,13 +78,13 @@ observeEvent( input$modalCustColumnEditorCommitOk,{ removeModal() }) -colSetPageDB<-reactiveVal( +choiceSetPageDB<-reactiveVal( tibble( tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus')[0,] ) populateChoiceSetEditMenu<-function(choice){ - # append tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus' to colSetPageDB + # append tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus' to choiceSetPageDB } aux<-reactiveValues(colChoiceSet=list()) diff --git a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R index 1e90be35..54fbb039 100644 --- a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R +++ b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R @@ -1,11 +1,11 @@ -colSetPageDB<-reactiveVal( - tibble( tabId="bogus", tibName="bogus", colName='bogus', colSetName='bogus')[0,] +choiceSetPageDB<-reactiveVal( + tibble( tabId="bogus", tibName="bogus", colName='bogus', choiceSetName='bogus')[0,] ) -observeEvent(colSetPageDB(),{ - if(nrow( colSetPageDB() )>0){ +observeEvent(choiceSetPageDB(),{ + if(nrow( choiceSetPageDB() )>0){ enableDMDM(session, 'plotNavBar','Edit Choices') } else{ disableDMDM(session, 'plotNavBar',"Edit Choices") @@ -13,7 +13,7 @@ observeEvent(colSetPageDB(),{ }) getColSetPage<-function(pageId){ - db<-colSetPageDB() + db<-choiceSetPageDB() filter(db, tabId==pageId ) } @@ -23,25 +23,25 @@ getColSet4PageName<-function(tab_Id, tib_Name, column_Name){ { return( NULL) } - csDB<-colSetPageDB() + csDB<-choiceSetPageDB() csDB<-filter(csDB, tabId==tab_Id &tibName==tib_Name & colName==column_Name ) if(nrow(csDB)>0){ - csDB$colSetName + csDB$choiceSetName } else { NULL } } setColSet4PageName<-function(tab_Id, tib_Name, column_Name, colSet_Name){ - csDB<-colSetPageDB() + csDB<-choiceSetPageDB() csDB<-filter(csDB, !(tabId==tab_Id & tibName==tib_Name & colName==column_Name ) ) if(!is.null(colSet_Name)){ - csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, colSetName=colSet_Name)) + csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, choiceSetName=colSet_Name)) } - colSetPageDB(csDB) + choiceSetPageDB(csDB) } \ No newline at end of file diff --git a/inst/App/rightPanel/footer/moduleFooterRight.R b/inst/App/rightPanel/footer/moduleFooterRight.R index 99c1270b..590b8b5f 100644 --- a/inst/App/rightPanel/footer/moduleFooterRight.R +++ b/inst/App/rightPanel/footer/moduleFooterRight.R @@ -16,7 +16,7 @@ moduleFooterRight<-function(input, output, session, if(hasPreProcChoices()){ leftPtButtons= 50 scriptName=getScriptName() - if(scriptName!="none"){ + if(length(scriptName)>0){ scriptName=paste("Preproc:", scriptName) } else { scriptName="" From 15b3b07c8438968738bcf50d94aca71c0a69161e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 11:53:01 -0500 Subject: [PATCH 135/263] ColSet => ChoiceSet --- inst/App/fileIO/serverLoadWorkSpace.R | 4 ++-- inst/App/leftPanel/pproj/pprojUtil.R | 2 +- .../App/rightPanel/choiceSet/modalChoiceSet.R | 4 ++-- .../rightPanel/choiceSet/serverChoiceSetDB.R | 20 +++++++++---------- .../App/rightPanel/footer/moduleFooterRight.R | 2 +- inst/App/util/dbInitiatizers.R | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index dd63c39a..4d0a3a7a 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -137,8 +137,8 @@ restoreWorkSpace<-reactive({ tib<-extractDBFromPages(wsPages, "^fileDescriptor.", initTib=initialFileDescDB() ) fileDescDB(tib) - tib<-extractDBFromPages(wsPages, "^colSetPage.", initTib=initialColSetPageDB()) - colSetPageDB(tib) + tib<-extractDBFromPages(wsPages, "^colSetPage.", initTib=initialChoiceSetPageDB()) + choiceSetPageDB(tib) if(!is.null(ptRproj)){ ptRproj$pathToProj<-editOption$currentProjectDirectory diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index f74a8c39..3348aab4 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -33,7 +33,7 @@ closeCurrentProj<-function(){ resetDnippetsDB() preProcScriptDB$points=initialPreProcScriptDB() preProcScriptDB$attrs= initialPreProcScriptDB() - colSetPageDB(initialColSetPageDB() ) + colSetPageDB(initialChoiceSetPageDB() ) fileDescDB(initialFileDescDB()) svgGridDB( initialSvgGridDB() ) useTribbleFormatDB( initialTribbleDB() ) diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index 9064f305..dee4b8f3 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -78,13 +78,13 @@ observeEvent( input$modalCustColumnEditorCommitOk,{ removeModal() }) -colSetPageDB<-reactiveVal( +choiceSetPageDB<-reactiveVal( tibble( tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus')[0,] ) populateChoiceSetEditMenu<-function(choice){ - # append tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus' to colSetPageDB + # append tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus' to choiceSetPageDB } aux<-reactiveValues(colChoiceSet=list()) diff --git a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R index 1e90be35..54fbb039 100644 --- a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R +++ b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R @@ -1,11 +1,11 @@ -colSetPageDB<-reactiveVal( - tibble( tabId="bogus", tibName="bogus", colName='bogus', colSetName='bogus')[0,] +choiceSetPageDB<-reactiveVal( + tibble( tabId="bogus", tibName="bogus", colName='bogus', choiceSetName='bogus')[0,] ) -observeEvent(colSetPageDB(),{ - if(nrow( colSetPageDB() )>0){ +observeEvent(choiceSetPageDB(),{ + if(nrow( choiceSetPageDB() )>0){ enableDMDM(session, 'plotNavBar','Edit Choices') } else{ disableDMDM(session, 'plotNavBar',"Edit Choices") @@ -13,7 +13,7 @@ observeEvent(colSetPageDB(),{ }) getColSetPage<-function(pageId){ - db<-colSetPageDB() + db<-choiceSetPageDB() filter(db, tabId==pageId ) } @@ -23,25 +23,25 @@ getColSet4PageName<-function(tab_Id, tib_Name, column_Name){ { return( NULL) } - csDB<-colSetPageDB() + csDB<-choiceSetPageDB() csDB<-filter(csDB, tabId==tab_Id &tibName==tib_Name & colName==column_Name ) if(nrow(csDB)>0){ - csDB$colSetName + csDB$choiceSetName } else { NULL } } setColSet4PageName<-function(tab_Id, tib_Name, column_Name, colSet_Name){ - csDB<-colSetPageDB() + csDB<-choiceSetPageDB() csDB<-filter(csDB, !(tabId==tab_Id & tibName==tib_Name & colName==column_Name ) ) if(!is.null(colSet_Name)){ - csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, colSetName=colSet_Name)) + csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, choiceSetName=colSet_Name)) } - colSetPageDB(csDB) + choiceSetPageDB(csDB) } \ No newline at end of file diff --git a/inst/App/rightPanel/footer/moduleFooterRight.R b/inst/App/rightPanel/footer/moduleFooterRight.R index 99c1270b..590b8b5f 100644 --- a/inst/App/rightPanel/footer/moduleFooterRight.R +++ b/inst/App/rightPanel/footer/moduleFooterRight.R @@ -16,7 +16,7 @@ moduleFooterRight<-function(input, output, session, if(hasPreProcChoices()){ leftPtButtons= 50 scriptName=getScriptName() - if(scriptName!="none"){ + if(length(scriptName)>0){ scriptName=paste("Preproc:", scriptName) } else { scriptName="" diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index 9dc2dc93..96e1e292 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -17,8 +17,8 @@ initialPreProcPageDB<-function(){ tibble( tabId="bogus", tibName="bogus", colName='bogus', scriptName='bogus')[0,] } -initialColSetPageDB<-function(){ - tibble( tabId="bogus", tibName="bogus", colName='bogus', colSetName='bogus')[0,] +initialChoiceSetPageDB<-function(){ + tibble( tabId="bogus", tibName="bogus", colName='bogus', choiceSetName='bogus')[0,] } initialTribbleDB<-function(){ From 72cb1c574a6326e311f1373c711e8de27b389963 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 12:08:45 -0500 Subject: [PATCH 136/263] ColSet=> ChoiceSet --- inst/App/fileIO/serverLoadWorkSpace.R | 2 +- inst/App/fileIO/serverPage2Workspace.R | 4 ++-- inst/App/leftPanel/pproj/pprojUtil.R | 2 +- inst/App/rightPanel/choiceSet/serverChoiceSetDB.R | 10 +++++----- inst/App/rightPanel/menu/cmdNewColumn.R | 2 +- inst/App/rightPanel/selector/serverAssetSelection.R | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index 4d0a3a7a..08759228 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -137,7 +137,7 @@ restoreWorkSpace<-reactive({ tib<-extractDBFromPages(wsPages, "^fileDescriptor.", initTib=initialFileDescDB() ) fileDescDB(tib) - tib<-extractDBFromPages(wsPages, "^colSetPage.", initTib=initialChoiceSetPageDB()) + tib<-extractDBFromPages(wsPages, "^choiceSetPage.", initTib=initialChoiceSetPageDB()) choiceSetPageDB(tib) if(!is.null(ptRproj)){ diff --git a/inst/App/fileIO/serverPage2Workspace.R b/inst/App/fileIO/serverPage2Workspace.R index 2eac93de..cb919d3b 100644 --- a/inst/App/fileIO/serverPage2Workspace.R +++ b/inst/App/fileIO/serverPage2Workspace.R @@ -14,7 +14,7 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ dnip<-getPageDnippetsDB(pageId) widg<-getPageWidgetDB(pageId) preprocPage<-getPagePreprocPageDB(pageId) - colSetPage<-getColSetPage(pageId) + choiceSetPage<-getChoiceSetPage(pageId) # print(widg) rtv<-c( fileDescriptor=getFileDescriptor(pageId), @@ -26,7 +26,7 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ dnip=dnip, widg=widg, preprocPage=preprocPage, - colSetPage=colSetPage + choiceSetPage=choiceSetPage ) # ppE<-getPreProcPtEntries(pageId) diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index 3348aab4..f78651c0 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -33,7 +33,7 @@ closeCurrentProj<-function(){ resetDnippetsDB() preProcScriptDB$points=initialPreProcScriptDB() preProcScriptDB$attrs= initialPreProcScriptDB() - colSetPageDB(initialChoiceSetPageDB() ) + choiceSetPageDB(initialChoiceSetPageDB() ) fileDescDB(initialFileDescDB()) svgGridDB( initialSvgGridDB() ) useTribbleFormatDB( initialTribbleDB() ) diff --git a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R index 54fbb039..185e077e 100644 --- a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R +++ b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R @@ -12,12 +12,12 @@ observeEvent(choiceSetPageDB(),{ } }) -getColSetPage<-function(pageId){ +getChoiceSetPage<-function(pageId){ db<-choiceSetPageDB() filter(db, tabId==pageId ) } -getColSet4PageName<-function(tab_Id, tib_Name, column_Name){ +getChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name){ if(any(sapply(c(tab_Id, tib_Name, column_Name), is.null)) || tab_Id=='bogus') { @@ -34,14 +34,14 @@ getColSet4PageName<-function(tab_Id, tib_Name, column_Name){ } } -setColSet4PageName<-function(tab_Id, tib_Name, column_Name, colSet_Name){ +setChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name, choiceSet_Name){ csDB<-choiceSetPageDB() csDB<-filter(csDB, !(tabId==tab_Id & tibName==tib_Name & colName==column_Name ) ) - if(!is.null(colSet_Name)){ - csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, choiceSetName=colSet_Name)) + if(!is.null(choiceSet_Name)){ + csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, choiceSetName=choiceSet_Name)) } choiceSetPageDB(csDB) } \ No newline at end of file diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index d53b52a9..f50a3eb4 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -222,7 +222,7 @@ observeEvent(input$commitNewCol, { #To do: perform additional checks !!! #updateWidgetChoicesRow( selectedWidget=returnValue4ModuleEdTib$selectedWidget()) - setColSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, colSet_Name=colSet_Name) + setChoiceSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, choiceSet_Name=colSet_Name) } if(treatAs=='number'){ newVal<-as.numeric(newVal) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 067ff60b..b9ff8543 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -265,7 +265,7 @@ getTibEntryChoices<-reactive({ tib_Name<-getAssetName() column_Name<-getTibColumnName() if( length(tab_Id)>0 && length(tib_Name)>0){ - choiceSetName<-getColSet4PageName( tab_Id, tib_Name, column_Name) + choiceSetName<-getChoiceSet4PageName( tab_Id, tib_Name, column_Name) if(length(choiceSetName)>0){ choices<-aux$colChoiceSet[[choiceSetName]] if(length(choices)>0){ From 9fc6c059d3841cdfaba482bf7756505e43d5e1e5 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 12:19:21 -0500 Subject: [PATCH 137/263] nchar <8 =>nchar <6 --- inst/App/rightPanel/choiceSet/modalChoiceSet.R | 2 +- inst/App/rightPanel/preProc/modalPreprocEditor.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index dee4b8f3..650a8c6b 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -37,7 +37,7 @@ modalCustColumnEditor <- function( custColumnName, value="TRUE\nFALSE" ) { observeEvent(input$modalCustColumnName,{ CustColumnName<-input$modalCustColumnName - if(length(CustColumnName)==0 || nchar(CustColumnName)<8){ + if(length(CustColumnName)==0 || nchar(CustColumnName)<6){ hideElement("modalCustColumnEditorCommitOk") } else { showElement("modalCustColumnEditorCommitOk") diff --git a/inst/App/rightPanel/preProc/modalPreprocEditor.R b/inst/App/rightPanel/preProc/modalPreprocEditor.R index e90a113e..b011193e 100644 --- a/inst/App/rightPanel/preProc/modalPreprocEditor.R +++ b/inst/App/rightPanel/preProc/modalPreprocEditor.R @@ -54,7 +54,7 @@ modalPreProcEditor <- function( preprocScripts, preprocName, type='points' ) { observeEvent(input$modalPreprocName,{ preprocName<-input$modalPreprocName - if(length(preprocName)==0 || nchar(preprocName)<8){ + if(length(preprocName)==0 || nchar(preprocName)<6){ hideElement("modalPreprocEditorCommitOk") } else { showElement("modalPreprocEditorCommitOk") From 846a0d8431862df7505781297be4a328b43b1dc9 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 13:59:15 -0500 Subject: [PATCH 138/263] cosmetic cleanup --- inst/App/leftPanel/mid/serverAce.R | 6 +- .../rightPanel/choiceSet/cmdChoiceSetImport.R | 71 +------------------ inst/App/rightPanel/menu/cmdNewColumn.R | 4 -- inst/App/rightPanel/mid/serverPlotRmd.R | 6 -- inst/App/rightPanel/serverPanelDispatch.R | 2 - 5 files changed, 3 insertions(+), 86 deletions(-) diff --git a/inst/App/leftPanel/mid/serverAce.R b/inst/App/leftPanel/mid/serverAce.R index 309293d6..218e6599 100644 --- a/inst/App/leftPanel/mid/serverAce.R +++ b/inst/App/leftPanel/mid/serverAce.R @@ -1,7 +1,7 @@ observeEvent(input$messageFromAce, { - cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") + # cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") if(length(input$messageFromAce$sender)>0){ if(length(input$messageFromAce$code)>0){ # returning code setCode(input$messageFromAce$code) # only place where request$code is set @@ -34,14 +34,12 @@ observeEvent(input$messageFromAce, { 'cmd.commit', 'cmd.add.column', 'cmd.add.asset' ) # these all should redraw viewport ){ - cat('acein\n') processMssgFromAceMssgPageIn(sender, input$messageFromAce) } else if( sender %in% c( 'fileCmd.save', 'fileCmd.saveAs' ) ){ - cat('acesave\n') processMssgFromAceMssgPageOut(sender, input$messageFromAce) } else { setTrigger('redraw') @@ -58,7 +56,7 @@ observeEvent(input$messageFromAce, { } } } - cat("<----< messageFromAce",'***** sender=',format(input$messageFromAce$sender),"\n\n") + # cat("<----< messageFromAce",'***** sender=',format(input$messageFromAce$sender),"\n\n") }, priority = 90, ignoreNULL = TRUE, ignoreInit = TRUE, label='messageFromAce') diff --git a/inst/App/rightPanel/choiceSet/cmdChoiceSetImport.R b/inst/App/rightPanel/choiceSet/cmdChoiceSetImport.R index 9d01da98..5cdb9136 100644 --- a/inst/App/rightPanel/choiceSet/cmdChoiceSetImport.R +++ b/inst/App/rightPanel/choiceSet/cmdChoiceSetImport.R @@ -7,8 +7,7 @@ observeEvent(input$buttonChoiceSetImport,{ if(length(fp.dt)>0 && nrow(fp.dt)){ datapath<-as.character(fp.dt$datapath[1]) datapath<-gsub(pattern = '^NA/', "~/", datapath) - cat("datapath=",datapath,"\n") - #copy to aux + # copy to aux # get targetDir targetDir<-getAuxChoicesPath() if(!file.exists(targetDir)){ # we should probably place this elsewhere !!! @@ -26,71 +25,3 @@ observeEvent(input$buttonChoiceSetImport,{ } }) - -# loadPreProc<-function(datapath, type){ -# extractBodyWithComments<-function(fn){ -# tt<-capture.output(print(fn)) -# blanks1<-grepl('^ *$',tt) -# blanks2<-c(blanks1[-1], FALSE) -# bad<-blanks1 & blanks2 -# tt<-tt[!bad] -# tt<-sub('^( )( )*','',tt) #eat all indents :() -# tt<-paste(tt, collapse="\n") -# pos1<-str_locate_all(tt,'\\{')[[1]][1] -# if(length(pos1)==0) {stop('ill formed preproc')} -# pos2<-str_locate_all(tt,'\\}')[[1]] -# if(length(pos2)==0) {stop('ill formed preproc')} -# pos1<-pos1[1]+1 -# pos2<-pos2[length(pos2)]-1 -# substr(tt,pos1,pos2) -# } -# -# tryCatch({ -# preProcList<-source(datapath, local=T)$value -# #check preProcList -# -# if(is.null(preProcList) || -# !(setequal(names(preProcList), preprocChoices[[type]])) -# ){ -# stop('ill-formed preprocessor') -# # todo better message -# } -# -# preProcList<-sapply(preProcList, extractBodyWithComments) -# -# -# # remove 1st 2 spaces of each line -# if(type=='points'){ -# auxPath<-getPreProcPPAuxPath() -# } else { -# auxPath<-getPreProcPAAuxPath() -# } -# -# #if this works, copy datapath to aux and reload -# file.copy(datapath, auxPath, overwrite = TRUE) -# readAuxPreProcs() -# }, -# error=function(e){ -# e<-c(e,traceback()) -# err<-paste(unlist(e), collapse="\n", sep="\n") -# shinyalert("load preproc Error",err, type="error") -# }) -# } -# -# observeEvent(input$buttonPreProcPtImport,{ -# fp.dt<-parseFilePaths(c(home='~'), input$buttonPreProcPtImport) -# if(length(fp.dt)>0 && nrow(fp.dt)){ -# datapath<-as.character(fp.dt$datapath[1]) -# datapath<-gsub(pattern = '^NA/', "~/", datapath) -# loadPreProc(datapath, 'points') -# } -# }) -# -# observeEvent(input$buttonPreProcAtImport,{ -# fp.dt<-parseFilePaths(c(home='~'), input$buttonPreProcAtImport) -# if(length(fp.dt)>0 && nrow(fp.dt)){ -# datapath<-as.character(fp.dt$datapath[1]) -# datapath<-gsub(pattern = '^NA/', "~/", datapath) -# loadPreProc(datapath, 'attrs') -# } -# }) \ No newline at end of file diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index f50a3eb4..43a2abd2 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -219,9 +219,7 @@ observeEvent(input$commitNewCol, { newVal<-input$modalColChooserValue # restrict that value is restiricted to this list colSet_Name<-input$modalColChooserSet - #To do: perform additional checks !!! - #updateWidgetChoicesRow( selectedWidget=returnValue4ModuleEdTib$selectedWidget()) setChoiceSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, choiceSet_Name=colSet_Name) } if(treatAs=='number'){ @@ -232,9 +230,7 @@ observeEvent(input$commitNewCol, { newVal<-list(eval(parse(text=newVal))) # to do: validate!!! } - # newVal is ready to insert - newPtDefs$tib[[getAssetName()]]<-add_column(newPtDefs$tib[[getAssetName()]], !!(newColName):=newVal ) diff --git a/inst/App/rightPanel/mid/serverPlotRmd.R b/inst/App/rightPanel/mid/serverPlotRmd.R index 64475eb7..787ba52c 100644 --- a/inst/App/rightPanel/mid/serverPlotRmd.R +++ b/inst/App/rightPanel/mid/serverPlotRmd.R @@ -11,15 +11,9 @@ modulePlotRmd<-function(input, output, session, output$rmd_Html <- renderUI({ if(getPanelName() %in% rmdPanelTag){ src<-getCode() - # src<-request$code if(grepl("output: dnd_snippet",src)){ - # cat("founds\n") - # cat('>--> dripplets2Rmd\n') src<-dripplets2Rmd(src) - # cat(src) - # cat('<--< dripplets2Rmd\n') } - # knit2html(text = src, fragment.only = FALSE, quiet = TRUE) div( style='background-color: #FFFFFF;', HTML(knit2html(text =src , fragment.only = TRUE, quiet = TRUE)) ) diff --git a/inst/App/rightPanel/serverPanelDispatch.R b/inst/App/rightPanel/serverPanelDispatch.R index c0377bc0..cdb73534 100644 --- a/inst/App/rightPanel/serverPanelDispatch.R +++ b/inst/App/rightPanel/serverPanelDispatch.R @@ -67,9 +67,7 @@ output$MidRightPanel<-renderUI({ div(img(src="ptR/pointRlogo.svg")) #Todo add something about sponsors. } else { - cat("chosenRightMidPanel=11\n") div(img(src="ptR/pointRlogo.svg")) - # div( pointRLogoSVG()) } From 28a428267bb954618dbe7e702703240b68b43ec1 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 20:37:02 -0500 Subject: [PATCH 139/263] added getChoiceSetElements --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 24418cd8..5f3eb1d7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2019-12-30 Title: pointR -Version: 0.4.4 +Version: 0.4.5 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR From 6172851a7c5a4f4dd70b26ba202142f64e8957a6 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 20:37:38 -0500 Subject: [PATCH 140/263] added getChoiceElements --- inst/App/rightPanel/choiceSet/modalChoiceSet.R | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index 650a8c6b..47dbf6da 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -15,7 +15,7 @@ modalCustColumnEditor <- function( custColumnName, value="TRUE\nFALSE" ) { label=span(style='color: #00ffff;', 'Name'), value=custColumnName, width='100%', - placeholder = 'Enter a name with at least 8 characters for this set of choices ' + placeholder = 'Enter a name with at least 6 characters for this set of choices ' ), div( aceEditor( @@ -62,6 +62,8 @@ readAuxChoices<-function(filePath){ } + + observeEvent( input$modalCustColumnEditorCommitOk,{ CustColumnName<-input$modalCustColumnName @@ -89,6 +91,16 @@ populateChoiceSetEditMenu<-function(choice){ aux<-reactiveValues(colChoiceSet=list()) +getChoiceSetElements<-function(name){ + rtv<-NULL + if(length(name)==1){ + cs<-aux$colChoiceSet + rtv<- cs[[name]] + } + rtv +} + + observeEvent(aux$colChoiceSet,{ # reset submenu for dropDown-cmdEditColumnChoices if(length(aux$colChoiceSet )==0){ From 79bc8fc996b8a9138506cd15765c6558a283df01 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 20:38:26 -0500 Subject: [PATCH 141/263] sync choiceSetName with choiceSetValues --- inst/App/rightPanel/menu/cmdNewColumn.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 43a2abd2..3f69379a 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -80,7 +80,11 @@ observeEvent(input$modalAttrValue,{ is.Non.Blank.Value(nchar(str)>0) }) - +observeEvent(input$modalColChooserSet,{ + name<-input$modalColChooserSet + choices<-getChoiceSetElements(name) + updatePickerInput(session,inputId ="modalColChooserValue", choices=choices, selected=choices[[1]]) +}) observeEvent(c(is.Non.Blank.Name(),input$modalColTreatAs, is.Non.Blank.Value() ),{ From a5fcac9c19713071a09175cc277a25a13d1fad21 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 28 Dec 2020 20:59:39 -0500 Subject: [PATCH 142/263] allow blanks in choiceSetEntries --- inst/App/rightPanel/choiceSet/modalChoiceSet.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index 47dbf6da..0bc91849 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -54,7 +54,7 @@ readAuxChoices<-function(filePath){ files<-dir(getAuxChoicesPath(), pattern="*\\.txt$",full.names=TRUE ) customChoiceList<-list() customChoiceList<-lapply(files, function(f){ - scan(file=f, what=character(), quiet=TRUE) + scan(file=f, what=character(), quiet=TRUE, sep="\n") }) nms<-gsub('\\.txt','', basename(files)) names(customChoiceList)<-nms From ad5a8aa5226c5377418ec362e78bad24a42b6e36 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 30 Dec 2020 09:55:32 -0500 Subject: [PATCH 143/263] Allow to remove choiceSet when violaged --- inst/App/rightPanel/choiceSet/serverChoiceSetDB.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R index 185e077e..a4c5f37e 100644 --- a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R +++ b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R @@ -44,4 +44,13 @@ setChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name, choiceSet_Name){ csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, choiceSetName=choiceSet_Name)) } choiceSetPageDB(csDB) +} + +removeChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name, choiceSet_Name){ + csDB<-choiceSetPageDB() + csDB<-filter(csDB, !(tabId==tab_Id & + tibName==tib_Name & + colName==column_Name ) + ) + choiceSetPageDB(csDB) } \ No newline at end of file From a4c2b80fc651111291c6b865d55da8c9be4299ac Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 30 Dec 2020 09:56:33 -0500 Subject: [PATCH 144/263] tibEntryChoices now obtained from choiceSetDB --- .../rightPanel/selector/serverAssetSelection.R | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index b9ff8543..3a8c8adc 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -261,23 +261,25 @@ getTibEntryChoices<-reactive({ if( identical(getColumnType(), 'point')){ return( c('point', 'matrix')) } + columnValues<-getTib() %$$% getTibColumnName() + # if(!is.null(columnValues)){ + # columnValues <- as.list(columnValues) + # } + tab_Id<-getTibTabId() tib_Name<-getAssetName() column_Name<-getTibColumnName() if( length(tab_Id)>0 && length(tib_Name)>0){ choiceSetName<-getChoiceSet4PageName( tab_Id, tib_Name, column_Name) if(length(choiceSetName)>0){ - choices<-aux$colChoiceSet[[choiceSetName]] - if(length(choices)>0){ + choices<-aux$colChoiceSet[[choiceSetName]] # this is a check to insure consistancy + if(length(setdiff(columnValues, choices))==0 && length(choices)>0){ return(choices) + } else {#if it the check fails should remove from choiceSetPage + removeChoiceSet4PageName(tab_Id, tib_Name, column_Name) } } } - - columnValues<-getTib() %$$% getTibColumnName() - if(!is.null(columnValues)){ - columnValues <- as.list(columnValues) - } columnValues }) From 3a36fcfe44a5b2cd52f143c5d5b83d81cb03d105 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 30 Dec 2020 09:57:40 -0500 Subject: [PATCH 145/263] EdTib shows only choice in widget selection --- inst/App/rightPanel/header/moduleEdTib.R | 14 +++++++++++++- inst/App/rightPanel/header/serverEdTib.R | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index c5e1132b..93ca647b 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -59,6 +59,7 @@ moduleEdTib<-function(input, output, session, getTibEditState, getTransformType, getWidgetChoices, + getChoiceSet4PageName, getWidget ){ ns <- session$ns @@ -108,8 +109,14 @@ moduleEdTib<-function(input, output, session, # cat('--Entering ---widgetChooserUI----------\n') # cat('--calling ---getWidgetChoices----------\n') choices<-getWidgetChoices() + # cat('--calling ---getWidget----------\n') widget<-getWidget() + cs<-getChoiceSet4PageName() + if(!is.null(cs)){ + choices<-cs + widget<-cs + } # cat('--returning from ---getWidget----------\n') # cat("\nAfter getWidget value of getRowIndex=", format(getRowIndex()), "\n") if(length(choices )>0 && !is.null(widget)){ @@ -130,6 +137,7 @@ moduleEdTib<-function(input, output, session, # cat("\nInitial value of getRowIndex", format(getRowIndex()), "\n") # cat('--calling ---getWidget2----------\n') widget<-getWidget() + cs<-getChoiceSet4PageName() # cat("widget=",format(widget),"\n") # cat("getTibEntry()=",format(getTibEntry()),"\n") # cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") @@ -152,7 +160,7 @@ moduleEdTib<-function(input, output, session, val }) choices<-sort(unique(unlist( choices ))) - if(widget=='radio'){ + if(!is.null(cs)){ # cat('xxx widget=', format(widget),"\n") # radioGroupButtons(inputId=ns("entryRadio"), # choices=choices, @@ -162,6 +170,10 @@ moduleEdTib<-function(input, output, session, jqScrollBar(inputId=ns("entryRadio"), choices =choices, selected=selected) + } else if(widget=='radio'){ + jqScrollBar(inputId=ns("entryRadio"), + choices =choices, selected=selected) + } else if (widget=='picker'){ # cat('xxx widget=', format(widget),"\n") div( "class"="ptR2", width='800px', diff --git a/inst/App/rightPanel/header/serverEdTib.R b/inst/App/rightPanel/header/serverEdTib.R index b2755e95..6430c35f 100644 --- a/inst/App/rightPanel/header/serverEdTib.R +++ b/inst/App/rightPanel/header/serverEdTib.R @@ -30,6 +30,12 @@ returnValue4ModuleEdTib<-callModule( getTransformType=getTransformType, getTibEditState=getTibEditState, getWidgetChoices=getWidgetChoices, + getChoiceSet4PageName=reactive({ + if( getTibEditState()==TRUE ){ + getChoiceSet4PageName(getTibTabId(), getAssetName(), getTibColumnName() ) + } else { + NULL } + }), getWidget=getWidget #reactive({ if( getTibEditState()==TRUE ){ getHandlerValue() } else { NULL } }) ) From 60dbab08ac2e469abaa616add107b8c0236eee8e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 30 Dec 2020 20:29:43 -0500 Subject: [PATCH 146/263] choiceSets have beeen added to widget selector and are now treated like any other widget --- inst/App/rightPanel/header/moduleEdTib.R | 10 +- inst/App/rightPanel/header/serverEdTib.R | 23 +++- inst/App/rightPanel/menu/cmdNewColumn.R | 33 ++++- .../selector/serverAssetSelection.R | 29 ++++- .../rightPanel/selector/serverWidgetHandler.R | 123 +++++++++++++----- 5 files changed, 169 insertions(+), 49 deletions(-) diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index 93ca647b..40579d6b 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -110,15 +110,12 @@ moduleEdTib<-function(input, output, session, # cat('--calling ---getWidgetChoices----------\n') choices<-getWidgetChoices() - # cat('--calling ---getWidget----------\n') widget<-getWidget() cs<-getChoiceSet4PageName() if(!is.null(cs)){ - choices<-cs - widget<-cs + # choices<-cs #widget choices + widget<-cs #selected widget } - # cat('--returning from ---getWidget----------\n') - # cat("\nAfter getWidget value of getRowIndex=", format(getRowIndex()), "\n") if(length(choices )>0 && !is.null(widget)){ #cat("tabId=",format(input$pages),"\n") # cat("widgetChooserUI:: choices=c(",paste(choices,collapse=", "),")\n") @@ -143,7 +140,10 @@ moduleEdTib<-function(input, output, session, # cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") if(!is.null(widget) && !is.null(getTibEntry()) && !is.null(getTibEntryChoices())){ selected<-getTibEntry() + log.val(selected) choices<-getTibEntryChoices() + print(choices) + log.val(widget) if(widget=='slider'){ # cat('xxx widget=', format(widget),"\n") sliderInput( diff --git a/inst/App/rightPanel/header/serverEdTib.R b/inst/App/rightPanel/header/serverEdTib.R index 6430c35f..830d5934 100644 --- a/inst/App/rightPanel/header/serverEdTib.R +++ b/inst/App/rightPanel/header/serverEdTib.R @@ -32,9 +32,20 @@ returnValue4ModuleEdTib<-callModule( getWidgetChoices=getWidgetChoices, getChoiceSet4PageName=reactive({ if( getTibEditState()==TRUE ){ - getChoiceSet4PageName(getTibTabId(), getAssetName(), getTibColumnName() ) + widget<-getWidget() + log.val(widget) + ll<-aux$colChoiceSe + cat('returning choiceSet with names\n') + print(names(ll)) + print(ll) + if(!is.null(widget) && widget %in% names(aux$colChoiceSet)){ + return(widget) + } else { + return(NULL) + } } else { - NULL } + NULL + } }), getWidget=getWidget #reactive({ if( getTibEditState()==TRUE ){ getHandlerValue() } else { NULL } }) ) @@ -51,14 +62,16 @@ getSafeSelection<-function(selection, choices){ #anybody using this??? } observeEvent(returnValue4ModuleEdTib$selectedWidget(), { - if( getTibEditState()==TRUE && !is.null( returnValue4ModuleEdTib$selectedWidget() )){ + if( getTibEditState()==TRUE && length( returnValue4ModuleEdTib$selectedWidget() )>0 ){ log.fin(returnValue4ModuleEdTib$selectedWidget()) selectedWidget<-returnValue4ModuleEdTib$selectedWidget() - # log.val(selectedWidget) + log.val(nchar(selectedWidget)) + log.val(selectedWidget) + cat('ModuleEdTib$selectedWidget:: abount to update selectedWidget') updateWidgetChoicesRow( selectedWidget=returnValue4ModuleEdTib$selectedWidget()) log.fout(returnValue4ModuleEdTib$selectedWidget()) } -}) +}, ignoreNULL = TRUE) observeEvent(returnValue4ModuleEdTib$transformType(),{ if( getPlotState()==transformTag){ diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 3f69379a..eaaa12cc 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -224,7 +224,38 @@ observeEvent(input$commitNewCol, { # restrict that value is restiricted to this list colSet_Name<-input$modalColChooserSet #To do: perform additional checks !!! - setChoiceSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, choiceSet_Name=colSet_Name) + #setChoiceSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, choiceSet_Name=colSet_Name) + log.val(colSet_Name) + cat('*******************cmdNewColumn about to call updateWidgetChoicesRow************************\n') + # populate widgetDB + db<-widgetDB() + cat('db1=\n') + print(db) + pageId<- input$pages + log.val(pageId) + tibName<-getAssetName() + log.val(tibName) + columnName<-input$modalAttrName + log.val(columnName) + log.val(colSet_Name) + db1<-db + cat('db1=\n') + print(db1) + add_row(db, tabId=pageId, name=tibName, column=columnName, + type='choiceSet' , minVal=NA, maxVal=NA, step=1, selectedWidget=colSet_Name) + db2<-tibble_row( tabId=pageId, name=tibName, column=columnName, + type='choiceSet' , minVal=NA, maxVal=NA, step=1, selectedWidget=colSet_Name) + cat('db2=\n') + print(db2) + db3<-bind_rows(db1,db2) + #tibble(tabId='Tab0', name='x',column='y',type='character',minVal=NA, maxVal=NA,step=1, selectedWidget='radio')[0,] + cat('db3=\n') + print(db3) + widgetDB(db3) + cat("*********ouch***********************") + db<-widgetDB() + cat('db3=\n') + print(db) } if(treatAs=='number'){ newVal<-as.numeric(newVal) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 3a8c8adc..81a4d48f 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -258,9 +258,11 @@ getTibEntry<-reactive({ }) getTibEntryChoices<-reactive({ + if( identical(getColumnType(), 'point')){ return( c('point', 'matrix')) } + log.fin(getTibEntryChoices) columnValues<-getTib() %$$% getTibColumnName() # if(!is.null(columnValues)){ # columnValues <- as.list(columnValues) @@ -269,17 +271,27 @@ getTibEntryChoices<-reactive({ tab_Id<-getTibTabId() tib_Name<-getAssetName() column_Name<-getTibColumnName() + log.val(tab_Id) + log.val(tib_Name) + log.val(column_Name) if( length(tab_Id)>0 && length(tib_Name)>0){ - choiceSetName<-getChoiceSet4PageName( tab_Id, tib_Name, column_Name) + #choiceSetName<-getChoiceSet4PageName( tab_Id, tib_Name, column_Name) + choiceSetName<-getWidget() + log.val(choiceSetName) if(length(choiceSetName)>0){ choices<-aux$colChoiceSet[[choiceSetName]] # this is a check to insure consistancy - if(length(setdiff(columnValues, choices))==0 && length(choices)>0){ + cat('choices\n') + print(choices) + cat('columnValues\n') + print(columnValues) + if(length(choices)>0 && length(setdiff(columnValues, choices))==0 ){ return(choices) } else {#if it the check fails should remove from choiceSetPage removeChoiceSet4PageName(tab_Id, tib_Name, column_Name) } } } + log.fout(getTibEntryChoices) columnValues }) @@ -303,6 +315,19 @@ getTibMatColChoices<-reactive({ rtv }) +getCompatibleChoicesSets<-reactive({ + choices<-aux$colChoiceSet + columnValues<-getTib() %$$% getTibColumnName() + if(length(cs)>0 && length(columnValues)>0){ + fn<-function(choices){ + length(choices)>0 && length(setdiff(columnValues, choices))==0 + } + names(Filter(fn,choices)) + } else { + NULL + } +}) + diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index c3b72767..cf6331f7 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -20,16 +20,16 @@ type2WidgetChoices<-function(colType){ character.list.2= c('picker','slider','radio'), #, "multiInput", 'picker', 'checkbox'), #range character.list.vec= c('picker','radio'), #, "multiInput", 'picker', 'checkbox'), #range #percentage, percentage.list.2 - integer=c('radio','picker','slider', "numeric"), #,'knob' - numeric=c('radio','picker','slider', "numeric"), #,'knob' - numeric.list=c('radio','picker'), #,'slider', "numeric"), #,'knob' + integer=c('picker','slider', "numeric"), #'radio','knob' + numeric=c('picker','slider', "numeric"), #,'knob' + numeric.list=c('picker'), #,'slider', "numeric"), #'radio',,'knob' numeric.list.2=c('slider'), #,'knob' integer.list.2=c('slider'), - numeric.list.vec=c('radio','picker'), #,'slider', "numeric"), #,'knob' - integer.list.vec=c('radio','picker'), #,'slider', "numeric"), - integer.list=c('radio','picker'), + numeric.list.vec=c('picker'), #,'slider', "numeric"), #'radio',,'knob' + integer.list.vec=c('picker'), #,'slider', "numeric"), #radio', + integer.list=c('picker'), #'radio', colourable=c('colourable','radio','picker' ) , #'spectrum', 'colorSelectorInput' ), - other=c('radio','picker'), + other=c('picker'), #'radio', other.list=c('radio','picker') )[[colType]] } else { @@ -51,72 +51,109 @@ getPageWidgetDB<-function(pageId ){ getRowWidgetDB<-reactive({ log.fin(getRowWidgetDB) pageId<- input$pages + row<-NULL if(length(pageId>0)){ wdb<-widgetDB() + cat('widgetDB\n') + print(wdb) tibName<-getAssetName() + log.val(tibName) colName<-getTibColumnName() + log.val(colName) row<-filter(wdb, tabId==pageId & name==tibName & column==colName) - + cat('row\n') + print(row) if(nrow(row)!=1){ #something is messed up: not there or multiple occurances # begin patch - if(nrow(row)>1){ # remove multiple occurances - wdb<-filter(wdb, !(tabId==pageId & name==tibName & column==colName)) - } - # and add back a default - colType<-getColumnType() - widgets<-getWidgetChoices() - chosenWidget<-widgets[1] - wdb<-add_row(wdb, - tabId=pageId, name=tibName, - column=colName, type=colType, - minVal=NA, maxVal=NA, - step=1, selectedWidget=chosenWidget - ) - widgetDB(wdb) - row<-filter(wdb, tabId==pageId & name==tibName & column==colName) - } # end of patch + if(nrow(row)>1){ # remove multiple occurances + wdb<-filter(wdb, !(tabId==pageId & name==tibName & column==colName)) + } + cat("wdb\n") + print(wdb) + # and add back a default + colType<-getColumnType() + widgets<-getWidgetChoices() + chosenWidget<-widgets[1] + wdb<-add_row(wdb, + tabId=pageId, name=tibName, + column=colName, type=colType, + minVal=NA, maxVal=NA, + step=1, selectedWidget=chosenWidget + ) + widgetDB(wdb) + row<-filter(wdb, tabId==pageId & name==tibName & column==colName) + } # end of patch log.fout(getRowWidgetDB) - row } - + row }) # TODO: populate handler with rows as needed: newPage or tabChange or ... # TODO: rewrite to update just minVal or maxVal or step or selectedWidget updateWidgetChoicesRow<-function(#tibName, colName, colType, - minVal=NA, maxVal=NA, step=1, selectedWidget='radio'){ # use current tib and col + minVal=NA, maxVal=NA, step=1, selectedWidget){ # use current tib and col + log.fin(updateWidgetChoicesRow) # can we really trust the following? pageId<- input$pages tibName<-getAssetName() colName<-getTibColumnName() + log.fin(selectedWidget) + log.val(pageId) + log.val(tibName) + log.val(colName) - - log.fin(updateWidgetChoicesRow) if(length(pageId)>0){ - + wdb<-widgetDB() + cat('length(',pageId,')>0\n') + print(wdb) rowNo<-which( wdb$tabId==pageId & wdb$name==tibName & wdb$column==colName - ) - if(length(rowNo)==1){ #not much changes, just replace selected (assuming selected in colVal) + ) + isCS<-FALSE + if(length(aux$colChoiceSet)>0 && selectedWidget %in% names(aux$colChoiceSet)){ + columnValues<-getTib() %$$% getTibColumnName() + valueChoices<-aux$colChoiceSet[[selectedWidget]] + isCS<-(length(valueChoices)>0 && length(setdiff(columnValues, valueChoices))==0 ) + if(!isCS){ + cat('if!isCS') + log.val(selectedWidget) + print(columnValues) + print(valueChoices) + + } + } + log.val(isCS) + if(length(rowNo)==1 && !isCS){ #not much changes, just replace selected (assuming selected in colVal) + cat('xxx--\n') nn<-names(match.call()[-1]) for(n in nn){ wdb[[n]][rowNo]<-get(n) } } else { # not there, or multiple rows? + cat('yyy--\n') widgets<-getWidgetChoices() + log.val(widgets) chosenWidget<-selectedWidget #kludge to avoid name clash - if(!chosenWidget %in% widgets){ + log.val(chosenWidget) + if(!isCS && !chosenWidget %in% widgets){ + cat('should not happen\n') chosenWidget<-widgets[1] } + log.val(chosenWidget) + if(isCS){ + colType<-'choiceSet' + log.val(colType) + } tmp<-wdb[!(wdb$tabId==pageId & wdb$name==tibName & wdb$column==colName),] #remove the row why? - wdb<-add_row(wdb, tabId=pageId, name=tibName, column=colName, + wdb<-add_row(tmp, tabId=pageId, name=tibName, column=colName, type=colType , minVal=minVal, maxVal=maxVal, step=step, selectedWidget=chosenWidget) } + print(wdb) widgetDB(wdb) log.fout(updateWidgetChoicesRow) } @@ -130,6 +167,9 @@ getWidgetChoices<-reactive({ tabId<- getTibTabId() tibName<-getAssetName() colName<-getTibColumnName() + cs<-getCompatibleChoicesSets() + widgetChoices<-c(widgetChoices, cs) + log.val(widgetChoices) scriptName<-getPreProcScriptName(tab_Id=tabId, tib_Name=tibName, column_Name=colName) if(getPlotState()=='value' && !is.null(scriptName) ){ widgetChoices<- c( "immutable", widgetChoices) @@ -139,9 +179,20 @@ getWidgetChoices<-reactive({ # called by # serverEdTib init (line 33) -# then moduleEdTib (lines 108, 128), bothconditon by getTibEditState()==TRUE +# then moduleEdTib (lines 108, 128), both by conditon: getTibEditState()==TRUE getWidget<-reactive({ - rtv<-getRowWidgetDB()$selectedWidget + log.fin(getWidget) + log.fin(getTibTabId()) + cat('getWidget returning\n') + db<-getRowWidgetDB() + print(db) + if(nrow(getRowWidgetDB())==1){ + rtv<-getRowWidgetDB()$selectedWidget + }else { + rtv<-NULL + } + print(rtv) + log.fin(getWidget) rtv }) From 320f6ea3b75a46c70cfa87b397c458f08e0c644d Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 31 Dec 2020 15:44:37 -0500 Subject: [PATCH 147/263] cosemetic --- inst/App/rightPanel/header/moduleEdTib.R | 31 +------------------ inst/App/rightPanel/header/serverEdTib.R | 8 ----- .../selector/serverAssetSelection.R | 23 ++------------ inst/App/util/dbInitiatizers.R | 4 --- 4 files changed, 3 insertions(+), 63 deletions(-) diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index 40579d6b..d2821577 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -76,16 +76,6 @@ moduleEdTib<-function(input, output, session, #------------ui ouput---------------------- - #---assets - # output$dataSetUI<-renderUI({ - # if(length(nameChoices())>0){ - # butts<- nameChoices() - # radioGroupButtons(inputId=ns("name"), choices=butts, selected=name(), - # justified=TRUE) - # } - # }) - - #---columns output$columnUI<-renderUI({ @@ -106,20 +96,14 @@ moduleEdTib<-function(input, output, session, #---column values output$widgetChooserUI<-renderUI({ #widgetChoice if( getTibEditState()==TRUE ){ - # cat('--Entering ---widgetChooserUI----------\n') - # cat('--calling ---getWidgetChoices----------\n') choices<-getWidgetChoices() widget<-getWidget() cs<-getChoiceSet4PageName() if(!is.null(cs)){ - # choices<-cs #widget choices widget<-cs #selected widget } if(length(choices )>0 && !is.null(widget)){ - #cat("tabId=",format(input$pages),"\n") - # cat("widgetChooserUI:: choices=c(",paste(choices,collapse=", "),")\n") - # cat('widget=',widget,"\n") div( "class"='ptR2', selectInput(ns("selectedWidget"), label=NULL, choices=choices, selected=widget, width="110px") @@ -130,22 +114,13 @@ moduleEdTib<-function(input, output, session, output$columnEntryUI<-renderUI({ if( getTibEditState()==TRUE ){ - # cat("\nEntering----------output$colEntryUI---------------\n") - # cat("\nInitial value of getRowIndex", format(getRowIndex()), "\n") - # cat('--calling ---getWidget2----------\n') widget<-getWidget() cs<-getChoiceSet4PageName() - # cat("widget=",format(widget),"\n") - # cat("getTibEntry()=",format(getTibEntry()),"\n") - # cat("getTibEntryChoices()=",format(getTibEntryChoices()),"\n") if(!is.null(widget) && !is.null(getTibEntry()) && !is.null(getTibEntryChoices())){ selected<-getTibEntry() - log.val(selected) + # log.val(selected) choices<-getTibEntryChoices() - print(choices) - log.val(widget) if(widget=='slider'){ - # cat('xxx widget=', format(widget),"\n") sliderInput( inputId=ns("entrySlider"),label = NULL, min=0,max = 100, value = as.numeric(selected) ) @@ -230,18 +205,14 @@ moduleEdTib<-function(input, output, session, #---asset name--- observeEvent(c( name(), nameChoices() ), { #update the name if( !is.null(name()) && name()==transformTag ){ - # cat('transformPanelContainer show \n') showElement('transformPanelContainer') } else { - # cat('transformPanelContainer hide \n') hideElement('transformPanelContainer') } if(length(nameChoices())>0 && !is.null(name()) && nchar(name())>0 && !(name() %in% c( transformTag, RPanelTag, errorPanelTag, svgPanelTag)) ){ - # cat('headEdTib show\n') showElement('headEdTib') } else { - # cat('headEdTib hide\n') hideElement('headEdTib') hideElement(ns('headEdTib')) } diff --git a/inst/App/rightPanel/header/serverEdTib.R b/inst/App/rightPanel/header/serverEdTib.R index 830d5934..35f8c99a 100644 --- a/inst/App/rightPanel/header/serverEdTib.R +++ b/inst/App/rightPanel/header/serverEdTib.R @@ -33,11 +33,6 @@ returnValue4ModuleEdTib<-callModule( getChoiceSet4PageName=reactive({ if( getTibEditState()==TRUE ){ widget<-getWidget() - log.val(widget) - ll<-aux$colChoiceSe - cat('returning choiceSet with names\n') - print(names(ll)) - print(ll) if(!is.null(widget) && widget %in% names(aux$colChoiceSet)){ return(widget) } else { @@ -65,9 +60,6 @@ observeEvent(returnValue4ModuleEdTib$selectedWidget(), { if( getTibEditState()==TRUE && length( returnValue4ModuleEdTib$selectedWidget() )>0 ){ log.fin(returnValue4ModuleEdTib$selectedWidget()) selectedWidget<-returnValue4ModuleEdTib$selectedWidget() - log.val(nchar(selectedWidget)) - log.val(selectedWidget) - cat('ModuleEdTib$selectedWidget:: abount to update selectedWidget') updateWidgetChoicesRow( selectedWidget=returnValue4ModuleEdTib$selectedWidget()) log.fout(returnValue4ModuleEdTib$selectedWidget()) } diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 81a4d48f..8a342244 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -105,7 +105,6 @@ resetSelectedTibbleName<-function(tibs, name){ } choices<-getRightPanelChoices() - # cat("resetSelectedTibbleName:: choices=", paste(choices, collapse=", "),"\n") aName<-getAssetName() if( !is.null(aName) && !is.null(getTibRow()) && !is.null(tibs[[aName]]) && getTibRow()0 && length(tib_Name)>0){ - #choiceSetName<-getChoiceSet4PageName( tab_Id, tib_Name, column_Name) choiceSetName<-getWidget() - log.val(choiceSetName) if(length(choiceSetName)>0){ choices<-aux$colChoiceSet[[choiceSetName]] # this is a check to insure consistancy - cat('choices\n') - print(choices) - cat('columnValues\n') - print(columnValues) if(length(choices)>0 && length(setdiff(columnValues, choices))==0 ){ return(choices) } else {#if it the check fails should remove from choiceSetPage - removeChoiceSet4PageName(tab_Id, tib_Name, column_Name) + #removePageWidgetDB(tab_Id) } } } - log.fout(getTibEntryChoices) columnValues }) diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index 96e1e292..b85f88f6 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -17,10 +17,6 @@ initialPreProcPageDB<-function(){ tibble( tabId="bogus", tibName="bogus", colName='bogus', scriptName='bogus')[0,] } -initialChoiceSetPageDB<-function(){ - tibble( tabId="bogus", tibName="bogus", colName='bogus', choiceSetName='bogus')[0,] -} - initialTribbleDB<-function(){ tibble( tabId='bogus', From b9b2ed4c22ee7057cecaeca5fe543ddd530d110b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 31 Dec 2020 15:45:45 -0500 Subject: [PATCH 148/263] removal of final vestiges of choiceDB --- inst/App/fileIO/serverLoadWorkSpace.R | 3 - inst/App/fileIO/serverPage2Workspace.R | 5 +- inst/App/leftPanel/pproj/pprojUtil.R | 1 - .../rightPanel/choiceSet/serverChoiceSetDB.R | 56 ------------------- inst/App/server.R | 1 - 5 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 inst/App/rightPanel/choiceSet/serverChoiceSetDB.R diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index 08759228..a86b5c45 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -137,9 +137,6 @@ restoreWorkSpace<-reactive({ tib<-extractDBFromPages(wsPages, "^fileDescriptor.", initTib=initialFileDescDB() ) fileDescDB(tib) - tib<-extractDBFromPages(wsPages, "^choiceSetPage.", initTib=initialChoiceSetPageDB()) - choiceSetPageDB(tib) - if(!is.null(ptRproj)){ ptRproj$pathToProj<-editOption$currentProjectDirectory ptRproj$projName<-editOption$currentProjectName diff --git a/inst/App/fileIO/serverPage2Workspace.R b/inst/App/fileIO/serverPage2Workspace.R index cb919d3b..1813be9d 100644 --- a/inst/App/fileIO/serverPage2Workspace.R +++ b/inst/App/fileIO/serverPage2Workspace.R @@ -14,8 +14,6 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ dnip<-getPageDnippetsDB(pageId) widg<-getPageWidgetDB(pageId) preprocPage<-getPagePreprocPageDB(pageId) - choiceSetPage<-getChoiceSetPage(pageId) - # print(widg) rtv<-c( fileDescriptor=getFileDescriptor(pageId), code=getCode(), @@ -25,8 +23,7 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ trib=trib, dnip=dnip, widg=widg, - preprocPage=preprocPage, - choiceSetPage=choiceSetPage + preprocPage=preprocPage ) # ppE<-getPreProcPtEntries(pageId) diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index f78651c0..9c1ca8b5 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -33,7 +33,6 @@ closeCurrentProj<-function(){ resetDnippetsDB() preProcScriptDB$points=initialPreProcScriptDB() preProcScriptDB$attrs= initialPreProcScriptDB() - choiceSetPageDB(initialChoiceSetPageDB() ) fileDescDB(initialFileDescDB()) svgGridDB( initialSvgGridDB() ) useTribbleFormatDB( initialTribbleDB() ) diff --git a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R b/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R deleted file mode 100644 index a4c5f37e..00000000 --- a/inst/App/rightPanel/choiceSet/serverChoiceSetDB.R +++ /dev/null @@ -1,56 +0,0 @@ - - -choiceSetPageDB<-reactiveVal( - tibble( tabId="bogus", tibName="bogus", colName='bogus', choiceSetName='bogus')[0,] -) - -observeEvent(choiceSetPageDB(),{ - if(nrow( choiceSetPageDB() )>0){ - enableDMDM(session, 'plotNavBar','Edit Choices') - } else{ - disableDMDM(session, 'plotNavBar',"Edit Choices") - } -}) - -getChoiceSetPage<-function(pageId){ - db<-choiceSetPageDB() - filter(db, tabId==pageId ) -} - -getChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name){ - if(any(sapply(c(tab_Id, tib_Name, column_Name), is.null)) - || tab_Id=='bogus') - { - return( NULL) - } - csDB<-choiceSetPageDB() - csDB<-filter(csDB, - tabId==tab_Id &tibName==tib_Name & colName==column_Name - ) - if(nrow(csDB)>0){ - csDB$choiceSetName - } else { - NULL - } -} - -setChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name, choiceSet_Name){ - csDB<-choiceSetPageDB() - csDB<-filter(csDB, !(tabId==tab_Id & - tibName==tib_Name & - colName==column_Name ) - ) - if(!is.null(choiceSet_Name)){ - csDB<-rbind(csDB, tibble(tabId=tab_Id, tibName=tib_Name, colName=column_Name, choiceSetName=choiceSet_Name)) - } - choiceSetPageDB(csDB) -} - -removeChoiceSet4PageName<-function(tab_Id, tib_Name, column_Name, choiceSet_Name){ - csDB<-choiceSetPageDB() - csDB<-filter(csDB, !(tabId==tab_Id & - tibName==tib_Name & - colName==column_Name ) - ) - choiceSetPageDB(csDB) -} \ No newline at end of file diff --git a/inst/App/server.R b/inst/App/server.R index 598705a9..2bc6d041 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -83,7 +83,6 @@ shinyServer(function(input, output,session) { #------------------rightPanel-------------------------------- source("rightPanel/selector/serverAssetSelectionDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcDB.R", local=TRUE) - source("rightPanel/choiceSet/serverChoiceSetDB.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsInsert.R", local=TRUE) source("rightPanel/preProc/serverPreProcPtsMove.R", local=TRUE) source("rightPanel/preProc/serverPreProcMatMove.R", local=TRUE) From 51e54f45cd36ccdbf0e6a529f33df8979e479a94 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 31 Dec 2020 15:47:02 -0500 Subject: [PATCH 149/263] file naming for validation --- .../App/rightPanel/choiceSet/modalChoiceSet.R | 14 +- inst/App/rightPanel/menu/cmdNewAsset.R | 9 +- inst/App/rightPanel/menu/cmdNewColumn.R | 28 +--- .../rightPanel/selector/serverWidgetHandler.R | 125 ++++++++---------- inst/App/util/utilptR.R | 18 +++ 5 files changed, 85 insertions(+), 109 deletions(-) diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index 0bc91849..c30e88a8 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -37,8 +37,9 @@ modalCustColumnEditor <- function( custColumnName, value="TRUE\nFALSE" ) { observeEvent(input$modalCustColumnName,{ CustColumnName<-input$modalCustColumnName - if(length(CustColumnName)==0 || nchar(CustColumnName)<6){ - hideElement("modalCustColumnEditorCommitOk") + #if(length(CustColumnName)==0 || nchar(CustColumnName)<6 || CustColumnName %in% names(allWidgetChoices)){ + if(!goodName(CustColumnName,5) || CustColumnName %in% allWidgetNames){ + hideElement("modalCustColumnEditorCommitOk") } else { showElement("modalCustColumnEditorCommitOk") } @@ -80,15 +81,6 @@ observeEvent( input$modalCustColumnEditorCommitOk,{ removeModal() }) -choiceSetPageDB<-reactiveVal( - tibble( tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus')[0,] -) - - -populateChoiceSetEditMenu<-function(choice){ - # append tabId="bogus", tibName="bogus", colName='bogus', colChoiceSet='bogus' to choiceSetPageDB -} - aux<-reactiveValues(colChoiceSet=list()) getChoiceSetElements<-function(name){ diff --git a/inst/App/rightPanel/menu/cmdNewAsset.R b/inst/App/rightPanel/menu/cmdNewAsset.R index 9e28c621..0bf65357 100644 --- a/inst/App/rightPanel/menu/cmdNewAsset.R +++ b/inst/App/rightPanel/menu/cmdNewAsset.R @@ -21,14 +21,17 @@ addNewAssetModal <- function(errMssg=NULL) { observeEvent(input$commitNewAsset, { #checks - if(!grepl(pattern = "^[[:alpha:]]", input$modalAssetName)){ # check name syntax + #if(!grepl(pattern = "^[[:alpha:]]", input$modalAssetName)){ # check name syntax + newAssetName<-input$modalAssetName + + forbidden<-c(names(getPtDefs()$tib), 'svgPanel', 'RPanel') + if(!goodRName(newAssetName ) ){ # check name syntax showModal(addNewAssetModal( errMssg="Invalid Asset Name: must begin with a character") ) - } else if( input$modalAssetName %in% names(getPtDefs()$tib )){ # check name uniqueness + } else if( newAssetName %in% forbidden ){ # check name uniqueness showModal(addNewAssetModal( errMssg="Invalid Asset Name: this name is already taken!") ) } else { #add name to tib newPtDefs<-getPtDefs() - newAssetName<-input$modalAssetName newPtDefs$tib[[newAssetName]]<-tibble(points=list(matrix(0,2,0))) newPtDefs$mats[newAssetName]<-input$modalAssetType=='matrix' diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index eaaa12cc..0ab53277 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -73,7 +73,8 @@ is.Non.Blank.Value<-reactiveVal(FALSE) observeEvent(input$modalAttrName,{ str<-input$modalAttrName - is.Non.Blank.Name(nchar(str)>0) + goodName(str) + #is.Non.Blank.Name(nchar(str)>0) }) observeEvent(input$modalAttrValue,{ str<-input$modalAttrValue @@ -143,7 +144,8 @@ observeEvent(input$commitNewCol, { treatAs<-input$modalColTreatAs newVal<-input$modalAttrValue #checks - if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ + # $if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ + if(!goodRName(input$modalAttrName)){ # check name syntax showModal(addNewColModal( errMssg="Invalid Column Name: must begin with a character", treatAsSelect=treatAs) ) } else if( input$modalAttrName %in% names(getTib()) ){ @@ -212,7 +214,6 @@ observeEvent(input$commitNewCol, { sender='cmd.add.column' #set the column to use specified script setPreProcScriptName(tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, script_Name=script_Name) - # updateAceExtDef(newPtDefs, sender=sender, selector=list( name=newColName ) ) #NO! THIS UPDATE CAN CAUSE MESSAGING LOOP }, error=function(e){ e<-c('preproErr',e) err<-paste(unlist(e), collapse="\n", sep="\n") @@ -224,38 +225,17 @@ observeEvent(input$commitNewCol, { # restrict that value is restiricted to this list colSet_Name<-input$modalColChooserSet #To do: perform additional checks !!! - #setChoiceSet4PageName( tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, choiceSet_Name=colSet_Name) log.val(colSet_Name) - cat('*******************cmdNewColumn about to call updateWidgetChoicesRow************************\n') # populate widgetDB db<-widgetDB() - cat('db1=\n') - print(db) pageId<- input$pages - log.val(pageId) tibName<-getAssetName() - log.val(tibName) columnName<-input$modalAttrName - log.val(columnName) - log.val(colSet_Name) db1<-db - cat('db1=\n') - print(db1) - add_row(db, tabId=pageId, name=tibName, column=columnName, - type='choiceSet' , minVal=NA, maxVal=NA, step=1, selectedWidget=colSet_Name) db2<-tibble_row( tabId=pageId, name=tibName, column=columnName, type='choiceSet' , minVal=NA, maxVal=NA, step=1, selectedWidget=colSet_Name) - cat('db2=\n') - print(db2) db3<-bind_rows(db1,db2) - #tibble(tabId='Tab0', name='x',column='y',type='character',minVal=NA, maxVal=NA,step=1, selectedWidget='radio')[0,] - cat('db3=\n') - print(db3) widgetDB(db3) - cat("*********ouch***********************") - db<-widgetDB() - cat('db3=\n') - print(db) } if(treatAs=='number'){ newVal<-as.numeric(newVal) diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index cf6331f7..67e16f4b 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -10,28 +10,31 @@ removePageWidgetDB<-function(pageId){ widgetDB(db) } +allWidgetChoices<-list( + point=c('radio','picker'), + character=c('radio','picker'), #'switch', 'toggle'), + character.list= c('radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range + character.list.2= c('picker','slider','radio'), #, "multiInput", 'picker', 'checkbox'), #range + character.list.vec= c('picker','radio'), #, "multiInput", 'picker', 'checkbox'), #range + #percentage, percentage.list.2 + integer=c('picker','slider', "numeric"), #'radio','knob' + numeric=c('picker','slider', "numeric"), #,'knob' + numeric.list=c('picker'), #,'slider', "numeric"), #'radio',,'knob' + numeric.list.2=c('slider'), #,'knob' + integer.list.2=c('slider'), + numeric.list.vec=c('picker'), #,'slider', "numeric"), #'radio',,'knob' + integer.list.vec=c('picker'), #,'slider', "numeric"), #radio', + integer.list=c('picker'), #'radio', + colourable=c('colourable','radio','picker' ) , #'spectrum', 'colorSelectorInput' ), + other=c('picker'), #'radio', + other.list=c('radio','picker') +) + +allWidgetNames<-unique(unlist(allWidgetChoices)) type2WidgetChoices<-function(colType){ if(!is.null(colType)){ - choices<-list( - point=c('radio','picker'), - character=c('radio','picker'), #'switch', 'toggle'), - character.list= c('radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range - character.list.2= c('picker','slider','radio'), #, "multiInput", 'picker', 'checkbox'), #range - character.list.vec= c('picker','radio'), #, "multiInput", 'picker', 'checkbox'), #range - #percentage, percentage.list.2 - integer=c('picker','slider', "numeric"), #'radio','knob' - numeric=c('picker','slider', "numeric"), #,'knob' - numeric.list=c('picker'), #,'slider', "numeric"), #'radio',,'knob' - numeric.list.2=c('slider'), #,'knob' - integer.list.2=c('slider'), - numeric.list.vec=c('picker'), #,'slider', "numeric"), #'radio',,'knob' - integer.list.vec=c('picker'), #,'slider', "numeric"), #radio', - integer.list=c('picker'), #'radio', - colourable=c('colourable','radio','picker' ) , #'spectrum', 'colorSelectorInput' ), - other=c('picker'), #'radio', - other.list=c('radio','picker') - )[[colType]] + choices<-allWidgetChoices[[colType]] } else { choices<-NULL } @@ -54,30 +57,25 @@ getRowWidgetDB<-reactive({ row<-NULL if(length(pageId>0)){ wdb<-widgetDB() - cat('widgetDB\n') - print(wdb) tibName<-getAssetName() - log.val(tibName) colName<-getTibColumnName() - log.val(colName) row<-filter(wdb, tabId==pageId & name==tibName & column==colName) - cat('row\n') - print(row) - if(nrow(row)!=1){ #something is messed up: not there or multiple occurances - # begin patch - if(nrow(row)>1){ # remove multiple occurances + widgets<-getWidgetChoices() + if(nrow(row)!=1 || !(row$selectedWidget %in% widgets) ){ # begin patch + if(nrow(row)>0){ # remove any existing rowss wdb<-filter(wdb, !(tabId==pageId & name==tibName & column==colName)) } - cat("wdb\n") - print(wdb) # and add back a default colType<-getColumnType() - widgets<-getWidgetChoices() + #widgets<-getWidgetChoices() chosenWidget<-widgets[1] + if(chosenWidget %in% aux$colChoiceSet){ + colType<-'choiceSet' + } wdb<-add_row(wdb, tabId=pageId, name=tibName, column=colName, type=colType, - minVal=NA, maxVal=NA, + minVal=NA, maxVal=NA, # may need to rethink these NA's step=1, selectedWidget=chosenWidget ) widgetDB(wdb) @@ -99,16 +97,9 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, pageId<- input$pages tibName<-getAssetName() colName<-getTibColumnName() - log.fin(selectedWidget) - log.val(pageId) - log.val(tibName) - log.val(colName) - if(length(pageId)>0){ wdb<-widgetDB() - cat('length(',pageId,')>0\n') - print(wdb) rowNo<-which( wdb$tabId==pageId & wdb$name==tibName & @@ -119,32 +110,20 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, columnValues<-getTib() %$$% getTibColumnName() valueChoices<-aux$colChoiceSet[[selectedWidget]] isCS<-(length(valueChoices)>0 && length(setdiff(columnValues, valueChoices))==0 ) - if(!isCS){ - cat('if!isCS') - log.val(selectedWidget) - print(columnValues) - print(valueChoices) - - } } - log.val(isCS) if(length(rowNo)==1 && !isCS){ #not much changes, just replace selected (assuming selected in colVal) - cat('xxx--\n') nn<-names(match.call()[-1]) for(n in nn){ wdb[[n]][rowNo]<-get(n) } } else { # not there, or multiple rows? - cat('yyy--\n') widgets<-getWidgetChoices() - log.val(widgets) chosenWidget<-selectedWidget #kludge to avoid name clash log.val(chosenWidget) if(!isCS && !chosenWidget %in% widgets){ - cat('should not happen\n') + # cat('should not happen\n') chosenWidget<-widgets[1] } - log.val(chosenWidget) if(isCS){ colType<-'choiceSet' log.val(colType) @@ -153,7 +132,6 @@ updateWidgetChoicesRow<-function(#tibName, colName, colType, wdb<-add_row(tmp, tabId=pageId, name=tibName, column=colName, type=colType , minVal=minVal, maxVal=maxVal, step=step, selectedWidget=chosenWidget) } - print(wdb) widgetDB(wdb) log.fout(updateWidgetChoicesRow) } @@ -168,7 +146,7 @@ getWidgetChoices<-reactive({ tibName<-getAssetName() colName<-getTibColumnName() cs<-getCompatibleChoicesSets() - widgetChoices<-c(widgetChoices, cs) + widgetChoices<-c(widgetChoices,cs) #prioritize cs log.val(widgetChoices) scriptName<-getPreProcScriptName(tab_Id=tabId, tib_Name=tibName, column_Name=colName) if(getPlotState()=='value' && !is.null(scriptName) ){ @@ -181,26 +159,31 @@ getWidgetChoices<-reactive({ # serverEdTib init (line 33) # then moduleEdTib (lines 108, 128), both by conditon: getTibEditState()==TRUE getWidget<-reactive({ - log.fin(getWidget) - log.fin(getTibTabId()) - cat('getWidget returning\n') - db<-getRowWidgetDB() - print(db) - if(nrow(getRowWidgetDB())==1){ - rtv<-getRowWidgetDB()$selectedWidget - }else { - rtv<-NULL + # log.fin(getWidget) + + rdb<-getRowWidgetDB() + + + if(nrow(rdb)==1){ #look ok so far + selectedWidget<-rdb$selectedWidget + # check if compatible: looping issue when changing to new tab + # if(!is.null(selectedWidget) && selectedWidget %in% names(aux$colChoiceSet ) ){ + # columnValues<-getTib() %$$% getTibColumnName() + # valueChoices<-aux$colChoiceSet[[selectedWidget]] + # isCS<-(length(valueChoices)>0 && length(setdiff(columnValues, valueChoices))==0 ) + # if(!isCS){ + # selectedWidget<-NULL #or first choice? + # } + # } + } else { + selectedWidget<-NULL } - print(rtv) - log.fin(getWidget) - rtv + + # log.fin(getWidget) + selectedWidget }) -# getWidgetVal<-reactive({ -# tabId<-input$pages -# # row<-filter(handler$choices, tabId==tabId, name==getAssetName(), column==getTibColumnName()) -# row<-filter(widgetDB(), tabId==tabId & name==getAssetName() & column==getTibColumnName()) -# }) + getPointMax<-reactive({ selectedTabId<-getTibTabId() diff --git a/inst/App/util/utilptR.R b/inst/App/util/utilptR.R index 4b7cc67d..26d6a518 100755 --- a/inst/App/util/utilptR.R +++ b/inst/App/util/utilptR.R @@ -1,3 +1,21 @@ +# enforce naming convention +goodName<-function(s, n=1){ + if(length(s)==1 && typeof(s)=='character' && nchar(s)>=n){ + grepl('^[[:alpha:]][[:alnum:]]*$', s) + } else{ + FALSE + } +} + + +goodRName<-function(s, n=1){ + if(length(s)==1 && typeof(s)=='character' && nchar(s)>=n){ + grepl('^[[:alpha:]\\.][[:alnum:]\\.]*$', s) + } else{ + FALSE + } +} + #returns col indices of tib corresponding to points # used by serverAssetSellection.R and serverAssetSellectionDB.R From e8b32a2a108ed80b10d95b9fce1bf406006f947d Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 31 Dec 2020 15:49:05 -0500 Subject: [PATCH 150/263] bump version --- DESCRIPTION | 4 ++-- LICENSE.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5f3eb1d7..83b20ffb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: pointR Type: Package -Date: 2019-12-30 +Date: 2021-01-02 Title: pointR -Version: 0.4.5 +Version: 0.4.6 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR diff --git a/LICENSE.txt b/LICENSE.txt index a1b0d47c..61f0c97d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ NOTICE -Copyright (c) 2020 M. S. Legrand. All rights reserved +Copyright (c) 2021 M. S. Legrand. All rights reserved The pointR package as a whole is distributed under the GPL-3 License, GNU GENERAL PUBLIC LICENSE version 3, see below. From 40505cdc4471e148f34d4b044bc0c69b4282c76d Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 4 Jan 2021 18:53:47 -0500 Subject: [PATCH 151/263] pruning dead rows from widgetDB --- .../mid/serverMessageFromAcePageIn.R | 1 + .../rightPanel/selector/serverWidgetHandler.R | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/inst/App/leftPanel/mid/serverMessageFromAcePageIn.R b/inst/App/leftPanel/mid/serverMessageFromAcePageIn.R index 10be8954..051ff591 100644 --- a/inst/App/leftPanel/mid/serverMessageFromAcePageIn.R +++ b/inst/App/leftPanel/mid/serverMessageFromAcePageIn.R @@ -12,6 +12,7 @@ processMssgFromAceMssgPageIn<-function(sender, mssg){ # cat('getAssetName()=', format(getAssetName()), "\n") } tibs<-getPtDefs()$tib + pruneDeadRowsFromWidgetDB() resetSelectedTibbleName(tibs=tibs, name=name) } else { # else covers: 'cmd.tabChange', # 'cmd.file.new', 'cmd.openFileNow', diff --git a/inst/App/rightPanel/selector/serverWidgetHandler.R b/inst/App/rightPanel/selector/serverWidgetHandler.R index 67e16f4b..f2f832eb 100644 --- a/inst/App/rightPanel/selector/serverWidgetHandler.R +++ b/inst/App/rightPanel/selector/serverWidgetHandler.R @@ -15,9 +15,9 @@ allWidgetChoices<-list( character=c('radio','picker'), #'switch', 'toggle'), character.list= c('radio','picker'), #, "multiInput", 'picker', 'checkbox'), #range character.list.2= c('picker','slider','radio'), #, "multiInput", 'picker', 'checkbox'), #range - character.list.vec= c('picker','radio'), #, "multiInput", 'picker', 'checkbox'), #range + character.list.vec= c('picker'), #, "multiInput", 'picker', 'checkbox'), #range #percentage, percentage.list.2 - integer=c('picker','slider', "numeric"), #'radio','knob' + integer=c('slider', "numeric", 'picker'), #'radio','knob' numeric=c('picker','slider', "numeric"), #,'knob' numeric.list=c('picker'), #,'slider', "numeric"), #'radio',,'knob' numeric.list.2=c('slider'), #,'knob' @@ -201,4 +201,23 @@ getPointMax<-reactive({ } }) +# tibble(tabId='Tab0', name='x',column='y',type='character',minVal=NA, maxVal=NA,step=1, selectedWidget='radio') +pruneDeadRowsFromWidgetDB<-function(){ + db<-widgetDB() + tibs<-getPtDefs()$tib + if(nrow(db)>0){ + v<-unlist(pmap(db, function(tabId, name, column, type, minVal, maxVal, step, selectedWidget){ + # print(getTibTabId()) + # print(column) + # print(name) + # print(names(tibs[[name]])) + tabId!= getTibTabId() || + (name %in% names(tibs) && column %in% names(tibs[[name]])) + })) + + db<-filter(db, v) + } + widgetDB(db) +} + From c4c2fd05c90e730f7e9fc539fc85b139b1aa1786 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 4 Jan 2021 18:54:50 -0500 Subject: [PATCH 152/263] fix bug with integer type --- inst/App/rightPanel/menu/cmdNewColumn.R | 43 +++++++++++++++++++------ 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 0ab53277..7a13f1bc 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -1,8 +1,13 @@ #--------NEW COLUMN------------------------------ -addNewColModal <- function(errMssg=NULL, treatAsSelect='string') { - log.val(treatAsSelect) +addNewColModal <- function(errMssg=NULL, init=TRUE, treatAsSelect='string') { + #log.val(treatAsSelect) + if(init){ + is.Non.Blank.Name(FALSE) + is.Non.Blank.Value(FALSE) + } + doOk<-"shinyjs.triggerButtonOnEnter(event,\"commitNewCol\")" ppscriptChoices<-unique(preProcScriptDB$attrs$scriptName) colChoices<-names(aux$colChoiceSet) @@ -16,6 +21,7 @@ addNewColModal <- function(errMssg=NULL, treatAsSelect='string') { if(length(aux$colChoiceSet)>0){ choices<-c(choices,list('using a choice set'='choiceSet')) } + modalDialog( size='l', onkeypress=doOk, @@ -73,9 +79,15 @@ is.Non.Blank.Value<-reactiveVal(FALSE) observeEvent(input$modalAttrName,{ str<-input$modalAttrName - goodName(str) - #is.Non.Blank.Name(nchar(str)>0) + if(goodName(str) && !(str %in% c( names(getTib()), 'svgPanel', 'RPanel' ) )){ + is.Non.Blank.Name(TRUE) + # showElement('modalColTreatAsDiv') + } else { + is.Non.Blank.Name(FALSE) + } + # is.Non.Blank.Name(nchar(str)>0) }) + observeEvent(input$modalAttrValue,{ str<-input$modalAttrValue is.Non.Blank.Value(nchar(str)>0) @@ -88,14 +100,18 @@ observeEvent(input$modalColChooserSet,{ }) -observeEvent(c(is.Non.Blank.Name(),input$modalColTreatAs, is.Non.Blank.Value() ),{ +observeEvent(c(is.Non.Blank.Name(),input$modalColTreatAs, is.Non.Blank.Value() , input$modalAttrValue),{ if( is.Non.Blank.Name()){ showElement('modalColTreatAsDiv') - if( !(input$modalColTreatAs %in% c('string','number','expression')) || is.Non.Blank.Value() ){ + if( !(input$modalColTreatAs %in% c('string','number','expression')) || + (is.Non.Blank.Value() && input$modalColTreatAs!='number') || + isNumericString(input$modalAttrValue) + ){ showElement('commitNewCol') } else { hideElement('commitNewCol') } + if(input$modalColTreatAs=='points'){ hideElement('modalAttrValue') hideElement('modalColPreProcScript') @@ -125,11 +141,20 @@ observeEvent(c(is.Non.Blank.Name(),input$modalColTreatAs, is.Non.Blank.Value() ) hideElement('modalColChooserValue') hideElement('commitNewCol') } - }) + +# observeEvent(input$cancel, { +# # set as blank? modalAttrValue +# hideElement('modalAttrValue') +# hideElement('modalColPreProcScript') +# hideElement('modalColChooserSet') +# hideElement('modalColChooserValue') +# removeModal() #close dialog +# }) + observeEvent(input$commitNewCol, { badExpr<-function(txt){ @@ -144,8 +169,8 @@ observeEvent(input$commitNewCol, { treatAs<-input$modalColTreatAs newVal<-input$modalAttrValue #checks - # $if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ - if(!goodRName(input$modalAttrName)){ + if(!grepl(pattern = "^[[:alpha:]]", input$modalAttrName)){ + #if(!goodRName(input$modalAttrName)){ # check name syntax showModal(addNewColModal( errMssg="Invalid Column Name: must begin with a character", treatAsSelect=treatAs) ) } else if( input$modalAttrName %in% names(getTib()) ){ From f13ee3cc9cf29e0411df0bcd80720266ead38665 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 5 Jan 2021 17:16:36 -0500 Subject: [PATCH 153/263] bug fix, choics =>cs --- inst/App/rightPanel/selector/serverAssetSelection.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/selector/serverAssetSelection.R b/inst/App/rightPanel/selector/serverAssetSelection.R index 8a342244..81285683 100644 --- a/inst/App/rightPanel/selector/serverAssetSelection.R +++ b/inst/App/rightPanel/selector/serverAssetSelection.R @@ -297,13 +297,13 @@ getTibMatColChoices<-reactive({ }) getCompatibleChoicesSets<-reactive({ - choices<-aux$colChoiceSet + cs<-aux$colChoiceSet columnValues<-getTib() %$$% getTibColumnName() if(length(cs)>0 && length(columnValues)>0){ fn<-function(choices){ length(choices)>0 && length(setdiff(columnValues, choices))==0 } - names(Filter(fn,choices)) + names(Filter(fn,cs)) } else { NULL } From 20ae334a2899bcb9216f5b974ab951422aad6246 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:33:10 -0500 Subject: [PATCH 154/263] added predoc to request added theBlocks, theEnvList, getEnvList, getWDCmd --- inst/App/leftPanel/serverRequest.R | 41 +++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/serverRequest.R b/inst/App/leftPanel/serverRequest.R index 00fd5264..80a66cab 100644 --- a/inst/App/leftPanel/serverRequest.R +++ b/inst/App/leftPanel/serverRequest.R @@ -1,12 +1,43 @@ theCode<-reactiveVal("") +theBlocks<-reactiveVal(NULL) +theEnvList<-reactiveVal(list()) #or NULL? request<-reactiveValues( sender=NULL, tabs=NULL, - trigger=0 + trigger=0, + predoc="" ) +getWDCmd<-reactive({ + log.fin(getWDCmd) + dpath<-getDirPath() + log.val(dpath) + if(identical(dpath, '~/.ptR')){ + dpath<-'~' + } + dd<-paste0('\nsetwd("',dpath,'")\n\n') + log.fout(getWDCmd) + dd +}) + + +getEnvList<-reactive({ + wd<-getWDCmd() + pcode<-theBlocks() + if(!is.null(pcode) && pcode!=""){ + pcode=paste(wd,pcode ) + initialEnv=new.env() + eval(parse(text=pcode),initialEnv) + envlist<-as.list(initialEnv) + } else { + envlist<-list() + } + envlist +}) + + trigger<-reactiveValues( @@ -70,6 +101,14 @@ popTab<-reactive({ tab }) +setBlocks<-function(blocks){ + theBlocks(blocks) +} + +getBlocks<-reactive({ + theBlocks() +}) + setCode<-function(code){ theCode(code) } From f092e02e5698d416de988c1bdd0352bd40230097 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:35:41 -0500 Subject: [PATCH 155/263] adding getEnvList to replace new.env() --- inst/App/rightPanel/mid/moduleSVGR.R | 5 +++-- inst/App/rightPanel/mid/serverPlotBarPoints.R | 1 + inst/App/rightPanel/mid/serverPlotBarSVG.R | 1 + inst/App/rightPanel/mid/serverPlotBarTagDrag.R | 1 + inst/App/rightPanel/mid/serverPlotBarTagValues.R | 1 + inst/App/rightPanel/mid/serverPlotBarTransform.R | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/mid/moduleSVGR.R b/inst/App/rightPanel/mid/moduleSVGR.R index 60b7ebcc..fba4efa1 100644 --- a/inst/App/rightPanel/mid/moduleSVGR.R +++ b/inst/App/rightPanel/mid/moduleSVGR.R @@ -25,7 +25,8 @@ svgToolsScript<-function(type){ getSVGWH, getSvgGrid, getBackDrop, - getCode, + getCode, + getEnvList, getErrorMssg, getTibNRow, # doesnot appear getDirPath @@ -98,7 +99,7 @@ svgToolsScript<-function(type){ wd<-paste0('\nsetwd("',dpath,'")\n\n') parsedCode<-parse(text=paste0(wd,codeTxt)) - svg<-eval(parsedCode, new.env() ) + svg<-eval(parsedCode, getEnvList() ) w<-svg$root$getAttr('width') h<-svg$root$getAttr('height') rtv$WH<-c(w,h) diff --git a/inst/App/rightPanel/mid/serverPlotBarPoints.R b/inst/App/rightPanel/mid/serverPlotBarPoints.R index 64821360..af141bfc 100755 --- a/inst/App/rightPanel/mid/serverPlotBarPoints.R +++ b/inst/App/rightPanel/mid/serverPlotBarPoints.R @@ -128,6 +128,7 @@ statusPlotPoint<-callModule( getSvgGrid, getBackDrop, getCode4Rendering, + getEnvList=getEnvList, getErrorMssg, getTibNRow=getTibNRow, getDirPath=getDirPath diff --git a/inst/App/rightPanel/mid/serverPlotBarSVG.R b/inst/App/rightPanel/mid/serverPlotBarSVG.R index 1d923558..a387e5ae 100644 --- a/inst/App/rightPanel/mid/serverPlotBarSVG.R +++ b/inst/App/rightPanel/mid/serverPlotBarSVG.R @@ -16,6 +16,7 @@ statusPlotSVG<-callModule( getSvgGrid, getBackDrop, getCode4Rendering, + getEnvList=getEnvList, getErrorMssg, getTibNRow=getTibNRow, getDirPath=getDirPath diff --git a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R index 51e77cf9..27935324 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R @@ -114,6 +114,7 @@ statusPlotTagDrag<-callModule( getSvgGrid=getSvgGrid, getBackDrop=getBackDrop, getCode= getCode4Rendering, + getEnvList=getEnvList, getErrorMssg=getErrorMssg, getTibNRow=getTibNRow, getDirPath=getDirPath diff --git a/inst/App/rightPanel/mid/serverPlotBarTagValues.R b/inst/App/rightPanel/mid/serverPlotBarTagValues.R index ffb8e494..3a46ac51 100755 --- a/inst/App/rightPanel/mid/serverPlotBarTagValues.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagValues.R @@ -103,6 +103,7 @@ statusPlotTagVal<-callModule( getSvgGrid, getBackDrop, getCode4Rendering, + getEnvList=getEnvList, getErrorMssg, getTibNRow=getTibNRow, getDirPath=getDirPath diff --git a/inst/App/rightPanel/mid/serverPlotBarTransform.R b/inst/App/rightPanel/mid/serverPlotBarTransform.R index 9befadd0..eee24ac3 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTransform.R +++ b/inst/App/rightPanel/mid/serverPlotBarTransform.R @@ -16,6 +16,7 @@ statusPlotTransform<-callModule( getSvgGrid, getBackDrop, getCode = getCode4RenderingTransform, + getEnvList=getEnvList, getErrorMssg, getTibNRow=getTibNRow, getDirPath=getDirPath From daf3a11d5d92e5bab31ba182f5721f7c7b8d4b95 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:37:20 -0500 Subject: [PATCH 156/263] adding aceReplaceBlock, updateRmdDependents, and preDoc --- inst/App/www/Acejs/aceExt.js | 127 ++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 1c659686..07836df3 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -93,6 +93,60 @@ function getAceMode(ed){ mode = mode.substr(mode.lastIndexOf('/') + 1); return mode; } + +function aceReplaceBlock(link, txt){ + let res=link.split("."); + let aceId=res[0]; + let rid=res[1]; + console.log('++++++++++++ aceId='+aceId); + console.log('++++++++++++ rid='+rid); + console.log('abcdefg-----------1--------------'); + let editor=$('#'+aceId).data('aceEditor'); + console.log('abcdefg-----------2--------------'); + let session =editor.getSession(); + console.log('abcdefg-----------3--------------'); + let anchors=session.anchors; + console.log('abcdefg-----------4--------------'); + console.log(JSON.stringify(anchors)); + let preDoc=null; + if( + (typeof editor.getSession().anchors !='undefined') && + (typeof editor.getSession().anchors[rid] !='undefined') + ){ + console.log('abcdefg-----------5--------------'); + let anc1 =editor.getSession().anchors[rid].anc1; + let anc2 =editor.getSession().anchors[rid].anc2; + if(!!anc1 && !!anc2){ + let Range = ace.require('ace/range').Range; + console.log('abcdefg-----------6--------------'); + let row1 = anc1.getPosition().row; + console.log('abcdefg-----------7--------------'); + let row2 = anc2.getPosition().row; + let prernge = new Range(0, 0, row1-1, Infinity); // assumes that row1>0 + preDoc=session.getTextRange(prernge); + console.log('abcdefg-----------8--------------'); + row1=row1+1; + row2=row2-1; + console.log('abcdefg-----------9--------------'); + // select range + console.log('row1='+row1+' row2='+row2); + + let rnge = new Range(row1, 0, row2, Infinity); + console.log('abcdefg-----------10--------------'); + console.log(JSON.stringify(rnge)); + // replace text in range + console.log('abcdefg-----------11--------------'); + session.replace(rnge,txt); + console.log('abcdefg-----------12--------------'); + + session.getUndoManager().setOk(); + } + } else { + console.log('anchor['+rid+'] not found'); + } + return preDoc; +} + /* function getSaveStatus(ed){ if(! ud.canUndo() ){ @@ -180,6 +234,46 @@ Shiny.addCustomMessageHandler( console.log('editor is null'); return false; } + + if(!!data.updateRmdDependents){ + $('.shiny-ace').each(function(){ + let lid=this.id; + console.log('lid='+lid); + let editr = $('#'+lid).data('aceEditor'); + if(!!editr.getSession().link ){ + let link=editr.getSession().link; + console.log('link is:'+JSON.stringify(link)); + if(link.length !== undefined){ + let res=link[0].split("."); + let aceId=res[0]; + let rid=res[1]; + if(aceId==id){ + console.log('found ace='+aceId+'with anchor='+ rid); + // select the range for rid in the rmd and copy over + console.log('anchors='+JSON.stringify(editor.getSession().anchors )); + if(!!editor.getSession().anchors ){ + let anc1 =editor.getSession().anchors[rid].anc1; + let anc2 =editor.getSession().anchors[rid].anc2; + // if both defined, get section + if(!!anc1 && !!anc2){ + let Range = ace.require('ace/range').Range; + + let row1 = anc1.getPosition().row; + let row2 = anc2.getPosition().row; + console.log('row1='+JSON.stringify( row1) +" row2="+JSON.stringify(row2) ); + let xrng = new Range(row1+1, 0, row2-1, Infinity); // assumes that row1>0 + console.log('xrng='+JSON.stringify(xrng) ) + let selTxt=editor.getSession().getTextRange(xrng); + console.log(JSON.stringify(selTxt)) + editr.getSession().setValue(selTxt); + } + } + } //aceId + } //link.length + }//!!editr.getSession().link + }); + } + //-------------updateAll handlers--------------- if(sender=='updateAll'){ if(!!data.fontSize){ @@ -215,7 +309,7 @@ Shiny.addCustomMessageHandler( var auxValue=""; - var HighlightedLines; + //var HighlightedLines; var aceMode = editor.getSession().$modeId; aceMode = aceMode.substr(aceMode.lastIndexOf('/') + 1); @@ -479,6 +573,7 @@ Shiny.addCustomMessageHandler( // editor.getSession().clearBreakpoints(); //} + Shiny.onInputChange('messageFromAce', { code : editor.getSession().getValue(), @@ -502,6 +597,7 @@ Shiny.addCustomMessageHandler( //} } */ + if(!!data.rollBack){ ud=editor.getSession().getUndoManager(); if( ud.$ok.length>0 ){ // only replace if we can roll back to a good state @@ -514,6 +610,34 @@ Shiny.addCustomMessageHandler( auxValue=data.auxValue; } + preDoc=""; + if(!!editor.getSession().link){ + let link= editor.getSession().link + //if(typeof link =='array') + console.log('*******link*********') + console.log("link="+JSON.stringify(link)) + console.log("link.length="+JSON.stringify(link.length)) + if(link.length !== undefined){ + let targetAceId=link[0] + console.log('****adskfjalsufhlaiufhsia&&&&&&&&77') + if(typeof targetAceId !=undefined){ + console.log('****adskfjalsufhla666666666iufhsia&&&&&&&&77') + console.log(JSON.stringify(link[0])); + let text = editor.getSession().getValue(); + console.log('****adskfjalsufhl8888888888888888hsia&&&&&&&&77') + preDoc=aceReplaceBlock(targetAceId, text); // should replace only if text does not match block + } + + // get targetEditor + // get targetSession.canchors + // select target beteen canchors + // set text in that region + + // + } + + + } Shiny.onInputChange('messageFromAce', { @@ -524,6 +648,7 @@ Shiny.addCustomMessageHandler( mode: aceMode, isSaved: ud.isSaved(), auxValue: auxValue, + preDoc: preDoc, rnd : randomString(5) }); } From 1c52875bb7ff147167f608a74e55d7f0a47307c4 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:38:06 -0500 Subject: [PATCH 157/263] change to .ace_highlight-marker --- inst/App/www/Acejs/shinyAce.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/www/Acejs/shinyAce.css b/inst/App/www/Acejs/shinyAce.css index a6096c66..e280242c 100755 --- a/inst/App/www/Acejs/shinyAce.css +++ b/inst/App/www/Acejs/shinyAce.css @@ -35,7 +35,7 @@ .ace_highlight-marker { position: absolute; - background: #FF0000; + background: #FF00FF; z-index: 1000; } From b3c3505081f0aacfd7ddf0668460be6910369b66 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:38:59 -0500 Subject: [PATCH 158/263] add link to newPage --- inst/App/leftPanel/tabs/serverNewPage.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inst/App/leftPanel/tabs/serverNewPage.R b/inst/App/leftPanel/tabs/serverNewPage.R index 287bd476..518517a0 100644 --- a/inst/App/leftPanel/tabs/serverNewPage.R +++ b/inst/App/leftPanel/tabs/serverNewPage.R @@ -1,7 +1,7 @@ # gets what we need from fileDescDB() -newPage<-function(tabId, title, txt, docFilePath, mode, fileSaveStatus ){ +newPage<-function(tabId, title, txt, docFilePath, mode, fileSaveStatus, link=NULL ){ # fileSaveStatus is boolean log.fin(newPage) if(is.null(tabId)){ @@ -16,6 +16,8 @@ newPage<-function(tabId, title, txt, docFilePath, mode, fileSaveStatus ){ } else { divClass="cAceRmdContainer" } + print("**** newPage link") + print(link) appendTab( inputId = "pages", select=TRUE, tabPanel( @@ -38,7 +40,8 @@ newPage<-function(tabId, title, txt, docFilePath, mode, fileSaveStatus ){ NULL }, docFilePath =docFilePath, - initSaved =fileSaveStatus + initSaved =fileSaveStatus, + link=link ) ), value=tabId From 7729527517069ddce88735226b64fe8f1d2edde9 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:39:53 -0500 Subject: [PATCH 159/263] add link to addFileTab (new Page) --- inst/App/leftPanel/tabs/serverFileTabs.R | 40 ++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/inst/App/leftPanel/tabs/serverFileTabs.R b/inst/App/leftPanel/tabs/serverFileTabs.R index 8ea1a8cc..08a0d26c 100644 --- a/inst/App/leftPanel/tabs/serverFileTabs.R +++ b/inst/App/leftPanel/tabs/serverFileTabs.R @@ -54,7 +54,7 @@ closeTabNow<-function(tabId2X){ # TODO!!!! , add input parameters for: autocomplete # fontsize should be read from options -addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FALSE){ +addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FALSE, link=NULL){ log.fin(addFileTab) tabId<-getNextTabId() @@ -65,7 +65,8 @@ addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FA aceId<-newPage(tabId=tabId, title=title, txt=txt, docFilePath=docFilePath, mode=mode, - fileSaveStatus=fileSaveStatus) + fileSaveStatus=fileSaveStatus, + link=link) #sendFileTabsMessage(tabId=pageId, sender='savedStatus', saveStatus=fileSaveStatus,resize=runif(1)) sendFileTabsMessage(resize=runif(1)) @@ -131,3 +132,38 @@ observeEvent(c(request$trigger,request$tabs), { } }, label='request-tabs-trigger') +observeEvent(input$messageContextMenu, { + + #todo + # add start_row, end_row, rmdId, to tabId page + # add control... to tabId page + # hide or disable rmdId page (removeTab, then restore tab later) + + start_row=input$messageContextMenu$start_row + end_row=input$messageContextMenu$end_row + src<-input$messageContextMenu$code + rid<-input$messageContextMenu$id + print("--------rmdId--------------") + print(rid) + cat("start_row=", start_row, " end_row=",end_row,"\n") + rmdAceId<-tabID2aceID(input$pages) + link<-paste(rmdAceId,rid, sep=".") + print("--------rmdId--------------") + print(rmdAceId) + # we update Ace with code + # + all prior code as a hidden portion + # and keep a hidden copy of full text for later reinsertion. + # BUT widget handler then has a problem, would need to know which ptR we are refering to. + + # print(rmdId) + # rmdId<-gsub('#',"", rmdId) + # hideElement(rmdId) # hides the frame but not the tab itself + tabName<-getNextAnonymousFileName() + tabId<-addFileTab(title=tabName, txt=src, docFilePath="?", mode='ptr', fileSaveStatus=FALSE, link=link) + # + aceId<-tabID2aceID(tabId) + # alternatively set ace content of to code, and save full txt somewhere + + mssg$error<-"" + log.fout(cmdFileNewPtR) +}) \ No newline at end of file From 22d4c06f0016fa25edd2b2340cf6a065f1b0ae0b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:40:52 -0500 Subject: [PATCH 160/263] adding link to ptRAce --- inst/App/leftPanel/mid/shinyAce4Ptr.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inst/App/leftPanel/mid/shinyAce4Ptr.R b/inst/App/leftPanel/mid/shinyAce4Ptr.R index 256bca28..89a04e54 100644 --- a/inst/App/leftPanel/mid/shinyAce4Ptr.R +++ b/inst/App/leftPanel/mid/shinyAce4Ptr.R @@ -30,7 +30,8 @@ initialPtrAceOptions<-function( cursorId=NULL, hotkeys=NULL, docFilePath='?', - initSaved=FALSE + initSaved=FALSE, + link=NULL ) { sanitizeId <- function(id){ @@ -49,7 +50,8 @@ initialPtrAceOptions<-function( autoCompleteList=autoCompleteList, acejs=acejs, docFilePath=docFilePath, - initSaved=initSaved + initSaved=initSaved, + link=link ) rtv<-paste0('ptRaceInit(',toJSON(options),');') # cat('initialPtrAceOptions:: options') @@ -73,7 +75,8 @@ shinyAce4Ptr <- function( cursorId=NULL, hotkeys=NULL, docFilePath=docFilePath, #assigned - initSaved=initSaved #assigned + initSaved=initSaved, #assigned + link=NULL ){ # cat('shinyAce4Ptr:: outputId=',outputId,"\n") @@ -99,7 +102,8 @@ shinyAce4Ptr <- function( autoCompleteList=autoCompleteList, debounce=debounce, selectionId=selectionId, cursorId=cursorId, hotkeys=hotkeys, docFilePath=docFilePath, - initSaved=initSaved + initSaved=initSaved, + link=link ) From 1d5c14d437c95b326c8df3fbfcb829599ceef6c4 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:41:36 -0500 Subject: [PATCH 161/263] if preDoc returned, extract into theBlocks --- inst/App/leftPanel/mid/serverAce.R | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/mid/serverAce.R b/inst/App/leftPanel/mid/serverAce.R index 218e6599..63ef786e 100644 --- a/inst/App/leftPanel/mid/serverAce.R +++ b/inst/App/leftPanel/mid/serverAce.R @@ -1,10 +1,25 @@ observeEvent(input$messageFromAce, { - # cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") + # cat("\n>----> messageFromAce", '***** sender=',format(input$messageFromAce$sender),"\n") + if(length(input$messageFromAce$sender)>0){ + if(length(input$messageFromAce$preDoc)>0){ + cat('has preDoc\n') + pDoc<-input$messageFromAce$preDoc + if(!identical(pDoc, request$pDoc)){ + pBlocks<-NULL + if(!identical(pDoc, "")){ + pBlocks<-extractCodeBlocksFromRmd(pDoc) + } + if(!identical(theBlocks(), pBlocks)){ + theBlocks(pBlocks) + } + } + } if(length(input$messageFromAce$code)>0){ # returning code setCode(input$messageFromAce$code) # only place where request$code is set + sender<-input$messageFromAce$sender # ace returns sender from call to update aceId<-input$messageFromAce$id tabId<-aceID2TabID(aceId) From ad5e5e47da7330c8b4c245b51636f4ab9daf38cc Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:42:31 -0500 Subject: [PATCH 162/263] adding Edit Code Block to context menu --- inst/App/leftPanel/mid/UIcontextMenu.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inst/App/leftPanel/mid/UIcontextMenu.R b/inst/App/leftPanel/mid/UIcontextMenu.R index 3623034e..53b3aba8 100644 --- a/inst/App/leftPanel/mid/UIcontextMenu.R +++ b/inst/App/leftPanel/mid/UIcontextMenu.R @@ -9,7 +9,8 @@ UIcontextMenu<-function(){ tag('li',list(class='clickMe', span(class='icon-clone'),span('Copy') )), tag('li',list(class='clickMe', span(class='icon-scissors'),span('Cut') )), tag('li',list(class='clickMe', span(class='icon-paste'),span('Paste') )), - tag('li',list(class='clickMe', span(class='icon-cancel'),span('Delete') )) + tag('li',list(class='clickMe', span(class='icon-cancel'),span('Delete') )), + tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-file-code'),span('Edit Code Block') )) )), hr(class='contexthr') ) @@ -18,7 +19,8 @@ UIcontextMenu<-function(){ }, tag('ul', list( id='items', - tag('li',list(class='clickMe', span(class="icon-help"), span( 'Lookup element'))) + tag('li',list(class='clickMe', span(class="icon-help"), span( 'Lookup element'))), + tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-file-code'),span('Edit Code Block') )) )) ) } \ No newline at end of file From 26cfc6cfbd192842f8eddb5a25f759a132d8cfc9 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:43:31 -0500 Subject: [PATCH 163/263] add cmd to update dependents if Rmd --- inst/App/leftPanel/footer/processKnit.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inst/App/leftPanel/footer/processKnit.R b/inst/App/leftPanel/footer/processKnit.R index cf1cc967..3a756bb9 100644 --- a/inst/App/leftPanel/footer/processKnit.R +++ b/inst/App/leftPanel/footer/processKnit.R @@ -3,6 +3,8 @@ processKnit<-reactive({ # cat_list<<-c( cat_list,">---> processKnit\n") clearErrorMssg() #src<-request$code + updateAceExt( id= getAceEditorId(), sender='commit.removeMarkers', removeAllMarkers='removeAllMarkers', updateRmdDependents=getAceEditorId() ) + src<-getCode() setSourceType(rmdPanelTag) From ac71cc0c395eacc41b0cded824b1fd26ccdb4c5e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:44:14 -0500 Subject: [PATCH 164/263] add extractCodeBlock --- inst/App/rightPanel/mid/serverPlotRmd.R | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/inst/App/rightPanel/mid/serverPlotRmd.R b/inst/App/rightPanel/mid/serverPlotRmd.R index 787ba52c..5101c056 100644 --- a/inst/App/rightPanel/mid/serverPlotRmd.R +++ b/inst/App/rightPanel/mid/serverPlotRmd.R @@ -30,3 +30,37 @@ rmdModuleList<-callModule( getPanelName=getRightMidPanel, getCode=getCode4Rendering ) + + +extractCodeBlocksFromRmd<-function(txt){ + + lines<-unlist(str_split(txt, '\n')) + print(lines) + pos<-grep('^```', lines) + np<-length(pos) + cat('np=',format(np),"\n") + blocks<-NULL + if(np>=2){ + if(np%%2==1){ + np=np-1 + } + pow<-pos[1:np] + pos<-matrix(pow,2) + print(pos) + i<-pos[1,] + ll<-lines[i] + + cols<-grep('^```\\s*\\{\\s*r[,[:space:]]',lines[i]) + cat('cols=',format(cols),'\n') + pos<-pos[,cols] + if(length(cols)>0){ + pos<-matrix(pos,2) + print(pos) + blocks<-apply(pos,2, function(x){ + paste0(lines[(x[1]+1):(x[2]-1)], collapse="\n") + }) + print(blocks) + } + } + blocks +} \ No newline at end of file From 21a2c59bcae74f54e93846731f2f3e13ef62509f Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:44:50 -0500 Subject: [PATCH 165/263] add link to session, if link was provided --- inst/App/www/Acejs/ptRaceInit.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inst/App/www/Acejs/ptRaceInit.js b/inst/App/www/Acejs/ptRaceInit.js index 0519736b..a5f02498 100644 --- a/inst/App/www/Acejs/ptRaceInit.js +++ b/inst/App/www/Acejs/ptRaceInit.js @@ -158,7 +158,13 @@ function ptRaceInit(data){ } theEditor.getSession().setUndoManager(ud); - + + if(!!data.link){ + console.log("*********************************"); + console.log("*** data.link=" + JSON.stringify(data.link)); + theEditor.getSession().link=data.link; + } + theEditor.commands.addCommand({ name: 'commitSource', bindKey: {win: 'Ctrl-Shift-Enter', mac: 'Command-Shift-Enter'}, From 2951f48acb8dc04417ba1a80e7a2b45e4be85497 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:46:05 -0500 Subject: [PATCH 166/263] added handler to "Edit Code Block" for rmds --- inst/App/www/ptR/contextMenu.js | 60 +++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index f189a243..aabf9ddd 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -11,8 +11,64 @@ $(function () { editor.getSession().selection.selectWordRight(); let text = editor.getSession().getTextRange(editor.getSelectionRange()); Shiny.onInputChange('helpMssg', {query:text, num:Math.random(), editorId: aceId} ); - } - else if(cmd==='Copy') { + } else if(cmd=="Edit Code Block"){ + + editor.find('```', {backwards:true}); + let row1=editor.getSelectionRange().start.row; + editor.find('```', {backwards:false}); + let row2=editor.getSelectionRange().start.row; + //alert('row1=' + row1 +", row2=" + row2); + let col= editor.session.getLine(row2).length; + let Range = ace.require('ace/range').Range; + //alert(col); + let range = new Range(row1, 0, row2, col); + let doc= editor.session.getDocument(); + + //import { Range } from "ace-builds" + //alert(JSON.stringify(range)); + // let row = range.end.row; + // let col= editor.session.getLine(row).length; + //range.end.column=Infinity; + + //alert(range); + if( !range.isEmpty() ){ + let text = editor.getSession().getTextRange(range); + let lines= text.split("\n"); + let patt=new RegExp("^```"); + let res0= patt.test(lines[0]); + let res1 = patt.test(lines[lines.length-1]); + let rngOk = res0 && res1; + if(rngOk){ + let Anchor = ace.require('ace/anchor').Anchor; + let anc1=new Anchor(doc,row1,0); + let anc2=new Anchor(doc,row2,0); + let anc={anc1: anc1, anc2:anc2}; + let rid=Math.random().toString(36).substring(8); + if(typeof editor.getSession().anchors ==='undefined'){ + editor.getSession().anchors={}; + } + editor.getSession().anchors[rid]=anc; + + lines=lines.slice(1, lines.length-1); + text=lines.join('\n'); + //alert(JSON.stringify(Object.keys(editor.getSession().anchors))); + // set current tab to read only + // send message to ptR to create new tab with text as content + Shiny.onInputChange('messageContextMenu', + { + start_row: row1, + end_row: row2, + code : text, + id:rid + }); + + // exit gracefully + //alert(text); + } + + + } + } else if(cmd==='Copy') { let text = editor.getSession().getTextRange(editor.getSelectionRange()); //window.clipboard.writeText(text); window.writeText(text); From 5cfc4631f590f804864afec0b6d7501a3ff49f5e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 08:47:18 -0500 Subject: [PATCH 167/263] replace new.env() with getEnvList() --- inst/App/leftPanel/footer/processCommit.R | 42 +++++++---------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/inst/App/leftPanel/footer/processCommit.R b/inst/App/leftPanel/footer/processCommit.R index 86c80d5e..cf7cb6d2 100644 --- a/inst/App/leftPanel/footer/processCommit.R +++ b/inst/App/leftPanel/footer/processCommit.R @@ -53,31 +53,26 @@ processCommit<-reactive({ } if(!hasError()){ tabId<-input$pages - # cat("tabId=",tabId,"\n") - #cat_list<<-c( cat_list,'>---> processCommit::savePage\n') savePage(tabId) - #cat_list<<-c( cat_list,'<---< processCommit::savePage\n') } - # log.fout( processCommit) + }) - processSvgR<-reactive({ - #src<-request$code + src<-getCode() - # cat('>----> processSvgR::\n') + if(length(src)==1){ ptRList<-getPtDefs()$tib tryCatch({ + initialEnv<-getEnvList() lines<-strsplit(src,"\n") lines<-lines[[1]] - # cat('ptRPos\n') + ptRPos<-grep("^\\s*ptR<-",lines) - # cat('svgRPos\n') svgRPos<-grep("^\\s*svgR\\(",lines) - # cat('done\n') + if(length(svgRPos)==0){ # just R code I guess - # browser() setSourceType(sourceType=RPanelTag) # } else { setSourceType(sourceType=svgPanelTag) #SVG code @@ -92,32 +87,21 @@ processSvgR<-reactive({ if(length(svgRPos)==0){ # just R code I guess #test for error and capture output # capture capture output as mssg - env<-new.env() + env1<-getEnvList() parsedCode<-parse(text=src) output<-lapply(parsedCode, function(x){ - captureOutput(eval(x, envir=env)) + captureOutput(eval(x, envir= env1 )) }) output<-paste( unlist(output), collapse="\n" ) output<-paste("Output:",output,sep="\n") setCapturedMssg(output) setSourceType(sourceType=RPanelTag) #no error, just R code } else { # presume to be svgR code - # next check if it can be run - # Set wd to the current project or if no project, then to home - dpath<-getDirPath() - if(identical(dpath, '~/.ptR')){ - dpath<-'~' - } - wd<-paste0('\nsetwd("',dpath,'")\n\n') - parsedCode<-parse(text=paste0(wd,src) ) - #parsedCode<-parse(text=src) - # svg<-eval(parsedCode) - # if(identical(class(svg),'svgDoc')){ - # w<-svg$root$getAttr('width') - # h<-svg$root$getAttr('height') - # #set WH in selected... - # } - output<-captureOutput(eval(parsedCode, new.env())) + + env2<-getEnvList() + parsedCode<-parse(text=paste0(src) ) + + output<-captureOutput(eval(parsedCode, envir=env2 )) output<-paste( output, collapse="\n" ) output<-paste("Output:",output,sep="\n") setCapturedMssg(output) From 3ff681ff541ef48c0d0f9419811fc28254ad13be Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 18:44:14 -0500 Subject: [PATCH 168/263] mssg$docFilePath => getFileDescriptor(tabId)$filePath --- inst/App/fileIO/genShinyFilesSaveButtons.R | 2 +- inst/App/fileIO/serverGenShinyFilesSaveObservers.R | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inst/App/fileIO/genShinyFilesSaveButtons.R b/inst/App/fileIO/genShinyFilesSaveButtons.R index dafac8ca..2e0ca57f 100644 --- a/inst/App/fileIO/genShinyFilesSaveButtons.R +++ b/inst/App/fileIO/genShinyFilesSaveButtons.R @@ -4,7 +4,7 @@ saveButtonFileNames<-setNames(paste0('buttonFileSave', extMode.TB$ext), extMode. UIGenShinySaveFilesButtons<-function(){ tt<-setNames(as.list(extMode.TB$ext),extMode.TB$mode) fileTypes<-lapply(tt, function(x){ - xx<-c(x,tt[tt!=x]) + xx<-c(x,tt[tt!=x]) #move the prefered mode to the top setNames(as.list(xx),xx) }) tmp<-lapply(extMode.TB$mode, function(mode){ diff --git a/inst/App/fileIO/serverGenShinyFilesSaveObservers.R b/inst/App/fileIO/serverGenShinyFilesSaveObservers.R index abc321cc..0a2df609 100644 --- a/inst/App/fileIO/serverGenShinyFilesSaveObservers.R +++ b/inst/App/fileIO/serverGenShinyFilesSaveObservers.R @@ -14,8 +14,9 @@ genShinySaveFilesObservers<-function(input, session){ if('cancel' %in% names(rtList)){ if(rtList$cancel=='close'){ tabId=popTabRequest() - if(mssg$docFilePath!="?"){ - addToRecentFiles(mssg$docFilePath) + docFilePath=getFileDescriptor(tabId)$filePath + if(!is.null(docFilePath) && docFilePath!="?"){ # WFT where is this mssg$docFilePath comming from??? !!!! + addToRecentFiles(docFilePath) } closeTabNow(tabId) } else { From 7239407ad874210baa579d3895a02591b5431a12 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 20 Jan 2021 18:45:37 -0500 Subject: [PATCH 169/263] comment out debugging --- inst/App/www/ptR/ptRManager.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/inst/App/www/ptR/ptRManager.js b/inst/App/www/ptR/ptRManager.js index 34e959da..1cdf1dbe 100644 --- a/inst/App/www/ptR/ptRManager.js +++ b/inst/App/www/ptR/ptRManager.js @@ -21,12 +21,12 @@ if(!!window.sendToElectron){ }); window.ipcRenderer.on( 'appCloseCmd', function(event, arg){ - console.log('about to close'); + // console.log('about to close'); $('#ptRQuit').trigger('click'); }); window.ipcRenderer.on( 'fileChanged', function(event, arg){ - console.log('fileChanged'); + // console.log('fileChanged'); //alert('fileChanged '+JSON.stringify(arg)); Shiny.onInputChange('fileChanged', { @@ -38,7 +38,7 @@ if(!!window.sendToElectron){ }); window.ipcRenderer.on( 'fileDeleted', function(event, arg){ - console.log('fileDeleted'); + // console.log('fileDeleted'); //alert('fileDeleted '+JSON.stringify(arg)); //$('#ptRQuit').trigger('click'); }); @@ -51,7 +51,7 @@ if(!!window.sendToElectron){ Shiny.addCustomMessageHandler( "ptRManager", function(data){ - console.log('-----------Entering ptRManager------------\n'); + // console.log('-----------Entering ptRManager------------\n'); // console.log(JSON.stringify(data)); if(data.sender==="cmd.electron"){ if(!!data.app2RunPath){ @@ -61,7 +61,7 @@ Shiny.addCustomMessageHandler( } if(!!data.resetWatcher){ if(!!window.sendToElectron){ - console.log('resetWatcher sendToElectron'); + // console.log('resetWatcher sendToElectron'); window.sendToElectron('resetWatcher',data.resetWatcher); } } @@ -76,27 +76,27 @@ Shiny.addCustomMessageHandler( } } if(!!data.openLink){ - console.log('data.openLink' + JSON.stringify(data.openLink)); + // console.log('data.openLink' + JSON.stringify(data.openLink)); if(!!window.sendToElectron){ window.sendToElectron('cmdOpenLink',data.openLink, ''); } } if(!!data.openWindow){ - console.log('data.openWindow' + JSON.stringify(data.openWindow)); + // console.log('data.openWindow' + JSON.stringify(data.openWindow)); if(!!window.sendToElectron){ window.sendToElectron('cmdOpenWindow',data.openWindow, ''); } } } //end of electron handlers if(data.sender==="closePtRWindowNow"){ - console.log('inside data.closePtRWindowNow'); + // console.log('inside data.closePtRWindowNow'); if(!!window.sendToElectron ){ - console.log('about to send confirmation'); + // console.log('about to send confirmation'); var confirmation=window.sendExitConfirmation(); //window.ipcRenderer.sendSync('confirmExit', true); - console.log('confirmation recieved '+ JSON.stringify(confirmation)); + // console.log('confirmation recieved '+ JSON.stringify(confirmation)); } - console.log('invoking window.close'); + // console.log('invoking window.close'); window.close(); } if(!!data.openFile){ @@ -205,7 +205,7 @@ Shiny.addCustomMessageHandler( if(!!data.rowCountChange){ $(window).resize(); } - console.log('-----------Exiting ptRManager------------\n'); + // console.log('-----------Exiting ptRManager------------\n'); } ); From 3529906883af896376280bf1309c07e8b58a6313 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Jan 2021 17:10:35 -0500 Subject: [PATCH 170/263] patch needed to make tagndrag to work as before --- inst/App/rightPanel/preProc/serverPreProcDB.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/preProc/serverPreProcDB.R b/inst/App/rightPanel/preProc/serverPreProcDB.R index a9bb7171..13dd9bf7 100644 --- a/inst/App/rightPanel/preProc/serverPreProcDB.R +++ b/inst/App/rightPanel/preProc/serverPreProcDB.R @@ -26,7 +26,7 @@ extractPreProcScript<-function(tab_Id, tib_Name, column_Name){ script_Name<-getPreProcScriptName( tab_Id, tib_Name,column_Name ) - if(script_Name!='none'){ + if(length(script_Name)>0 && script_Name!='none'){ tibs<-getPtDefs()$tib col<-tibs[[tib_Name]][[column_Name]] ctype<-extractColType(col) From 829c79161d775461f8b0a38e918972d9b68d61ca Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 18:09:43 -0500 Subject: [PATCH 171/263] e$message --- inst/App/fileIO/serverLoadWorkSpace.R | 1 + inst/App/leftPanel/footer/processDnip.R | 1 + inst/App/leftPanel/footer/processKnit.R | 1 + inst/App/rightPanel/menu/cmdFileImportPreProc.R | 2 +- inst/App/rightPanel/menu/cmdNewColumn.R | 2 +- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 4 ++-- inst/App/rightPanel/mouse/serverMouseCmdMovePt.R | 4 ++-- inst/App/rightPanel/preProc/preprocTrySetAttrValue.R | 4 ++-- inst/App/rightPanel/preProc/serverAuxPreproc.R | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index a86b5c45..0ecc829e 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -92,6 +92,7 @@ restoreWorkSpace<-reactive({ tryCatch( {txt<-paste(readLines(docFilePath), collapse="\n")}, error=function(e){ + e<-e$message cat("Unable to read file:", paste(e, collapse="\n")) return(NULL) #bail } diff --git a/inst/App/leftPanel/footer/processDnip.R b/inst/App/leftPanel/footer/processDnip.R index f5f2b030..3ac8df90 100644 --- a/inst/App/leftPanel/footer/processDnip.R +++ b/inst/App/leftPanel/footer/processDnip.R @@ -18,6 +18,7 @@ processDnip<-reactive({ } , #end of try error=function(e){ + e<-e$message if(all(!str_detect(e,'Output:'))){ e<-c(e,traceback()) } diff --git a/inst/App/leftPanel/footer/processKnit.R b/inst/App/leftPanel/footer/processKnit.R index 3a756bb9..7b306c1b 100644 --- a/inst/App/leftPanel/footer/processKnit.R +++ b/inst/App/leftPanel/footer/processKnit.R @@ -23,6 +23,7 @@ processKnit<-reactive({ } , #end of try error=function(e){ + e<-e$message if(all(!str_detect(e,'Output:'))){ e<-c(e,traceback()) } diff --git a/inst/App/rightPanel/menu/cmdFileImportPreProc.R b/inst/App/rightPanel/menu/cmdFileImportPreProc.R index fd48dcd7..c831c8ac 100644 --- a/inst/App/rightPanel/menu/cmdFileImportPreProc.R +++ b/inst/App/rightPanel/menu/cmdFileImportPreProc.R @@ -51,7 +51,7 @@ loadPreProc<-function(datapath, type){ readAuxPreProcs() }, error=function(e){ - e<-c(e,traceback()) + e<-c(e$message,traceback()) err<-paste(unlist(e), collapse="\n", sep="\n") shinyalert("load preproc Error",err, type="error") }) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 7a13f1bc..be16c714 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -240,7 +240,7 @@ observeEvent(input$commitNewCol, { #set the column to use specified script setPreProcScriptName(tab_Id=getTibTabId(), tib_Name= getAssetName(), column_Name=newColName, script_Name=script_Name) }, error=function(e){ - e<-c('preproErr',e) + e<-c('preproErr',e$message) err<-paste(unlist(e), collapse="\n", sep="\n") shinyalert("preproc new column Error",err, type="error") # may want to put this in a scrollable modal }) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 626f5893..7b2c2dfb 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -63,7 +63,7 @@ mouseCmdAddPt<-function(mssg){ } # all cols done successfully ptDefs$tib<-tibs # success, reset ptDefs }, error=function(e){ - err<-paste(unlist(e), collapse="\n", sep="\n") + err<-paste(e$message, collapse="\n", sep="\n") shinyalert("preproc new point Error",err, type="error") }) } #end of scripts @@ -97,7 +97,7 @@ mouseCmdAddPt<-function(mssg){ updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matColIndx+1)) } },error=function(e){ - err<-paste(unlist(e), collapse="\n", sep="\n") + err<-paste(e$message, collapse="\n", sep="\n") shinyalert("preproc new point Error",err, type="error") }) } else { #no prepoc pts diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R index 5be7d345..96af0974 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R @@ -41,8 +41,8 @@ mouseCmdMovePt<- function(mssg){ updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=rowIndex, matCol=matColIndx)) } },error=function(e){ - e<-c('preproErr',unlist(e)) - err<-paste(unlist(e), collapse="\n", sep="\n") + e<-c('preproErr',e$message) + err<-paste(e$message, collapse="\n", sep="\n") alert(err) }) } else { diff --git a/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R b/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R index 8e537496..72cc26c8 100644 --- a/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R +++ b/inst/App/rightPanel/preProc/preprocTrySetAttrValue.R @@ -38,7 +38,7 @@ preprocTrySetAttrValue<-function( cmd.Row, ptDefs, rowIndex, selection, mssg=NUL sender='applyTibEdit' updateAceExtDef(ptDefs, sender=sender, selector=list( name=context$name, rowIndex=context$row ) ) }, error=function(e){ - e<-c('onChangeRow:',e) + e<-c('onChangeRow:',e$message) err<-paste(unlist(e), collapse="\n", sep="\n") shinyalert("preproc value Errpr",err, type="error") }) @@ -87,7 +87,7 @@ preprocTrySetAttrValueS<-function(scripts, ptDefs, rowIndex, selection){ } } }, error=function(e){ - e<-c('preprocErr',e) + e<-c('preprocErr',e$message) err<-paste(unlist(e), collapse="\n", sep="\n") shinyalert("preproc value Errpr",err, type="error") }) diff --git a/inst/App/rightPanel/preProc/serverAuxPreproc.R b/inst/App/rightPanel/preProc/serverAuxPreproc.R index 8403ca89..6cc4d209 100644 --- a/inst/App/rightPanel/preProc/serverAuxPreproc.R +++ b/inst/App/rightPanel/preProc/serverAuxPreproc.R @@ -82,7 +82,7 @@ loadAuxPreProc<-function(fullName){ }, error=function(e){ #e0<-paste('attn: err in prepro script',script.Name,"\n") - e<-c(e,traceback()) + e<-c(e$message,traceback()) err<-paste(unlist(e), collapse="\n", sep="\n") shinyalert("preprocErr load",err, type="error") }) From 3115acd2d2381a08e73b6f0bce9443edef919056 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 19:54:26 -0500 Subject: [PATCH 172/263] reload only if pageId, colname, noOfRows exists --- inst/App/rightPanel/mid/serverRowIndexCtrl.R | 47 ++++++-------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/inst/App/rightPanel/mid/serverRowIndexCtrl.R b/inst/App/rightPanel/mid/serverRowIndexCtrl.R index a665762e..c99a040e 100644 --- a/inst/App/rightPanel/mid/serverRowIndexCtrl.R +++ b/inst/App/rightPanel/mid/serverRowIndexCtrl.R @@ -23,6 +23,7 @@ rowGroupsDB.addRow<-function(pageId, aname, cname, row_index ){ # so, the control cannot determine what was the initial trigger observeEvent( getTibRow(), { + # log.fin( getTibRow()) rowIndex<-input$myTibRowCntrl$selected if(!is.null(getTibRow()) && identical(rowIndex,getTibRow()) && @@ -32,6 +33,7 @@ observeEvent( getTibRow(), { return(NULL) } updateRowPicker(session, "myTibRowCntrl",selectRow = getTibRow() ) + # log.fout( getTibRow()) }) @@ -44,6 +46,7 @@ observeEvent( getTibRow(), { # 5. user code change (USER COMMIT) # the number of rows is determined from ptDefs after ace update resetRowPickeR<-function(){ + # log.fin(resetRowPickeR) rowIndex<-input$myTibRowCntrl$selected if(!is.null(getTibRow()) && identical(rowIndex,getTibRow()) && @@ -61,6 +64,7 @@ resetRowPickeR<-function(){ # CLONE # SPLIT # DELETE + # log.fout(resetRowPickeR) } @@ -100,7 +104,7 @@ observeEvent( input$myTibRowCntrl$selected, { updateSelected( rowIndex=rowIndex) } } - # log.fout(input$myTibRowCntrl$selected) + log.fout(input$myTibRowCntrl$selected) } }) @@ -159,63 +163,38 @@ observeEvent( input$myTibRowCntrl$group,{ # new asset , reload rowCntrl from rowGroupsDB # selector$name + rowGroupsDB => rowPicker observeEvent(getAssetName(),{ #reload rowpicker + aname<-getAssetName() - if(!is.null(aname)){ - log.fin("reload rowpicker") - # log.val(aname) - # group<-input$myTibRowCntrl$group - # if(length(group)>0){ - # cat('groups=\n') - # log.val(format(paste(group,collapse=","))) - # } else { - # cat('group is empty\n') - # } + pageId<-getTibTabId() + count<-getTibNRow() + cname<-getTibColumnName() + if(!is.null(aname) && !is.null(pageId) && length(count)>0 && length(cname)>0 ){ + # log.fin("reload rowpicker") - # print(rowGroupsDB()) pageId<-getTibTabId() count<-getTibNRow() - aname<-getAssetName() cname<-getTibColumnName() group<-filter(rowGroupsDB(), tabId==pageId, name==aname, colName==cname)$rows row<-getTibRow() - #browser() + if(length(group)>0 && !(row %in% group)){ row<-tail(group,1) updateSelected(rowIndex=row) } - #browser() - # cat('class of group is ',class(group),'\n') - # updateRowPicker(session, "myTibRowCntrl", - # count= count - # ) - # cat('************ (getAssetName count=count\n') - # print(rowGroupsDB()) - # cat('*********before**************\n') updateRowPicker(session, "myTibRowCntrl", count= count, selectRow = row, addToGroup=group ) - # cat('*********after**************\n') - # print(rowGroupsDB()) - # if(length(group)>0){ - # cat('groups=\n') - # log.val(format(paste(group,collapse=","))) - # } else { - # cat('group is empty\n') - # } - log.fout("reload rowpicker") + # log.fout("reload rowpicker") } }) observeEvent(getTibTabId(),{ # log.fin(getTibTabId()) - # cat('-----initializing rowGroupDB-----\n') - # count=getTibNRow() - # log.val(count) rowGroupsDB(initialRowGroupDB()) updateRowPicker(session, "myTibRowCntrl", selectRow=getTibRow(), From 2e36d4191ddd2d2933ce5bd67c4cbed0ce0e7183 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 19:58:51 -0500 Subject: [PATCH 173/263] e$message --- inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R index 0f9c798c..dbc219ab 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R @@ -14,7 +14,7 @@ mouseCmdMoveMatrix<-function(mssg){ row<-as.numeric(tail(tmp,1)) #this should be the same as selected row index selection<-getAssetName() matColIndx<-ncol(newPtDefs$tib[[selection]][[getTibPtColPos()]][[ row ]]) - + # Todo: for inter tib move support # selection -> 1 or more selections # row (currently corresponding to single name) - sets of rows @@ -56,7 +56,6 @@ mouseCmdMoveMatrix<-function(mssg){ colName=getTibColumnName() ) pageId<-getTibTabId() - if( mssg$shiftKey==TRUE){ if(getTibRow()!=row){ updateRowPicker(session, "myTibRowCntrl", addToGroup = row, selectRow = row ) @@ -72,7 +71,6 @@ mouseCmdMoveMatrix<-function(mssg){ } else { updateRowPicker(session, "myTibRowCntrl", removeEntireGroup=TRUE) } - contextList<-pmap(cntx, function(name, rows, colName){ # to check that tib has names ctype<-extractColType(tibs[[name]][[colName]]) @@ -84,7 +82,6 @@ mouseCmdMoveMatrix<-function(mssg){ } }) contextList<-Filter(function(x){!is.null(x)}, contextList) - tryCatch({ matCol<-NULL getDxy<-function(){names(dxy)<-c('dx','dy'); dxy} @@ -112,10 +109,9 @@ mouseCmdMoveMatrix<-function(mssg){ } matCol<-ncol(tibs[[getAssetName()]][[getTibPtColPos()]][[row]] ) newPtDefs$tib<-tibs - # cat('ContextList updateAceExtDef\n') updateAceExtDef(newPtDefs, sender=sender, selector=list( rowIndex=row, matCol=matCol)) }, error=function(e){ - e<-c('preproErr',unlist(e)) + e<-c('preproErr',e$message) err<-paste(unlist(e), collapse="\n", sep="\n") alert(err) }) From 46eb2119230d056b7ad94abebc8485e16acbcdef Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:00:17 -0500 Subject: [PATCH 174/263] keep star visable when active --- inst/App/www/scrollTabs.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/App/www/scrollTabs.css b/inst/App/www/scrollTabs.css index 9afff45f..28778e88 100644 --- a/inst/App/www/scrollTabs.css +++ b/inst/App/www/scrollTabs.css @@ -131,4 +131,8 @@ .star::after { content:"*"; color: #AAFFFF; +} +.active .star::after { + content:"*"; + color: #000000; } \ No newline at end of file From 606e6958c49e640f956c8699fa695763c381b6fd Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:02:53 -0500 Subject: [PATCH 175/263] clean up debug info --- inst/App/www/Acejs/aceExt.js | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 07836df3..1ccf3409 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -262,9 +262,9 @@ Shiny.addCustomMessageHandler( let row2 = anc2.getPosition().row; console.log('row1='+JSON.stringify( row1) +" row2="+JSON.stringify(row2) ); let xrng = new Range(row1+1, 0, row2-1, Infinity); // assumes that row1>0 - console.log('xrng='+JSON.stringify(xrng) ) + console.log('xrng='+JSON.stringify(xrng) ); let selTxt=editor.getSession().getTextRange(xrng); - console.log(JSON.stringify(selTxt)) + console.log(JSON.stringify(selTxt)); editr.getSession().setValue(selTxt); } } @@ -489,14 +489,15 @@ Shiny.addCustomMessageHandler( ud=editor.getSession().getUndoManager(); //console.log('1: undoManager is: ' + simpleStringify( ud )); - /* - console.log('1: ud.$ok is :' + JSON.stringify( ud.$ok)); - console.log("1: editor.getSession().getUndoManager().$ok=" + - JSON.stringify(editor.getSession().getUndoManager().$ok)); - console.log("Before pop ud.$undoStack.length=" + - editor.getSession().getUndoManager().$undoStack.length); - */ - if( ud.$ok.length>0 ){ // only replace if we can roll back to a good state + + //console.log('1: ud.$ok is :' + JSON.stringify( ud.$ok)); + //console.log("1: editor.getSession().getUndoManager().$ok=" + + // JSON.stringify(editor.getSession().getUndoManager().$ok)); + //console.log("Before pop ud.$undoStack.length=" + + // editor.getSession().getUndoManager().$undoStack.length); + //console.log("ud.$ok.length="+ ud.$ok.length) ; + if( ud.$ok.length>0 ){ // if we can, first roll back to a good state, then replace + //console.log( "ud.$ok.length="+ud.$ok.length ); ud.pop2Ok(); /* console.log('2: undoManager is: ' + simpleStringify( ud )); @@ -506,11 +507,11 @@ Shiny.addCustomMessageHandler( JSON.stringify(editor.getSession().getUndoManager().$ok)); */ //ud.pop2Ok(); //!!! to do, check if pop.2Ok exists - /* - console.log("Before replacement u.$undoStack.length=" + - editor.getSession().getUndoManager().$undoStack.length + "\n ok=" + - JSON.stringify(editor.getSession().getUndoManager().$ok) ); - */ + } + //console.log("Before replacement u.$undoStack.length=" + + // editor.getSession().getUndoManager().$undoStack.length + "\n ok=" + + // JSON.stringify(editor.getSession().getUndoManager().$ok) ); + for(var i=0; i< replacement.length; i++){ let rpl = replacement[i]; //console.log("xx "+ i + ": " + JSON.stringify(rpl)); @@ -520,8 +521,8 @@ Shiny.addCustomMessageHandler( editor.getSession().replace(rnge, rpl.txt); editor.getSession().getUndoManager().setOk(); } - //console.log("After replacement ud.$undoStack.length=" + - // editor.getSession().getUndoManager().$undoStack.length); + console.log("After replacement ud.$undoStack.length=" + + editor.getSession().getUndoManager().$undoStack.length); setTimeout( function(){ editor.getSession().getUndoManager().setOk(); @@ -546,8 +547,8 @@ Shiny.addCustomMessageHandler( }, 5 ); - } - } + //} + } //end replacement //---------setOk---------- if(!!data.setOk){ From 55b7bbc2ff2a7500b064dc53fb6668daba346aee Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:06:36 -0500 Subject: [PATCH 176/263] clean up comments --- inst/App/leftPanel/serverRequest.R | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/inst/App/leftPanel/serverRequest.R b/inst/App/leftPanel/serverRequest.R index 80a66cab..7e4570c3 100644 --- a/inst/App/leftPanel/serverRequest.R +++ b/inst/App/leftPanel/serverRequest.R @@ -24,16 +24,21 @@ getWDCmd<-reactive({ getEnvList<-reactive({ + # log.fin(getEnvList) wd<-getWDCmd() + # log.val(wd) pcode<-theBlocks() if(!is.null(pcode) && pcode!=""){ - pcode=paste(wd,pcode ) + pcode=paste(wd,pcode,sep="\n") initialEnv=new.env() + # log.val(pcode) eval(parse(text=pcode),initialEnv) envlist<-as.list(initialEnv) } else { envlist<-list() } + # log.val(envList) + # log.fout(getEnvList) envlist }) @@ -83,12 +88,6 @@ peekTabCmd<-function(){ request$sender } - -clearRequest<-function( ){ - request$sender<-NULL - request$tags<-list() -} - requestStartUp<-function(){ setTrigger('startup') } From a63e09decb9083fb6c0c921624ac8f7ffd7b3aa3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:14:01 -0500 Subject: [PATCH 177/263] added primitive debug helper --- inst/App/util/logger.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index 1ad94ca9..d5f25dc8 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -40,4 +40,10 @@ log.val<-function(x){ ) } +} + +log.counter<-function(x=0){ + x<-x+1 + cat(paste0('counter-',x),'\n') + x } \ No newline at end of file From 6985cc4895b586f147ca119abc5392971b9618f2 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:14:45 -0500 Subject: [PATCH 178/263] comment out debug statements --- inst/App/www/Acejs/aceExt.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 1ccf3409..0564a4b8 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -262,9 +262,9 @@ Shiny.addCustomMessageHandler( let row2 = anc2.getPosition().row; console.log('row1='+JSON.stringify( row1) +" row2="+JSON.stringify(row2) ); let xrng = new Range(row1+1, 0, row2-1, Infinity); // assumes that row1>0 - console.log('xrng='+JSON.stringify(xrng) ); + // console.log('xrng='+JSON.stringify(xrng) ); let selTxt=editor.getSession().getTextRange(xrng); - console.log(JSON.stringify(selTxt)); + // console.log(JSON.stringify(selTxt)); editr.getSession().setValue(selTxt); } } @@ -521,8 +521,8 @@ Shiny.addCustomMessageHandler( editor.getSession().replace(rnge, rpl.txt); editor.getSession().getUndoManager().setOk(); } - console.log("After replacement ud.$undoStack.length=" + - editor.getSession().getUndoManager().$undoStack.length); + //console.log("After replacement ud.$undoStack.length=" + + // editor.getSession().getUndoManager().$undoStack.length); setTimeout( function(){ editor.getSession().getUndoManager().setOk(); From 03885a9429f253542bfb4c230714fc5ff4ac4b95 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:15:21 -0500 Subject: [PATCH 179/263] commented out debug statement --- inst/App/rightPanel/mid/serverRowIndexCtrl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mid/serverRowIndexCtrl.R b/inst/App/rightPanel/mid/serverRowIndexCtrl.R index c99a040e..9c724c38 100644 --- a/inst/App/rightPanel/mid/serverRowIndexCtrl.R +++ b/inst/App/rightPanel/mid/serverRowIndexCtrl.R @@ -104,7 +104,7 @@ observeEvent( input$myTibRowCntrl$selected, { updateSelected( rowIndex=rowIndex) } } - log.fout(input$myTibRowCntrl$selected) + # log.fout(input$myTibRowCntrl$selected) } }) From b21c4daf472d14127a51424ef134d71016176b48 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:16:06 -0500 Subject: [PATCH 180/263] e$message --- inst/App/leftPanel/footer/processCommit.R | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/inst/App/leftPanel/footer/processCommit.R b/inst/App/leftPanel/footer/processCommit.R index cf7cb6d2..99b48f3c 100644 --- a/inst/App/leftPanel/footer/processCommit.R +++ b/inst/App/leftPanel/footer/processCommit.R @@ -55,23 +55,19 @@ processCommit<-reactive({ tabId<-input$pages savePage(tabId) } - + # log.fout(processCommit) }) processSvgR<-reactive({ - +# log.fin(processSvgR) src<-getCode() - if(length(src)==1){ - ptRList<-getPtDefs()$tib tryCatch({ initialEnv<-getEnvList() - lines<-strsplit(src,"\n") + lines<-strsplit(src,"\n") lines<-lines[[1]] - ptRPos<-grep("^\\s*ptR<-",lines) svgRPos<-grep("^\\s*svgR\\(",lines) - if(length(svgRPos)==0){ # just R code I guess setSourceType(sourceType=RPanelTag) # } else { @@ -97,7 +93,6 @@ processSvgR<-reactive({ setCapturedMssg(output) setSourceType(sourceType=RPanelTag) #no error, just R code } else { # presume to be svgR code - env2<-getEnvList() parsedCode<-parse(text=paste0(src) ) @@ -114,10 +109,13 @@ processSvgR<-reactive({ }, #end of try error=function(e){ #Error handler for commit + e<-e$message if(all(!str_detect(e,'Output:'))){ e<-c(e,traceback()) } - err<-paste(unlist(e), collapse="\n", sep="\n") + err<-unlist(e) + err<-paste(err, collapse="\n", sep="\n") + # log.val(err) #try to locate where the error occured if(str_detect(err, 'parse')){ m<-str_match(err, ":([0-9]+):([0-9]+):") @@ -141,7 +139,8 @@ processSvgR<-reactive({ } #end of error handler ) #end of tryCatch } #end of if(length==1) - # cat('<----< processSvgR::\n') + + # log.fout(processSvgR) }) From caf39fd4c8feae37bd2a5545df1756ddbffb1317 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:23:54 -0500 Subject: [PATCH 181/263] code to create anchors for rmd code block, add to anchor list in rmd's session and return to server text inside block toghther with name for block. --- inst/App/www/ptR/contextMenu.js | 86 +++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index aabf9ddd..455060ef 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -12,25 +12,78 @@ $(function () { let text = editor.getSession().getTextRange(editor.getSelectionRange()); Shiny.onInputChange('helpMssg', {query:text, num:Math.random(), editorId: aceId} ); } else if(cmd=="Edit Code Block"){ - - editor.find('```', {backwards:true}); - let row1=editor.getSelectionRange().start.row; - editor.find('```', {backwards:false}); - let row2=editor.getSelectionRange().start.row; - //alert('row1=' + row1 +", row2=" + row2); - let col= editor.session.getLine(row2).length; let Range = ace.require('ace/range').Range; + let rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition()}); + if(!rng1){ return null} + let row1=rng1.start.row; + // add check for "{ r , }"" in row1, + let rngL1 = new Range(row1, 0, row1, Infinity); + let line1 = editor.getSession().getTextRange(rngL1); + if(!/\Wr\W/.test(line1)){ // if not found exit + return null; + } + // if found extract label? + let rng2=editor.find('```', {backwards:false, start:editor.getCursorPosition()}); + if(!rng2){ return null} // if not found exit + let row2=rng2.start.row; + // check .anchors to see if row1, row2 are taken + let Anchor = ace.require('ace/anchor').Anchor; + let ancs = editor.getSession().anchors; + // console.log('----------- ancs='+JSON.stringify(ancs)); + // console.log("------------> typeof ancs" +typeof ancs); + let childAceId=null; + let ancTag=null; + if(typeof editor.getSession().anchors !='undefined'){ + let ancs = editor.getSession().anchors; + for(let k in ancs){ + let val=ancs[k]; + // console.log( 'k='+k); + let r1=val.anc1.row; + let r2=val.anc2.row; + //console.log('-------- r1='+r1," r2="+r2+" ----------"); + if(r1==r1 && r2== row2){ + ancTag=k; + } + } + // console.log(JSON.stringify(ancTag)); + if(!!ancTag){ + $('.shiny-ace').each(function(){ + let lid=this.id; + // console.log('lid='+lid); + let editr = $('#'+lid).data('aceEditor'); + if(!!editr.getSession().link ){ + let link=editr.getSession().link; + // console.log('link is:'+JSON.stringify(link)); + if(link.length !== undefined){ + let res=link[0].split("."); + let rid=res[1]; + if(rid==ancTag){ + childAceId=lid; + } + } + } + }); + if(!!childAceId){ + // console.log('>>>>>>>>>> childAceId exists=' + childAceId); + if(!!$('#'+childAceId)){ + Shiny.onInputChange('messageContextMenu', + { + cmd: "openTab", + id:childAceId + }); + return(null); + } + } + } + } + + let col= editor.session.getLine(row2).length; + //alert(col); let range = new Range(row1, 0, row2, col); let doc= editor.session.getDocument(); - //import { Range } from "ace-builds" - //alert(JSON.stringify(range)); - // let row = range.end.row; - // let col= editor.session.getLine(row).length; - //range.end.column=Infinity; - - //alert(range); + if( !range.isEmpty() ){ let text = editor.getSession().getTextRange(range); let lines= text.split("\n"); @@ -39,7 +92,7 @@ $(function () { let res1 = patt.test(lines[lines.length-1]); let rngOk = res0 && res1; if(rngOk){ - let Anchor = ace.require('ace/anchor').Anchor; + //let Anchor = ace.require('ace/anchor').Anchor; let anc1=new Anchor(doc,row1,0); let anc2=new Anchor(doc,row2,0); let anc={anc1: anc1, anc2:anc2}; @@ -56,6 +109,7 @@ $(function () { // send message to ptR to create new tab with text as content Shiny.onInputChange('messageContextMenu', { + cmd: "newTab", start_row: row1, end_row: row2, code : text, @@ -85,7 +139,7 @@ $(function () { //let text = clipboard.readText(); let text = window.readText(); editor.getSession().replace(range, text); - console.log("You have selected "+ cmd + " with ace id = " +aceId); + // console.log("You have selected "+ cmd + " with ace id = " +aceId); } else if(cmd==='Delete') { let range = editor.getSelectionRange(); if( !range.isEmpty() ){ From 034903312753266057511d354a6012404101cac4 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:27:18 -0500 Subject: [PATCH 182/263] if anchor name and code block text is received from client then creates a new tab, else receives tabId to open existing tab. --- inst/App/leftPanel/tabs/serverFileTabs.R | 64 ++++++++++++------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/inst/App/leftPanel/tabs/serverFileTabs.R b/inst/App/leftPanel/tabs/serverFileTabs.R index 08a0d26c..392c67d2 100644 --- a/inst/App/leftPanel/tabs/serverFileTabs.R +++ b/inst/App/leftPanel/tabs/serverFileTabs.R @@ -133,37 +133,37 @@ observeEvent(c(request$trigger,request$tabs), { }, label='request-tabs-trigger') observeEvent(input$messageContextMenu, { + cmd=input$messageContextMenu$cmd + if(cmd=="newTab"){ + start_row=input$messageContextMenu$start_row + end_row=input$messageContextMenu$end_row + src<-input$messageContextMenu$code + rid<-input$messageContextMenu$id + + rmdAceId<-tabID2aceID(input$pages) + link<-paste(rmdAceId,rid, sep=".") + # we update Ace with code + # + all prior code as a hidden portion + # and keep a hidden copy of full text for later reinsertion. + # BUT widget handler then has a problem, would need to know which ptR we are refering to. + tabName<-getNextAnonymousFileName() + tabId<-addFileTab(title=tabName, txt=src, docFilePath="?", mode='ptr', fileSaveStatus=FALSE, link=link) + # + aceId<-tabID2aceID(tabId) + # alternatively set ace content of to code, and save full txt somewhere + + mssg$error<-"" + } else if(cmd=="openTab"){ + id<-input$messageContextMenu$id + tabId=aceID2TabID(id) + + updateTabsetPanel(session, "pages", selected = tabId) + # change to tabId + #sendFileTabsMessage(selected=tabId, resize=runif(1)) + + #setTabRequest(sender="tabChange", tabs=tabId) + + } - #todo - # add start_row, end_row, rmdId, to tabId page - # add control... to tabId page - # hide or disable rmdId page (removeTab, then restore tab later) - - start_row=input$messageContextMenu$start_row - end_row=input$messageContextMenu$end_row - src<-input$messageContextMenu$code - rid<-input$messageContextMenu$id - print("--------rmdId--------------") - print(rid) - cat("start_row=", start_row, " end_row=",end_row,"\n") - rmdAceId<-tabID2aceID(input$pages) - link<-paste(rmdAceId,rid, sep=".") - print("--------rmdId--------------") - print(rmdAceId) - # we update Ace with code - # + all prior code as a hidden portion - # and keep a hidden copy of full text for later reinsertion. - # BUT widget handler then has a problem, would need to know which ptR we are refering to. - - # print(rmdId) - # rmdId<-gsub('#',"", rmdId) - # hideElement(rmdId) # hides the frame but not the tab itself - tabName<-getNextAnonymousFileName() - tabId<-addFileTab(title=tabName, txt=src, docFilePath="?", mode='ptr', fileSaveStatus=FALSE, link=link) - # - aceId<-tabID2aceID(tabId) - # alternatively set ace content of to code, and save full txt somewhere - - mssg$error<-"" - log.fout(cmdFileNewPtR) + # log.fout(cmdFileNewPtR) }) \ No newline at end of file From 27aec66fbaa6d908dd9c6c4612042ef04ddc8586 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:27:39 -0500 Subject: [PATCH 183/263] patch --- inst/App/rightPanel/preProc/serverPreProcDB.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/rightPanel/preProc/serverPreProcDB.R b/inst/App/rightPanel/preProc/serverPreProcDB.R index a9bb7171..a3d1f06e 100644 --- a/inst/App/rightPanel/preProc/serverPreProcDB.R +++ b/inst/App/rightPanel/preProc/serverPreProcDB.R @@ -26,7 +26,7 @@ extractPreProcScript<-function(tab_Id, tib_Name, column_Name){ script_Name<-getPreProcScriptName( tab_Id, tib_Name,column_Name ) - if(script_Name!='none'){ + if(length(script_Name)==1 && script_Name!='none'){ tibs<-getPtDefs()$tib col<-tibs[[tib_Name]][[column_Name]] ctype<-extractColType(col) From 28fbb2d57ae5f940445c5f1832d10e9022e6ca11 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 20:28:00 -0500 Subject: [PATCH 184/263] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 83b20ffb..ec7864d5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2021-01-02 Title: pointR -Version: 0.4.6 +Version: 0.4.7 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR From 21855e52621c79d85d70de72a936aa5407cbba23 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 22:19:44 -0500 Subject: [PATCH 185/263] goodName =>goodRName (bug fix for new column name ='stroke.width' --- inst/App/rightPanel/menu/cmdNewColumn.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdNewColumn.R b/inst/App/rightPanel/menu/cmdNewColumn.R index 7a13f1bc..f2b6ef5b 100644 --- a/inst/App/rightPanel/menu/cmdNewColumn.R +++ b/inst/App/rightPanel/menu/cmdNewColumn.R @@ -79,7 +79,7 @@ is.Non.Blank.Value<-reactiveVal(FALSE) observeEvent(input$modalAttrName,{ str<-input$modalAttrName - if(goodName(str) && !(str %in% c( names(getTib()), 'svgPanel', 'RPanel' ) )){ + if(goodRName(str) && !(str %in% c( names(getTib()), 'svgPanel', 'RPanel' ) )){ is.Non.Blank.Name(TRUE) # showElement('modalColTreatAsDiv') } else { @@ -273,7 +273,6 @@ observeEvent(input$commitNewCol, { # newVal is ready to insert newPtDefs$tib[[getAssetName()]]<-add_column(newPtDefs$tib[[getAssetName()]], !!(newColName):=newVal ) - } # updateAce and set selection to this column From f5dad6e2f51480da9d1675242f2d761a374b6492 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Jan 2021 22:20:24 -0500 Subject: [PATCH 186/263] fix rollback for new files without ok --- inst/App/www/Acejs/aceExt.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 1c659686..1acc7cae 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -389,9 +389,9 @@ Shiny.addCustomMessageHandler( //---------------replacement------------------ if(!!data.replacement){ - //console.log("\n\nEntering data.replacement"); + console.log("\n\nEntering data.replacement"); var replacement = data.replacement; - //console.log(JSON.stringify(replacement)); + console.log(JSON.stringify(replacement)); ud=editor.getSession().getUndoManager(); //console.log('1: undoManager is: ' + simpleStringify( ud )); @@ -404,7 +404,7 @@ Shiny.addCustomMessageHandler( */ if( ud.$ok.length>0 ){ // only replace if we can roll back to a good state ud.pop2Ok(); - /* + } /* console.log('2: undoManager is: ' + simpleStringify( ud )); //console.log('2: ud.$ok is: ' + simpleStringify( ud.$ok )); console.log('2: ud.$ok is: ' + JSON.stringify( ud.$ok )); @@ -452,7 +452,7 @@ Shiny.addCustomMessageHandler( }, 5 ); - } + //} } //---------setOk---------- From 9a522b8e5127cd67377eaf20a91c75bd9d2e79fe Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 25 Jan 2021 18:49:39 -0500 Subject: [PATCH 187/263] request$sender=>request$cmd --- inst/App/fileIO/serverGenShinyFilesSaveObservers.R | 2 +- inst/App/leftPanel/footer/serverButtons.R | 4 ++-- inst/App/leftPanel/menu/cmdFileQuit.R | 4 ++-- inst/App/leftPanel/menu/cmdFileSave.R | 4 ++-- inst/App/leftPanel/menu/cmdFileSaveAs.R | 2 +- inst/App/leftPanel/menu/serverEditBar.R | 2 +- inst/App/leftPanel/serverRequest.R | 14 +++++++------- inst/App/leftPanel/tabs/serverFileTabs.R | 6 +++--- inst/App/leftPanel/toolbar/cmdHToolBar.R | 2 +- inst/App/server.R | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/inst/App/fileIO/serverGenShinyFilesSaveObservers.R b/inst/App/fileIO/serverGenShinyFilesSaveObservers.R index 0a2df609..a151672b 100644 --- a/inst/App/fileIO/serverGenShinyFilesSaveObservers.R +++ b/inst/App/fileIO/serverGenShinyFilesSaveObservers.R @@ -20,7 +20,7 @@ genShinySaveFilesObservers<-function(input, session){ } closeTabNow(tabId) } else { - setTabRequest(sender=NULL, tabs=NULL) + setTabRequest(cmd=NULL, tabs=NULL) } } else { fp.dt<-parseSavePath(c(home='~'), rtList) diff --git a/inst/App/leftPanel/footer/serverButtons.R b/inst/App/leftPanel/footer/serverButtons.R index d727f268..cbdb28a3 100755 --- a/inst/App/leftPanel/footer/serverButtons.R +++ b/inst/App/leftPanel/footer/serverButtons.R @@ -12,7 +12,7 @@ observeEvent(input$commitMssg, { #---commit rmdView button----- observeEvent(input$writeNOpen ,{ - setTabRequest(sender='buttonCmd.rmdViewer', tabs=input$pages) + setTabRequest(cmd='buttonCmd.rmdViewer', tabs=input$pages) }, label= "writeNOpen") appRunner<-reactiveValues( @@ -28,7 +28,7 @@ if(usingElectron){ appRunner$log<-"" selection<-getAllNamedUnsavedFiles()$tabId if(length(selection)>0){ - setTabRequest(sender='fileCmd.runApp', tabs=selection) + setTabRequest(cmd='fileCmd.runApp', tabs=selection) } else { app2RunPath<-getFileDescriptor(appRunner$tabId)$filePath sendPtRManagerMessage(sender='cmd.electron', app2RunPath=app2RunPath, tabId= appRunner$tabId) diff --git a/inst/App/leftPanel/menu/cmdFileQuit.R b/inst/App/leftPanel/menu/cmdFileQuit.R index 6b361145..432b72ae 100644 --- a/inst/App/leftPanel/menu/cmdFileQuit.R +++ b/inst/App/leftPanel/menu/cmdFileQuit.R @@ -55,7 +55,7 @@ observeEvent(input$checkAll,{ cmdQuitNow() } else { #iterate over each tab id selection and save each, then quit - setTabRequest(sender='fileCmd.quit', tabs=selection) + setTabRequest(cmd='fileCmd.quit', tabs=selection) } }) @@ -68,7 +68,7 @@ observeEvent(input$quitNow,{ cmdQuitNow() } else { #iterate over each tab id selection and save each, then quit - setTabRequest(sender='fileCmd.quit', tabs=selection) + setTabRequest(cmd='fileCmd.quit', tabs=selection) } }) diff --git a/inst/App/leftPanel/menu/cmdFileSave.R b/inst/App/leftPanel/menu/cmdFileSave.R index 36e87a31..7ab3c50a 100644 --- a/inst/App/leftPanel/menu/cmdFileSave.R +++ b/inst/App/leftPanel/menu/cmdFileSave.R @@ -1,11 +1,11 @@ cmdFileSave<-function(){ - setTabRequest(sender="fileCmd.save", tabs=input$pages) + setTabRequest(cmd="fileCmd.save", tabs=input$pages) } cmdFileSaveAll<-function(){ tabIds<-getAllNamedUnsavedFiles()$tabId if(length(tabIds)>0){ - setTabRequest(sender= 'fileCmd.save', tabs=tabIds) + setTabRequest(cmd= 'fileCmd.save', tabs=tabIds) } } diff --git a/inst/App/leftPanel/menu/cmdFileSaveAs.R b/inst/App/leftPanel/menu/cmdFileSaveAs.R index 6d12b36c..be56383e 100644 --- a/inst/App/leftPanel/menu/cmdFileSaveAs.R +++ b/inst/App/leftPanel/menu/cmdFileSaveAs.R @@ -8,5 +8,5 @@ cmdFileSaveAs<-function(){ #tabId<-input$pages #sendPtRManagerMessage( id=tabId, sender='cmd.saveFileAs', saveFile=TRUE, closing=!is.null(request$closeTab), type='R') - setTabRequest(sender="fileCmd.saveAs", tabs=input$pages) + setTabRequest(cmd="fileCmd.saveAs", tabs=input$pages) } diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index cf54f0cd..8756d35a 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -104,7 +104,7 @@ observeEvent( input$editNavBar, { editOption$currentProjectDirectory<-NULL editOption$currentProjectName<-NULL dirtyDMDM(session, "editNavBar") - #delay(500, {request$sender='startup'}) + #delay(500, {request$cmd='startup'}) #delay(500, {setRequestSender('startup')}) delay(500, {requestStartUp()}) } diff --git a/inst/App/leftPanel/serverRequest.R b/inst/App/leftPanel/serverRequest.R index 7e4570c3..19ffea6d 100644 --- a/inst/App/leftPanel/serverRequest.R +++ b/inst/App/leftPanel/serverRequest.R @@ -4,7 +4,7 @@ theBlocks<-reactiveVal(NULL) theEnvList<-reactiveVal(list()) #or NULL? request<-reactiveValues( - sender=NULL, + cmd=NULL, tabs=NULL, trigger=0, predoc="" @@ -65,11 +65,11 @@ getCode4RenderingTransform<-eventReactive( trigger$redraw, { }) -setTabRequest<-function(sender, tabs){ - # if(length(sender)==1 && length(tabs)>1){ - # sender<-rep_len(sender,length(tabs) ) +setTabRequest<-function(cmd, tabs){ + # if(length(cmd)==1 && length(tabs)>1){ + # cmd<-rep_len(cmd,length(tabs) ) # } - request$sender<-sender + request$cmd<-cmd request$tabs<-tabs request$trigger<-sample(10^6,1) } @@ -85,7 +85,7 @@ peekTabRequest<-function(){ } peekTabCmd<-function(){ - request$sender + request$cmd } requestStartUp<-function(){ @@ -96,7 +96,7 @@ peekTab<-reactive( {request$tabs[1]} ) popTab<-reactive({ tab<-request$tabs[1] request$tabs<-request$tabs[-1] - # ????? if length(tabs is 0, remove sender?) + # ????? if length(tabs is 0, remove cmd?) tab }) diff --git a/inst/App/leftPanel/tabs/serverFileTabs.R b/inst/App/leftPanel/tabs/serverFileTabs.R index 392c67d2..a273b98b 100644 --- a/inst/App/leftPanel/tabs/serverFileTabs.R +++ b/inst/App/leftPanel/tabs/serverFileTabs.R @@ -94,8 +94,8 @@ observeEvent(input$pages,{ # updated by scrollManager and relays sender with tabs to request observeEvent(input$tabManager,{ tabs=unlist(input$tabManager$tabs) - sender=input$tabManager$sender - setTabRequest(sender=sender, tabs=tabs) + cmd=input$tabManager$sender + setTabRequest(cmd=cmd, tabs=tabs) }, label='tabManager') # request$tabs is updated by either @@ -161,7 +161,7 @@ observeEvent(input$messageContextMenu, { # change to tabId #sendFileTabsMessage(selected=tabId, resize=runif(1)) - #setTabRequest(sender="tabChange", tabs=tabId) + #setTabRequest(cmd="tabChange", tabs=tabId) } diff --git a/inst/App/leftPanel/toolbar/cmdHToolBar.R b/inst/App/leftPanel/toolbar/cmdHToolBar.R index 59de3723..57cdd48d 100644 --- a/inst/App/leftPanel/toolbar/cmdHToolBar.R +++ b/inst/App/leftPanel/toolbar/cmdHToolBar.R @@ -44,7 +44,7 @@ hBaRR<-reactiveValues( observers=list() ) -#observeEvent( request$sender, { +#observeEvent( request$cmd, { observeEvent( getCode(), { genTBObserver<-function(tbId, cmd){ return(observeEvent( diff --git a/inst/App/server.R b/inst/App/server.R index 2bc6d041..b58e47e7 100755 --- a/inst/App/server.R +++ b/inst/App/server.R @@ -164,7 +164,7 @@ shinyServer(function(input, output,session) { - # exportTestValues( request.sender=request$sender) + # exportTestValues( request.cmd=request$cmd) # exportTestValues(request.code=request$code) # exportTestValues(selectedAsset.tabId=selectedAsset$tabId) if(usingElectron){ From caec02fe995c7ddac31d51dfd2f2f2b554371041 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 25 Jan 2021 18:50:29 -0500 Subject: [PATCH 188/263] replace sendFileTabsMessage with fileDescDB()tabId --- inst/App/leftPanel/menu/cmdFileClose.R | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/inst/App/leftPanel/menu/cmdFileClose.R b/inst/App/leftPanel/menu/cmdFileClose.R index 864a2f6a..6a78d750 100644 --- a/inst/App/leftPanel/menu/cmdFileClose.R +++ b/inst/App/leftPanel/menu/cmdFileClose.R @@ -1,9 +1,17 @@ cmdFileClose<-function(){ - setTabRequest(sender="fileCmd.close", tabs=input$pages) + setTabRequest(cmd="fileCmd.close", tabs=input$pages) } cmdFileCloseAll<-function(){ - sendFileTabsMessage(sender= 'fileCmd.close', getAllTabIds=runif(1)) + + # 1. get all tab Ids + tabIds<-fileDescDB()$tabId + # 2. sender= 'fileCmd.close' + cmd= 'fileCmd.close' + # 3. push onto request + setTabRequest(cmd=cmd, tabs=tabIds) + + #sendFileTabsMessage(sender= 'fileCmd.close', getAllTabIds=runif(1)) } observeEvent( input$closeTab, { @@ -16,7 +24,7 @@ observeEvent( input$closeTab, { tabId<-aceID2TabID(id) } #removeFileDesc(tabId) - setTabRequest(sender="fileCmd.close", tabs=tabId) + setTabRequest(cmd="fileCmd.close", tabs=tabId) log.fin(input$closeTab) } } , label= "input$closeTab") From c87bfb3e7d7b647a87e4d1d41ffaad834a908aac Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 27 Jan 2021 13:35:25 -0500 Subject: [PATCH 189/263] track and close child files of Rmd when Rmd closes or project closes or program quits --- inst/App/fileIO/serverFileDescriptor.R | 15 +++++------ .../fileIO/serverGenShinyFilesSaveObservers.R | 2 +- inst/App/fileIO/serverLoadWorkSpace.R | 11 +++++--- .../leftPanel/dnippets/serverDnippetCntrl.R | 1 + inst/App/leftPanel/menu/cmdFileClose.R | 20 +++++++++++++-- inst/App/leftPanel/menu/cmdFileQuit.R | 9 +++++++ inst/App/leftPanel/pproj/pprojUtil.R | 18 ++++++++++--- inst/App/leftPanel/tabs/serverFileTabs.R | 25 ++++++++++++++++++- inst/App/util/dbInitiatizers.R | 3 ++- inst/App/util/logger.R | 2 +- inst/App/www/Acejs/aceExt.js | 21 ++++++++++------ 11 files changed, 97 insertions(+), 30 deletions(-) diff --git a/inst/App/fileIO/serverFileDescriptor.R b/inst/App/fileIO/serverFileDescriptor.R index 27e34274..45ba8b70 100644 --- a/inst/App/fileIO/serverFileDescriptor.R +++ b/inst/App/fileIO/serverFileDescriptor.R @@ -1,12 +1,6 @@ fileDescDB<-reactiveVal( - tibble( - tabId='bogus', - isSaved=FALSE, - filePath="?", - anonNo =1, - mode='ptr' - )[0,] + initialFileDescDB() ) getNextAnonymousFileName<-reactive({ @@ -20,14 +14,17 @@ getNextAnonFileNum<-reactive({ }) # to be called from serverFileTab.R::addFileTab -addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode){ +addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode, parId=NA){ if(identical(docFilePath,"?")){ anonNo<-getNextAnonFileNum() } else { anonNo<-0 } + if(is.null(parId)){ + parId=NA + } tb<-tibble(tabId=pageId, isSaved=fileSaveStatus, - filePath=docFilePath, anonNo, mode=fileMode) + filePath=docFilePath, anonNo, mode=fileMode, parId=parId) fd<- fileDescDB() fd<-bind_rows(fd,tb) fileDescDB(fd) diff --git a/inst/App/fileIO/serverGenShinyFilesSaveObservers.R b/inst/App/fileIO/serverGenShinyFilesSaveObservers.R index a151672b..90a9220a 100644 --- a/inst/App/fileIO/serverGenShinyFilesSaveObservers.R +++ b/inst/App/fileIO/serverGenShinyFilesSaveObservers.R @@ -15,7 +15,7 @@ genShinySaveFilesObservers<-function(input, session){ if(rtList$cancel=='close'){ tabId=popTabRequest() docFilePath=getFileDescriptor(tabId)$filePath - if(!is.null(docFilePath) && docFilePath!="?"){ # WFT where is this mssg$docFilePath comming from??? !!!! + if(!is.null(docFilePath) && docFilePath!="?"){ addToRecentFiles(docFilePath) } closeTabNow(tabId) diff --git a/inst/App/fileIO/serverLoadWorkSpace.R b/inst/App/fileIO/serverLoadWorkSpace.R index 0ecc829e..81eeeae9 100644 --- a/inst/App/fileIO/serverLoadWorkSpace.R +++ b/inst/App/fileIO/serverLoadWorkSpace.R @@ -27,7 +27,6 @@ restoreWorkSpace<-reactive({ } wsPages<-list() - ptRproj<-pprj() selectedTab<-readCurrentTab() @@ -35,6 +34,7 @@ restoreWorkSpace<-reactive({ # 1. load all pages into a list. for(filePath in fileWSPaths){ + page<-readRDS(filePath) # A. assign tabIds to each page id=basename(filePath) @@ -53,10 +53,14 @@ restoreWorkSpace<-reactive({ if(length(tibAs)>0){ names(tibAs)<-gsub(pattern, '', names(tibAs)) tibAs[sapply(tibAs,is.null)]<-NA + setdiff(names(initTib),names(tibAs))->tmp + if(length(tmp)>0){ + tmp<-sapply(tmp, function(x){NA}, USE.NAMES = T) + tibAs<-c(tibAs,tmp) + } } tibAs }) - rtv<-bind_rows( rtv) if(ncol(rtv)==0){ rtv<-initTib @@ -88,7 +92,8 @@ restoreWorkSpace<-reactive({ fileSaveStatus=page$fileDescriptor.isSaved txt=page$code - if(fileSaveStatus==TRUE && file.exists(docFilePath)){ + + if(identical(fileSaveStatus,TRUE) && file.exists(docFilePath)){ tryCatch( {txt<-paste(readLines(docFilePath), collapse="\n")}, error=function(e){ diff --git a/inst/App/leftPanel/dnippets/serverDnippetCntrl.R b/inst/App/leftPanel/dnippets/serverDnippetCntrl.R index c884b170..24ca7e8c 100644 --- a/inst/App/leftPanel/dnippets/serverDnippetCntrl.R +++ b/inst/App/leftPanel/dnippets/serverDnippetCntrl.R @@ -13,6 +13,7 @@ removeFromDnippetsSelectionAll<-function(dnName ){ observeEvent(c( getDnippetsAll(), dnippetsDB$usage, input$pages),{ + log.fout(c( getDnippetsAll(), getDnippetsSelected(), input$pages)) if(!is.null(input$pages)){ selected<-getDnippetsSelected() mode<-getMode() diff --git a/inst/App/leftPanel/menu/cmdFileClose.R b/inst/App/leftPanel/menu/cmdFileClose.R index 6a78d750..e38f393b 100644 --- a/inst/App/leftPanel/menu/cmdFileClose.R +++ b/inst/App/leftPanel/menu/cmdFileClose.R @@ -1,9 +1,18 @@ cmdFileClose<-function(){ + # if current tab has children + # first add children, then current tab + + fd<-fileDescDB() + aid<-getAceEditorId() + aids<-filter(fileDescDB(), parId==aid)$tabId + if(length(aids)>0){ + tabs<-aceID2TabID(aids) + closeTabsNow(tabs) + } setTabRequest(cmd="fileCmd.close", tabs=input$pages) } cmdFileCloseAll<-function(){ - # 1. get all tab Ids tabIds<-fileDescDB()$tabId # 2. sender= 'fileCmd.close' @@ -20,8 +29,15 @@ observeEvent( input$closeTab, { id<-input$closeTab$id if(input$closeTab$type=='tabId'){ tabId<-id + aceId<-tabID2aceID(tabId) } else { - tabId<-aceID2TabID(id) + aceId<-id + tabId<-aceID2TabID(aceId) + } + aids<-filter(fileDescDB(), parId==aceId & filePath=="?")$tabId # exclude from deletion any tabs with paths assigned + if(length(aids)>0){ + tabs<-aceID2TabID(aids) + closeTabsNow(tabs) } #removeFileDesc(tabId) setTabRequest(cmd="fileCmd.close", tabs=tabId) diff --git a/inst/App/leftPanel/menu/cmdFileQuit.R b/inst/App/leftPanel/menu/cmdFileQuit.R index 432b72ae..ce536264 100644 --- a/inst/App/leftPanel/menu/cmdFileQuit.R +++ b/inst/App/leftPanel/menu/cmdFileQuit.R @@ -1,7 +1,15 @@ cmdFileQuit<-reactive({ + log.fin(cmdFileQuit) storeAssetState() + if("parId" %in% names( fileDescDB())){ #shoul + aids<-filter(fileDescDB(), !is.na(parId) & filePath=="?")$tabId + if(length(aids)>0){ + tabs<-aceID2TabID(aids) + closeTabsNow(tabs) + } + } fd<-getAllNamedUnsavedFiles() choices<-fd$filePath if(length(choices)>0){ @@ -10,6 +18,7 @@ cmdFileQuit<-reactive({ } else { cmdQuitNow() } + log.fout(cmdFileQuit) }) cmdQuitNow<-reactive({ diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index 9c1ca8b5..d31ac7f6 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -11,6 +11,8 @@ # - observeEvent of *customFileDialog* # for the time being we just close closeCurrentProj<-function(){ + log.fin(closeCurrentProj) + storeAssetState() savePage(input$pages) pprj(NULL) @@ -22,9 +24,17 @@ closeCurrentProj<-function(){ opts<-sapply(opts,unlist, USE.NAMES = T, simplify = F ) writeOptionsJSON(opts) - # close all open tabs - # stopifnot('tabId' %in% names(fileDescDB()) ) - tabIds<-fileDescDB()$tabId + if("parId" %in% names( fileDescDB() )){ + aids<-filter(fileDescDB(), !is.na(parId) & filePath=="?")$tabId + tabIds<-filter(fileDescDB(), is.na(parId) | filePath!="?")$tabId #fileDescDB()$tabId + } else { + aids=NULL + tabIds<-fileDescDB()$tabId + } + if(length(aids)>0){ + tabs<-aceID2TabID(aids) + closeTabsNow(tabs) + } for( tabId in tabIds){ removeTab(inputId = "pages", tabId) } @@ -39,7 +49,7 @@ closeCurrentProj<-function(){ backDropDB( initialBackDropDB() ) svgGridDB( initialSvgGridDB() ) serverAssetDB$tib<-initialServerAsset() - + log.fout(closeCurrentProj) } # used only by resetShinyFilesIOPaths diff --git a/inst/App/leftPanel/tabs/serverFileTabs.R b/inst/App/leftPanel/tabs/serverFileTabs.R index a273b98b..7aae1757 100644 --- a/inst/App/leftPanel/tabs/serverFileTabs.R +++ b/inst/App/leftPanel/tabs/serverFileTabs.R @@ -47,6 +47,25 @@ closeTabNow<-function(tabId2X){ removeTab(inputId = "pages", tabId2X) } +closeTabsNow<-function(tabIds2Close){ + if(length(tabIds2Close)>0){ + serverAssetDB$tib<-filter(serverAssetDB$tib, !(tabId %in% tabIds2Close)) + db<-widgetDB() + db<-filter(db, !(tabId %in% tabIds2Close)) + widgetDB(db) + fdDB<-fileDescDB() + fdDB<-filter(fdDB, !(tabId %in% tabIds2Close)) + fileDescDB(fdDB) + path=getWorkSpaceDir() + for(id in tabIds2Close){ + pth<-paste0(path,"/",id,".rda") + file.remove(pth) + removeTab(inputId = "pages", id) + } + } + + +} @@ -59,7 +78,11 @@ addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FA tabId<-getNextTabId() if(is.null(tabId)){ cat("tabId is null\n"); browser() } #should never happen - addFileDesc(pageId=tabId, docFilePath=docFilePath, fileSaveStatus, fileMode=mode) + parId=NULL + if(!is.null(link)){ + parId<-unlist(strsplit(link,'\\.'))[[1]] + } + addFileDesc(pageId=tabId, docFilePath=docFilePath, fileSaveStatus, fileMode=mode, parId) setUseTribble( pageId=tabId, value=TRUE) addNewPage2dnippetsDB(tabId) diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index b85f88f6..1552bd12 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -4,7 +4,8 @@ initialFileDescDB<-function(){tibble( isSaved=FALSE, filePath="?", anonNo =1, - mode='ptr' + mode='ptr', + parId=NA )[0,] } diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index d5f25dc8..3f504dec 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,5 +1,5 @@ -SHOW_DEBUG_LOG=FALSE +SHOW_DEBUG_LOG=TRUE log.fin<-function(x){ if(SHOW_DEBUG_LOG){ diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 0564a4b8..edd664a0 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -526,14 +526,19 @@ Shiny.addCustomMessageHandler( setTimeout( function(){ editor.getSession().getUndoManager().setOk(); - /* - console.log("replacement: After setOk, ok=" + JSON.stringify(editor.getSession().getUndoManager().$ok)); - console.log('replacement fin: editor.getSession().getUndoManager()$undoStack.length=' + - editor.getSession().getUndoManager().$undoStack.length); - console.log('replacement fin: editor.getUndoManager()getSession().$ok=' + - JSON.stringify(editor.getSession().getUndoManager().$ok)); - console.log('replacement fin: sender=' + data.sender); - */ + preDoc=""; + if(!!editor.getSession().link){ + let link= editor.getSession().link + + if(link.length !== undefined){ + let targetAceId=link[0] + if(typeof targetAceId !=undefined){ + let text = editor.getSession().getValue(); + preDoc=aceReplaceBlock(targetAceId, text); // should replace only if text does not match block + } + } + } + Shiny.onInputChange('messageFromAce', { code : editor.getSession().getValue(), From 1ca1dd28c0c0c92ab1166cd6d1d31a7bed9203b3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 27 Jan 2021 18:22:22 -0500 Subject: [PATCH 190/263] add feature to place block label as tab name for block tab --- inst/App/leftPanel/tabs/serverFileTabs.R | 6 ++++-- inst/App/www/ptR/contextMenu.js | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/inst/App/leftPanel/tabs/serverFileTabs.R b/inst/App/leftPanel/tabs/serverFileTabs.R index 7aae1757..be732b8a 100644 --- a/inst/App/leftPanel/tabs/serverFileTabs.R +++ b/inst/App/leftPanel/tabs/serverFileTabs.R @@ -162,14 +162,16 @@ observeEvent(input$messageContextMenu, { end_row=input$messageContextMenu$end_row src<-input$messageContextMenu$code rid<-input$messageContextMenu$id - + tabName<-input$messageContextMenu$label rmdAceId<-tabID2aceID(input$pages) link<-paste(rmdAceId,rid, sep=".") # we update Ace with code # + all prior code as a hidden portion # and keep a hidden copy of full text for later reinsertion. # BUT widget handler then has a problem, would need to know which ptR we are refering to. - tabName<-getNextAnonymousFileName() + if(tabName==""){ + tabName<-getNextAnonymousFileName() + } tabId<-addFileTab(title=tabName, txt=src, docFilePath="?", mode='ptr', fileSaveStatus=FALSE, link=link) # aceId<-tabID2aceID(tabId) diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index 455060ef..bc4e8d10 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -22,7 +22,26 @@ $(function () { if(!/\Wr\W/.test(line1)){ // if not found exit return null; } - // if found extract label? + // split line and look for r, and label + // remove ```, {, } and split + let toks=line1.replace("```","").replace(/ /g,"").replace("{","").replace("}","").split(","); + // search for r + let hasR = toks.filter(tok => tok=='r').length==1; + if(!hasR){ + return null; + } + let label = toks.filter(tok => tok.match(/label=.*/)); + if(label.length===1){ + label=label[0].replace(/label='/,"").replace("'","").replace('"',''); + } else { + label =toks.filter(tok=>!tok.match('=')).filter(tok=>tok!='r'); + if(label.length==1){ + label=label[0].replace("'","").replace('"',''); + } else { + label=""; + } + } + let rng2=editor.find('```', {backwards:false, start:editor.getCursorPosition()}); if(!rng2){ return null} // if not found exit let row2=rng2.start.row; @@ -113,7 +132,8 @@ $(function () { start_row: row1, end_row: row2, code : text, - id:rid + id:rid, + label: label }); // exit gracefully From 7f4045d42ed7b6084945d3622d24e8b3a44cd19e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 28 Jan 2021 12:40:51 -0500 Subject: [PATCH 191/263] rmd scroll to block corresponding to last tab block --- inst/App/www/Acejs/aceExt.js | 30 +++++++++++------------------- inst/App/www/ptR/contextMenu.js | 17 ++++++----------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index edd664a0..6d675508 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -98,47 +98,30 @@ function aceReplaceBlock(link, txt){ let res=link.split("."); let aceId=res[0]; let rid=res[1]; - console.log('++++++++++++ aceId='+aceId); - console.log('++++++++++++ rid='+rid); - console.log('abcdefg-----------1--------------'); let editor=$('#'+aceId).data('aceEditor'); - console.log('abcdefg-----------2--------------'); let session =editor.getSession(); - console.log('abcdefg-----------3--------------'); let anchors=session.anchors; - console.log('abcdefg-----------4--------------'); - console.log(JSON.stringify(anchors)); let preDoc=null; if( (typeof editor.getSession().anchors !='undefined') && (typeof editor.getSession().anchors[rid] !='undefined') ){ - console.log('abcdefg-----------5--------------'); let anc1 =editor.getSession().anchors[rid].anc1; let anc2 =editor.getSession().anchors[rid].anc2; if(!!anc1 && !!anc2){ let Range = ace.require('ace/range').Range; - console.log('abcdefg-----------6--------------'); let row1 = anc1.getPosition().row; - console.log('abcdefg-----------7--------------'); let row2 = anc2.getPosition().row; let prernge = new Range(0, 0, row1-1, Infinity); // assumes that row1>0 preDoc=session.getTextRange(prernge); - console.log('abcdefg-----------8--------------'); row1=row1+1; row2=row2-1; - console.log('abcdefg-----------9--------------'); // select range - console.log('row1='+row1+' row2='+row2); - let rnge = new Range(row1, 0, row2, Infinity); - console.log('abcdefg-----------10--------------'); - console.log(JSON.stringify(rnge)); // replace text in range - console.log('abcdefg-----------11--------------'); session.replace(rnge,txt); - console.log('abcdefg-----------12--------------'); - + // scroll into view and set cursor pos + session.lineToSee=row2; session.getUndoManager().setOk(); } } else { @@ -617,6 +600,15 @@ Shiny.addCustomMessageHandler( } preDoc=""; + if( //typeof editor.getSession().lineToSee !== 'undefined' && + !!editor.getSession().lineToSee + ){ + let line2see= editor.getSession().lineToSee; + editor.moveCursorTo(line2see,0); + editor.scrollToLine(line2see, true, true, function () {}); + editor.clearSelection(); + } + editor.getSession().lineToSee=null; if(!!editor.getSession().link){ let link= editor.getSession().link //if(typeof link =='array') diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index bc4e8d10..b3010e09 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -12,6 +12,9 @@ $(function () { let text = editor.getSession().getTextRange(editor.getSelectionRange()); Shiny.onInputChange('helpMssg', {query:text, num:Math.random(), editorId: aceId} ); } else if(cmd=="Edit Code Block"){ + //let pos=e.getDocumentPosition(); + ///console.log('#########################'); + // console.log(JSON.stringify(pos)); let Range = ace.require('ace/range').Range; let rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition()}); if(!rng1){ return null} @@ -41,38 +44,33 @@ $(function () { label=""; } } - + let rng2=editor.find('```', {backwards:false, start:editor.getCursorPosition()}); + if(!rng2){ return null} // if not found exit + let row2=rng2.start.row; // check .anchors to see if row1, row2 are taken let Anchor = ace.require('ace/anchor').Anchor; let ancs = editor.getSession().anchors; - // console.log('----------- ancs='+JSON.stringify(ancs)); - // console.log("------------> typeof ancs" +typeof ancs); let childAceId=null; let ancTag=null; if(typeof editor.getSession().anchors !='undefined'){ let ancs = editor.getSession().anchors; for(let k in ancs){ let val=ancs[k]; - // console.log( 'k='+k); let r1=val.anc1.row; let r2=val.anc2.row; - //console.log('-------- r1='+r1," r2="+r2+" ----------"); if(r1==r1 && r2== row2){ ancTag=k; } } - // console.log(JSON.stringify(ancTag)); if(!!ancTag){ $('.shiny-ace').each(function(){ let lid=this.id; - // console.log('lid='+lid); let editr = $('#'+lid).data('aceEditor'); if(!!editr.getSession().link ){ let link=editr.getSession().link; - // console.log('link is:'+JSON.stringify(link)); if(link.length !== undefined){ let res=link[0].split("."); let rid=res[1]; @@ -83,7 +81,6 @@ $(function () { } }); if(!!childAceId){ - // console.log('>>>>>>>>>> childAceId exists=' + childAceId); if(!!$('#'+childAceId)){ Shiny.onInputChange('messageContextMenu', { @@ -97,8 +94,6 @@ $(function () { } let col= editor.session.getLine(row2).length; - - //alert(col); let range = new Range(row1, 0, row2, col); let doc= editor.session.getDocument(); From 6b791c7bc5781284dace85e7137bfe2d9b70e6e1 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 29 Jan 2021 16:58:57 -0500 Subject: [PATCH 192/263] reset range to null --- inst/App/www/ptR/contextMenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index b3010e09..5fff4941 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -16,7 +16,7 @@ $(function () { ///console.log('#########################'); // console.log(JSON.stringify(pos)); let Range = ace.require('ace/range').Range; - let rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition()}); + let rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition(), range:null}); if(!rng1){ return null} let row1=rng1.start.row; // add check for "{ r , }"" in row1, @@ -45,7 +45,7 @@ $(function () { } } - let rng2=editor.find('```', {backwards:false, start:editor.getCursorPosition()}); + let rng2=editor.find('```', {backwards:false, start:editor.getCursorPosition(), range:null}); if(!rng2){ return null} // if not found exit From c7ad85d9f643785c41f936b86337ea022840210e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 29 Jan 2021 16:59:24 -0500 Subject: [PATCH 193/263] comment out debug --- inst/App/www/ptR/scrollTabs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/App/www/ptR/scrollTabs.js b/inst/App/www/ptR/scrollTabs.js index 39213829..47f08372 100644 --- a/inst/App/www/ptR/scrollTabs.js +++ b/inst/App/www/ptR/scrollTabs.js @@ -279,8 +279,8 @@ $(document).ready(function(){ Shiny.addCustomMessageHandler( "scrollManager", function(data){ - console.log("----------entering scrollManager------------"); - console.log("data is" + JSON.stringify(data)); + //console.log("----------entering scrollManager------------"); + //console.log("data is" + JSON.stringify(data)); if(!!data.resize){ $(window).resize(); } @@ -305,6 +305,6 @@ Shiny.addCustomMessageHandler( rnd: Math.random().toString(36).substring(7) } ); } - console.log("----------exiting scrollManager------------"); + //console.log("----------exiting scrollManager------------"); } ); From 1f200f509a0c609f8bafb37269521fb726f19d5e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 29 Jan 2021 17:00:44 -0500 Subject: [PATCH 194/263] scroll rmd canvas to last edited tab block --- inst/App/www/Acejs/aceExt.js | 98 +++++++++++++++++++++++++++++------- 1 file changed, 81 insertions(+), 17 deletions(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 6d675508..78951d03 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -94,6 +94,7 @@ function getAceMode(ed){ return mode; } + function aceReplaceBlock(link, txt){ let res=link.split("."); let aceId=res[0]; @@ -233,7 +234,7 @@ Shiny.addCustomMessageHandler( if(aceId==id){ console.log('found ace='+aceId+'with anchor='+ rid); // select the range for rid in the rmd and copy over - console.log('anchors='+JSON.stringify(editor.getSession().anchors )); + //console.log('anchors='+JSON.stringify(editor.getSession().anchors )); if(!!editor.getSession().anchors ){ let anc1 =editor.getSession().anchors[rid].anc1; let anc2 =editor.getSession().anchors[rid].anc2; @@ -598,45 +599,107 @@ Shiny.addCustomMessageHandler( if(!!data.auxValue){ auxValue=data.auxValue; } - + let blockNum=0; preDoc=""; - if( //typeof editor.getSession().lineToSee !== 'undefined' && + if( typeof editor.getSession().lineToSee !== 'undefined' && !!editor.getSession().lineToSee ){ let line2see= editor.getSession().lineToSee; + console.log('line2see='+line2see); editor.moveCursorTo(line2see,0); editor.scrollToLine(line2see, true, true, function () {}); editor.clearSelection(); + //next find the block number + let rngF=new Range(0,0,line2see,Infinity); + //let blks=editor.findAll('```', {backwards:true, start:editor.getCursorPosition(), range:rngF}); + + editor.$search.setOptions({ + needle: "```", + start:editor.getCursorPosition(), + range:rngF, + caseSensitive: true, + wholeWord: true, + regExp: false, + }); + let res=editor.$search.findAll(editor.session) + //console.log(res.length); + /* + res.forEach(function(x){ + console.log( JSON.stringify(x.start.row)); + x.end.column=Infinity; + console.log('text='+editor.getSession().getTextRange(x)); + let line=editor.getSession().getTextRange(x); + console.log(line) + console.log(line.match(/asis/)); + //let toks=line.replace("```","").replace(/ /g,"").replace("{","").replace("}","").split(","); + //toks.filter(tok => tok=='r').length==1; + }) + */ + //let rows = res.map(function(x){return x.start.row;}); + //console.log('rows='+JSON.stringify(rows)); + rows=res.filter( x=>{ + x.end.column=Infinity; + return !!(editor.getSession().getTextRange(x).match(/asis/)); + }) + //console.log('2: rows='+JSON.stringify(rows)); + //console.log('2: rows.length='+rows.length) + //rows.forEach(function(x){ + // console.log( JSON.stringify(x.start.row)); + // x.end.column=Infinity; + // console.log('text='+editor.getSession().getTextRange(x)); + //}) + //let fr=res.map(function(x){ + // return getTextRange(x); + //}) + + if(!!rows){ + blockNum=rows.length; + } + + + //console.log('>>>>>>>>>>>>> blks='+blks); + //console.log("type blks="+ typeof blks); + if(blockNum>0){ + //blockNum=blks; //Math.floor(blks/2); + setTimeout(function() { + //find all matches possible blocks + // console.log("initially blockNum="+blockNum); + let oblks=$("#rmdMod-rmd_Html").find('svg'); + blockNum=Math.min(oblks.length, blockNum); + blockNum=blockNum-1; + // console.log('oblks.length='+oblks.length); + if(!!oblks){ + // console.log("blockNum="+blockNum); + let blockEl = oblks[blockNum]; + blockEl.scrollIntoView(false); + } + }, 500, blockNum ); + } + editor.clearSelection(); } editor.getSession().lineToSee=null; if(!!editor.getSession().link){ let link= editor.getSession().link //if(typeof link =='array') - console.log('*******link*********') - console.log("link="+JSON.stringify(link)) - console.log("link.length="+JSON.stringify(link.length)) + // console.log('*******link*********') + // console.log("link="+JSON.stringify(link)) + // console.log("link.length="+JSON.stringify(link.length)) if(link.length !== undefined){ let targetAceId=link[0] - console.log('****adskfjalsufhlaiufhsia&&&&&&&&77') + //console.log('****adskfjalsufhlaiufhsia&&&&&&&&77') if(typeof targetAceId !=undefined){ - console.log('****adskfjalsufhla666666666iufhsia&&&&&&&&77') - console.log(JSON.stringify(link[0])); + //console.log('****adskfjalsufhla666666666iufhsia&&&&&&&&77') + // console.log(JSON.stringify(link[0])); let text = editor.getSession().getValue(); - console.log('****adskfjalsufhl8888888888888888hsia&&&&&&&&77') + //console.log('****adskfjalsufhl8888888888888888hsia&&&&&&&&77') preDoc=aceReplaceBlock(targetAceId, text); // should replace only if text does not match block } - - // get targetEditor - // get targetSession.canchors - // select target beteen canchors - // set text in that region - // } } - + console.log('returning blockNum='+blockNum); Shiny.onInputChange('messageFromAce', { code : editor.getSession().getValue(), @@ -647,6 +710,7 @@ Shiny.addCustomMessageHandler( isSaved: ud.isSaved(), auxValue: auxValue, preDoc: preDoc, + //blockNumber: blockNum, rnd : randomString(5) }); } From 586da5f4fafe108204a879b39855736cd36129df Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 29 Jan 2021 20:53:47 -0500 Subject: [PATCH 195/263] context menu edit block to be visible for Rmd mode only. --- inst/App/util/reOrgPanels.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/App/util/reOrgPanels.R b/inst/App/util/reOrgPanels.R index 8aed458c..b505e133 100644 --- a/inst/App/util/reOrgPanels.R +++ b/inst/App/util/reOrgPanels.R @@ -18,6 +18,7 @@ reOrgPanels<-function(id, mode){ hideElement("aceTabSet") hideElement("midRightPanels") hideElement("BottomRightPanel") + hide(id="rmd-edit-code") addCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") showElement("logo.right") showElement("logo.left") @@ -32,6 +33,7 @@ reOrgPanels<-function(id, mode){ showElement("commitButton") showElement("useTribble") # todo!!! show only if mode==ptR and there is a tribble or tibble addCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") + hide(id="rmd-edit-code") if(usingElectron){ addCssClass( id= "runAppPanel", class="hiddenPanel") addCssClass( id= "stopAppPanel", class="hiddenPanel") @@ -43,16 +45,17 @@ reOrgPanels<-function(id, mode){ } else { hideElement("snippetToolBarContainer") } - removeCssClass( id= 'midRightPanels', class='ctop140') hideElement("TopRightPanel") hideElement("useTribble") # todo!!! show only if mode==ptR and there is a tribble or tibble # now consider which mode it is if(identical(mode,'ptrrmd')){ + show(id="rmd-edit-code") removeCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") } else{ + hide(id="rmd-edit-code") addCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") } if(usingElectron){ From f046cccfb0e7dc1b23d8eabfcf5603775611ec3a Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 30 Jan 2021 20:44:01 -0500 Subject: [PATCH 196/263] remove duplicate Edit Code Block --- inst/App/leftPanel/mid/UIcontextMenu.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/leftPanel/mid/UIcontextMenu.R b/inst/App/leftPanel/mid/UIcontextMenu.R index 53b3aba8..4f05393a 100644 --- a/inst/App/leftPanel/mid/UIcontextMenu.R +++ b/inst/App/leftPanel/mid/UIcontextMenu.R @@ -9,8 +9,8 @@ UIcontextMenu<-function(){ tag('li',list(class='clickMe', span(class='icon-clone'),span('Copy') )), tag('li',list(class='clickMe', span(class='icon-scissors'),span('Cut') )), tag('li',list(class='clickMe', span(class='icon-paste'),span('Paste') )), - tag('li',list(class='clickMe', span(class='icon-cancel'),span('Delete') )), - tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-file-code'),span('Edit Code Block') )) + tag('li',list(class='clickMe', span(class='icon-cancel'),span('Delete') ))#, + # tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-file-code'),span('Edit Code Block') )) )), hr(class='contexthr') ) From a8b59aaf926696eb723d197469677aa81ee62ef3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sat, 30 Jan 2021 20:46:00 -0500 Subject: [PATCH 197/263] set source for rrmdPanelTag (kludge but ...) --- inst/App/leftPanel/footer/processCommit.R | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/inst/App/leftPanel/footer/processCommit.R b/inst/App/leftPanel/footer/processCommit.R index 99b48f3c..52d302df 100644 --- a/inst/App/leftPanel/footer/processCommit.R +++ b/inst/App/leftPanel/footer/processCommit.R @@ -1,12 +1,20 @@ src2sourceType<-function(src){ #not used !! lines<-strsplit(src,"\n") lines<-lines[[1]] - svgRPos<-grep("^\\s*svgR\\(",lines) - if(length(svgRPos)==0){ # just R code I guess - # browser() - setSourceType(sourceType=RPanelTag) # + if(length(lines)==0){ + setSourceType(sourceType=textPanelTag) } else { - setSourceType(sourceType=svgPanelTag) #SVG code + if(grepl("^---",lines[1])){ + setSourceType(sourceType=rmdPanelTag) + } else{ + svgRPos<-grep("^\\s*svgR\\(",lines) + if(length(svgRPos)==0){ # just R code I guess + # browser() + setSourceType(sourceType=RPanelTag) # + } else { + setSourceType(sourceType=svgPanelTag) #SVG code + } + } } } @@ -18,6 +26,7 @@ processCommit<-reactive({ clearErrorMssg() mode<-getModeX() + log.val(mode) if(length(mode)!=1){ cat('missing mode\n'); browser() return(NULL) From e3314fd9a059c7fea8efe0dab03e7eb03b9d40f4 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sun, 7 Feb 2021 10:05:22 -0500 Subject: [PATCH 198/263] cosemeti --- inst/App/global.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/inst/App/global.R b/inst/App/global.R index 77227732..92c1ba8c 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -62,15 +62,20 @@ sapply( # the following constants would be better if placed in a list or # alteratively use lockBinding to fix the value defTag<-"ptR" + +# appears in serverPanelDispatch transformTag<-"Transforms" +svgPanelTag<-'svgPanel' errorPanelTag<-"errorPanel" RPanelTag='RPanel' -svgPanelTag<-'svgPanel' -rmdPanelTag<-'rmdPanel' +appPanelTag<-'appPanel' +rmdPanelTag<-'rmdPanel' textPanelTag<-'textPanel' -javascriptPanelTag<-'javascriptPanel' snippetPanelTag<-'snippetPanel' -appPanelTag<-'appPanel' +javascriptPanelTag<-'javascriptPanel' + + + tibTag<-'tib' resourceDir='aux' From dae0d65e449a6a69b308db6c49d53af9988362ef Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sun, 7 Feb 2021 19:54:38 -0500 Subject: [PATCH 199/263] save only if fileDescriptor exists --- inst/App/fileIO/serverPage2Workspace.R | 50 +++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/inst/App/fileIO/serverPage2Workspace.R b/inst/App/fileIO/serverPage2Workspace.R index 1813be9d..c52cc7b0 100644 --- a/inst/App/fileIO/serverPage2Workspace.R +++ b/inst/App/fileIO/serverPage2Workspace.R @@ -8,30 +8,32 @@ savePage<-function(pageId, path=getWorkSpaceDir()){ fileName=paste0(path,"/",pageId,".rda") asel<-reactiveValuesToList(selectedAsset) fileDescriptor=getFileDescriptor(pageId) - backdrop=getPageBackDrop(pageId) - grid=getPageSvgGrid(pageId) - trib<-getPageUseTribble(pageId) - dnip<-getPageDnippetsDB(pageId) - widg<-getPageWidgetDB(pageId) - preprocPage<-getPagePreprocPageDB(pageId) - rtv<-c( - fileDescriptor=getFileDescriptor(pageId), - code=getCode(), - assetSelection=asel, - backdrop=backdrop, - grid=grid, - trib=trib, - dnip=dnip, - widg=widg, - preprocPage=preprocPage - ) - - # ppE<-getPreProcPtEntries(pageId) - # if(length(ppE)!=0 && nrow(ppE)>0){ - # rtv<-c(rtv, preprocScripts=ppE) - # } - if(length(preprocPage)) - saveRDS(object=rtv, file = fileName) + if(length(fileDescriptor)>0){ + backdrop=getPageBackDrop(pageId) + grid=getPageSvgGrid(pageId) + trib<-getPageUseTribble(pageId) + dnip<-getPageDnippetsDB(pageId) + widg<-getPageWidgetDB(pageId) + preprocPage<-getPagePreprocPageDB(pageId) + rtv<-c( + fileDescriptor=getFileDescriptor(pageId), + code=getCode(), + assetSelection=asel, + backdrop=backdrop, + grid=grid, + trib=trib, + dnip=dnip, + widg=widg, + preprocPage=preprocPage + ) + + # ppE<-getPreProcPtEntries(pageId) + # if(length(ppE)!=0 && nrow(ppE)>0){ + # rtv<-c(rtv, preprocScripts=ppE) + # } + # if(length(preprocPage)) + saveRDS(object=rtv, file = fileName) + } log.fout(savePage) } } From 9f9e30a28464e794cd19e95e63af04bd6962398c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Sun, 7 Feb 2021 19:55:46 -0500 Subject: [PATCH 200/263] store and save input$pages only if has no parent --- inst/App/leftPanel/menu/cmdFileQuit.R | 4 ++-- inst/App/leftPanel/pproj/pprojUtil.R | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/inst/App/leftPanel/menu/cmdFileQuit.R b/inst/App/leftPanel/menu/cmdFileQuit.R index ce536264..85181a89 100644 --- a/inst/App/leftPanel/menu/cmdFileQuit.R +++ b/inst/App/leftPanel/menu/cmdFileQuit.R @@ -2,8 +2,8 @@ cmdFileQuit<-reactive({ log.fin(cmdFileQuit) - storeAssetState() - if("parId" %in% names( fileDescDB())){ #shoul + storeAssetState() # should check if + if("parId" %in% names( fileDescDB())){ #should remove all child tabs aids<-filter(fileDescDB(), !is.na(parId) & filePath=="?")$tabId if(length(aids)>0){ tabs<-aceID2TabID(aids) diff --git a/inst/App/leftPanel/pproj/pprojUtil.R b/inst/App/leftPanel/pproj/pprojUtil.R index d31ac7f6..68e6d567 100644 --- a/inst/App/leftPanel/pproj/pprojUtil.R +++ b/inst/App/leftPanel/pproj/pprojUtil.R @@ -12,9 +12,14 @@ # for the time being we just close closeCurrentProj<-function(){ log.fin(closeCurrentProj) + # check if current page has a parId + # if so, set current tab to par Id + # + if( is.na(getFileDescriptor(input$pages )$parId )){ + storeAssetState() # this stores the selectedAsset ubti db + savePage(input$pages) # this saves the current page + } - storeAssetState() - savePage(input$pages) pprj(NULL) if(!is.null(editOption$currentProjectName)){ addToRecentProjects(editOption$currentProjectDirectory, editOption$currentProjectName ) From 3f245a78dce1cd8cf54106048e08ea0f0e42f291 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Mon, 8 Feb 2021 17:33:18 -0500 Subject: [PATCH 201/263] adding block insertion to menu --- inst/App/fileIO/dndSnippetLoader.R | 4 ++++ inst/App/leftPanel/mid/UIcontextMenu.R | 5 +++-- inst/App/util/dbInitiatizers.R | 2 +- inst/App/util/logger.R | 2 +- inst/App/util/reOrgPanels.R | 9 +++++++++ inst/App/www/ptR/contextMenu.js | 16 +++++++++++++++- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/inst/App/fileIO/dndSnippetLoader.R b/inst/App/fileIO/dndSnippetLoader.R index da07600a..1631536d 100644 --- a/inst/App/fileIO/dndSnippetLoader.R +++ b/inst/App/fileIO/dndSnippetLoader.R @@ -123,6 +123,10 @@ dripplets2List2<-function(drps){ paste(toupper(substring(s, 1, 1)), substring(s, 2), sep = "", collapse = " ") } + drps<-lapply(drps, function(dr){ + dr['snip']<-gsub("\\```","```" , dr['snip']) + dr + }) if(!is.null(editOption$currentProjectName)){ cname<-sub('\\.pprj$','', editOption$currentProjectName) Cname<-s.upper(cname) diff --git a/inst/App/leftPanel/mid/UIcontextMenu.R b/inst/App/leftPanel/mid/UIcontextMenu.R index 4f05393a..1d036230 100644 --- a/inst/App/leftPanel/mid/UIcontextMenu.R +++ b/inst/App/leftPanel/mid/UIcontextMenu.R @@ -10,7 +10,6 @@ UIcontextMenu<-function(){ tag('li',list(class='clickMe', span(class='icon-scissors'),span('Cut') )), tag('li',list(class='clickMe', span(class='icon-paste'),span('Paste') )), tag('li',list(class='clickMe', span(class='icon-cancel'),span('Delete') ))#, - # tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-file-code'),span('Edit Code Block') )) )), hr(class='contexthr') ) @@ -20,7 +19,9 @@ UIcontextMenu<-function(){ tag('ul', list( id='items', tag('li',list(class='clickMe', span(class="icon-help"), span( 'Lookup element'))), - tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-file-code'),span('Edit Code Block') )) + tag('li',list(id='rmd-insert-svgR', class='clickMe', span(class=" icon-circle-empty"), span( 'Insert svgR Block'))), + tag('li',list(id='rmd-insert-ptR', class='clickMe', span(class="icon-circle"), span( 'Insert ptR Block'))), + tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-edit'),span('Edit Code Block') )) )) ) } \ No newline at end of file diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index 1552bd12..12f5363a 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -5,7 +5,7 @@ initialFileDescDB<-function(){tibble( filePath="?", anonNo =1, mode='ptr', - parId=NA + parId=NA # points to the parent tab (if any) )[0,] } diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index 3f504dec..d5f25dc8 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,5 +1,5 @@ -SHOW_DEBUG_LOG=TRUE +SHOW_DEBUG_LOG=FALSE log.fin<-function(x){ if(SHOW_DEBUG_LOG){ diff --git a/inst/App/util/reOrgPanels.R b/inst/App/util/reOrgPanels.R index b505e133..d3dee025 100644 --- a/inst/App/util/reOrgPanels.R +++ b/inst/App/util/reOrgPanels.R @@ -19,6 +19,8 @@ reOrgPanels<-function(id, mode){ hideElement("midRightPanels") hideElement("BottomRightPanel") hide(id="rmd-edit-code") + hide(id="rmd-insert-svgR") + hide(id="rmd-insert-ptR") addCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") showElement("logo.right") showElement("logo.left") @@ -34,6 +36,8 @@ reOrgPanels<-function(id, mode){ showElement("useTribble") # todo!!! show only if mode==ptR and there is a tribble or tibble addCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") hide(id="rmd-edit-code") + hide(id="rmd-insert-svgR") + hide(id="rmd-insert-ptR") if(usingElectron){ addCssClass( id= "runAppPanel", class="hiddenPanel") addCssClass( id= "stopAppPanel", class="hiddenPanel") @@ -52,10 +56,15 @@ reOrgPanels<-function(id, mode){ # now consider which mode it is if(identical(mode,'ptrrmd')){ show(id="rmd-edit-code") + show(id="rmd-insert-svgR") + show(id="rmd-insert-ptR") + removeCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") } else{ hide(id="rmd-edit-code") + hide(id="rmd-insert-svgR") + hide(id="rmd-insert-ptR") addCssClass( id= "rmdBrowserButtonPanel", class="hiddenPanel") } if(usingElectron){ diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index 5fff4941..d2ec9a48 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -11,6 +11,20 @@ $(function () { editor.getSession().selection.selectWordRight(); let text = editor.getSession().getTextRange(editor.getSelectionRange()); Shiny.onInputChange('helpMssg', {query:text, num:Math.random(), editorId: aceId} ); + } else if(cmd=="Insert svgR Block"){ + //$el.trigger(tab_press); + let snippet= + "```{r, ${1:title,} echo=${2:FALSE}, results='asis'}\nWH=c(500,300)\nsvgR(wh=WH,\n #your custom code goes here\n ${0:NULL}\n)\n```"; + let snippetManager = ace.require("ace/snippets").snippetManager; + snippetManager.insertSnippet(editor, snippet); + editor.focus(); + } else if(cmd=="Insert ptR Block"){ + let snippet= + "```{r, ${1:title,} echo=${2:FALSE}, results='asis'}\nWH<-c(600,400)\n\n# Defined by mouse: edit with care!\nptR<-list(\n x=tribble(\n ~points,\n matrix(0,2,0)\n )\n)\n\nsvgR(wh=WH,\n #your custom code goes here\n ${0:NULL}\n)\n\n```"; + let snippetManager = ace.require("ace/snippets").snippetManager; + snippetManager.insertSnippet(editor, snippet); + editor.focus(); + } else if(cmd=="Edit Code Block"){ //let pos=e.getDocumentPosition(); ///console.log('#########################'); @@ -136,7 +150,7 @@ $(function () { } - } + } //end of edit code block } else if(cmd==='Copy') { let text = editor.getSession().getTextRange(editor.getSelectionRange()); //window.clipboard.writeText(text); From db1386c8342ac59f685c20f547904360bbb2e761 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 11 Feb 2021 12:10:26 -0500 Subject: [PATCH 202/263] bug fix: allow . and _ in colume names --- inst/App/util/utilptR.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/util/utilptR.R b/inst/App/util/utilptR.R index 26d6a518..e5613c04 100755 --- a/inst/App/util/utilptR.R +++ b/inst/App/util/utilptR.R @@ -1,7 +1,7 @@ # enforce naming convention goodName<-function(s, n=1){ if(length(s)==1 && typeof(s)=='character' && nchar(s)>=n){ - grepl('^[[:alpha:]][[:alnum:]]*$', s) + grepl('^[[:alpha:]][[:alnum:]\\._]*$', s) } else{ FALSE } From f34e6e668d364cd134eb5c30ad701842d16dace3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 11 Feb 2021 16:06:30 -0500 Subject: [PATCH 203/263] remove offending } at line 486 --- inst/App/www/Acejs/aceExt.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/App/www/Acejs/aceExt.js b/inst/App/www/Acejs/aceExt.js index 97834d87..6d539406 100644 --- a/inst/App/www/Acejs/aceExt.js +++ b/inst/App/www/Acejs/aceExt.js @@ -467,9 +467,9 @@ Shiny.addCustomMessageHandler( //---------------replacement------------------ if(!!data.replacement){ - console.log("\n\nEntering data.replacement"); + //console.log("\n\nEntering data.replacement"); var replacement = data.replacement; - console.log(JSON.stringify(replacement)); + //console.log(JSON.stringify(replacement)); ud=editor.getSession().getUndoManager(); //console.log('1: undoManager is: ' + simpleStringify( ud )); @@ -483,7 +483,7 @@ Shiny.addCustomMessageHandler( if( ud.$ok.length>0 ){ // if we can, first roll back to a good state, then replace //console.log( "ud.$ok.length="+ud.$ok.length ); ud.pop2Ok(); - } /* + /* console.log('2: undoManager is: ' + simpleStringify( ud )); //console.log('2: ud.$ok is: ' + simpleStringify( ud.$ok )); console.log('2: ud.$ok is: ' + JSON.stringify( ud.$ok )); From 07921e740685b9b041e0158e4688d214d9a39793 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 11 Feb 2021 16:08:57 -0500 Subject: [PATCH 204/263] cosmetic --- inst/App/leftPanel/mid/serverAce.R | 2 +- inst/App/leftPanel/tabs/serverNewPage.R | 4 ++-- inst/App/rightPanel/choiceSet/modalChoiceSet.R | 2 +- inst/App/rightPanel/mid/serverPlotRmd.R | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/inst/App/leftPanel/mid/serverAce.R b/inst/App/leftPanel/mid/serverAce.R index 63ef786e..16fce540 100644 --- a/inst/App/leftPanel/mid/serverAce.R +++ b/inst/App/leftPanel/mid/serverAce.R @@ -5,7 +5,7 @@ observeEvent(input$messageFromAce, { if(length(input$messageFromAce$sender)>0){ if(length(input$messageFromAce$preDoc)>0){ - cat('has preDoc\n') + # cat('has preDoc\n') pDoc<-input$messageFromAce$preDoc if(!identical(pDoc, request$pDoc)){ pBlocks<-NULL diff --git a/inst/App/leftPanel/tabs/serverNewPage.R b/inst/App/leftPanel/tabs/serverNewPage.R index 518517a0..29e93cb9 100644 --- a/inst/App/leftPanel/tabs/serverNewPage.R +++ b/inst/App/leftPanel/tabs/serverNewPage.R @@ -16,8 +16,8 @@ newPage<-function(tabId, title, txt, docFilePath, mode, fileSaveStatus, link=NU } else { divClass="cAceRmdContainer" } - print("**** newPage link") - print(link) + # print("**** newPage link") + # print(link) appendTab( inputId = "pages", select=TRUE, tabPanel( diff --git a/inst/App/rightPanel/choiceSet/modalChoiceSet.R b/inst/App/rightPanel/choiceSet/modalChoiceSet.R index c30e88a8..01275b88 100644 --- a/inst/App/rightPanel/choiceSet/modalChoiceSet.R +++ b/inst/App/rightPanel/choiceSet/modalChoiceSet.R @@ -38,7 +38,7 @@ modalCustColumnEditor <- function( custColumnName, value="TRUE\nFALSE" ) { observeEvent(input$modalCustColumnName,{ CustColumnName<-input$modalCustColumnName #if(length(CustColumnName)==0 || nchar(CustColumnName)<6 || CustColumnName %in% names(allWidgetChoices)){ - if(!goodName(CustColumnName,5) || CustColumnName %in% allWidgetNames){ + if(!goodRName(CustColumnName,5) || CustColumnName %in% allWidgetNames){ hideElement("modalCustColumnEditorCommitOk") } else { showElement("modalCustColumnEditorCommitOk") diff --git a/inst/App/rightPanel/mid/serverPlotRmd.R b/inst/App/rightPanel/mid/serverPlotRmd.R index 5101c056..883ba56c 100644 --- a/inst/App/rightPanel/mid/serverPlotRmd.R +++ b/inst/App/rightPanel/mid/serverPlotRmd.R @@ -35,10 +35,10 @@ rmdModuleList<-callModule( extractCodeBlocksFromRmd<-function(txt){ lines<-unlist(str_split(txt, '\n')) - print(lines) + # print(lines) pos<-grep('^```', lines) np<-length(pos) - cat('np=',format(np),"\n") + # cat('np=',format(np),"\n") blocks<-NULL if(np>=2){ if(np%%2==1){ @@ -46,20 +46,20 @@ extractCodeBlocksFromRmd<-function(txt){ } pow<-pos[1:np] pos<-matrix(pow,2) - print(pos) + # print(pos) i<-pos[1,] ll<-lines[i] cols<-grep('^```\\s*\\{\\s*r[,[:space:]]',lines[i]) - cat('cols=',format(cols),'\n') + # cat('cols=',format(cols),'\n') pos<-pos[,cols] if(length(cols)>0){ pos<-matrix(pos,2) - print(pos) + # print(pos) blocks<-apply(pos,2, function(x){ paste0(lines[(x[1]+1):(x[2]-1)], collapse="\n") }) - print(blocks) + # print(blocks) } } blocks From 6552f517707b58177b2a3c7b1b7b617be3e5f86e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 11 Feb 2021 16:09:25 -0500 Subject: [PATCH 205/263] add _ to goodRName --- inst/App/util/utilptR.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/util/utilptR.R b/inst/App/util/utilptR.R index e5613c04..5897a620 100755 --- a/inst/App/util/utilptR.R +++ b/inst/App/util/utilptR.R @@ -10,7 +10,7 @@ goodName<-function(s, n=1){ goodRName<-function(s, n=1){ if(length(s)==1 && typeof(s)=='character' && nchar(s)>=n){ - grepl('^[[:alpha:]\\.][[:alnum:]\\.]*$', s) + grepl('^[[:alpha:]\\.][[:alnum:]\\._]*$', s) } else{ FALSE } From 628ac82d747663c165fa9d93704ca5783655d375 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 18 Jun 2021 13:14:37 -0400 Subject: [PATCH 206/263] limited functionality for dndsnipptes --- inst/App/fileIO/dndSnippetLoader.R | 8 +- inst/App/fileIO/serverFileDescriptor.R | 29 ++++++- inst/App/leftPanel/mid/UIcontextMenu.R | 3 +- inst/App/leftPanel/tabs/serverFileTabs.R | 16 +++- inst/App/rightPanel/header/moduleEdTib.R | 2 +- inst/App/rightPanel/mid/moduleSVGR.R | 36 ++++++-- inst/App/rightPanel/mid/serverPlotBarPoints.R | 7 +- inst/App/rightPanel/mid/serverPlotBarSVG.R | 7 +- .../App/rightPanel/mid/serverPlotBarTagDrag.R | 7 +- .../rightPanel/mid/serverPlotBarTagValues.R | 5 +- .../rightPanel/mid/serverPlotBarTransform.R | 5 +- inst/App/util/dbInitiatizers.R | 3 +- inst/App/util/logger.R | 2 +- inst/App/util/reOrgPanels.R | 6 ++ inst/App/www/ptR/contextMenu.js | 82 ++++++++++++------- 15 files changed, 155 insertions(+), 63 deletions(-) diff --git a/inst/App/fileIO/dndSnippetLoader.R b/inst/App/fileIO/dndSnippetLoader.R index 1631536d..d0887e21 100644 --- a/inst/App/fileIO/dndSnippetLoader.R +++ b/inst/App/fileIO/dndSnippetLoader.R @@ -21,9 +21,11 @@ dripplets2Rmd<-function( drps ){ unlist(str_split(drps, '\n'))->drps indx<-m[2,] drps[indx]<-paste( - "temp$root$setAttr('width',480)", - "temp$root$setAttr('height',320)", - "temp$root$setAttr('viewBox','0 0 48 32')", + # "temp$root$setAttr('width',480)", + # "temp$root$setAttr('height',320)", + # "temp$root$setAttr('viewBox','0 0 48 32')", + "temp$root$setAttr('stroke','#00FFFF')", + "temp$root$setAttr('fill','#00FFFF')", "temp$root$prependChildren( svgR:::use(filter=svgR:::filter( filterUnits='userSpaceOnUse', svgR:::feFlood(flood.color='black') ) ) )", diff --git a/inst/App/fileIO/serverFileDescriptor.R b/inst/App/fileIO/serverFileDescriptor.R index 45ba8b70..d5260ca3 100644 --- a/inst/App/fileIO/serverFileDescriptor.R +++ b/inst/App/fileIO/serverFileDescriptor.R @@ -14,7 +14,7 @@ getNextAnonFileNum<-reactive({ }) # to be called from serverFileTab.R::addFileTab -addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode, parId=NA){ +addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode, parId=NA, parMode=NA){ if(identical(docFilePath,"?")){ anonNo<-getNextAnonFileNum() } else { @@ -24,7 +24,7 @@ addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode, parId=NA){ parId=NA } tb<-tibble(tabId=pageId, isSaved=fileSaveStatus, - filePath=docFilePath, anonNo, mode=fileMode, parId=parId) + filePath=docFilePath, anonNo, mode=fileMode, parId=parId, parMode=parMode) fd<- fileDescDB() fd<-bind_rows(fd,tb) fileDescDB(fd) @@ -45,6 +45,31 @@ getMode<-reactive({ mode }) +getParMode<-reactive({ + cat('>---> getParMode\n') + tabId<-input$pages # getTibTabId() + cat(paste('tabId=',format(tabId))) + if(is.null(tabId) || identical(tabId, 'bogus')){ + cat('seting parNode to NULL') + parMode<-NULL + } else { + fd<-fileDescDB() + print(fd) + print(fd$tabId) + print(fd$parMode) + #stopifnot('tabId' %in% names(fd)) + parMode<-fd[fd$tabId==input$pages,]$parMode + cat('parMode=') + cat(format(parMode)) + if(is.na(parMode)){ + parMode<-NULL + } + } + # print(parMode) + #parMode='dnds' + parMode +}) + # in getModeX we need to insert flag to enable/disable appmode # we could use shinyjs to query a property of a (hidden) node? # or use ptR.js to do an on.change ? diff --git a/inst/App/leftPanel/mid/UIcontextMenu.R b/inst/App/leftPanel/mid/UIcontextMenu.R index 1d036230..08ddc7ea 100644 --- a/inst/App/leftPanel/mid/UIcontextMenu.R +++ b/inst/App/leftPanel/mid/UIcontextMenu.R @@ -21,7 +21,8 @@ UIcontextMenu<-function(){ tag('li',list(class='clickMe', span(class="icon-help"), span( 'Lookup element'))), tag('li',list(id='rmd-insert-svgR', class='clickMe', span(class=" icon-circle-empty"), span( 'Insert svgR Block'))), tag('li',list(id='rmd-insert-ptR', class='clickMe', span(class="icon-circle"), span( 'Insert ptR Block'))), - tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-edit'),span('Edit Code Block') )) + tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-edit'),span('Edit Code Block') )), + tag('li',list(id='dnd-edit-svgR', class='clickMe', span(class="icon-edit"), span( 'Edit DNDS Icon'))) )) ) } \ No newline at end of file diff --git a/inst/App/leftPanel/tabs/serverFileTabs.R b/inst/App/leftPanel/tabs/serverFileTabs.R index be732b8a..fe6e1f44 100644 --- a/inst/App/leftPanel/tabs/serverFileTabs.R +++ b/inst/App/leftPanel/tabs/serverFileTabs.R @@ -73,7 +73,7 @@ closeTabsNow<-function(tabIds2Close){ # TODO!!!! , add input parameters for: autocomplete # fontsize should be read from options -addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FALSE, link=NULL){ +addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FALSE, link=NULL, parMode=NA){ log.fin(addFileTab) tabId<-getNextTabId() @@ -82,7 +82,8 @@ addFileTab<-function(title, txt, docFilePath='?', mode='ptr', fileSaveStatus=FA if(!is.null(link)){ parId<-unlist(strsplit(link,'\\.'))[[1]] } - addFileDesc(pageId=tabId, docFilePath=docFilePath, fileSaveStatus, fileMode=mode, parId) + cat(format(parMode)) + addFileDesc(pageId=tabId, docFilePath=docFilePath, fileSaveStatus, fileMode=mode, parId, parMode) setUseTribble( pageId=tabId, value=TRUE) addNewPage2dnippetsDB(tabId) @@ -157,7 +158,15 @@ observeEvent(c(request$trigger,request$tabs), { observeEvent(input$messageContextMenu, { cmd=input$messageContextMenu$cmd + cat('cmd=') + cat(format(cmd)) + parMode<-input$messageContextMenu$parMode + cat('\ninput$messageContextMenu$parMode return value=') + cat(format(parMode)) + cat("\n") if(cmd=="newTab"){ + # print(start_row) + # print(end_row) start_row=input$messageContextMenu$start_row end_row=input$messageContextMenu$end_row src<-input$messageContextMenu$code @@ -165,6 +174,7 @@ observeEvent(input$messageContextMenu, { tabName<-input$messageContextMenu$label rmdAceId<-tabID2aceID(input$pages) link<-paste(rmdAceId,rid, sep=".") + # we update Ace with code # + all prior code as a hidden portion # and keep a hidden copy of full text for later reinsertion. @@ -172,7 +182,7 @@ observeEvent(input$messageContextMenu, { if(tabName==""){ tabName<-getNextAnonymousFileName() } - tabId<-addFileTab(title=tabName, txt=src, docFilePath="?", mode='ptr', fileSaveStatus=FALSE, link=link) + tabId<-addFileTab(title=tabName, txt=src, docFilePath="?", mode='ptr', fileSaveStatus=FALSE, link=link, parMode=parMode) # aceId<-tabID2aceID(tabId) # alternatively set ace content of to code, and save full txt somewhere diff --git a/inst/App/rightPanel/header/moduleEdTib.R b/inst/App/rightPanel/header/moduleEdTib.R index d2821577..987db028 100644 --- a/inst/App/rightPanel/header/moduleEdTib.R +++ b/inst/App/rightPanel/header/moduleEdTib.R @@ -47,7 +47,7 @@ moduleEdTib<-function(input, output, session, name, nameChoices, getRowIndex, - getTibNRow, + getTibNRow, #extraneous??? matColIndex, matColIndexChoices, getMatColIndex, diff --git a/inst/App/rightPanel/mid/moduleSVGR.R b/inst/App/rightPanel/mid/moduleSVGR.R index fba4efa1..11aca225 100644 --- a/inst/App/rightPanel/mid/moduleSVGR.R +++ b/inst/App/rightPanel/mid/moduleSVGR.R @@ -22,13 +22,14 @@ svgToolsScript<-function(type){ showPts.compound, # =showsvgRPoints.pts2 ptrDisplayScript, # =js.scripts[[ "Points"]] useKeyMouseScript, # - getSVGWH, + # getSVGWH, #not used here??? getSvgGrid, getBackDrop, getCode, getEnvList, getErrorMssg, - getTibNRow, # doesnot appear + # getTibNRow, # doesnot appear + getParMode, getDirPath ){ ns <- session$ns @@ -78,7 +79,7 @@ svgToolsScript<-function(type){ output$svghtml <- renderUI({ # renderUI is probably not the most efficient approach!!! - WH<-getSVGWH() + #WH<-getSVGWH() # not used here??? codeTxt<-getCode() if(is.null(getSvgGrid())){return(NULL)} @@ -100,6 +101,17 @@ svgToolsScript<-function(type){ parsedCode<-parse(text=paste0(wd,codeTxt)) svg<-eval(parsedCode, getEnvList() ) + parentMode<-getParMode() + cat('parentMode= ') + cat(format(parentMode)) + if(identical(parentMode, 'dnippets')){ + cat('\ngot it') + svg$root$setAttr('width',480) + svg$root$setAttr('height',320) + svg$root$setAttr('viewBox','0 0 48 32') + svg$root$setAttr('stroke','#00FFFF') + svg$root$setAttr('fill','#00FFFF') + } w<-svg$root$getAttr('width') h<-svg$root$getAttr('height') rtv$WH<-c(w,h) @@ -118,16 +130,25 @@ svgToolsScript<-function(type){ vbScaleFactor<-1 } } - }, error=function(e){ + }, + error=function(e){ vbScaleFactor<-1 }) + if(identical(parentMode, 'dnippets')){ + vbScaleFactor<-10 + dxy=c(5,5) + svg$root$prependNode( graphPaper2( wh=c(48,32), dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor) ) + svg$root$prependChildren( + svgR:::use(filter=svgR:::filter( filterUnits='userSpaceOnUse', svgR:::feFlood(flood.color='black') ) ) + ) + } svg$root$setAttr('id',svgID) if(getSvgGrid()$show==TRUE){ dxy<-c( getSvgGrid()$dx, getSvgGrid()$dy) #svg$root$prependNode(svgR:::graphPaper( wh=c(w,h), dxy=dxy, labels=TRUE )) #need to replace with vbScaleFactor-scalable version #svg$root$prependNode( graphPaper2( wh=c(w,h), dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor)) - svg$root$prependNode( graphPaper2( wh=gWH, dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor)) + svg$root$prependNode( graphPaper2( wh=gWH, dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor) ) } if(getBackDrop()$checked==FALSE){ svg$root$prependChildren( @@ -159,10 +180,7 @@ svgToolsScript<-function(type){ keyMouseScript=paste0('onKeyMouseDown(evt, "', svgID, '")') svg$root$addAttributes(list(onmousedown=keyMouseScript)) } - - - - as.character(svg)->svgOut + as.character(svg)->svgOut res<-HTML(svgOut) rtv$status<-list( state="PASS", diff --git a/inst/App/rightPanel/mid/serverPlotBarPoints.R b/inst/App/rightPanel/mid/serverPlotBarPoints.R index af141bfc..c5f63dec 100755 --- a/inst/App/rightPanel/mid/serverPlotBarPoints.R +++ b/inst/App/rightPanel/mid/serverPlotBarPoints.R @@ -124,13 +124,14 @@ statusPlotPoint<-callModule( }), ptrDisplayScript = reactive({ svgToolsScript( "Points") }), useKeyMouseScript=FALSE, - getSVGWH, + # getSVGWH, #extraneous??? getSvgGrid, getBackDrop, getCode4Rendering, getEnvList=getEnvList, getErrorMssg, - getTibNRow=getTibNRow, + #getTibNRow=getTibNRow, #extraneous + getParMode=getParMode, getDirPath=getDirPath ) @@ -141,7 +142,7 @@ observeEvent(c(statusPlotPoint$status(), statusPlotPoint$WH()), { mssg$err<-paste(mssg$err, status$message, "cannot plot: code02\n", collapse="\n") } else { wh<-statusPlotPoint$WH() - getSVGWH(wh) + getSVGWH(wh) #sets the wh value for later use } }) diff --git a/inst/App/rightPanel/mid/serverPlotBarSVG.R b/inst/App/rightPanel/mid/serverPlotBarSVG.R index a387e5ae..84b6a9e4 100644 --- a/inst/App/rightPanel/mid/serverPlotBarSVG.R +++ b/inst/App/rightPanel/mid/serverPlotBarSVG.R @@ -12,13 +12,14 @@ statusPlotSVG<-callModule( }), ptrDisplayScript = reactive({ list("") }), useKeyMouseScript=FALSE, - getSVGWH, + # getSVGWH, #extraneous??? getSvgGrid, getBackDrop, getCode4Rendering, getEnvList=getEnvList, getErrorMssg, - getTibNRow=getTibNRow, + #getTibNRow=getTibNRow, #extraneous + getParMode=getParMode, getDirPath=getDirPath ) @@ -29,7 +30,7 @@ observeEvent(c(statusPlotSVG$status(), statusPlotSVG$WH()), { mssg$err<-paste(mssg$err, status$message, "cannot plot: code02\n", collapse="\n") } else { wh<-statusPlotPoint$WH() - getSVGWH(wh) + getSVGWH(wh) #sets the wh value for later use } }) diff --git a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R index 27935324..3ce3bf6b 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R @@ -110,13 +110,14 @@ statusPlotTagDrag<-callModule( }), ptrDisplayScript = reactive({ svgToolsScript( "TagDrag") }), useKeyMouseScript=TRUE, - getSVGWH=getSVGWH, + # getSVGWH=getSVGWH, #extraneous??? getSvgGrid=getSvgGrid, getBackDrop=getBackDrop, getCode= getCode4Rendering, getEnvList=getEnvList, getErrorMssg=getErrorMssg, - getTibNRow=getTibNRow, + #getTibNRow=getTibNRow, #extraneous??? + getParMode=getParMode, getDirPath=getDirPath ) @@ -127,7 +128,7 @@ observeEvent(c(statusPlotTagDrag$status(), statusPlotPoint$WH()), { # switch to log } else { wh<-statusPlotPoint$WH() - getSVGWH(wh) + getSVGWH(wh) #sets the wh value for later use } }) diff --git a/inst/App/rightPanel/mid/serverPlotBarTagValues.R b/inst/App/rightPanel/mid/serverPlotBarTagValues.R index 3a46ac51..b69aa96c 100755 --- a/inst/App/rightPanel/mid/serverPlotBarTagValues.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagValues.R @@ -99,13 +99,14 @@ statusPlotTagVal<-callModule( }), ptrDisplayScript = reactive({ svgToolsScript( "TagVal") }), useKeyMouseScript=TRUE, - getSVGWH, + # getSVGWH, #extraneous??? getSvgGrid, getBackDrop, getCode4Rendering, getEnvList=getEnvList, getErrorMssg, - getTibNRow=getTibNRow, + #getTibNRow=getTibNRow, #extraneous + getParMode=getParMode, getDirPath=getDirPath ) diff --git a/inst/App/rightPanel/mid/serverPlotBarTransform.R b/inst/App/rightPanel/mid/serverPlotBarTransform.R index eee24ac3..737cbf22 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTransform.R +++ b/inst/App/rightPanel/mid/serverPlotBarTransform.R @@ -12,13 +12,14 @@ statusPlotTransform<-callModule( svgToolsScript(type) }), useKeyMouseScript=FALSE, - getSVGWH, + # getSVGWH, #extraneous??? getSvgGrid, getBackDrop, getCode = getCode4RenderingTransform, getEnvList=getEnvList, getErrorMssg, - getTibNRow=getTibNRow, + #getTibNRow=getTibNRow, #extraneous + getParMode=getParMode, getDirPath=getDirPath ) diff --git a/inst/App/util/dbInitiatizers.R b/inst/App/util/dbInitiatizers.R index 12f5363a..a5251ef6 100644 --- a/inst/App/util/dbInitiatizers.R +++ b/inst/App/util/dbInitiatizers.R @@ -5,7 +5,8 @@ initialFileDescDB<-function(){tibble( filePath="?", anonNo =1, mode='ptr', - parId=NA # points to the parent tab (if any) + parId=NA, # points to the parent tab (if any) + parMode=NA )[0,] } diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index d5f25dc8..3f504dec 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,5 +1,5 @@ -SHOW_DEBUG_LOG=FALSE +SHOW_DEBUG_LOG=TRUE log.fin<-function(x){ if(SHOW_DEBUG_LOG){ diff --git a/inst/App/util/reOrgPanels.R b/inst/App/util/reOrgPanels.R index d3dee025..1c335104 100644 --- a/inst/App/util/reOrgPanels.R +++ b/inst/App/util/reOrgPanels.R @@ -38,6 +38,7 @@ reOrgPanels<-function(id, mode){ hide(id="rmd-edit-code") hide(id="rmd-insert-svgR") hide(id="rmd-insert-ptR") + hide(id="dnd-edit-svgR") if(usingElectron){ addCssClass( id= "runAppPanel", class="hiddenPanel") addCssClass( id= "stopAppPanel", class="hiddenPanel") @@ -54,6 +55,11 @@ reOrgPanels<-function(id, mode){ hideElement("useTribble") # todo!!! show only if mode==ptR and there is a tribble or tibble # now consider which mode it is + if(identical(mode,'dnippets')){ + show(id="dnd-edit-svgR") + } else { + hide(id="dnd-edit-svgR") + } if(identical(mode,'ptrrmd')){ show(id="rmd-edit-code") show(id="rmd-insert-svgR") diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index d2ec9a48..b131fc3b 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -25,39 +25,61 @@ $(function () { snippetManager.insertSnippet(editor, snippet); editor.focus(); - } else if(cmd=="Edit Code Block"){ + } else if(cmd=="Edit Code Block" || cmd=='Edit DNDS Icon'){ //let pos=e.getDocumentPosition(); ///console.log('#########################'); // console.log(JSON.stringify(pos)); let Range = ace.require('ace/range').Range; - let rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition(), range:null}); - if(!rng1){ return null} - let row1=rng1.start.row; - // add check for "{ r , }"" in row1, - let rngL1 = new Range(row1, 0, row1, Infinity); - let line1 = editor.getSession().getTextRange(rngL1); - if(!/\Wr\W/.test(line1)){ // if not found exit - return null; - } - // split line and look for r, and label - // remove ```, {, } and split - let toks=line1.replace("```","").replace(/ /g,"").replace("{","").replace("}","").split(","); - // search for r - let hasR = toks.filter(tok => tok=='r').length==1; - if(!hasR){ - return null; - } - let label = toks.filter(tok => tok.match(/label=.*/)); - if(label.length===1){ - label=label[0].replace(/label='/,"").replace("'","").replace('"',''); + let rng1=null; + parMode=null; + if(cmd== "Edit Code Block"){ + parMode='ptrrmd'; + rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition(), range:null}); + if(!rng1){ return null} + } else { - label =toks.filter(tok=>!tok.match('=')).filter(tok=>tok!='r'); - if(label.length==1){ - label=label[0].replace("'","").replace('"',''); - } else { - label=""; + parMode='dnippets'; + rng1=editor.find('***', {backwards:true, start:editor.getCursorPosition(), range:null}); + if(!rng1){ return null} + rng1=editor.find('SVGR', {backwards:false, start:editor.getCursorPosition(), range:null}); + if(!rng1){ return null} + rng1=editor.find('```', {backwards:false, start:editor.getCursorPosition(), range:null}); + if(!rng1){ return null} + } + + + let row1=rng1.start.row; + let label=""; + + if(parMode=='ptrrmd'){ + let rngL1 = new Range(row1, 0, row1, Infinity); + let line1 = editor.getSession().getTextRange(rngL1); + if(!/\Wr\W/.test(line1)){ // if not found exit + return null; } - } + // split line and look for r, and label + // remove ```, {, } and split + let toks=line1.replace("```","").replace(/ /g,"").replace("{","").replace("}","").split(","); + // search for r + let hasR = toks.filter(tok => tok=='r').length==1; + if(!hasR){ + return null; + } + + label = toks.filter(tok => tok.match(/label=.*/)); + if(label.length===1){ + label=label[0].replace(/label='/,"").replace("'","").replace('"',''); + } else { + label =toks.filter(tok=>!tok.match('=')).filter(tok=>tok!='r'); + if(label.length==1){ + label=label[0].replace("'","").replace('"',''); + } else { + label=""; + } + } + } + // add check for "{ r , }"" in row1, + let rng2=editor.find('```', {backwards:false, start:editor.getCursorPosition(), range:null}); @@ -99,7 +121,8 @@ $(function () { Shiny.onInputChange('messageContextMenu', { cmd: "openTab", - id:childAceId + id:childAceId, + parMode: parMode }); return(null); } @@ -142,7 +165,8 @@ $(function () { end_row: row2, code : text, id:rid, - label: label + label: label, + parMode: parMode }); // exit gracefully From 9aa417b49d24e506304cb08bcc909deae9196751 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 08:52:39 -0400 Subject: [PATCH 207/263] grid and backdrop enable if in parmode --- inst/App/rightPanel/serverPanelCoordinator.R | 30 ++++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/inst/App/rightPanel/serverPanelCoordinator.R b/inst/App/rightPanel/serverPanelCoordinator.R index 4a2b8310..7ee149ec 100644 --- a/inst/App/rightPanel/serverPanelCoordinator.R +++ b/inst/App/rightPanel/serverPanelCoordinator.R @@ -155,18 +155,36 @@ label= 'getRightPanelChoices' ) -observeEvent(c(getSourceType(), hasError()),{ +observeEvent(c(getSourceType(), hasError(), getParMode() ),{ if(!hasError() && identical(getSourceType(), svgPanelTag)){ enableDMDM( session, menuBarId="plotNavBar", entry="Grid" ) - enableDMDM( - session, - menuBarId="plotNavBar", - entry="Backdrop" - ) + if(is.null(getParMode()) ){ + enableDMDM( + session, + menuBarId="plotNavBar", + entry="Backdrop" + ) + enableDMDM( + session, + menuBarId="plotNavBar", + entry="cmdAdjustGridSpacing" + ) + } else { + disableDMDM( + session, + menuBarId="plotNavBar", + entry="Backdrop" + ) + disableDMDM( + session, + menuBarId="plotNavBar", + entry="cmdAdjustGridSpacing" + ) + } } else { disableDMDM( session, From 7f35f6dad1b04814587c56ca6388ee6fcd2aefe0 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 09:24:23 -0400 Subject: [PATCH 208/263] use labelColor for stroke for pointlabels --- inst/App/rightPanel/mid/serverPlotBarPoints.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mid/serverPlotBarPoints.R b/inst/App/rightPanel/mid/serverPlotBarPoints.R index c5f63dec..807d0438 100755 --- a/inst/App/rightPanel/mid/serverPlotBarPoints.R +++ b/inst/App/rightPanel/mid/serverPlotBarPoints.R @@ -20,6 +20,10 @@ displayOpt<-displayOptions if(is.null(displayOpt)||is.null(displayOpt$labelMode) || is.null(displayOpt$restrictMode)){ return(NULL)} + labelColor<-'#000000' # black by default but override if displayOpt specifies it. + if(!is.null(displayOpt$labelColor)){ + labelColor<-displayOpt$labelColor + } # if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } onMouseDownTxt='ptRPlotter_ptR_SVG_Point.selectPoint(evt)' @@ -68,7 +72,7 @@ }, if(displayOpt$labelMode==TRUE){ text(paste0(i,",",j), xy=c(10,-10), - stroke='black', font.size=12, opacity=1, + stroke=labelColor, font.size=12, opacity=1, transform=list(scale=1/vbScaleFactor,translate=vbScaleFactor*pt)) } else { NULL From 860b72079365542e7e6af187d2a10cf63adc35c3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 09:29:58 -0400 Subject: [PATCH 209/263] if parMode is not null (presumably dnippets) set labelColor to white --- inst/App/rightPanel/serverDisplayOptions.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/serverDisplayOptions.R b/inst/App/rightPanel/serverDisplayOptions.R index 0116646d..0366271f 100644 --- a/inst/App/rightPanel/serverDisplayOptions.R +++ b/inst/App/rightPanel/serverDisplayOptions.R @@ -4,7 +4,8 @@ displayOptions<-reactiveValues( insertMode=TRUE, ptMode="Normal", # can be 'Hidden', 'Normal', 'Labeled' labelMode=FALSE, - restrictMode=FALSE + restrictMode=FALSE, + labelColor='#000000' ) #displayMode<-reactive({displayOptions$ptMode}) @@ -27,6 +28,9 @@ getDisplayMode<-reactive({ setDisplayOption<-function( insertMode, ptMode, labelMode, restrictMode ){ if(!missing(labelMode)){ displayOptions$labelMode<-labelMode + if(!is.null(getParMode())){ + displayOptions$labelColor<-'#FFFFFF' + } } if(!missing(restrictMode)){ displayOptions$restrictMode<-restrictMode From 5a04347cf1d6c8b82b62c5bf9f17965be755a602 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 09:31:06 -0400 Subject: [PATCH 210/263] remove debug code --- inst/App/fileIO/serverFileDescriptor.R | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/inst/App/fileIO/serverFileDescriptor.R b/inst/App/fileIO/serverFileDescriptor.R index d5260ca3..b8a54d26 100644 --- a/inst/App/fileIO/serverFileDescriptor.R +++ b/inst/App/fileIO/serverFileDescriptor.R @@ -46,27 +46,18 @@ getMode<-reactive({ }) getParMode<-reactive({ - cat('>---> getParMode\n') + # cat('>---> getParMode\n') tabId<-input$pages # getTibTabId() - cat(paste('tabId=',format(tabId))) + # cat(paste('tabId=',format(tabId))) if(is.null(tabId) || identical(tabId, 'bogus')){ - cat('seting parNode to NULL') parMode<-NULL } else { fd<-fileDescDB() - print(fd) - print(fd$tabId) - print(fd$parMode) - #stopifnot('tabId' %in% names(fd)) parMode<-fd[fd$tabId==input$pages,]$parMode - cat('parMode=') - cat(format(parMode)) - if(is.na(parMode)){ + if(length(parMode)>0 && is.na(parMode)){ parMode<-NULL } } - # print(parMode) - #parMode='dnds' parMode }) From 741d1d110cece486418aef8ef495a8e4c949bae7 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 09:32:09 -0400 Subject: [PATCH 211/263] handling dnippets childwindow --- inst/App/rightPanel/mid/moduleSVGR.R | 111 +++++++++++++++------------ 1 file changed, 62 insertions(+), 49 deletions(-) diff --git a/inst/App/rightPanel/mid/moduleSVGR.R b/inst/App/rightPanel/mid/moduleSVGR.R index 11aca225..8eeb962e 100644 --- a/inst/App/rightPanel/mid/moduleSVGR.R +++ b/inst/App/rightPanel/mid/moduleSVGR.R @@ -102,72 +102,85 @@ svgToolsScript<-function(type){ parsedCode<-parse(text=paste0(wd,codeTxt)) svg<-eval(parsedCode, getEnvList() ) parentMode<-getParMode() - cat('parentMode= ') - cat(format(parentMode)) + # cat('parentMode= ') + # cat(format(parentMode)) + svg$root$setAttr('id',svgID) if(identical(parentMode, 'dnippets')){ - cat('\ngot it') svg$root$setAttr('width',480) svg$root$setAttr('height',320) svg$root$setAttr('viewBox','0 0 48 32') svg$root$setAttr('stroke','#00FFFF') svg$root$setAttr('fill','#00FFFF') - } - w<-svg$root$getAttr('width') - h<-svg$root$getAttr('height') - rtv$WH<-c(w,h) - vbWH<-svg$root$getAttr('viewBox') - vbWH<-str_split(vbWH,',') - vbWH<-unlist(vbWH)[3:4] - vbScaleFactor<-1 - gWH<-c(w,h) - tryCatch({ - if(length(vbWH)==2 ){ - vbWH<-as.numeric(vbWH) - if(min(vbWH)>0){ - vbScaleFactor<-mean(rtv$WH/vbWH) - gWH<-vbWH - } else { - vbScaleFactor<-1 - } - } - }, - error=function(e){ - vbScaleFactor<-1 - }) - if(identical(parentMode, 'dnippets')){ + rtv$WH<-c(480,320) vbScaleFactor<-10 - dxy=c(5,5) - svg$root$prependNode( graphPaper2( wh=c(48,32), dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor) ) + if(getSvgGrid()$show==TRUE){ + dxy=c(4,4) + svg$root$prependNode( graphPaper2( wh=c(48,32), dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor) ) + } svg$root$prependChildren( svgR:::use(filter=svgR:::filter( filterUnits='userSpaceOnUse', svgR:::feFlood(flood.color='black') ) ) ) - } - svg$root$setAttr('id',svgID) - if(getSvgGrid()$show==TRUE){ - dxy<-c( getSvgGrid()$dx, getSvgGrid()$dy) - #svg$root$prependNode(svgR:::graphPaper( wh=c(w,h), dxy=dxy, labels=TRUE )) #need to replace with vbScaleFactor-scalable version - #svg$root$prependNode( graphPaper2( wh=c(w,h), dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor)) - svg$root$prependNode( graphPaper2( wh=gWH, dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor) ) - } - if(getBackDrop()$checked==FALSE){ + } else { + # record width, height + w<-svg$root$getAttr('width') + h<-svg$root$getAttr('height') + rtv$WH<-c(w,h) + + # if viewBox, calculate vbScaleFactor, else vbScaleFactor=1 + vbWH<-svg$root$getAttr('viewBox') + vbWH<-str_split(vbWH,',') + vbWH<-unlist(vbWH)[3:4] + vbScaleFactor<-1 + gWH<-c(w,h) + tryCatch({ + if(length(vbWH)==2 ){ + vbWH<-as.numeric(vbWH) + if(min(vbWH)>0){ + vbScaleFactor<-mean(rtv$WH/vbWH) + gWH<-vbWH + } else { + vbScaleFactor<-1 + } + } + }, + error=function(e){ + vbScaleFactor<-1 + }) + if(getSvgGrid()$show==TRUE){ + dxy<-c( getSvgGrid()$dx, getSvgGrid()$dy) + + #svg$root$prependNode(svgR:::graphPaper( wh=c(w,h), dxy=dxy, labels=TRUE )) #need to replace with vbScaleFactor-scalable version + #svg$root$prependNode( graphPaper2( wh=c(w,h), dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor)) + svg$root$prependNode( graphPaper2( wh=gWH, dxy=dxy, labels=TRUE, scaleFactor= vbScaleFactor) ) + } + + if(getBackDrop()$checked==FALSE){ #solid svg$root$prependChildren( svgR:::use(filter=svgR:::filter(xy=c(0,0), wh=c(w,h), filterUnits="userSpaceOnUse", svgR:::feFlood(flood.color=getBackDrop()$color))) ) - } else { - wh2=c(20,20)/vbScaleFactor - wh1=c(10,10)/vbScaleFactor - svg$root$prependChildren( - svgR:::rect(xy=c(0,0), wh=c(w,h), - fill=svgR:::pattern( xy=c(0,0), wh=wh2, patternUnits="userSpaceOnUse", - svgR:::g( - svgR:::rect(xy=c(0,0), wh=wh1, fill=getBackDrop()$color), - svgR:::rect(xy=wh1, wh=wh1, fill=getBackDrop()$color) - ) - ) + } else { # checkered + wh2=c(20,20)/vbScaleFactor + wh1=c(10,10)/vbScaleFactor + svg$root$prependChildren( + svgR:::rect(xy=c(0,0), wh=c(w,h), + fill=svgR:::pattern( xy=c(0,0), wh=wh2, patternUnits="userSpaceOnUse", + svgR:::g( + svgR:::rect(xy=c(0,0), wh=wh1, fill=getBackDrop()$color), + svgR:::rect(xy=wh1, wh=wh1, fill=getBackDrop()$color) + ) + ) ) ) + } + } + + + + # svg$root$setAttr('id',svgID) + + svg$root$prependNode(svgR:::script(ptrDisplyScriptTxt)) svg$root$prependNode( svgR:::style(".draggable {','cursor: move;','}")) From f921553a99de5da2f83cff5b3db5b442b25d8e0b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 09:32:55 -0400 Subject: [PATCH 212/263] add defaults to dnippet svg --- inst/App/fileIO/dndSnippetLoader.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inst/App/fileIO/dndSnippetLoader.R b/inst/App/fileIO/dndSnippetLoader.R index d0887e21..819b22c9 100644 --- a/inst/App/fileIO/dndSnippetLoader.R +++ b/inst/App/fileIO/dndSnippetLoader.R @@ -97,7 +97,14 @@ extractDripplet<-function(dr ){ if(all(m>0)){ rtv<-tt rtv<-tryCatch({ - svg<-as.character(eval(parse(text=tt['SVGR']), new.env())) + # svg<-as.character(eval(parse(text=tt['SVGR']), new.env())) + svg<-eval(parse(text=tt['SVGR']), new.env()) + svg$root$setAttr('stroke','#00FFFF') + svg$root$setAttr('fill','#00FFFF') + svg$root$setAttr('width',48) + svg$root$setAttr('height',32) + #set width, height??? + svg<-as.character(svg) rtv["SVGR"]<-svg names(rtv)<-c('hint','snip','logo')[m] rtv From bcb61c9bdc5efb94f94b879d2e081ddf109ad614 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 09:47:26 -0400 Subject: [PATCH 213/263] add labelColor to determine the stroke for labes --- inst/App/rightPanel/mid/serverPlotBarTagDrag.R | 8 ++++++-- inst/App/rightPanel/mid/serverPlotBarTagValues.R | 12 +++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R index 3ce3bf6b..319e1efe 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R @@ -18,6 +18,10 @@ } displayOpt<-displayOptions if(is.null(displayOpt)||is.null(displayOpt$labelMode) || is.null(displayOpt$restrictMode)){ return(NULL)} + labelColor<-'#000000' # black by default but override if displayOpt specifies it. + if(!is.null(displayOpt$labelColor)){ + labelColor<-displayOpt$labelColor + } onMouseDownTxt="ptRPlotter_ptR_SVG_TagDrag.selectElement(evt)" @@ -53,7 +57,7 @@ g( circle(cxy=c(0,0), r=8), if(displayOpt$labelMode==TRUE){ - text( paste(i), xy=c(10,-10), stroke='black', font.size=12) + text( paste(i), xy=c(10,-10), stroke=labelColor, font.size=12) } else { NULL }, @@ -78,7 +82,7 @@ g( circle(cxy=c(0,0), r=8), if(displayOpt$labelMode==TRUE){ - text( paste(rowIndex), xy=c(10,-10), stroke='black', font.size=12) + text( paste(rowIndex), xy=c(10,-10), stroke=labelColor, font.size=12) } else { NULL }, diff --git a/inst/App/rightPanel/mid/serverPlotBarTagValues.R b/inst/App/rightPanel/mid/serverPlotBarTagValues.R index b69aa96c..1921331f 100755 --- a/inst/App/rightPanel/mid/serverPlotBarTagValues.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagValues.R @@ -16,9 +16,11 @@ showPts.valTag % Date: Fri, 25 Jun 2021 12:18:55 -0400 Subject: [PATCH 214/263] remove labelColor from displayOptins --- inst/App/rightPanel/serverDisplayOptions.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/inst/App/rightPanel/serverDisplayOptions.R b/inst/App/rightPanel/serverDisplayOptions.R index 0366271f..1e8df382 100644 --- a/inst/App/rightPanel/serverDisplayOptions.R +++ b/inst/App/rightPanel/serverDisplayOptions.R @@ -28,9 +28,6 @@ getDisplayMode<-reactive({ setDisplayOption<-function( insertMode, ptMode, labelMode, restrictMode ){ if(!missing(labelMode)){ displayOptions$labelMode<-labelMode - if(!is.null(getParMode())){ - displayOptions$labelColor<-'#FFFFFF' - } } if(!missing(restrictMode)){ displayOptions$restrictMode<-restrictMode @@ -43,7 +40,7 @@ setDisplayOption<-function( insertMode, ptMode, labelMode, restrictMode ){ } } getDisplayOptions<-reactive({ - tmp<-reactiveValuesToList(displayOptions) + tmp<-reactiveValuesToList(displayOptions) #how can this possibly work??? }) From aee294892d207200e2ac2074428a50c0d5fafc05 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 12:19:14 -0400 Subject: [PATCH 215/263] remove cat --- inst/App/fileIO/serverFileDescriptor.R | 1 - 1 file changed, 1 deletion(-) diff --git a/inst/App/fileIO/serverFileDescriptor.R b/inst/App/fileIO/serverFileDescriptor.R index b8a54d26..f4199704 100644 --- a/inst/App/fileIO/serverFileDescriptor.R +++ b/inst/App/fileIO/serverFileDescriptor.R @@ -32,7 +32,6 @@ addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode, parId=NA, getMode<-reactive({ - # cat('>---> getMode\n') tabId<-input$pages # getTibTabId() if(is.null(tabId) || identical(tabId, 'bogus')){ mode<-NULL From cb3814ec8b55f8b371298ad9d1bb5653287428d5 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 12:20:02 -0400 Subject: [PATCH 216/263] add labelColor as param to showPts.compound --- inst/App/rightPanel/mid/moduleSVGR.R | 6 +++++- inst/App/rightPanel/mid/serverPlotBarPoints.R | 13 ++++++------- inst/App/rightPanel/mid/serverPlotBarTagDrag.R | 8 +++++--- inst/App/rightPanel/mid/serverPlotBarTagValues.R | 13 ++++++------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/inst/App/rightPanel/mid/moduleSVGR.R b/inst/App/rightPanel/mid/moduleSVGR.R index 8eeb962e..58bdfa23 100644 --- a/inst/App/rightPanel/mid/moduleSVGR.R +++ b/inst/App/rightPanel/mid/moduleSVGR.R @@ -185,7 +185,11 @@ svgToolsScript<-function(type){ svg$root$prependNode( svgR:::style(".draggable {','cursor: move;','}")) if(!is.null(showPts.compound()) ){ - temp<-svgR(showPts.compound()(vbScaleFactor))$root$xmlChildren() + labelColor='black' + if(!is.null(parentMode) || getBackDrop()$color %in% c('#000000','#FF0000','#0000FF','#333333' )){ + labelColor="white" + } + temp<-svgR(showPts.compound()(vbScaleFactor, labelColor))$root$xmlChildren() svg$root$appendChildren(temp) } if(useKeyMouseScript){ diff --git a/inst/App/rightPanel/mid/serverPlotBarPoints.R b/inst/App/rightPanel/mid/serverPlotBarPoints.R index 807d0438..b445bbb8 100755 --- a/inst/App/rightPanel/mid/serverPlotBarPoints.R +++ b/inst/App/rightPanel/mid/serverPlotBarPoints.R @@ -10,7 +10,8 @@ rowIndex=NULL, matColIndex=NULL, displayOptions=NULL, - vbScaleFactor + vbScaleFactor, + labelColor="black" ){ @@ -20,10 +21,7 @@ displayOpt<-displayOptions if(is.null(displayOpt)||is.null(displayOpt$labelMode) || is.null(displayOpt$restrictMode)){ return(NULL)} - labelColor<-'#000000' # black by default but override if displayOpt specifies it. - if(!is.null(displayOpt$labelColor)){ - labelColor<-displayOpt$labelColor - } + # if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } onMouseDownTxt='ptRPlotter_ptR_SVG_Point.selectPoint(evt)' @@ -112,7 +110,7 @@ statusPlotPoint<-callModule( id="svgPointsMod", svgID='ptR_SVG_Point', showPts.compound=reactive({ - function(vbScaleFactor){ + function(vbScaleFactor, labelColor){ list( newPtLayer( getInsertMode(), getSVGWH() ), showPts.PtCmd( @@ -121,7 +119,8 @@ statusPlotPoint<-callModule( rowIndex=getTibRow(), matColIndex=getTibMatCol(), displayOptions=getDisplayOptions(), - vbScaleFactor=vbScaleFactor + vbScaleFactor=vbScaleFactor, + labelColor ) ) } diff --git a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R index 319e1efe..c97f8ee8 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R @@ -9,7 +9,8 @@ pts=NULL, rowIndex=NULL, displayOptions=NULL, - vbScaleFactor=1 + vbScaleFactor=1, + labelColor='black' ){ #if(is.null(ptDisplayMode) || ptDisplayMode=="Hidden"){ return(NULL) } @@ -102,13 +103,14 @@ statusPlotTagDrag<-callModule( id="svgTagDragMod", svgID='ptR_SVG_TagDrag', showPts.compound=reactive({ - function(vbScaleFactor){ + function(vbScaleFactor, labelColor){ showPts.dragTag( ptName=getAssetName(), pts=getTibPts(), rowIndex=getTibRow(), displayOptions=getDisplayOptions(), - vbScaleFactor + vbScaleFactor, + labelColor ) } }), diff --git a/inst/App/rightPanel/mid/serverPlotBarTagValues.R b/inst/App/rightPanel/mid/serverPlotBarTagValues.R index 1921331f..b9248b2c 100755 --- a/inst/App/rightPanel/mid/serverPlotBarTagValues.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagValues.R @@ -9,17 +9,15 @@ showPts.valTag % Date: Fri, 25 Jun 2021 17:51:02 -0400 Subject: [PATCH 217/263] remove displayOpt labelColor --- inst/App/rightPanel/mid/serverPlotBarTagDrag.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R index c97f8ee8..82bb45f1 100644 --- a/inst/App/rightPanel/mid/serverPlotBarTagDrag.R +++ b/inst/App/rightPanel/mid/serverPlotBarTagDrag.R @@ -19,10 +19,6 @@ } displayOpt<-displayOptions if(is.null(displayOpt)||is.null(displayOpt$labelMode) || is.null(displayOpt$restrictMode)){ return(NULL)} - labelColor<-'#000000' # black by default but override if displayOpt specifies it. - if(!is.null(displayOpt$labelColor)){ - labelColor<-displayOpt$labelColor - } onMouseDownTxt="ptRPlotter_ptR_SVG_TagDrag.selectElement(evt)" From bf5be8009b221c3226f685c1c5f6bf04395e0a5c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 25 Jun 2021 17:52:34 -0400 Subject: [PATCH 218/263] bug fix for case when we have a viewBox attribute attached to the svg --- inst/App/www/IOjs/tagDragIO.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/inst/App/www/IOjs/tagDragIO.js b/inst/App/www/IOjs/tagDragIO.js index 141a27b7..3b367d7c 100644 --- a/inst/App/www/IOjs/tagDragIO.js +++ b/inst/App/www/IOjs/tagDragIO.js @@ -7,7 +7,22 @@ function PtRPanelTagDrag(svgId){ //currently svgId is not used here this.origY = 0; this.svgId=svgId; this.svg=document.querySelector("#" + svgId); + this.sx=1.0; + this.sy=1.0; + if(this.svg.getAttribute('viewBox')){ + //console.log(JSON.stringify( this.svg.getAttribute('viewBox') )); + var vb=this.svg.getAttribute('viewBox').split(/[ ,]+/).filter(Boolean); + //console.log('vb='+JSON.stringify(vb)); + this.sx=Number(vb[2]); + this.sy=Number(vb[3]); + this.sx=this.sx/Number(this.svg.getAttribute('width')); + //console.log('svg height='+this.svg.getAttribute('height')); + this.sy=this.sy/Number(this.svg.getAttribute('height')); + //console.log('sy='+this.sy); + //console.log('sx='+this.sx); + } this.currentMatrix = 0; + this.pt= this.svg.createSVGPoint(); } //TRANSFORM @@ -21,6 +36,7 @@ PtRPanelTagDrag.prototype.selectElement = function (evt) { this.origX = evt.clientX; this.origY = evt.clientY; this.currentMatrix = this.selectedElement.getAttributeNS(null, "transform").slice(7,-1).split(" "); + //console.log(JSON.stringify( this.selectedElement.getAttributeNS(null, "transform") )); for(var i=0; i Date: Sun, 4 Jul 2021 13:03:59 -0400 Subject: [PATCH 219/263] eliminating need for user to specify WH for dnds --- inst/App/fileIO/dndSnippetLoader.R | 9 +++++---- inst/App/leftPanel/footer/processCommit.R | 5 +++++ inst/App/rightPanel/mid/moduleSVGR.R | 7 ++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/inst/App/fileIO/dndSnippetLoader.R b/inst/App/fileIO/dndSnippetLoader.R index 819b22c9..7d811232 100644 --- a/inst/App/fileIO/dndSnippetLoader.R +++ b/inst/App/fileIO/dndSnippetLoader.R @@ -21,8 +21,8 @@ dripplets2Rmd<-function( drps ){ unlist(str_split(drps, '\n'))->drps indx<-m[2,] drps[indx]<-paste( - # "temp$root$setAttr('width',480)", - # "temp$root$setAttr('height',320)", + "temp$root$setAttr('width',48)", + "temp$root$setAttr('height',32)", # "temp$root$setAttr('viewBox','0 0 48 32')", "temp$root$setAttr('stroke','#00FFFF')", "temp$root$setAttr('fill','#00FFFF')", @@ -37,7 +37,7 @@ dripplets2Rmd<-function( drps ){ drps<-str_replace(drps, "\noutput: dnd_snippet", "\noutput: html_document") drps<-str_replace_all(drps, "POPUP\\s*\n```\n(.+)\n```", "### \\1") drps<-str_replace_all(drps, "\nSNIPPET\\s*","\n") - drps<-str_replace_all(drps, "\nSVGR\\s*\n```\n", '\n\n```\\{r, echo=FALSE, results=\'asis\'\\}\n') + drps<-str_replace_all(drps, "\nSVGR\\s*\n```\n", '\n\n```\\{r, echo=FALSE, results=\'asis\'\\}\nWH=c(48,32)\n') drps } @@ -98,7 +98,8 @@ extractDripplet<-function(dr ){ rtv<-tt rtv<-tryCatch({ # svg<-as.character(eval(parse(text=tt['SVGR']), new.env())) - svg<-eval(parse(text=tt['SVGR']), new.env()) + # svg<-eval(parse(text=tt['SVGR']), new.env()) + svg<-eval(parse(text=tt['SVGR']), list(WH=c(48,32))) svg$root$setAttr('stroke','#00FFFF') svg$root$setAttr('fill','#00FFFF') svg$root$setAttr('width',48) diff --git a/inst/App/leftPanel/footer/processCommit.R b/inst/App/leftPanel/footer/processCommit.R index 52d302df..3b74b787 100644 --- a/inst/App/leftPanel/footer/processCommit.R +++ b/inst/App/leftPanel/footer/processCommit.R @@ -103,6 +103,11 @@ processSvgR<-reactive({ setSourceType(sourceType=RPanelTag) #no error, just R code } else { # presume to be svgR code env2<-getEnvList() + #if parMode is dndsnippet, need to add to env2, WH=c(48,32) + if(identical(getParMode(), 'dnippets')){ + env2<-c(env2, list(WH=c(48,32))) + } + parsedCode<-parse(text=paste0(src) ) output<-captureOutput(eval(parsedCode, envir=env2 )) diff --git a/inst/App/rightPanel/mid/moduleSVGR.R b/inst/App/rightPanel/mid/moduleSVGR.R index 58bdfa23..5dce8f2c 100644 --- a/inst/App/rightPanel/mid/moduleSVGR.R +++ b/inst/App/rightPanel/mid/moduleSVGR.R @@ -100,8 +100,13 @@ svgToolsScript<-function(type){ wd<-paste0('\nsetwd("',dpath,'")\n\n') parsedCode<-parse(text=paste0(wd,codeTxt)) - svg<-eval(parsedCode, getEnvList() ) parentMode<-getParMode() + env3<-getEnvList() + if(identical(parentMode, 'dnippets')){ + env3<-c(env3, list(WH=c(48,32))) + } + svg<-eval(parsedCode, env3 ) + # cat('parentMode= ') # cat(format(parentMode)) svg$root$setAttr('id',svgID) From b1be1a48eb130deba3f557b8a39a3743c506593b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 21 Jul 2021 18:42:09 -0400 Subject: [PATCH 220/263] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ec7864d5..d95efefe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pointR Type: Package Date: 2021-01-02 Title: pointR -Version: 0.4.7 +Version: 0.4.8 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR From af05a40c638fbfe3c5d4e0daf8c5a934a39e72b0 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 21 Jul 2021 18:42:33 -0400 Subject: [PATCH 221/263] disable logger --- inst/App/util/logger.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index 3f504dec..d5f25dc8 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,5 +1,5 @@ -SHOW_DEBUG_LOG=TRUE +SHOW_DEBUG_LOG=FALSE log.fin<-function(x){ if(SHOW_DEBUG_LOG){ From 2d9f3e162a8afac10616cedb013500f042035856 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 21 Jul 2021 18:42:59 -0400 Subject: [PATCH 222/263] comment out debug log --- inst/App/www/IOjs/tagDragIO.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/App/www/IOjs/tagDragIO.js b/inst/App/www/IOjs/tagDragIO.js index 3b367d7c..82905f9f 100644 --- a/inst/App/www/IOjs/tagDragIO.js +++ b/inst/App/www/IOjs/tagDragIO.js @@ -79,7 +79,7 @@ PtRPanelTagDrag.prototype.deselectElement = function (evt) { var kc=$( "#svgOutPanel" ).data("keycode"); let r = Math.random().toString(36).substring(7); var dxy=[movedByX*this.sx, movedByY*this.sy]; - console.log('moving by'+ JSON.stringify( dxy )); + // console.log('moving by'+ JSON.stringify( dxy )); Shiny.onInputChange("mouseMssg", { cmd: "transGrp", From 587b203a1ad3695761b327dd393725d7a628eb12 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 21 Jul 2021 18:43:39 -0400 Subject: [PATCH 223/263] remove explicit usage of WH --- inst/App/templates/dndSnippetTemplate.dnds | 13 ++-- inst/App/templates/sampleShapes.dnds | 83 +++++++++------------- inst/App/templates/samples.dnds | 12 ++-- 3 files changed, 44 insertions(+), 64 deletions(-) diff --git a/inst/App/templates/dndSnippetTemplate.dnds b/inst/App/templates/dndSnippetTemplate.dnds index 0518ec7e..5a35a9ba 100644 --- a/inst/App/templates/dndSnippetTemplate.dnds +++ b/inst/App/templates/dndSnippetTemplate.dnds @@ -33,16 +33,14 @@ ellipse( SVGR ``` library(svgR) -WH<-c(48,32) ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( ellipse( cxy=WH/2, rxy=WH/4, fill='none', - stroke='#00FFFF', stroke.width=2 ) ) @@ -55,19 +53,18 @@ Assign Point Matrix ``` SNIPPET ``` -=matrix(${1:0},2,${0:0}) +=matrix(${1:0},2${0:,0}) ``` SVGR ``` library(svgR) -WH<-c(48,32) ptR<-list( x=matrix(0,2,0) ) X=c(.2,.4,.6,.8) -svgR(wh=WH, stroke.width=2, stroke="#00FFFF", fille="none", - polyline(points=c(WH)*c(c(.3,.1),c(.1,.1), c(.1,.9), c(.3,.9))), - polyline(points=c(WH)*c(c(.7,.1),c(.9,.1), c(.9,.9), c(.7,.9))), +svgR(stroke.width=2, + polyline(points=c(WH)*c(c(.3,.1),c(.1,.1), c(.1,.9), c(.3,.9)), fill="none"), + polyline(points=c(WH)*c(c(.7,.1),c(.9,.1), c(.9,.9), c(.7,.9)), fill="none"), lapply( X, function(x){ list( line(xy1=WH*c(x,.3),xy2=WH*c(x,.4)), diff --git a/inst/App/templates/sampleShapes.dnds b/inst/App/templates/sampleShapes.dnds index 9cfe969e..e0a49b17 100644 --- a/inst/App/templates/sampleShapes.dnds +++ b/inst/App/templates/sampleShapes.dnds @@ -31,16 +31,15 @@ circle( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( #your custom code goes here circle( cxy=WH/2, r=WH[2]/3, - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -66,16 +65,15 @@ ellipse( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( #your custom code goes here ellipse( cxy=WH/2, rxy=c(.3,.2)*WH, - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -103,17 +101,16 @@ rect( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), +svgR(, + line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2), + line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2), rect( xy=WH/2, wh=c(.4,.2)*WH, - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -140,17 +137,16 @@ rect( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), + line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2), + line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2), rect( cxy=WH/2, wh=c(.4,.2)*WH, - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -173,15 +169,14 @@ line( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( line( xy1=c(.2,0.8)*WH, xy2=c(.8,0.2)*WH, - stroke='#00FFFF', stroke.width=2 ) ) @@ -204,7 +199,7 @@ polyline( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) @@ -212,7 +207,6 @@ svgR(wh=WH, polyline( points=WH*matrix(c(.25,.25,.5,.8,.75,.25),2), stroke.width=2, - stroke='#00FFFF', fill='none' ) ) @@ -235,14 +229,13 @@ polygon( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( polygon( points=WH*matrix(c(.25,.75,.5,.25,.75,.75),2), - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -267,17 +260,16 @@ text( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), +svgR( + line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2), + line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2), text( 'Text', xy=WH/2, - stroke='#00FFFF', font.size=10, fill='#00FFFF' ) @@ -302,17 +294,16 @@ SNIPPET SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, - line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2, stroke="#00FFFF"), - line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2, stroke="#00FFFF"), +svgR( + line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2), + line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2), text( 'Text', cxy=WH/2, - stroke='#00FFFF', font.size=10, fill='#00FFFF' ) @@ -339,21 +330,19 @@ SNIPPET SVGR ``` library(svgR) -WH<-c(48,32) -# Defined by mouse: edit with care! + ptR<-list( x=tribble( ~points, matrix(0,2,0) ) ) -svgR(wh=WH, +svgR( path( d=list( M=c(.5,.2)*WH, A=c(.3*WH, 180,1,0,c(.8,.5)*WH) ), - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -380,7 +369,7 @@ path( SVGR ``` library(svgR) -WH<-c(48,32) + # Defined by mouse: edit with care! ptR<-list( x=tribble( @@ -388,13 +377,12 @@ ptR<-list( matrix(0,2,0) ) ) -svgR(wh=WH, +svgR( path( d=list( M=c(.2,.2)*WH, Q=c( c(.5,1.5)*WH,c(.8,.2)*WH) ), - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -422,7 +410,7 @@ path( SVGR ``` library(svgR) -WH<-c(48,32) + # Defined by mouse: edit with care! ptR<-list( x=tribble( @@ -430,14 +418,13 @@ ptR<-list( matrix(0,2,0) ) ) -svgR(wh=WH, +svgR( path( d=list( M=c(.3,.1)*WH, Q=c( c(1,.7),c(.5,.7))*WH, T=c(.7,.1)*WH ), - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -464,18 +451,17 @@ path( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( #your custom code goes here path( d=list( M=c(.2,.9)*WH, C=c( c(.3,-1),c(.7,2), c(.8,.2))*WH ), - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -504,11 +490,11 @@ path( SVGR ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, +svgR( #your custom code goes here path( d=list( @@ -516,7 +502,6 @@ svgR(wh=WH, C=c( c(.4,.0),c(.4,.8), c(.5,.8))*WH, S=c( c(.6,.0),c(.8,.6))*WH ), - stroke='#00FFFF', stroke.width=2, fill='none' ) diff --git a/inst/App/templates/samples.dnds b/inst/App/templates/samples.dnds index cee4fe96..28337f1b 100644 --- a/inst/App/templates/samples.dnds +++ b/inst/App/templates/samples.dnds @@ -32,7 +32,7 @@ Snippet Insert: SVGR Image: ``` library(svgR) -WH<-c(48,32) + # Defined by mouse: edit with care! ptR<-list( x=tribble( @@ -40,13 +40,12 @@ ptR<-list( matrix(0,2,0) ) ) -svgR(wh=WH, +svgR( path( d=list( M=c(.5,.2)*WH, A=c(.3*WH, 180,1,0,c(.8,.5)*WH) ), - stroke='#00FFFF', stroke.width=2, fill='none' ) @@ -71,16 +70,15 @@ circle( SVGR Image: ``` library(svgR) -WH<-c(48,32) + ptR<-list( x=matrix(0,2,0) ) -svgR(wh=WH, -#your custom code goes here +svgR( + circle( cxy=WH/2, r=WH[2]/3, - stroke='#00FFFF', stroke.width=2, fill='none' ) From e6f148e0459b75f8d57b8440cc09f08802df01ae Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 19 Aug 2021 19:22:37 -0400 Subject: [PATCH 224/263] added insert dnds, refactored insert svg-ptR block, added label for edit dnds --- inst/App/leftPanel/mid/UIcontextMenu.R | 1 + inst/App/util/logger.R | 2 +- inst/App/util/reOrgPanels.R | 3 + inst/App/www/ptR/contextMenu.js | 185 ++++++++++++++++++++++--- 4 files changed, 172 insertions(+), 19 deletions(-) diff --git a/inst/App/leftPanel/mid/UIcontextMenu.R b/inst/App/leftPanel/mid/UIcontextMenu.R index 08ddc7ea..f7b35da5 100644 --- a/inst/App/leftPanel/mid/UIcontextMenu.R +++ b/inst/App/leftPanel/mid/UIcontextMenu.R @@ -22,6 +22,7 @@ UIcontextMenu<-function(){ tag('li',list(id='rmd-insert-svgR', class='clickMe', span(class=" icon-circle-empty"), span( 'Insert svgR Block'))), tag('li',list(id='rmd-insert-ptR', class='clickMe', span(class="icon-circle"), span( 'Insert ptR Block'))), tag('li',list(id='rmd-edit-code', class='clickMe', span(class='icon-edit'),span('Edit Code Block') )), + tag('li',list(id='dnd-insert-block', class='clickMe', span(class=" icon-plus-squared-alt"), span( 'Insert DNDS Block'))), tag('li',list(id='dnd-edit-svgR', class='clickMe', span(class="icon-edit"), span( 'Edit DNDS Icon'))) )) ) diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index d5f25dc8..3f504dec 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,5 +1,5 @@ -SHOW_DEBUG_LOG=FALSE +SHOW_DEBUG_LOG=TRUE log.fin<-function(x){ if(SHOW_DEBUG_LOG){ diff --git a/inst/App/util/reOrgPanels.R b/inst/App/util/reOrgPanels.R index 1c335104..f2b98b0b 100644 --- a/inst/App/util/reOrgPanels.R +++ b/inst/App/util/reOrgPanels.R @@ -39,6 +39,7 @@ reOrgPanels<-function(id, mode){ hide(id="rmd-insert-svgR") hide(id="rmd-insert-ptR") hide(id="dnd-edit-svgR") + hide(id="dnd-insert-block") if(usingElectron){ addCssClass( id= "runAppPanel", class="hiddenPanel") addCssClass( id= "stopAppPanel", class="hiddenPanel") @@ -57,8 +58,10 @@ reOrgPanels<-function(id, mode){ # now consider which mode it is if(identical(mode,'dnippets')){ show(id="dnd-edit-svgR") + show(id="dnd-insert-block") } else { hide(id="dnd-edit-svgR") + hide(id="dnd-insert-block") } if(identical(mode,'ptrrmd')){ show(id="rmd-edit-code") diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index b131fc3b..11193149 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -1,11 +1,94 @@ //------begin:-------stuff to handle custom context menu $(function () { + const svgRBlockSnip="```{r, ${1:title,} echo=${2:FALSE}, results='asis'}\nWH=c(500,300)\nsvgR(wh=WH,\n #your custom code goes here\n ${0:NULL}\n)\n```"; + const ptRBlockSnip= "```{r, ${1:title,} echo=${2:FALSE}, results='asis'}\nWH<-c(600,400)\n\n# Defined by mouse: edit with care!\nptR<-list(\n x=tribble(\n ~points,\n matrix(0,2,0)\n )\n)\n\nsvgR(wh=WH,\n #your custom code goes here\n ${0:NULL}\n)\n\n```"; + + const DNDSSnip="\n\ +*********************\n\ +POPUP\n\ +```\n\ +${1:hint}\n\ +```\n\ +SNIPPET\n\ +```\n\ +${2:snippet}\n\ +```\n\ +SVGR\n\ +```\n\ +library(svgR)\n\ +ptR<-list(\n\ + x=matrix(0,2,0)\n\ +)\n\ +svgR(\n\ + #your code here\n\ + ${0:NULL}\n\ +)\n\ +```\n\ +*********************\n\ +"; + function insideDNDS(editor ){ + let Range = ace.require('ace/range').Range; + var curPos=editor.getCursorPosition(); + console.log("------------------------------"); + console.log(JSON.stringify(curPos)); + var row1=curPos.row; + // check if curRow contains ``` + console.log('hello hello hello'); + let rngL1 = new Range(row1, 0, row1, Infinity); + //let line1 = editor.getSession().getTextRange(rngL1); + //console.log('line1================'+line1); + //let found=(line1.indexOf('***')>=0); + let found=editor.find('***', { start:rngL1, range:rngL1}); + if(found){ + row1=row1+1; //move down + } + // setCurPos to row1 + // search down for row2 + // search to see if POPUp is inside + // + //console.log('found ***='+found); + //alert('found ***='+found); + return null; + } + + function insideCodeBlock(editor ){ + let Range = ace.require('ace/range').Range; + let curPos=editor.getCursorPosition(); + let rtv= false; + console.log("------------------------------"); + console.log(JSON.stringify(curPos)); + let curRow=curPos.row; + let curLine = editor.getSession().getLine(curRow); + if(-1!==curLine.indexOf('```')){ //check if curLine contains ``` + return true; + } else { + // search up for ``` + let topRng=editor.find('```', {backwards:true, start:curPos, range:null, skipCurrent:false, wrap:false}, false); + if(typeof topRng !== 'undefined'){ + // if found, does that line contain r,? + let topRow=topRng.start.row; + let curLine = editor.getSession().getLine(topRow); + if(-1!==curLine.indexOf('r')){ + rtv= true; + } + } + // restore curPos + editor.moveCursorTo(curRow,0); + // remove selection + editor.clearSelection(); + return rtv; + } + // check if curRow contains ``` + } + $('.clickMe').click(function () { var cmd = $(this).text().trim(); + console.log('cmd='+cmd); var aceId= $("#cntnr").attr('data-value'); var $el = $( aceId); - var editor = $el.data('aceEditor'); + var editor = $el.data('aceEditor'); + let Range = ace.require('ace/range').Range; if(cmd==='Lookup element'){ editor.getSession().selection.moveCursorLongWordLeft(); editor.getSession().selection.selectWordRight(); @@ -13,42 +96,98 @@ $(function () { Shiny.onInputChange('helpMssg', {query:text, num:Math.random(), editorId: aceId} ); } else if(cmd=="Insert svgR Block"){ //$el.trigger(tab_press); - let snippet= - "```{r, ${1:title,} echo=${2:FALSE}, results='asis'}\nWH=c(500,300)\nsvgR(wh=WH,\n #your custom code goes here\n ${0:NULL}\n)\n```"; - let snippetManager = ace.require("ace/snippets").snippetManager; - snippetManager.insertSnippet(editor, snippet); - editor.focus(); + + if(!insideCodeBlock(editor)){ + let snippet =svgRBlockSnip; + let snippetManager = ace.require("ace/snippets").snippetManager; + snippetManager.insertSnippet(editor, snippet); + editor.focus(); + } + } else if(cmd=="Insert ptR Block"){ - let snippet= - "```{r, ${1:title,} echo=${2:FALSE}, results='asis'}\nWH<-c(600,400)\n\n# Defined by mouse: edit with care!\nptR<-list(\n x=tribble(\n ~points,\n matrix(0,2,0)\n )\n)\n\nsvgR(wh=WH,\n #your custom code goes here\n ${0:NULL}\n)\n\n```"; - let snippetManager = ace.require("ace/snippets").snippetManager; - snippetManager.insertSnippet(editor, snippet); - editor.focus(); - + if(!insideCodeBlock(editor)){ + let snippet =ptRBlockSnip; + let snippetManager = ace.require("ace/snippets").snippetManager; + snippetManager.insertSnippet(editor, snippet); + editor.focus(); + } + } else if(cmd=='Insert DNDS Block'){ + // todo add check for placement of block + let edPos=editor.getCursorPosition(); + //console.log('edPos'+JSON.stringify(edPos)); + let curRow =editor.getCursorPosition().row; + let curLine = editor.getSession().getLine(curRow); + console.log('curLine='+curLine); + console.log("curLine.indexOf('***')="+curLine.indexOf('***')); + if(-1===curLine.indexOf('***')){ + // get botRow + let botRow=editor.session.getLength(); + let botRng=editor.find('***', {backwards:false, start:edPos, range:null, skipCurrent:true, wrap:false},false); + let topRng=editor.find('***', {backwards:true, start:edPos, range:null, skipCurrent:true, wrap:false}, false); + //console.log('botRng='+JSON.stringify(botRng)); + //console.log('topRng='+JSON.stringify(topRng)); + //console.log('!botRng.isEmpty()'+!botRng.isEmpty() ); + if(typeof botRng !== 'undefined' && typeof topRng !== 'undefined' ){ + botRow=botRng.start.row; + let topRow=topRng.start.row; + //console.log('range is ='+topRow+", "+botRow); + // test if insideDNDS + let trng= new Range(topRow, 0, botRow, Infinity); + editor.moveCursorTo(topRow,0); + //console.log('trange is ='+JSON.stringify(trng)); + let lines=editor.session.getTextRange(trng); + //console.log(lines); + if(-1===lines.indexOf('POPUP')){ + //console.log('POPUP not found'); + // keep let curRow number + } else { + //console.log('POPUP found'); + // reset let curRow + curRow=botRow; + } + editor.clearSelection(); + } else { + //console.log('empty range'); + } + + // get topRow + // get popUpRow + editor.moveCursorTo(curRow,0); + let snippet=DNDSSnip; + + let snippetManager = ace.require("ace/snippets").snippetManager; + snippetManager.insertSnippet(editor, snippet); + editor.scrollToLine(curRow, false, false, function () {}); + editor.focus(); + } + } else if(cmd=="Edit Code Block" || cmd=='Edit DNDS Icon'){ - //let pos=e.getDocumentPosition(); - ///console.log('#########################'); - // console.log(JSON.stringify(pos)); + //insideDNDS(editor); let Range = ace.require('ace/range').Range; let rng1=null; + parMode=null; if(cmd== "Edit Code Block"){ parMode='ptrrmd'; rng1=editor.find('```', {backwards:true, start:editor.getCursorPosition(), range:null}); if(!rng1){ return null} - } else { + } else { //cmd=='Edit DNDS Icon' parMode='dnippets'; rng1=editor.find('***', {backwards:true, start:editor.getCursorPosition(), range:null}); if(!rng1){ return null} + //search for POPUP followed by ```, + //rng1=editor.find('POPUP\n```\n', {backwards:false, start:editor.getCursorPosition(), range:null}); + //The next line should be the label rng1=editor.find('SVGR', {backwards:false, start:editor.getCursorPosition(), range:null}); if(!rng1){ return null} rng1=editor.find('```', {backwards:false, start:editor.getCursorPosition(), range:null}); if(!rng1){ return null} } - - let row1=rng1.start.row; + //rng1 now points to the top of the block + // extract row1 for anchor1 + let row1=rng1.start.row; //used for anchor1 let label=""; if(parMode=='ptrrmd'){ @@ -77,6 +216,16 @@ $(function () { label=""; } } + } else { //parMode='dnippets' + // search upwards for POPUP + let pos=editor.getCursorPosition(); + let rng0=editor.find('POPUP', {backwards:true, start:editor.getCursorPosition(), range:null}); + let row0=2+rng0.end.row; + let rngL1 = new Range(row0, 0, row0, Infinity); + let text = editor.getSession().getTextRange(rngL1); + //console.log('text='+text); + label=text; + editor.moveCursorToPosition(pos); } // add check for "{ r , }"" in row1, From 07116b92d6fe747b19c9168e4e52c6840549594b Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 20 Aug 2021 18:40:53 -0400 Subject: [PATCH 225/263] debug commented --- inst/App/www/ptR/contextMenu.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inst/App/www/ptR/contextMenu.js b/inst/App/www/ptR/contextMenu.js index 11193149..2950384a 100644 --- a/inst/App/www/ptR/contextMenu.js +++ b/inst/App/www/ptR/contextMenu.js @@ -30,11 +30,11 @@ svgR(\n\ function insideDNDS(editor ){ let Range = ace.require('ace/range').Range; var curPos=editor.getCursorPosition(); - console.log("------------------------------"); - console.log(JSON.stringify(curPos)); + //console.log("------------------------------"); + //console.log(JSON.stringify(curPos)); var row1=curPos.row; // check if curRow contains ``` - console.log('hello hello hello'); + //console.log('hello hello hello'); let rngL1 = new Range(row1, 0, row1, Infinity); //let line1 = editor.getSession().getTextRange(rngL1); //console.log('line1================'+line1); @@ -56,8 +56,8 @@ svgR(\n\ let Range = ace.require('ace/range').Range; let curPos=editor.getCursorPosition(); let rtv= false; - console.log("------------------------------"); - console.log(JSON.stringify(curPos)); + //console.log("------------------------------"); + //console.log(JSON.stringify(curPos)); let curRow=curPos.row; let curLine = editor.getSession().getLine(curRow); if(-1!==curLine.indexOf('```')){ //check if curLine contains ``` @@ -84,7 +84,7 @@ svgR(\n\ $('.clickMe').click(function () { var cmd = $(this).text().trim(); - console.log('cmd='+cmd); + //console.log('cmd='+cmd); var aceId= $("#cntnr").attr('data-value'); var $el = $( aceId); var editor = $el.data('aceEditor'); @@ -117,8 +117,8 @@ svgR(\n\ //console.log('edPos'+JSON.stringify(edPos)); let curRow =editor.getCursorPosition().row; let curLine = editor.getSession().getLine(curRow); - console.log('curLine='+curLine); - console.log("curLine.indexOf('***')="+curLine.indexOf('***')); + //console.log('curLine='+curLine); + //console.log("curLine.indexOf('***')="+curLine.indexOf('***')); if(-1===curLine.indexOf('***')){ // get botRow let botRow=editor.session.getLength(); From 5a6286a3a7801420af381cf304a582e923280444 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 20 Aug 2021 19:07:22 -0400 Subject: [PATCH 226/263] DEBUG_LOG=FALSE; bump version --- DESCRIPTION | 4 ++-- inst/App/util/logger.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d95efefe..3eb87cba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: pointR Type: Package -Date: 2021-01-02 +Date: 2021-08-20 Title: pointR -Version: 0.4.8 +Version: 0.4.9 Author: M.S.Legrand Maintainer: M.S.Legrand Description: pointR is a shiny-based IDE for svgR diff --git a/inst/App/util/logger.R b/inst/App/util/logger.R index 3f504dec..d5f25dc8 100644 --- a/inst/App/util/logger.R +++ b/inst/App/util/logger.R @@ -1,5 +1,5 @@ -SHOW_DEBUG_LOG=TRUE +SHOW_DEBUG_LOG=FALSE log.fin<-function(x){ if(SHOW_DEBUG_LOG){ From 058ceaa80af6f5bbc05477be11f620be6b979979 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 27 Aug 2021 09:15:45 -0400 Subject: [PATCH 227/263] enable/disable newColumn for dnippets --- inst/App/rightPanel/menu/cmdNewAsset.R | 8 ++++++-- inst/App/rightPanel/serverPanelCoordinator.R | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/menu/cmdNewAsset.R b/inst/App/rightPanel/menu/cmdNewAsset.R index 0bf65357..deabcb54 100644 --- a/inst/App/rightPanel/menu/cmdNewAsset.R +++ b/inst/App/rightPanel/menu/cmdNewAsset.R @@ -1,13 +1,17 @@ #--------NEW COLUMN------------------------------ -addNewAssetModal <- function(errMssg=NULL) { +addNewAssetModal <- function(errMssg=NULL ) { doOk<-"shinyjs.triggerButtonOnEnter(event,\"commitNewCol\")" + choices<-c('matrix','tibble') + if(identical(getParMode(),"dnippets")){ + choices<-'matrix' + } modalDialog( onkeypress=doOk, span('Enter both the type and the name for the new asset'), textInput("modalAssetName", "Enter the name for the new asset"), div( class='ptR2', awesomeRadio("modalAssetType", "Asset Type", - choices=c('matrix','tibble') + choices=choices )), if(!is.null(errMssg)){ div(tags$b(errMssg, style = "color: red;")) diff --git a/inst/App/rightPanel/serverPanelCoordinator.R b/inst/App/rightPanel/serverPanelCoordinator.R index 7ee149ec..7660b2fe 100644 --- a/inst/App/rightPanel/serverPanelCoordinator.R +++ b/inst/App/rightPanel/serverPanelCoordinator.R @@ -173,6 +173,7 @@ observeEvent(c(getSourceType(), hasError(), getParMode() ),{ menuBarId="plotNavBar", entry="cmdAdjustGridSpacing" ) + enable(id='tagValBar-newColumnButton') } else { disableDMDM( session, @@ -184,6 +185,12 @@ observeEvent(c(getSourceType(), hasError(), getParMode() ),{ menuBarId="plotNavBar", entry="cmdAdjustGridSpacing" ) + if(identical(getParMode(), 'dnippets')){ + disable(id='tagValBar-newColumnButton') + } else { + enable(id='tagValBar-newColumnButton') + } + } } else { disableDMDM( From fd04ba2ea7718f25756a3fcf81315102c97ddd72 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Wed, 22 Sep 2021 17:13:25 -0400 Subject: [PATCH 228/263] getEnvList should simply return an env to use --- inst/App/leftPanel/serverRequest.R | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/inst/App/leftPanel/serverRequest.R b/inst/App/leftPanel/serverRequest.R index 19ffea6d..da871922 100644 --- a/inst/App/leftPanel/serverRequest.R +++ b/inst/App/leftPanel/serverRequest.R @@ -24,27 +24,18 @@ getWDCmd<-reactive({ getEnvList<-reactive({ - # log.fin(getEnvList) wd<-getWDCmd() - # log.val(wd) pcode<-theBlocks() + initialEnv=new.env() if(!is.null(pcode) && pcode!=""){ pcode=paste(wd,pcode,sep="\n") - initialEnv=new.env() - # log.val(pcode) - eval(parse(text=pcode),initialEnv) - envlist<-as.list(initialEnv) - } else { - envlist<-list() + } else { + pcode<-wd } - # log.val(envList) - # log.fout(getEnvList) - envlist + eval(parse(text=pcode),initialEnv) + initialEnv }) - - - trigger<-reactiveValues( redraw=0, startup=0 @@ -100,11 +91,11 @@ popTab<-reactive({ tab }) -setBlocks<-function(blocks){ +setBlocks<-function(blocks){ # not used??? theBlocks(blocks) } -getBlocks<-reactive({ +getBlocks<-reactive({ # not used??? theBlocks() }) From a0190463bb0b601abe3cf3aa39a25bcc9abb93ef Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:19:23 -0400 Subject: [PATCH 229/263] change getEnvList from reactive to function --- inst/App/leftPanel/serverRequest.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inst/App/leftPanel/serverRequest.R b/inst/App/leftPanel/serverRequest.R index da871922..9d1d1890 100644 --- a/inst/App/leftPanel/serverRequest.R +++ b/inst/App/leftPanel/serverRequest.R @@ -13,7 +13,6 @@ request<-reactiveValues( getWDCmd<-reactive({ log.fin(getWDCmd) dpath<-getDirPath() - log.val(dpath) if(identical(dpath, '~/.ptR')){ dpath<-'~' } @@ -23,7 +22,7 @@ getWDCmd<-reactive({ }) -getEnvList<-reactive({ +getEnvList<-function(){ wd<-getWDCmd() pcode<-theBlocks() initialEnv=new.env() @@ -34,7 +33,7 @@ getEnvList<-reactive({ } eval(parse(text=pcode),initialEnv) initialEnv -}) +} trigger<-reactiveValues( redraw=0, From 816eebbfc3590869252290caab4267e5c5bcc3f9 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:20:10 -0400 Subject: [PATCH 230/263] handle case where fd$filePath is anon --- inst/App/leftPanel/footer/serverButtons.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inst/App/leftPanel/footer/serverButtons.R b/inst/App/leftPanel/footer/serverButtons.R index cbdb28a3..022283db 100755 --- a/inst/App/leftPanel/footer/serverButtons.R +++ b/inst/App/leftPanel/footer/serverButtons.R @@ -68,12 +68,14 @@ if(usingElectron){ #!!! move this elsewhere observeEvent(input$fileChanged,{ - # cat('Observed Event: fileChanged') changedFile<-input$fileChanged$mssg fd<-fileDescDB() - fd$filePath<-normalizePath(fd$filePath) + if(!(identical(fd$filePath,"?"))){ + fd$filePath<-normalizePath(fd$filePath) + } + tb<-filter(fd, filePath==changedFile) # cat("fileChanged 2\n") if(nrow(tb)>0){ From 495840ff2d000caaa080039b54fb59564b4553cc Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:21:28 -0400 Subject: [PATCH 231/263] add keycode for mouse click preproc --- inst/App/rightPanel/mouse/serverMouseCmdAddPt.R | 7 ++++--- inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R | 3 ++- inst/App/rightPanel/mouse/serverMouseCmdMovePt.R | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R index 7b2c2dfb..25b1dfc1 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdAddPt.R @@ -10,7 +10,7 @@ mouseCmdAddPt<-function(mssg){ sender='PointsBar.mouse.add' - + keycode=mssg$keycode newPt<-vec selection<-getAssetName() @@ -56,7 +56,7 @@ mouseCmdAddPt<-function(mssg){ setAttrValue=setAttrValue, getAttrValue=getAttrValue, context=context, - keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey) + keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey, keycode=mssg$keycode) ) tibs<-eval(parse(text=txt), ppenv ) validateTibLists(getPtDefs()$tib, tibs) @@ -75,6 +75,7 @@ mouseCmdAddPt<-function(mssg){ txt<-getPreProcScript()['onNewPt'] if( !is.null(txt) ){ #preproc pts tryCatch({ + getPoint<-function(){names(newPt)<-c('x','y'); newPt} context<-list( name=getAssetName(), @@ -87,7 +88,7 @@ mouseCmdAddPt<-function(mssg){ getPoint=getPoint, insertPoint=insertPoint, context=context, - keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), + keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey, keycode=mssg$keycode), WH=getSVGWH() ) tibs<-eval(parse(text=txt), ppenv ) diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R index dbc219ab..5385832a 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMoveMatrix.R @@ -4,6 +4,7 @@ mouseCmdMoveMatrix<-function(mssg){ vec<- as.numeric(unlist(mssg$vec)) } src<-getCode() + replacementList<-list() newPtDefs<-getPtDefs() tibs<-getPtDefs()$tib @@ -88,7 +89,7 @@ mouseCmdMoveMatrix<-function(mssg){ ppenv<-list( getDxy=getDxy, moveMatrix=moveMatrix, - keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), + keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey, keycode=mssg$keycode), WH=getSVGWH() ) for(ctx in contextList){ diff --git a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R index 96af0974..f03ae05f 100644 --- a/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R +++ b/inst/App/rightPanel/mouse/serverMouseCmdMovePt.R @@ -3,6 +3,7 @@ mouseCmdMovePt<- function(mssg){ vec<- as.numeric(unlist(mssg$vec)) } src<-getCode() + keycode=mssg$keycode replacementList<-list() ptDefs<-getPtDefs() updateRowPicker(session, "myTibRowCntrl", removeEntireGroup=TRUE) @@ -31,7 +32,7 @@ mouseCmdMovePt<- function(mssg){ getPoint=getPoint, movePoint=movePoint, context=context, - keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey), + keys=list(alt=mssg$altKey, shift=mssg$shiftKey, ctrl=mssg$ctrlKey, meta=mssg$metaKey, keycode=mssg$keycode), WH=getSVGWH() ) tibs<-eval(parse(text=txt), ppenv ) From 43d5ea18623b0612ebb0f2bb1a738e53b0f95043 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:22:05 -0400 Subject: [PATCH 232/263] added comments --- inst/App/rightPanel/serverOptions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/App/rightPanel/serverOptions.R b/inst/App/rightPanel/serverOptions.R index cf7e5f24..8f6ddafa 100644 --- a/inst/App/rightPanel/serverOptions.R +++ b/inst/App/rightPanel/serverOptions.R @@ -14,8 +14,8 @@ pprj<-reactiveVal(initialProj) getDirPath<-reactive({ if(!is.null(editOption$currentProjectName) && !is.null(editOption$currentProjectDirectory)){ dirPath<-editOption$currentProjectDirectory - if(!file.exists(dirPath)){ - dirPath<-optionDirPath() + if(!file.exists(dirPath)){ # currentProjectDirectory not found!! + dirPath<-optionDirPath() # this sets dirPath to ~/ptr editOption$currentProjectName=NULL editOption$currentProjectDirectory=NULL } From 40b408c67711b030999cab3ae797a215d613f819 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:22:25 -0400 Subject: [PATCH 233/263] changed templated comments --- inst/App/templates/onChangeRowTemplate.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inst/App/templates/onChangeRowTemplate.R b/inst/App/templates/onChangeRowTemplate.R index fddc7804..d7a949f8 100644 --- a/inst/App/templates/onChangeRowTemplate.R +++ b/inst/App/templates/onChangeRowTemplate.R @@ -1,8 +1,9 @@ # template for value precprossing on row change -value<-getAttrValue() # pt contains coordinates derived from the mouse click +value<-getAttrValue() # by value contains value as entered -# apply your point manipulations here +# apply your value manipulations here tibs<-setAttrValue(value=value, context=context ) tibs # always return tibs + From 7d1428727112cdf64e6e2d45fa2e76ab081e834e Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:23:40 -0400 Subject: [PATCH 234/263] added help windows for preprocs --- inst/App/leftPanel/menu/UIProjectTemplateMenu.R | 2 +- inst/App/leftPanel/menu/UIbuildLeftMenu.R | 10 ++++++++++ inst/App/leftPanel/menu/serverEditBar.R | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R index 0c0445dd..20dac69d 100644 --- a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R +++ b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R @@ -7,7 +7,7 @@ UIProjectTemplateMenu<-function(){ file.path(homeDir, '.ptR','.templates'), full.names = TRUE, recursive = FALSE ) templatePaths<-c(projTemplatePaths,userTemplatePaths) - templateNames<-basename(templatePaths) + templateNames<-basename(templatePaths) #gsub('-',' ',basename(templatePaths)) templatePaths<-paste0('projectTemplate-',templatePaths) tmp<-mapply(shinyDMDMenu::menuItem, templateNames, value=templatePaths,SIMPLIFY=FALSE) do.call(tagList, tmp) diff --git a/inst/App/leftPanel/menu/UIbuildLeftMenu.R b/inst/App/leftPanel/menu/UIbuildLeftMenu.R index 659252f1..6a7279bd 100644 --- a/inst/App/leftPanel/menu/UIbuildLeftMenu.R +++ b/inst/App/leftPanel/menu/UIbuildLeftMenu.R @@ -84,11 +84,21 @@ buildLeftMenu<-function(version){ "Help", shinyDMDMenu::menuItem("Editor ShortCuts"), shinyDMDMenu::menuItem("Element Reference"), + if(usingElectron){ shinyDMDMenu::menuItem("svgR User Guide", value="svgRUserGuide") } else { shinyDMDMenu::menuItem(HTML("
  • svgR User Guide
  • ")) }, + if(usingElectron){ + menuDropdown( + "Preprocessing", + shinyDMDMenu::menuItem(HTML("attribute"), value="preprocAttrHelp"), + shinyDMDMenu::menuItem(HTML("point"), value="preprocPtHelp") + ) + } else { + NULL + }, if(usingElectron){ menuDropdown( "Useful Links", diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index 8756d35a..217b3818 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -214,6 +214,18 @@ observeEvent( input$editNavBar, { sendPtRManagerMessage(sender='cmd.electron', openWindow= "svgRUserGuide") dirtyDMDM(session, "editNavBar") } + if(identical(fileCmd,"preprocPtHelp")){ + #href='http://mslegrand.github.io/svgR/User_Guide.html' + #sendPtRManagerMessage(sender='cmd.electron', openLink= href) + sendPtRManagerMessage(sender='cmd.electron', openWindow= "preprocPtHelp") + dirtyDMDM(session, "editNavBar") + } + if(identical(fileCmd,"preprocAttrHelp")){ + #href='http://mslegrand.github.io/svgR/User_Guide.html' + #sendPtRManagerMessage(sender='cmd.electron', openLink= href) + sendPtRManagerMessage(sender='cmd.electron', openWindow= "preprocAttrHelp") + dirtyDMDM(session, "editNavBar") + } if(identical(fileCmd,"io.svgR")){ href='http://mslegrand.github.io/svgR' sendPtRManagerMessage(sender='cmd.electron', openLink= href) From 405f6c5f097affc2ba0a2df7c6f386c8188d4a4c Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 08:24:02 -0400 Subject: [PATCH 235/263] reformat --- inst/App/global.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/App/global.R b/inst/App/global.R index 92c1ba8c..5e134e16 100644 --- a/inst/App/global.R +++ b/inst/App/global.R @@ -80,7 +80,10 @@ tibTag<-'tib' resourceDir='aux' -preprocChoices<-list(points=c("onNewPt", "onMovePt", "onMoveMat"), attrs=c('onNewRow', 'onChangeRow')) +preprocChoices<-list( + points=c("onNewPt", "onMovePt", "onMoveMat"), + attrs=c('onNewRow', 'onChangeRow') +) #----begin external resources loaded prior to server------------ # must be loaded prior to alles From 965bdf0d46f2c350e2b0f3bd5566ae5ac3575913 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Thu, 21 Oct 2021 09:12:16 -0400 Subject: [PATCH 236/263] replace new.env() with getEnvList() --- inst/App/leftPanel/footer/processKnit.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/footer/processKnit.R b/inst/App/leftPanel/footer/processKnit.R index 7b306c1b..53095295 100644 --- a/inst/App/leftPanel/footer/processKnit.R +++ b/inst/App/leftPanel/footer/processKnit.R @@ -17,7 +17,8 @@ processKnit<-reactive({ } tryCatch({ # cat_list<<-c( cat_list,'>--> knit2html\n') - knit2html(text = src, fragment.only = FALSE, quiet = TRUE, envir=new.env()) + # knit2html(text = src, fragment.only = FALSE, quiet = TRUE, envir=new.env()) + knit2html(text = src, fragment.only = FALSE, quiet = TRUE, envir=getEnvList() ) # cat_list<<-c( cat_list,'<--< knit2html\n') setSourceType(sourceType=rmdPanelTag) } From 45e73b32fc8d94d96b2ff4434266bd843e8f4692 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Oct 2021 17:31:38 -0400 Subject: [PATCH 237/263] knit snippet in getEnvList enviroment --- inst/App/rightPanel/mid/serverPlotRmd.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/App/rightPanel/mid/serverPlotRmd.R b/inst/App/rightPanel/mid/serverPlotRmd.R index 883ba56c..b5c8fbab 100644 --- a/inst/App/rightPanel/mid/serverPlotRmd.R +++ b/inst/App/rightPanel/mid/serverPlotRmd.R @@ -15,7 +15,10 @@ modulePlotRmd<-function(input, output, session, src<-dripplets2Rmd(src) } div( style='background-color: #FFFFFF;', - HTML(knit2html(text =src , fragment.only = TRUE, quiet = TRUE)) + HTML( + knit2html(text = src, fragment.only = TRUE, quiet = TRUE, envir=getEnvList() ) + # knit2html(text =src , fragment.only = TRUE, quiet = TRUE + ) ) } else { HTML('') From 17c36701aee5d9066e2e0d9066aa59e75718c614 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 22 Oct 2021 17:32:38 -0400 Subject: [PATCH 238/263] knit in envir=getEnvList add update for dependent child windows --- inst/App/leftPanel/footer/processDnip.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/footer/processDnip.R b/inst/App/leftPanel/footer/processDnip.R index 3ac8df90..0dee0b2d 100644 --- a/inst/App/leftPanel/footer/processDnip.R +++ b/inst/App/leftPanel/footer/processDnip.R @@ -4,6 +4,8 @@ processDnip<-reactive({ clearErrorMssg() # src<-request$code src<-getCode() + updateAceExt( id= getAceEditorId(), sender='commit.removeMarkers', removeAllMarkers='removeAllMarkers', updateRmdDependents=getAceEditorId() ) + setSourceType(rmdPanelTag) if(length(src)==1 && nchar(src)>0){ @@ -12,7 +14,7 @@ processDnip<-reactive({ src<-dripplets2Rmd(src) # cat_list<<-c( cat_list,'<--< dripplets2Rmd\n') # cat_list<<-c( cat_list,'>-->> knit2html\n') - knit2html(text = src, fragment.only = FALSE, quiet = TRUE) + knit2html(text = src, fragment.only = FALSE, quiet = TRUE, envir=getEnvList() ) # cat_list<<-c( cat_list,'<--<< knit2html\n') setSourceType(sourceType=rmdPanelTag) } From 7085e09caaaa48fffee36a613421e50c96da977d Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 5 Nov 2021 19:17:39 -0400 Subject: [PATCH 239/263] fix rect dnds --- inst/App/templates/sampleShapes.dnds | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/App/templates/sampleShapes.dnds b/inst/App/templates/sampleShapes.dnds index e0a49b17..f1f16db1 100644 --- a/inst/App/templates/sampleShapes.dnds +++ b/inst/App/templates/sampleShapes.dnds @@ -93,7 +93,7 @@ SNIPPET ``` rect( xy=${1:WH/2}, - wh=${2:c(.47,.3)*WH}, + wh=${2:c(.4,.3)*WH}, stroke='black', fill=${3:'none'} )${0:} @@ -105,7 +105,7 @@ library(svgR) ptR<-list( x=matrix(0,2,0) ) -svgR(, +svgR( line(xy1=c(.5,0)*WH, xy2=c(.5,1)*WH, stroke.dasharray=2), line(xy1=c(0,.5)*WH, xy2=c(1,.5)*WH, stroke.dasharray=2), rect( @@ -129,7 +129,7 @@ SNIPPET ``` rect( cxy=${1:WH/2}, - wh=${2:c(.47,.3)*WH}, + wh=${2:c(.45,.3)*WH}, stroke='black', fill=${3:'none'} )${0:} From b45b8422a2497b5d58f090dbd1faca4fa8c1f711 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 5 Nov 2021 19:18:57 -0400 Subject: [PATCH 240/263] dash in project name is displayed as spaces --- inst/App/leftPanel/pproj/pprojModalNew.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/pproj/pprojModalNew.R b/inst/App/leftPanel/pproj/pprojModalNew.R index 7e40b319..1a99eb62 100644 --- a/inst/App/leftPanel/pproj/pprojModalNew.R +++ b/inst/App/leftPanel/pproj/pprojModalNew.R @@ -17,7 +17,8 @@ newProjModal <- function(failed = 0, mssg=NULL, datapath=NULL, projectName=NULL) }, div( textInput(inputId="modalProjName", "Project Name", - value = projectName, + label = gsub('-',' ', projectName), + projectName, placeholder = 'The name of this pointR project' )), #span('Create the project as a subdirectory of:)'), From 32bf5269a8e052ea5b1d74ca6efb2b5f429353f3 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 5 Nov 2021 19:21:00 -0400 Subject: [PATCH 241/263] dash in project name displayed as spaces remove New Basic Project for New Project Menu (since now resides in projectTemplate dir --- inst/App/leftPanel/menu/UIProjectTemplateMenu.R | 5 +++-- inst/App/leftPanel/menu/UIbuildLeftMenu.R | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R index 20dac69d..78759816 100644 --- a/inst/App/leftPanel/menu/UIProjectTemplateMenu.R +++ b/inst/App/leftPanel/menu/UIProjectTemplateMenu.R @@ -7,7 +7,8 @@ UIProjectTemplateMenu<-function(){ file.path(homeDir, '.ptR','.templates'), full.names = TRUE, recursive = FALSE ) templatePaths<-c(projTemplatePaths,userTemplatePaths) - templateNames<-basename(templatePaths) #gsub('-',' ',basename(templatePaths)) +# templateNames<-basename(templatePaths) #gsub('-',' ',basename(templatePaths)) + templateNames<-gsub('-',' ',basename(templatePaths)) templatePaths<-paste0('projectTemplate-',templatePaths) tmp<-mapply(shinyDMDMenu::menuItem, templateNames, value=templatePaths,SIMPLIFY=FALSE) do.call(tagList, tmp) @@ -36,7 +37,7 @@ updateNewProjectMenu<-function(session){ removeDMDM(session=session, menuBarId="editNavBar", entry='New Project') #recreate dropdow submenu<-menuDropdown('New Project', - shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), + # shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), shinyDMDMenu::menuItem('Clone of Existing Project', value='newCloneProject'), # shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), UIProjectTemplateMenu() diff --git a/inst/App/leftPanel/menu/UIbuildLeftMenu.R b/inst/App/leftPanel/menu/UIbuildLeftMenu.R index 6a7279bd..178a7ba9 100644 --- a/inst/App/leftPanel/menu/UIbuildLeftMenu.R +++ b/inst/App/leftPanel/menu/UIbuildLeftMenu.R @@ -25,7 +25,7 @@ buildLeftMenu<-function(version){ # shinyDMDMenu::menuItem('Plain Text Doc', value='newText') ), menuDropdown('New Project', - shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), + # shinyDMDMenu::menuItem('New Basic Project', value='newBasicProject'), shinyDMDMenu::menuItem('Clone of Existing Project', value='newCloneProject'), # shinyDMDMenu::menuItem('svgR-based ShinyInput Control', value='newSimpleInputWidget'), UIProjectTemplateMenu() From 625722aa174d495827672a3220b8bae6ca51b381 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 5 Nov 2021 19:21:41 -0400 Subject: [PATCH 242/263] remove projectTemplate- prefix using sub instead of split --- inst/App/leftPanel/menu/serverEditBar.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/App/leftPanel/menu/serverEditBar.R b/inst/App/leftPanel/menu/serverEditBar.R index 217b3818..a554c7e5 100755 --- a/inst/App/leftPanel/menu/serverEditBar.R +++ b/inst/App/leftPanel/menu/serverEditBar.R @@ -68,7 +68,10 @@ observeEvent( input$editNavBar, { dirtyDMDM(session, "editNavBar") } if(grepl("projectTemplate-",fileCmd)){ - templatePath<- str_split(fileCmd,'-')[[1]][2] + cat('fileCmd=',fileCmd,'\n') + #templatePath<- str_split(fileCmd,'-')[[1]][2] + templatePath<-sub('^projectTemplate-','',fileCmd) + cat('templatePath=',templatePath,'\n' ) showModal(newProjShinyCntrlModal(projTemplatePath=templatePath)) dirtyDMDM(session, "editNavBar") } From ed6d708727a41e55ae5c643c7d81ce390d9839bd Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Fri, 5 Nov 2021 19:22:47 -0400 Subject: [PATCH 243/263] replace - with space in projectName in h2 header of modal --- inst/App/leftPanel/pproj/pprojModalNewCntrl.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inst/App/leftPanel/pproj/pprojModalNewCntrl.R b/inst/App/leftPanel/pproj/pprojModalNewCntrl.R index 2c05e574..27b80d5a 100644 --- a/inst/App/leftPanel/pproj/pprojModalNewCntrl.R +++ b/inst/App/leftPanel/pproj/pprojModalNewCntrl.R @@ -1,8 +1,8 @@ # ---beging code to inserted in ptR------------------------------- newProjShinyCntrlModal <- function(failed = 0, mssg=NULL, datapath=NULL, projectName=NULL, projTemplatePath) { #shinyDirChoose(input, id='browseForDir', roots=c(wd='~'), filetypes='') - # cat('>----> newProjShinyCntrlModal\n') - requestedProjTemplatePath(projTemplatePath) + + requestedProjTemplatePath(projTemplatePath) shinyDirChoose(input, id='browseForDir', roots=c(home='~')) observeEvent(input$browseForDir,{ datapath<-parseDirPath(c(home='~'), input$browseForDir) @@ -15,7 +15,7 @@ newProjShinyCntrlModal <- function(failed = 0, mssg=NULL, datapath=NULL, project # cat('>----> modalDialog\n') modalDialog( h4('Create a new Project using the template '), - h2( basename(projTemplatePath)), + h2( gsub('-', ' ', basename(projTemplatePath))), if(failed==1){ h4(mssg) }, @@ -49,6 +49,7 @@ requestedProjTemplatePath<-reactiveVal("") observeEvent(input$modalNewShinyCntrlProjOk, { # Check that data object exists and is data frame. templatePath<-requestedProjTemplatePath() + projectName<-input$modalProjName if(!is.null(projectName)){ projectName<-str_trim(projectName) @@ -103,8 +104,8 @@ observeEvent(input$modalNewShinyCntrlProjOk, { # 0. close current project closeCurrentProj() sourceProject<- path_join(c(templatePath, templateName.pprj)) - - # 1. clone project + + # 1. clone project fullpathProjName<-copyAndRenameProject( sourceProject= path_join(c(templatePath, templateName.pprj)), targetName=projName, From 1e769e0105f68f6e72826a37afd403ad3bd7a7a6 Mon Sep 17 00:00:00 2001 From: "m. s. legrand" Date: Tue, 29 Mar 2022 07:52:49 -0400 Subject: [PATCH 244/263] remove useShinyalert --- .../New-Basic-Project/.DS_Store | Bin 0 -> 6148 bytes .../.workspace/PTR-TABID1bc24c47730d.rda | Bin 0 -> 758 bytes .../.workspace/currentTab.rda | Bin 0 -> 73 bytes .../New-Basic-Project/New-Basic-Project.pprj | 12 + .../New-Basic-Project/aux/.DS_Store | Bin 0 -> 6148 bytes .../New-Basic-Project/aux/dnds/fill.dnds | 143 +++++ .../aux/dnds/sampleShapes.dnds | 512 ++++++++++++++++++ .../shiny-Input-Control/.DS_Store | Bin 0 -> 6148 bytes .../.workspace/PTR-TABID41cd6cdad2c7.rda | Bin .../.workspace/PTR-TABID4e863aae5fe.rda | Bin .../.workspace/PTR-TABID4e867f16b059.rda | Bin .../.workspace/PTR-TABID5e821a75da45.rda | Bin .../.workspace/PTR-TABID7274230e0fc4.rda | Bin .../.workspace/currentTab.rda | Bin .../.workspace/loadedDnippets.rda | Bin .../app.R | 0 .../shiny-Input-Control/aux/.DS_Store | Bin 0 -> 6148 bytes .../aux/dnds/cntl.dnds | 0 .../aux/dnds/jstools.dnds | 0 .../aux/dnds/mouseEvents.dnds | 0 .../aux/dnds/sampleShapes.dnds | 0 .../notes.Rmd | 0 .../notes.html | 0 .../readme.Rmd | 0 .../readme.html | 0 .../shinyInputControl.R | 0 .../shinyInputControl.pprj | 0 .../shinyInputControl_svg.R | 0 .../www/shinyInputControl.js | 0 inst/App/ui.R | 4 +- 30 files changed, 669 insertions(+), 2 deletions(-) create mode 100644 inst/App/projectTemplates/New-Basic-Project/.DS_Store create mode 100644 inst/App/projectTemplates/New-Basic-Project/.workspace/PTR-TABID1bc24c47730d.rda create mode 100644 inst/App/projectTemplates/New-Basic-Project/.workspace/currentTab.rda create mode 100644 inst/App/projectTemplates/New-Basic-Project/New-Basic-Project.pprj create mode 100644 inst/App/projectTemplates/New-Basic-Project/aux/.DS_Store create mode 100644 inst/App/projectTemplates/New-Basic-Project/aux/dnds/fill.dnds create mode 100644 inst/App/projectTemplates/New-Basic-Project/aux/dnds/sampleShapes.dnds create mode 100644 inst/App/projectTemplates/shiny-Input-Control/.DS_Store rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/PTR-TABID41cd6cdad2c7.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/PTR-TABID4e863aae5fe.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/PTR-TABID4e867f16b059.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/PTR-TABID5e821a75da45.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/PTR-TABID7274230e0fc4.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/currentTab.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/.workspace/loadedDnippets.rda (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/app.R (100%) create mode 100644 inst/App/projectTemplates/shiny-Input-Control/aux/.DS_Store rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/aux/dnds/cntl.dnds (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/aux/dnds/jstools.dnds (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/aux/dnds/mouseEvents.dnds (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/aux/dnds/sampleShapes.dnds (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/notes.Rmd (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/notes.html (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/readme.Rmd (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/readme.html (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/shinyInputControl.R (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/shinyInputControl.pprj (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/shinyInputControl_svg.R (100%) rename inst/App/projectTemplates/{shinyInputControl => shiny-Input-Control}/www/shinyInputControl.js (100%) diff --git a/inst/App/projectTemplates/New-Basic-Project/.DS_Store b/inst/App/projectTemplates/New-Basic-Project/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5456890f36b7855d884ce69ab230dd76b3c07829 GIT binary patch literal 6148 zcmeH~I}XA?3`A|9h(wc;avKi74OS7HfD7;|kth%nvIYIqf#4$mxIozrYo8^+Vg;}!TM!kPMk^St>SKu2 zy&WuhT}`%Nw2S8Op?PPuDF&v|E?SVlv^p5502LT1Fps>q^M42bHvf-Wm{I{M@Mj9> zV!PiCc&R*FKVHx3hpgJV!9l+q;q4~?i5bBqmBv)9 z9plzX{x#N;II`VCZeY*C>+mu>0pL2x;&?0Sh?K_v_x=9QcE8$|Wvy7N*0QxykxQ#` zI{4IjZCT4TDYWIgA>SpbP?g_@y}?Oq@cu*h;DzIE@3=d=yDvMQBy6RWKKh2GxAJFQ zEq+d$~U46~%p$HS9`olAmv$ru=ihJALp*K+HxI-TZDr_-?Q zEp!0qBmxgP2@2_m!y5!15okh$k6g^)xgCp>y;eZDsM`ol_XQ)46TnPB=vz!lBzRK^ zA(q^<-f3<(rEP>7w)8Lyr9ScZ&kj>1w3W~iL+*$R8X}i^fQA$}@_|9BaC~}nWH*e| zssn~29$*0maVL%7h9dqpG}mZ!43nN%v}5=BxQ*8K14vc4(8A>?7SGw{JV3E%*@%SbFJYYXgjy^Py5IKumQ3_1JAU}s_v z3qP-wLE}iC0-BLEgACK5x~m~#+)2*4GDMr|=W#OIWSgCx#% zo)|hV4Mt&fEQ^$9Xee+9x{(LdJVS$)x6nr#WaLwWj748XEs;D?GeoWOre{Vcy62if zM@7t!ulbcRX*sPs*uC%=jZ6LtR2G4<4BaSDAKZ(p&f7yqywd)vLby*S`IV;tZ(0_U zk^$Y7J-gh?CKaNaR6t=e6_b*I>n6uI80ER!UPQ`yZz_c2Fb<&a;~03`i#(oJMX_?` z0v)v{#2c1FRfyJvy9!9>siY%{=}UD&5`Doz8N$;7O1E(Vao+kAQ2hn(ObQ?}>VC{1 oX4LKBA(Y~)l?dW!<4~g9(xhzaRC?qTEC1jA0w|H5)|v{{co-GZSiB0DGA}kvP`E4LuI?{> Zcu9)#Y5Nu(cEZWd&6|<<$gZNTz`Ct zvr|7G2HHML(|B(C!Fe>8_F7v%h@)kTzq>C{apNtnrfJhdQ1Lo|A= zc2QUzb9c`!J7!^92Qaa1YriZTVtdCvJn7#(JQh#o^NV7Y!v`p3Q{xO?!I&Q~%x>ZU zej*0Xo%h~2iPPj3e6vkv$%MoJF+dC~Cj+n`dwZ=wO{Xsi^12Za6zNE&D$2L6vIYIqf#4$mxIozrYo8^+Vg;}!TM!kPMk^St>SKu2 zy&WuhT}`%Nw2S8Op?PPuDF&v|E?SVlv^p5502LT1Fps>q^M42bHvf-Wm{I{M@Mj9> zV!PiCc&R*FKVHx3hpgJV!9l+q;q4~?i5?E15i}_&_ZRqsB?^5cegKi9K#I7C3;lKccE*p0B&)O(#Fp&2^?7!+ zQ=HELWbxfU0&@T}x*~oww5IRX8@q{2M-<(oAJ?0=Vc0a4mlMkE(BqRn9`o<8#TVW! z4p`#}yWawyhVz2ec|nJf+kRks*j8C-sX!`_3Zw$5z_lw7{cv`F?Ly@JQ-M^VQ9!>B zg|1iwCrA5qFxUt{)ZchBKHDroESezJz{!yrnmCo{REZHooX&iSx*9k+Ivo