js-use-core
Version:
JavaScript Comprehensive tool library, including full screen, copy and paste functions
2 lines (1 loc) • 20.4 kB
JavaScript
function e(e){return!(!e||"object"!=typeof e||e.nodeType!==Node.ELEMENT_NODE)}function t(t){return e(t)&&t instanceof HTMLElement}function r(e){return e&&e.nodeType===Node.DOCUMENT_NODE}function n(t){if(!t)return null;if(e(t))return t;if("string"==typeof t)try{return document.querySelector(t)}catch(e){return null}return null}function o(e){try{return Array.from(document.querySelectorAll(e))}catch(e){return[]}}const s=["","webkit","moz","ms","o"];function i(e){if(e in document.documentElement.style||e in window||e in document)return{supported:!0};for(const t of s.slice(1)){const r=`${t}${e.charAt(0).toUpperCase()}${e.slice(1)}`;if(r in document.documentElement.style||r in window||r in document)return{supported:!0,prefixedName:r,prefix:t}}return{supported:!1}}function c(e){const t=i(e);return t.supported?t.prefixedName||e:null}function a(e,t){const r=document.createElement("div"),n=c(e);if(!n)return!1;try{return r.style[n]=t||"initial",""!==r.style[n]}catch{return!1}}function u(e){return e in document.createElement("div")}function l(e){return i(e).supported}function d(e){return c(e)}const h=new class{constructor(){this.listeners=new WeakMap}add(e,t,r,n){e.addEventListener(t,r,n),this.listeners.has(e)||this.listeners.set(e,new Map);const o=this.listeners.get(e);return o.has(t)||o.set(t,new Set),o.get(t).add(r),()=>this.remove(e,t,r,n)}remove(e,t,r,n){e.removeEventListener(t,r,n);const o=this.listeners.get(e);if(o){const e=o.get(t);e&&(e.delete(r),0===e.size&&o.delete(t))}}removeAll(e){const t=this.listeners.get(e);if(t){for(const[r,n]of t)for(const t of n)e.removeEventListener(r,t);this.listeners.delete(e)}}};function R(e,t,r,o){const s=(e instanceof Element?e:n(e))||e;if(!s)throw new Error("Invalid event target");return h.add(s,t,r,o)}function f(e,t,r,o){const s=(e instanceof Element?e:n(e))||e;if(!s)throw new Error("Invalid event target");h.remove(s,t,r,o)}function m(e){const t=(e instanceof Element?e:n(e))||e;t&&h.removeAll(t)}function E(e,t,r){return new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0,...r})}function p(e,t,r,o){const s=n(e);if(!s)throw new Error("Invalid event target for dispatch");const i=E(t,r,o);return s.dispatchEvent(i)}function g(e,t,r,o,s){const i=n(e);if(!i)throw new Error("Invalid container for event delegation");return R(i,r,e=>{const r=e.target.closest(t);r&&i.contains(r)&&o(e,r)},s)}const O=new class{constructor(){this.operations=[],this.rafId=null}add(e){this.operations.push(e),this.schedule()}schedule(){null===this.rafId&&(this.rafId=requestAnimationFrame(()=>{this.flush()}))}flush(){const e=this.operations.splice(0);this.rafId=null;for(const t of e)try{t()}catch(e){}}flushSync(){null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.flush()}};function S(e){e.forEach(e=>O.add(e))}function w(){return document.createDocumentFragment()}function v(e,t,r={}){const o=n(e);if(!o)throw new Error("Invalid container element");const{useFragment:s=!0}=r;if(s&&t.length>1){const e=w();t.forEach(t=>{if("string"==typeof t){const r=document.createElement("div");for(r.innerHTML=t;r.firstChild;)e.appendChild(r.firstChild)}else e.appendChild(t)}),o.appendChild(e)}else t.forEach(e=>{"string"==typeof e?o.insertAdjacentHTML("beforeend",e):o.appendChild(e)})}function I(e,t){const r=n(e);if(!r)throw new Error("Invalid target element for style setting");O.add(()=>{Object.assign(r.style,t)})}function N(e,t){const r=n(e);if(!r)throw new Error("Invalid target element for attribute setting");O.add(()=>{Object.entries(t).forEach(([e,t])=>{r.setAttribute(e,t)})})}function T(e){const t=n(e);return t?t.getBoundingClientRect():null}function _(e,t=0){const r=n(e);if(!r)return!1;const o=r.getBoundingClientRect(),s=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return o.top>=-t&&o.left>=-t&&o.bottom<=s+t&&o.right<=i+t}function y(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}function C(e,t=5e3){return new Promise((r,o)=>{const s=n(e);if(s)return void r(s);const i=new MutationObserver(()=>{const t=n(e);t&&(i.disconnect(),clearTimeout(c),r(t))}),c=setTimeout(()=>{i.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t);i.observe(document.body,{childList:!0,subtree:!0})})}function b(){O.flushSync()}class Cache{constructor(e){this.cache=new Map,this.config={maxSize:e?.maxSize??100,defaultTTL:e?.defaultTTL??3e5,enableLRU:e?.enableLRU??!0,cleanupInterval:e?.cleanupInterval??6e4},this.startCleanup()}set(e,t,r){const n=Date.now(),o={value:t,expireAt:n+(r??this.config.defaultTTL),createdAt:n,accessCount:0,lastAccessed:n};this.cache.size>=this.config.maxSize&&!this.cache.has(e)&&this.evictLRU(),this.cache.set(e,o)}get(e){const t=this.cache.get(e);if(!t)return;const r=Date.now();if(!(r>t.expireAt))return t.accessCount++,t.lastAccessed=r,t.value;this.cache.delete(e)}has(e){const t=this.cache.get(e);return!!t&&(!(Date.now()>t.expireAt)||(this.cache.delete(e),!1))}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}size(){return this.cache.size}keys(){return Array.from(this.cache.keys())}getInfo(e){const t=this.cache.get(e);if(t){if(!(Date.now()>t.expireAt))return{...t};this.cache.delete(e)}}touch(e,t){const r=this.cache.get(e);if(!r)return!1;const n=Date.now();if(n>r.expireAt)return this.cache.delete(e),!1;const o=t??this.config.defaultTTL;return r.expireAt=n+o,r.lastAccessed=n,!0}async getOrSet(e,t,r){const n=this.get(e);if(void 0!==n)return n;const o=await t();return this.set(e,o,r),o}mset(e,t){for(const[r,n]of e)this.set(r,n,t)}mget(e){return e.map(e=>this.get(e))}mdel(e){let t=0;for(const r of e)this.delete(r)&&t++;return t}getStats(){let e=0,t=0;const r=Date.now();for(const[n,o]of this.cache.entries())e+=o.accessCount,r>o.expireAt&&t++;return{size:this.cache.size,maxSize:this.config.maxSize,hitRate:e>0?(e-t)/e:0,totalAccess:e,expiredCount:t}}cleanup(){const e=Date.now();let t=0;for(const[r,n]of this.cache.entries())e>n.expireAt&&(this.cache.delete(r),t++);return t}evictLRU(){if(!this.config.enableLRU||0===this.cache.size)return;let e=null,t=1/0;for(const[r,n]of this.cache.entries())n.lastAccessed<t&&(t=n.lastAccessed,e=r);e&&this.cache.delete(e)}startCleanup(){this.cleanupTimer&&clearInterval(this.cleanupTimer),this.cleanupTimer=setInterval(()=>{this.cleanup()},this.config.cleanupInterval)}stopCleanup(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0)}updateConfig(e){if(this.config={...this.config,...e},void 0!==e.cleanupInterval&&this.startCleanup(),void 0!==e.maxSize&&this.cache.size>e.maxSize)for(;this.cache.size>e.maxSize;)this.evictLRU()}destroy(){this.stopCleanup(),this.clear()}}var x,A,D,L;!function(e){e.USER_ERROR="USER_ERROR",e.SYSTEM_ERROR="SYSTEM_ERROR",e.NETWORK_ERROR="NETWORK_ERROR",e.PERMISSION_ERROR="PERMISSION_ERROR",e.CONFIG_ERROR="CONFIG_ERROR",e.TIMEOUT_ERROR="TIMEOUT_ERROR",e.VALIDATION_ERROR="VALIDATION_ERROR",e.INTERNAL_ERROR="INTERNAL_ERROR",e.UNKNOWN_ERROR="UNKNOWN_ERROR"}(x||(x={})),function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(A||(A={}));class Logger{constructor(e="Core",t){this.level=A.INFO,this.logs=[],this.maxLogs=1e3,this.enableConsole=!0,this.module=e,t&&(this.level=t.level??A.INFO,this.maxLogs=t.maxLogs??1e3,this.enableConsole=t.enableConsole??!0)}setLevel(e){this.level=e}getLevel(){return this.level}debug(e,t){this.log(A.DEBUG,e,t)}info(e,t){this.log(A.INFO,e,t)}warn(e,t){this.log(A.WARN,e,t)}error(e,t){this.log(A.ERROR,e,t)}log(e,t,r){if(e<this.level)return;const n={level:e,message:t,timestamp:Date.now(),module:this.module,data:r};this.logs.push(n),this.logs.length>this.maxLogs&&this.logs.shift(),this.enableConsole&&this.outputToConsole(n)}outputToConsole(e){new Date(e.timestamp).toISOString(),A[e.level],e.module,e.message,void 0!==e.data&&e.data;switch(e.level){case A.DEBUG:case A.INFO:case A.WARN:case A.ERROR:}}getLogs(){return[...this.logs]}getLogsByLevel(e){return this.logs.filter(t=>t.level===e)}getLogsByTimeRange(e,t){return this.logs.filter(r=>r.timestamp>=e&&r.timestamp<=t)}clear(){this.logs=[]}setMaxLogs(e){if(e<0)throw new Error("Max logs must be non-negative");this.maxLogs=e,this.logs.length>e&&(this.logs=this.logs.slice(-e))}setConsoleOutput(e){this.enableConsole=e}exportLogs(){return JSON.stringify(this.logs,null,2)}importLogs(e){try{const t=JSON.parse(e);Array.isArray(t)&&(this.logs=t.filter(e=>e&&"number"==typeof e.level&&"string"==typeof e.message&&"number"==typeof e.timestamp))}catch(e){this.error("Failed to import logs",e)}}createChild(e){return new Logger(`${this.module}.${e}`,{level:this.level,maxLogs:this.maxLogs,enableConsole:this.enableConsole})}}!function(e){e.USER_ERROR="USER_ERROR",e.SYSTEM_ERROR="SYSTEM_ERROR",e.NETWORK_ERROR="NETWORK_ERROR",e.PERMISSION_ERROR="PERMISSION_ERROR",e.CONFIG_ERROR="CONFIG_ERROR",e.VALIDATION_ERROR="VALIDATION_ERROR",e.TIMEOUT_ERROR="TIMEOUT_ERROR",e.UNSUPPORTED_ERROR="UNSUPPORTED_ERROR",e.INTERNAL_ERROR="INTERNAL_ERROR",e.EXTERNAL_ERROR="EXTERNAL_ERROR",e.UNKNOWN_ERROR="UNKNOWN_ERROR"}(D||(D={})),function(e){e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e.CRITICAL="critical"}(L||(L={}));class U extends Error{constructor(e,t,r){super(t),this.name="CustomError",this.type=e,this.code=r?.code,this.context=r?.context,this.recoverable=r?.recoverable??!1,r?.cause&&(this.cause=r.cause),Error.captureStackTrace&&Error.captureStackTrace(this,U)}}class ErrorHandler{constructor(e){this.errorSolutions=new Map,this.logger=e||new Logger("ErrorHandler"),this.initializeErrorSolutions()}handleError(e,t){const r=this.classifyError(e),n={module:"Unknown",method:"Unknown",timestamp:Date.now(),userAgent:"undefined"!=typeof navigator?navigator.userAgent:"Node.js",...t},o={type:r,severity:this.getErrorSeverity(r),message:e.message,userMessage:this.getUserFriendlyMessage(e,r),originalError:e,context:n,code:this.getErrorCode(e)||this.generateErrorCode(r),recoverable:this.isRecoverableError(e),solutions:this.getErrorSolutions(e),id:this.generateErrorId(),processedAt:Date.now(),relatedErrors:[]};return this.logger.error(`[${r}] ${o.message}`,{error:e.message,stack:e.stack,context:n,recoverable:o.recoverable}),o}createError(e,t,r){const n={module:"Unknown",method:"Unknown",timestamp:Date.now(),userAgent:"undefined"!=typeof navigator?navigator.userAgent:"Node.js",...r?.context};return new U(e,t,{code:r?.code,context:n,recoverable:r?.recoverable,cause:r?.cause})}isRecoverableError(e){if(e instanceof U)return e.recoverable;switch(this.classifyError(e)){case D.NETWORK_ERROR:case D.TIMEOUT_ERROR:return!0;case D.PERMISSION_ERROR:case D.SYSTEM_ERROR:return!1;case D.USER_ERROR:case D.CONFIG_ERROR:return!0;default:return!1}}getErrorSolution(e){const t=this.getErrorCode(e);if(t&&this.errorSolutions.has(t))return this.errorSolutions.get(t);const r=this.classifyError(e);return this.getDefaultSolution(r)}getErrorSolutions(e){const t=this.getErrorSolution(e);return t?[{description:t,steps:[t],automatic:!1,priority:1}]:[]}getErrorSeverity(e){switch(e){case D.USER_ERROR:case D.CONFIG_ERROR:return L.LOW;case D.NETWORK_ERROR:case D.TIMEOUT_ERROR:return L.MEDIUM;case D.PERMISSION_ERROR:case D.VALIDATION_ERROR:return L.HIGH;case D.SYSTEM_ERROR:case D.INTERNAL_ERROR:return L.CRITICAL;default:return L.MEDIUM}}generateErrorCode(e){return`${e}_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,5)}`.toUpperCase()}generateErrorId(){return`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}addErrorSolution(e,t){this.errorSolutions.set(e,t)}addErrorSolutions(e){for(const[t,r]of Object.entries(e))this.errorSolutions.set(t,r)}classifyError(e){if(e instanceof U)return e.type;const t=(e.message||"").toLowerCase(),r=(e.name||"").toLowerCase();return t.includes("network")||t.includes("fetch")||t.includes("xhr")||r.includes("networkerror")?D.NETWORK_ERROR:t.includes("timeout")||t.includes("timed out")||r.includes("timeouterror")?D.TIMEOUT_ERROR:t.includes("permission")||t.includes("denied")||t.includes("unauthorized")||t.includes("forbidden")||r.includes("notallowederror")?D.PERMISSION_ERROR:t.includes("not supported")||t.includes("not available")||t.includes("not implemented")||r.includes("notsupportederror")?D.SYSTEM_ERROR:t.includes("invalid")||t.includes("configuration")||t.includes("config")||r.includes("configerror")?D.CONFIG_ERROR:e instanceof TypeError||e instanceof RangeError||t.includes("invalid argument")||t.includes("invalid parameter")?D.USER_ERROR:D.UNKNOWN_ERROR}getUserFriendlyMessage(e,t){switch(t){case D.NETWORK_ERROR:return"网络连接失败,请检查网络连接后重试";case D.TIMEOUT_ERROR:return"操作超时,请稍后重试";case D.PERMISSION_ERROR:return"权限不足,请检查浏览器权限设置";case D.SYSTEM_ERROR:return"当前浏览器不支持此功能,请使用其他浏览器或升级浏览器版本";case D.CONFIG_ERROR:return"配置参数错误,请检查配置";case D.USER_ERROR:return"输入参数错误,请检查输入参数";default:return e.message||"发生未知错误"}}getErrorCode(e){if(e instanceof U)return e.code;const t=e;return t.code||t.errno||void 0}getDefaultSolution(e){switch(e){case D.NETWORK_ERROR:return"请检查网络连接,确保网络正常后重试";case D.TIMEOUT_ERROR:return"请稍后重试,或增加超时时间设置";case D.PERMISSION_ERROR:return"请在浏览器设置中允许相关权限,或使用HTTPS协议";case D.SYSTEM_ERROR:return"请使用支持此功能的现代浏览器,或升级浏览器版本";case D.CONFIG_ERROR:return"请检查配置参数是否正确,参考文档进行配置";case D.USER_ERROR:return"请检查输入参数的类型和格式是否正确";default:return null}}initializeErrorSolutions(){this.errorSolutions.set("ENOTFOUND","域名解析失败,请检查网络连接"),this.errorSolutions.set("ECONNREFUSED","连接被拒绝,请检查服务器状态"),this.errorSolutions.set("ETIMEDOUT","连接超时,请检查网络连接或稍后重试"),this.errorSolutions.set("CERT_UNTRUSTED","SSL证书不受信任,请检查证书配置"),this.errorSolutions.set("MIXED_CONTENT","混合内容错误,请使用HTTPS协议")}}class M{constructor(e={}){this.VENDOR_PREFIXES=["","webkit","moz","ms","o"],this.CSS_PREFIXES=["","-webkit-","-moz-","-ms-","-o-"],this.browserInfo=null,this.config={enableCache:!0,cacheTimeout:3e5,debug:!1,customPrefixes:[],...e},this.cache=new Cache({maxSize:200,defaultTTL:this.config.cacheTimeout,enableLRU:!0}),this.logger=new Logger("BrowserAdapter",{level:this.config.debug?0:2,enableConsole:this.config.debug}),this.errorHandler=new ErrorHandler}isSupported(e){return this.detectFeature(e).supported}getPrefixedProperty(e){const t=this.detectFeature(e,"property");return t.supported?t.prefixedName||e:null}getPrefixedMethod(e,t=window){const r=this.detectFeature(e,"method",t);if(!r.supported)return null;return t[r.prefixedName||e]||null}getPrefixedCSSProperty(e){const t=this.detectFeature(e,"css");return t.supported?t.prefixedName||e:null}detectFeature(e,t="property",r=null){const n=`${e}_${t}_${r?"custom":"default"}`;if(this.config.enableCache){const t=this.cache.get(n);if(t)return this.logger.debug(`Feature detection cache hit: ${e}`),t}let o;try{switch(t){case"property":default:o=this.detectProperty(e);break;case"method":o=this.detectMethod(e,null===r?null:r||window);break;case"css":o=this.detectCSSProperty(e);break;case"api":o=this.detectAPI(e);break;case"custom":o=this.detectCustomFeature(e,r)}return o.timestamp=Date.now(),this.config.enableCache&&this.cache.set(n,o),this.logger.debug(`Feature detection result for ${e}:`,o),o}catch(n){const o={module:"BrowserAdapter",method:"detectFeature",input:{feature:e,method:t,target:r},timestamp:Date.now()};return this.errorHandler.handleError(n,o),{supported:!1,method:t,timestamp:Date.now()}}}detectProperty(e){const t=[document.documentElement.style,window,document,navigator];for(const r of t)if(e in r)return{supported:!0,method:"property",timestamp:Date.now()};const r=[...this.VENDOR_PREFIXES.slice(1),...this.config.customPrefixes];for(const n of r){const r=this.getPrefixedName(e,n);for(const e of t)if(r in e)return{supported:!0,prefixedName:r,prefix:n,method:"property",timestamp:Date.now()}}return{supported:!1,method:"property",timestamp:Date.now()}}detectMethod(e,t){if(!t||"object"!=typeof t)return{supported:!1,method:"method",timestamp:Date.now()};if("function"==typeof t[e])return{supported:!0,method:"method",timestamp:Date.now()};const r=[...this.VENDOR_PREFIXES.slice(1),...this.config.customPrefixes];for(const n of r){const r=this.getPrefixedName(e,n);if("function"==typeof t[r])return{supported:!0,prefixedName:r,prefix:n,method:"method",timestamp:Date.now()}}return{supported:!1,method:"method",timestamp:Date.now()}}detectCSSProperty(e){const t=document.createElement("div").style;if(e in t)return{supported:!0,method:"css",timestamp:Date.now()};for(const r of this.CSS_PREFIXES.slice(1)){const n=`${r}${e}`;if(n in t)return{supported:!0,prefixedName:n,prefix:r.replace(/-/g,""),method:"css",timestamp:Date.now()}}try{if(t.setProperty(e,"initial"),t.getPropertyValue(e))return{supported:!0,method:"css",timestamp:Date.now()}}catch{}return{supported:!1,method:"css",timestamp:Date.now()}}detectAPI(e){const t=[e,`window.${e}`,`navigator.${e}`,`document.${e}`];for(const e of t)try{if(void 0!==this.getNestedProperty(window,e))return{supported:!0,method:"api",timestamp:Date.now()}}catch{continue}return{supported:!1,method:"api",timestamp:Date.now()}}detectCustomFeature(e,t){try{let e=!1;return"function"==typeof t?e=t():"boolean"==typeof t?e=t:t&&"function"==typeof t.test&&(e=t.test()),{supported:e,method:"custom",timestamp:Date.now()}}catch{return{supported:!1,method:"custom",timestamp:Date.now()}}}getPrefixedName(e,t){return t?`${t}${e.charAt(0).toUpperCase()}${e.slice(1)}`:e}getNestedProperty(e,t){return t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,e)}getBrowserInfo(){if(this.browserInfo)return this.browserInfo;const e=navigator.userAgent,t={name:"Unknown",version:"0.0.0",engine:"Unknown",mobile:!1,os:"Unknown"};if(e.includes("Chrome")){t.name="Chrome",t.engine="Blink";const r=e.match(/Chrome\/(\d+\.\d+)/);r&&(t.version=r[1])}else if(e.includes("Firefox")){t.name="Firefox",t.engine="Gecko";const r=e.match(/Firefox\/(\d+\.\d+)/);r&&(t.version=r[1])}else if(e.includes("Safari")&&!e.includes("Chrome")){t.name="Safari",t.engine="WebKit";const r=e.match(/Version\/(\d+\.\d+)/);r&&(t.version=r[1])}else if(e.includes("Edge")){t.name="Edge",t.engine="Blink";const r=e.match(/Edge\/(\d+\.\d+)/);r&&(t.version=r[1])}return t.mobile=/Mobile|Android|iPhone|iPad/.test(e),e.includes("Windows")?t.os="Windows":e.includes("Mac")?t.os="macOS":e.includes("Linux")?t.os="Linux":e.includes("Android")?t.os="Android":(e.includes("iPhone")||e.includes("iPad"))&&(t.os="iOS"),this.browserInfo=t,t}addEventListenerCompat(e,t,r,n){if(e.addEventListener)return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n);const o=e;if(o.attachEvent){const n=t=>{!t.target&&t.srcElement&&Object.defineProperty(t,"target",{value:t.srcElement,writable:!1,enumerable:!0,configurable:!0}),t.preventDefault=t.preventDefault||(()=>{t.returnValue=!1}),t.stopPropagation=t.stopPropagation||(()=>{t.cancelBubble=!0}),r.call(e,t)};return o.attachEvent(`on${t}`,n),()=>o.detachEvent(`on${t}`,n)}const s=`on${t}`,i=e[s];return e[s]=t=>{i&&i.call(e,t),r.call(e,t)},()=>{e[s]=i}}clearCache(){this.cache.clear(),this.browserInfo=null,this.logger.info("Browser adapter cache cleared")}getCacheStats(){const e=this.cache.getStats();return{size:this.cache.size(),hitRate:e.hitRate,maxSize:e.maxSize}}destroy(){this.clearCache(),this.logger.info("Browser adapter destroyed")}}let P=null;function F(e){return P||(P=new M(e)),P}export{R as addEventListener,v as appendElements,S as batchDOMOperations,i as checkBrowserSupport,E as createCustomEvent,w as createDocumentFragment,g as delegate,p as dispatchCustomEvent,b as flushBatchedOperations,F as getBrowserAdapter,n as getElement,o as getElements,c as getPrefixedCSSProperty,d as getPrefixedProperty,r as isDocument,e as isElement,_ as isElementInViewport,t as isHTMLElement,l as isSupported,T as measureElement,y as ready,m as removeAllEventListeners,f as removeEventListener,N as setAttributes,I as setStyles,a as supportsCSSFeature,u as supportsHTML5Feature,C as waitForElement};