"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.imports = void 0;
const transpile_1 = require("../../transpile");
exports.imports = [
    { name: 'WmProgressBar', from: '@wavemaker/app-rn-runtime/components/basic/progress-bar/progress-bar.component' }
];
exports.default = {
    pre: (element, context) => {
        var _a;
        const onTooltiptext = element.getAttribute('on-tooltiptext');
        const functionNameRegex = /fragment\.(\w+)\(/;
        const tooltipFunctionName = (_a = `${onTooltiptext}`.match(functionNameRegex)) === null || _a === void 0 ? void 0 : _a[1];
        const tooltipText = onTooltiptext ? `($event, widget, minVal, maxVal, percentage) => {
      if (fragment.${tooltipFunctionName}) {
        return ${onTooltiptext}
      }
    }` : '';
        if (onTooltiptext) {
            element.removeAttribute('on-tooltiptext');
        }
        ;
        return `<WmProgressBar ${(0, transpile_1.transformAttrs)(element, context)} ${onTooltiptext ? `onTooltiptext={${tooltipText}}` : ''}>`;
    },
    post: (element, context) => '</WmProgressBar>',
    imports: (element, context) => exports.imports
};
//# sourceMappingURL=progress-bar.transformer.js.map