PageSourceSearch

https://thg-experten.de/assets/controllers/regex_controller-6de33f…738dea6f687c83fdaafc61df9da8ec2d1dd1ad2e.js

js thg-experten.de collected 2026-10-08 20:30:37 UTC 715 bytes, 32 lines download raw bytes

1import { Controller } from "@hotwired/stimulus";
2
3export default class extends Controller {
4  static targets = ["input"];
5
6  connect() {
7    this.updatePattern();
8  }
9
10  changed() {
11    this.updatePattern();
12  }
13
14  updatePattern() {
15    const role = document.querySelector(".js-role-radio:checked")?.value;
16    const accountHolder = this.inputTarget;
17
18    if (role === "company") {
19      accountHolder.setAttribute(
20        "pattern",
21        accountHolder.dataset.companyPattern,
22      );
23    } else if (role === "individual") {
24      accountHolder.setAttribute(
25        "pattern",
26        accountHolder.dataset.individualPattern,
27      );
28    } else {
29      accountHolder.removeAttribute("pattern");
30    }
31  }
32};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.