The text to split.
Maximum chunk length in UTF-16 code units (positive safe integer).
Literal split points in priority order (default: ['\n', ' ', '.']).
The trimmed, non-empty chunks.
Math.floor(max_length / 2) and
its end within the limit. Separators stay in the preceding chunk unless trimmed.max_length = 1 is
the sole length-limit exception (2 units). Unpaired surrogates are preserved.
Splits text into trimmed, non-empty chunks, preferring separators over forced splits.