"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.safeJsonParse=exports.safeSlugify=exports.encodeBackSlashes=exports.unescapeFormId=exports.escapeFormId=exports.strikethroughText=void 0;const slugify_1=__importDefault(require("slugify"));function strikethroughText(e){return e.split("").map((e=>e+"̵")).join("")}function escapeFormId(e){return e.replace(/[.[\]]/g,(e=>({".":"%2e","[":"%5b","]":"%5d"}[e]||"")))}function unescapeFormId(e){return e.replace(/%2e|%5b|%5d/g,(e=>({"%2e":".","%5b":"[","%5d":"]"}[e]||"")))}function encodeBackSlashes(e){return e.replace(/\\/g,"%5C")}function safeSlugify(e){return(0,slugify_1.default)(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function safeJsonParse(e,r={}){try{return JSON.parse(e)}catch(e){return r}}exports.strikethroughText=strikethroughText,exports.escapeFormId=escapeFormId,exports.unescapeFormId=unescapeFormId,exports.encodeBackSlashes=encodeBackSlashes,exports.safeSlugify=safeSlugify,exports.safeJsonParse=safeJsonParse;
//# sourceMappingURL=string.js.map