import{aD as t,aE as s,aF as e,aG as i,aH as a,aV as c}from"./p-BTBbFFOR.js";var n=function(t,s,e,i){var a,c=arguments.length,n=c<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(a=t[h])&&(n=(c<3?a(n):c>3?a(s,e,n):a(s,e))||n);return c>3&&n&&Object.defineProperty(s,e,n),n};class h extends e{connectedCallback(){this.subject&&(this.notifyObserver=new i(this.isAcceptableObserverPayload.bind(this),this.handleObserver),a.register(this.subject,this.notifyObserver))}disconnectedCallback(){this.subject&&a.unregister(this.subject,this.notifyObserver)}constructor(t,s,e){super(),this.acceptableResultMap=new WeakMap,this.isAcceptableObserverPayload=t=>{let s=!1;return"function"==typeof this.customAcceptableHandle?s=this.customAcceptableHandle(t):this.host&&t.host&&(this.acceptableResultMap.has(t.host)?s=!!this.acceptableResultMap.get(t.host):(s=this.host!==t.host&&c(t.host,this.host),this.acceptableResultMap.set(t.host,s))),s},this.handleObserver=t=>{"function"==typeof this.callback&&this.callback(t)},this.subject=t,this.callback=s,this.customAcceptableHandle=e}}n([t()],h.prototype,"host",void 0),n([s("connectedCallback")],h.prototype,"connectedCallback",null),n([s("disconnectedCallback")],h.prototype,"disconnectedCallback",null);export{h as C}