var __create = Object.create; var __defProp = Object.defineProperty; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); var __export = (target, all) => { __markAsModule(target); for (var name in all) __defProp(target, name, {get: all[name], enumerable: true}); }; var __exportStar = (target, module2, desc) => { __markAsModule(target); if (module2 && typeof module2 === "object" || typeof module2 === "function") { for (let key of __getOwnPropNames(module2)) if (!__hasOwnProp.call(target, key) && key !== "default") __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); } return target; }; var __toModule = (module2) => { if (module2 && module2.__esModule) return module2; return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2); }; // index.ts __export(exports, { aspectRatio: () => aspectRatio }); var import_twind = __toModule(require("twind")); var aspectRatioCalc = () => ({ paddingBottom: `calc(var(--tw-aspect-h)/var(--tw-aspect-w)*100%)` }); var aspectRatio$ = (ratio, {theme, tag}) => ratio === "none" ? import_twind.apply`static pb-0 children:(static h-auto w-auto inset-auto)` : { "--tw-aspect-w": ratio.w && ratio.w !== "ratio" && theme("aspectRatio", "" + ratio.w, "" + ratio.w), "--tw-aspect-h": ratio.h && theme("aspectRatio", "" + ratio.h, "" + ratio.h), _: ratio.h && ratio.w !== "ratio" ? tag("aspect-ratio") : void 0, ":global": { ["." + tag("aspect-ratio")]: import_twind.apply`relative ${aspectRatioCalc} children:(absolute h-full w-full inset-0)` } }; var aspectRatio = (ratio, context) => { if (Array.isArray(ratio)) { switch (ratio[0]) { case "w": return import_twind.directive(aspectRatio$, {w: ratio[1]}); case "h": return import_twind.directive(aspectRatio$, {h: ratio[1]}); case "none": return import_twind.directive(aspectRatio$, ratio[0]); default: { if (ratio.length === 1) { ratio = ratio[0].split("/"); } return import_twind.directive(aspectRatio$, {w: ratio[0], h: ratio[1]}); } } } if (ratio === "none") { return import_twind.directive(aspectRatio$, ratio); } if (typeof ratio === "object") { return import_twind.directive(aspectRatio$, ratio); } if (context !== void 0) { return import_twind.directive(aspectRatio$, {w: ratio, h: context}); } const [w, h] = ratio.split("/"); return import_twind.directive(aspectRatio$, {w, h}); }; //# sourceMappingURL=aspect-ratio.cjs.map