text: !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).plainreceipt=n()}(this,function(){"use strict";var u=function(t,n){for(var r="",e=0;e<n;e++)r+=t;return r},c=function(t,n,r){return r(t)};function i(t,n,r,e){var i=n.max_character,o=n.space_character,n=n.near_space_by_position,a=void 0===n?0:n;void 0===r&&(r=c),void 0===e&&(e="left");var f=i-t.map(function(t){return("string"==typeof t?t:t.toString()).length}).reduce(function(t,n){return t+n},0)-a;t[0],u(o,"left"===e?a:f),t[1],u(o,"right"===e?a:f),t[2];return r([t[0],t[1],t[2]],f,function(t){var n=t[0],r=t[1],t=t[2];return[n,u(o,"left"===e?a:f),r,u(o,"right"===e?a:f),t]}).join("")}return function(e){return{loopingText:function(t,n){return void 0===n&&(n=e.max_character),u(t,n)},centerPosition:function(t){return n=t,t=(r=e).max_character,r=e.space_character,(t=t-("string"==typeof n?n:n.toString()).length)<=1?"string"==typeof n?n:n.toString():[u(r,(t-t%2)/2),n].join("");var n,r},justifyContent:function(t,n){return function(t,n,r){var e=void 0===(e=n.near_space_by_position)?0:e,i=n.max_character,o=n.space_character;if(void 0===r&&(r="left"),n=t.map(function(t){var n=t[0],t=t[1];return[("string"==typeof n?n:n.toString()).length,("string"==typeof t?t:t.toString()).length]}),"left"===r){var r=n.map(function(t){return t[0]}),a=Math.max.apply(Math,r)+e;return t.map(function(t){var n=t[0],t=t[1];return"[:divider]"===n?u("string"==typeof t?t:t.toString(),i):n+u(o,"string"==typeof n?a-n.length:a-n.toString().length)+t}).join("\n")}var n=n.map(function(t){return t[0],t[1]}),f=Math.max.apply(Math,n)+e;return t.map(function(t){var n=t[0],t=t[1];return"[:divider]"===n?u("string"==typeof t?t:t.toString(),i):n+u(o,"string"==typeof t?f-t.length:f-t.toString().length)+t}).map(function(t){return(1<=i-t.length?u(o,i-t.length):"")+t}).join("\n")}(t,e,n)},spaceBetween:function(t,n,r){return"function"==typeof n?i(t,e,n):void 0!==r&&"string"==typeof n?i(t,e,r,n):i(t,e)},convertString:function(t){return 1<=t.length?t.join("\n"):""}}}});