{"version":3,"sources":["../../src/app/components/utils/objectutils.ts","../../src/app/components/utils/uniquecomponentid.ts"],"names":["ObjectUtils","equals","obj1","obj2","field","this","resolveFieldData","equalsByValue","i","length","key","arrA","Array","isArray","arrB","dateA","Date","dateB","getTime","regexpA","RegExp","regexpB","toString","keys","Object","prototype","hasOwnProperty","call","data","isFunction","indexOf","fields","split","value","len","obj","constructor","apply","reorderArray","from","to","splice","insertIntoOrderedArray","item","index","arr","sourceArr","injected","findIndexInList","push","list","removeAccents","str","search","replace","lastId"],"mappings":"gTAAA,SAAAA,YAEkBA,EAAAC,OAAP,SAAcC,EAAWC,EAAWC,GACvC,OAAIA,EACQC,KAAKC,iBAAiBJ,EAAME,KAAWC,KAAKC,iBAAiBH,EAAMC,GAEpEC,KAAKE,cAAcL,EAAMC,IAG1BH,EAAAO,cAAP,SAAqBL,EAAWC,GACnC,GAAID,IAASC,EAAM,OAAO,EAE1B,GAAID,GAAQC,GAAuB,iBAARD,GAAmC,iBAARC,EAAkB,CACpE,IAEMK,EACAC,EACAC,EAJFC,EAAOC,MAAMC,QAAQX,GACnBY,EAAOF,MAAMC,QAAQV,GAK3B,GAAIQ,GAAQG,EAAM,CAEd,IADAL,EAASP,EAAKO,SACAN,EAAKM,OAAQ,OAAO,EAClC,IAAKD,EAAIC,EAAgB,GAARD,KACb,IAAKH,KAAKE,cAAcL,EAAKM,GAAIL,EAAKK,IAAK,OAAO,EACtD,OAAO,EAGX,GAAIG,GAAQG,EAAM,OAAO,EAEzB,IAAIC,EAAQb,aAAgBc,KACtBC,EAAQd,aAAgBa,KAC9B,GAAID,GAASE,EAAO,OAAO,EAC3B,GAAIF,GAASE,EAAO,OAAOf,EAAKgB,WAAaf,EAAKe,UAElD,IAAIC,EAAUjB,aAAgBkB,OACxBC,EAAUlB,aAAgBiB,OAChC,GAAID,GAAWE,EAAS,OAAO,EAC/B,GAAIF,GAAWE,EAAS,OAAOnB,EAAKoB,YAAcnB,EAAKmB,WAEvD,IAAIC,EAAO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gBAAgBH,EAAIrC,GAAIsC,GAC7BF,EAAO,CAC1BC,EAAIJ,OAAOjC,EAAG,EAAGmC,GACjBI,GAAW,EACX,OAIHA,GACDF,EAAII,KAAKN,QAIbE,EAAII,KAAKN,IAIH3C,EAAAgD,gBAAP,SAAuBL,EAAWO,GACrC,IAAIN,GAAiB,EAErB,GAAIM,EACA,IAAI,IAAI1C,EAAI,EAAGA,EAAI0C,EAAKzC,OAAQD,IAC5B,GAAI0C,EAAK1C,IAAMmC,EAAM,CACjBC,EAAQpC,EACR,MAKZ,OAAOoC,GAGG5C,EAAAmD,cAAP,SAAqBC,GA0BxB,OAzBIA,GAAOA,EAAIC,OAAO,iBAAmB,IACrCD,EAAMA,EACGE,QAAQ,eAAgB,KACxBA,QAAQ,UAAW,MACnBA,QAAQ,UAAW,KACnBA,QAAQ,eAAgB,KACxBA,QAAQ,eAAgB,KACxBA,QAAQ,UAAW,KACnBA,QAAQ,UAAW,KACnBA,QAAQ,mBAAoB,KAC5BA,QAAQ,eAAgB,KACxBA,QAAQ,UAAW,KACnBA,QAAQ,UAAW,KACnBA,QAAQ,eAAgB,KACxBA,QAAQ,UAAW,MACnBA,QAAQ,UAAW,KACnBA,QAAQ,eAAgB,KACxBA,QAAQ,eAAgB,KACxBA,QAAQ,UAAW,KACnBA,QAAQ,mBAAoB,KAC5BA,QAAQ,eAAgB,KACxBA,QAAQ,UAAW,KACnBA,QAAQ,cAAe,MAG7BF,QChKJG,EAAAA,OAAS,iDAKhB,OADAA,EAAAA,SADa,SAEMA,EAAAA","sourcesContent":["export class ObjectUtils {\n\n public static equals(obj1: any, obj2: any, field?: string): boolean {\n if (field)\n return (this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field));\n else\n return this.equalsByValue(obj1, obj2);\n }\n\n public static equalsByValue(obj1: any, obj2: any): boolean {\n if (obj1 === obj2) return true;\n\n if (obj1 && obj2 && typeof obj1 == 'object' && typeof obj2 == 'object') {\n var arrA = Array.isArray(obj1)\n , arrB = Array.isArray(obj2)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = obj1.length;\n if (length != obj2.length) return false;\n for (i = length; i-- !== 0;)\n if (!this.equalsByValue(obj1[i], obj2[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = obj1 instanceof Date\n , dateB = obj2 instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return obj1.getTime() == obj2.getTime();\n\n var regexpA = obj1 instanceof RegExp\n , regexpB = obj2 instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return obj1.toString() == obj2.toString();\n\n var keys = Object.keys(obj1);\n length = keys.length;\n\n if (length !== Object.keys(obj2).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(obj2, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!this.equalsByValue(obj1[key], obj2[key])) return false;\n }\n\n return true;\n }\n\n return obj1 !== obj1 && obj2 !== obj2;\n }\n\n public static resolveFieldData(data: any, field: any): any {\n if (data && field) {\n if (this.isFunction(field)) {\n return field(data);\n }\n else if (field.indexOf('.') == -1) {\n return data[field];\n }\n else {\n let fields: string[] = field.split('.');\n let value = data;\n for(let i = 0, len = fields.length; i < len; ++i) {\n if (value == null) {\n return null;\n }\n value = value[fields[i]];\n }\n return value;\n }\n }\n else {\n return null;\n }\n }\n\n public static isFunction(obj: any) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n }\n\n public static reorderArray(value: any[], from: number, to: number) {\n let target: number;\n if (value && from !== to) {\n if (to >= value.length) {\n to %= value.length;\n from %= value.length;\n }\n value.splice(to, 0, value.splice(from, 1)[0]);\n }\n }\n\n public static insertIntoOrderedArray(item: any, index: number, arr: any[], sourceArr: any[]): void {\n if (arr.length > 0) {\n let injected = false;\n for(let i = 0; i < arr.length; i++) {\n let currentItemIndex = this.findIndexInList(arr[i], sourceArr);\n if (currentItemIndex > index) {\n arr.splice(i, 0, item);\n injected = true;\n break;\n }\n }\n\n if (!injected) {\n arr.push(item);\n }\n }\n else {\n arr.push(item);\n }\n }\n\n public static findIndexInList(item: any, list: any): number {\n let index: number = -1;\n\n if (list) {\n for(let i = 0; i < list.length; i++) {\n if (list[i] == item) {\n index = i;\n break;\n }\n }\n }\n\n return index;\n }\n\n public static removeAccents(str) {\n if (str && str.search(/[\\xC0-\\xFF]/g) > -1) {\n str = str\n .replace(/[\\xC0-\\xC5]/g, \"A\")\n .replace(/[\\xC6]/g, \"AE\")\n .replace(/[\\xC7]/g, \"C\")\n .replace(/[\\xC8-\\xCB]/g, \"E\")\n .replace(/[\\xCC-\\xCF]/g, \"I\")\n .replace(/[\\xD0]/g, \"D\")\n .replace(/[\\xD1]/g, \"N\")\n .replace(/[\\xD2-\\xD6\\xD8]/g, \"O\")\n .replace(/[\\xD9-\\xDC]/g, \"U\")\n .replace(/[\\xDD]/g, \"Y\")\n .replace(/[\\xDE]/g, \"P\")\n .replace(/[\\xE0-\\xE5]/g, \"a\")\n .replace(/[\\xE6]/g, \"ae\")\n .replace(/[\\xE7]/g, \"c\")\n .replace(/[\\xE8-\\xEB]/g, \"e\")\n .replace(/[\\xEC-\\xEF]/g, \"i\")\n .replace(/[\\xF1]/g, \"n\")\n .replace(/[\\xF2-\\xF6\\xF8]/g, \"o\")\n .replace(/[\\xF9-\\xFC]/g, \"u\")\n .replace(/[\\xFE]/g, \"p\")\n .replace(/[\\xFD\\xFF]/g, \"y\");\n }\n \n return str;\n }\n}\n","\nexport var lastId = 0;\n\nexport function UniqueComponentId () {\n let prefix = 'pr_id_';\n lastId++;\n return `${prefix}${lastId}`;\n}"]}