"use strict";
var __webpack_require__ = {};
(()=>{
    __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__, {
    hierarchicalPath: ()=>hierarchicalPath
});
const external_lit_namespaceObject = require("lit");
const directive_js_namespaceObject = require("lit/directive.js");
class HierarchicalPathDirective extends directive_js_namespaceObject.Directive {
    render(props) {
        const { path, separator = '/', ellipsis = '...', maxLength = 3, emptyPathContent = '', separatorClass = 'mx-0.5', itemClass = 'max-w-max flex-1 truncate', ellipsisClass = '' } = props;
        if (!path.length) return emptyPathContent;
        const ellipsedPath = this.getEllipsedPath(path, maxLength, ellipsis);
        return ellipsedPath.map((value, index)=>(0, external_lit_namespaceObject.html)`
        ${index > 0 ? (0, external_lit_namespaceObject.html)`<span class=${separatorClass}>${separator}</span>` : ''}
        <span class=${value === ellipsis ? ellipsisClass : itemClass}>
          ${value}
        </span>
      `);
    }
    getEllipsedPath(path, maxLength, ellipsis) {
        if (path.length <= maxLength) return path;
        if (1 === maxLength) return [
            path[0]
        ];
        const firstPart = path.slice(0, 1);
        const lastParts = path.slice(-maxLength + 1);
        return firstPart.concat(ellipsis, ...lastParts);
    }
    constructor(partInfo){
        super(partInfo);
        if (partInfo.type !== directive_js_namespaceObject.PartType.CHILD) throw new Error('hierarchicalPath can only be used in child bindings');
    }
}
const hierarchicalPath = (0, directive_js_namespaceObject.directive)(HierarchicalPathDirective);
exports.hierarchicalPath = __webpack_exports__.hierarchicalPath;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "hierarchicalPath"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
