"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    renderUserAction: ()=>renderUserAction
});
const external_lit_namespaceObject = require("lit");
const multi_class_map_cjs_namespaceObject = require("../../../directives/multi-class-map.cjs");
const date_utils_cjs_namespaceObject = require("../../../utils/date-utils.cjs");
const bookmark_cjs_namespaceObject = require("../../../images/bookmark.cjs");
var bookmark_cjs_default = /*#__PURE__*/ __webpack_require__.n(bookmark_cjs_namespaceObject);
const document_cjs_namespaceObject = require("../../../images/document.cjs");
var document_cjs_default = /*#__PURE__*/ __webpack_require__.n(document_cjs_namespaceObject);
const point_cjs_namespaceObject = require("../../../images/point.cjs");
var point_cjs_default = /*#__PURE__*/ __webpack_require__.n(point_cjs_namespaceObject);
const quickview_cjs_namespaceObject = require("../../../images/quickview.cjs");
var quickview_cjs_default = /*#__PURE__*/ __webpack_require__.n(quickview_cjs_namespaceObject);
const search_cjs_namespaceObject = require("../../../images/search.cjs");
var search_cjs_default = /*#__PURE__*/ __webpack_require__.n(search_cjs_namespaceObject);
const icons = {
    SEARCH: search_cjs_default(),
    CLICK: document_cjs_default(),
    VIEW: quickview_cjs_default(),
    CUSTOM: point_cjs_default(),
    TICKET_CREATION: bookmark_cjs_default()
};
const renderUserAction = ({ props })=>{
    const renderActionTimestamp = ()=>{
        const { hours, minutes } = (0, date_utils_cjs_namespaceObject.parseTimestampToDateDetails)(props.action.timestamp);
        const formattedHours = String(hours).padStart(2, '0');
        const formattedMinutes = String(minutes).padStart(2, '0');
        return `${formattedHours}:${formattedMinutes}`;
    };
    const renderIcon = ()=>{
        const iconClasses = (0, multi_class_map_cjs_namespaceObject.tw)({
            'w-3 h-3': true,
            'text-primary': [
                'CLICK',
                'VIEW'
            ].includes(props.action.actionType)
        });
        return (0, external_lit_namespaceObject.html)`<atomic-icon
      icon=${icons[props.action.actionType]}
      class=${(0, multi_class_map_cjs_namespaceObject.multiClassMap)(iconClasses)}
    ></atomic-icon>`;
    };
    const renderActionTitle = ()=>{
        switch(props.action.actionType){
            case 'TICKET_CREATION':
                return (0, external_lit_namespaceObject.html)`<div
          class="ticket-creation-action__text text-xs font-semibold"
        >
          ${props.bindings.i18n.t('ticket-created')}
        </div>`;
            case 'CUSTOM':
                return (0, external_lit_namespaceObject.html)`<div class="text-xs font-semibold">
          ${props.action.eventData?.value ?? props.action.eventData?.type}
        </div>`;
            case 'SEARCH':
                return (0, external_lit_namespaceObject.html)`<div class="text-xs font-semibold">
          ${props.action.query || props.bindings.i18n.t('empty-search')}
        </div>`;
            case 'VIEW':
                return (0, external_lit_namespaceObject.html)`<a
          href=${props.action.document?.contentIdValue}
          class="text-primary text-xs font-semibold"
          target="_blank"
        >
          ${props.action.document?.title}
        </a>`;
            case 'CLICK':
                return (0, external_lit_namespaceObject.html)`<div class="text-xs font-semibold">
          ${props.action.document?.title}
        </div>`;
            default:
                return external_lit_namespaceObject.nothing;
        }
    };
    return (0, external_lit_namespaceObject.html)`<li class="flex">
    <div class="flex-none pr-2">
      <div class="flex justify-center py-1">${renderIcon()}</div>
      <div class="flex justify-center py-1">
        <div class="user-action__separator h-7 w-0.5 rounded"></div>
      </div>
    </div>
    <div class="flex-1">
      ${renderActionTitle()}
      <div class="text-neutral-dark text-xxs flex py-2 font-light">
        <div>${renderActionTimestamp()}</div>
        <div class="px-2">${props.action.searchHub}</div>
      </div>
    </div>
  </li>`;
};
exports.renderUserAction = __webpack_exports__.renderUserAction;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderUserAction"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
