import{__assign as e}from"tslib";import{jsxs as a,jsx as s}from"react/jsx-runtime";import{History as t}from"lucide-react";import l from"../styles/OverrideTimeline.module.css.js";import i from"../styles/CustomTooltip.module.css.js";import r from"../components/CustomTooltip.js";var n=function(n){var o=n.changeLog,c=n.headerText,d=void 0===c?"Override History":c;return o&&0!==o.length?a("div",e({className:l.container},{children:[a("div",e({className:l.header},{children:[s(t,{color:"#475569",size:15,className:l.headerIcon}),s("span",e({className:l.headerText},{children:d}))]})),s("div",e({className:l.timeline},{children:o.map(function(t,n){var c,d,m=n===o.length-1,h="global"===t.scope.toLowerCase(),p=m&&["edited","add","remove","edit"].includes(t.type);return a("div",e({className:l.timelineItem},{children:[s(r,e({content:t.scope,placement:"top",withArrow:!0,contentClassName:i.customTooltip,sideOffset:5},{children:s("div",e({className:l.leftColumn},{children:s("span",p?e({className:l.leafLabel},{children:"add"===t.type?"Added":"remove"===t.type?"Removed":"Edited"}):e({className:l.scopeLabel},{children:t.scope}))}))})),a("div",e({className:l.middleColumn},{children:[!m&&s("div",{className:l.verticalLine}),p&&s("div",{className:l.leafConnector}),!p&&s("div",{className:"".concat(l.dot," ").concat(h?l.dotGlobal:l.dotOther)})]})),s("div",e({className:l.rightColumn},{children:p?a("div",e({className:l.leafCard},{children:[s("div",{className:l.leafDot}),s("div",e({className:l.leafContent},{children:(c=t.text,d=c.split(/(<s>.*?<\/s>)/g),s("span",{children:d.map(function(a,t){if(a.startsWith("<s>")&&a.endsWith("</s>")){var i=a.slice(3,-4);return s("span",e({className:l.strikethrough},{children:i}),t)}return s("span",{children:a},t)})}))}))]})):s("div",e({className:l.normalContent},{children:"Default Variant"===t.text?"Default":t.text}))}))]}),n)})}))]})):null};export{n as default};
//# sourceMappingURL=OverrideTimeline.js.map
