import{InvalidOperationError as r}from"../InvalidOperationError.js";import{notifyChange as i,onWatch as s,watch as e}from"../support/observableUtils.js";import{ObservableMap as t}from"./ObservableMap.js";const o="This map is read-only.";export class ReadOnlyMap extends t{constructor(r){super(),this._originalMap=r,this._handles.add(s(this,"size",(()=>e(this._originalMap,"size",(()=>i(this,"size")),{sync:!0}))))}emit(r,i){return this._originalMap.emit(r,i)}clear(){throw new r(o)}delete(i){throw new r(o)}set(){throw new r(o)}on(r,i){return this._originalMap.on(r,i)}}