{
  "version": 3,
  "sources": ["../src/toggle-format.js"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { speak } from '@wordpress/a11y';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport { getActiveFormat } from './get-active-format';\nimport { removeFormat } from './remove-format';\nimport { applyFormat } from './apply-format';\n\n/** @typedef {import('./types').RichTextValue} RichTextValue */\n/** @typedef {import('./types').RichTextFormat} RichTextFormat */\n\n/**\n * Toggles a format object to a Rich Text value at the current selection.\n *\n * @param {RichTextValue}  value  Value to modify.\n * @param {RichTextFormat} format Format to apply or remove.\n *\n * @return {RichTextValue} A new value with the format applied or removed.\n */\nexport function toggleFormat( value, format ) {\n\tif ( getActiveFormat( value, format.type ) ) {\n\t\t// For screen readers, will announce if formatting control is disabled.\n\t\tif ( format.title ) {\n\t\t\t// translators: %s: title of the formatting control\n\t\t\tspeak( sprintf( __( '%s removed.' ), format.title ), 'assertive' );\n\t\t}\n\t\treturn removeFormat( value, format.type );\n\t}\n\t// For screen readers, will announce if formatting control is enabled.\n\tif ( format.title ) {\n\t\t// translators: %s: title of the formatting control\n\t\tspeak( sprintf( __( '%s applied.' ), format.title ), 'assertive' );\n\t}\n\treturn applyFormat( value, format );\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAsB;AACtB,kBAA4B;AAM5B,+BAAgC;AAChC,2BAA6B;AAC7B,0BAA4B;AAarB,SAAS,aAAc,OAAO,QAAS;AAC7C,UAAK,0CAAiB,OAAO,OAAO,IAAK,GAAI;AAE5C,QAAK,OAAO,OAAQ;AAEnB,iCAAO,yBAAS,gBAAI,aAAc,GAAG,OAAO,KAAM,GAAG,WAAY;AAAA,IAClE;AACA,eAAO,mCAAc,OAAO,OAAO,IAAK;AAAA,EACzC;AAEA,MAAK,OAAO,OAAQ;AAEnB,+BAAO,yBAAS,gBAAI,aAAc,GAAG,OAAO,KAAM,GAAG,WAAY;AAAA,EAClE;AACA,aAAO,iCAAa,OAAO,MAAO;AACnC;",
  "names": []
}
