import{AsyncDirective as k,Decorators as O,Directive as C,Directives as F,LitElement as V,noChange as W,nothing as H,StaticHtml as P,svg as U}from"./../../third_party/lit/lit.js";import*as L from"./../../core/i18n/i18n.js";import*as m from"./../../third_party/lit/lit.js";var{html:d}=m.StaticHtml;function A(i,r,s){let n=i.getLocalizedStringSetFor(L.DevToolsLocale.DevToolsLocale.instance().locale).getMessageFormatterFor(r),t=m.nothing;for(let e of n.getAst())if(e.type===1){let f=s[e.value];f&&(t=d`${t}${f}`)}else"value"in e&&(t=d`${t}${e.value}`);return t}import*as w from"./../../third_party/lit/lit.js";var p=new WeakMap,g=new WeakMap;function D(i,r,s){let n=r instanceof ShadowRoot?r.host:r;if(n instanceof Element){let f=p.get(r)?.container?.attributes,c=s?.container?.attributes;if(c)for(let[o,l]of Object.entries(c))f?.[o]!==l&&(l==null?n.removeAttribute(o):typeof l=="boolean"?n.toggleAttribute(o,l):n.setAttribute(o,l.toString()));if(f)for(let o of Object.keys(f))(!c||!(o in c))&&n.removeAttribute(o);let u=p.get(r)?.container?.classes,a=s?.container?.classes;if(u)for(let o of u)a?.includes(o)||n.classList.remove(o);if(a)for(let o of a)u?.includes(o)||n.classList.add(o)}let t=g.get(r);t||(t=new Map,g.set(r,t));let e=s?.container?.listeners;if(e)for(let[f,c]of Object.entries(e)){let u=t.get(f);if(u)u.listener=c;else{let a=c,o={get listener(){return a},set listener(l){a=l},wrapper:l=>{if(typeof a=="function")return a.call(n,l);if(a&&"handleEvent"in a)return a.handleEvent(l)}};t.set(f,o),n.addEventListener(f,o.wrapper)}}for(let[f,c]of t.entries())(!e||!(f in e))&&(n.removeEventListener(f,c.wrapper),t.delete(f));return p.set(r,s),w.render(i,r,s)}import*as h from"./../../core/platform/platform.js";import*as v from"./../../third_party/lit/lit.js";var b=new WeakMap;function y(i){return!!(typeof i=="object"&&i&&"_$litDirective$"in i&&"values"in i)}function E(i,...r){let s=b.get(i);s||(i.some(e=>e.includes(`
`))?s=x(i):s=i),b.set(i,s);let n=e=>typeof e=="string"?h.StringUtilities.safeEscapeUnicode(e):Array.isArray(e)?e.map(n):(y(e)&&(e.values=e.values.map(n)),e),t=r.map(n);return v.html(s,...t)}function x(i){let r=!1,s=i.map(n=>n.replace(/[<>]|\n\s*/g,t=>{if(t==="<")r=!0;else if(r&&t===">")r=!1;else if(!r)return"";return t}));return s.raw=i.raw,s}export{k as AsyncDirective,O as Decorators,C as Directive,F as Directives,V as LitElement,P as StaticHtml,E as html,A as i18nTemplate,y as isLitDirective,W as noChange,H as nothing,D as render,U as svg};
//# sourceMappingURL=lit.js.map
