"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__, {
    AtomicGeneratedAnswerInlineLink: ()=>AtomicGeneratedAnswerInlineLink
});
const headless_namespaceObject = require("@coveo/headless");
const external_lit_namespaceObject = require("lit");
const decorators_js_namespaceObject = require("lit/decorators.js");
const external_atomic_generated_answer_inline_link_tw_css_cjs_namespaceObject = require("./atomic-generated-answer-inline-link.tw.css.cjs");
var external_atomic_generated_answer_inline_link_tw_css_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_atomic_generated_answer_inline_link_tw_css_cjs_namespaceObject);
const if_defined_js_namespaceObject = require("lit/directives/if-defined.js");
const binding_guard_cjs_namespaceObject = require("../../../decorators/binding-guard.cjs");
const bindings_cjs_namespaceObject = require("../../../decorators/bindings.cjs");
const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard.cjs");
const context_namespaceObject = require("@lit/context");
const answer_context_cjs_namespaceObject = require("../atomic-generated-answer-content/answer-context.cjs");
function _ts_decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
    else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function _ts_metadata(k, v) {
    if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
}
class AtomicGeneratedAnswerInlineLink extends external_lit_namespaceObject.LitElement {
    initialize() {
        if (this.answerId && this.href) this.interactiveLink = (0, headless_namespaceObject.buildInteractiveGeneratedAnswerInlineLink)(this.bindings.engine, {
            options: {
                answerId: this.answerId,
                link: {
                    linkText: this.textContent?.trim() || '',
                    linkURL: this.href
                }
            }
        });
    }
    render() {
        return (0, external_lit_namespaceObject.html)`
      <a
        part="answer-link"
        href=${this.href}
        title=${(0, if_defined_js_namespaceObject.ifDefined)(this.title || void 0)}
        target="_blank"
        rel="noopener noreferrer"
        @click=${this.handleSelect}
        @contextmenu=${this.handleSelect}
        @mousedown=${this.handleSelect}
        @mouseup=${this.handleSelect}
        @touchstart=${this.handleBeginDelayedSelect}
        @touchend=${this.handleCancelPendingSelect}
      >
        <span part="answer-link-text"><slot></slot></span>
        <span class="icon-wrapper">
          <svg
            part="answer-link-icon"
            width="100%"
            height="100%"
            viewBox="0 0 640 640"
            aria-hidden="true"
            focusable="false"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              fill="currentColor"
              d="M354.4 83.8C359.4 71.8 371.1 64 384 64L544 64C561.7 64 576 78.3 576 96L576 256C576 268.9 568.2 280.6 556.2 285.6C544.2 290.6 530.5 287.8 521.3 278.7L464 221.3L310.6 374.6C298.1 387.1 277.8 387.1 265.3 374.6C252.8 362.1 252.8 341.8 265.3 329.3L418.7 176L361.4 118.6C352.2 109.4 349.5 95.7 354.5 83.7zM64 240C64 195.8 99.8 160 144 160L224 160C241.7 160 256 174.3 256 192C256 209.7 241.7 224 224 224L144 224C135.2 224 128 231.2 128 240L128 496C128 504.8 135.2 512 144 512L400 512C408.8 512 416 504.8 416 496L416 416C416 398.3 430.3 384 448 384C465.7 384 480 398.3 480 416L480 496C480 540.2 444.2 576 400 576L144 576C99.8 576 64 540.2 64 496L64 240z"
            />
          </svg>
        </span>
      </a>
    `;
    }
    handleSelect() {
        this.interactiveLink?.select();
    }
    handleBeginDelayedSelect() {
        this.interactiveLink?.beginDelayedSelect();
    }
    handleCancelPendingSelect() {
        this.interactiveLink?.cancelPendingSelect();
    }
    constructor(...args){
        super(...args), this.initialized = false, this.href = '', this.title = '';
    }
}
AtomicGeneratedAnswerInlineLink.styles = external_atomic_generated_answer_inline_link_tw_css_cjs_default();
_ts_decorate([
    (0, context_namespaceObject.consume)({
        context: answer_context_cjs_namespaceObject.answerContext
    }),
    _ts_metadata("design:type", Object)
], AtomicGeneratedAnswerInlineLink.prototype, "answerId", void 0);
_ts_decorate([
    (0, decorators_js_namespaceObject.state)(),
    _ts_metadata("design:type", "u" < typeof AnyBindings ? Object : AnyBindings)
], AtomicGeneratedAnswerInlineLink.prototype, "bindings", void 0);
_ts_decorate([
    (0, decorators_js_namespaceObject.state)(),
    _ts_metadata("design:type", "u" < typeof Error ? Object : Error)
], AtomicGeneratedAnswerInlineLink.prototype, "error", void 0);
_ts_decorate([
    (0, decorators_js_namespaceObject.property)({
        reflect: true
    })
], AtomicGeneratedAnswerInlineLink.prototype, "href", void 0);
_ts_decorate([
    (0, decorators_js_namespaceObject.property)({
        reflect: true
    })
], AtomicGeneratedAnswerInlineLink.prototype, "title", void 0);
_ts_decorate([
    (0, binding_guard_cjs_namespaceObject.bindingGuard)(),
    (0, error_guard_cjs_namespaceObject.errorGuard)(),
    _ts_metadata("design:type", Function),
    _ts_metadata("design:paramtypes", []),
    _ts_metadata("design:returntype", void 0)
], AtomicGeneratedAnswerInlineLink.prototype, "render", null);
AtomicGeneratedAnswerInlineLink = _ts_decorate([
    (0, decorators_js_namespaceObject.customElement)('atomic-generated-answer-inline-link'),
    (0, bindings_cjs_namespaceObject.bindings)()
], AtomicGeneratedAnswerInlineLink);
exports.AtomicGeneratedAnswerInlineLink = __webpack_exports__.AtomicGeneratedAnswerInlineLink;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "AtomicGeneratedAnswerInlineLink"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
