PageSourceSearch

https://americansuppressorassociation.com/theme/bb91f029b1ef3adfdc…rder-approval.multi-select.plugin.aeba95.js

js americansuppressorassociation.com collected 2026-10-02 09:59:46 UTC 11,561 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[37194],{857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==s},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function r(e,t,s){return e.concat(t).map(function(e){return i(e,s)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function l(e,t){try{return t in e}catch(e){return!1}}function o(e,s,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||t,a.cloneUnlessOtherwiseSpecified=i;var c,u,d=Array.isArray(s);return d!==Array.isArray(e)?i(s,a):d?a.arrayMerge(e,s,a):(u={},(c=a).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=i(e[t],c)}),n(s).forEach(function(t){(!l(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(l(e,t)&&c.isMergeableObject(s[t])?u[t]=(function(e,t){if(!t.customMerge)return o;var s=t.customMerge(e);return"function"==typeof s?s:o})(t,c)(e[t],s[t],c):u[t]=i(s[t],c))}),u)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,s){return o(e,s,t)},{})},e.exports=o},49:(e,t,s)=>{s.d(t,{Z:()=>r});var i=s(140);class r{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!r.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!1===r.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(s)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=t.replace(/^data(|-)/,""),l=i.Z.toLowerCamelCase(n,"-");if(!r.isNode(e)){if(s)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(s)throw Error("This node doesn't support the dataset attribute!");return}let o=e.dataset[l];if(void 0===o){if(s)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return o}return i.Z.parsePrimitive(o)}static querySelector(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelector(t)||!1;if(s&&!1===i)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return i}static querySelectorAll(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelectorAll(t);if(0===i.length&&(i=!1),s&&!1===i)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return i}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return e.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not([tabindex^="-"]):not([disabled])\n        ')}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}},266:(e,t,s)=>{s.d(t,{Z:()=>i});class i{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var s of e.entries())t(s[1],s[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(s=>{t(e[s],s)});throw Error("The element type ".concat(typeof e," is not iterable!"))}}},140:(e,t,s)=>{s.d(t,{Z:()=>i});
1class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let s=i.toUpperCamelCase(e,t);return i.lcFirst(s)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},293:(e,t,s)=>{s.d(t,{Z:()=>a});var i=s(857),r=s.n(i),n=s(49),l=s(140);class o{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:s});return this.el.dispatchEvent(i),i}subscribe(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,r=e.split("."),n=s.scope?t.bind(s.scope):t;if(s.once&&!0===s.once){let t=n;n=function(s){i.unsubscribe(e),t(s)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:s,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,s)=>([...s.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):e.push(s),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class a{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=l.Z.toDashCase(this._pluginName),s=n.Z.getDataAttribute(this.el,"data-".concat(t,"-config"),!1),i=n.Z.getAttribute(this.el,"data-".concat(t,"-options"),!1),o=[this.constructor.options,this.options,e];s&&o.push(window.PluginConfigManager.get(this._pluginName,s));try{i&&o.push(JSON.parse(i))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(t,'-options" could not be parsed to json: ').concat(e.message))}return r().all(o.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}constructor(e,t={},s=!1){if(!n.Z.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(s),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}},194:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var i=s(293),r=s(266);class n extends i.Z{init(){this.selectedIds=[],this._sampleItem=this.el.querySelector("".concat(this.options.selectedItem,".sample")),this._sampleResultItem=this.el.querySelector("".concat(this.options.selectResult,".sample")),this._select=this.el.querySelector(this.options.selectionList),this._selectResults=this.el.querySelectorAll(this.options.selectResult),this._result=this.el.querySelector(this.options.selectResultList),this._registerEvents(),this.el.classList.contains("multi-select")&&this.renderMultiSelectOptions(),this._initValue()}_initValue(){var e,t;this.selectedIds=(t=JSON.parse(this.el.getAttribute("init-ids")))!==null&&void 0!==t?t:[],((e=this.selectedIds)===null||void 0===e?void 0:e.length)&&this._selectResults.forEach(e=>{let t=e.getAttribute("data-id");this.selectedIds.includes(t)&&this.generateSelectedItem(e,t,e.textContent)})}_registerEvents(){this._select.addEventListener("click",this._handleFieldChange.bind(this)),this._select.addEventListener("keydown",this._handleFieldChange.bind(this)),document.body.addEventListener("click",this._onBackgroundClick.bind(this)),document.$emitter.subscribe("MultiSelect/updateConfig",this.renderMultiSelectOptions.bind(this)),this.el.classList.contains("multi-select")||this._registerEventSelectElement()}_registerEventSelectElement(){r.Z.iterate(this._selectResults,e=>{e.addEventListener("click",this._renderResultItem.bind(this)),e.addEventListener("keydown",this._handleKeyDown.bind(this))})}_registerEventRemoveElement(){let e=document.querySelectorAll(this.options.labelDismiss);r.Z.iterate(e,e=>e.addEventListener("click",this._removeResultItem.bind(this)))}_handleFieldChange(){this._result.classList.remove("d-none")}
1_onBackgroundClick(e){e.target.closest(this.options.selectionList)||e.target.closest(this.options.selectResultList)||this._result.classList.add("d-none"),this.$emitter.publish("onBackgroundClick")}_renderResultItem(e){let t=e.target.querySelector(this.options.selectResultText).textContent,s=e.target.getAttribute("data-id"),i=this.el.querySelector("".concat(this.options.selectedItem,'[data-id="').concat(s,'"]'));i?(e.target.classList.remove("is--active"),i.remove(),this.selectedIds=this.selectedIds.filter(e=>e!==s)):(this.generateSelectedItem(e.target,s,t),this.selectedIds=[...this.selectedIds,s]),document.$emitter.publish("MultiSelect/updateValue",{value:this.selectedIds})}_handleKeyDown(e){"Enter"===e.key&&this._renderResultItem(e)}_removeResultItem(e){let t=e.target.closest(this.options.selectedItem),s=t.getAttribute("data-id");this._selectResults.forEach(e=>{e.getAttribute("data-id")===s&&e.classList.remove("is--active")}),this.selectedIds=this.selectedIds.filter(e=>e!==s),document.$emitter.publish("MultiSelect/updateValue",{value:this.selectedIds}),t.remove()}generateSelectedItem(e,t,s){let i=this._sampleItem.cloneNode(!0);i.classList.remove("d-none","sample"),i.setAttribute("data-id",t),i.querySelector(this.options.selectedItemText).textContent=s,this._select.appendChild(i),e.classList.add("is--active"),this._registerEventRemoveElement()}renderMultiSelectOptions(){var e;if(!this.el.classList.contains("multi-select"))return;let t=(e=JSON.parse(this.el.getAttribute("config")))!==null&&void 0!==e?e:[],s=this._result.querySelector(".select-result-list__item-list");if(s.innerHTML="",!t.options)return;let i=t.options.options,r=document.documentElement.lang;i.forEach(e=>{var t;let i=this._sampleResultItem.cloneNode(!0);i.classList.remove("d-none","sample"),i.querySelector(".select-result__result-item-text").textContent=(t=e.label[r])!==null&&void 0!==t?t:e.label["en-GB"],i.setAttribute("data-id",e.value),s.appendChild(i)}),this._selectResults=this.el.querySelectorAll(this.options.selectResult),this._registerEventSelectElement()}}n.options={selectionList:".select-selection-list",selectedItem:".select-selection-list__item-holder",selectedItemText:".select-selection-list__item",selectResultList:".select-result-list__content",selectResult:".select-result",selectResultText:".select-result__result-item-text",labelDismiss:".label__dismiss"}}}]);

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.