cliodot 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +2 -0
  3. package/dist/AuthAppClient.d.ts +1 -0
  4. package/dist/AuthAppClient.d.ts.map +1 -1
  5. package/dist/AuthAppClient.js +199 -1
  6. package/dist/CommercialAppClient.d.ts +50 -9
  7. package/dist/CommercialAppClient.d.ts.map +1 -1
  8. package/dist/CommercialAppClient.js +576 -1
  9. package/dist/ConnectorBuilder.js +104 -1
  10. package/dist/Events.d.ts +2 -0
  11. package/dist/Events.d.ts.map +1 -1
  12. package/dist/Events.js +325 -1
  13. package/dist/Flosync.js +296 -1
  14. package/dist/FlosyncClient.js +429 -1
  15. package/dist/FunctionBuilder.js +65 -1
  16. package/dist/IdentityAppClient.d.ts +1 -0
  17. package/dist/IdentityAppClient.d.ts.map +1 -1
  18. package/dist/IdentityAppClient.js +197 -1
  19. package/dist/MemoryAppClient.d.ts +1 -0
  20. package/dist/MemoryAppClient.d.ts.map +1 -1
  21. package/dist/MemoryAppClient.js +149 -1
  22. package/dist/MemoryClient.js +20 -1
  23. package/dist/OAuthAppClient.d.ts +1 -0
  24. package/dist/OAuthAppClient.d.ts.map +1 -1
  25. package/dist/OAuthAppClient.js +269 -1
  26. package/dist/ProviderServicesClient.d.ts +24 -0
  27. package/dist/ProviderServicesClient.d.ts.map +1 -0
  28. package/dist/ProviderServicesClient.js +158 -0
  29. package/dist/Surface.d.ts +2 -0
  30. package/dist/Surface.d.ts.map +1 -1
  31. package/dist/Surface.js +255 -1
  32. package/dist/ValidatorBuilder.js +24 -1
  33. package/dist/Webhooks.js +61 -1
  34. package/dist/WorkflowBuilder.js +279 -1
  35. package/dist/__tests__/CommercialAppClient.test.d.ts +2 -0
  36. package/dist/__tests__/CommercialAppClient.test.d.ts.map +1 -0
  37. package/dist/__tests__/CommercialAppClient.test.js +217 -0
  38. package/dist/__tests__/Events.test.js +191 -1
  39. package/dist/__tests__/IdentityAppClient.test.js +232 -1
  40. package/dist/__tests__/OAuthAppClient.test.js +300 -1
  41. package/dist/__tests__/ProviderServicesClient.test.d.ts +2 -0
  42. package/dist/__tests__/ProviderServicesClient.test.d.ts.map +1 -0
  43. package/dist/__tests__/ProviderServicesClient.test.js +131 -0
  44. package/dist/__tests__/Surface.test.js +150 -1
  45. package/dist/__tests__/errors.test.js +54 -1
  46. package/dist/__tests__/function.test.js +58 -1
  47. package/dist/__tests__/helpers.d.ts +5 -0
  48. package/dist/__tests__/helpers.d.ts.map +1 -0
  49. package/dist/__tests__/helpers.js +10 -0
  50. package/dist/__tests__/localhost-lookup.test.d.ts +2 -0
  51. package/dist/__tests__/localhost-lookup.test.d.ts.map +1 -0
  52. package/dist/__tests__/localhost-lookup.test.js +26 -0
  53. package/dist/__tests__/parse-api-error.test.js +26 -1
  54. package/dist/__tests__/runner.test.js +156 -1
  55. package/dist/connectors/builtin.js +354 -1
  56. package/dist/connectors/registry.js +300 -1
  57. package/dist/decorators/build.js +105 -1
  58. package/dist/decorators/connector.js +56 -1
  59. package/dist/decorators/index.js +34 -1
  60. package/dist/decorators/metadata.js +338 -1
  61. package/dist/decorators/steps.js +220 -1
  62. package/dist/decorators/workflow.js +52 -1
  63. package/dist/errors.js +76 -1
  64. package/dist/http/__tests__/cliodot-request.environment.test.d.ts +2 -0
  65. package/dist/http/__tests__/cliodot-request.environment.test.d.ts.map +1 -0
  66. package/dist/http/__tests__/cliodot-request.environment.test.js +37 -0
  67. package/dist/http/__tests__/cliodot-result.test.d.ts +2 -0
  68. package/dist/http/__tests__/cliodot-result.test.d.ts.map +1 -0
  69. package/dist/http/__tests__/cliodot-result.test.js +57 -0
  70. package/dist/http/__tests__/events-instance-id.test.d.ts +2 -0
  71. package/dist/http/__tests__/events-instance-id.test.d.ts.map +1 -0
  72. package/dist/http/__tests__/events-instance-id.test.js +45 -0
  73. package/dist/http/cliodot-request.d.ts +35 -0
  74. package/dist/http/cliodot-request.d.ts.map +1 -0
  75. package/dist/http/cliodot-request.js +105 -0
  76. package/dist/http/cliodot-result.d.ts +40 -0
  77. package/dist/http/cliodot-result.d.ts.map +1 -0
  78. package/dist/http/cliodot-result.js +139 -0
  79. package/dist/http/create-client.d.ts +3 -0
  80. package/dist/http/create-client.d.ts.map +1 -0
  81. package/dist/http/create-client.js +14 -0
  82. package/dist/http/events-instance-id.d.ts +11 -0
  83. package/dist/http/events-instance-id.d.ts.map +1 -0
  84. package/dist/http/events-instance-id.js +86 -0
  85. package/dist/http/localhost-lookup.d.ts +12 -0
  86. package/dist/http/localhost-lookup.d.ts.map +1 -0
  87. package/dist/http/localhost-lookup.js +67 -0
  88. package/dist/http/parse-api-error.js +56 -1
  89. package/dist/http/sanitize-execution-headers.js +79 -1
  90. package/dist/identity-offline-verify.js +174 -1
  91. package/dist/identity-token-cache.js +51 -1
  92. package/dist/index.d.ts +1 -1
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +108 -1
  95. package/dist/runner/ProcessorEngine.js +1311 -1
  96. package/dist/runner/connector.executor.js +1786 -1
  97. package/dist/runner/utilities/math.executor.js +153 -1
  98. package/dist/runner/utilities/random.executor.js +151 -1
  99. package/dist/runner/utilities/string.executor.js +825 -1
  100. package/dist/template.js +127 -1
  101. package/dist/transformers/StepsToNodesTransformer.js +214 -1
  102. package/dist/transformers/WorkflowTransformer.js +189 -1
  103. package/dist/types/auth-app.api.d.ts +2 -0
  104. package/dist/types/auth-app.api.d.ts.map +1 -1
  105. package/dist/types/auth-app.api.js +2 -1
  106. package/dist/types/builtin.js +2 -1
  107. package/dist/types/client.api.js +2 -1
  108. package/dist/types/commercial-app.api.d.ts +407 -11
  109. package/dist/types/commercial-app.api.d.ts.map +1 -1
  110. package/dist/types/commercial-app.api.js +2 -1
  111. package/dist/types/connector.js +2 -1
  112. package/dist/types/context.js +2 -1
  113. package/dist/types/event-app.api.d.ts +8 -0
  114. package/dist/types/event-app.api.d.ts.map +1 -1
  115. package/dist/types/event-app.api.js +2 -1
  116. package/dist/types/function.js +2 -1
  117. package/dist/types/identity-app.api.d.ts +2 -0
  118. package/dist/types/identity-app.api.d.ts.map +1 -1
  119. package/dist/types/identity-app.api.js +2 -1
  120. package/dist/types/index.js +23 -1
  121. package/dist/types/memory-app.api.d.ts +2 -0
  122. package/dist/types/memory-app.api.d.ts.map +1 -1
  123. package/dist/types/memory-app.api.js +2 -1
  124. package/dist/types/oauth-app.api.d.ts +2 -0
  125. package/dist/types/oauth-app.api.d.ts.map +1 -1
  126. package/dist/types/oauth-app.api.js +105 -1
  127. package/dist/types/provider-services.api.d.ts +98 -0
  128. package/dist/types/provider-services.api.d.ts.map +1 -0
  129. package/dist/types/provider-services.api.js +2 -0
  130. package/dist/types/validator.js +2 -1
  131. package/dist/types/webhook-app.api.js +2 -1
  132. package/dist/types/workflow.js +33 -1
  133. package/dist/validators/validators.js +478 -1
  134. package/dist/variable.js +37 -1
  135. package/package.json +3 -2
@@ -1 +1,825 @@
1
- 'use strict';const _0x7f8abc=_0x78d1;(function(_0x2078bb,_0x2f1e1d){const _0x2a0fe2=_0x78d1,_0x56d39e=_0x2078bb();while(!![]){try{const _0x1416fb=parseInt(_0x2a0fe2(0xe0))/0x1+parseInt(_0x2a0fe2(0xf8))/0x2*(-parseInt(_0x2a0fe2(0xed))/0x3)+parseInt(_0x2a0fe2(0xc0))/0x4+parseInt(_0x2a0fe2(0x94))/0x5+parseInt(_0x2a0fe2(0x113))/0x6+parseInt(_0x2a0fe2(0x12e))/0x7*(-parseInt(_0x2a0fe2(0x101))/0x8)+-parseInt(_0x2a0fe2(0xf9))/0x9;if(_0x1416fb===_0x2f1e1d)break;else _0x56d39e['push'](_0x56d39e['shift']());}catch(_0x310a8c){_0x56d39e['push'](_0x56d39e['shift']());}}}(_0x561e,0x53968));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x7f8abc(0x6a)]=executeString;function _0x78d1(_0x41c57b,_0x2ecc1f){_0x41c57b=_0x41c57b-0x6a;const _0x561e7f=_0x561e();let _0x78d136=_0x561e7f[_0x41c57b];if(_0x78d1['gcQJvU']===undefined){var _0x3b33f6=function(_0x2ef422){const _0x1cd5f6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x51eac2='',_0x4719a9='';for(let _0x2c6851=0x0,_0x4cab93,_0x4bfb9f,_0x45bfd1=0x0;_0x4bfb9f=_0x2ef422['charAt'](_0x45bfd1++);~_0x4bfb9f&&(_0x4cab93=_0x2c6851%0x4?_0x4cab93*0x40+_0x4bfb9f:_0x4bfb9f,_0x2c6851++%0x4)?_0x51eac2+=String['fromCharCode'](0xff&_0x4cab93>>(-0x2*_0x2c6851&0x6)):0x0){_0x4bfb9f=_0x1cd5f6['indexOf'](_0x4bfb9f);}for(let _0x5f142e=0x0,_0x2b942f=_0x51eac2['length'];_0x5f142e<_0x2b942f;_0x5f142e++){_0x4719a9+='%'+('00'+_0x51eac2['charCodeAt'](_0x5f142e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4719a9);};_0x78d1['rpHmRi']=_0x3b33f6,_0x78d1['lTVfSY']={},_0x78d1['gcQJvU']=!![];}const _0x56095a=_0x561e7f[0x0],_0x361997=_0x41c57b+_0x56095a,_0x25331c=_0x78d1['lTVfSY'][_0x361997];return!_0x25331c?(_0x78d136=_0x78d1['rpHmRi'](_0x78d136),_0x78d1['lTVfSY'][_0x361997]=_0x78d136):_0x78d136=_0x25331c,_0x78d136;}const crypto_1=require(_0x7f8abc(0x83));function escapeRegex(_0x51eac2){const _0x133d8c=_0x7f8abc;return _0x51eac2['replace'](/[.*+?^${}()|[\]\\]/g,_0x133d8c(0xa2));}function str(_0x4719a9){if(_0x4719a9===null||_0x4719a9===undefined)return'';return String(_0x4719a9);}function pluralise(_0x2c6851,_0x4cab93=0x2){const _0x174ba3=_0x7f8abc;if(_0x4cab93===0x1)return _0x2c6851;const _0x4bfb9f={'man':_0x174ba3(0xfc),'woman':_0x174ba3(0x104),'child':_0x174ba3(0xa5),'foot':'feet','tooth':_0x174ba3(0xbf),'goose':_0x174ba3(0x73),'mouse':'mice','ox':_0x174ba3(0xd5),'person':'people','leaf':_0x174ba3(0xa4),'life':_0x174ba3(0x9e),'wife':_0x174ba3(0x119),'knife':_0x174ba3(0xfb),'wolf':_0x174ba3(0x12f),'loaf':_0x174ba3(0xfe),'potato':_0x174ba3(0xd7),'tomato':_0x174ba3(0x97),'cactus':_0x174ba3(0xde),'focus':_0x174ba3(0x6e),'fungus':'fungi','nucleus':_0x174ba3(0x117),'syllabus':_0x174ba3(0x10c),'analysis':_0x174ba3(0xbd),'thesis':'theses','crisis':_0x174ba3(0xc3),'phenomenon':'phenomena','criterion':_0x174ba3(0x114),'datum':_0x174ba3(0xc5)},_0x45bfd1=_0x2c6851[_0x174ba3(0x10b)]();if(_0x4bfb9f[_0x45bfd1])return _0x2c6851[0x0]===_0x2c6851[0x0][_0x174ba3(0xd0)]()?_0x4bfb9f[_0x45bfd1][_0x174ba3(0x11a)](0x0)[_0x174ba3(0xd0)]()+_0x4bfb9f[_0x45bfd1][_0x174ba3(0x8b)](0x1):_0x4bfb9f[_0x45bfd1];if(/(?:s|sh|ch|x|z)$/i[_0x174ba3(0xfd)](_0x2c6851))return _0x2c6851+'es';if(/[^aeiou]y$/i['test'](_0x2c6851))return _0x2c6851[_0x174ba3(0x8b)](0x0,-0x1)+_0x174ba3(0x10a);if(/(?:fe?)$/i[_0x174ba3(0xfd)](_0x2c6851))return _0x2c6851[_0x174ba3(0x8d)](/fe?$/,_0x174ba3(0x9f));return _0x2c6851+'s';}function singularise(_0x5f142e){const _0x2db91e=_0x7f8abc,_0x2b942f={'men':'man','women':_0x2db91e(0xb0),'children':_0x2db91e(0x132),'feet':_0x2db91e(0xd2),'teeth':_0x2db91e(0x93),'geese':_0x2db91e(0x7f),'mice':_0x2db91e(0xc4),'oxen':'ox','people':_0x2db91e(0x125),'leaves':_0x2db91e(0xcf),'lives':_0x2db91e(0xa8),'wives':_0x2db91e(0xa7),'knives':_0x2db91e(0x108),'wolves':'wolf','loaves':_0x2db91e(0x9d),'potatoes':_0x2db91e(0x112),'tomatoes':'tomato','cacti':_0x2db91e(0x8e),'foci':_0x2db91e(0xe9),'fungi':_0x2db91e(0x118),'nuclei':_0x2db91e(0x122),'syllabi':'syllabus','analyses':_0x2db91e(0x9a),'theses':_0x2db91e(0x8a),'crises':_0x2db91e(0x12a),'phenomena':'phenomenon','criteria':'criterion','data':_0x2db91e(0x10d)},_0x2af8b3=_0x5f142e[_0x2db91e(0x10b)]();if(_0x2b942f[_0x2af8b3])return _0x5f142e[0x0]===_0x5f142e[0x0][_0x2db91e(0xd0)]()?_0x2b942f[_0x2af8b3]['charAt'](0x0)[_0x2db91e(0xd0)]()+_0x2b942f[_0x2af8b3][_0x2db91e(0x8b)](0x1):_0x2b942f[_0x2af8b3];if(/ies$/i[_0x2db91e(0xfd)](_0x5f142e))return _0x5f142e['slice'](0x0,-0x3)+'y';if(/ves$/i[_0x2db91e(0xfd)](_0x5f142e))return _0x5f142e[_0x2db91e(0x8b)](0x0,-0x3)+'fe';if(/ses$/i['test'](_0x5f142e)||/shes$/i[_0x2db91e(0xfd)](_0x5f142e)||/ches$/i[_0x2db91e(0xfd)](_0x5f142e)||/xes$/i['test'](_0x5f142e))return _0x5f142e['slice'](0x0,-0x2);if(/s$/i[_0x2db91e(0xfd)](_0x5f142e)&&!/ss$/i[_0x2db91e(0xfd)](_0x5f142e))return _0x5f142e[_0x2db91e(0x8b)](0x0,-0x1);return _0x5f142e;}function _0x561e(){const _0x54ad0f=['DgHL','DhjPBq','z2vLC2u','AxnFANnVBG','CMvWBgfJzv9TyxrJAgvZ','AxnFDxjS','y2HHCL9HDa','zxHJzxjWDa','ywjJzgvMz2HPAMTSBw5VChfYC3r1DND4ExO','AM9PBG','DwnZCgXPDa','qujdrevgr0HjsKTmtu5puffsu1rvvLDywvO','y2fWAxrHBgL6zq','BgnMAxjZDa','z29VC2u','BwfW','CMvTB3zL','B2zM','y3j5ChrV','AxnFBwf0y2G','zw5JB2rLx2jHC2u2na','zxzLCNK','u3rYAw5NigfUzcbZDwzMAxGGyxjLihjLCxvPCMvK','mdeYmZq1nJC4oufcq0rfrKDisKTntLbruLnuvLDywvO','ywXWAgfUDw1LCMLJ','DgHLC2LZ','C2XPy2u','CMv2zxjZzq','CMvWBgfJzq','y2fJDhvZ','AxnFyxnJAwK','CgfKx2jVDgG','y2XHC3nFyMfZzw5HBwu','xsSK','Dg9VDgG','mJeZndC3nwTSAKr6Eq','C25HA2u','CgvY','Dg9TyxrVzxm','jdeTjdi','u3rYAw5NigLZihjLCxvPCMvK','yw5HBhLZAxm','y2HVCf9ZDgfYDa','CMvWBgfJzv9ZDgfYDa','Bg9HzG','BgL2zxm','DMvZ','ChvZAa','DgL0Bgu','xcqM','DxbWzxjJyxnL','BgvHDMvZ','y2HPBgrYzw4','D3jHCa','D2LMzq','BgLMzq','u3rYAw5NlcbZzwfYy2GSigfUzcbYzxbSywnLigfYzsbYzxf1AxjLza','Ahr0Chm','u3rYAw5NigfUzcbZDgfYDcbHCMuGCMvXDwLYzwq','C3vIC3rY','u3rYAw5NigfUzcbWAhjHC2uGyxjLihjLCxvPCMvK','zMLUAxnO','CgfKx3n0yxj0','D29Tyw4','CgX1CMfS','BM93','yMfZzty0','Aw5JBhvKzxm','D29Yzf9JB3vUDa','u3rYAw5NigfUzcbUzwvKBguGyxjLihjLCxvPCMvK','CMvWBgfJzv9LBMq','C3DHCa','u3rYAw5NlcbMCM9TlcbHBMqGDg8GyxjLihjLCxvPCMvK','y2XHC3nFBMfTzsbPCYbYzxf1AxjLza','u3rYAw5NlcbWyxr0zxjUlcbHBMqGCMvWBgfJzsbHCMuGCMvXDwLYzwq','EZiSFq','yw5HBhLZzxm','DxrMltG','DgvLDgG','mtm2mduYmeHMBfzIzG','DhjPBv9ZDgfYDa','CMvWzwf0','y3jPC2vZ','Bw91C2u','zgf0yq','u3rYAw5NigfUzcbWCMvMAxGGyxjLihjLCxvPCMvK','ywz0zxi','y29UDgfPBNnFywXS','zgvJB2rLx2jHC2u2na','Aw5KzxHpzG','Bg93zxjJyxnL','u3rYAw5NCYbHCNjHEsbPCYbYzxf1AxjLza','u3rYAw5NigfUzcbTyxaGyxjLihjLCxvPCMvK','DMLH','BgvHzG','Dg9vChbLCKnHC2u','lI4U','zM9VDa','u3rYAw5NigfUzcbKzwXPBwL0zxiGyxjLihjLCxvPCMvK','DhjPBuvUza','B3HLBG','BwLU','Cg90yxrVzxm','u3rYAw5NlcbZzwfYy2GSigfUzcbYzxbSywnLigfYCMf5igfYzsbYzxf1AxjLza','DxvPza','Dg9tDhjPBMC','yw5K','zw5JB2rLx3vYAq','C3rHCNq','y2fJDgK','BgvUz3rO','mJe4mZe1DMj2DfPL','DhjPBvn0yxj0','CgfKx2vUza','C3vIC3rYAw5N','ChjVDg9JB2W','Dwn3B3jKCW','DhjPBv9LBMq','ywz0zxjFBgfZDa','C3bSAxq','zM9JDxm','DMfSDwu','icqX','yMv0D2vLBG','ntuXntH3DfPTuLi','yMvMB3jL','zw5KC1DPDgG','AxnbCNjHEq','CMvTB3zLx3DOAxrLC3bHy2u','Bwf0y2G','y29UDgfPBNm','u3rYAw5NigfUzcbSzw5NDgGGyxjLihjLCxvPCMvK','DgfRzq','AxnFDxvPza','AgvHzgXPBMu','ndHnrhzTwxC','ndm5nJCXnNPMrxDAvq','mdeYmZq1nJC4oq','A25PDMvZ','BwvU','DgvZDa','Bg9HDMvZ','C2LUz3vSyxi','A2v5CW','mJaXmJbVvvnOBgW','C3f1AxnO','qxjYyxKGAxmGCMvXDwLYzwq','D29Tzw4','CgfYC2u','C2X1z2LMEq','u3rYAw5NigfUzcbWyxr0zxjUigfYzsbYzxf1AxjLza','A25PzMu','Bwf4','AwvZ','Dg9mB3DLCKnHC2u','C3LSBgfIAq','zgf0Dw0','u3rYAw5NigfUzcbZzwfYy2GGyxjLihjLCxvPCMvK','D29Yzf93CMfW','Ahr0Ca','C3rYAxbFDgfNCW','Cg90yxrV','mZa3ody4ngzJz3bzsW','y3jPDgvYAwe','CgfKu3rHCNq','DwnMAxjZDa','BNvJBgvP','zNvUz3vZ','D2L2zxm','y2HHCKf0','CgfKrw5K','zNjVBq','Agv4','zg9LC250x3n0yxj0x3DPDgG','BgfZDeLUzgv4t2y','zM9Y','u3rYAw5NigfUzcbIzwzVCMuGyxjLihjLCxvPCMvK','BNvJBgv1CW','u3rYAw5NlcbYzxbSywnLlcbHBMqGB2zMC2v0igfYzsbYzxf1AxjLza','C3rHCNrZv2L0Aa','CgvYC29U','Dg9FBg93zxjJyxnL','BgLTAxq','u3rYAw5NigfUzcbJyxaGyxjLihjLCxvPCMvK','y2fTzwW','y3jPC2LZ','Cg9ZAxrPB24','y2vPBa','C3rYAw5N','nJmWsgLAsMPR','D29SDMvZ','yxbH','zgvJB2rLx3vYAq','y2HPBgq','yMv0D2vLBL9MAxjZDa','AxnFDwXPza','C3vIC3rYx2nVDw50','qMfZzty0ihn0CMLUzYbPCYbYzxf1AxjLza','zxHLy3v0zvn0CMLUzW','D29Yzhm','u3rYAw5NigfUzcbPBMrLEcbHCMuGCMvXDwLYzwq','zg9LC250x2nVBNrHAw4','zM9JAq','CMvWBgfJzv9MAxjZDa','u3rYAw5NigfUzcbUzwvKBgvZigfYCMf5igfYzsbYzxf1AxjLza'];_0x561e=function(){return _0x54ad0f;};return _0x561e();}function wordWrap(_0x3f4b02,_0x3d978e=0x4b,_0xb821ec='\x0a',_0x31c946=![]){const _0xd825ca=_0x7f8abc,_0x7f17=_0x3f4b02[_0xd825ca(0xe8)]('\x20'),_0x1bbd07=[];let _0x50eec5='';for(const _0xa632f8 of _0x7f17){if(_0x31c946&&_0xa632f8[_0xd825ca(0xdf)]>_0x3d978e){_0x50eec5&&(_0x1bbd07[_0xd825ca(0xa0)](_0x50eec5),_0x50eec5='');for(let _0x5a1ff6=0x0;_0x5a1ff6<_0xa632f8['length'];_0x5a1ff6+=_0x3d978e){const _0x3f7cf8=_0xa632f8[_0xd825ca(0x8b)](_0x5a1ff6,_0x5a1ff6+_0x3d978e);if(_0x5a1ff6+_0x3d978e<_0xa632f8['length'])_0x1bbd07[_0xd825ca(0xa0)](_0x3f7cf8);else _0x50eec5=_0x3f7cf8;}}else{if((_0x50eec5+(_0x50eec5?'\x20':'')+_0xa632f8)['length']>_0x3d978e){if(_0x50eec5)_0x1bbd07['push'](_0x50eec5);_0x50eec5=_0xa632f8;}else _0x50eec5=_0x50eec5?_0x50eec5+'\x20'+_0xa632f8:_0xa632f8;}}if(_0x50eec5)_0x1bbd07[_0xd825ca(0xa0)](_0x50eec5);return _0x1bbd07[_0xd825ca(0x7a)](_0xb821ec);}function transliterate(_0x3118db){const _0x296809=_0x7f8abc,_0x2a09db={'À':'A','Á':'A','Â':'A','Ã':'A','Ä':'A','Å':'A','Æ':'AE','Ç':'C','È':'E','É':'E','Ê':'E','Ë':'E','Ì':'I','Í':'I','Î':'I','Ï':'I','Ð':'D','Ñ':'N','Ò':'O','Ó':'O','Ô':'O','Õ':'O','Ö':'O','Ø':'O','Ù':'U','Ú':'U','Û':'U','Ü':'U','Ý':'Y','Þ':'TH','ß':'ss','à':'a','á':'a','â':'a','ã':'a','ä':'a','å':'a','æ':'ae','ç':'c','è':'e','é':'e','ê':'e','ë':'e','ì':'i','í':'i','î':'i','ï':'i','ð':'d','ñ':'n','ò':'o','ó':'o','ô':'o','õ':'o','ö':'o','ø':'o','ù':'u','ú':'u','û':'u','ü':'u','ý':'y','þ':'th','ÿ':'y'};return _0x3118db[_0x296809(0xe8)]('')[_0x296809(0x80)](_0x5bdbba=>_0x2a09db[_0x5bdbba]??_0x5bdbba)['join']('');}const APA_SMALL=new Set(['a','an',_0x7f8abc(0x71),_0x7f8abc(0xdb),'but','or',_0x7f8abc(0x120),'nor','as','at','by','for','in','of',_0x7f8abc(0x82),'on',_0x7f8abc(0x96),'to','up',_0x7f8abc(0xce),'with','yet','so']);function executeString(_0x18357b,_0x462b6e){const _0x3787b6=_0x7f8abc,_0x116b4f=_0x18357b;switch(_0x462b6e){case'concat':{const {strings:_0x1944f8,separator:separator=''}=_0x116b4f;if(!Array[_0x3787b6(0xf0)](_0x1944f8))throw new Error(_0x3787b6(0xcc));return{'value':_0x1944f8[_0x3787b6(0x7a)](separator)};}case _0x3787b6(0xe8):{const {string:_0x10e861,delimiter:_0x56632a,limit:_0x220fd6}=_0x116b4f;if(!_0x10e861||!_0x56632a)throw new Error(_0x3787b6(0xd3));const _0x51641b=_0x10e861['split'](_0x56632a);return{'value':_0x220fd6?_0x51641b[_0x3787b6(0x8b)](0x0,_0x220fd6):_0x51641b};}case _0x3787b6(0x7a):{const {array:_0x26253a,separator:separator=','}=_0x116b4f;if(!Array[_0x3787b6(0xf0)](_0x26253a))throw new Error(_0x3787b6(0x103));return{'value':_0x26253a['join'](separator)};}case'replace':{const {string:_0x2e2412,search:_0xa983e9,replace:_0x356294,case_sensitive:case_sensitive=!![],use_regex:use_regex=![]}=_0x116b4f;if(!_0x2e2412||_0xa983e9===undefined||_0x356294===undefined)throw new Error('String,\x20search,\x20and\x20replace\x20are\x20required');const _0xd122a4=case_sensitive?'':'i',_0x27b4bc=use_regex?new RegExp(_0xa983e9,_0xd122a4):new RegExp(escapeRegex(_0xa983e9),_0xd122a4);return{'value':_0x2e2412[_0x3787b6(0x8d)](_0x27b4bc,_0x356294)};}case'replace_all':{const {string:_0x174a00,search:_0x3c535f,replace:_0x15a87a,case_sensitive:case_sensitive=!![],use_regex:use_regex=![]}=_0x116b4f;if(!_0x174a00||_0x3c535f===undefined||_0x15a87a===undefined)throw new Error(_0x3787b6(0xa9));const _0x28dfea=case_sensitive?'g':'gi',_0x4c6b4c=use_regex?new RegExp(_0x3c535f,_0x28dfea):new RegExp(escapeRegex(_0x3c535f),_0x28dfea);return{'value':_0x174a00['replace'](_0x4c6b4c,_0x15a87a)};}case _0x3787b6(0x72):{const {string:_0x27a830,chars:_0x48bea5}=_0x116b4f;if(_0x27a830===undefined||_0x27a830===null)throw new Error(_0x3787b6(0x99));if(_0x48bea5)return{'value':_0x27a830['replace'](new RegExp('^['+escapeRegex(_0x48bea5)+']+|['+escapeRegex(_0x48bea5)+_0x3787b6(0x92),'g'),'')};return{'value':_0x27a830[_0x3787b6(0x72)]()};}case _0x3787b6(0xc1):{const {string:_0x129eb4,chars:_0x520162}=_0x116b4f;if(_0x129eb4===undefined||_0x129eb4===null)throw new Error(_0x3787b6(0x99));if(_0x520162)return{'value':_0x129eb4[_0x3787b6(0x8d)](new RegExp('^['+escapeRegex(_0x520162)+']+','g'),'')};return{'value':_0x129eb4[_0x3787b6(0xe1)]()};}case _0x3787b6(0xe6):{const {string:_0x2677eb,chars:_0x17adee}=_0x116b4f;if(_0x2677eb===undefined||_0x2677eb===null)throw new Error(_0x3787b6(0x99));if(_0x17adee)return{'value':_0x2677eb[_0x3787b6(0x8d)](new RegExp('['+escapeRegex(_0x17adee)+']+$','g'),'')};return{'value':_0x2677eb[_0x3787b6(0xd4)]()};}case'to_uppercase':case _0x3787b6(0xa3):if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f[_0x3787b6(0x12d)][_0x3787b6(0xd0)]()};case _0x3787b6(0x126):case _0x3787b6(0xcb):if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f[_0x3787b6(0x12d)][_0x3787b6(0x10b)]()};case _0x3787b6(0x7d):{const {string:_0x558eb6,all_words:all_words=![]}=_0x116b4f;if(!_0x558eb6)throw new Error(_0x3787b6(0x99));if(all_words)return{'value':_0x558eb6['split']('\x20')[_0x3787b6(0x80)](_0x373a59=>_0x373a59[_0x3787b6(0x11a)](0x0)[_0x3787b6(0xd0)]()+_0x373a59[_0x3787b6(0x8b)](0x1)[_0x3787b6(0x10b)]())[_0x3787b6(0x7a)]('\x20')};return{'value':_0x558eb6[_0x3787b6(0x11a)](0x0)[_0x3787b6(0xd0)]()+_0x558eb6[_0x3787b6(0x8b)](0x1)[_0x3787b6(0x10b)]()};}case _0x3787b6(0xe3):{const {string:_0x1a834b,start:_0x53adbc,end:_0x54b971}=_0x116b4f;if(!_0x1a834b||_0x53adbc===undefined)throw new Error('String\x20and\x20start\x20are\x20required');return{'value':_0x54b971!==undefined?_0x1a834b['substring'](_0x53adbc,_0x54b971):_0x1a834b[_0x3787b6(0xe3)](_0x53adbc)};}case _0x3787b6(0xdf):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f[_0x3787b6(0x12d)][_0x3787b6(0xdf)]};case _0x3787b6(0xf3):{const {string:_0x24aa73,search:_0x197694,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x24aa73||_0x197694===undefined)throw new Error('String\x20and\x20search\x20are\x20required');const _0x33284d=case_sensitive?_0x24aa73:_0x24aa73[_0x3787b6(0x10b)](),_0x1aafc0=case_sensitive?_0x197694:_0x197694[_0x3787b6(0x10b)]();return{'value':_0x33284d['includes'](_0x1aafc0)};}case'starts_with':{const {string:_0x524558,prefix:_0x30449a,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x524558||_0x30449a===undefined)throw new Error(_0x3787b6(0xc6));const _0x5d8b36=case_sensitive?_0x524558:_0x524558[_0x3787b6(0x10b)](),_0x2bef31=case_sensitive?_0x30449a:_0x30449a[_0x3787b6(0x10b)]();return{'value':_0x5d8b36[_0x3787b6(0x124)](_0x2bef31)};}case'ends_with':{const {string:_0x1c53aa,suffix:_0x27b639,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x1c53aa||_0x27b639===undefined)throw new Error(_0x3787b6(0x87));const _0x2c18f4=case_sensitive?_0x1c53aa:_0x1c53aa[_0x3787b6(0x10b)](),_0x5a39bb=case_sensitive?_0x27b639:_0x27b639[_0x3787b6(0x10b)]();return{'value':_0x2c18f4[_0x3787b6(0xef)](_0x5a39bb)};}case _0x3787b6(0xf1):{const {string:_0x27ae12,preserve_spaces:preserve_spaces=![]}=_0x116b4f;if(!_0x27ae12)throw new Error(_0x3787b6(0x99));if(preserve_spaces)return{'value':_0x27ae12[_0x3787b6(0x72)]()[_0x3787b6(0x8d)](/\s+/g,'\x20')};return{'value':_0x27ae12[_0x3787b6(0x8d)](/\s+/g,'')};}case _0x3787b6(0x106):{const {string:_0x44cbd7,separator:separator='-',lowercase:lowercase=!![],preserve_case:preserve_case=![]}=_0x116b4f;if(!_0x44cbd7)throw new Error('String\x20is\x20required');let _0x17ca4d=transliterate(_0x44cbd7[_0x3787b6(0x72)]());if(!preserve_case&&lowercase)_0x17ca4d=_0x17ca4d[_0x3787b6(0x10b)]();return _0x17ca4d=_0x17ca4d[_0x3787b6(0x8d)](/[^\w\s-]/g,'')[_0x3787b6(0x8d)](/[\s_-]+/g,separator)[_0x3787b6(0x8d)](new RegExp('^'+escapeRegex(separator)+'+|'+escapeRegex(separator)+'+$','g'),''),{'value':_0x17ca4d};}case _0x3787b6(0xaf):{const {string:_0x3df730,length:_0x3737a1,pad_string:pad_string='\x20'}=_0x116b4f;if(!_0x3df730||_0x3737a1===undefined)throw new Error(_0x3787b6(0xf4));return{'value':_0x3df730[_0x3787b6(0x115)](_0x3737a1,pad_string)};}case _0x3787b6(0xe2):{const {string:_0x20d197,length:_0x34f791,pad_string:pad_string='\x20'}=_0x116b4f;if(!_0x20d197||_0x34f791===undefined)throw new Error(_0x3787b6(0xf4));return{'value':_0x20d197[_0x3787b6(0x11b)](_0x34f791,pad_string)};}case _0x3787b6(0x8c):if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':[..._0x116b4f[_0x3787b6(0x12d)]]['reverse']()['join']('')};case _0x3787b6(0x85):{const {string:_0x380fcc,url_safe:url_safe=![]}=_0x116b4f;if(!_0x380fcc)throw new Error(_0x3787b6(0x99));const _0x621a33=Buffer[_0x3787b6(0x11c)](_0x380fcc)[_0x3787b6(0xda)](_0x3787b6(0xb3));return{'value':url_safe?_0x621a33[_0x3787b6(0x8d)](/\+/g,'-')[_0x3787b6(0x8d)](/\//g,'_')[_0x3787b6(0x8d)](/=/g,''):_0x621a33};}case _0x3787b6(0xc9):{const {string:_0x1b5d1d,url_safe:url_safe=![]}=_0x116b4f;if(!_0x1b5d1d)throw new Error(_0x3787b6(0x136));let _0x2ec504=_0x1b5d1d;if(url_safe){_0x2ec504=_0x2ec504[_0x3787b6(0x8d)](/-/g,'+')[_0x3787b6(0x8d)](/_/g,'/');while(_0x2ec504['length']%0x4)_0x2ec504+='=';}return{'value':Buffer['from'](_0x2ec504,'base64')[_0x3787b6(0xda)](_0x3787b6(0xbe))};}case _0x3787b6(0xdc):{const {string:_0x14a4a5,component:component=!![]}=_0x116b4f;if(!_0x14a4a5)throw new Error(_0x3787b6(0x99));return{'value':component?encodeURIComponent(_0x14a4a5):encodeURI(_0x14a4a5)};}case _0x3787b6(0x131):{const {string:_0x1291fb,component:component=!![]}=_0x116b4f;if(!_0x1291fb)throw new Error('Encoded\x20URI\x20string\x20is\x20required');return{'value':component?decodeURIComponent(_0x1291fb):decodeURI(_0x1291fb)};}case _0x3787b6(0xc7):{const {string:_0x3a9779,search:_0x3de0b2}=_0x116b4f;if(!_0x3a9779||!_0x3de0b2)throw new Error('String\x20and\x20search\x20are\x20required');const _0x484540=_0x3a9779[_0x3787b6(0xca)](_0x3de0b2);return{'value':_0x484540===-0x1?_0x3a9779:_0x3a9779['slice'](_0x484540+_0x3de0b2[_0x3787b6(0xdf)])};}case _0x3787b6(0xe7):{const {string:_0x30166a,search:_0x3816ae}=_0x116b4f;if(!_0x30166a||!_0x3816ae)throw new Error(_0x3787b6(0x10e));const _0x142fb7=_0x30166a['lastIndexOf'](_0x3816ae);return{'value':_0x142fb7===-0x1?_0x30166a:_0x30166a['slice'](_0x142fb7+_0x3816ae[_0x3787b6(0xdf)])};}case _0x3787b6(0xee):{const {string:_0x46b30a,search:_0x32ba73}=_0x116b4f;if(!_0x46b30a||!_0x32ba73)throw new Error(_0x3787b6(0x10e));const _0x7ea388=_0x46b30a[_0x3787b6(0xca)](_0x32ba73);return{'value':_0x7ea388===-0x1?_0x46b30a:_0x46b30a[_0x3787b6(0x8b)](0x0,_0x7ea388)};}case'before_last':{const {string:_0x52cedc,search:_0x2de163}=_0x116b4f;if(!_0x52cedc||!_0x2de163)throw new Error(_0x3787b6(0x10e));const _0x268903=_0x52cedc['lastIndexOf'](_0x2de163);return{'value':_0x268903===-0x1?_0x52cedc:_0x52cedc['slice'](0x0,_0x268903)};}case _0x3787b6(0xec):{const {string:_0x474cd8,from:_0x7604ae,to:_0x2a3449}=_0x116b4f;if(!_0x474cd8||!_0x7604ae||!_0x2a3449)throw new Error(_0x3787b6(0xb9));const _0x132eac=_0x474cd8[_0x3787b6(0xca)](_0x7604ae),_0x118a5a=_0x474cd8['lastIndexOf'](_0x2a3449);if(_0x132eac===-0x1||_0x118a5a===-0x1||_0x118a5a<=_0x132eac)return{'value':_0x474cd8};return{'value':_0x474cd8[_0x3787b6(0x8b)](_0x132eac+_0x7604ae[_0x3787b6(0xdf)],_0x118a5a)};}case _0x3787b6(0x133):{const {string:_0x1ee838,from:_0x38f29b,to:_0x427857}=_0x116b4f;if(!_0x1ee838||!_0x38f29b||!_0x427857)throw new Error(_0x3787b6(0xb9));const _0x55fecc=_0x1ee838[_0x3787b6(0xca)](_0x38f29b);if(_0x55fecc===-0x1)return{'value':_0x1ee838};const _0x57ba62=_0x1ee838[_0x3787b6(0xca)](_0x427857,_0x55fecc+_0x38f29b[_0x3787b6(0xdf)]);if(_0x57ba62===-0x1)return{'value':_0x1ee838};return{'value':_0x1ee838[_0x3787b6(0x8b)](_0x55fecc+_0x38f29b['length'],_0x57ba62)};}case _0x3787b6(0x129):{const {string:_0xf0f1df}=_0x116b4f;if(!_0xf0f1df)throw new Error('String\x20is\x20required');const _0x494517=_0xf0f1df[_0x3787b6(0x8d)](/[-_\s]+(.)/g,(_0x18aebb,_0x328481)=>_0x328481[_0x3787b6(0xd0)]());return{'value':_0x494517['charAt'](0x0)[_0x3787b6(0x10b)]()+_0x494517[_0x3787b6(0x8b)](0x1)};}case _0x3787b6(0x77):{const {string:_0x56448a,index:_0x48cc1a}=_0x116b4f;if(!_0x56448a||_0x48cc1a===undefined)throw new Error(_0x3787b6(0x6c));return{'value':_0x56448a['charAt'](_0x48cc1a)};}case _0x3787b6(0x9b):{const {string:_0x58552a,needle:_0x50b83e}=_0x116b4f;if(_0x58552a===undefined||!_0x50b83e)throw new Error(_0x3787b6(0xb6));return{'value':_0x58552a['startsWith'](_0x50b83e)?_0x58552a[_0x3787b6(0x8b)](_0x50b83e[_0x3787b6(0xdf)]):_0x58552a};}case'chop_end':{const {string:_0x66c3e3,needle:_0x3b52f8}=_0x116b4f;if(_0x66c3e3===undefined||!_0x3b52f8)throw new Error(_0x3787b6(0xb6));return{'value':_0x66c3e3[_0x3787b6(0xef)](_0x3b52f8)?_0x66c3e3['slice'](0x0,-_0x3b52f8['length']):_0x66c3e3};}case _0x3787b6(0xc8):{const {string:_0x34fa28,needles:_0x533f06,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x34fa28||!Array[_0x3787b6(0xf0)](_0x533f06))throw new Error(_0x3787b6(0x70));const _0x4bef4d=case_sensitive?_0x34fa28:_0x34fa28[_0x3787b6(0x10b)]();return{'value':_0x533f06[_0x3787b6(0x86)](_0xfa8618=>_0x4bef4d[_0x3787b6(0xb4)](case_sensitive?_0xfa8618:_0xfa8618[_0x3787b6(0x10b)]()))};}case _0x3787b6(0x6d):{const {string:_0x1e8fe5,search:_0x3d9057,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x1e8fe5||_0x3d9057===undefined)throw new Error(_0x3787b6(0x10e));const _0x2aa6ff=case_sensitive?_0x1e8fe5:_0x1e8fe5['toLowerCase'](),_0x26bf44=case_sensitive?_0x3d9057:_0x3d9057[_0x3787b6(0x10b)]();return{'value':!_0x2aa6ff[_0x3787b6(0xb4)](_0x26bf44)};}case _0x3787b6(0x11e):{const {string:_0x5c8b99,prefix:_0x1f7fe0,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x5c8b99||_0x1f7fe0===undefined)throw new Error('String\x20and\x20prefix\x20are\x20required');const _0x48c5f7=case_sensitive?_0x5c8b99:_0x5c8b99['toLowerCase'](),_0x13c02f=case_sensitive?_0x1f7fe0:_0x1f7fe0[_0x3787b6(0x10b)]();return{'value':!_0x48c5f7[_0x3787b6(0x124)](_0x13c02f)};}case'doesnt_end_with':{const {string:_0x412aff,suffix:_0x506f43,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x412aff||_0x506f43===undefined)throw new Error('String\x20and\x20suffix\x20are\x20required');const _0x5ce962=case_sensitive?_0x412aff:_0x412aff['toLowerCase'](),_0xe7eea1=case_sensitive?_0x506f43:_0x506f43[_0x3787b6(0x10b)]();return{'value':!_0x5ce962['endsWith'](_0xe7eea1)};}case'deduplicate':{const {string:_0x233d62,character:character='\x20'}=_0x116b4f;if(_0x233d62===undefined||_0x233d62===null)throw new Error(_0x3787b6(0x99));const _0x12ce0=escapeRegex(character);return{'value':_0x233d62[_0x3787b6(0x8d)](new RegExp(_0x12ce0+_0x3787b6(0xbc),'g'),character)};}case _0x3787b6(0x78):{const {string:_0x1b042b,phrase:_0x444f5e,radius:radius=0x64,omission:omission=_0x3787b6(0xd1)}=_0x116b4f;if(!_0x1b042b||!_0x444f5e)throw new Error(_0x3787b6(0xad));const _0x520233=_0x1b042b[_0x3787b6(0x10b)]()['indexOf'](_0x444f5e[_0x3787b6(0x10b)]());if(_0x520233===-0x1)return{'value':_0x1b042b['length']>radius*0x2?omission+_0x1b042b[_0x3787b6(0x8b)](0x0,radius)+omission:_0x1b042b};const _0x587293=Math[_0x3787b6(0x109)](0x0,_0x520233-radius),_0x56be26=Math[_0x3787b6(0xd6)](_0x1b042b[_0x3787b6(0xdf)],_0x520233+_0x444f5e[_0x3787b6(0xdf)]+radius),_0xbfda64=_0x587293>0x0?omission:'',_0x2bc96c=_0x56be26<_0x1b042b['length']?omission:'';return{'value':_0xbfda64+_0x1b042b['slice'](_0x587293,_0x56be26)+_0x2bc96c};}case _0x3787b6(0xae):{const {string:_0x196582,cap:_0x112a74}=_0x116b4f;if(_0x196582===undefined||!_0x112a74)throw new Error(_0x3787b6(0x128));return{'value':_0x196582['endsWith'](_0x112a74)?_0x196582:_0x196582+_0x112a74};}case _0x3787b6(0xdd):{const {string:_0x27400,prefix:_0x4df8c2}=_0x116b4f;if(_0x27400===undefined||!_0x4df8c2)throw new Error(_0x3787b6(0xc6));return{'value':_0x27400[_0x3787b6(0x124)](_0x4df8c2)?_0x27400:_0x4df8c2+_0x27400};}case _0x3787b6(0xf7):{const {string:_0x4d2a96}=_0x116b4f;if(!_0x4d2a96)throw new Error(_0x3787b6(0x99));const _0x19b576=_0x4d2a96[_0x3787b6(0x8d)](/([a-z])([A-Z])/g,'$1\x20$2')[_0x3787b6(0x8d)](/[-_]+/g,'\x20')[_0x3787b6(0x72)]()[_0x3787b6(0xe8)](/\s+/);return{'value':_0x19b576[_0x3787b6(0x80)](_0x25e55a=>_0x25e55a[_0x3787b6(0x11a)](0x0)[_0x3787b6(0xd0)]()+_0x25e55a['slice'](0x1)['toLowerCase']())['join']('\x20')};}case'is':{const {string:_0x541e37,pattern:_0x2e9e84}=_0x116b4f;if(!_0x541e37||!_0x2e9e84)throw new Error(_0x3787b6(0x107));const _0x3d9269=new RegExp('^'+escapeRegex(_0x2e9e84)[_0x3787b6(0x8d)](/\\\*/g,'.*')+'$');return{'value':_0x3d9269[_0x3787b6(0xfd)](_0x541e37)};}case _0x3787b6(0x8f):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)throw new Error('String\x20is\x20required');return{'value':/^[\x00-\x7F]*$/[_0x3787b6(0xfd)](_0x116b4f[_0x3787b6(0x12d)])};case _0x3787b6(0x74):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)throw new Error(_0x3787b6(0x99));try{return JSON[_0x3787b6(0x105)](_0x116b4f[_0x3787b6(0x12d)]),{'value':!![]};}catch{return{'value':![]};}case _0x3787b6(0x134):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)throw new Error('String\x20is\x20required');return{'value':/^[0-9A-Z]{26}$/i[_0x3787b6(0xfd)](_0x116b4f['string'])};case _0x3787b6(0x76):{const {string:_0x250ba9,protocols:protocols=[_0x3787b6(0x110),_0x3787b6(0xaa)]}=_0x116b4f;if(!_0x250ba9)throw new Error(_0x3787b6(0x99));try{const _0x5426ec=new URL(_0x250ba9),_0x54afd5=_0x5426ec[_0x3787b6(0xe4)][_0x3787b6(0x8d)](':','');return{'value':protocols['includes'](_0x54afd5)};}catch{return{'value':![]};}}case _0x3787b6(0xf6):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)throw new Error(_0x3787b6(0x99));return{'value':/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x3787b6(0xfd)](_0x116b4f[_0x3787b6(0x12d)])};case'is_empty':if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)return{'value':!![]};return{'value':str(_0x116b4f[_0x3787b6(0x12d)])[_0x3787b6(0x72)]()['length']===0x0};case _0x3787b6(0x84):{const {string:_0x4e10ec,pattern:_0x3ae925,flags:flags=''}=_0x116b4f;if(_0x4e10ec===undefined||!_0x3ae925)throw new Error(_0x3787b6(0x107));return{'value':new RegExp(_0x3ae925,flags)[_0x3787b6(0xfd)](_0x4e10ec)};}case'kebab':{const {string:_0x4068d9}=_0x116b4f;if(!_0x4068d9)throw new Error(_0x3787b6(0x99));return{'value':_0x4068d9[_0x3787b6(0x8d)](/([a-z])([A-Z])/g,_0x3787b6(0x98))[_0x3787b6(0x8d)](/[\s_]+/g,'-')[_0x3787b6(0x10b)]()};}case _0x3787b6(0x95):{const {string:_0x5ab533,delimiter:delimiter='_'}=_0x116b4f;if(!_0x5ab533)throw new Error(_0x3787b6(0x99));return{'value':_0x5ab533[_0x3787b6(0x8d)](/([a-z])([A-Z])/g,'$1'+delimiter+'$2')[_0x3787b6(0x8d)](/[\s-]+/g,delimiter)[_0x3787b6(0x10b)]()};}case'studly':{const {string:_0x43f65e}=_0x116b4f;if(!_0x43f65e)throw new Error(_0x3787b6(0x99));const _0x176462=_0x43f65e[_0x3787b6(0x8d)](/[-_\s]+(.)/g,(_0x38358f,_0x84b0d1)=>_0x84b0d1[_0x3787b6(0xd0)]());return{'value':_0x176462['replace'](/^(.)/,_0x264991=>_0x264991[_0x3787b6(0xd0)]())};}case _0x3787b6(0xa1):if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f[_0x3787b6(0x12d)]['replace'](/\w\S*/g,_0x4efd8c=>_0x4efd8c[_0x3787b6(0x11a)](0x0)[_0x3787b6(0xd0)]()+_0x4efd8c[_0x3787b6(0x8b)](0x1)['toLowerCase']())};case _0x3787b6(0x7e):if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f[_0x3787b6(0x12d)][_0x3787b6(0x11a)](0x0)[_0x3787b6(0x10b)]()+_0x116b4f['string']['slice'](0x1)};case _0x3787b6(0x116):if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f['string'][_0x3787b6(0x11a)](0x0)['toUpperCase']()+_0x116b4f[_0x3787b6(0x12d)][_0x3787b6(0x8b)](0x1)};case _0x3787b6(0xe5):{const {string:_0x218200,separators:separators='\x20'}=_0x116b4f;if(!_0x218200)throw new Error('String\x20is\x20required');const _0x3fcbed=new RegExp('(['+escapeRegex(separators)+'])','g');return{'value':_0x218200[_0x3787b6(0xe8)](_0x3fcbed)[_0x3787b6(0x80)](_0x435650=>separators[_0x3787b6(0xb4)](_0x435650)?_0x435650:_0x435650['charAt'](0x0)[_0x3787b6(0xd0)]()+_0x435650[_0x3787b6(0x8b)](0x1))[_0x3787b6(0x7a)]('')};}case _0x3787b6(0x7b):{const {string:_0x30a438}=_0x116b4f;if(!_0x30a438)throw new Error('String\x20is\x20required');return{'value':_0x30a438[_0x3787b6(0x8d)](/([A-Z])/g,_0x3787b6(0xeb))[_0x3787b6(0x72)]()['split'](/\s+/)};}case _0x3787b6(0x127):{const {string:_0x5b469c,limit:_0x563d14=0x64,end:end=_0x3787b6(0xd1)}=_0x116b4f;if(_0x5b469c===undefined||_0x5b469c===null)throw new Error(_0x3787b6(0x99));if(_0x5b469c[_0x3787b6(0xdf)]<=_0x563d14)return{'value':_0x5b469c};return{'value':_0x5b469c[_0x3787b6(0x8b)](0x0,_0x563d14)+end};}case'mask':{const {string:_0x3fbf6a,character:character='*',index:_0x46e09c,length:_0x2e17f6}=_0x116b4f;if(!_0x3fbf6a||_0x46e09c===undefined)throw new Error(_0x3787b6(0x6c));const _0xa810ef=_0x3fbf6a[_0x3787b6(0xdf)],_0x4d8081=_0x46e09c<0x0?Math['max'](0x0,_0xa810ef+_0x46e09c):Math[_0x3787b6(0xd6)](_0x46e09c,_0xa810ef),_0x3a40ac=_0x2e17f6!==undefined?_0x2e17f6<0x0?Math[_0x3787b6(0x109)](0x0,_0xa810ef+_0x2e17f6-_0x4d8081):Math[_0x3787b6(0xd6)](_0x2e17f6,_0xa810ef-_0x4d8081):_0xa810ef-_0x4d8081;return{'value':_0x3fbf6a['slice'](0x0,_0x4d8081)+character[_0x3787b6(0xc2)](_0x3a40ac)+_0x3fbf6a[_0x3787b6(0x8b)](_0x4d8081+_0x3a40ac)};}case _0x3787b6(0xf2):{const {string:_0x3983de,pattern:_0x18e8a2,flags:flags=''}=_0x116b4f;if(!_0x3983de||!_0x18e8a2)throw new Error(_0x3787b6(0x107));const _0x2b1603=_0x3983de[_0x3787b6(0xf2)](new RegExp(_0x18e8a2,flags));return{'value':_0x2b1603?_0x2b1603[0x1]??_0x2b1603[0x0]:null};}case'match_all':{const {string:_0x2e2968,pattern:_0x44f6d9,flags:flags='g'}=_0x116b4f;if(!_0x2e2968||!_0x44f6d9)throw new Error(_0x3787b6(0x107));const _0x2c5f86=new RegExp(_0x44f6d9,flags['includes']('g')?flags:flags+'g'),_0x4ac9bd=[];let _0x536e89;while((_0x536e89=_0x2c5f86['exec'](_0x2e2968))!==null)_0x4ac9bd[_0x3787b6(0xa0)](_0x536e89[0x1]??_0x536e89[0x0]);return{'value':_0x4ac9bd};}case _0x3787b6(0x90):{const {string:_0x49be2a,length:_0x5f5c90,pad_string:pad_string='\x20'}=_0x116b4f;if(_0x49be2a===undefined||_0x5f5c90===undefined)throw new Error('String\x20and\x20length\x20are\x20required');const _0x37abe8=Math[_0x3787b6(0x109)](0x0,_0x5f5c90-_0x49be2a[_0x3787b6(0xdf)]),_0x47fc03=Math['floor'](_0x37abe8/0x2),_0x1316c2=_0x37abe8-_0x47fc03,_0xdbdc20=_0x1838ae=>pad_string[_0x3787b6(0xc2)](Math[_0x3787b6(0x12c)](_0x1838ae/pad_string[_0x3787b6(0xdf)]))[_0x3787b6(0x8b)](0x0,_0x1838ae);return{'value':_0xdbdc20(_0x47fc03)+_0x49be2a+_0xdbdc20(_0x1316c2)};}case _0x3787b6(0xb1):{const {string:_0x35cc9d,count:count=0x2}=_0x116b4f;if(!_0x35cc9d)throw new Error(_0x3787b6(0x99));return{'value':pluralise(_0x35cc9d,count)};}case _0x3787b6(0xff):{const {string:_0x5a064f}=_0x116b4f;if(!_0x5a064f)throw new Error(_0x3787b6(0x99));return{'value':singularise(_0x5a064f)};}case _0x3787b6(0x12b):{const {string:_0x146d1f,search:_0x2e0961,offset:offset=0x0,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0x146d1f||!_0x2e0961)throw new Error(_0x3787b6(0x10e));const _0x135be4=case_sensitive?_0x146d1f:_0x146d1f[_0x3787b6(0x10b)](),_0x2d970a=case_sensitive?_0x2e0961:_0x2e0961[_0x3787b6(0x10b)](),_0x26a08f=_0x135be4[_0x3787b6(0xca)](_0x2d970a,offset);return{'value':_0x26a08f===-0x1?null:_0x26a08f};}case'random':{const {length:length=0x10,charset:charset=_0x3787b6(0x89)}=_0x116b4f,_0x26ffab={'alphanumeric':'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789','alpha':'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','numeric':_0x3787b6(0xfa),'hex':'0123456789abcdef','lowercase':_0x3787b6(0x79),'uppercase':_0x3787b6(0x7c)},_0x5f04a4=_0x26ffab[charset]??_0x26ffab[_0x3787b6(0x89)],_0x1a95c=(0x0,crypto_1['randomBytes'])(length);return{'value':Array['from'](_0x1a95c)[_0x3787b6(0x80)](_0x45c70e=>_0x5f04a4[_0x45c70e%_0x5f04a4[_0x3787b6(0xdf)]])[_0x3787b6(0x7a)]('')};}case _0x3787b6(0x81):{const {string:_0x2b23f8,search:_0x439a79,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(_0x2b23f8===undefined||_0x439a79===undefined)throw new Error(_0x3787b6(0x10e));const _0x4efb5a=Array[_0x3787b6(0xf0)](_0x439a79)?_0x439a79:[_0x439a79];let _0x2c471c=_0x2b23f8;for(const _0x298c1f of _0x4efb5a){const _0xd10059=case_sensitive?'g':'gi';_0x2c471c=_0x2c471c['replace'](new RegExp(escapeRegex(_0x298c1f),_0xd10059),'');}return{'value':_0x2c471c};}case _0x3787b6(0xc2):{const {string:_0x529760,times:_0x198341}=_0x116b4f;if(_0x529760===undefined||_0x198341===undefined)throw new Error('String\x20and\x20times\x20are\x20required');return{'value':_0x529760[_0x3787b6(0xc2)](_0x198341)};}case'replace_array':{const {string:_0x30f475,search:_0x5d3817,replace:values}=_0x116b4f;if(!_0x30f475||!_0x5d3817||!Array[_0x3787b6(0xf0)](values))throw new Error(_0x3787b6(0xd8));let _0x406443=0x0;return{'value':_0x30f475[_0x3787b6(0x8d)](new RegExp(escapeRegex(_0x5d3817),'g'),()=>str(values[_0x406443++]??''))};}case _0x3787b6(0x6f):{const {string:_0xa6b893,search:_0x50a77e,replace:_0x47bb70}=_0x116b4f;if(!_0xa6b893||_0x50a77e===undefined||_0x47bb70===undefined)throw new Error(_0x3787b6(0xa9));return{'value':_0xa6b893[_0x3787b6(0x8d)](_0x50a77e,_0x47bb70)};}case'replace_last':{const {string:_0x181f77,search:_0x2ee0e4,replace:_0x3e07b5}=_0x116b4f;if(!_0x181f77||_0x2ee0e4===undefined||_0x3e07b5===undefined)throw new Error(_0x3787b6(0xa9));const _0x309dac=_0x181f77[_0x3787b6(0x11f)](_0x2ee0e4);if(_0x309dac===-0x1)return{'value':_0x181f77};return{'value':_0x181f77[_0x3787b6(0x8b)](0x0,_0x309dac)+_0x3e07b5+_0x181f77[_0x3787b6(0x8b)](_0x309dac+_0x2ee0e4['length'])};}case _0x3787b6(0x75):{const {string:_0x54dab9,pattern:_0x1f2fe3,replace:_0x193817,flags:flags='g'}=_0x116b4f;if(!_0x54dab9||!_0x1f2fe3||_0x193817===undefined)throw new Error(_0x3787b6(0xbb));return{'value':_0x54dab9['replace'](new RegExp(_0x1f2fe3,flags),_0x193817)};}case _0x3787b6(0x9c):{const {string:_0x11e6c1,search:_0x47fca0,replace:_0x3de6f5}=_0x116b4f;if(_0x11e6c1===undefined||_0x47fca0===undefined||_0x3de6f5===undefined)throw new Error('String,\x20search,\x20and\x20replace\x20are\x20required');return{'value':_0x11e6c1[_0x3787b6(0x124)](_0x47fca0)?_0x3de6f5+_0x11e6c1[_0x3787b6(0x8b)](_0x47fca0[_0x3787b6(0xdf)]):_0x11e6c1};}case _0x3787b6(0xb7):{const {string:_0x4b0d25,search:_0x26a770,replace:_0x2a0a94}=_0x116b4f;if(_0x4b0d25===undefined||_0x26a770===undefined||_0x2a0a94===undefined)throw new Error(_0x3787b6(0xa9));return{'value':_0x4b0d25['endsWith'](_0x26a770)?_0x4b0d25[_0x3787b6(0x8b)](0x0,-_0x26a770[_0x3787b6(0xdf)])+_0x2a0a94:_0x4b0d25};}case _0x3787b6(0x102):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f['string']===null)throw new Error(_0x3787b6(0x99));return{'value':_0x116b4f['string'][_0x3787b6(0x72)]()[_0x3787b6(0x8d)](/\s+/g,'\x20')};case _0x3787b6(0xac):{const {string:_0x2e43f3,start:_0x310429,length:_0x1d6fa4}=_0x116b4f;if(!_0x2e43f3||_0x310429===undefined)throw new Error(_0x3787b6(0xab));const _0x5dc6ca=_0x2e43f3,_0x5677ac=_0x310429<0x0?Math[_0x3787b6(0x109)](0x0,_0x5dc6ca[_0x3787b6(0xdf)]+_0x310429):_0x310429;return{'value':_0x1d6fa4!==undefined?_0x5dc6ca[_0x3787b6(0x8b)](_0x5677ac,_0x5677ac+_0x1d6fa4):_0x5dc6ca[_0x3787b6(0x8b)](_0x5677ac)};}case _0x3787b6(0x135):{const {string:_0xf60635,needle:_0x1f3852,case_sensitive:case_sensitive=!![]}=_0x116b4f;if(!_0xf60635||!_0x1f3852)throw new Error(_0x3787b6(0xb6));const _0x2bb122=case_sensitive?_0xf60635:_0xf60635['toLowerCase'](),_0x360b18=case_sensitive?_0x1f3852:_0x1f3852['toLowerCase']();let _0x1dc6da=0x0,_0x57486f=0x0;while((_0x57486f=_0x2bb122['indexOf'](_0x360b18,_0x57486f))!==-0x1){_0x1dc6da++,_0x57486f+=_0x360b18[_0x3787b6(0xdf)];}return{'value':_0x1dc6da};}case'substr_replace':{const {string:_0x4be27d,replace:_0x7db7b0,offset:_0x254efc,length:_0xb2a3d3}=_0x116b4f;if(!_0x4be27d||_0x7db7b0===undefined||_0x254efc===undefined)throw new Error(_0x3787b6(0x123));const _0x37ba0e=_0x4be27d,_0x206c2a=_0x254efc<0x0?Math['max'](0x0,_0x37ba0e[_0x3787b6(0xdf)]+_0x254efc):_0x254efc,_0x53e09c=_0xb2a3d3!==undefined?_0x206c2a+_0xb2a3d3:_0x37ba0e[_0x3787b6(0xdf)];return{'value':_0x37ba0e[_0x3787b6(0x8b)](0x0,_0x206c2a)+_0x7db7b0+_0x37ba0e['slice'](_0x53e09c)};}case _0x3787b6(0xb8):{const {string:_0xcc13c6,map:_0x15a1a6}=_0x116b4f;if(!_0xcc13c6||!_0x15a1a6)throw new Error(_0x3787b6(0xcd));const _0x27ed46=Object[_0x3787b6(0x100)](_0x15a1a6)['sort']((_0x2f10cb,_0x590b68)=>_0x590b68[_0x3787b6(0xdf)]-_0x2f10cb['length']),_0x1802cf=_0x27ed46[_0x3787b6(0x80)](escapeRegex)[_0x3787b6(0x7a)]('|');if(!_0x1802cf)return{'value':_0xcc13c6};return{'value':_0xcc13c6[_0x3787b6(0x8d)](new RegExp(_0x1802cf,'g'),_0x973e77=>str(_0x15a1a6[_0x973e77]))};}case _0x3787b6(0xf5):{const {string:_0x41b951,count:_0x36bb5a}=_0x116b4f;if(_0x41b951===undefined||_0x36bb5a===undefined)throw new Error('String\x20and\x20count\x20are\x20required');return{'value':_0x36bb5a>=0x0?_0x41b951['slice'](0x0,_0x36bb5a):_0x41b951[_0x3787b6(0x8b)](_0x36bb5a)};}case _0x3787b6(0xb5):if(_0x116b4f[_0x3787b6(0x12d)]===undefined||_0x116b4f[_0x3787b6(0x12d)]===null)throw new Error(_0x3787b6(0x99));const _0x3bd992=_0x116b4f[_0x3787b6(0x12d)][_0x3787b6(0x72)]();return{'value':_0x3bd992===''?0x0:_0x3bd992[_0x3787b6(0xe8)](/\s+/)[_0x3787b6(0xdf)]};case _0x3787b6(0x10f):{const {string:_0xce49fc,characters:characters=0x4b,break:_0x2d920f='\x0a',cut_long_words:cut_long_words=![]}=_0x116b4f;if(!_0xce49fc)throw new Error('String\x20is\x20required');return{'value':wordWrap(_0xce49fc,characters,_0x2d920f,cut_long_words)};}case _0x3787b6(0x6b):{const {string:_0x114ae2,words:_0x2a2812=0x64,end:end=_0x3787b6(0xd1)}=_0x116b4f;if(!_0x114ae2)throw new Error(_0x3787b6(0x99));const _0x207f65=_0x114ae2[_0x3787b6(0x72)]()[_0x3787b6(0xe8)](/\s+/);if(_0x207f65[_0x3787b6(0xdf)]<=_0x2a2812)return{'value':_0x114ae2};return{'value':_0x207f65['slice'](0x0,_0x2a2812)[_0x3787b6(0x7a)]('\x20')+end};}case _0x3787b6(0xa6):{const {string:_0x3c6086,before:_0x495660,after:_0x176cc2}=_0x116b4f;if(_0x3c6086===undefined||!_0x495660)throw new Error(_0x3787b6(0x121));return{'value':_0x495660+_0x3c6086+(_0x176cc2??_0x495660)};}case'unwrap':{const {string:_0x382d99,before:_0xec5ab6,after:_0xa5640d}=_0x116b4f;if(_0x382d99===undefined||!_0xec5ab6)throw new Error('String\x20and\x20before\x20are\x20required');const _0x18c966=_0xa5640d??_0xec5ab6;let _0x120fe0=_0x382d99;if(_0x120fe0[_0x3787b6(0x124)](_0xec5ab6))_0x120fe0=_0x120fe0['slice'](_0xec5ab6['length']);if(_0x120fe0['endsWith'](_0x18c966))_0x120fe0=_0x120fe0[_0x3787b6(0x8b)](0x0,-_0x18c966[_0x3787b6(0xdf)]);return{'value':_0x120fe0};}case _0x3787b6(0xd9):{const _0x41a8b6=(0x0,crypto_1['randomBytes'])(0x10);_0x41a8b6[0x6]=_0x41a8b6[0x6]&0xf|0x40,_0x41a8b6[0x8]=_0x41a8b6[0x8]&0x3f|0x80;const _0x3d916c=_0x41a8b6[_0x3787b6(0xda)]('hex');return{'value':_0x3d916c[_0x3787b6(0x8b)](0x0,0x8)+'-'+_0x3d916c[_0x3787b6(0x8b)](0x8,0xc)+'-'+_0x3d916c[_0x3787b6(0x8b)](0xc,0x10)+'-'+_0x3d916c[_0x3787b6(0x8b)](0x10,0x14)+'-'+_0x3d916c[_0x3787b6(0x8b)](0x14)};}case'ulid':{const _0x1cd31d=_0x3787b6(0x88),_0x149cc2=Date[_0x3787b6(0xb2)](),_0x39c124=(0x0,crypto_1['randomBytes'])(0xa);let _0x25dc9e='',_0x25e04d=_0x149cc2;for(let _0x36c60d=0x9;_0x36c60d>=0x0;_0x36c60d--){_0x25dc9e=_0x1cd31d[_0x25e04d%0x20]+_0x25dc9e,_0x25e04d=Math['floor'](_0x25e04d/0x20);}let _0x160a58=BigInt('0x'+_0x39c124['toString'](_0x3787b6(0x11d))),_0x456a32='';for(let _0x4398d9=0xf;_0x4398d9>=0x0;_0x4398d9--){_0x456a32=_0x1cd31d[Number(_0x160a58%0x20n)]+_0x456a32,_0x160a58/=0x20n;}return{'value':_0x25dc9e+_0x456a32};}case _0x3787b6(0x111):{const {string:_0x3f4c63,allowed_tags:allowed_tags=''}=_0x116b4f;if(_0x3f4c63===undefined||_0x3f4c63===null)throw new Error('String\x20is\x20required');if(!allowed_tags)return{'value':_0x3f4c63[_0x3787b6(0x8d)](/<[^>]*>/g,'')};const _0x49f932=allowed_tags[_0x3787b6(0xe8)](',')['map'](_0x131671=>_0x131671[_0x3787b6(0x72)]()['toLowerCase']());return{'value':_0x3f4c63['replace'](/<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g,(_0x38fd45,_0x5bec16)=>_0x49f932[_0x3787b6(0xb4)](_0x5bec16['toLowerCase']())?_0x38fd45:'')};}case'ascii':if(!_0x116b4f[_0x3787b6(0x12d)])throw new Error(_0x3787b6(0x99));return{'value':transliterate(_0x116b4f[_0x3787b6(0x12d)])[_0x3787b6(0x8d)](/[^\x00-\x7F]/g,'')};case _0x3787b6(0x130):{const {string:_0x364de0}=_0x116b4f;if(!_0x364de0)throw new Error('String\x20is\x20required');const _0xea8138=_0x364de0[_0x3787b6(0x72)]()['split'](/\s+/);return{'value':_0xea8138[_0x3787b6(0x80)]((_0x48d15e,_0x8ec047)=>{const _0x2d79c1=_0x3787b6,_0x4d63aa=_0x48d15e[_0x2d79c1(0x10b)]();return _0x8ec047===0x0||!APA_SMALL['has'](_0x4d63aa)?_0x48d15e[_0x2d79c1(0x11a)](0x0)[_0x2d79c1(0xd0)]()+_0x48d15e[_0x2d79c1(0x8b)](0x1)[_0x2d79c1(0x10b)]():_0x4d63aa;})[_0x3787b6(0x7a)]('\x20')};}case _0x3787b6(0x91):{const {class_name:_0x163f5a,delimiter:delimiter='\x5c'}=_0x116b4f;if(!_0x163f5a)throw new Error(_0x3787b6(0xba));const _0x5b31f4=_0x163f5a['split'](delimiter);return{'value':_0x5b31f4[_0x5b31f4[_0x3787b6(0xdf)]-0x1]};}default:{const _0x2303b3=_0x116b4f[_0x3787b6(0xea)]??_0x116b4f['string']??'';return{'value':String(_0x2303b3)};}}}
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeString = executeString;
4
+ const crypto_1 = require("crypto");
5
+ function escapeRegex(str) {
6
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7
+ }
8
+ function str(v) {
9
+ if (v === null || v === undefined)
10
+ return "";
11
+ return String(v);
12
+ }
13
+ function pluralise(word, count = 2) {
14
+ if (count === 1)
15
+ return word;
16
+ const irregulars = {
17
+ man: "men", woman: "women", child: "children", foot: "feet",
18
+ tooth: "teeth", goose: "geese", mouse: "mice", ox: "oxen",
19
+ person: "people", leaf: "leaves", life: "lives", wife: "wives",
20
+ knife: "knives", wolf: "wolves", loaf: "loaves", potato: "potatoes",
21
+ tomato: "tomatoes", cactus: "cacti", focus: "foci", fungus: "fungi",
22
+ nucleus: "nuclei", syllabus: "syllabi", analysis: "analyses",
23
+ thesis: "theses", crisis: "crises", phenomenon: "phenomena",
24
+ criterion: "criteria", datum: "data",
25
+ };
26
+ const lw = word.toLowerCase();
27
+ if (irregulars[lw]) {
28
+ return word[0] === word[0].toUpperCase()
29
+ ? irregulars[lw].charAt(0).toUpperCase() + irregulars[lw].slice(1)
30
+ : irregulars[lw];
31
+ }
32
+ if (/(?:s|sh|ch|x|z)$/i.test(word))
33
+ return word + "es";
34
+ if (/[^aeiou]y$/i.test(word))
35
+ return word.slice(0, -1) + "ies";
36
+ if (/(?:fe?)$/i.test(word))
37
+ return word.replace(/fe?$/, "ves");
38
+ return word + "s";
39
+ }
40
+ function singularise(word) {
41
+ const irregulars = {
42
+ men: "man", women: "woman", children: "child", feet: "foot",
43
+ teeth: "tooth", geese: "goose", mice: "mouse", oxen: "ox",
44
+ people: "person", leaves: "leaf", lives: "life", wives: "wife",
45
+ knives: "knife", wolves: "wolf", loaves: "loaf", potatoes: "potato",
46
+ tomatoes: "tomato", cacti: "cactus", foci: "focus", fungi: "fungus",
47
+ nuclei: "nucleus", syllabi: "syllabus", analyses: "analysis",
48
+ theses: "thesis", crises: "crisis", phenomena: "phenomenon",
49
+ criteria: "criterion", data: "datum",
50
+ };
51
+ const lw = word.toLowerCase();
52
+ if (irregulars[lw]) {
53
+ return word[0] === word[0].toUpperCase()
54
+ ? irregulars[lw].charAt(0).toUpperCase() + irregulars[lw].slice(1)
55
+ : irregulars[lw];
56
+ }
57
+ if (/ies$/i.test(word))
58
+ return word.slice(0, -3) + "y";
59
+ if (/ves$/i.test(word))
60
+ return word.slice(0, -3) + "fe";
61
+ if (/ses$/i.test(word) || /shes$/i.test(word) || /ches$/i.test(word) || /xes$/i.test(word))
62
+ return word.slice(0, -2);
63
+ if (/s$/i.test(word) && !/ss$/i.test(word))
64
+ return word.slice(0, -1);
65
+ return word;
66
+ }
67
+ function wordWrap(s, width = 75, breakChar = "\n", cutLong = false) {
68
+ const words = s.split(" ");
69
+ const lines = [];
70
+ let current = "";
71
+ for (const word of words) {
72
+ if (cutLong && word.length > width) {
73
+ if (current) {
74
+ lines.push(current);
75
+ current = "";
76
+ }
77
+ for (let i = 0; i < word.length; i += width) {
78
+ const chunk = word.slice(i, i + width);
79
+ if (i + width < word.length)
80
+ lines.push(chunk);
81
+ else
82
+ current = chunk;
83
+ }
84
+ }
85
+ else if ((current + (current ? " " : "") + word).length > width) {
86
+ if (current)
87
+ lines.push(current);
88
+ current = word;
89
+ }
90
+ else {
91
+ current = current ? current + " " + word : word;
92
+ }
93
+ }
94
+ if (current)
95
+ lines.push(current);
96
+ return lines.join(breakChar);
97
+ }
98
+ function transliterate(s) {
99
+ const MAP = {
100
+ À: "A", Á: "A", Â: "A", Ã: "A", Ä: "A", Å: "A", Æ: "AE", Ç: "C",
101
+ È: "E", É: "E", Ê: "E", Ë: "E", Ì: "I", Í: "I", Î: "I", Ï: "I",
102
+ Ð: "D", Ñ: "N", Ò: "O", Ó: "O", Ô: "O", Õ: "O", Ö: "O", Ø: "O",
103
+ Ù: "U", Ú: "U", Û: "U", Ü: "U", Ý: "Y", Þ: "TH", ß: "ss",
104
+ à: "a", á: "a", â: "a", ã: "a", ä: "a", å: "a", æ: "ae", ç: "c",
105
+ è: "e", é: "e", ê: "e", ë: "e", ì: "i", í: "i", î: "i", ï: "i",
106
+ ð: "d", ñ: "n", ò: "o", ó: "o", ô: "o", õ: "o", ö: "o", ø: "o",
107
+ ù: "u", ú: "u", û: "u", ü: "u", ý: "y", þ: "th", ÿ: "y",
108
+ };
109
+ return s.split("").map((c) => MAP[c] ?? c).join("");
110
+ }
111
+ const APA_SMALL = new Set([
112
+ "a", "an", "the", "and", "but", "or", "for", "nor", "as", "at", "by", "for",
113
+ "in", "of", "off", "on", "per", "to", "up", "via", "with", "yet", "so",
114
+ ]);
115
+ function executeString(opts, actionMethod) {
116
+ const o = opts;
117
+ switch (actionMethod) {
118
+ case "concat": {
119
+ const { strings, separator = "" } = o;
120
+ if (!Array.isArray(strings))
121
+ throw new Error("Strings array is required");
122
+ return { value: strings.join(separator) };
123
+ }
124
+ case "split": {
125
+ const { string, delimiter, limit } = o;
126
+ if (!string || !delimiter)
127
+ throw new Error("String and delimiter are required");
128
+ const parts = string.split(delimiter);
129
+ return { value: limit ? parts.slice(0, limit) : parts };
130
+ }
131
+ case "join": {
132
+ const { array, separator = "," } = o;
133
+ if (!Array.isArray(array))
134
+ throw new Error("Array is required");
135
+ return { value: array.join(separator) };
136
+ }
137
+ case "replace": {
138
+ const { string, search, replace: replaceWith, case_sensitive = true, use_regex = false } = o;
139
+ if (!string || search === undefined || replaceWith === undefined)
140
+ throw new Error("String, search, and replace are required");
141
+ const flags = case_sensitive ? "" : "i";
142
+ const pattern = use_regex ? new RegExp(search, flags) : new RegExp(escapeRegex(search), flags);
143
+ return { value: string.replace(pattern, replaceWith) };
144
+ }
145
+ case "replace_all": {
146
+ const { string, search, replace: replaceWith, case_sensitive = true, use_regex = false } = o;
147
+ if (!string || search === undefined || replaceWith === undefined)
148
+ throw new Error("String, search, and replace are required");
149
+ const flags = case_sensitive ? "g" : "gi";
150
+ const pattern = use_regex ? new RegExp(search, flags) : new RegExp(escapeRegex(search), flags);
151
+ return { value: string.replace(pattern, replaceWith) };
152
+ }
153
+ case "trim": {
154
+ const { string, chars } = o;
155
+ if (string === undefined || string === null)
156
+ throw new Error("String is required");
157
+ if (chars)
158
+ return { value: string.replace(new RegExp(`^[${escapeRegex(chars)}]+|[${escapeRegex(chars)}]+$`, "g"), "") };
159
+ return { value: string.trim() };
160
+ }
161
+ case "trim_start": {
162
+ const { string, chars } = o;
163
+ if (string === undefined || string === null)
164
+ throw new Error("String is required");
165
+ if (chars)
166
+ return { value: string.replace(new RegExp(`^[${escapeRegex(chars)}]+`, "g"), "") };
167
+ return { value: string.trimStart() };
168
+ }
169
+ case "trim_end": {
170
+ const { string, chars } = o;
171
+ if (string === undefined || string === null)
172
+ throw new Error("String is required");
173
+ if (chars)
174
+ return { value: string.replace(new RegExp(`[${escapeRegex(chars)}]+$`, "g"), "") };
175
+ return { value: string.trimEnd() };
176
+ }
177
+ case "to_uppercase":
178
+ case "uppercase":
179
+ if (!o.string)
180
+ throw new Error("String is required");
181
+ return { value: o.string.toUpperCase() };
182
+ case "to_lowercase":
183
+ case "lowercase":
184
+ if (!o.string)
185
+ throw new Error("String is required");
186
+ return { value: o.string.toLowerCase() };
187
+ case "capitalize": {
188
+ const { string, all_words = false } = o;
189
+ if (!string)
190
+ throw new Error("String is required");
191
+ if (all_words)
192
+ return { value: string.split(" ").map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ") };
193
+ return { value: string.charAt(0).toUpperCase() + string.slice(1).toLowerCase() };
194
+ }
195
+ case "substring": {
196
+ const { string, start, end } = o;
197
+ if (!string || start === undefined)
198
+ throw new Error("String and start are required");
199
+ return { value: end !== undefined ? string.substring(start, end) : string.substring(start) };
200
+ }
201
+ case "length":
202
+ if (o.string === undefined || o.string === null)
203
+ throw new Error("String is required");
204
+ return { value: o.string.length };
205
+ case "contains": {
206
+ const { string, search, case_sensitive = true } = o;
207
+ if (!string || search === undefined)
208
+ throw new Error("String and search are required");
209
+ const s = case_sensitive ? string : string.toLowerCase();
210
+ const q = case_sensitive ? search : search.toLowerCase();
211
+ return { value: s.includes(q) };
212
+ }
213
+ case "starts_with": {
214
+ const { string, prefix, case_sensitive = true } = o;
215
+ if (!string || prefix === undefined)
216
+ throw new Error("String and prefix are required");
217
+ const s = case_sensitive ? string : string.toLowerCase();
218
+ const p = case_sensitive ? prefix : prefix.toLowerCase();
219
+ return { value: s.startsWith(p) };
220
+ }
221
+ case "ends_with": {
222
+ const { string, suffix, case_sensitive = true } = o;
223
+ if (!string || suffix === undefined)
224
+ throw new Error("String and suffix are required");
225
+ const s = case_sensitive ? string : string.toLowerCase();
226
+ const p = case_sensitive ? suffix : suffix.toLowerCase();
227
+ return { value: s.endsWith(p) };
228
+ }
229
+ case "remove_whitespace": {
230
+ const { string, preserve_spaces = false } = o;
231
+ if (!string)
232
+ throw new Error("String is required");
233
+ if (preserve_spaces)
234
+ return { value: string.trim().replace(/\s+/g, " ") };
235
+ return { value: string.replace(/\s+/g, "") };
236
+ }
237
+ case "slugify": {
238
+ const { string, separator = "-", lowercase = true, preserve_case = false } = o;
239
+ if (!string)
240
+ throw new Error("String is required");
241
+ let slug = transliterate(string.trim());
242
+ if (!preserve_case && lowercase)
243
+ slug = slug.toLowerCase();
244
+ slug = slug.replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, separator).replace(new RegExp(`^${escapeRegex(separator)}+|${escapeRegex(separator)}+$`, "g"), "");
245
+ return { value: slug };
246
+ }
247
+ case "pad_start": {
248
+ const { string, length, pad_string = " " } = o;
249
+ if (!string || length === undefined)
250
+ throw new Error("String and length are required");
251
+ return { value: string.padStart(length, pad_string) };
252
+ }
253
+ case "pad_end": {
254
+ const { string, length, pad_string = " " } = o;
255
+ if (!string || length === undefined)
256
+ throw new Error("String and length are required");
257
+ return { value: string.padEnd(length, pad_string) };
258
+ }
259
+ case "reverse":
260
+ if (!o.string)
261
+ throw new Error("String is required");
262
+ return { value: [...o.string].reverse().join("") };
263
+ case "encode_base64": {
264
+ const { string, url_safe = false } = o;
265
+ if (!string)
266
+ throw new Error("String is required");
267
+ const encoded = Buffer.from(string).toString("base64");
268
+ return { value: url_safe ? encoded.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "") : encoded };
269
+ }
270
+ case "decode_base64": {
271
+ const { string, url_safe = false } = o;
272
+ if (!string)
273
+ throw new Error("Base64 string is required");
274
+ let decoded = string;
275
+ if (url_safe) {
276
+ decoded = decoded.replace(/-/g, "+").replace(/_/g, "/");
277
+ while (decoded.length % 4)
278
+ decoded += "=";
279
+ }
280
+ return { value: Buffer.from(decoded, "base64").toString("utf-8") };
281
+ }
282
+ case "encode_uri": {
283
+ const { string, component = true } = o;
284
+ if (!string)
285
+ throw new Error("String is required");
286
+ return { value: component ? encodeURIComponent(string) : encodeURI(string) };
287
+ }
288
+ case "decode_uri": {
289
+ const { string, component = true } = o;
290
+ if (!string)
291
+ throw new Error("Encoded URI string is required");
292
+ return { value: component ? decodeURIComponent(string) : decodeURI(string) };
293
+ }
294
+ case "after": {
295
+ const { string, search } = o;
296
+ if (!string || !search)
297
+ throw new Error("String and search are required");
298
+ const idx = string.indexOf(search);
299
+ return { value: idx === -1 ? string : string.slice(idx + search.length) };
300
+ }
301
+ case "after_last": {
302
+ const { string, search } = o;
303
+ if (!string || !search)
304
+ throw new Error("String and search are required");
305
+ const idx = string.lastIndexOf(search);
306
+ return { value: idx === -1 ? string : string.slice(idx + search.length) };
307
+ }
308
+ case "before": {
309
+ const { string, search } = o;
310
+ if (!string || !search)
311
+ throw new Error("String and search are required");
312
+ const idx = string.indexOf(search);
313
+ return { value: idx === -1 ? string : string.slice(0, idx) };
314
+ }
315
+ case "before_last": {
316
+ const { string, search } = o;
317
+ if (!string || !search)
318
+ throw new Error("String and search are required");
319
+ const idx = string.lastIndexOf(search);
320
+ return { value: idx === -1 ? string : string.slice(0, idx) };
321
+ }
322
+ case "between": {
323
+ const { string, from, to } = o;
324
+ if (!string || !from || !to)
325
+ throw new Error("String, from, and to are required");
326
+ const start = string.indexOf(from);
327
+ const end = string.lastIndexOf(to);
328
+ if (start === -1 || end === -1 || end <= start)
329
+ return { value: string };
330
+ return { value: string.slice(start + from.length, end) };
331
+ }
332
+ case "between_first": {
333
+ const { string, from, to } = o;
334
+ if (!string || !from || !to)
335
+ throw new Error("String, from, and to are required");
336
+ const start = string.indexOf(from);
337
+ if (start === -1)
338
+ return { value: string };
339
+ const end = string.indexOf(to, start + from.length);
340
+ if (end === -1)
341
+ return { value: string };
342
+ return { value: string.slice(start + from.length, end) };
343
+ }
344
+ case "camel": {
345
+ const { string } = o;
346
+ if (!string)
347
+ throw new Error("String is required");
348
+ const s = string.replace(/[-_\s]+(.)/g, (_, c) => c.toUpperCase());
349
+ return { value: s.charAt(0).toLowerCase() + s.slice(1) };
350
+ }
351
+ case "char_at": {
352
+ const { string, index } = o;
353
+ if (!string || index === undefined)
354
+ throw new Error("String and index are required");
355
+ return { value: string.charAt(index) };
356
+ }
357
+ case "chop_start": {
358
+ const { string, needle } = o;
359
+ if (string === undefined || !needle)
360
+ throw new Error("String and needle are required");
361
+ return { value: string.startsWith(needle) ? string.slice(needle.length) : string };
362
+ }
363
+ case "chop_end": {
364
+ const { string, needle } = o;
365
+ if (string === undefined || !needle)
366
+ throw new Error("String and needle are required");
367
+ return { value: string.endsWith(needle) ? string.slice(0, -needle.length) : string };
368
+ }
369
+ case "contains_all": {
370
+ const { string, needles, case_sensitive = true } = o;
371
+ if (!string || !Array.isArray(needles))
372
+ throw new Error("String and needles array are required");
373
+ const s = case_sensitive ? string : string.toLowerCase();
374
+ return { value: needles.every((n) => s.includes(case_sensitive ? n : n.toLowerCase())) };
375
+ }
376
+ case "doesnt_contain": {
377
+ const { string, search, case_sensitive = true } = o;
378
+ if (!string || search === undefined)
379
+ throw new Error("String and search are required");
380
+ const s = case_sensitive ? string : string.toLowerCase();
381
+ const q = case_sensitive ? search : search.toLowerCase();
382
+ return { value: !s.includes(q) };
383
+ }
384
+ case "doesnt_start_with": {
385
+ const { string, prefix, case_sensitive = true } = o;
386
+ if (!string || prefix === undefined)
387
+ throw new Error("String and prefix are required");
388
+ const s = case_sensitive ? string : string.toLowerCase();
389
+ const p = case_sensitive ? prefix : prefix.toLowerCase();
390
+ return { value: !s.startsWith(p) };
391
+ }
392
+ case "doesnt_end_with": {
393
+ const { string, suffix, case_sensitive = true } = o;
394
+ if (!string || suffix === undefined)
395
+ throw new Error("String and suffix are required");
396
+ const s = case_sensitive ? string : string.toLowerCase();
397
+ const p = case_sensitive ? suffix : suffix.toLowerCase();
398
+ return { value: !s.endsWith(p) };
399
+ }
400
+ case "deduplicate": {
401
+ const { string, character = " " } = o;
402
+ if (string === undefined || string === null)
403
+ throw new Error("String is required");
404
+ const esc = escapeRegex(character);
405
+ return { value: string.replace(new RegExp(`${esc}{2,}`, "g"), character) };
406
+ }
407
+ case "excerpt": {
408
+ const { string, phrase, radius = 100, omission = "..." } = o;
409
+ if (!string || !phrase)
410
+ throw new Error("String and phrase are required");
411
+ const idx = string.toLowerCase().indexOf(phrase.toLowerCase());
412
+ if (idx === -1)
413
+ return { value: string.length > radius * 2 ? omission + string.slice(0, radius) + omission : string };
414
+ const start = Math.max(0, idx - radius);
415
+ const end = Math.min(string.length, idx + phrase.length + radius);
416
+ const pre = start > 0 ? omission : "";
417
+ const post = end < string.length ? omission : "";
418
+ return { value: pre + string.slice(start, end) + post };
419
+ }
420
+ case "finish": {
421
+ const { string, cap } = o;
422
+ if (string === undefined || !cap)
423
+ throw new Error("String and cap are required");
424
+ return { value: string.endsWith(cap) ? string : string + cap };
425
+ }
426
+ case "start": {
427
+ const { string, prefix } = o;
428
+ if (string === undefined || !prefix)
429
+ throw new Error("String and prefix are required");
430
+ return { value: string.startsWith(prefix) ? string : prefix + string };
431
+ }
432
+ case "headline": {
433
+ const { string } = o;
434
+ if (!string)
435
+ throw new Error("String is required");
436
+ const words = string.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().split(/\s+/);
437
+ return { value: words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ") };
438
+ }
439
+ case "is": {
440
+ const { string, pattern } = o;
441
+ if (!string || !pattern)
442
+ throw new Error("String and pattern are required");
443
+ const regex = new RegExp("^" + escapeRegex(pattern).replace(/\\\*/g, ".*") + "$");
444
+ return { value: regex.test(string) };
445
+ }
446
+ case "is_ascii":
447
+ if (o.string === undefined || o.string === null)
448
+ throw new Error("String is required");
449
+ return { value: /^[\x00-\x7F]*$/.test(o.string) };
450
+ case "is_json":
451
+ if (o.string === undefined || o.string === null)
452
+ throw new Error("String is required");
453
+ try {
454
+ JSON.parse(o.string);
455
+ return { value: true };
456
+ }
457
+ catch {
458
+ return { value: false };
459
+ }
460
+ case "is_ulid":
461
+ if (o.string === undefined || o.string === null)
462
+ throw new Error("String is required");
463
+ return { value: /^[0-9A-Z]{26}$/i.test(o.string) };
464
+ case "is_url": {
465
+ const { string, protocols = ["http", "https"] } = o;
466
+ if (!string)
467
+ throw new Error("String is required");
468
+ try {
469
+ const u = new URL(string);
470
+ const proto = u.protocol.replace(":", "");
471
+ return { value: protocols.includes(proto) };
472
+ }
473
+ catch {
474
+ return { value: false };
475
+ }
476
+ }
477
+ case "is_uuid":
478
+ if (o.string === undefined || o.string === null)
479
+ throw new Error("String is required");
480
+ return { value: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(o.string) };
481
+ case "is_empty":
482
+ if (o.string === undefined || o.string === null)
483
+ return { value: true };
484
+ return { value: str(o.string).trim().length === 0 };
485
+ case "is_match": {
486
+ const { string, pattern, flags = "" } = o;
487
+ if (string === undefined || !pattern)
488
+ throw new Error("String and pattern are required");
489
+ return { value: new RegExp(pattern, flags).test(string) };
490
+ }
491
+ case "kebab": {
492
+ const { string } = o;
493
+ if (!string)
494
+ throw new Error("String is required");
495
+ return { value: string.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase() };
496
+ }
497
+ case "snake": {
498
+ const { string, delimiter = "_" } = o;
499
+ if (!string)
500
+ throw new Error("String is required");
501
+ return { value: string.replace(/([a-z])([A-Z])/g, `$1${delimiter}$2`).replace(/[\s-]+/g, delimiter).toLowerCase() };
502
+ }
503
+ case "studly": {
504
+ const { string } = o;
505
+ if (!string)
506
+ throw new Error("String is required");
507
+ const s = string.replace(/[-_\s]+(.)/g, (_, c) => c.toUpperCase());
508
+ return { value: s.replace(/^(.)/, (c) => c.toUpperCase()) };
509
+ }
510
+ case "title":
511
+ if (!o.string)
512
+ throw new Error("String is required");
513
+ return { value: o.string.replace(/\w\S*/g, (w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()) };
514
+ case "lcfirst":
515
+ if (!o.string)
516
+ throw new Error("String is required");
517
+ return { value: o.string.charAt(0).toLowerCase() + o.string.slice(1) };
518
+ case "ucfirst":
519
+ if (!o.string)
520
+ throw new Error("String is required");
521
+ return { value: o.string.charAt(0).toUpperCase() + o.string.slice(1) };
522
+ case "ucwords": {
523
+ const { string, separators = " " } = o;
524
+ if (!string)
525
+ throw new Error("String is required");
526
+ const sepRe = new RegExp(`([${escapeRegex(separators)}])`, "g");
527
+ return { value: string.split(sepRe).map((part) => separators.includes(part) ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("") };
528
+ }
529
+ case "ucsplit": {
530
+ const { string } = o;
531
+ if (!string)
532
+ throw new Error("String is required");
533
+ return { value: string.replace(/([A-Z])/g, " $1").trim().split(/\s+/) };
534
+ }
535
+ case "limit": {
536
+ const { string, limit: lim = 100, end = "..." } = o;
537
+ if (string === undefined || string === null)
538
+ throw new Error("String is required");
539
+ if (string.length <= lim)
540
+ return { value: string };
541
+ return { value: string.slice(0, lim) + end };
542
+ }
543
+ case "mask": {
544
+ const { string, character = "*", index, length } = o;
545
+ if (!string || index === undefined)
546
+ throw new Error("String and index are required");
547
+ const len = string.length;
548
+ const start = index < 0 ? Math.max(0, len + index) : Math.min(index, len);
549
+ const maskLen = length !== undefined
550
+ ? (length < 0 ? Math.max(0, len + length - start) : Math.min(length, len - start))
551
+ : len - start;
552
+ return { value: string.slice(0, start) + character.repeat(maskLen) + string.slice(start + maskLen) };
553
+ }
554
+ case "match": {
555
+ const { string, pattern, flags = "" } = o;
556
+ if (!string || !pattern)
557
+ throw new Error("String and pattern are required");
558
+ const m = string.match(new RegExp(pattern, flags));
559
+ return { value: m ? (m[1] ?? m[0]) : null };
560
+ }
561
+ case "match_all": {
562
+ const { string, pattern, flags = "g" } = o;
563
+ if (!string || !pattern)
564
+ throw new Error("String and pattern are required");
565
+ const re = new RegExp(pattern, flags.includes("g") ? flags : flags + "g");
566
+ const results = [];
567
+ let m;
568
+ while ((m = re.exec(string)) !== null)
569
+ results.push(m[1] ?? m[0]);
570
+ return { value: results };
571
+ }
572
+ case "pad_both": {
573
+ const { string, length, pad_string = " " } = o;
574
+ if (string === undefined || length === undefined)
575
+ throw new Error("String and length are required");
576
+ const totalPad = Math.max(0, length - string.length);
577
+ const leftPad = Math.floor(totalPad / 2);
578
+ const rightPad = totalPad - leftPad;
579
+ const pad = (n) => pad_string.repeat(Math.ceil(n / pad_string.length)).slice(0, n);
580
+ return { value: pad(leftPad) + string + pad(rightPad) };
581
+ }
582
+ case "plural": {
583
+ const { string, count = 2 } = o;
584
+ if (!string)
585
+ throw new Error("String is required");
586
+ return { value: pluralise(string, count) };
587
+ }
588
+ case "singular": {
589
+ const { string } = o;
590
+ if (!string)
591
+ throw new Error("String is required");
592
+ return { value: singularise(string) };
593
+ }
594
+ case "position": {
595
+ const { string, search, offset = 0, case_sensitive = true } = o;
596
+ if (!string || !search)
597
+ throw new Error("String and search are required");
598
+ const s = case_sensitive ? string : string.toLowerCase();
599
+ const q = case_sensitive ? search : search.toLowerCase();
600
+ const idx = s.indexOf(q, offset);
601
+ return { value: idx === -1 ? null : idx };
602
+ }
603
+ case "random": {
604
+ const { length = 16, charset = "alphanumeric" } = o;
605
+ const chars = {
606
+ alphanumeric: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
607
+ alpha: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
608
+ numeric: "0123456789",
609
+ hex: "0123456789abcdef",
610
+ lowercase: "abcdefghijklmnopqrstuvwxyz",
611
+ uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
612
+ };
613
+ const pool = chars[charset] ?? chars.alphanumeric;
614
+ const bytes = (0, crypto_1.randomBytes)(length);
615
+ return { value: Array.from(bytes).map((b) => pool[b % pool.length]).join("") };
616
+ }
617
+ case "remove": {
618
+ const { string, search, case_sensitive = true } = o;
619
+ if (string === undefined || search === undefined)
620
+ throw new Error("String and search are required");
621
+ const needles = Array.isArray(search) ? search : [search];
622
+ let result = string;
623
+ for (const needle of needles) {
624
+ const flags = case_sensitive ? "g" : "gi";
625
+ result = result.replace(new RegExp(escapeRegex(needle), flags), "");
626
+ }
627
+ return { value: result };
628
+ }
629
+ case "repeat": {
630
+ const { string, times } = o;
631
+ if (string === undefined || times === undefined)
632
+ throw new Error("String and times are required");
633
+ return { value: string.repeat(times) };
634
+ }
635
+ case "replace_array": {
636
+ const { string, search, replace: values } = o;
637
+ if (!string || !search || !Array.isArray(values))
638
+ throw new Error("String, search, and replace array are required");
639
+ let i = 0;
640
+ return { value: string.replace(new RegExp(escapeRegex(search), "g"), () => str(values[i++] ?? "")) };
641
+ }
642
+ case "replace_first": {
643
+ const { string, search, replace: replaceWith } = o;
644
+ if (!string || search === undefined || replaceWith === undefined)
645
+ throw new Error("String, search, and replace are required");
646
+ return { value: string.replace(search, replaceWith) };
647
+ }
648
+ case "replace_last": {
649
+ const { string, search, replace: replaceWith } = o;
650
+ if (!string || search === undefined || replaceWith === undefined)
651
+ throw new Error("String, search, and replace are required");
652
+ const idx = string.lastIndexOf(search);
653
+ if (idx === -1)
654
+ return { value: string };
655
+ return { value: string.slice(0, idx) + replaceWith + string.slice(idx + search.length) };
656
+ }
657
+ case "replace_matches": {
658
+ const { string, pattern, replace: replaceWith, flags = "g" } = o;
659
+ if (!string || !pattern || replaceWith === undefined)
660
+ throw new Error("String, pattern, and replace are required");
661
+ return { value: string.replace(new RegExp(pattern, flags), replaceWith) };
662
+ }
663
+ case "replace_start": {
664
+ const { string, search, replace: replaceWith } = o;
665
+ if (string === undefined || search === undefined || replaceWith === undefined)
666
+ throw new Error("String, search, and replace are required");
667
+ return { value: string.startsWith(search) ? replaceWith + string.slice(search.length) : string };
668
+ }
669
+ case "replace_end": {
670
+ const { string, search, replace: replaceWith } = o;
671
+ if (string === undefined || search === undefined || replaceWith === undefined)
672
+ throw new Error("String, search, and replace are required");
673
+ return { value: string.endsWith(search) ? string.slice(0, -search.length) + replaceWith : string };
674
+ }
675
+ case "squish":
676
+ if (o.string === undefined || o.string === null)
677
+ throw new Error("String is required");
678
+ return { value: o.string.trim().replace(/\s+/g, " ") };
679
+ case "substr": {
680
+ const { string, start, length } = o;
681
+ if (!string || start === undefined)
682
+ throw new Error("String and start are required");
683
+ const s = string;
684
+ const from = start < 0 ? Math.max(0, s.length + start) : start;
685
+ return { value: length !== undefined ? s.slice(from, from + length) : s.slice(from) };
686
+ }
687
+ case "substr_count": {
688
+ const { string, needle, case_sensitive = true } = o;
689
+ if (!string || !needle)
690
+ throw new Error("String and needle are required");
691
+ const s = case_sensitive ? string : string.toLowerCase();
692
+ const n = case_sensitive ? needle : needle.toLowerCase();
693
+ let count = 0, pos = 0;
694
+ while ((pos = s.indexOf(n, pos)) !== -1) {
695
+ count++;
696
+ pos += n.length;
697
+ }
698
+ return { value: count };
699
+ }
700
+ case "substr_replace": {
701
+ const { string, replace: replaceWith, offset, length } = o;
702
+ if (!string || replaceWith === undefined || offset === undefined)
703
+ throw new Error("String, replace, and offset are required");
704
+ const s = string;
705
+ const from = offset < 0 ? Math.max(0, s.length + offset) : offset;
706
+ const end = length !== undefined ? from + length : s.length;
707
+ return { value: s.slice(0, from) + replaceWith + s.slice(end) };
708
+ }
709
+ case "swap": {
710
+ const { string, map } = o;
711
+ if (!string || !map)
712
+ throw new Error("String and map are required");
713
+ const keys = Object.keys(map).sort((a, b) => b.length - a.length);
714
+ const pattern = keys.map(escapeRegex).join("|");
715
+ if (!pattern)
716
+ return { value: string };
717
+ return { value: string.replace(new RegExp(pattern, "g"), (match) => str(map[match])) };
718
+ }
719
+ case "take": {
720
+ const { string, count } = o;
721
+ if (string === undefined || count === undefined)
722
+ throw new Error("String and count are required");
723
+ return { value: count >= 0 ? string.slice(0, count) : string.slice(count) };
724
+ }
725
+ case "word_count":
726
+ if (o.string === undefined || o.string === null)
727
+ throw new Error("String is required");
728
+ const trimmed = o.string.trim();
729
+ return { value: trimmed === "" ? 0 : trimmed.split(/\s+/).length };
730
+ case "word_wrap": {
731
+ const { string, characters = 75, break: breakChar = "\n", cut_long_words = false } = o;
732
+ if (!string)
733
+ throw new Error("String is required");
734
+ return { value: wordWrap(string, characters, breakChar, cut_long_words) };
735
+ }
736
+ case "words": {
737
+ const { string, words: limit = 100, end = "..." } = o;
738
+ if (!string)
739
+ throw new Error("String is required");
740
+ const parts = string.trim().split(/\s+/);
741
+ if (parts.length <= limit)
742
+ return { value: string };
743
+ return { value: parts.slice(0, limit).join(" ") + end };
744
+ }
745
+ case "wrap": {
746
+ const { string, before, after } = o;
747
+ if (string === undefined || !before)
748
+ throw new Error("String and before are required");
749
+ return { value: before + string + (after ?? before) };
750
+ }
751
+ case "unwrap": {
752
+ const { string, before, after } = o;
753
+ if (string === undefined || !before)
754
+ throw new Error("String and before are required");
755
+ const suf = after ?? before;
756
+ let result = string;
757
+ if (result.startsWith(before))
758
+ result = result.slice(before.length);
759
+ if (result.endsWith(suf))
760
+ result = result.slice(0, -suf.length);
761
+ return { value: result };
762
+ }
763
+ case "uuid": {
764
+ const bytes = (0, crypto_1.randomBytes)(16);
765
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
766
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
767
+ const hex = bytes.toString("hex");
768
+ return { value: `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}` };
769
+ }
770
+ case "ulid": {
771
+ const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
772
+ const ts = Date.now();
773
+ const rand = (0, crypto_1.randomBytes)(10);
774
+ let result = "";
775
+ let t = ts;
776
+ for (let i = 9; i >= 0; i--) {
777
+ result = ENCODING[t % 32] + result;
778
+ t = Math.floor(t / 32);
779
+ }
780
+ let rVal = BigInt("0x" + rand.toString("hex"));
781
+ let rStr = "";
782
+ for (let i = 15; i >= 0; i--) {
783
+ rStr = ENCODING[Number(rVal % 32n)] + rStr;
784
+ rVal /= 32n;
785
+ }
786
+ return { value: result + rStr };
787
+ }
788
+ case "strip_tags": {
789
+ const { string, allowed_tags = "" } = o;
790
+ if (string === undefined || string === null)
791
+ throw new Error("String is required");
792
+ if (!allowed_tags)
793
+ return { value: string.replace(/<[^>]*>/g, "") };
794
+ const allowed = allowed_tags.split(",").map((t) => t.trim().toLowerCase());
795
+ return { value: string.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g, (match, tag) => allowed.includes(tag.toLowerCase()) ? match : "") };
796
+ }
797
+ case "ascii":
798
+ if (!o.string)
799
+ throw new Error("String is required");
800
+ return { value: transliterate(o.string).replace(/[^\x00-\x7F]/g, "") };
801
+ case "apa": {
802
+ const { string } = o;
803
+ if (!string)
804
+ throw new Error("String is required");
805
+ const words = string.trim().split(/\s+/);
806
+ return { value: words.map((w, i) => {
807
+ const low = w.toLowerCase();
808
+ return (i === 0 || !APA_SMALL.has(low))
809
+ ? w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
810
+ : low;
811
+ }).join(" ") };
812
+ }
813
+ case "class_basename": {
814
+ const { class_name, delimiter = "\\" } = o;
815
+ if (!class_name)
816
+ throw new Error("class_name is required");
817
+ const parts = class_name.split(delimiter);
818
+ return { value: parts[parts.length - 1] };
819
+ }
820
+ default: {
821
+ const val = o.value ?? o.string ?? "";
822
+ return { value: String(val) };
823
+ }
824
+ }
825
+ }