"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),l=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("clsx"),o="Button-module_button__18Bed",a="Button-module_disabled__UzdWL",r="Button-module_buttonText__reUdv";const s=e=>{let{children:t,text:s,disabled:c,wrapperClass:i,buttonClass:u,...p}=e;return l.createElement("div",{className:n.clsx(i&&i,c&&a)},l.createElement("button",Object.assign({className:n.clsx(o,u&&u),disabled:c},p),t,s&&l.createElement("span",{className:r},s)))};var c="Heading-module_headingWrapper__oEBIY";var i="Input-module_input__505b7";var u="NextButton-module_nextButtonWrapper__Moxf-",p="NextButton-module_nextButton__XdxOI";var d="SingleChoiceButton-module_singleChoicesWrapper__wze-g",m="SingleChoiceButton-module_wrapper__cZ1yL",g="SingleChoiceButton-module_singleChoiceButton__epCT2",_="SingleChoiceButton-module_singleChoiceText__o7VWi",x="SingleChoiceButton-module_singleChoiceSelected__yDqaN";const b=e=>{let{children:t}=e;return l.createElement("div",{className:d}," ",t," ")},h=e=>{let{children:t,text:o,item:a,pageValue:r,setPageValue:c,selected:i,align:u,...p}=e;return l.createElement(l.Fragment,null,l.createElement(s,Object.assign({wrapperClass:m,buttonClass:n.clsx(g,i&&x)},p),l.createElement("span",{className:_},o),a&&a.image&&l.createElement("img",{src:a.image,alt:a.key})))};var y="Checkbox-module_checkboxWrapper__A680D",E="Checkbox-module_checkmark__pjJT2";const v="onStoreUpdated",k=(e,t)=>{const l=localStorage.getItem(e);return l?function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(l)?JSON.parse(l):l:t};exports.Button=s,exports.Checkbox=e=>{let{checked:t}=e;return l.createElement("label",{className:y},l.createElement("input",{type:"checkbox",checked:t,onClick:e=>{e.preventDefault(),e.stopPropagation()},readOnly:!0}),l.createElement("span",{className:E}))},exports.Heading=e=>{let{title:t,subtitle:n}=e;return l.createElement("div",{className:c},l.createElement("h1",null,t),n&&l.createElement("h3",null,n))},exports.Input=e=>{let{type:t="text",active:n,disabled:o,...a}=e;return l.createElement("input",Object.assign({type:"text",className:i},a))},exports.NextButton=e=>{let{text:t="Next",...n}=e;return l.createElement(s,Object.assign({text:t,wrapperClass:u,buttonClass:p},n))},exports.SingleChoice=e=>{let{options:t,selectedKey:n,onSelect:o,align:a="center"}=e;return l.createElement(b,null,t.map((e=>l.createElement(h,{key:e.key,align:a,selected:e.key===n,text:e.value,onClick:()=>o(e)}))))},exports.SingleChoiceButton=h,exports.SingleChoicesButtonWrapper=b,exports.SlackWorkflowAPI=class{constructor(e){let{webHookUrl:t}=e;this.webHookUrl=t}sendMessageToWebhook(e){return fetch(this.webHookUrl,{method:"POST",body:JSON.stringify(e)})}},exports.isBoolean=e=>"boolean"==typeof e,exports.isEmpty=e=>!!e.trim(),exports.isNumber=e=>"number"==typeof e&&Number.isFinite(e),exports.isString=e=>"string"==typeof e,exports.useLocalStorage=e=>{let{key:l,defaultValue:n}=e;const[o,a]=t.useState(k(l,n));return t.useEffect((()=>(window.addEventListener(v,(e=>{l===e.detail.keyEvent&&a(e.detail.value)})),()=>{window.removeEventListener(v,(e=>{l===e.detail.keyEvent&&a(e.detail.value)}))})),[l]),t.useEffect((()=>{"object"==typeof o?localStorage.setItem(l,JSON.stringify(o)||""):localStorage.setItem(l,"boolean"==typeof o?o:o||""),window.dispatchEvent(new CustomEvent(v,{detail:{value:o,keyEvent:l}}))}),[o,l]),{pageValue:o,setPageValue:a}},exports.uuidv4=()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));
//# sourceMappingURL=ui-core-kit.cjs.development.js.map
