import { b as $325a3faab7a68acd$export$a16aca283550c30d } from "./Separator-BPvqJny4.js";
import { useCallback, useMemo } from "react";
function $bb77f239b46e8c72$export$3274cf84b703fff(options) {
  let collator = $325a3faab7a68acd$export$a16aca283550c30d({
    usage: "search",
    ...options
  });
  let startsWith = useCallback((string, substring) => {
    if (substring.length === 0) return true;
    string = string.normalize("NFC");
    substring = substring.normalize("NFC");
    return collator.compare(string.slice(0, substring.length), substring) === 0;
  }, [
    collator
  ]);
  let endsWith = useCallback((string, substring) => {
    if (substring.length === 0) return true;
    string = string.normalize("NFC");
    substring = substring.normalize("NFC");
    return collator.compare(string.slice(-substring.length), substring) === 0;
  }, [
    collator
  ]);
  let contains = useCallback((string, substring) => {
    if (substring.length === 0) return true;
    string = string.normalize("NFC");
    substring = substring.normalize("NFC");
    let scan = 0;
    let sliceLen = substring.length;
    for (; scan + sliceLen <= string.length; scan++) {
      let slice = string.slice(scan, scan + sliceLen);
      if (collator.compare(substring, slice) === 0) return true;
    }
    return false;
  }, [
    collator
  ]);
  return useMemo(() => ({
    startsWith,
    endsWith,
    contains
  }), [
    startsWith,
    endsWith,
    contains
  ]);
}
export {
  $bb77f239b46e8c72$export$3274cf84b703fff as $
};
