PageSourceSearch

https://shop.duden.de/theme/a9dd922003eb7771b776d292d2b01149/js/or…val.b2b-approval-rule-base.plugin.55b842.js

js duden.de collected 2026-09-24 07:56:48 UTC 11,249 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[44473],{857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function n(t,e,r){return t.concat(e).map(function(t){return i(t,r)})}function o(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function s(t,e){try{return e in t}catch(t){return!1}}function a(t,r,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=i;var u,d,c=Array.isArray(r);return c!==Array.isArray(t)?i(r,l):c?l.arrayMerge(t,r,l):(d={},(u=l).isMergeableObject(t)&&o(t).forEach(function(e){d[e]=i(t[e],u)}),o(r).forEach(function(e){(!s(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(s(t,e)&&u.isMergeableObject(r[e])?d[e]=(function(t,e){if(!e.customMerge)return a;var r=e.customMerge(t);return"function"==typeof r?r:a})(e,u)(t[e],r[e],u):d[e]=i(r[e],u))}),d)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return a(t,r,e)},{})},t.exports=a},49:(t,e,r)=>{r.d(e,{Z:()=>n});var i=r(140);class n{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!n.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===n.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=e.replace(/^data(|-)/,""),s=i.Z.toLowerCamelCase(o,"-");if(!n.isNode(t)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let a=t.dataset[s];if(void 0===a){if(r)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return a}return i.Z.parsePrimitive(a)}static querySelector(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!n.isNode(t))throw Error("The parent node is not a valid HTML Node!");let i=t.querySelector(e)||!1;if(r&&!1===i)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return i}static querySelectorAll(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!n.isNode(t))throw Error("The parent node is not a valid HTML Node!");let i=t.querySelectorAll(e);if(0===i.length&&(i=!1),r&&!1===i)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return i}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.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 t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}},140:(t,e,r)=>{r.d(e,{Z:()=>i});class i{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let r=i.toUpperCamelCase(t,e);return i.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>i.ucFirst(t.toLowerCase())).join(""):i.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},293:(t,e,r)=>{r.d(e,{Z:()=>l});var i=r(857),n=r.n(i),o=r(49),s=r(140);class a{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(i),i}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,n=t.split("."),o=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=o;o=function(r){i.unsubscribe(t),e(r)}}return this.el.addEventListener(n[0],o),this.listeners.push({splitEventName:n,opts:r,cb:o}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),t),[]),!0}
1reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class l{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(t){let e=s.Z.toDashCase(this._pluginName),r=o.Z.getDataAttribute(this.el,"data-".concat(e,"-config"),!1),i=o.Z.getAttribute(this.el,"data-".concat(e,"-options"),!1),a=[this.constructor.options,this.options,t];r&&a.push(window.PluginConfigManager.get(this._pluginName,r));try{i&&a.push(JSON.parse(i))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(e,'-options" could not be parsed to json: ').concat(t.message))}return n().all(a.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},r=!1){if(!o.Z.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}},473:(t,e,r)=>{r.r(e),r.d(e,{default:()=>a});var i=r(293);let n={lowerThanEquals:{identifier:"<=",label:"lowerThanEquals"},equals:{identifier:"=",label:"equals"},greaterThanEquals:{identifier:">=",label:"greaterThanEquals"},notEquals:{identifier:"!=",label:"notEquals"},greaterThan:{identifier:">",label:"greaterThan"},lowerThan:{identifier:"<",label:"lowerThan"},isOneOf:{identifier:"=",label:"isOneOf"},isNoneOf:{identifier:"!=",label:"isNoneOf"},gross:{identifier:!1,label:"gross"},net:{identifier:!0,label:"net"},empty:{identifier:"empty",label:"empty"}},o={defaultSet:[n.equals,n.notEquals,n.greaterThanEquals,n.lowerThanEquals],singleStore:[n.equals,n.notEquals],multiStore:[n.isOneOf,n.isNoneOf],string:[n.equals,n.notEquals],bool:[n.equals],number:[n.equals,n.greaterThan,n.greaterThanEquals,n.lowerThan,n.lowerThanEquals,n.notEquals],isNet:[n.gross,n.net],empty:[n.empty]};class s{static getOperatorSet(t){return o[t]}static getOperatorOptionsByIdentifiers(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?t.map(t=>{let r=Object.entries(n).find(r=>{let[i,n]=r;return!(e&&["equals","notEquals"].includes(i)||!e&&["isOneOf","isNoneOf"].includes(i))&&t===n.identifier});return r?r.pop():{identifier:t,label:t}}):null}}class a extends i.Z{init(){this.conditionData=this.el.querySelector(this.options.conditionDataInput),this.store={},this.currentCondition={},this.groups=["orderApprovalAllOrders","orderApprovalCustomCondition"],this.currentGroup="orderApprovalAllOrders",this.initConditions(),this.initCustomCondition()}initCustomCondition(){var t,e,r;if(!((t=this.conditionData)===null||void 0===t?void 0:t.value)){this.updateCurrentCondition({type:"orderApprovalAllOrders",value:[]}),this.setCurrentGroup("orderApprovalAllOrders");return}let i=JSON.parse((e=this.conditionData)===null||void 0===e?void 0:e.value),n="scriptRule"===i.type?"".concat(i.type,"_").concat(i.scriptId):i.type;this.setCurrentCondition({...i,type:n}),this.setCurrentGroup((r=this.store[n])===null||void 0===r?void 0:r.group),"orderApprovalAllOrders"!==this.currentGroup&&this.emitUpdateConditionType()}conditionMapping(){var t;let e={};return(t=this.options.conditions)===null||void 0===t||t.forEach(t=>{if("scriptRule"===t.type){e["scriptRule_".concat(t.scriptId)]=t;return}e[t.type]=t}),e}initConditions(){let t=this.conditionMapping();Object.keys(t).forEach(e=>{let r=this.determineGroup(e);if("cartGoodsPrice"===e){this.addCondition(e,{group:r,...t[e],value:{amount:"0.0",operator:"="},config:{fields:{amount:{name:"amount",type:"float"}}}});return}if("shippingMethod"===e){this.addCondition(e,{group:r,...t[e],value:{shippingMethodIds:[],operator:"="}});return}this.addCondition(e,{group:r,...t[e]})})}determineGroup(t){return"orderApprovalAllOrders"===t?"orderApprovalAllOrders":"orderApprovalCustomCondition"}addCondition(t,e){this.store[t]=e}addGroups(t){this.groups=[...this.groups,t]}getGroups(){return this.groups}getCurrentCondition(){return this.currentCondition}setCurrentGroup(t){this.currentGroup=t,document.$emitter.publish("ApprovalRule/onUpdateGroup",t)}getOperatorList(){var t,e;let r=this.store[this.currentCondition.type];return r&&"orderApprovalAllOrders"!==r.group?"cartGoodsPrice"===r.type?s.getOperatorSet("number"):s.getOperatorOptionsByIdentifiers((t=r.config)===null||void 0===t?void 0:t.operators,(e=r.config)===null||void 0===e?void 0:e.isMatchAny):void 0}
1emitUpdateConditionType(){document.$emitter.publish("ApprovalRule/onUpdateConditionType")}getConditionList(){return"orderApprovalAllOrders"===this.currentGroup?[]:Object.entries(this.store).filter(t=>{let[e,r]=t;return r.group===this.currentGroup}).map(t=>{let[e]=t;return e})}updateCurrentCondition(t){this.currentCondition=t,this.conditionData.value=JSON.stringify(this.currentCondition)}updateCurrentScriptCondition(t){this.currentCondition=t;let e=t.type.split("_")[0],r=t.type.split("_")[1];this.conditionData.value=JSON.stringify({...t,type:e,scriptId:r})}setCurrentCondition(t){if(t.type.includes("scriptRule")){this.updateCurrentScriptCondition(t);return}this.updateCurrentCondition(t)}getCurrentConditionConfig(){var t;return(t=this.store[this.currentCondition.type])===null||void 0===t?void 0:t.config}}a.options={conditionDataInput:"#approvalRuleCondition"}}}]);

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.