PageSourceSearch

https://space-apps-eosin.vercel.app/stuquery.js

js space-apps-eosin.vercel.app collected 2026-10-03 07:46:29 UTC 17,687 bytes, 698 lines download raw bytes

1/*!
2 * stuQuery
3 */
4(function (b) {
5  var f = {};
6  function d(h) {
7    this.stuquery = "1.0.26";
8    this.getBy = function (q, p) {
9      var o, l, n;
10      o = -1;
11      var j = [];
12      if (p.indexOf(":eq") > 0) {
13        l = p.replace(/(.*)\:eq\(([0-9]+)\)/, "$1 $2").split(" ");
14        p = l[0];
15        o = parseInt(l[1]);
16      }
17      if (p[0] == ".") {
18        h = q.getElementsByClassName(p.substr(1));
19      } else {
20        if (p[0] == "#") {
21          h = q.getElementById(p.substr(1));
22        } else {
23          h = q.getElementsByTagName(p);
24        }
25      }
26      if (!h) {
27        h = [];
28      }
29      if (h.nodeName && h.nodeName == "SELECT") {
30        j.push(h);
31      } else {
32        if (typeof h.length !== "number") {
33          h = [h];
34        }
35        for (n = 0; n < h.length; n++) {
36          j.push(h[n]);
37        }
38        if (o >= 0 && j.length > 0) {
39          if (o < j.length) {
40            j = [j[o]];
41          } else {
42            j = [];
43          }
44        }
45      }
46      return j;
47    };
48    this.matchSelector = function (l, k) {
49      if (k[0] == ".") {
50        k = k.substr(1);
51        for (var j = 0; j < l.classList.length; j++) {
52          if (l.classList[j] == k) {
53            return true;
54          }
55        }
56      } else {
57        if (k[0] == "#") {
58          if (l.id == k.substr(1)) {
59            return true;
60          }
61        } else {
62          if (l.tagName == k.toUpperCase()) {
63            return true;
64          }
65        }
66      }
67      return false;
68    };
69    if (typeof h === "string") {
70      this.e = this.querySelector(document, h);
71    } else {
72      if (typeof h === "object") {
73        this.e = typeof h.length == "number" ? h : [h];
74      }
75    }
76    for (var i in this.e) {
77      if (this.e[i]) {
78        this[i] = this.e[i];
79      }
80    }
81    this.length = this.e ? this.e.length : 0;
82    return this;
83  }
84  d.prototype.querySelector = function (m, h) {
85    var s = [];
86    var q, r, p, n, l, o;
87    if (h.indexOf(":eq") >= 0) {
88      q = h.split(" ");
89      for (p = 0; p < q.length; p++) {
90        if (p == 0) {
91          o = this.getBy(m, q[p]);
92        } else {
93          r = [];
94          for (n = 0; n < o.length; n++) {
95            r = r.concat(this.getBy(o[n], q[p]));
96          }
97          o = r.splice(0);
98        }
99      }
100    } else {
101      o = m.querySelectorAll(h);
102    }
103    for (l = 0; l < o.length; l++) {
104      s.push(o[l]);
105    }
106    return s;
107  };
108  d.prototype.ready = function (h) {
109    if (/in/.test(document.readyState)) {
110      setTimeout("S(document).ready(" + h + ")", 9);
111    } else {
112      h();
113    }
114  };
115  d.prototype.html = function (j) {
116    if (typeof j === "number") {
117      j = "" + j;
118    }
119    if (typeof j !== "string" && this.length == 1) {
120      return this[0].innerHTML;
121    }
122    if (typeof j === "string") {
123      for (var h = 0; h < this.length; h++) {
124        this[h].innerHTML = j;
125      }
126    }
127    return this;
128  };
129  d.prototype.append = function (j) {
130    if (!j && this.length == 1) {
131      return this[0].innerHTML;
132    }
133    if (j) {
134      for (var h = 0; h < this.length; h++) {
135        var k = document.createElement("template");
136        k.innerHTML = j;
137        var l = typeof k.content === "undefined" ? k : k.content;
138        if (l.childNodes.length > 0) {
139          while (l.childNodes.length > 0) {
140            this[h].appendChild(l.childNodes[0]);
141          }
142        } else {
143          this[h].append(j);
144        }
145      }
146    }
147    return this;
148  };
149  d.prototype.prepend = function (l) {
150    var k, h, n, m;
151    if (!l && this.length == 1) {
152      return this[0].innerHTML;
153    }
154    for (k = 0; k < this.length; k++) {
155      n = document.createElement("div");
156      n.innerHTML = l;
157      m = n.childNodes;
158      for (h = m.length - 1; h >= 0; h--) {
159        this[k].insertBefore(m[h], this[k].firstChild);
160      }
161    }
162    return this;
163  };
164  d.prototype.before = function (l) {
165    var k, n, m, h;
166    for (k = 0; k < this.length; k++) {
167      n = document.createElement("div");
168      n.innerHTML = l;
169      m = n.childNodes;
170      for (h = 0; h < m.length; h++) {
171        this[k].parentNode.insertBefore(m[h], this[k]);
172      }
173    }
174    return this;
175  };
176  d.prototype.after = function (j) {
177    for (var h = 0; h < this.length; h++) {
178      this[h].insertAdjacentHTML("afterend", j);
179    }
180    return this;
181  };
182  function g(h, k) {
183    if (h && h.length > 0) {
184      for (var j = 0; j < h.length; j++) {
185        if (h[j].node == k) {
186          return { success: true, match: j };
187        }
188      }
189    }
190    return { success: false };
191  }
192  function e(l, j, i, h, k) {
193    if (!f[j]) {
194      f[j] = [];
195    }
196    f[j].push({ node: l, fn: i, fn2: h, data: k });
197  }
198  function a(i) {
199    if (f[i.type]) {
200      var h = g(f[i.type], i.currentTarget);
201      if (h.success) {
202        if (h.match.data) {
203          i.data = f[i.type][h.match].data;
204        }
205        return { fn: f[i.type][h.match].fn, data: i };
206      }
207    }
208    return function () {
209      return { fn: "" };
210    };
211  }
212  d.prototype.off = function (k) {
213    if (typeof Element.prototype.removeEventListener !== "function") {
214      Element.prototype.removeEventListener = function (q, n) {
215        if (!oListeners.hasOwnProperty(q)) {
216          return;
217        }
218        var m = oListeners[q];
219        for (var i = -1, l = 0; l < m.aEls.length; l++) {
220          if (m.aEls[l] === this) {
221            i = l;
222            break;
223          }
224        }
225        if (i === -1) {
226          return;
227        }
228        for (var p = 0, o = m.aEvts[i]; p < o.length; p++) {
229          if (o[p] === n) {
230            o.splice(p, 1);
231          }
232        }
233      };
234    }
235    for (var j = 0; j < this.length; j++) {
236      var h = g(f[k], this.e[j]);
237      if (h.success) {
238        this[j].removeEventListener(k, f[k][h.match].fn2, false);
239        f[k].splice(h.match, 1);
240      }
241    }
242    return this;
243  };
244  d.prototype.on = function (m, o, k) {
245    var j = (m || window.event).split(/ /);
246    if (typeof o === "function" && !k) {
247      k = o;
248      o = "";
249    }
250    if (typeof k !== "function") {
251      return this;
252    }
253    if (this.length > 0) {
254      var p = this;
255      var n;
256      for (var l = 0; l < j.length; l++) {
257        m = j[l];
258        n = function (i) {
259          var q = a({
260            currentTarget: this,
261            type: m,
262            data: o,
263            originalEvent: i,
264            preventDefault: function () {
265              if (i.preventDefault) {
266                i.preventDefault();
267              }
268            },
269            stopPropagation: function () {
270              if (i.stopImmediatePropagation) {
271                i.stopImmediatePropagation();
272              }
273              if (i.stopPropagation) {
274                i.stopPropagation();
275              }
276              if (i.cancelBubble != null) {
277                i.cancelBubble = true;
278              }
279            },
280          });
281          if (typeof q.fn === "function") {
282            return q.fn.call(p, q.data);
283          }
284        };
285        for (var h = 0; h < this.length; h++) {
286          e(this[h], m, k, n, o);
287          if (this[h].addEventListener) {
288            this[h].addEventListener(m, n, false);
289          } else {
290            if (this[h].attachEvent) {
291              this[h].attachEvent(m, n);
292            }
293          }
294        }
295      }
296    }
297    return this;
298  };
299  d.prototype.trigger = function (m, n) {
300    var l;
301    var j = m.split(/ /);
302    for (var k = 0; k < j.length; k++) {
303      if (document.createEvent) {
304        l = document.createEvent("HTMLEvents");
305        l.initEvent(n || j[k], true, true);
306      } else {
307        l = document.createEventObject();
308        l.eventType = n || j[k];
309      }
310      l.eventName = m;
311      for (var h = 0; h < this.length; h++) {
312        if (document.createEvent) {
313          this[h].dispatchEvent(l);
314        } else {
315          this[h].fireEvent("on" + l.eventType, l);
316        }
317      }
318    }
319    return this;
320  };
321  d.prototype.focus = function () {
322    if (this.length == 1) {
323      this[0].focus();
324    }
325    return this;
326  };
327  d.prototype.blur = function () {
328    if (this.length == 1) {
329      this[0].blur();
330    }
331    return this;
332  };
333  d.prototype.remove = function () {
334    if (this.length < 1) {
335      return this;
336    }
337    for (var h = this.length - 1; h >= 0; h--) {
338      if (!this[h]) {
339        return;
340      }
341      if (typeof this[h].remove === "function") {
342        this[h].remove();
343      } else {
344        if (typeof this[h].parentElement.removeChild === "function") {
345          this[h].parentElement.removeChild(this[h]);
346        }
347      }
348    }
349    return this;
350  };
351  d.prototype.hasClass = function (j) {
352    var h = true;
353    for (var k = 0; k < this.length; k++) {
354      if (!this[k].className.match(new RegExp("(\\s|^)" + j + "(\\s|$)"))) {
355        h = false;
356      }
357    }
358    return h;
359  };
360  d.prototype.toggleClass = function (h) {
361    for (var j = 0; j < this.length; j++) {
362      if (this[j].className.match(new RegExp("(\\s|^)" + h + "(\\s|$)"))) {
363        this[j].className = this[j].className
364          .replace(new RegExp("(\\s|^)" + h + "(\\s|$)", "g"), " ")
365          .replace(/ $/, "");
366      } else {
367        this[j].className = (this[j].className + " " + h).replace(/^ /, "");
368      }
369    }
370    return this;
371  };
372  d.prototype.addClass = function (h) {
373    for (var j = 0; j < this.length; j++) {
374      if (!this[j].className.match(new RegExp("(\\s|^)" + h + "(\\s|$)"))) {
375        this[j].className = (this[j].className + " " + h).replace(/^ /, "");
376      }
377    }
378    return this;
379  };
380  d.prototype.removeClass = function (h) {
381    for (var j = 0; j < this.length; j++) {
382      while (this[j].className.match(new RegExp("(\\s|^)" + h + "(\\s|$)"))) {
383        this[j].className = this[j].className
384          .replace(new RegExp("(\\s|^)" + h + "(\\s|$)", "g"), " ")
385          .replace(/ $/, "")
386          .replace(/^ /, "");
387      }
388    }
389    return this;
390  };
391  d.prototype.css = function (l) {
392    var q, k, o;
393    if (this.length == 1 && typeof l === "string") {
394      q = window.getComputedStyle(this[0]);
395      return q[l];
396    }
397    for (k = 0; k < this.length; k++) {
398      q = {};
399      var h = this[k].getAttribute("style");
400      if (h) {
401        var p = this[k].getAttribute("style").split(";");
402        for (var n = 0; n < p.length; n++) {
403          var j = p[n].split(":");
404          if (j.length == 2) {
405            q[j[0]] = j[1];
406          }
407        }
408      }
409      if (typeof l === "object") {
410        for (o in l) {
411          if (typeof l[o] !== "undefined") {
412            q[o] = l[o];
413          }
414        }
415        var m = "";
416        for (o in q) {
417          if (typeof q[o] !== "undefined") {
418            if (m) {
419              m += ";";
420            }
421            if (q[o]) {
422              m += o + ":" + q[o];
423            }
424          }
425        }
426        this[k].setAttribute("style", m);
427      }
428    }
429    return this;
430  };
431  d.prototype.parent = function () {
432    var j = [];
433    for (var h = 0; h < this.length; h++) {
434      j.push(this[h].parentElement);
435    }
436    return S(j);
437  };
438  d.prototype.children = function (l) {
439    var j;
440    if (typeof l === "string") {
441      var h = [];
442      for (j = 0; j < this.length; j++) {
443        for (var k = 0; k < this[j].children.length; k++) {
444          if (this.matchSelector(this[j].children[k], l)) {
445            h.push(this[j].children[k]);
446          }
447        }
448      }
449      return S(h);
450    } else {
451      for (j = 0; j < this.length; j++) {
452        this[j] = this[j].children.length > l ? this[j].children[l] : this[j];
453      }
454      return this;
455    }
456  };
457  d.prototype.find = function (j) {
458    var h = [];
459    for (var k = 0; k < this.length; k++) {
460      h = h.concat(this.querySelector(this[k], j));
461    }
462    return S(h);
463  };
464  function c(p, h, q, k) {
465    var o = [];
466    for (var n = 0; n < p.length; n++) {
467      o.push(p[n].getAttribute(h));
468      var m = false;
469      for (var l in k) {
470        if (typeof q === k[l]) {
471          m = true;
472        }
473      }
474      if (m) {
475        if (q) {
476          p[n].setAttribute(h, q);
477        } else {
478          p[n].removeAttribute(h);
479        }
480      }
481    }
482    if (o.length == 1) {
483      o = o[0];
484    }
485    if (typeof q === "undefined") {
486      return o;
487    } else {
488      return p;
489    }
490  }
491  d.prototype.attr = function (h, i) {
492    return c(this, h, i, ["string", "number"]);
493  };
494  d.prototype.prop = function (h, i) {
495    return c(this, h, i, ["boolean"]);
496  };
497  d.prototype.clone = function () {
498    var h = document.createElement("div");
499    h.appendChild(this[0].cloneNode(true));
500    return h.innerHTML;
501  };
502  d.prototype.replaceWith = function (k) {
503    var h;
504    var l = S(this.e);
505    for (var j = 0; j < this.length; j++) {
506      h = document.createElement("div");
507      h.innerHTML = k;
508      l[j] = h.cloneNode(true);
509      this[j].parentNode.replaceChild(l[j], this[j]);
510    }
511    return l;
512  };
513  d.prototype.width = function () {
514    if (this.length > 1) {
515      return;
516    }
517    return this[0].offsetWidth;
518  };
519  d.prototype.height = function () {
520    if (this.length > 1) {
521      return;
522    }
523    return this[0].offsetHeight;
524  };
525  d.prototype.outerWidth = function () {
526    if (this.length > 1) {
527      return;
528    }
529    var h = getComputedStyle(this[0]);
530    return (
531      this[0].offsetWidth + parseInt(h.marginLeft) + parseInt(h.marginRight)
532    );
533  };
534  d.prototype.outerHeight = function () {
535    if (this.length > 1) {
536      return;
537    }
538    var h = getComputedStyle(this[0]);
539    return (
540      this[0].offsetHeight + parseInt(h.marginTop) + parseInt(h.marginBottom)
541    );
542  };
543  d.prototype.offset = function () {
544    var h = this[0].getBoundingClientRect();
545    return {
546      top: h.top + document.body.scrollTop,
547      left: h.left + document.body.scrollLeft,
548    };
549  };
550  d.prototype.position = function () {
551    if (this.length > 1) {
552      return;
553    }
554    return { left: this[0].offsetLeft, top: this[0].offsetTop };
555  };
556  d.prototype.ajax = function (i, s) {
557    if (typeof i !== "string") {
558      return false;
559    }
560    if (!s) {
561      s = {};
562    }
563    var l = "",
564      o = "";
565    var q, r;
566    if (i.indexOf("?") > 0) {
567      r = i.split("?");
568      if (r.length) {
569        i = r[0];
570        o = r[1];
571      }
572    }
573    if (s.dataType == "jsonp") {
574      l = "fn_" + new Date().getTime();
575      window[l] = function (t) {
576        if (typeof s.success === "function") {
577          s.success.call(s["this"] ? s["this"] : this, t, s);
578        }
579      };
580    }
581    if (typeof s.cache === "boolean" && !s.cache) {
582      o += (o ? "&" : "") + new Date().valueOf();
583    }
584    if (l) {
585      o += (o ? "&" : "") + "callback=" + l;
586    }
587    if (s.data) {
588      o += (o ? "&" : "") + s.data;
589    }
590    if (s.method == "POST") {
591      s.url = i;
592    } else {
593      s.url = i + (o ? "?" + o : "");
594    }
595    if (s.dataType == "jsonp") {
596      var p = document.createElement("script");
597      p.src = s.url;
598      document.body.appendChild(p);
599      return this;
600    }
601    q = window.XMLHttpRequest
602      ? new XMLHttpRequest()
603      : new ActiveXObject("Microsoft.XMLHTTP");
604    q.addEventListener("load", window[l] || j);
605    q.addEventListener("error", n);
606    q.addEventListener("progress", h);
607    var k = "responseType" in q;
608    if (s.beforeSend) {
609      q = s.beforeSend.call(s["this"] ? s["this"] : this, q, s);
610    }
611    function j(t) {
612      s.header = q.getAllResponseHeaders();
613      var u;
614      if (q.status == 200 || q.status == 201 || q.status == 202) {
615        u = q.response;
616        if (q.responseType == "" || q.responseType == "text") {
617          u = q.responseText;
618        }
619        if (s.dataType == "json") {
620          try {
621            if (typeof u === "string") {
622              u = JSON.parse(
623                u
624                  .replace(/[\n\r]/g, "\\n")
625                  .replace(/^([^\(]+)\((.*)\)([^\)]*)$/, function (z, y, x, A) {
626                    return y == l ? x : "";
627                  })
628                  .replace(/\\n/g, "\n")
629              );
630            }
631          } catch (w) {
632            n(w);
633          }
634        }
635        if (s.dataType == "script") {
636          var v = document.createElement("script");
637          v.setAttribute("type", "text/javascript");
638          v.innerHTML = u;
639          document.head.appendChild(v);
640        }
641        s.statusText = "success";
642        if (typeof s.success === "function") {
643          s.success.call(s["this"] ? s["this"] : this, u, s);
644        }
645      } else {
646        s.statusText = "error";
647        n(t);
648      }
649      if (typeof s.complete === "function") {
650        s.complete.call(s["this"] ? s["this"] : this, u, s);
651      }
652    }
653    function n(t) {
654      if (typeof s.error === "function") {
655        s.error.call(s["this"] ? s["this"] : this, t, s);
656      }
657    }
658    function h(t) {
659      if (typeof s.progress === "function") {
660        s.progress.call(s["this"] ? s["this"] : this, t, s);
661      }
662    }
663    if (k && s.dataType) {
664      try {
665        q.responseType = s.dataType;
666      } catch (m) {
667        n(m);
668      }
669    }
670    try {
671      q.open(s.method || "GET", s.url, true);
672    } catch (m) {
673      n(m);
674    }
675    if (s.method == "POST") {
676      q.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
677    }
678    try {
679      q.send(s.method == "POST" ? o : null);
680    } catch (m) {
681      n(m);
682    }
683    return this;
684  };
685  d.prototype.loadJSON = function (i, j, h) {
686    if (!h) {
687      h = {};
688    }
689    h.dataType = "json";
690    h.complete = j;
691    this.ajax(i, h);
692    return this;
693  };
694  b.stuQuery = d;
695  b.S = function (h) {
696    return new d(h);
697  };
698})(window || this);

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.