!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function($){"use strict";$.extend($.jgrid,{stringify:function(e){return JSON.stringify(e,function(e,t){return"function"==typeof t?t.toString():t})},parseFunc:function(str){return JSON.parse(str,function(key,value){if("string"!=typeof value||-1===value.indexOf("function"))return value;var sv=value.split(" ");return sv[0]=$.jgrid.trim(sv[0].toLowerCase()),0===sv[0].indexOf("function")&&"}"===value.trim().slice(-1)?eval("("+value+")"):value})},encode:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},jsonToXML:function(e,t){function c(e,t){return"#text"===e?s.encode?d.encode(t):t:"function"==typeof t?"<"+e+">"+e+">\n":""===t?"<"+e+">__EMPTY_STRING_"+e+">\n":"<"+e+">"+(s.encode?d.encode(t):t)+""+e+">\n"}var s=$.extend({xmlDecl:'\n',attr_prefix:"-",encode:!0},t||{}),d=this,u=function(e,t){for(var n=[],o=0;o":"object"==typeof r&&r.constructor==Array?n[n.length]=u(e,r):n[n.length]=("object"==typeof r?f:c)(e,r)}return n.length||(n[0]="<"+e+">__EMPTY_ARRAY_"+e+">\n"),n.join("")},f=function(e,t){var n,o,r=[],a=[];for(n in t)t.hasOwnProperty(n)&&(o=t[n],n.charAt(0)!==s.attr_prefix?null==o?r[r.length]="<"+n+" />":"object"==typeof o&&o.constructor===Array?r[r.length]=u(n,o):r[r.length]=("object"==typeof o?f:c)(n,o):a[a.length]=" "+n.substring(1)+'="'+(s.encode?d.encode(o):o)+'"');var i=a.join(""),l=r.join("");return null==e||(l=0\n"+l+""+e+">\n":"<"+e+i+">"+l+""+e+">\n":"<"+e+i+" />\n"),l},e=f(null,e);return s.xmlDecl+e},xmlToJSON:function(root,options){var o=$.extend({force_array:[],attr_prefix:"-"},options||{});if(root){var __force_array={};if(o.force_array)for(var i=0;i