import{isBrowser as r}from"../../is-in-browser/dist/module.js";import e from"../../@babel/runtime/helpers/esm/toConsumableArray.js";var t="",n="",o="",i="",s=r&&"ontouchstart"in document.documentElement;if(r){var u={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},l=document.createElement("p").style;for(var p in u)if(p+"Transform"in l){t=p,n=u[p];break}"Webkit"===t&&"msHyphens"in l&&(t="ms",n=u.ms,i="edge"),"Webkit"===t&&"-apple-trailing-word"in l&&(o="apple")}var a={js:t,css:n,vendor:o,browser:i,isTouch:s};function f(r){return"-"===r[1]||"ms"===a.js?r:"@"+a.css+"keyframes"+r.substr(10)}var c={noPrefill:["appearance"],supportedProperty:function(r){return"appearance"===r&&("ms"===a.js?"-webkit-"+r:a.css+r)}},m={noPrefill:["color-adjust"],supportedProperty:function(r){return"color-adjust"===r&&("Webkit"===a.js?a.css+"print-"+r:r)}},d=/[-\s]+(.)?/g;function y(r,e){return e?e.toUpperCase():""}function b(r){return r.replace(d,y)}function v(r){return b("-"+r)}var x,j={noPrefill:["mask"],supportedProperty:function(r,e){if(!/^mask/.test(r))return!1;if("Webkit"===a.js){var t="mask-image";if(b(t)in e)return r;if(a.js+v(t)in e)return a.css+r}return r}},k={noPrefill:["text-orientation"],supportedProperty:function(r){return"text-orientation"===r&&("apple"!==a.vendor||a.isTouch?r:a.css+r)}},P={noPrefill:["transform"],supportedProperty:function(r,e,t){return"transform"===r&&(t.transform?r:a.css+r)}},g={noPrefill:["transition"],supportedProperty:function(r,e,t){return"transition"===r&&(t.transition?r:a.css+r)}},w={noPrefill:["writing-mode"],supportedProperty:function(r){return"writing-mode"===r&&("Webkit"===a.js||"ms"===a.js&&"edge"!==a.browser?a.css+r:r)}},h={noPrefill:["user-select"],supportedProperty:function(r){return"user-select"===r&&("Moz"===a.js||"ms"===a.js||"apple"===a.vendor?a.css+r:r)}},E={supportedProperty:function(r,e){return!!/^break-/.test(r)&&("Webkit"===a.js?"WebkitColumn"+v(r)in e&&a.css+"column-"+r:"Moz"===a.js&&("page"+v(r)in e&&"page-"+r))}},W={supportedProperty:function(r,e){if(!/^(border|margin|padding)-inline/.test(r))return!1;if("Moz"===a.js)return r;var t=r.replace("-inline","");return a.js+v(t)in e&&a.css+t}},N={supportedProperty:function(r,e){return b(r)in e&&r}},z={supportedProperty:function(r,e){var t=v(r);return"-"===r[0]||"-"===r[0]&&"-"===r[1]?r:a.js+t in e?a.css+r:"Webkit"!==a.js&&"Webkit"+t in e&&"-webkit-"+r}},O={supportedProperty:function(r){return"scroll-snap"===r.substring(0,11)&&("ms"===a.js?""+a.css+r:r)}},C={supportedProperty:function(r){return"overscroll-behavior"===r&&("ms"===a.js?a.css+"scroll-chaining":r)}},M={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},A={supportedProperty:function(r,e){var t=M[r];return!!t&&(a.js+v(t)in e&&a.css+t)}},T={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},D=Object.keys(T),V=function(r){return a.css+r},_=[c,m,j,k,P,g,w,h,E,W,N,z,O,C,A,{supportedProperty:function(r,e,t){var n=t.multiple;if(D.indexOf(r)>-1){var o=T[r];if(!Array.isArray(o))return a.js+v(o)in e&&a.css+o;if(!n)return!1;for(var i=0;i<o.length;i++)if(!(a.js+v(o[0])in e))return!1;return o.map(V)}return!1}}],H=_.filter((function(r){return r.supportedProperty})).map((function(r){return r.supportedProperty})),I=_.filter((function(r){return r.noPrefill})).reduce((function(r,t){return r.push.apply(r,e(t.noPrefill)),r}),[]),S={};if(r){x=document.createElement("p");var U=window.getComputedStyle(document.documentElement,"");for(var q in U)isNaN(q)||(S[U[q]]=U[q]);I.forEach((function(r){return delete S[r]}))}function B(r,e){if(void 0===e&&(e={}),!x)return r;if("benchmark"!==process.env.NODE_ENV&&null!=S[r])return S[r];"transition"!==r&&"transform"!==r||(e[r]=r in x.style);for(var t=0;t<H.length&&(S[r]=H[t](r,x.style,e),!S[r]);t++);try{x.style[r]=""}catch(r){return!1}return S[r]}var F,G={},J={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},K=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function L(r,e,t){if("var"===e)return"var";if("all"===e)return"all";if("all"===t)return", all";var n=e?B(e):", "+B(t);return n||(e||t)}function Q(r,e){var t=e;if(!F||"content"===r)return e;if("string"!=typeof t||!isNaN(parseInt(t,10)))return t;var n=r+t;if("benchmark"!==process.env.NODE_ENV&&null!=G[n])return G[n];try{F.style[r]=t}catch(r){return G[n]=!1,!1}if(J[r])t=t.replace(K,L);else if(""===F.style[r]&&("-ms-flex"===(t=a.css+t)&&(F.style[r]="-ms-flexbox"),F.style[r]=t,""===F.style[r]))return G[n]=!1,!1;return F.style[r]="",G[n]=t,G[n]}r&&(F=document.createElement("p"));export{a as prefix,f as supportedKeyframes,B as supportedProperty,Q as supportedValue};
//# sourceMappingURL=css-vendor.esm.js.map
