class c extends Map{constructor(e,s=a){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:s}}),e!=null)for(const[n,o]of e)this.set(n,o)}get(e){return super.get(r(this,e))}has(e){return super.has(r(this,e))}set(e,s){return super.set(u(this,e),s)}delete(e){return super.delete(i(this,e))}}class h extends Set{constructor(e,s=a){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:s}}),e!=null)for(const n of e)this.add(n)}has(e){return super.has(r(this,e))}add(e){return super.add(u(this,e))}delete(e){return super.delete(i(this,e))}}function r({_intern:t,_key:e},s){const n=e(s);return t.has(n)?t.get(n):s}function u({_intern:t,_key:e},s){const n=e(s);return t.has(n)?t.get(n):(t.set(n,s),s)}function i({_intern:t,_key:e},s){const n=e(s);return t.has(n)&&(s=t.get(n),t.delete(n)),s}function a(t){return t!==null&&typeof t=="object"?t.valueOf():t}export{c as InternMap,h as InternSet};