PageSourceSearch

https://macsfish.com/js/hooks.js

js macsfish.com collected 2026-10-10 00:09:59 UTC 6,546 bytes, 231 lines download raw bytes

1/*! This file is auto-generated */
2;(() => {
3  'use strict'
4  var t = {
5      d: (e, n) => {
6        for (var r in n)
7          t.o(n, r) &&
8            !t.o(e, r) &&
9            Object.defineProperty(e, r, {
10              enumerable: !0,
11              get: n[r]
12            })
13      },
14      o: (t, e) => Object.prototype.hasOwnProperty.call(t, e),
15      r: (t) => {
16        'undefined' != typeof Symbol &&
17          Symbol.toStringTag &&
18          Object.defineProperty(t, Symbol.toStringTag, {
19            value: 'Module'
20          }),
21          Object.defineProperty(t, '__esModule', {
22            value: !0
23          })
24      }
25    },
26    e = {}
27  t.r(e),
28    t.d(e, {
29      actions: () => S,
30      addAction: () => m,
31      addFilter: () => p,
32      applyFilters: () => k,
33      createHooks: () => h,
34      currentAction: () => w,
35      currentFilter: () => I,
36      defaultHooks: () => f,
37      didAction: () => O,
38      didFilter: () => j,
39      doAction: () => b,
40      doingAction: () => x,
41      doingFilter: () => T,
42      filters: () => z,
43      hasAction: () => v,
44      hasFilter: () => y,
45      removeAction: () => A,
46      removeAllActions: () => F,
47      removeAllFilters: () => g,
48      removeFilter: () => _
49    })
50  const n = function (t) {
51    return 'string' != typeof t || '' === t
52      ? (console.error('The namespace must be a non-empty string.'), !1)
53      : !!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t) ||
54          (console.error(
55            'The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.'
56          ),
57          !1)
58  }
59  const r = function (t) {
60    return 'string' != typeof t || '' === t
61      ? (console.error('The hook name must be a non-empty string.'), !1)
62      : /^__/.test(t)
63      ? (console.error('The hook name cannot begin with `__`.'), !1)
64      : !!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t) ||
65        (console.error(
66          'The hook name can only contain numbers, letters, dashes, periods and underscores.'
67        ),
68        !1)
69  }
70  const o = function (t, e) {
71    return function (o, i, s, c = 10) {
72      const l = t[e]
73      if (!r(o)) return
74      if (!n(i)) return
75      if ('function' != typeof s)
76        return void console.error('The hook callback must be a function.')
77      if ('number' != typeof c)
78        return void console.error(
79          'If specified, the hook priority must be a number.'
80        )
81      const u = {
82        callback: s,
83        priority: c,
84        namespace: i
85      }
86      if (l[o]) {
87        const t = l[o].handlers
88        let e
89        for (e = t.length; e > 0 && !(c >= t[e - 1].priority); e--);
90        e === t.length ? (t[e] = u) : t.splice(e, 0, u),
91          l.__current.forEach((t) => {
92            t.name === o && t.currentIndex >= e && t.currentIndex++
93          })
94      } else
95        l[o] = {
96          handlers: [u],
97          runs: 0
98        }
99      'hookAdded' !== o && t.doAction('hookAdded', o, i, s, c)
100    }
101  }
102  const i = function (t, e, o = !1) {
103    return function (i, s) {
104      const c = t[e]
105      if (!r(i)) return
106      if (!o && !n(s)) return
107      if (!c[i]) return 0
108      let l = 0
109      if (o)
110        (l = c[i].handlers.length),
111          (c[i] = {
112            runs: c[i].runs,
113            handlers: []
114          })
115      else {
116        const t = c[i].handlers
117        for (let e = t.length - 1; e >= 0; e--)
118          t[e].namespace === s &&
119            (t.splice(e, 1),
120            l++,
121            c.__current.forEach((t) => {
122              t.name === i && t.currentIndex >= e && t.currentIndex--
123            }))
124      }
125      return 'hookRemoved' !== i && t.doAction('hookRemoved', i, s), l
126    }
127  }
128  const s = function (t, e) {
129    return function (n, r) {
130      const o = t[e]
131      return void 0 !== r
132        ? n in o && o[n].handlers.some((t) => t.namespace === r)
133        : n in o
134    }
135  }
136  const c = function (t, e, n = !1) {
137    return function (r, ...o) {
138      const i = t[e]
139      i[r] ||
140        (i[r] = {
141          handlers: [],
142          runs: 0
143        }),
144        i[r].runs++
145      const s = i[r].handlers
146      if (!s || !s.length) return n ? o[0] : void 0
147      const c = {
148        name: r,
149        currentIndex: 0
150      }
151      for (i.__current.push(c); c.currentIndex < s.length; ) {
152        const t = s[c.currentIndex].callback.apply(null, o)
153        n && (o[0] = t), c.currentIndex++
154      }
155      return i.__current.pop(), n ? o[0] : void 0
156    }
157  }
158  const l = function (t, e) {
159    return function () {
160      var n
161      const r = t[e]
162      return null !== (n = r.__current[r.__current.length - 1]?.name) &&
163        void 0 !== n
164        ? n
165        : null
166    }
167  }
168  const u = function (t, e) {
169    return function (n) {
170      const r = t[e]
171      return void 0 === n
172        ? void 0 !== r.__current[0]
173        : !!r.__current[0] && n === r.__current[0].name
174    }
175  }
176  const a = function (t, e) {
177    return function (n) {
178      const o = t[e]
179      if (r(n)) return o[n] && o[n].runs ? o[n].runs : 0
180    }
181  }
182  class d {
183    constructor() {
184      ;(this.actions = Object.create(null)),
185        (this.actions.__current = []),
186        (this.filters = Object.create(null)),
187        (this.filters.__current = []),
188        (this.addAction = o(this, 'actions')),
189        (this.addFilter = o(this, 'filters')),
190        (this.removeAction = i(this, 'actions')),
191        (this.removeFilter = i(this, 'filters')),
192        (this.hasAction = s(this, 'actions')),
193        (this.hasFilter = s(this, 'filters')),
194        (this.removeAllActions = i(this, 'actions', !0)),
195        (this.removeAllFilters = i(this, 'filters', !0)),
196        (this.doAction = c(this, 'actions')),
197        (this.applyFilters = c(this, 'filters', !0)),
198        (this.currentAction = l(this, 'actions')),
199        (this.currentFilter = l(this, 'filters')),
200        (this.doingAction = u(this, 'actions')),
201        (this.doingFilter = u(this, 'filters')),
202        (this.didAction = a(this, 'actions')),
203        (this.didFilter = a(this, 'filters'))
204    }
205  }
206  const h = function () {
207      return new d()
208    },
209    f = h(),
210    {
211      addAction: m,
212      addFilter: p,
213      removeAction: A,
214      removeFilter: _,
215      hasAction: v,
216      hasFilter: y,
217      removeAllActions: F,
218      removeAllFilters: g,
219      doAction: b,
220      applyFilters: k,
221      currentAction: w,
222      currentFilter: I,
223      doingAction: x,
224      doingFilter: T,
225      didAction: O,
226      didFilter: j,
227      actions: S,
228      filters: z
229    } = f
230  ;(window.wp = window.wp || {}).hooks = e
231})()

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.