{
  "version": 3,
  "sources": ["../../src/button/utils.js"],
  "sourcesContent": ["/**\n * Returns whether the given width value is a percentage.\n *\n * @param {string} width - The width value.\n * @return {boolean} True if the width is a percentage value.\n */\nexport function isPercentageWidth( width ) {\n\treturn typeof width === 'string' && width.endsWith( '%' );\n}\n\n/**\n * Returns the width classes for the button based on the width attribute.\n *\n * @param {string} width - The width value (e.g., '25%', '50%', '75%', '100%', or custom value).\n * @return {Object} Object with width-related class names as keys and true as values.\n */\nexport function getWidthClasses( width ) {\n\tif ( ! width ) {\n\t\treturn {};\n\t}\n\n\tif ( isPercentageWidth( width ) ) {\n\t\tconst legacyWidthClasses = {\n\t\t\t'25%': 'wp-block-button__width-25',\n\t\t\t'50%': 'wp-block-button__width-50',\n\t\t\t'75%': 'wp-block-button__width-75',\n\t\t\t'100%': 'wp-block-button__width-100',\n\t\t};\n\t\treturn {\n\t\t\t'has-custom-width': true,\n\t\t\t'wp-block-button__width': true,\n\t\t\t// Maintain legacy class for backwards compatibility.\n\t\t\t...( legacyWidthClasses[ width ] && {\n\t\t\t\t[ legacyWidthClasses[ width ] ]: true,\n\t\t\t} ),\n\t\t};\n\t}\n\n\treturn {\n\t\t'has-custom-width': true,\n\t};\n}\n"],
  "mappings": ";AAMO,SAAS,kBAAmB,OAAQ;AAC1C,SAAO,OAAO,UAAU,YAAY,MAAM,SAAU,GAAI;AACzD;AAQO,SAAS,gBAAiB,OAAQ;AACxC,MAAK,CAAE,OAAQ;AACd,WAAO,CAAC;AAAA,EACT;AAEA,MAAK,kBAAmB,KAAM,GAAI;AACjC,UAAM,qBAAqB;AAAA,MAC1B,OAAO;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IACT;AACA,WAAO;AAAA,MACN,oBAAoB;AAAA,MACpB,0BAA0B;AAAA;AAAA,MAE1B,GAAK,mBAAoB,KAAM,KAAK;AAAA,QACnC,CAAE,mBAAoB,KAAM,CAAE,GAAG;AAAA,MAClC;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,oBAAoB;AAAA,EACrB;AACD;",
  "names": []
}
