{"version":3,"file":"ng-zorro-antd-core-highlight.mjs","sources":["../../components/core/highlight/highlight.pipe.ts","../../components/core/highlight/public-api.ts","../../components/core/highlight/ng-zorro-antd-core-highlight.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\n\nimport { encodeEntities } from 'ng-zorro-antd/core/util';\n\n@Pipe({\n  name: 'nzHighlight'\n})\nexport class NzHighlightPipe implements PipeTransform {\n  private UNIQUE_WRAPPERS: [string, string] = ['##==-open_tag-==##', '##==-close_tag-==##'];\n\n  transform(value: string, highlightValue: string, flags?: string, klass?: string): string | null {\n    if (!highlightValue) {\n      return value;\n    }\n\n    // Escapes regex keyword to interpret these characters literally\n    const searchValue = new RegExp(highlightValue.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$&'), flags);\n    const wrapValue = value.replace(searchValue, `${this.UNIQUE_WRAPPERS[0]}$&${this.UNIQUE_WRAPPERS[1]}`);\n    return encodeEntities(wrapValue)\n      .replace(new RegExp(this.UNIQUE_WRAPPERS[0], 'g'), klass ? `<span class=\"${klass}\">` : '<span>')\n      .replace(new RegExp(this.UNIQUE_WRAPPERS[1], 'g'), '</span>');\n  }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './highlight.pipe';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MASU,eAAe,CAAA;AAClB,IAAA,eAAe,GAAqB,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AAEzF,IAAA,SAAS,CAAC,KAAa,EAAE,cAAsB,EAAE,KAAc,EAAE,KAAc,EAAA;QAC7E,IAAI,CAAC,cAAc,EAAE;AACnB,YAAA,OAAO,KAAK;QAC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