import*as i18n from"../i18n/i18n.js";import{AffectedResourcesView}from"./AffectedResourcesView.js";const UIStrings={request:"request",requests:"requests",requestC:"Request",parentFrame:"Parent Frame",blockedResource:"Blocked Resource"},str_=i18n.i18n.registerUIStrings("issues/AffectedBlockedByResponseView.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export class AffectedBlockedByResponseView extends AffectedResourcesView{constructor(e,t){super(e,{singular:i18nString(UIStrings.request),plural:i18nString(UIStrings.requests)}),this.issue=t}appendDetails(e){const t=document.createElement("tr");this.appendColumnTitle(t,i18nString(UIStrings.requestC)),this.appendColumnTitle(t,i18nString(UIStrings.parentFrame)),this.appendColumnTitle(t,i18nString(UIStrings.blockedResource)),this.affectedResources.appendChild(t);let s=0;for(const i of e)this.appendDetail(i),s++;this.updateAffectedResourceCount(s)}appendDetail(e){const t=document.createElement("tr");t.classList.add("affected-resource-row");const s=this.createRequestCell(e.request);if(t.appendChild(s),e.parentFrame){const s=this.createFrameCell(e.parentFrame.frameId,this.issue);t.appendChild(s)}else t.appendChild(document.createElement("td"));if(e.blockedFrame){const s=this.createFrameCell(e.blockedFrame.frameId,this.issue);t.appendChild(s)}else t.appendChild(document.createElement("td"));this.affectedResources.appendChild(t)}update(){this.clear(),this.appendDetails(this.issue.getBlockedByResponseDetails())}}