Diep.IO 3D

Turns diep.io into real 3D

目前为 2021-09-23 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Diep.IO 3D
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.3
  5. // @description Turns diep.io into real 3D
  6. // @author Zertalious (Zert)
  7. // @match *://diep.io/*
  8. // @icon https://www.google.com/s2/favicons?domain=diep.io
  9. // @grant none
  10. // @require https://unpkg.com/three@latest/build/three.min.js
  11. // @require https://unpkg.com/three@latest/examples/js/controls/OrbitControls.js
  12. // ==/UserScript==
  13.  
  14. const OUTLINE_LAYER = 0;
  15. const MAIN_LAYER = 1;
  16.  
  17. let renderer, scene, camera, canvas;
  18. let ortho;
  19.  
  20. let currentCamera;
  21.  
  22. init();
  23.  
  24. const tempObject = new THREE.Object3D();
  25. const tempColor = new THREE.Color();
  26.  
  27. const material = new THREE.MeshToonMaterial( { transparent: true } );
  28. const outlineMaterial = new THREE.MeshBasicMaterial( { transparent: true } );
  29.  
  30. material.onBeforeCompile = outlineMaterial.onBeforeCompile = function ( shader ) {
  31.  
  32. shader.vertexShader = shader.vertexShader.replace( 'void', `
  33.  
  34. attribute vec2 scale;
  35. attribute float alpha;
  36.  
  37. varying float vAlpha;
  38.  
  39. void` ).replace( '<begin_vertex>', `<begin_vertex>
  40.  
  41. if ( scale.x != 0.0 && scale.y != 0.0 ) {
  42.  
  43. if ( transformed.x == 1.0 || transformed.x == 0.5 ) {
  44.  
  45. transformed.yz *= scale.x;
  46.  
  47. } else if ( transformed.x == - 1.0 || transformed.x == - 0.5 ) {
  48.  
  49. transformed.yz *= scale.y;
  50.  
  51. }
  52.  
  53. }
  54.  
  55. vAlpha = alpha;
  56.  
  57. ` );
  58.  
  59. shader.fragmentShader = shader.fragmentShader.replace( 'void', `
  60.  
  61. varying float vAlpha;
  62.  
  63. void` ).replace( '}', `
  64.  
  65. gl_FragColor.a *= vAlpha;
  66.  
  67. }` );
  68.  
  69. }
  70.  
  71. const instances = {};
  72.  
  73. const array = [ {
  74. name: 'sphere',
  75. geometry: new THREE.SphereGeometry( 1, 16 ),
  76. count: 150
  77. }, {
  78. name: 'cylinder',
  79. geometry: new THREE.CylinderGeometry( 0.5, 0.5, 1, 16 ).rotateZ( Math.PI / 2 ),
  80. count: 75,
  81. hasScaling: true
  82. }, {
  83. name: 'poly3',
  84. geometry: new THREE.CylinderGeometry( 1, 1, 1, 3, 1, false, - Math.PI / 6 ).rotateX( Math.PI / 2 ),
  85. count: 75
  86. }, {
  87. name: 'poly4',
  88. geometry: new THREE.BoxGeometry( 1, 1, 1 ),
  89. count: 75
  90. }, {
  91. name: 'poly5',
  92. geometry: new THREE.CylinderGeometry( 1, 1, 1, 5, 1, false, Math.PI / 10 ).rotateX( Math.PI / 2 ),
  93. count: 40
  94. }, {
  95. name: 'poly6',
  96. geometry: new THREE.CylinderGeometry( 1, 1, 1, 6, 1, false, - Math.PI / 12 ).rotateX( Math.PI / 2 ),
  97. count: 10
  98. } ];
  99.  
  100. for ( let i = 0; i < array.length; i ++ ) {
  101.  
  102. const { name, geometry, count, hasScaling } = array[ i ];
  103.  
  104. if ( hasScaling ) {
  105.  
  106. geometry.setAttribute( 'scale', new THREE.InstancedBufferAttribute( new Float32Array( count * 2 ), 2 ) );
  107.  
  108. }
  109.  
  110. geometry.setAttribute( 'alpha', new THREE.InstancedBufferAttribute( new Float32Array( count ), 1 ) );
  111.  
  112. const main = new THREE.InstancedMesh( geometry, material, count );
  113. main.layers.set( MAIN_LAYER );
  114. scene.add( main );
  115.  
  116. const outline = new THREE.InstancedMesh( geometry, outlineMaterial, count );
  117. outline.layers.set( OUTLINE_LAYER );
  118. scene.add( outline );
  119.  
  120. main.setColorAt( 0, tempColor );
  121. outline.setColorAt( 0, tempColor );
  122.  
  123. instances[ name ] = {
  124. main,
  125. outline,
  126. count,
  127. hasScaling,
  128. index: 0
  129. };
  130.  
  131. }
  132.  
  133. const stack = [];
  134.  
  135. function getStack( index ) {
  136.  
  137. const result = stack[ stack.length - 1 - index ];
  138.  
  139. if ( result ) {
  140.  
  141. return result;
  142.  
  143. }
  144.  
  145. return { name: 'none' };
  146.  
  147. }
  148.  
  149. function setObject( name, x, y, z, sx, sy, sz, angle, color, alpha = 1, scaleX = 1, scaleY = 1 ) {
  150.  
  151. tempObject.position.set( x, y, z );
  152. tempObject.scale.set( sx, sy, sz );
  153. tempObject.rotation.set( 0, 0, angle );
  154.  
  155. tempObject.updateMatrix();
  156.  
  157. tempColor.set( color );
  158.  
  159. const instance = instances[ name ];
  160.  
  161. instance.main.setMatrixAt( instance.index, tempObject.matrix );
  162. instance.main.setColorAt( instance.index, tempColor );
  163.  
  164. instance.main.geometry.attributes.alpha.setX( instance.index, alpha );
  165. instance.outline.geometry.attributes.alpha.setX( instance.index, alpha );
  166.  
  167. const outlineSize = 4 / window.innerHeight * ( name === 'sphere' ? 0.7 : 1 );
  168.  
  169. if ( instance.hasScaling ) {
  170.  
  171. tempObject.scale.x += outlineSize;
  172. tempObject.scale.y += outlineSize / scaleY;
  173. tempObject.scale.z += outlineSize / scaleY;
  174.  
  175. } else {
  176.  
  177. tempObject.scale.addScalar( outlineSize );
  178.  
  179. }
  180.  
  181. tempObject.updateMatrix();
  182.  
  183. tempColor.multiplyScalar( 0.6 );
  184.  
  185. instance.outline.setMatrixAt( instance.index, tempObject.matrix );
  186. instance.outline.setColorAt( instance.index, tempColor );
  187.  
  188. if ( instance.hasScaling ) {
  189.  
  190. instance.main.geometry.attributes.scale.setXY( instance.index, scaleX, scaleY );
  191. instance.outline.geometry.attributes.scale.setXY( instance.index, scaleX, scaleY );
  192.  
  193. }
  194.  
  195. instance.index ++;
  196.  
  197. stack.push( { name, x, y, z, sx, sy, sz, angle, color, outlineSize, alpha } );
  198.  
  199. }
  200.  
  201. function init() {
  202.  
  203. canvas = document.getElementById( 'canvas' );
  204.  
  205. renderer = new THREE.WebGLRenderer( {
  206. antialias: true,
  207. alpha: true
  208. } );
  209.  
  210. renderer.autoClear = false;
  211.  
  212. renderer.setPixelRatio( window.devicePixelRatio );
  213. renderer.setSize( canvas.width, canvas.height, false );
  214.  
  215. renderer.domElement.style.position = 'absolute';
  216. renderer.domElement.style.left = '0';
  217. renderer.domElement.style.top = '0';
  218. renderer.domElement.style.width = '100%';
  219. renderer.domElement.style.height = '100%';
  220. renderer.domElement.style.pointerEvents = 'none';
  221.  
  222. canvas.parentNode.insertBefore( renderer.domElement, canvas.nextSibling );
  223.  
  224. scene = new THREE.Scene();
  225.  
  226. camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 0.1, 1000 );
  227.  
  228. ortho = new THREE.OrthographicCamera( - camera.aspect / 2, camera.aspect / 2, 0.5, - 0.5, 0, 1000 );
  229.  
  230. currentCamera = camera;
  231.  
  232. const oldZ = Math.sin( Math.PI / 3 );
  233. camera.position.z = ortho.position.z = oldZ;
  234.  
  235. const ambLight = new THREE.AmbientLight( 0xffffff, 0.5 );
  236. ambLight.layers.set( MAIN_LAYER );
  237. scene.add( ambLight );
  238.  
  239. const dirLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
  240. dirLight.layers.set( MAIN_LAYER );
  241. dirLight.position.z = 1;
  242. scene.add( dirLight );
  243.  
  244. const controls = new THREE.OrbitControls( camera, canvas );
  245.  
  246. controls.enabled = false;
  247.  
  248. window.addEventListener( 'keyup', function ( event ) {
  249.  
  250. const key = String.fromCharCode( event.keyCode );
  251.  
  252. if ( key === 'V' ) {
  253.  
  254. controls.enabled = ! controls.enabled;
  255.  
  256. if ( ! controls.enabled ) {
  257.  
  258. camera.position.set( 0, 0, oldZ );
  259. camera.rotation.set( 0, 0, 0 );
  260.  
  261. controls.target.set( 0, 0, 0 );
  262.  
  263. ortho.position.set( 0, 0, oldZ );
  264. ortho.rotation.set( 0, 0, 0 );
  265.  
  266. ortho.zoom = 1;
  267.  
  268. }
  269.  
  270. } else if ( key === 'P' ) {
  271.  
  272. currentCamera = currentCamera === camera ? ortho : camera;
  273.  
  274. currentCamera.position.copy( controls.object.position );
  275. currentCamera.rotation.copy( controls.object.rotation );
  276.  
  277. controls.object = currentCamera;
  278.  
  279. }
  280.  
  281. } );
  282.  
  283. window.addEventListener( 'resize', onWindowResize );
  284.  
  285. }
  286.  
  287. function onWindowResize() {
  288.  
  289. renderer.setSize( canvas.width, canvas.height, false );
  290. camera.aspect = canvas.width / canvas.height;
  291. camera.updateProjectionMatrix();
  292.  
  293. ortho.left = - camera.aspect / 2;
  294. ortho.right = camera.aspect / 2;
  295. ortho.updateProjectionMatrix();
  296.  
  297. }
  298.  
  299. window.requestAnimationFrame = new Proxy( window.requestAnimationFrame, {
  300. apply( target, thisArgs, args ) {
  301.  
  302. args[ 0 ] = new Proxy( args[ 0 ], {
  303. apply( target, thisArgs, args ) {
  304.  
  305. stack.length = 0;
  306.  
  307. tempObject.position.setScalar( 0 );
  308. tempObject.scale.setScalar( 0 );
  309. tempObject.rotation.set( 0, 0, 0 );
  310.  
  311. tempObject.updateMatrix();
  312.  
  313. tempColor.setRGB( 0, 0, 0 );
  314.  
  315. for ( let key in instances ) {
  316.  
  317. const { main, outline, count, hasScaling } = instances[ key ];
  318.  
  319. for ( let i = 0; i < count; i ++ ) {
  320.  
  321. main.setMatrixAt( i, tempObject.matrix );
  322. outline.setMatrixAt( i, tempObject.matrix );
  323.  
  324. }
  325.  
  326. main.instanceMatrix.needsUpdate = true;
  327. main.instanceColor.needsUpdate = true;
  328.  
  329. outline.instanceMatrix.needsUpdate = true;
  330. outline.instanceColor.needsUpdate = true;
  331.  
  332. if ( hasScaling ) {
  333.  
  334. main.geometry.attributes.scale.needsUpdate = true;
  335. outline.geometry.attributes.scale.needsUpdate = true;
  336.  
  337. }
  338.  
  339. main.geometry.attributes.alpha.needsUpdate = true;
  340. outline.geometry.attributes.alpha.needsUpdate = true;
  341.  
  342. instances[ key ].index = 0;
  343.  
  344. }
  345.  
  346. arcCounter = 0;
  347.  
  348. Reflect.apply( ...arguments );
  349.  
  350. renderer.clear();
  351.  
  352. currentCamera.layers.set( OUTLINE_LAYER );
  353.  
  354. renderer.render( scene, currentCamera );
  355.  
  356. renderer.clearDepth();
  357.  
  358. currentCamera.layers.set( MAIN_LAYER );
  359.  
  360. renderer.render( scene, currentCamera );
  361.  
  362. }
  363. } );
  364.  
  365. return Reflect.apply( ...arguments );
  366.  
  367. }
  368. } );
  369.  
  370. const Context2D = CanvasRenderingContext2D.prototype;
  371.  
  372. let arcCounter = 0;
  373.  
  374. Context2D.arc = new Proxy( Context2D.arc, {
  375. apply( target, thisArgs, args ) {
  376.  
  377. if ( args[ 4 ] === Math.PI * 2 ) {
  378.  
  379. if ( arcCounter === 0 ) {
  380.  
  381. const matrix = thisArgs.getTransform();
  382.  
  383. const r = matrix.a / canvas.height;
  384.  
  385. const x = ( matrix.e / canvas.width - 0.5 ) * camera.aspect;
  386. const y = 0.5 - matrix.f / canvas.height;
  387.  
  388. let z = 0;
  389.  
  390. const s0 = getStack( 0 );
  391. const s1 = getStack( 1 );
  392.  
  393. if ( s0.name === 'cylinder' && s1.name === 'sphere' && Math.hypot( x - s1.x, y - s1.y ) < 0.001 ) {
  394.  
  395. z = s1.sz;
  396.  
  397. const index = ( instances.cylinder.index - 1 ) * 16 + 14;
  398.  
  399. const newDepth = z + r - s0.sz / 2;
  400.  
  401. instances.cylinder.main.instanceMatrix.array[ index ] = newDepth;
  402. instances.cylinder.outline.instanceMatrix.array[ index ] = newDepth;
  403.  
  404. } else myBlock: {
  405.  
  406. for ( let i = 0; i < 5; i ++ ) {
  407.  
  408. if ( getStack( i ).name !== 'cylinder' ) {
  409.  
  410. break myBlock;
  411.  
  412. }
  413.  
  414. }
  415.  
  416. if ( getStack( 0 ).angle !== getStack( 2 ).angle ) {
  417.  
  418. break myBlock;
  419.  
  420. }
  421.  
  422. const a = r - getStack( 0 ).sy;
  423.  
  424. for ( let i = 0; i < 5; i ++ ) {
  425.  
  426. const index = ( instances.cylinder.index - 1 - i ) * 16 + 14;
  427.  
  428. const newDepth = a - a * 2 * i / 4;
  429.  
  430. instances.cylinder.main.instanceMatrix.array[ index ] = newDepth;
  431. instances.cylinder.outline.instanceMatrix.array[ index ] = newDepth;
  432.  
  433. }
  434.  
  435. }
  436.  
  437. checkIfIsMainCanvas( thisArgs, 'sphere' );
  438.  
  439. setObject(
  440. 'sphere',
  441. x,
  442. y,
  443. z,
  444. r,
  445. r,
  446. r,
  447. 0,
  448. thisArgs.fillStyle,
  449. thisArgs.globalAlpha
  450. );
  451.  
  452. } else if ( arcCounter === 1 ) {
  453.  
  454. tempColor.set( thisArgs.fillStyle );
  455. instances.sphere.main.setColorAt( instances.sphere.index - 1, tempColor );
  456.  
  457. tempColor.multiplyScalar( 0.6 );
  458. instances.sphere.outline.setColorAt( instances.sphere.index - 1, tempColor );
  459.  
  460. }
  461.  
  462. arcCounter = ( arcCounter + 1 ) % 3;
  463.  
  464. }
  465.  
  466. return Reflect.apply( ...arguments );
  467.  
  468. }
  469. } );
  470.  
  471. Context2D.rect = new Proxy( Context2D.rect, {
  472. apply( target, thisArgs, args ) {
  473.  
  474. const matrix = thisArgs.getTransform();
  475.  
  476. const isTurret = matrix.b !== 0 && matrix.c !== 0;
  477.  
  478. if ( isTurret || ( thisArgs.canvas === canvas && Math.hypot( matrix.c, matrix.d ) > 100 && thisArgs.globalAlpha === 1 ) ) {
  479.  
  480. const center = new DOMPoint( 0.5, 0.5 ).matrixTransform( matrix );
  481.  
  482. const scaleYZ = Math.hypot( matrix.c, matrix.d ) / canvas.height;
  483.  
  484. const name = isTurret ? 'cylinder' : 'poly4';
  485.  
  486. checkIfIsMainCanvas( thisArgs, name );
  487.  
  488. setObject(
  489. name,
  490. ( center.x / canvas.width - 0.5 ) * camera.aspect,
  491. 0.5 - center.y / canvas.height,
  492. isTurret ? 0 : 0.05,
  493. Math.hypot( matrix.a, matrix.b ) / canvas.height,
  494. scaleYZ,
  495. isTurret ? scaleYZ : 0.1,
  496. Math.atan2( matrix.c, matrix.d ),
  497. thisArgs.fillStyle,
  498. thisArgs.globalAlpha
  499. );
  500.  
  501. }
  502.  
  503. return Reflect.apply( ...arguments );
  504.  
  505. }
  506. } );
  507.  
  508. const points = [];
  509. let hasCurve = true;
  510.  
  511. Context2D.beginPath = new Proxy( Context2D.beginPath, {
  512. apply( target, thisArgs, args ) {
  513.  
  514. points.length = 0;
  515. hasCurve = false;
  516.  
  517. return Reflect.apply( ...arguments );
  518.  
  519. }
  520. } );
  521.  
  522. const addPoint = {
  523. apply( target, thisArgs, [ x, y ] ) {
  524.  
  525. points.push( new DOMPoint( x, y ).matrixTransform( thisArgs.getTransform() ) );
  526.  
  527. return Reflect.apply( ...arguments );
  528.  
  529. }
  530. };
  531.  
  532. Context2D.moveTo = new Proxy( Context2D.moveTo, addPoint );
  533. Context2D.lineTo = new Proxy( Context2D.lineTo, addPoint );
  534.  
  535. Context2D.arc = new Proxy( Context2D.arc, {
  536. apply( target, thisArgs, args ) {
  537.  
  538. hasCurve = true;
  539.  
  540. return Reflect.apply( ...arguments );
  541.  
  542. }
  543. } );
  544.  
  545. Context2D.fill = new Proxy( Context2D.fill, {
  546. apply( target, thisArgs, args ) {
  547.  
  548. if ( ! hasCurve ) {
  549.  
  550. if ( points.length > 2 && points.length < 7 ) {
  551.  
  552. const center = { x: 0, y: 0 };
  553.  
  554. const count = points.length;
  555.  
  556. for ( let i = 0; i < count; i ++ ) {
  557.  
  558. center.x += points[ i ].x;
  559. center.y += points[ i ].y;
  560.  
  561. }
  562.  
  563. center.x /= count;
  564. center.y /= count;
  565.  
  566. let s, sx, angle, scaleX, scaleY;
  567.  
  568. let name = 'poly' + points.length;
  569.  
  570. if ( points.length === 4 ) {
  571.  
  572. const [ p0, p1, p2 ] = points;
  573. const pl = points[ points.length - 1 ];
  574.  
  575. scaleX = Math.hypot( p1.x - p2.x, p1.y - p2.y ) / canvas.height;
  576. scaleY = Math.hypot( p0.x - pl.x, p0.y - pl.y ) / canvas.height;
  577.  
  578. const dx = ( p1.x + p2.x ) / 2 - ( p0.x + pl.x ) / 2;
  579. const dy = ( p1.y + p2.y ) / 2 - ( p0.y + pl.y ) / 2;
  580.  
  581. sx = Math.hypot( dx, dy ) / canvas.height;
  582. angle = Math.atan2( dx, dy ) - Math.PI / 2;
  583.  
  584. if ( Math.abs( scaleX - scaleY ) > 0.001 ) {
  585.  
  586. s = 1;
  587. name = 'cylinder';
  588.  
  589. } else {
  590.  
  591. s = sx = scaleY;
  592.  
  593. }
  594.  
  595. } else {
  596.  
  597. s = sx = Math.hypot( points[ 0 ].x - center.x, points[ 0 ].y - center.y ) / canvas.height;
  598.  
  599. angle = - Math.atan2( points[ 0 ].y - center.y, points[ 0 ].x - center.x );
  600.  
  601. }
  602.  
  603. checkIfIsMainCanvas( thisArgs, name );
  604.  
  605. setObject(
  606. name,
  607. ( center.x / canvas.width - 0.5 ) * camera.aspect,
  608. 0.5 - center.y / canvas.height,
  609. 0,
  610. sx,
  611. s,
  612. s,
  613. angle,
  614. thisArgs.fillStyle,
  615. thisArgs.globalAlpha,
  616. scaleX,
  617. scaleY
  618. );
  619.  
  620. }
  621.  
  622. }
  623.  
  624. return Reflect.apply( ...arguments );
  625.  
  626. }
  627. } );
  628.  
  629. Context2D.drawImage = new Proxy( Context2D.drawImage, {
  630. apply( target, thisArgs, args ) {
  631.  
  632. if ( thisArgs.canvas === canvas && args[ 0 ].objects ) {
  633.  
  634. const matrix = thisArgs.getTransform();
  635.  
  636. const x = matrix.e / canvas.width;
  637. const y = matrix.f / canvas.height;
  638.  
  639. const sx = Math.hypot( matrix.a, matrix.b );
  640. const sy = Math.hypot( matrix.c, matrix.d );
  641.  
  642. for ( let i = 0; i < args[ 0 ].objects.length; i ++ ) {
  643.  
  644. const { name, index } = args[ 0 ].objects[ i ];
  645.  
  646. const instance = instances[ name ];
  647.  
  648. const ma = instance.main.instanceMatrix.array;
  649. const oa = instance.outline.instanceMatrix.array;
  650.  
  651. const idx = index * 16;
  652.  
  653. const ox = ma[ idx + 12 ] / camera.aspect + 0.5;
  654. const oy = - ma[ idx + 13 ] + 0.5;
  655.  
  656. const outlineOldSx = Math.hypot( oa[ idx + 0 ], oa[ idx + 1 ] );
  657. const outlineOldSy = Math.hypot( oa[ idx + 4 ], oa[ idx + 5 ] );
  658.  
  659. const outlineSizeX = outlineOldSx - Math.hypot( ma[ idx + 0 ], ma[ idx + 1 ] );
  660. const outlineSizeY = outlineOldSy - Math.hypot( ma[ idx + 4 ], ma[ idx + 5 ] );
  661.  
  662. ma[ idx + 0 ] *= sx;
  663. ma[ idx + 1 ] *= sx;
  664. ma[ idx + 4 ] *= sy;
  665. ma[ idx + 5 ] *= sy;
  666. ma[ idx + 10 ] *= sy;
  667.  
  668. const nsx = Math.hypot( ma[ idx + 0 ], ma[ idx + 1 ] ) + outlineSizeX;
  669. const nsy = Math.hypot( ma[ idx + 4 ], ma[ idx + 5 ] ) + outlineSizeY;
  670.  
  671. oa[ idx + 0 ] *= nsx / outlineOldSx;
  672. oa[ idx + 1 ] *= nsx / outlineOldSx;
  673. oa[ idx + 4 ] *= nsy / outlineOldSy;
  674. oa[ idx + 5 ] *= nsy / outlineOldSy;
  675. oa[ idx + 10 ] *= sy;
  676.  
  677. ma[ idx + 12 ] = oa[ idx + 12 ] = ( ( ox * sx + x ) - 0.5 ) * camera.aspect;
  678. ma[ idx + 13 ] = oa[ idx + 13 ] = 0.5 - ( oy * sy + y );
  679.  
  680. instance.main.geometry.attributes.alpha.array[ index ] = thisArgs.globalAlpha;
  681. instance.outline.geometry.attributes.alpha.array[ index ] = thisArgs.globalAlpha;
  682.  
  683. }
  684.  
  685. delete args[ 0 ][ 'objects' ];
  686.  
  687. }
  688.  
  689. return Reflect.apply( ...arguments );
  690.  
  691. }
  692. } );
  693.  
  694. function checkIfIsMainCanvas( ctx, name ) {
  695.  
  696. if ( ctx.canvas !== canvas ) {
  697.  
  698. const { index } = instances[ name ];
  699.  
  700. if ( ctx.canvas.objects ) {
  701.  
  702. ctx.canvas.objects.push( { name, index } );
  703.  
  704. } else {
  705.  
  706. ctx.canvas.objects = [ { name, index } ];
  707.  
  708. }
  709.  
  710. }
  711.  
  712. }