exporting.src.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. /**
  2. * @license Highcharts JS v2.2.5 (2012-06-08)
  3. * Exporting module
  4. *
  5. * (c) 2010-2011 Torstein Hønsi
  6. *
  7. * License: www.highcharts.com/license
  8. */
  9. // JSLint options:
  10. /*global Highcharts, document, window, Math, setTimeout */
  11. (function () { // encapsulate
  12. // create shortcuts
  13. var HC = Highcharts,
  14. Chart = HC.Chart,
  15. addEvent = HC.addEvent,
  16. removeEvent = HC.removeEvent,
  17. createElement = HC.createElement,
  18. discardElement = HC.discardElement,
  19. css = HC.css,
  20. merge = HC.merge,
  21. each = HC.each,
  22. extend = HC.extend,
  23. math = Math,
  24. mathMax = math.max,
  25. doc = document,
  26. win = window,
  27. hasTouch = doc.documentElement.ontouchstart !== undefined,
  28. M = 'M',
  29. L = 'L',
  30. DIV = 'div',
  31. HIDDEN = 'hidden',
  32. NONE = 'none',
  33. PREFIX = 'highcharts-',
  34. ABSOLUTE = 'absolute',
  35. PX = 'px',
  36. UNDEFINED,
  37. defaultOptions = HC.getOptions();
  38. // Add language
  39. extend(defaultOptions.lang, {
  40. downloadPNG: '下载PNG图片',
  41. downloadJPEG: '下载JPEG图片',
  42. downloadPDF: '下载PDF文件',
  43. downloadSVG: '下载SVG矢量图片',
  44. exportButtonTitle: '导出raster或者vector图片',
  45. printButtonTitle: '打印图片'
  46. });
  47. // Buttons and menus are collected in a separate config option set called 'navigation'.
  48. // This can be extended later to add control buttons like zoom and pan right click menus.
  49. defaultOptions.navigation = {
  50. menuStyle: {
  51. border: '1px solid #A0A0A0',
  52. background: '#FFFFFF'
  53. },
  54. menuItemStyle: {
  55. padding: '0 5px',
  56. background: NONE,
  57. color: '#303030',
  58. fontSize: hasTouch ? '14px' : '11px'
  59. },
  60. menuItemHoverStyle: {
  61. background: '#4572A5',
  62. color: '#FFFFFF'
  63. },
  64. buttonOptions: {
  65. align: 'right',
  66. backgroundColor: {
  67. linearGradient: [0, 0, 0, 20],
  68. stops: [
  69. [0.4, '#F7F7F7'],
  70. [0.6, '#E3E3E3']
  71. ]
  72. },
  73. borderColor: '#B0B0B0',
  74. borderRadius: 3,
  75. borderWidth: 1,
  76. //enabled: true,
  77. height: 20,
  78. hoverBorderColor: '#909090',
  79. hoverSymbolFill: '#81A7CF',
  80. hoverSymbolStroke: '#4572A5',
  81. symbolFill: '#E0E0E0',
  82. //symbolSize: 12,
  83. symbolStroke: '#A0A0A0',
  84. //symbolStrokeWidth: 1,
  85. symbolX: 11.5,
  86. symbolY: 10.5,
  87. verticalAlign: 'top',
  88. width: 24,
  89. y: 10
  90. }
  91. };
  92. // Add the export related options
  93. defaultOptions.exporting = {
  94. //enabled: true,
  95. //filename: 'chart',
  96. type: 'image/png',
  97. url: 'http://export.highcharts.com/',
  98. //url : 'http://localhost:9080/jeecg-v3-framework/logController.do?export',
  99. width: 800,
  100. buttons: {
  101. exportButton: {
  102. //enabled: true,
  103. symbol: 'exportIcon',
  104. x: -10,
  105. symbolFill: '#A8BF77',
  106. hoverSymbolFill: '#768F3E',
  107. _id: 'exportButton',
  108. _titleKey: 'exportButtonTitle',
  109. menuItems: [{
  110. textKey: 'downloadPNG',
  111. onclick: function () {
  112. this.exportChart();
  113. }
  114. }, {
  115. textKey: 'downloadJPEG',
  116. onclick: function () {
  117. this.exportChart({
  118. type: 'image/jpeg'
  119. });
  120. }
  121. }, {
  122. textKey: 'downloadPDF',
  123. onclick: function () {
  124. this.exportChart({
  125. type: 'application/pdf'
  126. });
  127. }
  128. }, {
  129. textKey: 'downloadSVG',
  130. onclick: function () {
  131. this.exportChart({
  132. type: 'image/svg+xml'
  133. });
  134. }
  135. }
  136. // Enable this block to add "View SVG" to the dropdown menu
  137. /*
  138. ,{
  139. text: 'View SVG',
  140. onclick: function () {
  141. var svg = this.getSVG()
  142. .replace(/</g, '\n&lt;')
  143. .replace(/>/g, '&gt;');
  144. doc.body.innerHTML = '<pre>' + svg + '</pre>';
  145. }
  146. } // */
  147. ]
  148. },
  149. printButton: {
  150. //enabled: true,
  151. symbol: 'printIcon',
  152. x: -36,
  153. symbolFill: '#B5C9DF',
  154. hoverSymbolFill: '#779ABF',
  155. _id: 'printButton',
  156. _titleKey: 'printButtonTitle',
  157. onclick: function () {
  158. this.print();
  159. }
  160. }
  161. }
  162. };
  163. extend(Chart.prototype, {
  164. /**
  165. * Return an SVG representation of the chart
  166. *
  167. * @param additionalOptions {Object} Additional chart options for the generated SVG representation
  168. */
  169. getSVG: function (additionalOptions) {
  170. var chart = this,
  171. chartCopy,
  172. sandbox,
  173. svg,
  174. seriesOptions,
  175. options = merge(chart.options, additionalOptions); // copy the options and add extra options
  176. // IE compatibility hack for generating SVG content that it doesn't really understand
  177. if (!doc.createElementNS) {
  178. /*jslint unparam: true*//* allow unused parameter ns in function below */
  179. doc.createElementNS = function (ns, tagName) {
  180. return doc.createElement(tagName);
  181. };
  182. /*jslint unparam: false*/
  183. }
  184. // create a sandbox where a new chart will be generated
  185. sandbox = createElement(DIV, null, {
  186. position: ABSOLUTE,
  187. top: '-9999em',
  188. width: chart.chartWidth + PX,
  189. height: chart.chartHeight + PX
  190. }, doc.body);
  191. // override some options
  192. extend(options.chart, {
  193. renderTo: sandbox,
  194. forExport: true
  195. });
  196. options.exporting.enabled = false; // hide buttons in print
  197. options.chart.plotBackgroundImage = null; // the converter doesn't handle images
  198. // prepare for replicating the chart
  199. options.series = [];
  200. each(chart.series, function (serie) {
  201. seriesOptions = merge(serie.options, {
  202. animation: false, // turn off animation
  203. showCheckbox: false,
  204. visible: serie.visible
  205. });
  206. if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
  207. // remove image markers
  208. if (seriesOptions && seriesOptions.marker && /^url\(/.test(seriesOptions.marker.symbol)) {
  209. seriesOptions.marker.symbol = 'circle';
  210. }
  211. options.series.push(seriesOptions);
  212. }
  213. });
  214. // generate the chart copy
  215. chartCopy = new Highcharts.Chart(options);
  216. // reflect axis extremes in the export
  217. each(['xAxis', 'yAxis'], function (axisType) {
  218. each(chart[axisType], function (axis, i) {
  219. var axisCopy = chartCopy[axisType][i],
  220. extremes = axis.getExtremes(),
  221. userMin = extremes.userMin,
  222. userMax = extremes.userMax;
  223. if (userMin !== UNDEFINED || userMax !== UNDEFINED) {
  224. axisCopy.setExtremes(userMin, userMax, true, false);
  225. }
  226. });
  227. });
  228. // get the SVG from the container's innerHTML
  229. svg = chartCopy.container.innerHTML;
  230. // free up memory
  231. options = null;
  232. chartCopy.destroy();
  233. discardElement(sandbox);
  234. // sanitize
  235. svg = svg
  236. .replace(/zIndex="[^"]+"/g, '')
  237. .replace(/isShadow="[^"]+"/g, '')
  238. .replace(/symbolName="[^"]+"/g, '')
  239. .replace(/jQuery[0-9]+="[^"]+"/g, '')
  240. .replace(/isTracker="[^"]+"/g, '')
  241. .replace(/url\([^#]+#/g, 'url(#')
  242. .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
  243. .replace(/ href=/g, ' xlink:href=')
  244. .replace(/\n/, ' ')
  245. .replace(/<\/svg>.*?$/, '</svg>') // any HTML added to the container after the SVG (#894)
  246. /* This fails in IE < 8
  247. .replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
  248. return s2 +'.'+ s3[0];
  249. })*/
  250. // Replace HTML entities, issue #347
  251. .replace(/&nbsp;/g, '\u00A0') // no-break space
  252. .replace(/&shy;/g, '\u00AD') // soft hyphen
  253. // IE specific
  254. .replace(/<IMG /g, '<image ')
  255. .replace(/height=([^" ]+)/g, 'height="$1"')
  256. .replace(/width=([^" ]+)/g, 'width="$1"')
  257. .replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
  258. .replace(/id=([^" >]+)/g, 'id="$1"')
  259. .replace(/class=([^" ]+)/g, 'class="$1"')
  260. .replace(/ transform /g, ' ')
  261. .replace(/:(path|rect)/g, '$1')
  262. .replace(/style="([^"]+)"/g, function (s) {
  263. return s.toLowerCase();
  264. });
  265. // IE9 beta bugs with innerHTML. Test again with final IE9.
  266. svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1')
  267. .replace(/&quot;/g, "'");
  268. if (svg.match(/ xmlns="/g).length === 2) {
  269. svg = svg.replace(/xmlns="[^"]+"/, '');
  270. }
  271. return svg;
  272. },
  273. /**
  274. * Submit the SVG representation of the chart to the server
  275. * @param {Object} options Exporting options. Possible members are url, type and width.
  276. * @param {Object} chartOptions Additional chart options for the SVG representation of the chart
  277. */
  278. exportChart: function (options, chartOptions) {
  279. var form,
  280. chart = this,
  281. svg = chart.getSVG(merge(chart.options.exporting.chartOptions, chartOptions)); // docs
  282. // merge the options
  283. options = merge(chart.options.exporting, options);
  284. // create the form
  285. form = createElement('form', {
  286. method: 'post',
  287. action: options.url,
  288. enctype: 'multipart/form-data'
  289. }, {
  290. display: NONE
  291. }, doc.body);
  292. // add the values
  293. each(['filename', 'type', 'width', 'svg'], function (name) {
  294. createElement('input', {
  295. type: HIDDEN,
  296. name: name,
  297. value: {
  298. filename: options.filename || 'chart',
  299. type: options.type,
  300. width: options.width,
  301. svg: svg
  302. }[name]
  303. }, null, form);
  304. });
  305. // submit
  306. form.submit();
  307. // clean up
  308. discardElement(form);
  309. },
  310. //update-begin--Author:xuelin Date:20170329 for:[#1823]【bug】报表点击打印后,页面乱的问题解决--------------------
  311. /**
  312. * Print the chart
  313. */
  314. print: function () {
  315. var chart = this,
  316. container = chart.container,
  317. origDisplay = [],
  318. origParent = container.parentNode,
  319. body = doc.body,
  320. childNodes = body.childNodes;
  321. if (chart.isPrinting) { // block the button while in printing mode
  322. return;
  323. }
  324. chart.isPrinting = true;
  325. // 在页面不需要打印的元素class属性中添加no-print
  326. var noPrintNodes = doc.getElementsByClassName('no-print');
  327. // hide no print DOM
  328. each(noPrintNodes, function (node, i) {
  329. if (node.nodeType === 1) {
  330. origDisplay[i] = node.style.display;
  331. node.style.display = NONE;
  332. }
  333. });
  334. // print
  335. win.print();
  336. // allow the browser to prepare before reverting
  337. setTimeout(function () {
  338. // back display
  339. each(noPrintNodes, function (node, i) {
  340. if (node.nodeType === 1) {
  341. node.style.display = origDisplay[i];
  342. }
  343. });
  344. chart.isPrinting = false;
  345. }, 1000);
  346. },
  347. //update-end--Author:xuelin Date:20170329 for:[#1823]【bug】报表点击打印后,页面乱的问题解决----------------------
  348. /**
  349. * Display a popup menu for choosing the export type
  350. *
  351. * @param {String} name An identifier for the menu
  352. * @param {Array} items A collection with text and onclicks for the items
  353. * @param {Number} x The x position of the opener button
  354. * @param {Number} y The y position of the opener button
  355. * @param {Number} width The width of the opener button
  356. * @param {Number} height The height of the opener button
  357. */
  358. contextMenu: function (name, items, x, y, width, height) {
  359. var chart = this,
  360. navOptions = chart.options.navigation,
  361. menuItemStyle = navOptions.menuItemStyle,
  362. chartWidth = chart.chartWidth,
  363. chartHeight = chart.chartHeight,
  364. cacheName = 'cache-' + name,
  365. menu = chart[cacheName],
  366. menuPadding = mathMax(width, height), // for mouse leave detection
  367. boxShadow = '3px 3px 10px #888',
  368. innerMenu,
  369. hide,
  370. menuStyle;
  371. // create the menu only the first time
  372. if (!menu) {
  373. // create a HTML element above the SVG
  374. chart[cacheName] = menu = createElement(DIV, {
  375. className: PREFIX + name
  376. }, {
  377. position: ABSOLUTE,
  378. zIndex: 1000,
  379. padding: menuPadding + PX
  380. }, chart.container);
  381. innerMenu = createElement(DIV, null,
  382. extend({
  383. MozBoxShadow: boxShadow,
  384. WebkitBoxShadow: boxShadow,
  385. boxShadow: boxShadow
  386. }, navOptions.menuStyle), menu);
  387. // hide on mouse out
  388. hide = function () {
  389. css(menu, { display: NONE });
  390. };
  391. addEvent(menu, 'mouseleave', hide);
  392. // create the items
  393. each(items, function (item) {
  394. if (item) {
  395. var div = createElement(DIV, {
  396. onmouseover: function () {
  397. css(this, navOptions.menuItemHoverStyle);
  398. },
  399. onmouseout: function () {
  400. css(this, menuItemStyle);
  401. },
  402. innerHTML: item.text || chart.options.lang[item.textKey]
  403. }, extend({
  404. cursor: 'pointer'
  405. }, menuItemStyle), innerMenu);
  406. div[hasTouch ? 'ontouchstart' : 'onclick'] = function () {
  407. hide();
  408. item.onclick.apply(chart, arguments);
  409. };
  410. // Keep references to menu divs to be able to destroy them
  411. chart.exportDivElements.push(div);
  412. }
  413. });
  414. // Keep references to menu and innerMenu div to be able to destroy them
  415. chart.exportDivElements.push(innerMenu, menu);
  416. chart.exportMenuWidth = menu.offsetWidth;
  417. chart.exportMenuHeight = menu.offsetHeight;
  418. }
  419. menuStyle = { display: 'block' };
  420. // if outside right, right align it
  421. if (x + chart.exportMenuWidth > chartWidth) {
  422. menuStyle.right = (chartWidth - x - width - menuPadding) + PX;
  423. } else {
  424. menuStyle.left = (x - menuPadding) + PX;
  425. }
  426. // if outside bottom, bottom align it
  427. if (y + height + chart.exportMenuHeight > chartHeight) {
  428. menuStyle.bottom = (chartHeight - y - menuPadding) + PX;
  429. } else {
  430. menuStyle.top = (y + height - menuPadding) + PX;
  431. }
  432. css(menu, menuStyle);
  433. },
  434. /**
  435. * Add the export button to the chart
  436. */
  437. addButton: function (options) {
  438. var chart = this,
  439. renderer = chart.renderer,
  440. btnOptions = merge(chart.options.navigation.buttonOptions, options),
  441. onclick = btnOptions.onclick,
  442. menuItems = btnOptions.menuItems,
  443. buttonWidth = btnOptions.width,
  444. buttonHeight = btnOptions.height,
  445. box,
  446. symbol,
  447. button,
  448. borderWidth = btnOptions.borderWidth,
  449. boxAttr = {
  450. stroke: btnOptions.borderColor
  451. },
  452. symbolAttr = {
  453. stroke: btnOptions.symbolStroke,
  454. fill: btnOptions.symbolFill
  455. },
  456. symbolSize = btnOptions.symbolSize || 12;
  457. // Keeps references to the button elements
  458. if (!chart.exportDivElements) {
  459. chart.exportDivElements = [];
  460. chart.exportSVGElements = [];
  461. }
  462. if (btnOptions.enabled === false) {
  463. return;
  464. }
  465. // element to capture the click
  466. function revert() {
  467. symbol.attr(symbolAttr);
  468. box.attr(boxAttr);
  469. }
  470. // the box border
  471. box = renderer.rect(
  472. 0,
  473. 0,
  474. buttonWidth,
  475. buttonHeight,
  476. btnOptions.borderRadius,
  477. borderWidth
  478. )
  479. //.translate(buttonLeft, buttonTop) // to allow gradients
  480. .align(btnOptions, true)
  481. .attr(extend({
  482. fill: btnOptions.backgroundColor,
  483. 'stroke-width': borderWidth,
  484. zIndex: 19
  485. }, boxAttr)).add();
  486. // the invisible element to track the clicks
  487. button = renderer.rect(
  488. 0,
  489. 0,
  490. buttonWidth,
  491. buttonHeight,
  492. 0
  493. )
  494. .align(btnOptions)
  495. .attr({
  496. id: btnOptions._id,
  497. fill: 'rgba(255, 255, 255, 0.001)',
  498. title: chart.options.lang[btnOptions._titleKey],
  499. zIndex: 21
  500. }).css({
  501. cursor: 'pointer'
  502. })
  503. .on('mouseover', function () {
  504. symbol.attr({
  505. stroke: btnOptions.hoverSymbolStroke,
  506. fill: btnOptions.hoverSymbolFill
  507. });
  508. box.attr({
  509. stroke: btnOptions.hoverBorderColor
  510. });
  511. })
  512. .on('mouseout', revert)
  513. .on('click', revert)
  514. .add();
  515. // add the click event
  516. if (menuItems) {
  517. onclick = function () {
  518. revert();
  519. var bBox = button.getBBox();
  520. chart.contextMenu('export-menu', menuItems, bBox.x, bBox.y, buttonWidth, buttonHeight);
  521. };
  522. }
  523. /*addEvent(button.element, 'click', function() {
  524. onclick.apply(chart, arguments);
  525. });*/
  526. button.on('click', function () {
  527. onclick.apply(chart, arguments);
  528. });
  529. // the icon
  530. symbol = renderer.symbol(
  531. btnOptions.symbol,
  532. btnOptions.symbolX - (symbolSize / 2),
  533. btnOptions.symbolY - (symbolSize / 2),
  534. symbolSize,
  535. symbolSize
  536. )
  537. .align(btnOptions, true)
  538. .attr(extend(symbolAttr, {
  539. 'stroke-width': btnOptions.symbolStrokeWidth || 1,
  540. zIndex: 20
  541. })).add();
  542. // Keep references to the renderer element so to be able to destroy them later.
  543. chart.exportSVGElements.push(box, button, symbol);
  544. },
  545. /**
  546. * Destroy the buttons.
  547. */
  548. destroyExport: function () {
  549. var i,
  550. chart = this,
  551. elem;
  552. // Destroy the extra buttons added
  553. for (i = 0; i < chart.exportSVGElements.length; i++) {
  554. elem = chart.exportSVGElements[i];
  555. // Destroy and null the svg/vml elements
  556. elem.onclick = elem.ontouchstart = null;
  557. chart.exportSVGElements[i] = elem.destroy();
  558. }
  559. // Destroy the divs for the menu
  560. for (i = 0; i < chart.exportDivElements.length; i++) {
  561. elem = chart.exportDivElements[i];
  562. // Remove the event handler
  563. removeEvent(elem, 'mouseleave');
  564. // Remove inline events
  565. chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
  566. // Destroy the div by moving to garbage bin
  567. discardElement(elem);
  568. }
  569. }
  570. });
  571. /**
  572. * Crisp for 1px stroke width, which is default. In the future, consider a smarter,
  573. * global function.
  574. */
  575. function crisp(arr) {
  576. var i = arr.length;
  577. while (i--) {
  578. if (typeof arr[i] === 'number') {
  579. arr[i] = Math.round(arr[i]) - 0.5;
  580. }
  581. }
  582. return arr;
  583. }
  584. // Create the export icon
  585. HC.Renderer.prototype.symbols.exportIcon = function (x, y, width, height) {
  586. return crisp([
  587. M, // the disk
  588. x, y + width,
  589. L,
  590. x + width, y + height,
  591. x + width, y + height * 0.8,
  592. x, y + height * 0.8,
  593. 'Z',
  594. M, // the arrow
  595. x + width * 0.5, y + height * 0.8,
  596. L,
  597. x + width * 0.8, y + height * 0.4,
  598. x + width * 0.4, y + height * 0.4,
  599. x + width * 0.4, y,
  600. x + width * 0.6, y,
  601. x + width * 0.6, y + height * 0.4,
  602. x + width * 0.2, y + height * 0.4,
  603. 'Z'
  604. ]);
  605. };
  606. // Create the print icon
  607. HC.Renderer.prototype.symbols.printIcon = function (x, y, width, height) {
  608. return crisp([
  609. M, // the printer
  610. x, y + height * 0.7,
  611. L,
  612. x + width, y + height * 0.7,
  613. x + width, y + height * 0.4,
  614. x, y + height * 0.4,
  615. 'Z',
  616. M, // the upper sheet
  617. x + width * 0.2, y + height * 0.4,
  618. L,
  619. x + width * 0.2, y,
  620. x + width * 0.8, y,
  621. x + width * 0.8, y + height * 0.4,
  622. 'Z',
  623. M, // the lower sheet
  624. x + width * 0.2, y + height * 0.7,
  625. L,
  626. x, y + height,
  627. x + width, y + height,
  628. x + width * 0.8, y + height * 0.7,
  629. 'Z'
  630. ]);
  631. };
  632. // Add the buttons on chart load
  633. Chart.prototype.callbacks.push(function (chart) {
  634. var n,
  635. exportingOptions = chart.options.exporting,
  636. buttons = exportingOptions.buttons;
  637. if (exportingOptions.enabled !== false) {
  638. for (n in buttons) {
  639. chart.addButton(buttons[n]);
  640. }
  641. // Destroy the export elements at chart destroy
  642. addEvent(chart, 'destroy', chart.destroyExport);
  643. }
  644. });
  645. }());