/** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. * Original file: /npm/lit-html@3.1.3/directives/live.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t=globalThis,e=t.trustedTypes,i=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,r="?"+n,o=`<${r}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,_="[ \t\n\f\r]",c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a=/-->/g,d=/>/g,p=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),u=/'/g,g=/"/g,v=/^(?:script|style|textarea|title)$/i,f=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),y=new WeakMap,x=h.createTreeWalker(h,129);function H(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==i?i.createHTML(e):e}const N=(t,e)=>{const i=t.length-1,r=[];let h,l=2===e?"":"",$=c;for(let e=0;e"===_[0]?($=h??c,f=-1):void 0===_[1]?f=-2:(f=$.lastIndex-_[2].length,A=_[1],$=void 0===_[3]?p:'"'===_[3]?g:u):$===g||$===u?$=p:$===a||$===d?$=c:($=p,h=void 0);const y=$===p&&t[e+1].startsWith("/>")?" ":"";l+=$===c?i+o:f>=0?(r.push(A),i.slice(0,f)+s+i.slice(f)+n+y):i+n+(-2===f?e:y)}return[H(t,l+(t[i]||"")+(2===e?"":"")),r]};class b{constructor({strings:t,_$litType$:i},o){let h;this.parts=[];let $=0,A=0;const _=t.length-1,c=this.parts,[a,d]=N(t,i);if(this.el=b.createElement(a,o),x.currentNode=this.el.content,2===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=x.nextNode())&&c.length<_;){if(1===h.nodeType){if(h.hasAttributes())for(const t of h.getAttributeNames())if(t.endsWith(s)){const e=d[A++],i=h.getAttribute(t).split(n),s=/([.?@])?(.*)/.exec(e);c.push({type:1,index:$,name:s[2],strings:i,ctor:"."===s[1]?w:"?"===s[1]?E:"@"===s[1]?I:S}),h.removeAttribute(t)}else t.startsWith(n)&&(c.push({type:6,index:$}),h.removeAttribute(t));if(v.test(h.tagName)){const t=h.textContent.split(n),i=t.length-1;if(i>0){h.textContent=e?e.emptyScript:"";for(let e=0;eA(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==m&&$(this._$AH)?this._$AA.nextSibling.data=t:this.T(h.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=b.createElement(H(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new C(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=y.get(t.strings);return void 0===e&&y.set(t.strings,e=new b(t)),e}k(t){A(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new M(this.S(l()),this.S(l()),this,this.options)):i=e[s],i._$AI(n),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=m}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=T(this,t,e,0),r=!$(t)||t!==this._$AH&&t!==f,r&&(this._$AH=t);else{const s=t;let o,h;for(t=n[0],o=0;o(...e)=>({_$litDirective$:t,values:e}))(class extends D{constructor(t){if(super(t),t.type!==W&&t.type!==B&&t.type!==j)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===f||e===m)return e;const i=t.element,s=t.name;if(t.type===W){if(e===i[s])return f}else if(t.type===j){if(!!e===i.hasAttribute(s))return f}else if(t.type===B&&i.getAttribute(s)===e+"")return f;return((t,e=L)=>{t._$AH=e; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */})(t),e}});export{P as live};export default null;