svg.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. if (!String.prototype.encodeHTML) {
  2. String.prototype.encodeHTML = function () {
  3. return this.replace(/&/g, '&')
  4. .replace(/</g, '&lt;')
  5. .replace(/>/g, '&gt;')
  6. .replace(/"/g, '&quot;')
  7. .replace(/'/g, '&apos;');
  8. };
  9. }
  10. var transition = {pid: '', port: '8080' };
  11. // BERT Protocol
  12. var players = ["Gabrielo","Mustafa","Alina","Me"];
  13. function statsRow(start_name,i,games) {
  14. var start_score = 200;
  15. var name = template_engine(
  16. '<tspan xmlns="http://www.w3.org/2000/svg" x="{this.x}" y="{this.y}">{this.body}</tspan>',{
  17. x: start_name,
  18. y: 180+25*i,
  19. body: games[i].value[0][0] + " — " + games[i].value[0][1]});
  20. var element1 = svg(name);
  21. document.getElementById('Stat-Right').appendChild(element1);
  22. }
  23. var user_count = 0;
  24. function handle_web_socket(body) {
  25. // console.log(dec(body).value[0][0].value);
  26. switch (dec(body).value[0][0].value) {
  27. case 'roster_item':
  28. var id = dec(body).value[0][1].value;
  29. var names = dec(body).value[0][2].value;
  30. var surnames = dec(body).value[0][3].value;
  31. addOnlineUser(id,names+" "+surnames+ " "+user_count++,'appendChild');
  32. break;
  33. case 'roster_end':
  34. onlineHover();
  35. mouseWheelHandler({'detail':5,'wheelDelta':5});
  36. onlineHoverOut();
  37. break;
  38. case 'stats_event':
  39. document.getElementById('Player-Statistics').style.display = '';
  40. var games = dec(body).value[0][2];
  41. var reveals = dec(body).value[0][3];
  42. var protocol = dec(body).value[0][4];
  43. removeChilds(document.getElementById('Stat-Left'));
  44. removeChilds(document.getElementById('Stat-Right'));
  45. for (var i=0;i<games.length;i++) { statsRow(24, i,games); }
  46. for (var i=0;i<protocol.length;i++) { statsRow(340,i,protocol); }
  47. // for (var i=0;i<reveals.length;i++) { statsRow(340,i,reveals); }
  48. break;
  49. }
  50. switch (dec(body).value[0][2].value) {
  51. case 'okey_game_info':
  52. var a = dec(body).value[0][3][0].value[0][1];
  53. // console.log("Players: " + a.length);
  54. for (var i=0;i<a.length;i++) {
  55. var c = a[i].value[0][3].value;
  56. var v = a[i].value[0][4].value;
  57. setPlayerName(players[i],c + " " + v);
  58. // console.log("Player: " + c + " " + v);
  59. }
  60. break;
  61. case 'okey_game_started':
  62. var a = dec(body).value[0][3][0].value[0][1];
  63. // console.log("Cards: " + a.length);
  64. for (var i=1;i<=a.length;i++) {
  65. var c = a[i-1].value[0][1];
  66. var v = a[i-1].value[0][2];
  67. // console.log("Card: " + c + " " + v);
  68. place_card(i,rand(1,2),c,v);
  69. }
  70. break;
  71. case 'okey_game_player_state': /// these two messages should be combined
  72. var a = dec(body).value[0][3][3].value[0][1];
  73. // console.log("Cards: " + a.length);
  74. for (var i=1;i<=a.length;i++) {
  75. var c = a[i-1].value[0][1];
  76. var v = a[i-1].value[0][2];
  77. // console.log("Card: " + c + " " + v);
  78. place_card(i,1,c,v);
  79. }
  80. break;
  81. case 'okey_tile_discarded':
  82. console.log(String(dec(body)));
  83. var player = dec(body).value[0][3][0].value[0][1];
  84. var tile = dec(body).value[0][3][1].value[0][1];
  85. if (player.value == document.user) {
  86. console.log("Discard: " + player.value);
  87. var p = findCardOnTable(tile.value[0][1],tile.value[0][2]);
  88. empty_card(p.x,p.y);
  89. }
  90. break;
  91. case 'okey_tile_taken':
  92. console.log(String(dec(body)));
  93. var player = dec(body).value[0][3][0].value[0][1];
  94. var taken = dec(body).value[0][3][2].value[0][1];
  95. if (taken.value != 'null' && player.value == document.user) {
  96. console.log("Taken: " + player.value);
  97. var c = taken.value[0][1];
  98. var v = taken.value[0][2];
  99. var pos = findPlace();
  100. // console.log(pos);
  101. place_card(pos.x,pos.y,c,v);
  102. }
  103. break;
  104. default: console.log(String(dec(body)));
  105. }
  106. }
  107. // SVG DOM and Template Engine
  108. function template_engine(html, data) {
  109. var re = /{([^}]+)?}/g, code = 'var r=[];', cursor = 0;
  110. var add = function(line,js) {
  111. js? (code += 'r.push(' + line + ');') :
  112. (code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");' : '');
  113. return add; }
  114. while(match = re.exec(html)) {
  115. add(html.slice(cursor, match.index))(match[1],true);
  116. cursor = match.index + match[0].length; }
  117. add(html.substr(cursor, html.length - cursor));
  118. code += 'return r.join("");';
  119. return new Function(code.replace(/[\r\t\n]/g, '')).apply(data); }
  120. function reload(file, name) { var slot = document.getElementById(name);
  121. slot.parentNode.replaceChild(svg(localStorage.getItem(file)),slot);}
  122. function reload_cont(cont,name,element) { if (null != cont) (cont)(); else reload(name,element); }
  123. function loadFile(name,cont,element) {
  124. if (localStorage.getItem(name) == null) {
  125. var client = new XMLHttpRequest();
  126. client.open('GET', name, true);
  127. client.onload = function() {
  128. localStorage.setItem(name,client.responseText);
  129. reload_cont(cont,name,element); }
  130. client.send(); }
  131. else reload_cont(cont,name,element); }
  132. function svg(html) {
  133. return new DOMParser().parseFromString(html, "text/xml").firstChild;
  134. }
  135. function svgBulk() {
  136. var res = [];
  137. var node = new DOMParser().parseFromString(html, "text/xml").firstChild;
  138. for (var i=0;i<node.childnode.length;i++) { var child = childNodes.item(i);
  139. if (child.tagName != undefined) res.push(child); } }
  140. // The Card
  141. //var color = ['#CE290F','#3B5998','#48AF5E','#FFEC00'];
  142. var color = ['#DE3F26','#606060','#48AF5E','#FFC800'];
  143. var slotName = slotNameDef;
  144. function slotNameDef(x,y) { return "Slot-"+y+","+x; }
  145. function card(line,pos,col,v) {
  146. return template_engine(
  147. localStorage.getItem("templates/Card.svg"),
  148. { name: slotName(pos,line),
  149. suit: color[col-1],
  150. value: v,
  151. y: (line-1)*69,
  152. x: (pos-1)*42 }); }
  153. // Game Scene
  154. function setPlayerName(e, playerName) {
  155. var dx = (document.getElementById(e).attributes['fill'].value == "#FFFFFF") ? 65 : 20;
  156. document.getElementById(e).setAttribute("y",27);
  157. document.getElementById(e).setAttribute("x",dx);
  158. document.getElementById(e).textContent = playerName;
  159. // console.log("Bounding Box: " + document.getElementById(e).getBBox().width);
  160. document.getElementById(e+"-Pad").setAttribute('width',
  161. document.getElementById(e).getBBox().width + 45); }
  162. function place_card(x,y,c,v) {
  163. var slot = document.getElementById(slotName(x,y));
  164. slot.parentNode.replaceChild(svg(card(y,x,c,v)),slot); }
  165. function empty_card(x,y) { var slot = document.getElementById(slotName(x,y));
  166. var html = '<g xmlns="http://www.w3.org/2000/svg" id="'+slotName(x,y)+'"/>';
  167. slot.parentNode.replaceChild(svg(html),slot); }
  168. function rand(lo,hi) { return Math.floor((Math.random()*hi)+lo); }
  169. function loadScene() {
  170. reload("Kakaranet-Scene.svg", "Refined");
  171. for (var i=1;i<16;i++) { empty_card(i,2); empty_card(i,1); }
  172. //drawSampleCards();
  173. }
  174. function findPlace() {
  175. for (var y=1;y<3;y++) for (var x=1;x<15;x++) {
  176. var e = document.getElementById(slotName(x,y));
  177. if (e.childElementCount == 0) {
  178. var pos = e.attributes['id'].value.split("-")[1].split(",");
  179. console.log("Free");
  180. console.log(pos[0]);
  181. console.log(pos[1]);
  182. return { y: pos[0], x: pos[1] }; } } }
  183. function findCardOnTable(c,v) {
  184. console.log("Find Card " + c + " " + v);
  185. for (var y=1;y<3;y++) for (var x=1;x<15;x++) {
  186. var e = document.getElementById(slotName(x,y));
  187. if (e.childElementCount > 0) {
  188. var value = e.lastChild.textContent;
  189. var col = color.indexOf(e.lastChild.attributes['fill'].value) + 1;
  190. console.log(col + " " + value);
  191. if (c == col && v == value) return { 'x': x, 'y': y }; } }
  192. console.log("Card Not Found");
  193. return ""; }
  194. function loadAppend(file, animation, name) {
  195. loadFile(file, function() {
  196. var slot = document.getElementById(name);
  197. var r = template_engine(localStorage.getItem(file),{'name': animation});
  198. document.getElementById(name).appendChild(svg(r)); }); }
  199. function loadAnimationForButton(a, b) { return loadAppend('templates/ButtonAnimation.svg', a, b); }
  200. // TODO: Rollout Monadic Chain here
  201. loadFile('templates/Card.svg', function() {
  202. loadFile('Kakaranet-Scene.svg', function() {
  203. loadScene();
  204. var a = [{button: "Create", pathes: ["CreateShow", "CreateHide"]},
  205. {button: "Play", pathes: ["PlayShow", "PlayHide"]}];
  206. for (var y=0;y<a.length;y++) for (var x=0;x<a[y].pathes.length;x++)
  207. loadAnimationForButton(a[y].pathes[x],a[y].button);
  208. document.getElementById("Right-Menu") .setAttribute('onclick', 'onRightMenu(evt)');
  209. document.getElementById("Play") .setAttribute('onclick', 'onRightMenuDown(evt)');
  210. document.getElementById("Create") .setAttribute('onclick', 'onRightMenuDown(evt)');
  211. document.getElementById("Point-Table").setAttribute('onclick', 'onPlayerInfo(evt)');
  212. document.getElementById("Player-Statistics").setAttribute('onclick', 'onPlayerInfoClose(evt)');
  213. document.getElementById('Page-1').addEventListener("mousewheel", mouseWheelHandler, false);
  214. onRightMenuDown();
  215. });
  216. });
  217. var clipPath1 = svg('<clipPath id="myClip1"><rect xmlns="http://www.w3.org/2000/svg" id="Clip-Path-Left" x="0" y="0" width="216" height="400"/></clipPath>');
  218. var clipPath2 = svg('<clipPath id="myClip2"><rect xmlns="http://www.w3.org/2000/svg" id="Clip-Path-Right" x="0" y="0" width="216" height="400"/></clipPath>');
  219. document.getElementsByTagName('defs').item(0).appendChild(clipPath1);
  220. document.getElementsByTagName('defs').item(0).appendChild(clipPath2);
  221. document.getElementById("Online-List").setAttribute("clip-path","url(#myClip1)");
  222. document.getElementById("Chat").setAttribute("clip-path","url(#myClip2)");
  223. document.getElementById("Clip-Path-Left").setAttribute("transform", "translate(0,0)");
  224. document.getElementById("Clip-Path-Right").setAttribute("transform", "translate(0,0)");
  225. document.getElementById('Player-Statistics').style.display = 'none';
  226. document.getElementById("Right-Bar").setAttribute("fill","skyblue");
  227. document.getElementById("Right-Bar").onmouseover = barHover;
  228. document.getElementById("Right-Bar").onmouseout = barHoverOut;
  229. document.getElementById("Left-Bar").onmouseover = onlineHover;
  230. document.getElementById("Left-Bar").onmouseout = onlineHoverOut;
  231. document.getElementById('edit').setAttribute("contentEditable","true");
  232. document.getElementById('edit').onkeydown = chatEditor;
  233. var removeChilds = function (node) {
  234. var last;
  235. while (last = node.lastChild) node.removeChild(last);
  236. };
  237. function onPlayerInfo(evt) {
  238. ws.send(enc(tuple(atom('client'),
  239. tuple(atom('stats_action'),bin(document.user),atom('game_okey')))));
  240. }
  241. function onPlayerInfoClose(evt) {
  242. document.getElementById('Player-Statistics').style.display = 'none';
  243. }
  244. function onRightMenu(evt) {
  245. localStorage.clear();
  246. ["PlayShow","CreateShow"].map(function (x) {
  247. document.getElementById(x+"-Motion").beginElement(); }); }
  248. function onRightMenuDown(evt) {
  249. ["PlayHide","CreateHide"].map(function (x) {
  250. document.getElementById(x+"-Motion").beginElement(); }); }
  251. // SVG Samples for svg.htm
  252. /*
  253. loadFile('templates/Mustafa-Persona.svg', null, "Mustafa-Persona-Sample");
  254. loadFile('templates/Mustafa-Selection.svg', null, "Mustafa-Selection-Sample");
  255. document.getElementById("MustafaSelection").addEventListener('click', function() {
  256. var style = document.getElementById("Mustafa-Selection-Sample").style;
  257. if (style.display == 'none') style.display = 'block';
  258. else style.display = 'none'; });
  259. */
  260. function slotName1(x,y) { return "1Slot-"+y+","+x; }
  261. function drawSampleCards() {
  262. slotName = slotName1;
  263. for (var i=1;i<15;i++) { place_card(i,rand(1,2),rand(1,4),rand(1,13)); }
  264. slotName = slotNameDef; }
  265. var scrollSensitivity = 0.2;
  266. var scroll_left = 5;
  267. var scroll_right = -10000;
  268. function chatMessage(id, me, string) {
  269. var i=0;
  270. var colors=['#FDFDFD','#DFF1F4'];
  271. var x1 = 7;
  272. var y1 = 0;
  273. var translate_y = parseFloat(document.getElementById("Chat").getBBox().height);
  274. var x2 = 205;
  275. var textElement = chatText(id,me,string);
  276. var dy = translate_y == 0 ? 0 : translate_y + 10;
  277. var html = "<g xmlns='http://www.w3.org/2000/svg' " +
  278. "id='Message-"+id+"' transform='translate(0,"+dy+")'></g>";
  279. var messageElement = svg(html);
  280. messageElement.appendChild(textElement);
  281. document.getElementById("Chat").appendChild(messageElement);
  282. create_multiline(textElement);
  283. var y2 = textElement.getBBox().height + 5;
  284. var box = "<path xmlns='http://www.w3.org/2000/svg' d='M"+x1+","+y1+
  285. " L"+x2+","+y1+
  286. ((me == "Maxim") ?
  287. (" L"+x2+","+parseFloat(y2-7)+
  288. " L"+parseFloat(x2+7)+","+y2+
  289. " L"+x1+","+y2)
  290. :
  291. (" L"+x2+","+y2+
  292. " L"+0+","+y2+
  293. " L"+x1+","+parseFloat(y2-7)))
  294. + " L"+x1+","+y1+"' fill='"+colors[me=="Maxim"?1:0]+"'></path>";
  295. var boxElement = svg(box);
  296. messageElement.insertBefore(boxElement,textElement);
  297. boxElement.setAttribute("mouseover","barHover(evt);");
  298. boxElement.setAttribute("mouseout","barHoverOut(evt);");
  299. textElement.setAttribute("mouseover","barHover(evt);");
  300. textElement.setAttribute("mouseout","barHoverOut(evt);");
  301. messageElement.setAttribute("onmouseover","barHover(evt);");
  302. messageElement.setAttribute("onmouseout","barHoverOut(evt);");
  303. // console.log(messageElement);
  304. }
  305. function chatText(id, me, string) {
  306. var i = 0;
  307. var colors=['#3B5998'];
  308. var html = "<text id='ChatText-"+id+"' width='180' " +
  309. " xmlns='http://www.w3.org/2000/svg' "+
  310. " font-family='Exo 2' font-size='16' font-weight='normal' fill='"+colors[i]+"'>" +
  311. string + "</text>";
  312. // console.log(html);
  313. return svg(html);
  314. }
  315. function mouseWheelHandler(e) {
  316. var leftBar = document.getElementById("Left-Bar");
  317. var rightBar = document.getElementById("Right-Bar");
  318. var leftFill = leftBar.getAttribute("fill");
  319. var rightFill = rightBar.getAttribute("fill");
  320. var leftActive = leftFill == "skyblue";
  321. var rightActive = rightFill == "skyblue";
  322. if (!leftActive && !rightActive) return;
  323. // console.log(leftActive);
  324. var evt = e;
  325. var scroll_dy = evt.detail ? evt.detail * scrollSensitivity : evt.wheelDelta * scrollSensitivity;
  326. var ori = leftActive ? scroll_left : scroll_right;
  327. var scroll = parseFloat(scroll_dy) + parseFloat(ori);
  328. var selectedBar = leftActive ? "Online-List" : "Chat";
  329. var selectedClip = leftActive ? "Clip-Path-Left" : "Clip-Path-Right";
  330. var selectedBarShift = leftActive ? 0 : 857;
  331. var limit = parseFloat(document.getElementById(selectedBar).getBBox().height) - 400;
  332. if (scroll > 5) scroll = 5;
  333. if (scroll < -limit) scroll = -limit;
  334. document.getElementById(selectedClip).setAttribute("transform", "translate(0,"+parseFloat(-scroll)+")");
  335. document.getElementById(selectedBar).setAttribute("transform", "translate("+selectedBarShift+","+(parseFloat(95+scroll))+")");
  336. if (leftActive) scroll_left = scroll; else scroll_right = scroll;
  337. return true;
  338. }
  339. var svgNS = "http://www.w3.org/2000/svg";
  340. function create_multiline(target) {
  341. var text_element = target; // evt.target;
  342. var width = 190; //target.getAttribute("width");
  343. var words = text_element.firstChild.data.split('');
  344. // console.log(words);
  345. // var words = [].concat.apply([],lines.map(function(line) { return line.split(' '); }));;
  346. var start_x = 15; //text_element.getAttribute('x');
  347. text_element.firstChild.data = '';
  348. var tspan_element = document.createElementNS(svgNS, "tspan");
  349. tspan_element.setAttribute("x", start_x);
  350. tspan_element.setAttribute("dy", 18);
  351. var text_node = document.createTextNode(words[0]);
  352. tspan_element.appendChild(text_node);
  353. text_element.appendChild(tspan_element);
  354. for(var i=1; i<words.length; i++) {
  355. if (words[i]=="") continue;
  356. var len = tspan_element.firstChild.data.length;
  357. tspan_element.firstChild.data += words[i];
  358. if (tspan_element.getComputedTextLength() > width || words[i]=="\n") {
  359. if (words[i]=='\n') words[i]="";
  360. tspan_element.firstChild.data = tspan_element.firstChild.data.slice(0, len);
  361. var tspan_element = document.createElementNS(svgNS, "tspan");
  362. tspan_element.setAttribute("x", start_x);
  363. tspan_element.setAttribute("dy", 18);
  364. text_node = document.createTextNode(words[i]);
  365. tspan_element.appendChild(text_node);
  366. text_element.appendChild(tspan_element);
  367. }
  368. }
  369. }
  370. function barHover(evt) { document.getElementById("Right-Bar").setAttribute("fill","skyblue"); }
  371. function barHoverOut(evt) { document.getElementById("Right-Bar").setAttribute("fill","lightblue"); }
  372. function onlineHover(evt) { document.getElementById("Left-Bar").setAttribute("fill","skyblue"); }
  373. function onlineHoverOut(evt) { document.getElementById("Left-Bar").setAttribute("fill","lightblue"); }
  374. function onlineHoverColor(evt) {
  375. onlineHover(evt);
  376. var name = evt.target.getAttribute("xmlns:data");
  377. if (null != name) document.getElementById(name).setAttribute("fill","#FFF687");
  378. }
  379. function onlineHoverOutColor(evt) {
  380. onlineHoverOut(evt);
  381. var name = evt.target.getAttribute("xmlns:data");
  382. if (null != name) document.getElementById(name).setAttribute("fill","#DBEBED");
  383. }
  384. function chatEditor(evt) {
  385. if (evt.keyCode == 13 && evt.metaKey == false) {
  386. var e = document.getElementById('edit');
  387. if (e.innerText.trim() != ""){
  388. chatMessage("100","Maxim",e.innerText.trim().encodeHTML());
  389. e.innerHTML = '';
  390. }
  391. } else if (evt.keyCode == 13 && evt.metaKey == true) {
  392. document.execCommand('insertText',false, '\n');
  393. }
  394. var scroll = -1000000;
  395. mouseWheelHandler({'detail':scroll,'wheelDelta':scroll});
  396. }
  397. function addOnlineUser(name,full_name,insertMode) {
  398. var listElement = document.getElementById("Online-List");
  399. var y = listElement.getBBox().height;
  400. // console.log(y);
  401. var html = '<g xmlns="http://www.w3.org/2000/svg" height="60" transform="translate(0, '+y+')">' +
  402. '<g xmlns:data="'+name+'"fill="#DBEBED" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);">' +
  403. ' <rect xmlns:data="'+name+'"fill="#DBEBED" id="'+name+'" x="10" y="0" width="196" height="48" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);"></rect></g>' +
  404. '<text xmlns:data="'+name+'" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);" '+
  405. 'font-family="Exo 2" font-size="18" font-weight="normal" line-spacing="18"'+
  406. ' fill="#3B5998">' +
  407. '<tspan xmlns:data="'+name+'" font-weight="normal" fill="green" x="19" y="22">'+full_name+'</tspan>' +
  408. '<tspan xmlns:data="'+name+'" font-size="14" x="19" y="40">Score: 1043 Pos: 13</tspan></text>'+
  409. '<rect onmouseover="onlineHover(evt);" onmouseout="onlineHoverOut(evt);"'+
  410. ' x="10" y="48" width="196" height="8"></rect></g>';
  411. var element = svg(html);
  412. // element.setAttribute("mouseover","onlineHoverColor(evt);");
  413. // element.setAttribute("mouseout","onlineHoverOutColor(evt);");
  414. // console.log(element);
  415. listElement.appendChild(element);
  416. }
  417. chatMessage("1","Maxim2","Joe:\nHello There!".encodeHTML());
  418. chatMessage("2","Maxim2","Alice:\nYou got new Design. Eh?".encodeHTML());
  419. chatMessage("3","Maxim","Maxim So:\nThis was made with pure SVG".encodeHTML());
  420. /*
  421. for (var i=0;i<5;i++) {
  422. addOnlineUser("Maxim1"+i,"Maxim Sokhatsky",'appendChild');
  423. addOnlineUser("Maxim2"+i,"Sinan Ustel",'appendChild');
  424. addOnlineUser("Maxim3"+i,"Ahmet Tez",'appendChild');
  425. addOnlineUser("Maxim4"+i,"Alice Cooper",'appendChild');
  426. }
  427. */
  428. barHover();
  429. mouseWheelHandler({'detail':-100000,'wheelDelta':-100000});
  430. barHoverOut();