Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
const require_safe_custom_element = require("../../shared/safe-custom-element.cjs");
const require_index = require("../../shared/tailwind-element/index.cjs");
const require_decorate = require("../../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.cjs");
const require_style = require("./style.css?inline.cjs");
let lit = require("lit");
let lit_decorators_js = require("lit/decorators.js");
let lit_directives_unsafe_html_js = require("lit/directives/unsafe-html.js");
let dompurify = require("dompurify");
dompurify = require_runtime.__toESM(dompurify, 1);
//#region src/components/lukso-sanitize/index.ts
/**
* Default DOMPurify options for lukso-sanitize component.
*/
var DEFAULT_OPTIONS = {
	ADD_ATTR: ["target"],
	CUSTOM_ELEMENT_HANDLING: {
		tagNameCheck: /^lukso-/,
		attributeNameCheck: /.*/
	}
};
/**
* Options to strip all HTML tags.
*/
var NO_HTML_TAGS_OPTIONS = { ALLOWED_TAGS: [] };
var LuksoSanitize = class LuksoSanitize extends require_index.TailwindStyledElement(require_style.default) {
	constructor(..._args) {
		super(..._args);
		this.htmlContent = "";
		this.isPre = false;
		this.stripHtmlTags = false;
	}
	sanitize() {
		if (this.stripHtmlTags) return dompurify.default.sanitize(this.htmlContent, NO_HTML_TAGS_OPTIONS);
		return dompurify.default.sanitize(this.htmlContent, DEFAULT_OPTIONS);
	}
	render() {
		return this.isPre ? lit.html`<!-- prettier-ignore -->
          <div
      class='whitespace-pre-wrap'>${(0, lit_directives_unsafe_html_js.unsafeHTML)(this.sanitize())}</div>` : lit.html`${(0, lit_directives_unsafe_html_js.unsafeHTML)(this.sanitize())}`;
	}
};
require_decorate.__decorate([(0, lit_decorators_js.property)({
	type: String,
	attribute: "html-content"
})], LuksoSanitize.prototype, "htmlContent", void 0);
require_decorate.__decorate([(0, lit_decorators_js.property)({
	type: Boolean,
	attribute: "is-pre"
})], LuksoSanitize.prototype, "isPre", void 0);
require_decorate.__decorate([(0, lit_decorators_js.property)({
	type: Boolean,
	attribute: "strip-html-tags"
})], LuksoSanitize.prototype, "stripHtmlTags", void 0);
LuksoSanitize = require_decorate.__decorate([require_safe_custom_element.safeCustomElement("lukso-sanitize")], LuksoSanitize);
//#endregion
exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
Object.defineProperty(exports, "LuksoSanitize", {
	enumerable: true,
	get: function() {
		return LuksoSanitize;
	}
});
exports.NO_HTML_TAGS_OPTIONS = NO_HTML_TAGS_OPTIONS;
