function watchDraggedElement() {
    printDebug(() => "watching dragged element");
    armWindowScroller();
    const dropZones = typeToDropZones.get(draggedElType);
    for (const dz of dropZones) {
        dz.addEventListener(DRAGGED_ENTERED_EVENT_NAME, handleDraggedEntered);
        dz.addEventListener(DRAGGED_LEFT_EVENT_NAME, handleDraggedLeft);
        dz.addEventListener(DRAGGED_OVER_INDEX_EVENT_NAME, handleDraggedIsOverIndex);
    }
    window.addEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop);
    // it is important that we don't have an interval that is faster than the flip duration because it can cause elements to jump bach and forth
    const observationIntervalMs = Math.max(
        MIN_OBSERVATION_INTERVAL_MS,
        ...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs)
    );
    observe(draggedEl, dropZones, observationIntervalMs * 1.07);
}
/* functions to manage observing the dragged element and trigger custom drag-events */
functions to manage observing the dragged element and trigger custom drag-events
functions to manage observing the dragged element and trigger custom drag - events
function watchDraggedElement() {
    printDebug(() => "watching dragged element");
    armWindowScroller();
    const dropZones = typeToDropZones.get(draggedElType);
    for (const dz of dropZones) {
        dz.addEventListener(DRAGGED_ENTERED_EVENT_NAME, handleDraggedEntered);
        dz.addEventListener(DRAGGED_LEFT_EVENT_NAME, handleDraggedLeft);
        dz.addEventListener(DRAGGED_OVER_INDEX_EVENT_NAME, handleDraggedIsOverIndex);
    }
    window.addEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop);
    const observationIntervalMs = Math.max(
        MIN_OBSERVATION_INTERVAL_MS,
        ...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs)
    );
    observe(draggedEl, dropZones, observationIntervalMs * 1.07);
}
function watchDraggedElement ( ) { printDebug ( ( ) => "watching dragged element" ) ; armWindowScroller ( ) ; const dropZones = typeToDropZones . get ( draggedElType ) ; for ( const dz of dropZones ) { dz . addEventListener ( DRAGGED_ENTERED_EVENT_NAME , handleDraggedEntered ) ; dz . addEventListener ( DRAGGED_LEFT_EVENT_NAME , handleDraggedLeft ) ; dz . addEventListener ( DRAGGED_OVER_INDEX_EVENT_NAME , handleDraggedIsOverIndex ) ; } window . addEventListener ( DRAGGED_LEFT_DOCUMENT_EVENT_NAME , handleDrop ) ; const observationIntervalMs = Math . max ( MIN_OBSERVATION_INTERVAL_MS , ... Array . from ( dropZones . keys ( ) ) . map ( dz => dzToConfig . get ( dz ) . dropAnimationDurationMs ) ) ; observe ( draggedEl , dropZones , observationIntervalMs * 1.07 ) ; }
functions to manage observing the dragged element and trigger custom drag-events
functions to manage observing the dragged element and trigger custom drag - events
// it is important that we don't have an interval that is faster than the flip duration because it can cause elements to jump bach and forth