import 'svelte/internal/disclose-version';
import * as $ from 'svelte/internal/client';
var root = $.template(`<p>Select this text to fire events</p> <p> </p>`, 1);
export default function App($$anchor, $$props) {
$.push($$props, true);
let selection = $.state('');
const handleSelectionChange = (e) => $.set(selection, $.proxy(document.getSelection().toString()));
var fragment = root();
$.event('selectionchange', $.document, handleSelectionChange);
var p = $.sibling($.first_child(fragment), 2);
var text = $.child(p);
$.reset(p);
$.template_effect(() => $.set_text(text, `Selection: ${$.get(selection) ?? ''}`));
$.append($$anchor, fragment);
$.pop();
}