6 lines
1.0 KiB
JavaScript
6 lines
1.0 KiB
JavaScript
"use strict";const i=require("./class-map-DV5418hw.js");/**
|
|
* @license
|
|
* Copyright 2018 Google LLC
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/const l="important",c=" !"+l,u=i.e(class extends i.i{constructor(n){var t;if(super(n),n.type!==i.t.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,s)=>{const e=n[s];return e==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(n,[t]){const{style:s}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)t[e]==null&&(this.ft.delete(e),e.includes("-")?s.removeProperty(e):s[e]=null);for(const e in t){const r=t[e];if(r!=null){this.ft.add(e);const o=typeof r=="string"&&r.endsWith(c);e.includes("-")||o?s.setProperty(e,o?r.slice(0,-11):r,o?l:""):s[e]=r}}return i.T}});exports.o=u;
|