<commit_before>import { mainLizmap, mainEventDispatcher } from '../modules/Globals.js';
import { html, render } from 'lit-html';

export default class GeolocationSurvey extends HTMLElement {
    constructor() {
        super();
    }

    connectedCallback() {
        const mainTemplate = () => html`
        <div class="control-group ${mainLizmap.geolocation.isLinkedToEdition ? '' : 'hide'}">
            <label class="jforms-label control-label" for="geolocation-survey-distance">Distance :</label>
            <div class="controls">
                <input id="geolocation-survey-distance" class="jforms-ctrl-input" value="" type="text">
            </div>
        </div>`;

        render(mainTemplate(), this);

        mainEventDispatcher.addListener(
            () => {
                render(mainTemplate(), this);
            },
            'geolocation.isLinkedToEdition'
        );
    }

    disconnectedCallback() {
    }
}<commit_msg>Geolocation survey only for line or polygon<commit_after>import { mainLizmap, mainEventDispatcher } from '../modules/Globals.js';
import { html, render } from 'lit-html';

export default class GeolocationSurvey extends HTMLElement {
    constructor() {
        super();
    }

    connectedCallback() {
        const mainTemplate = () => html`
        <div class="control-group ${mainLizmap.geolocation.isLinkedToEdition && ['line', 'polygon'].includes(mainLizmap.lizmapEditionLayerGeometry)  ? '' : 'hide'}">
            <label class="jforms-label control-label" for="geolocation-survey-distance">Distance :</label>
            <div class="controls">
                <input id="geolocation-survey-distance" class="jforms-ctrl-input" value="" type="text">
            </div>
        </div>`;

        render(mainTemplate(), this);

        mainEventDispatcher.addListener(
            () => {
                render(mainTemplate(), this);
            },
            'geolocation.isLinkedToEdition'
        );
    }

    disconnectedCallback() {
    }
}
{'fraction_non_alphanumeric': 0.14035964035964035, 'fraction_numerical': 0.0, 'mean_word_length': 2.4956369982547995, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7380018', 'n_tokens_mistral': 574, 'n_tokens_neox': 555, 'n_words': 102}