1 line
7.9 KiB
JSON
1 line
7.9 KiB
JSON
{"ast":null,"code":"// Used https://gist.github.com/mudge/5830382 as a starting point.\n// See https://github.com/browserify/events/blob/master/events.js for\n// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.\nexport class EventManager {\n constructor() {\n this.maxListeners = 10;\n this.warnOnce = false;\n this.events = {};\n }\n on(eventName, listener, options = {}) {\n let collection = this.events[eventName];\n if (!collection) {\n collection = {\n highPriority: new Map(),\n regular: new Map()\n };\n this.events[eventName] = collection;\n }\n if (options.isFirst) {\n collection.highPriority.set(listener, true);\n } else {\n collection.regular.set(listener, true);\n }\n if (process.env.NODE_ENV !== 'production') {\n const collectionSize = collection.highPriority.size + collection.regular.size;\n if (collectionSize > this.maxListeners && !this.warnOnce) {\n this.warnOnce = true;\n console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`, `Use emitter.setMaxListeners() to increase limit.`].join('\\n'));\n }\n }\n }\n removeListener(eventName, listener) {\n if (this.events[eventName]) {\n this.events[eventName].regular.delete(listener);\n this.events[eventName].highPriority.delete(listener);\n }\n }\n removeAllListeners() {\n this.events = {};\n }\n emit(eventName, ...args) {\n const collection = this.events[eventName];\n if (!collection) {\n return;\n }\n const highPriorityListeners = Array.from(collection.highPriority.keys());\n const regularListeners = Array.from(collection.regular.keys());\n for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {\n const listener = highPriorityListeners[i];\n if (collection.highPriority.has(listener)) {\n listener.apply(this, args);\n }\n }\n for (let i = 0; i < regularListeners.length; i += 1) {\n const listener = regularListeners[i];\n if (collection.regular.has(listener)) {\n listener.apply(this, args);\n }\n }\n }\n once(eventName, listener) {\n // eslint-disable-next-line consistent-this\n const that = this;\n this.on(eventName, function oneTimeListener(...args) {\n that.removeListener(eventName, oneTimeListener);\n listener.apply(that, args);\n });\n }\n}","map":{"version":3,"names":["EventManager","constructor","maxListeners","warnOnce","events","on","eventName","listener","options","collection","highPriority","Map","regular","isFirst","set","process","env","NODE_ENV","collectionSize","size","console","warn","join","removeListener","delete","removeAllListeners","emit","args","highPriorityListeners","Array","from","keys","regularListeners","i","length","has","apply","once","that","oneTimeListener"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/utils/EventManager.js"],"sourcesContent":["// Used https://gist.github.com/mudge/5830382 as a starting point.\n// See https://github.com/browserify/events/blob/master/events.js for\n// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.\nexport class EventManager {\n constructor() {\n this.maxListeners = 10;\n this.warnOnce = false;\n this.events = {};\n }\n\n on(eventName, listener, options = {}) {\n let collection = this.events[eventName];\n\n if (!collection) {\n collection = {\n highPriority: new Map(),\n regular: new Map()\n };\n this.events[eventName] = collection;\n }\n\n if (options.isFirst) {\n collection.highPriority.set(listener, true);\n } else {\n collection.regular.set(listener, true);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n const collectionSize = collection.highPriority.size + collection.regular.size;\n\n if (collectionSize > this.maxListeners && !this.warnOnce) {\n this.warnOnce = true;\n console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`, `Use emitter.setMaxListeners() to increase limit.`].join('\\n'));\n }\n }\n }\n\n removeListener(eventName, listener) {\n if (this.events[eventName]) {\n this.events[eventName].regular.delete(listener);\n this.events[eventName].highPriority.delete(listener);\n }\n }\n\n removeAllListeners() {\n this.events = {};\n }\n\n emit(eventName, ...args) {\n const collection = this.events[eventName];\n\n if (!collection) {\n return;\n }\n\n const highPriorityListeners = Array.from(collection.highPriority.keys());\n const regularListeners = Array.from(collection.regular.keys());\n\n for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {\n const listener = highPriorityListeners[i];\n\n if (collection.highPriority.has(listener)) {\n listener.apply(this, args);\n }\n }\n\n for (let i = 0; i < regularListeners.length; i += 1) {\n const listener = regularListeners[i];\n\n if (collection.regular.has(listener)) {\n listener.apply(this, args);\n }\n }\n }\n\n once(eventName, listener) {\n // eslint-disable-next-line consistent-this\n const that = this;\n this.on(eventName, function oneTimeListener(...args) {\n that.removeListener(eventName, oneTimeListener);\n listener.apply(that, args);\n });\n }\n\n}"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,YAAY,CAAC;EACxBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,YAAY,GAAG,EAAE;IACtB,IAAI,CAACC,QAAQ,GAAG,KAAK;IACrB,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC;EAClB;EAEAC,EAAEA,CAACC,SAAS,EAAEC,QAAQ,EAAEC,OAAO,GAAG,CAAC,CAAC,EAAE;IACpC,IAAIC,UAAU,GAAG,IAAI,CAACL,MAAM,CAACE,SAAS,CAAC;IAEvC,IAAI,CAACG,UAAU,EAAE;MACfA,UAAU,GAAG;QACXC,YAAY,EAAE,IAAIC,GAAG,CAAC,CAAC;QACvBC,OAAO,EAAE,IAAID,GAAG,CAAC;MACnB,CAAC;MACD,IAAI,CAACP,MAAM,CAACE,SAAS,CAAC,GAAGG,UAAU;IACrC;IAEA,IAAID,OAAO,CAACK,OAAO,EAAE;MACnBJ,UAAU,CAACC,YAAY,CAACI,GAAG,CAACP,QAAQ,EAAE,IAAI,CAAC;IAC7C,CAAC,MAAM;MACLE,UAAU,CAACG,OAAO,CAACE,GAAG,CAACP,QAAQ,EAAE,IAAI,CAAC;IACxC;IAEA,IAAIQ,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MACzC,MAAMC,cAAc,GAAGT,UAAU,CAACC,YAAY,CAACS,IAAI,GAAGV,UAAU,CAACG,OAAO,CAACO,IAAI;MAE7E,IAAID,cAAc,GAAG,IAAI,CAAChB,YAAY,IAAI,CAAC,IAAI,CAACC,QAAQ,EAAE;QACxD,IAAI,CAACA,QAAQ,GAAG,IAAI;QACpBiB,OAAO,CAACC,IAAI,CAAC,CAAC,+CAA+CH,cAAc,IAAIZ,SAAS,mBAAmB,EAAE,kDAAkD,CAAC,CAACgB,IAAI,CAAC,IAA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