Liferay.Loader.define("data-engine-taglib@3.3.26/data_layout_builder/js/components/rules/editor/CalculatorButtonArea.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","data-engine-js-components-web","liferay!frontend-js-react-web$react"],(function(e,a,t){var l;window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=u();if(a&&a.has(e))return a.get(e);var t={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=l?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(t,n,o):t[n]=e[n]}t.default=e,a&&a.set(e,t);return t}(t("@frontend-taglib-clay$clayui/button")),o=t("@frontend-taglib-clay$clayui/drop-down"),r=t("data-engine-js-components-web"),c=(l=t("liferay!frontend-js-react-web$react"))&&l.__esModule?l:{default:l};function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}const e=["1","2","3","4","5","6","7","8","9"],s=[{label:Liferay.Language.get("add"),value:"+"},{label:Liferay.Language.get("divide"),value:"/"},{label:Liferay.Language.get("multiply"),value:"*"},{label:Liferay.Language.get("subtract"),value:"-"}],d={BACKSPACE:"Backspace",LITERAL:r.Token.LITERAL,OPERATOR:r.Token.OPERATOR,PARENTHESIS_LEFT:r.Token.LEFT_PARENTHESIS,PARENTHESIS_RIGHT:r.Token.RIGHT_PARENTHESIS};var i=function({disableDot:a,disableFunctions:t,disableNumbers:l,disableOperators:r,functions:u,onClick:i,onFunctionSelected:b}){return c.default.createElement("div",{className:"calculator-button-area"},c.default.createElement("div",{className:"calculator-buttons calculator-buttons-numbers"},c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("backspace"),className:"border-top-left calculator-button",displayType:"secondary",onClick:()=>i({tokenType:d.BACKSPACE,tokenValue:"backspace"}),symbol:"angle-left",title:Liferay.Language.get("backspace")}),c.default.createElement(n.default,{"aria-label":Liferay.Language.get("left-parenthesis"),className:"calculator-button",disabled:l,displayType:"secondary",monospaced:!0,onClick:()=>i({tokenType:d.PARENTHESIS_LEFT,tokenValue:"("}),title:Liferay.Language.get("left-parenthesis")},"("),c.default.createElement(n.default,{"aria-label":Liferay.Language.get("right-parenthesis"),className:"border-top-right calculator-button",disabled:l,displayType:"secondary",monospaced:!0,onClick:()=>i({tokenType:d.PARENTHESIS_RIGHT,tokenValue:")"}),title:Liferay.Language.get("right-parenthesis")},")"),e.map((e=>c.default.createElement(n.default,{className:"calculator-button",disabled:l,displayType:"secondary",key:e,monospaced:!0,onClick:()=>i({tokenType:d.LITERAL,tokenValue:e})},e))),c.default.createElement(n.default,{"aria-label":Liferay.Language.get("zero"),className:"border-bottom-left button-two-columns calculator-button",disabled:l,displayType:"secondary",monospaced:!0,onClick:()=>i({tokenType:d.LITERAL,tokenValue:"0"})},"0"),c.default.createElement(n.default,{"aria-label":Liferay.Language.get("period"),className:"border-bottom-right calculator-button",disabled:a||l,displayType:"secondary",monospaced:!0,onClick:()=>i({tokenType:d.LITERAL,tokenValue:"."})},".")),c.default.createElement("div",{className:"calculator-buttons calculator-buttons-operators"},c.default.createElement("div",{className:"btn-group-vertical",role:"group"},c.default.createElement(o.ClayDropDownWithItems,{className:"dropdown-action",items:u.map((e=>({label:e.label,onClick:()=>b(e)}))),trigger:c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("actions"),className:"calculator-add-operator-button-area",disabled:t,symbol:"ellipsis-v",title:Liferay.Language.get("actions")})}),s.map((({label:e,value:a})=>c.default.createElement(n.default,{"aria-label":e,className:"calculator-button",disabled:r,displayType:"secondary",key:e,monospaced:!0,onClick:()=>i({tokenType:d.OPERATOR,tokenValue:a})},a))))))};a.default=i}}));
//# sourceMappingURL=CalculatorButtonArea.es.js.map