export function applyCaptureIdToElement ( element , referenceCaptureId ) { element . setAttribute ( getCaptureIdAttributeName ( referenceCaptureId ) , '' ) ; } function getElementByCaptureId ( referenceCaptureId ) { const selector = `[${ getCaptureIdAttributeName ( referenceCaptureId ) }]` ; return document . querySelector ( selector ) ; } function getCaptureIdAttributeName ( referenceCaptureId ) { return `_bl_${ referenceCaptureId }` ; } const elementRefKey = '__internalId' ; DotNet . attachReviver ( ( key , value ) => { if ( value && typeof value === 'object' && value . hasOwnProperty ( elementRefKey ) && typeof value [ elementRefKey ] === 'string' ) { return getElementByCaptureId ( value [ elementRefKey ] ) ; } else { return value ; } } ) ;