<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
 *   Copyright (c) 2022 Esri
 *   All rights reserved.

 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at

 *   http://www.apache.org/licenses/LICENSE-2.0

 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
var __importDefault = (this &amp;&amp; this.__importDefault) || function (mod) {
    return (mod &amp;&amp; mod.__esModule) ? mod : { "default": mod };
};
define(["require", "exports", "ArcGISHTMLSanitizer", "TemplatesCommonLib/functionality/securityUtils"], function (require, exports, ArcGISHTMLSanitizer_1, securityUtils_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.expandPopup = expandPopup;
    exports.renderFeaturePanelContent = renderFeaturePanelContent;
    exports.renderPopupContent = renderPopupContent;
    exports.cleanupPrintPage = cleanupPrintPage;
    ArcGISHTMLSanitizer_1 = __importDefault(ArcGISHTMLSanitizer_1);
    const _sanitizer = (0, securityUtils_1.createSanitizerInstance)(ArcGISHTMLSanitizer_1.default);
    function expandPopup() {
        const elements = document.getElementsByClassName("popup-block");
        for (let i = 0; i &lt; elements.length; i++) {
            elements[i]?.setAttribute("open", "true");
        }
    }
    function renderFeaturePanelContent(container) {
        const nodes = document.getElementsByClassName("esri-features__container");
        container.innerHTML = null;
        if (nodes?.length &gt; 0) {
            container.append(nodes[0].cloneNode(true));
        }
    }
    function renderPopupContent(container) {
        // copy popup content to print div
        const resultContainer = document.getElementById("popupPanel");
        const features = resultContainer?.getElementsByClassName("popup-block");
        container.innerHTML = null;
        for (var i = 0; i &lt; features?.length; i++) {
            const popupDiv = document.createElement("div");
            popupDiv.classList.add("popup-content");
            container.append(popupDiv);
            const feature = features[i].cloneNode(true);
            const title = features[i]?.getAttribute("data-title");
            if (title) {
                const h = document.createElement("h2");
                h.innerHTML = _sanitizer.sanitize(title);
                popupDiv.append(h);
            }
            while (feature?.firstChild) {
                popupDiv.append(feature.firstChild);
            }
        }
    }
    function cleanupPrintPage() {
        const elements = document.getElementsByClassName("print-only");
        for (let i = 0; i &lt; elements?.length; i++) {
            const element = elements[0];
            element.innerHTML = null;
        }
    }
});
</pre></body></html>