@citizenplane/pimp 7.0.1 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.eslintrc.js +1 -0
  2. package/.lintstagedrc.json +2 -2
  3. package/README.md +18 -6
  4. package/dist/pimp.es.js +10669 -0
  5. package/dist/pimp.umd.js +9 -0
  6. package/dist/style.css +1 -0
  7. package/package-lock.json +2295 -1775
  8. package/package.json +27 -20
  9. package/src/App.vue +0 -1
  10. package/src/README.md +23 -9
  11. package/src/assets/styles/base/_base.scss +2 -15
  12. package/src/assets/styles/helpers/_functions.scss +1 -1
  13. package/src/assets/styles/helpers/_keyframes.scss +25 -0
  14. package/src/assets/styles/lib/_normalize.scss +19 -41
  15. package/src/assets/styles/variables/_colors.scss +16 -16
  16. package/src/assets/styles/variables/_sizing.scss +1 -1
  17. package/src/assets/styles/variables/_spacing.scss +2 -2
  18. package/src/components/atomic-elements/CpBadge.vue +41 -29
  19. package/src/components/buttons/CpButton.vue +1 -1
  20. package/src/components/core/BaseInputLabel/index.vue +0 -1
  21. package/src/components/core/playground-sections/SectionAtomicElements.vue +20 -4
  22. package/src/components/core/playground-sections/SectionDatePickers.vue +26 -1
  23. package/src/components/core/playground-sections/SectionSimpleInputs.vue +6 -1
  24. package/src/components/date-pickers/CpCalendar.vue +49 -2
  25. package/src/components/date-pickers/CpDate.vue +61 -39
  26. package/src/components/date-pickers/CpDatepicker.vue +50 -3
  27. package/src/components/feedback-indicators/CpAlert.vue +4 -4
  28. package/src/components/index.js +15 -0
  29. package/src/components/inputs/CpInput.vue +59 -75
  30. package/src/components/inputs/CpTextarea.vue +19 -2
  31. package/src/components/lists-and-table/CpTable/index.scss +15 -9
  32. package/src/components/selects/CpSelect.vue +21 -2
  33. package/src/components/toggles/CpCheckbox/index.scss +1 -1
  34. package/src/components/toggles/CpRadio/index.scss +2 -2
  35. package/src/components/visual/CpIcon.vue +9 -2
  36. package/src/libs/CoreDatepicker.vue +101 -118
  37. package/vite.config.js +19 -0
  38. package/dist/assets/chevron-down-icon.1e5b69a2.svg +0 -3
  39. package/dist/assets/index.2be314eb.css +0 -1
  40. package/dist/assets/index.e3e1e2b7.js +0 -1
  41. package/dist/assets/vendor.ed632372.js +0 -9
  42. package/dist/index.html +0 -20
@@ -1 +0,0 @@
1
- var Be=Object.defineProperty,Ee=Object.defineProperties;var Re=Object.getOwnPropertyDescriptors;var ae=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var le=(e,t,i)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,M=(e,t)=>{for(var i in t||(t={}))Le.call(t,i)&&le(e,i,t[i]);if(ae)for(var i of ae(t))Pe.call(t,i)&&le(e,i,t[i]);return e},X=(e,t)=>Ee(e,Re(t));import{o as c,c as _,a as o,r as f,b as a,w as d,d as m,t as b,e as T,f as k,g as V,F as I,m as re,T as $,D as y,h as D,n as P,i as w,j as de,I as z,k as O,v as ce,l as K,p as $e,q as ze,s as ue,u as Z,x as j,y as U,z as he,A as qe,B as Y,C as Q,E as Ae,G as Fe,H as pe,J as Ue,K as Ne}from"./vendor.ed632372.js";const We=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))p(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const u of n.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&p(u)}).observe(document,{childList:!0,subtree:!0});function i(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerpolicy&&(n.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?n.credentials="include":s.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function p(s){if(s.ep)return;s.ep=!0;const n=i(s);fetch(s.href,n)}};We();const je="@citizenplane/pimp",Ye="7.0.1",He={dev:"vite",build:"vite build",preview:"vite preview",lint:"eslint --ext .js,.vue --ignore-path .gitignore --fix src",format:"prettier . --write",test:"jest tests"},Ge="dist/pimp.common.js",Je=["dist/*","src/*","public/*","*.json","*.js"],Xe={vue:"^3.1.0",animejs:"^3.2.0","core-js":"^3.18.1","feather-icons":"^4.28.0",luxon:"^2.0.2",maska:"^1.4.6"},Ke={"@babel/core":"^7.15.8","@vitejs/plugin-vue":"^1.9.2","@vue/babel-preset-app":"^4.5.14","@vue/eslint-config-prettier":"^6.0.0","@vue/test-utils":"^2.0.0-rc.16","babel-core":"^7.0.0-bridge.0",eslint:"^7.32.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-vue":"^7.18.0",husky:"^7.0.4",jest:"^26.6.3","lint-staged":"^11.2.4",prettier:"^2.4.1",sass:"~1.42.1","sass-loader":"^10.1.1",stylus:"^0.55.0","stylus-loader":"^3.0.2",vite:"^2.6.0","vue-jest":"^5.0.0-alpha.10"};var Ze={name:je,version:Ye,scripts:He,main:Ge,files:Je,dependencies:Xe,devDependencies:Ke},S=(e,t)=>{for(const[i,p]of t)e[i]=p;return e};const Qe={},et={width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tt=o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23.3155 1.33384C11.7696 2.66096 2.66096 11.7696 1.33384 23.3155L0.981172 26.3838C-0.327057 37.7654 -0.327057 49.2594 0.981172 60.641L1.33384 63.7092C2.36493 72.6797 8.09325 80.179 16.0124 83.7006L16.0124 43.6567C16.0238 28.586 28.2869 16.328 43.3608 16.328C58.4408 16.328 70.7092 28.5963 70.7092 43.6764C70.7092 54.5957 64.276 64.0389 55.0001 68.4197L55.0094 68.3815L54.5074 68.6469C51.1007 70.1736 47.3284 71.0238 43.3608 71.0238C43.3406 71.0238 43.3205 71.0235 43.3004 71.0232C43.2802 71.023 43.2601 71.0227 43.2399 71.0227L38.9718 71.0217L38.9955 66.3765L43.2399 66.3455C43.2601 66.3455 43.2802 66.3458 43.3004 66.346C43.3205 66.3463 43.3406 66.3465 43.3608 66.3465C55.8616 66.3465 66.032 56.1761 66.032 43.6764C66.032 31.1756 55.8616 21.0052 43.3608 21.0052C30.8662 21.0052 20.701 31.1653 20.6906 43.6567V85.2476C21.5495 85.44 22.4253 85.5886 23.3155 85.6909L26.3838 86.0436C27.6029 86.1837 28.8234 86.3088 30.0449 86.4189V43.6575H30.0428C30.0532 36.3225 36.0236 30.3583 43.3607 30.3583C50.7039 30.3583 56.6785 36.3329 56.6785 43.6771C56.6785 51.0204 50.7039 56.995 43.3607 56.995C43.3528 56.995 43.3449 56.9947 43.3371 56.9944C43.3297 56.9942 43.3223 56.9939 43.3152 56.9939H38.9995V52.3167L43.3152 52.3157C43.3223 52.3157 43.3297 52.3162 43.3372 52.3167C43.3399 52.3169 43.3427 52.3171 43.3455 52.3172C43.3505 52.3175 43.3556 52.3178 43.3607 52.3178C48.1246 52.3178 52.0013 48.4411 52.0013 43.6771C52.0013 38.9121 48.1246 35.0355 43.3607 35.0355C38.6029 35.0355 34.7314 38.9018 34.72 43.6575H34.7221V86.767C43.3612 87.2741 52.0332 87.033 60.641 86.0436L63.7092 85.6909C75.2551 84.3638 84.3638 75.2551 85.6909 63.7092L86.0436 60.641C87.3518 49.2594 87.3518 37.7654 86.0436 26.3838L85.6909 23.3155C84.3638 11.7696 75.2551 2.66096 63.7092 1.33384L60.641 0.981172C49.2594 -0.327057 37.7654 -0.327057 26.3838 0.981172L23.3155 1.33384Z",fill:"#3E3E5B"},null,-1),st=[tt];function it(e,t){return c(),_("svg",et,st)}var nt=S(Qe,[["render",it]]);const ot={props:{sectionTitle:{type:String,default:""}}},at={class:"sectionContainer"},lt={class:"sectionContainer__body"};function rt(e,t,i,p,s,n){const u=f("cp-heading");return c(),_("section",at,[a(u,{"heading-level":"h2",size:700,class:"sectionContainer__title"},{default:d(()=>[m(b(i.sectionTitle),1)]),_:1}),o("div",lt,[T(e.$slots,"default")])])}var E=S(ot,[["render",rt]]);const dt={components:{SectionContainer:E},data(){return{badgeList:[{color:"neutral",label:"Beta"},{color:"green",label:"Processed"},{color:"red",label:"Aborted"},{color:"blue",label:"In Progress"},{color:"purple",label:"trial"}]}},methods:{}},ct={class:"item"},ut=o("h3",null,"Badge",-1),ht={class:"sectionAtomicElements__badges"};function pt(e,t,i,p,s,n){const u=f("cp-badge"),r=f("section-container");return c(),k(r,{"section-title":"Toggles",class:"sectionAtomicElements"},{default:d(()=>[o("div",ct,[ut,o("div",ht,[(c(!0),_(I,null,V(s.badgeList,({color:h,label:l})=>(c(),k(u,{key:l,color:h,label:l,class:"sectionAtomicElements__badge"},null,8,["color","label"]))),128))])])]),_:1})}var _t=S(dt,[["render",pt]]);const mt={components:{SectionContainer:E},data(){return{headings:[100,200,300,400,500,600,700,800,900]}}},ft={class:"item sectionTypography__headings"},gt=m("Headings");function yt(e,t,i,p,s,n){const u=f("cp-heading"),r=f("section-container");return c(),k(r,{"section-title":"Typography",class:"sectionTypography"},{default:d(()=>[o("div",ft,[a(u,{size:800},{default:d(()=>[gt]),_:1}),(c(!0),_(I,null,V(s.headings,(h,l)=>(c(),k(u,{key:l,size:h,"heading-level":"h3",class:"sectionTypography__heading"},{default:d(()=>[m(b(h)+": The quick brown fox jumps over the lazy dog ",1)]),_:2},1032,["size"]))),128))])]),_:1})}var bt=S(mt,[["render",yt]]);const vt={components:{SectionContainer:E},data(){return{loaders:{primary:!1,secondary:!1}}},methods:{load(e){this.loaders[e]=!0,setTimeout(()=>{this.loaders[e]=!1},2e3)}}},Dt={class:"sectionButtons__type"},St=m("Default"),kt={class:"sectionButtons__buttons"},wt=m("Default button"),It=m("Default blue button"),Ct=m("Default purple button"),xt=m("Default green button"),Vt=m("Default orange button"),Tt=m("Default red button"),Ot={class:"sectionButtons__type"},Mt=m("Primary"),Bt={class:"sectionButtons__buttons"},Et=m("Primary button"),Rt=m("Primary button"),Lt=m("Primary button"),Pt=m("Primary button"),$t=m("Primary button"),zt={class:"sectionButtons__type"},qt=m("Minimal"),At={class:"sectionButtons__buttons"},Ft=m("Minimal button"),Ut=m("Minimal button"),Nt=m("Minimal button"),Wt=m("Minimal button"),jt=m("Minimal button"),Yt={class:"sectionButtons__type"},Ht=m("Buttons as links"),Gt={class:"sectionButtons__buttons"},Jt=m("Default button (link)"),Xt=m("Primary button (link)"),Kt=m("Minimal button (link)"),Zt={class:"sectionButtons__type"},Qt=m("Disabled"),es={class:"sectionButtons__buttons"},ts=m("Disabled button"),ss=m("Disabled button (link)"),is={class:"sectionButtons__type"},ns=m("With icons"),os={class:"sectionButtons__buttons"},as=m(" Default button "),ls=m(" Primary button "),rs={class:"sectionButtons__type"},ds=m("Loading"),cs={class:"sectionButtons__buttons"},us=m(" Default button "),hs=m(" Default button "),ps={class:"sectionButtons__type"},_s=m("Square"),ms={class:"sectionButtons__buttons"},fs=m("Square button"),gs=m("Square button"),ys=m(" Square button "),bs={class:"sectionButtons__type"},vs=m("Large"),Ds={class:"sectionButtons__buttons"},Ss=m(" Large button "),ks=m(" Large button "),ws=m(" Large button ");function Is(e,t,i,p,s,n){const u=f("cp-heading"),r=f("cp-button"),h=f("cp-icon"),l=f("section-container");return c(),k(l,{"section-title":"Buttons",class:"sectionButtons"},{default:d(()=>[o("div",Dt,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[St]),_:1}),o("div",kt,[a(r,null,{default:d(()=>[wt]),_:1}),a(r,{color:"blue"},{default:d(()=>[It]),_:1}),a(r,{color:"purple"},{default:d(()=>[Ct]),_:1}),a(r,{color:"green"},{default:d(()=>[xt]),_:1}),a(r,{color:"orange"},{default:d(()=>[Vt]),_:1}),a(r,{color:"red"},{default:d(()=>[Tt]),_:1})])]),o("div",Ot,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[Mt]),_:1}),o("div",Bt,[a(r,{appearance:"primary",color:"blue"},{default:d(()=>[Et]),_:1}),a(r,{appearance:"primary",color:"purple"},{default:d(()=>[Rt]),_:1}),a(r,{appearance:"primary",color:"green"},{default:d(()=>[Lt]),_:1}),a(r,{appearance:"primary",color:"orange"},{default:d(()=>[Pt]),_:1}),a(r,{appearance:"primary",color:"red"},{default:d(()=>[$t]),_:1})])]),o("div",zt,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[qt]),_:1}),o("div",At,[a(r,{appearance:"minimal",color:"blue"},{default:d(()=>[Ft]),_:1}),a(r,{appearance:"minimal",color:"purple"},{default:d(()=>[Ut]),_:1}),a(r,{appearance:"minimal",color:"green"},{default:d(()=>[Nt]),_:1}),a(r,{appearance:"minimal",color:"orange"},{default:d(()=>[Wt]),_:1}),a(r,{appearance:"minimal",color:"red"},{default:d(()=>[jt]),_:1})])]),o("div",Yt,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[Ht]),_:1}),o("div",Gt,[a(r,{color:"purple",tag:"a"},{default:d(()=>[Jt]),_:1}),a(r,{appearance:"primary",color:"purple",tag:"a"},{default:d(()=>[Xt]),_:1}),a(r,{appearance:"minimal",color:"purple",tag:"a"},{default:d(()=>[Kt]),_:1})])]),o("div",Zt,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[Qt]),_:1}),o("div",es,[a(r,{disabled:"",appearance:"primary",color:"green"},{default:d(()=>[ts]),_:1}),a(r,{disabled:"",appearance:"minimal",color:"green",tag:"a"},{default:d(()=>[ss]),_:1})])]),o("div",is,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[ns]),_:1}),o("div",os,[a(r,{color:"red"},{"icon-before":d(()=>[a(h,{type:"refresh-cw"})]),default:d(()=>[as]),_:1}),a(r,{appearance:"primary",color:"red"},{"icon-after":d(()=>[a(h,{type:"refresh-cw"})]),default:d(()=>[ls]),_:1}),a(r,{appearance:"minimal",color:"red"},{"icon-after":d(()=>[a(h,{type:"refresh-cw"})]),_:1})])]),o("div",rs,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[ds]),_:1}),o("div",cs,[a(r,{color:"orange","is-loading":s.loaders.primary,onClick:t[0]||(t[0]=g=>n.load("primary"))},{"icon-before":d(()=>[a(h,{type:"refresh-cw"})]),default:d(()=>[us]),_:1},8,["is-loading"]),a(r,{appearance:"primary",color:"orange","is-loading":s.loaders.secondary,onClick:t[1]||(t[1]=g=>n.load("secondary"))},{default:d(()=>[hs]),_:1},8,["is-loading"]),a(r,{color:"orange",appearance:"minimal","is-loading":s.loaders.secondary,onClick:t[2]||(t[2]=g=>n.load("secondary"))},{"icon-before":d(()=>[a(h,{type:"refresh-cw"})]),_:1},8,["is-loading"])])]),o("div",ps,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[_s]),_:1}),o("div",ms,[a(r,{"is-square":"",color:"green"},{default:d(()=>[fs]),_:1}),a(r,{"is-square":"",appearance:"primary",color:"green"},{default:d(()=>[gs]),_:1}),a(r,{"is-square":"",color:"green",appearance:"minimal"},{default:d(()=>[ys]),_:1})])]),o("div",bs,[a(u,{"heading-level":"h3",size:600,class:"sectionButtons__title"},{default:d(()=>[vs]),_:1}),o("div",Ds,[a(r,{"is-large":"",color:"green"},{"icon-before":d(()=>[a(h,{type:"refresh-cw"})]),default:d(()=>[Ss]),_:1}),a(r,{"is-large":"",appearance:"primary",color:"green"},{"icon-after":d(()=>[a(h,{type:"refresh-cw"})]),default:d(()=>[ks]),_:1}),a(r,{"is-large":"",color:"green",appearance:"minimal"},{default:d(()=>[ws]),_:1})])])]),_:1})}var Cs=S(vt,[["render",Is]]);const xs={data(){return{inputs:{default:"",sizes:"",icons:"",disabled:"disabled",error:"",hidden:"very long input text field that is so long I can see that icon is hidden",poop:null,number:null,email:"wrong email",date:"",password:"",mask:"",border:"",large:""}}}},Vs={class:"sectionSimpleInputs"},Ts={class:"sectionSimpleInputs__type"},Os=m("Default"),Ms={class:"sectionSimpleInputs__inputs"},Bs={class:"sectionSimpleInputs__type"},Es=m("Sizes"),Rs={class:"sectionSimpleInputs__inputs"},Ls={class:"sectionSimpleInputs__type"},Ps=m("With icons"),$s={class:"sectionSimpleInputs__inputs"},zs=o("span",null,"cm",-1),qs={class:"sectionSimpleInputs__type"},As=m("Disabled"),Fs={class:"sectionSimpleInputs__inputs"},Us=o("span",null,"cm",-1),Ns={class:"sectionSimpleInputs__type"},Ws=m("Errors"),js={class:"sectionSimpleInputs__inputs"},Ys=o("span",null,"cm",-1),Hs={class:"sectionSimpleInputs__type"},Gs=m("Hidden after icon"),Js={class:"sectionSimpleInputs__inputs"},Xs={class:"sectionSimpleInputs__type"},Ks=m("Types"),Zs={class:"sectionSimpleInputs__inputs"},Qs={class:"sectionSimpleInputs__type"},ei=m("Masks"),ti={class:"sectionSimpleInputs__inputs"},si={class:"sectionSimpleInputs__type"},ii=m("No border"),ni={class:"sectionSimpleInputs__inputs"},oi={class:"sectionSimpleInputs__type"},ai=m("Large"),li={class:"sectionSimpleInputs__inputs"},ri=o("span",null,"cm",-1);function di(e,t,i,p,s,n){const u=f("cp-heading"),r=f("cp-input"),h=f("cp-icon");return c(),_("div",Vs,[o("div",Ts,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[Os]),_:1}),o("div",Ms,[a(r,{modelValue:s.inputs.default,"onUpdate:modelValue":t[0]||(t[0]=l=>s.inputs.default=l),label:"Default input",type:"text",placeholder:"default input placeholder"},null,8,["modelValue"])])]),o("div",Bs,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[Es]),_:1}),o("div",Rs,[a(r,{modelValue:s.inputs.sizes,"onUpdate:modelValue":t[1]||(t[1]=l=>s.inputs.sizes=l),label:"Input 18px font-sized",placeholder:"Input placeholder",type:"text",style:{"font-size":"18px"}},null,8,["modelValue"]),a(r,{modelValue:s.inputs.sizes,"onUpdate:modelValue":t[2]||(t[2]=l=>s.inputs.sizes=l),label:"Input 16px font-sized",placeholder:"Input placeholder",type:"text",style:{"font-size":"16px"}},null,8,["modelValue"]),a(r,{modelValue:s.inputs.sizes,"onUpdate:modelValue":t[3]||(t[3]=l=>s.inputs.sizes=l),label:"Input 14px font-sized",placeholder:"Input placeholder",type:"text",style:{"font-size":"14px"}},null,8,["modelValue"]),a(r,{modelValue:s.inputs.sizes,"onUpdate:modelValue":t[4]||(t[4]=l=>s.inputs.sizes=l),label:"Input 12px font-sized",placeholder:"Input placeholder",type:"text",style:{"font-size":"12px"}},null,8,["modelValue"])])]),o("div",Ls,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[Ps]),_:1}),o("div",$s,[a(r,{modelValue:s.inputs.icons,"onUpdate:modelValue":t[5]||(t[5]=l=>s.inputs.icons=l),label:"Input with icon before \u2013 18px font-sized",type:"text",placeholder:"Input placeholder",style:{"font-size":"18px"}},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),_:1},8,["modelValue"]),a(r,{modelValue:s.inputs.icons,"onUpdate:modelValue":t[6]||(t[6]=l=>s.inputs.icons=l),label:"Input with icon before",type:"text",placeholder:"Input placeholder"},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),_:1},8,["modelValue"]),a(r,{modelValue:s.inputs.icons,"onUpdate:modelValue":t[7]||(t[7]=l=>s.inputs.icons=l),label:"Input with icon after \u2013 14px font-sized",type:"text",placeholder:"Input placeholder",style:{"font-size":"14px"}},{"input-icon-after":d(()=>[zs]),_:1},8,["modelValue"])])]),o("div",qs,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[As]),_:1}),o("div",Fs,[a(r,{label:"Empty disabled input with icon before",type:"text",placeholder:"Input placeholder",disabled:""},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),_:1}),a(r,{modelValue:s.inputs.disabled,"onUpdate:modelValue":t[8]||(t[8]=l=>s.inputs.disabled=l),label:"Valid disabled input with icon before",type:"text",placeholder:"Input placeholder",disabled:""},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),_:1},8,["modelValue"]),a(r,{modelValue:s.inputs.disabled,"onUpdate:modelValue":t[9]||(t[9]=l=>s.inputs.disabled=l),label:"Invalid disabled input with icon after",type:"text",placeholder:"Input placeholder",disabled:"","is-invalid":""},{"input-icon-after":d(()=>[Us]),_:1},8,["modelValue"])])]),o("div",Ns,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[Ws]),_:1}),o("div",js,[a(r,{modelValue:s.inputs.error,"onUpdate:modelValue":t[10]||(t[10]=l=>s.inputs.error=l),label:"Invalid input with icon before",type:"text",placeholder:"Input placeholder","is-invalid":"","error-message":"This input has an error"},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),_:1},8,["modelValue"]),a(r,{modelValue:s.inputs.error,"onUpdate:modelValue":t[11]||(t[11]=l=>s.inputs.error=l),label:"Invalid input with icon before",type:"text",placeholder:"Input placeholder","is-invalid":"","error-message":"This input has an error"},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),_:1},8,["modelValue"]),a(r,{modelValue:s.inputs.error,"onUpdate:modelValue":t[12]||(t[12]=l=>s.inputs.error=l),label:"Invalid input with icon after",type:"text",placeholder:"Input placeholder","is-invalid":"","error-message":"This input has an error"},{"input-icon-after":d(()=>[Ys]),_:1},8,["modelValue"])])]),o("div",Hs,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[Gs]),_:1}),o("div",Js,[a(r,{modelValue:s.inputs.hidden,"onUpdate:modelValue":t[13]||(t[13]=l=>s.inputs.hidden=l),label:"Input with hidden after icon",type:"text",placeholder:"Input placeholder","hide-validity-icon":""},null,8,["modelValue"])])]),o("div",Xs,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[Ks]),_:1}),o("div",Zs,[a(r,{modelValue:s.inputs.poop,"onUpdate:modelValue":t[14]||(t[14]=l=>s.inputs.poop=l),label:"Type number, masked ###",type:"number",placeholder:"Input placeholder",mask:"###"},null,8,["modelValue"]),a(r,{modelValue:s.inputs.number,"onUpdate:modelValue":t[15]||(t[15]=l=>s.inputs.number=l),label:"Input type number",type:"number",placeholder:"Input placeholder"},null,8,["modelValue"]),a(r,{modelValue:s.inputs.email,"onUpdate:modelValue":t[16]||(t[16]=l=>s.inputs.email=l),required:"",label:"Required input type email",type:"email",placeholder:"Input placeholder"},null,8,["modelValue"]),a(r,{modelValue:s.inputs.date,"onUpdate:modelValue":t[17]||(t[17]=l=>s.inputs.date=l),label:"Input type date",type:"date",placeholder:"Input placeholder"},null,8,["modelValue"]),a(r,{modelValue:s.inputs.password,"onUpdate:modelValue":t[18]||(t[18]=l=>s.inputs.password=l),label:"Input type password",type:"password",placeholder:"Input placeholder"},null,8,["modelValue"])])]),o("div",Qs,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[ei]),_:1}),o("div",ti,[a(r,{modelValue:s.inputs.mask,"onUpdate:modelValue":t[19]||(t[19]=l=>s.inputs.mask=l),label:"Date masked input",type:"text",placeholder:"00/00/0000",mask:"##/##/####"},null,8,["modelValue"])])]),o("div",si,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[ii]),_:1}),o("div",ni,[a(r,{modelValue:s.inputs.border,"onUpdate:modelValue":t[20]||(t[20]=l=>s.inputs.border=l),label:"Input without border",type:"text",placeholder:"I dont have borders","remove-border":""},null,8,["modelValue"]),a(r,{modelValue:s.inputs.border,"onUpdate:modelValue":t[21]||(t[21]=l=>s.inputs.border=l),label:"Input with error & without border",placeholder:"I dont have borders",type:"text","remove-border":"","is-invalid":""},null,8,["modelValue"])])]),o("div",oi,[a(u,{"heading-level":"h3",size:600,class:"sectionSimpleInputs__title"},{default:d(()=>[ai]),_:1}),o("div",li,[a(r,{modelValue:s.inputs.large,"onUpdate:modelValue":t[22]||(t[22]=l=>s.inputs.large=l),label:"Large input",type:"text",placeholder:"Input placeholder","is-large":""},null,8,["modelValue"]),a(r,{modelValue:s.inputs.large,"onUpdate:modelValue":t[23]||(t[23]=l=>s.inputs.large=l),label:"Large input",type:"text",placeholder:"Input placeholder","is-large":""},{"input-icon":d(()=>[a(h,{type:"map-pin"})]),"input-icon-after":d(()=>[ri]),_:1},8,["modelValue"])])])])}var ci=S(xs,[["render",di]]);const ui={inheritAttrs:!1,props:{isInvalid:{type:Boolean,default:!1,required:!1}}};function hi(e,t,i,p,s,n){return c(),_("label",re({class:[{"baseInputLabel--isInvalid":i.isInvalid},"baseInputLabel"]},e.$attrs),[T(e.$slots,"default")],16)}var ee=S(ui,[["render",hi]]);const pi={methods:{afterEnter(e){e.style.height="auto"},enter(e){const{width:t}=getComputedStyle(e);e.style.width=t,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto";const{height:i}=getComputedStyle(e);e.style.width=null,e.style.position=null,e.style.visibility=null,e.style.height=0,getComputedStyle(e).height,requestAnimationFrame(()=>{e.style.height=i})},leave(e){const{height:t}=getComputedStyle(e);e.style.height=t,getComputedStyle(e).height,requestAnimationFrame(()=>{e.style.height=0})}}};function _i(e,t,i,p,s,n){return c(),k($,{name:"expand",onEnter:n.enter,onAfterEnter:n.afterEnter,onLeave:n.leave},{default:d(()=>[T(e.$slots,"default",{},void 0,!0)]),_:3},8,["onEnter","onAfterEnter","onLeave"])}var H=S(pi,[["render",_i],["__scopeId","data-v-d29b8092"]]);const B=()=>`_${Math.random().toString(36).substr(2,9)}`,_e=function(t,i,p){let s="";return t&&(s=y.fromISO(t).toFormat(p)),i&&(s+=" - "+y.fromISO(i).toFormat(p)),s},q=e=>typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1);const mi={components:{BaseInputLabel:ee,TransitionExpand:H},props:{modelValue:{type:String,default:"",required:!1},label:{type:String,default:"",required:!1},placeholder:{type:String,default:"",required:!0},required:{type:Boolean,default:!1,required:!1},inputId:{type:String,default:"",required:!1},disabled:{type:Boolean,default:!1,required:!1},isInvalid:{type:Boolean,default:!1,required:!1},errorMessage:{type:String,default:"",required:!1},height:{type:Number,default:200,required:!1}},emits:["update:modelValue"],data(){return{inputReferenceId:this.inputId}},computed:{inputLabelTitle(){const e=this.required&&this.label?"*":"";return`${this.label} ${e}`}},mounted(){this.inputReferenceId||(this.inputReferenceId=B())},methods:{handleChange(e){this.$emit("update:modelValue",e.target.value)}}},fi={class:"cpTextarea"},gi=["id","disabled","placeholder","required","value"];function yi(e,t,i,p,s,n){const u=f("base-input-label"),r=f("transition-expand");return c(),_("div",fi,[i.label?(c(),k(u,{key:0,for:s.inputReferenceId},{default:d(()=>[m(b(n.inputLabelTitle),1)]),_:1},8,["for"])):D("",!0),o("textarea",{id:s.inputReferenceId,disabled:i.disabled,placeholder:i.placeholder,required:i.required,value:i.modelValue,style:P(`min-height: ${i.height}px`),class:w([{"cpTextarea__input--isInvalid":i.isInvalid},"cpTextarea__input"]),onInput:t[0]||(t[0]=(...h)=>n.handleChange&&n.handleChange(...h))},null,46,gi),a(r,null,{default:d(()=>[i.isInvalid?(c(),k(u,{key:0,for:s.inputReferenceId,"is-invalid":""},{default:d(()=>[m(b(i.errorMessage),1)]),_:1},8,["for"])):D("",!0)]),_:1})])}var me=S(mi,[["render",yi]]);const bi={components:{CpTextarea:me,SectionContainer:E,SectionSimpleInputs:ci},data(){return{textarea:""}}},vi={class:"sectionInputs__section"},Di=m("Simple inputs"),Si={class:"sectionInputs__section"},ki=m("Textarea");function wi(e,t,i,p,s,n){const u=f("cp-heading"),r=f("section-simple-inputs"),h=f("cp-textarea"),l=f("section-container");return c(),k(l,{"section-title":"Inputs",class:"sectionInputs"},{default:d(()=>[o("div",vi,[a(u,{"heading-level":"h3",size:600,class:"sectionInputs__title"},{default:d(()=>[Di]),_:1}),a(r)]),o("div",Si,[a(u,{"heading-level":"h3",size:600,class:"sectionInputs__title"},{default:d(()=>[ki]),_:1}),a(h,{modelValue:s.textarea,"onUpdate:modelValue":t[0]||(t[0]=g=>s.textarea=g),label:"Textarea label",placeholder:"The quick, brown fox jumps over a lazy dog."},null,8,["modelValue"])])]),_:1})}var Ii=S(bi,[["render",wi]]);const Ci={components:{SectionContainer:E},data(){return{selects:{default:"",sizes:"",disabled:"",large:"",error:"",options:[{label:"very very long option 1",value:"first_option"},{label:"option 2",value:"second_option"},{label:"option 3",value:"third_option"}]}}}},xi={class:"sectionSelects__type"},Vi=m("Default"),Ti={class:"sectionSelects__selects"},Oi={class:"sectionSelects__type"},Mi=m("Sizes"),Bi={class:"sectionSelects__selects"},Ei={class:"sectionSelects__type"},Ri=m("Disabled"),Li={class:"sectionSelects__selects"},Pi={class:"sectionSelects__type"},$i=m("With error"),zi={class:"sectionSelects__selects"},qi={class:"sectionSelects__type"},Ai=m("Large"),Fi={class:"sectionSelects__selects"};function Ui(e,t,i,p,s,n){const u=f("cp-heading"),r=f("cp-select"),h=f("section-container");return c(),k(h,{"section-title":"Selects",class:"sectionSelects"},{default:d(()=>[o("div",xi,[a(u,{"heading-level":"h3",size:600,class:"sectionSelects__title"},{default:d(()=>[Vi]),_:1}),o("div",Ti,[a(r,{modelValue:s.selects.default,"onUpdate:modelValue":t[0]||(t[0]=l=>s.selects.default=l),label:"Default select",options:s.selects.options},null,8,["modelValue","options"])])]),o("div",Oi,[a(u,{"heading-level":"h3",size:600,class:"sectionSelects__title"},{default:d(()=>[Mi]),_:1}),o("div",Bi,[a(r,{modelValue:s.selects.sizes,"onUpdate:modelValue":t[1]||(t[1]=l=>s.selects.sizes=l),label:"Select 18px font-sized",options:s.selects.options,style:{"font-size":"18px"}},null,8,["modelValue","options"]),a(r,{modelValue:s.selects.sizes,"onUpdate:modelValue":t[2]||(t[2]=l=>s.selects.sizes=l),label:"Select 16px font-sized",options:s.selects.options},null,8,["modelValue","options"]),a(r,{modelValue:s.selects.sizes,"onUpdate:modelValue":t[3]||(t[3]=l=>s.selects.sizes=l),label:"Select 14px font-sized",options:s.selects.options,style:{"font-size":"14px"}},null,8,["modelValue","options"]),a(r,{modelValue:s.selects.sizes,"onUpdate:modelValue":t[4]||(t[4]=l=>s.selects.sizes=l),label:"Select 12px font-sized",options:s.selects.options,style:{"font-size":"12px"}},null,8,["modelValue","options"])])]),o("div",Ei,[a(u,{"heading-level":"h3",size:600,class:"sectionSelects__title"},{default:d(()=>[Ri]),_:1}),o("div",Li,[a(r,{modelValue:s.selects.disabled,"onUpdate:modelValue":t[5]||(t[5]=l=>s.selects.disabled=l),disabled:"",label:"Disabled select",options:s.selects.options},null,8,["modelValue","options"])])]),o("div",Pi,[a(u,{"heading-level":"h3",size:600,class:"sectionSelects__title"},{default:d(()=>[$i]),_:1}),o("div",zi,[a(r,{modelValue:s.selects.disabled,"onUpdate:modelValue":t[6]||(t[6]=l=>s.selects.disabled=l),label:"Select with error",options:s.selects.options,"is-invalid":""},null,8,["modelValue","options"]),a(r,{modelValue:s.selects.disabled,"onUpdate:modelValue":t[7]||(t[7]=l=>s.selects.disabled=l),label:"Select with error message",options:s.selects.options,"is-invalid":"","error-message":"This select has an error message"},null,8,["modelValue","options"]),a(r,{modelValue:s.selects.disabled,"onUpdate:modelValue":t[8]||(t[8]=l=>s.selects.disabled=l),disabled:"",label:"Disabled select with error",options:s.selects.options,"is-invalid":"","error-message":"This select has an error message"},null,8,["modelValue","options"])])]),o("div",qi,[a(u,{"heading-level":"h3",size:600,class:"sectionSelects__title"},{default:d(()=>[Ai]),_:1}),o("div",Fi,[a(r,{modelValue:s.selects.large,"onUpdate:modelValue":t[9]||(t[9]=l=>s.selects.large=l),"is-large":"",label:"Select with error",options:s.selects.options,"is-invalid":""},null,8,["modelValue","options"])])])]),_:1})}var Ni=S(Ci,[["render",Ui]]);const Wi={components:{SectionContainer:E},data(){return{firstMenuSelectedValue:{label:"Banana",value:"first_value"},firstMenuSelectMenuValues:[{label:"Banana",value:"first_value"},{label:"Kiwi",value:"second_value"},{label:"Orange",value:"third_value"},{label:"Pineapple",value:"fourth_value"}],secondMenuSelectedValue:{label:"Dog",value:"first_value"},secondMenuSelectMenuValues:[{label:"Dog",value:"first_value"},{label:"Cat",value:"second_value"},{label:"Snake",value:"third_value"},{label:"Dragon",value:"fourth_value"}],secondMenuFilterValue:""}},computed:{secondMenuFilteredList(){return this.secondMenuSelectMenuValues.filter(e=>e.label.toLowerCase().includes(this.secondMenuFilterValue.toLowerCase()))}},methods:{filterValues(e){this.secondMenuFilterValue=e}}},ji={class:"item"},Yi=o("h3",null,"Simple select menu without filter",-1),Hi={class:"item"},Gi=o("h3",null,"Select menu with title and filter",-1);function Ji(e,t,i,p,s,n){const u=f("cp-select-menu"),r=f("section-container");return c(),k(r,{"section-title":"Select menu"},{default:d(()=>[o("div",ji,[Yi,o("span",null,"selected value: "+b(s.firstMenuSelectedValue),1),a(u,{"selected-value":s.firstMenuSelectedValue,"onUpdate:selected-value":t[0]||(t[0]=h=>s.firstMenuSelectedValue=h),values:s.firstMenuSelectMenuValues},null,8,["selected-value","values"])]),o("div",Hi,[Gi,o("span",null,"selected value: "+b(s.secondMenuSelectedValue),1),a(u,{"selected-value":s.secondMenuSelectedValue,"onUpdate:selected-value":t[1]||(t[1]=h=>s.secondMenuSelectedValue=h),values:n.secondMenuFilteredList,"has-filter":!0,"dropdown-title":"Select value","dropdown-filter-placeholder":"Search value...","dropdown-list-placeholder":"No option found",onOnFilterChange:n.filterValues},null,8,["selected-value","values","onOnFilterChange"])])]),_:1})}var Xi=S(Wi,[["render",Ji]]);const Ki={components:{SectionContainer:E},data(){return{cpDate:"",date:null}},methods:{setDate(e){this.date=e[0]},resetDate(){this.date=null}}},Zi={class:"sectionDatePickers__type"},Qi={class:"sectionDatePickers__datepickers"},en={class:"sectionDatePickers__type"},tn={class:"sectionDatePickers__datepickers"},sn=m("Reset date"),nn={class:"sectionDatePickers__type"},on={class:"sectionDatePickers__datepickers"},an={class:"sectionDatePickers__type"},ln=m(" Range datepicker "),rn={class:"sectionDatePickers__datepickers"},dn={class:"sectionDatePickers__type"},cn=m(" Simple datepicker with custom placeholder "),un={class:"sectionDatePickers__datepickers"},hn={class:"sectionDatePickers__type"},pn=m(" Datepicker with set minDate & maxDate (2021-01-01 / 2021-01-10) "),_n={class:"sectionDatePickers__datepickers"},mn={class:"sectionDatePickers__type"},fn=m(" Allow-past-dates "),gn={class:"sectionDatePickers__datepickers"},yn={class:"sectionDatePickers__type"},bn=m(" Default CpCalendar "),vn={class:"sectionDatePickers__datepickers"};function Dn(e,t,i,p,s,n){const u=f("cp-heading"),r=f("cp-date"),h=f("cp-datepicker"),l=f("cp-button"),g=f("cp-calendar"),v=f("section-container");return c(),k(v,{"section-title":"Date picker",class:"sectionDatePickers"},{default:d(()=>[o("div",Zi,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[m(" Default date input: "+b(s.cpDate),1)]),_:1}),o("div",Qi,[a(r,{modelValue:s.cpDate,"onUpdate:modelValue":t[0]||(t[0]=C=>s.cpDate=C),label:"Default date input",class:"sectionDatePickers__date"},null,8,["modelValue"])])]),o("div",en,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[m(" Default datepicker: "+b(s.date),1)]),_:1}),o("div",tn,[a(h,{label:"Simple datepicker","init-date-one":s.date,onDates:n.setDate},null,8,["init-date-one","onDates"]),a(l,{class:"sectionDatePickers__button",onClick:n.resetDate},{default:d(()=>[sn]),_:1},8,["onClick"])])]),o("div",nn,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[m(" Simple inline datepicker: "+b(s.date),1)]),_:1}),o("div",on,[a(h,{label:"Range datepicker","single-month":"","is-inline":"","init-date-one":s.date,onDates:n.setDate},null,8,["init-date-one","onDates"])])]),o("div",an,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[ln]),_:1}),o("div",rn,[a(h,{label:"Range datepicker",mode:"range","min-date":"2020-10-10"})])]),o("div",dn,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[cn]),_:1}),o("div",un,[a(h,{label:"Simple datepicker with custom placeholder","init-date-one":s.date,placeholder:"Custom placeholder",onDates:n.setDate},null,8,["init-date-one","onDates"])])]),o("div",hn,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[pn]),_:1}),o("div",_n,[a(h,{label:"Datepicker with set minDate & maxDate","min-date":"2022-01-01","max-date":"2022-01-10",placeholder:"Custom placeholder",onDates:n.setDate},null,8,["onDates"])])]),o("div",mn,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[fn]),_:1}),o("div",gn,[a(h,{label:"Allow past dates","allow-past-dates":"",placeholder:"Custom placeholder",onDates:n.setDate},null,8,["onDates"])])]),o("div",yn,[a(u,{"heading-level":"h3",size:600,class:"sectionDatePickers__title"},{default:d(()=>[bn]),_:1}),o("div",vn,[a(g,{label:"Calendar"})])])]),_:1})}var Sn=S(Ki,[["render",Dn]]);const kn={components:{SectionContainer:E},methods:{addUniqueToaster(){this.$toaster.unique({title:"Unique message published"})},addMultipleToaster(){this.$toaster.warning({title:"This is a warning toaster",description:"This a description of a toaster"}),this.$toaster.info({title:"This is an info toaster",description:"This a description of a toaster"}),this.$toaster.success({title:"This is a success toaster",description:"This a description of a toaster"}),this.$toaster.critical({title:"This is a critical toaster",description:"This a description of a toaster"})},addSuccessToaster(){this.$toaster.success({title:"This is a success toaster",description:"This a description of a toaster"})},addLinkToaster(){this.$toaster.success({title:"This is a success toaster",description:"Description of a toaster with a link",actionLabel:"See flight information",actionMethod:e=>{e.closeToaster(),window.open("http://app.citizenplane.com","_blank")}})}}},wn={class:"item"},In=m("Add Unique"),Cn={class:"item"},xn=m("Add Multiple"),Vn={class:"item"},Tn=m("Add Success"),On={class:"item"},Mn=m("Add link");function Bn(e,t,i,p,s,n){const u=f("cp-button"),r=f("section-container");return c(),k(r,{"section-title":"Toaster",class:"sectionToaster"},{default:d(()=>[o("div",wn,[a(u,{onClick:n.addUniqueToaster},{default:d(()=>[In]),_:1},8,["onClick"])]),o("div",Cn,[a(u,{onClick:n.addMultipleToaster},{default:d(()=>[xn]),_:1},8,["onClick"])]),o("div",Vn,[a(u,{onClick:n.addSuccessToaster},{default:d(()=>[Tn]),_:1},8,["onClick"])]),o("div",On,[a(u,{onClick:n.addLinkToaster},{default:d(()=>[Mn]),_:1},8,["onClick"])])]),_:1})}var En=S(kn,[["render",Bn]]),G={BLUE:"blue",PURPLE:"purple",GREEN:"green",ORANGE:"orange",RED:"red"},A={BLUE:G.BLUE,PURPLE:G.PURPLE};const Rn={components:{SectionContainer:E},data(){return{Colors:G,cpSwitchState:!0,radioGroup:[{value:"basketball",label:"Basketball",description:"default",additionalData:"default color"},{value:"football",label:"Football",additionalData:"disabled",disabled:!0},{value:"handball",label:"Handball",additionalData:"More data"}],checkboxGroup:[{value:"ski",label:"Ski"},{value:"snowboard",label:"Snowboard",disabled:!0},{value:"wakeboard",label:"Wake board"}],radioGroupSelectedOption:"football",checkboxGroupSelectOption:["snowboard"],simpleCheckbox:!0}},methods:{isRadioSelected(e){return e===this.radioGroupSelectedOption}}},Ln={class:"item"},Pn=o("h3",null,"Switch",-1),$n={class:"item"},zn=o("h3",null,"Switch disabled",-1),qn={class:"item"},An=o("h3",null,"Checkbox with multiple values",-1),Fn={class:"sectionToggles__toggle"},Un={class:"item"},Nn=o("h3",null,"Simple checkbox",-1),Wn={class:"sectionToggles__toggle"},jn={class:"sectionToggles__toggle"},Yn={class:"item"},Hn=o("h3",null,"Radio",-1),Gn={class:"sectionToggles__toggle"};function Jn(e,t,i,p,s,n){const u=f("cp-switch"),r=f("cp-checkbox"),h=f("cp-radio"),l=f("section-container");return c(),k(l,{"section-title":"Toggles",class:"sectionToggles"},{default:d(()=>[o("div",Ln,[Pn,o("span",null,"Switch state: "+b(s.cpSwitchState),1),a(u,{modelValue:s.cpSwitchState,"onUpdate:modelValue":t[0]||(t[0]=g=>s.cpSwitchState=g),class:"sectionToggles__switch sectionToggles__switch--isSmall"},null,8,["modelValue"]),a(u,{modelValue:s.cpSwitchState,"onUpdate:modelValue":t[1]||(t[1]=g=>s.cpSwitchState=g),class:"sectionToggles__switch",color:s.Colors.PURPLE,label:"Purple switch with label"},null,8,["modelValue","color"]),a(u,{modelValue:s.cpSwitchState,"onUpdate:modelValue":t[2]||(t[2]=g=>s.cpSwitchState=g),class:"sectionToggles__switch","reverse-label":"",label:"Default switch with reversed label"},null,8,["modelValue"])]),o("div",$n,[zn,a(u,{modelValue:s.cpSwitchState,"onUpdate:modelValue":t[3]||(t[3]=g=>s.cpSwitchState=g),class:"sectionToggles__switch",label:"Disabled switch",disabled:""},null,8,["modelValue"]),a(u,{modelValue:s.cpSwitchState,"onUpdate:modelValue":t[4]||(t[4]=g=>s.cpSwitchState=g),class:"sectionToggles__switch",disabled:""},null,8,["modelValue"]),a(u,{modelValue:s.cpSwitchState,"onUpdate:modelValue":t[5]||(t[5]=g=>s.cpSwitchState=g),class:"sectionToggles__switch",color:s.Colors.PURPLE,disabled:""},null,8,["modelValue","color"])]),o("div",qn,[An,o("span",null,"Selected value: "+b(s.checkboxGroupSelectOption),1),o("div",Fn,[(c(!0),_(I,null,V(s.checkboxGroup,({label:g,value:v,disabled:C},x)=>(c(),k(r,{key:`checkbox${x}`,value:s.checkboxGroupSelectOption,"onUpdate:value":t[6]||(t[6]=L=>s.checkboxGroupSelectOption=L),"checkbox-value":v,"checkbox-label":g,"group-name":"cp-checkbox","is-disabled":C},null,8,["value","checkbox-value","checkbox-label","is-disabled"]))),128))])]),o("div",Un,[Nn,o("span",null,"Selected value: "+b(s.simpleCheckbox),1),o("div",Wn,[a(r,{value:s.simpleCheckbox,"onUpdate:value":t[7]||(t[7]=g=>s.simpleCheckbox=g),"checkbox-label":"label","group-name":"simple-checkbox"},null,8,["value"])]),o("div",jn,[a(r,{value:s.simpleCheckbox,"onUpdate:value":t[8]||(t[8]=g=>s.simpleCheckbox=g),"checkbox-label":"Purple reversed label checkbox","group-name":"simple-checkbox",color:s.Colors.PURPLE,"reverse-label":""},null,8,["value","color"])])]),o("div",Yn,[Hn,o("span",null,"Selected value: "+b(s.radioGroupSelectedOption),1),o("div",Gn,[a(h,{modelValue:s.radioGroupSelectedOption,"onUpdate:modelValue":t[9]||(t[9]=g=>s.radioGroupSelectedOption=g),options:s.radioGroup,"group-name":"cp-radio",color:"purple"},null,8,["modelValue","options"])])])]),_:1})}var Xn=S(Rn,[["render",Jn]]);const Kn={components:{SectionContainer:E},data(){return{alertMessages:["info","success","warning","critical"]}}},Zn={class:"sectionFeedbackIndicators__alertMessage"},Qn=m("Alert message"),eo=m(" The quick, brown fox jumps over a lazy dog. ");function to(e,t,i,p,s,n){const u=f("cp-heading"),r=f("cp-alert"),h=f("section-container");return c(),k(h,{"section-title":"Feedback Indicators",class:"sectionFeedbackIndicators"},{default:d(()=>[o("div",Zn,[a(u,{"heading-level":"h3",size:600,class:"sectionFeedbackIndicators__title"},{default:d(()=>[Qn]),_:1}),(c(!0),_(I,null,V(s.alertMessages,(l,g)=>(c(),k(r,{key:g,intent:l,title:`Alert intent: ${l}`,"is-closable":""},{default:d(()=>[eo]),_:2},1032,["intent","title"]))),128))])]),_:1})}var so=S(Kn,[["render",to]]);const io={components:{SectionContainer:E},data(){return{objectColumns:[{name:"Line number (300px width)",id:"line_number",width:300},"name",{name:"Firstname (right aligned)",id:"firstname",textAlign:"right"},{name:"Job title",id:"job_title"},{name:"Username (center aligned, 400px width)",id:"username",width:400,textAlign:"center"},"email",{name:"Address (300px width)",id:"address",width:300},"zip code",{name:"City",id:"city"},{name:"State",id:"state"},{name:"Country",id:"country"},{name:"Phone number",id:"phone_number"}],caption:"Table caption",pagination:{enabled:!0,limit:this.rowsPerPage},rowsPerPage:4,numberOfColumns:12,rowData:"",cellData:"",isLoading:!1}},computed:{objectRows(){return[{groupBy:"January",rows:[{line_number:"0",firstname:"Vincent",job_title:"software engineer",username:"pseudodeVincent",address:"34 rue de la Solidarit\xE9",state:"Nevada"},["1","Ohayon","Alexis","CTO","aloha","alexis@citizenplane.com","23 rue de Cl\xE9ry","75002","Paris","Ile de France","France","0101010110"]]},{groupBy:"February",rows:[{line_number:"0",firstname:"Vincent",job_title:"software engineer",username:"pseudodeVincent",address:"34 rue de la Solidarit\xE9",state:"Nevada"},["1","Ohayon","Alexis","CTO","aloha","alexis@citizenplane.com","23 rue de Cl\xE9ry","75002","Paris","Ile de France","France","0101010110"]]},{groupBy:"March",rows:[{line_number:"0",firstname:"Vincent",job_title:"software engineer",username:"pseudodeVincent",address:"34 rue de la Solidarit\xE9",state:"Nevada"},["1","Ohayon","Alexis","CTO","aloha","alexis@citizenplane.com","23 rue de Cl\xE9ry","75002","Paris","Ile de France","France","0101010110"]]}]},computedPagination(){return{enabled:!0,limit:Number(this.rowsPerPage)}},computedColumns(){return this.objectColumns.slice(0,this.numberOfColumns)},computedRows(){return this.objectRows}},methods:{handleRightClick({event:e}){e.preventDefault(),document.addEventListener("click",this.documentClickHandler);const t=window.innerWidth,i=e.clientX,p=e.clientY,n=i+250<=t?e.clientX:e.clientX-250;this.$refs.menu.style.top=`${p}px`,this.$refs.menu.style.left=`${n}px`,this.$refs.menu.classList.remove("hidden")},documentClickHandler(e){var i;((i=this.$refs)==null?void 0:i.menu.contains(e.target))||(this.$refs.menu.classList.add("hidden"),document.removeEventListener("click",this.documentClickHandler))}}},no={class:"sectionListAndTables"},oo={ref:"menu",class:"sectionListAndTables__menu hidden"},ao=o("li",null,"First option",-1),lo=o("li",null,"Second option",-1),ro=o("li",null,"Third option",-1),co=[ao,lo,ro];function uo(e,t,i,p,s,n){const u=f("cp-table"),r=f("section-container");return c(),k(r,{"section-title":"List and tables",class:"sectionListAndTables"},{default:d(()=>[o("div",no,[a(u,{caption:s.caption,data:n.computedRows,columns:n.computedColumns,class:"tableExample__table",pagination:n.computedPagination,"is-loading":s.isLoading,"enable-row-options":"","are-rows-clickable":"",onOnRowRightClick:n.handleRightClick},null,8,["caption","data","columns","pagination","is-loading","onOnRowRightClick"]),o("ul",oo,co,512)])]),_:1})}var ho=S(io,[["render",uo]]);const po={name:"Pimp",components:{PimpLogo:nt,SectionAtomicElements:_t,SectionTypography:bt,SectionButtons:Cs,SectionInputs:Ii,SectionSelects:Ni,SectionSelectMenus:Xi,SectionDatePickers:Sn,SectionToasters:En,SectionToggles:Xn,SectionFeedbackIndicators:so,SectionListsAndTables:ho},computed:{version(){return Ze.version}}},_o={class:"designPlayground"},mo={class:"designPlayground__header header"},fo=m("Pimp"),go={class:"header__tagline"},yo={class:"designPlayground__container"};function bo(e,t,i,p,s,n){const u=f("pimp-logo"),r=f("cp-heading"),h=f("section-lists-and-tables"),l=f("section-atomic-elements"),g=f("section-typography"),v=f("section-buttons"),C=f("section-inputs"),x=f("section-selects"),L=f("section-select-menus"),J=f("section-date-pickers"),oe=f("section-toasters"),Oe=f("section-toggles"),Me=f("section-feedback-indicators");return c(),_("div",_o,[o("header",mo,[a(u,{class:"header__logo"}),a(r,{size:700,"heading-level":"h2",class:"header__title"},{default:d(()=>[fo]),_:1}),o("div",go,"v "+b(n.version),1)]),o("div",yo,[a(h),a(l),a(g),a(v),a(C),a(x),a(L),a(J),a(oe),a(Oe),a(Me)])])}var vo=S(po,[["render",bo]]);const Do=["neutral","blue","green","red","orange","purple","teal","pink","yellow"],So={props:{color:{type:String,required:!0,validator:e=>Do.includes(e)},label:{type:[String,Number],required:!0},isSolid:{type:Boolean,default:!1,required:!1},isPlain:{type:Boolean,default:!1,required:!1}},computed:{capitalizedColor(){return q(this.color)},computedClasses(){return[this.isSolid?"cpBadge--isSolid":"",this.isPlain?"cpBadge--isPlain":"",`cpBadge--is${this.capitalizedColor}`]}}},ko={class:"cpBadge__label"};function wo(e,t,i,p,s,n){return c(),_("div",{class:w(["cpBadge",n.computedClasses])},[o("span",ko,b(i.label),1)],2)}var Io=S(So,[["render",wo]]);const te=["h1","h2","h3","h4","h5","h6"],fe=[100,200,300,400,500,600,700,800,900],Co={props:{headingLevel:{type:String,default:te[0],validator:e=>te.includes(e),required:!1},size:{type:Number,default:fe[4],validator:e=>fe.includes(e),required:!1}},data(){return{headingLevels:te}}};function xo(e,t,i,p,s,n){return c(),k(de(e.$props.headingLevel),re(e.$attrs,{class:[`cpHeading--${i.size}`,"cpHeading"]}),{default:d(()=>[T(e.$slots,"default")]),_:3},16,["class"])}var ge=S(Co,[["render",xo]]);const Vo={props:{color:{type:String,default:"#ff6700"}}},To={id:"loader-1",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"40px",height:"40px",viewBox:"0 0 40 40","enable-background":"new 0 0 40 40","xml:space":"preserve"},Oo=["fill"],Mo=["fill"],Bo=o("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 20 20",to:"360 20 20",dur:"0.5s",repeatCount:"indefinite"},null,-1),Eo=[Bo];function Ro(e,t,i,p,s,n){return c(),_("svg",To,[o("path",{opacity:"0.2",fill:i.color,d:"M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"},null,8,Oo),o("path",{fill:i.color,d:"M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z"},Eo,8,Mo)])}var ye=S(Vo,[["render",Ro]]);const be={default:"default",primary:"primary",minimal:"minimal"},ve={button:"button",a:"a"},De={button:"button",submit:"submit",reset:"reset"},Lo={components:{CpLoader:ye},props:{appearance:{type:String,default:be.default,validator:e=>({}).propertyIsEnumerable.call(be,e)},color:{type:String,default:"",validator:e=>Object.values(G).includes(e)||e===""},disabled:{type:Boolean,default:!1},tag:{type:String,default:ve.button,validator:e=>({}).propertyIsEnumerable.call(ve,e)},type:{type:String,default:De.button,validator:e=>({}).propertyIsEnumerable.call(De,e)},isLoading:{type:Boolean,default:!1},isSquare:{type:Boolean,default:!1},isLarge:{type:Boolean,default:!1}},emits:["click"],computed:{capitalizedAppearance(){return q(this.appearance)},capitalizedColor(){return q(this.color)},dynamicClasses(){return[`cpButton--is${this.capitalizedAppearance}`,this.capitalizedColor&&`cpButton--is${this.capitalizedColor}`,{"cpButton--isDisabled":this.isButtonDisabled,"cpButton--isIcon":!this.hasLabel,"cpButton--isLoading":this.isLoading,"cpButton--isSquare":this.isSquare,"cpButton--isLarge":this.isLarge}]},hasLabel(){return!!this.$slots.default},hasIconBefore(){return!!this.$slots["icon-before"]},hasIconAfter(){return!!this.$slots["icon-after"]},isButtonDisabled(){return this.disabled||this.isLoading?!0:null}},methods:{handleClick(e){this.isButtonDisabled||this.$emit("click",e)}}},Po={class:"cpButton__body"},$o={key:0,class:"cpButton__loader"},zo={key:1,class:"cpButton__icon cpButton__icon--isBefore"},qo={key:2},Ao={key:3,class:"cpButton__icon cpButton__icon--isAfter"};function Fo(e,t,i,p,s,n){const u=f("cp-loader");return c(),k(de(i.tag),{type:i.type,"aria-disabled":n.isButtonDisabled,disabled:n.isButtonDisabled,class:w([n.dynamicClasses,"cpButton"]),role:"button",tabindex:"0",onClick:n.handleClick},{default:d(()=>[o("span",Po,[i.isLoading?(c(),_("span",$o,[a(u,{color:"#B2B2BD"})])):D("",!0),n.hasIconBefore?(c(),_("span",zo,[T(e.$slots,"icon-before")])):D("",!0),n.hasLabel?(c(),_("span",qo,[T(e.$slots,"default")])):D("",!0),n.hasIconAfter?(c(),_("span",Ao,[T(e.$slots,"icon-after")])):D("",!0)])]),_:3},8,["type","aria-disabled","disabled","class","onClick"])}var Se=S(Lo,[["render",Fo]]);const Uo=120,No={props:{modelValue:{type:[String,Date],default:""},minDate:{type:[String,Date],default:y.now().minus({year:Uo}).toISO()},maxDate:{type:[String,Date],default:y.now().toISO()},label:{type:String,default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","on-validation"],data(){return{day:this.initDateToken("day"),month:this.initDateToken("month"),year:this.initDateToken("year")}},computed:{formattedLabel(){const e=this.required&&this.label?"*":"";return`${this.label} ${e}`},cpDateId(){return B()},minYear(){return this.isoMinDate.year},maxYear(){return this.isoMaxDate.year},monthMaxDay(){return y.fromObject({year:this.year&&this.year.length<=4?Number(this.year):y.now().year,month:this.month?Number(this.month):y.now().month,day:1}).daysInMonth},months(){return z.months().map((e,t)=>({label:e,value:t+1}))},isoDate(){return y.fromObject({year:Number(this.year),month:Number(this.month),day:Number(this.day)}).toISODate()},isoMinDate(){return y.fromISO(this.minDate)},isoMaxDate(){return y.fromISO(this.maxDate)},isDateAfterMinDate(){return this.isoDate>=this.isoMinDate.toISODate()},isDateBeforeMaxDate(){return this.isoDate<=this.isoMaxDate.toISODate()},areInputsEmpty(){return this.day===""&&this.month===""&&this.year===""},isDateValid(){if(!this.required&&this.areInputsEmpty)return!0;const e=this.isDayValid&&this.isMonthValid&&this.isYearValid&&this.isDateBeforeMaxDate&&this.isDateAfterMinDate;return this.$emit("on-validation",e),e},isDayValid(){return this.day>=1&&this.day<=this.monthMaxDay},isMonthValid(){return!!this.month},isYearValid(){return this.year>=this.minYear&&this.year<=this.maxYear},areAllFieldsEmpty(){return!this.day&&!this.month&&!this.year},errorMessage(){return this.areAllFieldsEmpty&&this.required?`The ${this.label} field is required.`:this.isMonthValid?this.isDayValid?this.isYearValid?this.isDateBeforeMaxDate?this.isDateAfterMinDate?"":`The date can't be before ${this.isoMinDate.toFormat("DDD")}.`:`The date can't be after ${this.isoMaxDate.toFormat("DDD")}.`:`Year must be in the range ${this.minYear} \u2013 ${this.maxYear}.`:`Day must be in the range 1 \u2013 ${this.monthMaxDay}.`:"Month is required."},dynamicClasses(){return{"cpDate--isInvalid":!this.isDateValid,"cpDate--isDisabled":this.disabled}},selectDynamicClass(){return{"cpDate__month--isEmpty":!this.month}}},watch:{day(){this.handleUpdate()},month(){this.handleUpdate(),this.focusOnFirstEmptyInput()},year(){this.handleUpdate()}},methods:{initDateToken(e){return y.fromISO(this.modelValue).invalid?"":y.fromISO(this.modelValue)[e]},handleUpdate(){const e=this.isDateValid?this.isoDate:"Invalid Datetime";this.$emit("update:modelValue",e)},focusOnFirstEmptyInput(){if(!this.isDayValid){this.$refs.day.focus();return}this.isYearValid||this.$refs.year.focus()}}},Wo=["for"],jo={class:"cpDate__inputs"},Yo=["required","disabled"],Ho=o("div",{class:"cpDate__divider"},null,-1),Go=["id","required","disabled"],Jo=o("option",{value:"",disabled:""},"Month",-1),Xo=["value"],Ko=o("div",{class:"cpDate__divider"},null,-1),Zo=["min","max","disabled","required"],Qo={key:0,class:"cpDate__errorMessage"};function ea(e,t,i,p,s,n){const u=f("cp-icon"),r=f("transition-expand");return c(),_("div",{class:w(["cpDate",n.dynamicClasses])},[i.label?(c(),_("label",{key:0,class:"cpDate__label",for:n.cpDateId},[m(b(n.formattedLabel)+" ",1),n.isDateValid?D("",!0):(c(),k(u,{key:0,type:"alert-circle"}))],8,Wo)):D("",!0),o("div",jo,[O(o("input",{ref:"day","onUpdate:modelValue":t[0]||(t[0]=h=>s.day=h),placeholder:"DD",class:"cpDate__day",type:"number",inputmode:"numeric",min:1,max:31,maxlength:"2",required:i.required,disabled:i.disabled},null,8,Yo),[[ce,s.day]]),Ho,o("div",{class:w(["cpDate__month",n.selectDynamicClass])},[O(o("select",{id:n.cpDateId,"onUpdate:modelValue":t[1]||(t[1]=h=>s.month=h),required:i.required,disabled:i.disabled},[Jo,(c(!0),_(I,null,V(n.months,(h,l)=>(c(),_("option",{key:l,value:h.value},b(h.label),9,Xo))),128))],8,Go),[[K,s.month]])],2),Ko,O(o("input",{ref:"year","onUpdate:modelValue":t[2]||(t[2]=h=>s.year=h),placeholder:"YYYY",class:"cpDate__year",type:"number",inputmode:"numeric",min:n.minYear,max:n.maxYear,maxlength:"4",disabled:i.disabled,required:i.required},null,8,Zo),[[ce,s.year]])]),a(r,null,{default:d(()=>[n.isDateValid?D("",!0):(c(),_("div",Qo,b(n.errorMessage),1))]),_:1})],2)}var ta=S(No,[["render",ea]]),sa={componentUpdated:ke,inserted:ke};function ke(e){const t=document.createElement("select");t.className=e.className;const i=document.createElement("option");i.textContent=e.value,t.appendChild(i),e.parentNode.appendChild(t),e.style.width=t.offsetWidth+"px",t.parentNode.removeChild(t)}const N=$e({name:"CpIcon",props:{animation:{type:String,default:void 0},animationSpeed:{type:String,default:void 0},fill:{type:String,default:"none"},size:{type:[Number,String],default:24},stroke:{type:String,default:"currentColor"},strokeLinecap:{type:String,default:"round"},strokeLinejoin:{type:String,default:"round"},strokeWidth:{type:[Number,String],default:2},tag:{type:String,default:"i"},type:{type:String,default:"feather",validator(e){if(!ze)throw new Error("The Feather icons is required.");if(!ue.exports.icons[e])throw new Error(`"${e}" is not an available icon type.`);return!0}}},setup(e,{attrs:t}){const i=ue.exports.icons[e.type];return()=>Z(e.tag,X(M({},t),{"data-name":e.type,"data-tags":i.tags,"data-type":e.type,class:{featherIcon:!0,[`cpIcon--${e.type}`]:e.type,[`cpIcon--${e.animation}`]:e.animation,[`cpIcon--${e.animationSpeed}`]:e.animationSpeed}}),[Z("svg",X(M({},i.attrs),{fill:e.fill,height:e.size,stroke:e.stroke,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,"stroke-width":e.strokeWidth,width:e.size,class:[i.attrs.class,"cpIcon__content"],innerHTML:i.contents}))])}});const we=768,ia={name:"CoreDatepicker",components:{CpIcon:N},directives:{resizeSelect:sa},props:{triggerElementId:{type:String,default:"datepicker-trigger"},dateOne:{type:[String,Date],default:""},dateTwo:{type:[String,Date],default:""},minDate:{type:[String,Date],default:()=>y.local().toISODate()},maxDate:{type:[String,Date],default:""},mode:{type:String,default:"single"},offsetY:{type:Number,default:0},offsetX:{type:Number,default:0},monthsToShow:{type:Number,default:2},startOpen:{type:Boolean},fullscreenMobile:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},mobileHeader:{type:String,default:""},disabledDates:{type:Array,default:()=>[]},enabledDates:{type:Array,default:()=>[]},customizedDates:{type:Array,default:()=>[]},showActionButtons:{type:Boolean,default:!1},showShortcutsMenuTrigger:{type:Boolean,default:!1},showMonthYearSelect:{type:Boolean,default:!1},yearsForSelect:{type:Number,default:10},trigger:{type:Boolean,default:!1},closeAfterSelect:{type:Boolean,default:!1},isRecurrent:{type:Boolean,default:!1},closeCalendar:{type:Boolean,default:!1},isTest:{type:Boolean,default:()=>!1}},emits:["date-one-selected","date-two-selected","is-inline","previous-month","next-month","opened","cancelled","closed","apply"],data(){return{wrapperId:"datepicker-wrapper-"+B(),dateLabelFormat:"dddd, MMMM D, YYYY",showDatepicker:!1,showKeyboardShortcutsMenu:!1,showMonths:2,colors:{selected:"#fffff",inRange:"#66e2da",selectedText:"#fff",text:"#565a5c",inRangeBorder:"#33dacd",disabled:"#fff",hoveredInRange:"#67f6ee"},sundayFirst:!1,monthNames:z.months("long",{locale:"eng"}),days:z.weekdaysFormat("long",{locale:"eng"}),daysShort:z.weekdaysFormat("short",{locale:"eng"}),texts:{apply:"Apply",cancel:"Cancel",keyboardShortcuts:"Keyboard Shortcuts"},startingDate:"",months:[],years:[],width:300,selectedDate1:"",selectedDate2:"",isSelectingDate1:!0,hoverDate:"",focusedDate:"",alignRight:!1,triggerPosition:{},triggerWrapperPosition:{},viewportWidth:void 0,isMobile:void 0,triggerElement:void 0,isInline:this.inline||!1}},computed:{wrapperClasses(){return{"asd__wrapper--datepicker-open":this.showDatepicker,"asd__wrapper--full-screen":this.showFullscreen,"asd__wrapper--isInline":this.isInline,"asd__wrapper--showOneMonth":this.monthsToShow===1}},wrapperStyles(){return{width:this.width*this.showMonths+"px",zIndex:this.isInline?"":"100"}},innerStyles(){return{"margin-left":this.showFullscreen?"-"+this.viewportWidth:`-${this.width}px`}},monthWidthStyles(){return{width:this.showFullscreen?this.viewportWidth:this.width+"px"}},mobileHeaderFallback(){return this.mode==="range"?"Select dates":"Select date"},showFullscreen(){return this.isMobile&&this.fullscreenMobile},datesSelected(){return!!(this.selectedDate1&&this.selectedDate1!==""||this.selectedDate2&&this.selectedDate2!=="")},allDatesSelected(){return!!(this.selectedDate1&&this.selectedDate1!==""&&this.selectedDate2&&this.selectedDate2!=="")},hasMinDate(){return!!(this.minDate&&this.minDate!=="")},isRangeMode(){return this.mode==="range"},isSingleMode(){return this.mode==="single"},datePropsCompound(){return this.dateOne+this.dateTwo},isDateTwoBeforeDateOne(){if(!this.dateTwo)return!1;const e=y.fromISO(this.dateOne);return y.fromISO(this.dateTwo)<e},visibleMonths(){const e=this.months.filter((i,p)=>p>0),t=[];for(let i=0;i<this.showMonths;i++)t.push(i);return t.map((i,p)=>{if(!!e[p])return e[p].firstDateOfMonth})}},watch:{selectedDate1(e){const t=!e||e===""?"":e;this.$emit("date-one-selected",t)},selectedDate2(e){const t=!e||e===""?"":e;e&&this.selectedDate1&&!this.isDateVisible(t)&&this.nextMonth(),this.$emit("date-two-selected",t)},mode(){this.setStartDates()},minDate(){this.setStartDates(),this.generateMonths(),this.generateYears()},maxDate(){this.generateYears()},datePropsCompound(){this.dateOne!==this.selectedDate1&&(this.startingDate=this.dateOne,this.setStartDates(),this.generateMonths(),this.generateYears()),this.isDateTwoBeforeDateOne&&(this.selectedDate2="",this.$emit("date-two-selected",""))},trigger(e){e&&setTimeout(()=>{this.openDatepicker()},0)},closeCalendar(){this.closeDatepicker()}},created(){this.setupDatepicker(),this.sundayFirst&&this.setSundayToFirstDayInWeek()},mounted(){this.handleDatepickerSizing(),this.triggerElement=this.isTest?document.createElement("input"):document.getElementById(this.triggerElementId),this.setStartDates(),this.generateMonths(),this.generateYears(),(this.startOpen||this.isInline)&&this.openDatepicker(),this.triggerElement.addEventListener("click",this._handleWindowClickEvent)},unmounted(){window.removeEventListener("resize",this._handleWindowResizeEvent),window.removeEventListener("click",this._handleWindowClickEvent),this.triggerElement.removeEventListener("click",this._handleWindowClickEvent)},methods:{handleDatepickerSizing(){this.viewportWidth=window.innerWidth+"px",this._isWindowLessThan=e=>window.innerWidth<=e||screen.width<=e,this.isInline=this.inline||this._isWindowLessThan(we),this.$emit("is-inline",this.isInline),this._handleWindowResizeEvent=this.debounce(()=>{this.isInline=this.inline||this._isWindowLessThan(we),this.isInline?this.openDatepicker():this.closeDatepicker(),this.$emit("is-inline",this.isInline),this.positionDatepicker(),this.setStartDates()},200),this._handleWindowClickEvent=e=>{e.target.id===this.triggerElementId&&(e.stopPropagation(),e.preventDefault(),this.toggleDatepicker())},window.addEventListener("resize",this._handleWindowResizeEvent)},getDayClasses(e,t){return[{"asd__day--enabled":e!==0,"asd__day--empty":e===0,"asd__day--disabled":this.isDisabled(t),"asd__day--selected":t&&(this.selectedDate1===t||this.selectedDate2===t)&&!this.isRecurrent,"asd__day--selected-recurrent":t&&(this.selectedDate1===t||this.selectedDate2===t)&&this.isRecurrent,"asd__day--date-one-not-selected":this.mode==="range"&&this.selectedDate1==="","asd__day--date-two-not-selected":this.mode==="range"&&this.selectedDate1!==""&&this.selectedDate2===""&&this.isAfter(t,this.selectedDate1),"asd__day--in-range":this.isInRange(t),"asd__day--end-week":this.isEndWeek(t),"asd__day--start-week":this.isStartWeek(t),"asd__day--start-month":this.isStartMonth(t),"asd__day--end-month":this.isEndMonth(t),"asd__day--today":t&&this.isToday(t),"asd__day--hovered":this.isHoveredInRange(t),"asd__selected-date-one":t&&t===this.selectedDate1&&this.mode==="range","asd__selected-date-two":t&&t===this.selectedDate2&&this.mode==="range"},this.customizedDateClass(t)]},debounce(e,t,i){let p;return function(){const s=this,n=arguments,u=function(){p=null,i||e.apply(s,n)},r=i&&!p;clearTimeout(p),p=setTimeout(u,t),r&&e.apply(s,n)}},copyObject(e){return JSON.parse(JSON.stringify(e))},findAncestor(e,t){if(!e)return null;if(typeof e.closest=="function")return e.closest(t)||null;for(;e;){if(e.matches(t))return e;e=e.parentElement}return null},handleClickOutside(e){e.target.id===this.triggerElementId||!this.showDatepicker||this.isInline||this.isRecurrent||this.closeDatepicker()},shouldHandleInput(e,t){return e.keyCode===t&&(!e.shiftKey||e.keyCode===191)&&this.showDatepicker},isMonthDisabled(e,t){const i=y.fromObject({year:e,month:t+1}).toJSDate(),p=y.fromISO(this.minDate).startOf("month");return this.hasMinDate&&i<p?!0:this.isAfterEndDate(i)},generateMonths(){this.months=[];let e=this.startingDate;for(let t=0;t<this.showMonths+2;t++)this.months.push(this.getMonth(e)),e=this.addMonths(e)},generateYears(){if(!this.showMonthYearSelect)return;this.years=[];const e=y.fromISO(this.startingDate).year,t=this.minDate?y.fromISO(this.minDate).year:e-this.yearsForSelect,i=this.maxDate?y.fromISO(this.maxDate).year:e+this.yearsForSelect;for(let p=t;p<=i;p++)this.years.push(p.toString())},setupDatepicker(){if(this.$options.dateLabelFormat&&(this.dateLabelFormat=this.copyObject(this.$options.dateLabelFormat)),this.$options.sundayFirst&&(this.sundayFirst=this.copyObject(this.$options.sundayFirst)),this.$options.colors){const e=this.copyObject(this.$options.colors);this.colors.selected=e.selected||this.colors.selected,this.colors.inRange=e.inRange||this.colors.inRange,this.colors.hoveredInRange=e.hoveredInRange||this.colors.hoveredInRange,this.colors.selectedText=e.selectedText||this.colors.selectedText,this.colors.text=e.text||this.colors.text,this.colors.inRangeBorder=e.inRangeBorder||this.colors.inRangeBorder,this.colors.disabled=e.disabled||this.colors.disabled}if(this.$options.monthNames&&this.$options.monthNames.length===12&&(this.monthNames=this.copyObject(this.$options.monthNames)),this.$options.days&&this.$options.days.length===7&&(this.days=this.copyObject(this.$options.days)),this.$options.daysShort&&this.$options.daysShort.length===7&&(this.daysShort=this.copyObject(this.$options.daysShort)),this.$options.texts){const e=this.copyObject(this.$options.texts);this.texts.apply=e.apply||this.texts.apply,this.texts.cancel=e.cancel||this.texts.cancel}},setStartDates(){let e=this.dateOne?y.fromISO(this.dateOne):y.local();const t=y.fromISO(this.minDate);this.hasMinDate&&e<t&&(e=t),this.startingDate=this.subtractMonths(e.toJSDate()),this.selectedDate1=this.dateOne,this.selectedDate2=this.dateTwo,this.focusedDate=e.toJSDate()},setSundayToFirstDayInWeek(){const e=this.days.pop();this.days.unshift(e);const t=this.daysShort.pop();this.daysShort.unshift(t)},getMonth(e){const t=y.fromISO(e),i=t.toFormat("yyyy-MM-01"),p=t.toFormat("yyyy"),s=parseInt(t.toFormat("M")),n=this.monthNames[s-1];return{year:p,firstDateOfMonth:i,monthName:n,monthNumber:s,weeks:this.getWeeks(i)}},getWeeks(e){const t=y.fromISO(e),i={dayNumber:0},p=t.daysInMonth,s=t.toFormat("yyyy"),n=t.toFormat("MM");let u=parseInt(t.toFormat(this.sundayFirst?"d":"E"));this.sundayFirst&&u++;const r=[];let h=[];for(let l=1;l<u;l++)h.push(i);for(let l=0;l<p;l++){const g=l>=p-1,v=l+1,C=v<10?"0"+v:v;if(h.push({dayNumber:v,dayNumberFull:C,dayDate:s+"-"+n+"-"+C}),h.length===7)r.push(h),h=[];else if(g){for(let x=0;x<7-h.length;x++)h.push(i);r.push(h),h=[]}}return r},selectDate(e){if(this.isBeforeMinDate(e)||this.isAfterEndDate(e)||this.isDateDisabled(e))return;if(this.mode==="single"){this.selectedDate1=e,this.closeAfterSelect&&this.closeDatepicker();return}const t=y.fromISO(e),i=typeof this.selectedDate1=="object"?y.fromJSDate(this.selectedDate1):y.fromISO(this.selectedDate1);this.isSelectingDate1||t<=i?(this.selectedDate1=e,this.isSelectingDate1=!1,(typeof this.selectedDate2=="object"?y.fromJSDate(this.selectedDate2):y.fromISO(this.selectedDate2))<t&&(this.selectedDate2="")):(this.selectedDate2=e,this.isSelectingDate1=!0,i>t?this.selectedDate1="":this.showActionButtons&&this.$refs["apply-button"].focus(),this.allDatesSelected&&this.closeAfterSelect&&this.closeDatepicker())},setHoverDate(e){this.hoverDate=e},setFocusedDate(e){this.focusedDate=e;const t=this.$refs[`date-${e}`];t&&t.length&&setTimeout(function(){t[0].focus()},10)},resetFocusedDate(e){if(this.focusedDate&&!this.isDateVisible(this.focusedDate)){const t=e?0:this.visibleMonths.length-1,i=y.fromISO(this.visibleMonths[t]),p=i.month,s=i.year;this.focusedDate=y.fromISO(this.focusedDate).set({month:p}).set({year:s}).toISODate()}},isToday(e){return y.local().toISODate()===e},isSameDate(e,t){return e?(typeof e=="object"?y.fromJSDate(e):y.fromISO(e)).toISODate()===t:!1},isSelected(e){if(!!e)return this.selectedDate1===e||this.selectedDate2===e},isInRange(e){if(!this.allDatesSelected||this.isSingleMode)return!1;const t=y.fromISO(e),i=typeof this.selectedDate1=="object"?y.fromJSDate(this.selectedDate1):y.fromISO(this.selectedDate1),p=typeof this.selectedDate2=="object"?y.fromJSDate(this.selectedDate2):y.fromISO(this.selectedDate2),s=y.fromISO(this.hoverDate);return t>i&&t<p||t>i&&t<s&&!this.allDatesSelected},isEndWeek(e){if(!!e)return y.fromISO(e).weekday===7},isStartWeek(e){if(!!e)return y.fromISO(e).weekday===1},isEndMonth(e){if(!e)return;const t=y.fromISO(e);return t.day===t.daysInMonth},isStartMonth(e){if(!!e)return y.fromISO(e).day===1},isAfter(e,t){if(!e||!t)return!1;const i=y.fromISO(e),p=y.fromISO(t);return i>p},isHoveredInRange(e){if(this.isSingleMode||this.allDatesSelected)return!1;const t=y.fromISO(e),i=typeof this.selectedDate1=="object"?y.fromJSDate(this.selectedDate1):y.fromISO(this.selectedDate1),p=y.fromISO(this.hoverDate);return t>i&&t<p||t>p&&e<i},isBeforeMinDate(e){if(!this.minDate)return!1;const t=y.fromISO(e),i=y.fromISO(this.minDate);return t<i},isAfterEndDate(e){if(!this.maxDate)return!1;const t=y.fromISO(e),i=y.fromISO(this.maxDate);return t>i},isDateVisible(e){if(!e)return!1;const t=y.fromISO(e),i=y.fromISO(this.visibleMonths[0]).minus({day:1}),p=y.fromISO(this.visibleMonths[this.monthsToShow-1]).plus({month:1}).set({day:0}).plus({day:1});return t>i&&t<p},isDateDisabled(e){return this.enabledDates.length>0?!this.enabledDates.includes(e):this.disabledDates.includes(e)},customizedDateClass(e){let t="";if(this.customizedDates.length>0)for(let i=0;i<this.customizedDates.length;i++)this.customizedDates[i].dates.includes(e)&&(t+=` asd__day--${this.customizedDates[i].cssClass}`);return t},isDisabled(e){return this.isDateDisabled(e)||this.isBeforeMinDate(e)||this.isAfterEndDate(e)},previousMonth(){this.startingDate=this.subtractMonths(this.months[0].firstDateOfMonth),this.months.unshift(this.getMonth(this.startingDate)),this.months.splice(this.months.length-1,1),this.$emit("previous-month",this.visibleMonths),this.resetFocusedDate(!1)},nextMonth(){!this.months[this.months.length-1]||(this.startingDate=this.addMonths(this.months[this.months.length-1].firstDateOfMonth),this.months.push(this.getMonth(this.startingDate)),this.months.splice(0,1),this.$emit("next-month",this.visibleMonths),this.resetFocusedDate(!0))},subtractMonths(e){return(typeof e=="object"?y.fromJSDate(e):y.fromISO(e)).minus({month:1}).toISODate()},addMonths(e){return(typeof e=="object"?y.fromJSDate(e):y.fromISO(e)).plus({month:1}).toISODate()},toggleDatepicker(){this.showDatepicker?this.closeDatepicker():this.openDatepicker()},updateMonth(e,t,i){const p=i.target.value,s=this.monthNames.indexOf(p),n=y.fromISO(this.startingDate);this.startingDate=n.set({month:s,year:t}).toISODate(),this.generateMonths()},updateYear(e,t,i){const p=i.target.value,s=y.fromISO(this.startingDate);this.startingDate=s.set({month:t,year:p}).toISODate(),this.generateMonths()},openDatepicker(){this.positionDatepicker(),this.setStartDates(),this.triggerElement.classList.add("datepicker-open"),this.showDatepicker=!0,this.initialDate1=this.dateOne,this.initialDate2=this.dateTwo,this.$emit("opened"),this.$nextTick(()=>{this.isInline||this.setFocusedDate(this.focusedDate)})},closeDatepickerCancel(){this.showDatepicker&&(this.selectedDate1=this.initialDate1,this.selectedDate2=this.initialDate2,this.$emit("cancelled"),this.closeDatepicker())},closeDatepicker(){this.isInline||(this.showDatepicker=!1,this.showKeyboardShortcutsMenu=!1,this.triggerElement.classList.remove("datepicker-open"),this.$emit("closed"))},apply(){this.$emit("apply"),this.closeDatepicker()},positionDatepicker(){const e=this.findAncestor(this.triggerElement,".datepicker-trigger");this.triggerPosition=this.triggerElement.getBoundingClientRect(),e?this.triggerWrapperPosition=e.getBoundingClientRect():this.triggerWrapperPosition={left:0,right:0};const t=document.documentElement.clientWidth||window.innerWidth;this.viewportWidth=t+"px",this.isMobile=t<768,this.isMobile?this.showMonths=1:this.monthsToShow>2?this.showMonths=2:this.showMonths=this.monthsToShow,this.$nextTick(function(){const i=document.getElementById(this.wrapperId);if(!this.triggerElement||!i)return;const p=this.triggerElement.getBoundingClientRect().left+i.getBoundingClientRect().width;this.alignRight=p>t})}}},na=["id"],oa={key:0,class:"asd__mobile-header asd__mobile-only"},aa={key:1,class:"asd__mobile-close-icon"},la={class:"asd__datepicker-header"},ra={class:"asd__month-name"},da=["onUpdate:modelValue","tabindex","onChange"],ca=["value","disabled"],ua={key:1},ha=["onUpdate:modelValue","tabindex","onChange"],pa=["value"],_a=["value"],ma={key:3},fa={class:"asd__month-table",role:"presentation"},ga=["data-date","tabindex","onMouseover"],ya=["date","disabled","onClick"],ba={class:"asd__day-number"};function va(e,t,i,p,s,n){const u=f("cp-icon"),r=j("resize-select"),h=j("click-outside");return c(),k($,{name:"asd__fade"},{default:d(()=>[O(o("div",{id:s.wrapperId,class:w(["asd__wrapper",n.wrapperClasses]),style:P(n.showFullscreen?void 0:n.wrapperStyles)},[n.showFullscreen?(c(),_("div",oa,[o("button",{class:"asd__mobile-close",type:"button",onClick:t[0]||(t[0]=(...l)=>n.closeDatepicker&&n.closeDatepicker(...l))},[e.$slots["close-icon"]?T(e.$slots,"close-icon",{key:0},void 0,!0):(c(),_("div",aa,"X"))]),o("h3",null,b(i.mobileHeader||n.mobileHeaderFallback),1)])):D("",!0),o("div",la,[o("button",{class:"asd__change-month-button asd__change-month-button--previous",onClick:t[1]||(t[1]=(...l)=>n.previousMonth&&n.previousMonth(...l))},[a(u,{type:"chevron-left"})]),o("button",{class:"asd__change-month-button asd__change-month-button--next",onClick:t[2]||(t[2]=(...l)=>n.nextMonth&&n.nextMonth(...l))},[a(u,{type:"chevron-right"})]),(c(!0),_(I,null,V(s.showMonths,(l,g)=>(c(),_("div",{key:l,class:"asd__days-legend",style:P([n.monthWidthStyles,{left:s.width*g+"px"}])},[(c(!0),_(I,null,V(s.daysShort,(v,C)=>(c(),_("div",{key:C,class:"asd__day-title"},b(v),1))),128))],4))),128))]),o("div",{class:"asd__inner-wrapper",style:P(n.innerStyles)},[a(he,{name:"asd__list-complete",tag:"div"},{default:d(()=>[(c(!0),_(I,null,V(s.months,(l,g)=>(c(),_("div",{key:l.firstDateOfMonth,class:w(["asd__month",{"asd__month--hidden":g===0||g>s.showMonths}]),style:P(n.monthWidthStyles)},[o("div",ra,[i.showMonthYearSelect?O((c(),_("select",{key:0,"onUpdate:modelValue":v=>l.monthName=v,class:"asd__month-year-select",tabindex:g===0||g>s.showMonths?-1:0,onChange:v=>n.updateMonth(g,l.year,v)},[(c(!0),_(I,null,V(s.monthNames,(v,C)=>(c(),_("option",{key:`month-${g}-${v}`,value:v,disabled:n.isMonthDisabled(l.year,C)},b(v),9,ca))),128))],40,da)),[[K,l.monthName],[r]]):(c(),_("span",ua,b(l.monthName),1)),i.showMonthYearSelect?O((c(),_("select",{key:2,"onUpdate:modelValue":v=>l.year=v,class:"asd__month-year-select",tabindex:g===0||g>s.showMonths?-1:0,onChange:v=>n.updateYear(g,l.monthNumber-1,v)},[s.years.indexOf(l.year)===-1?(c(),_("option",{key:`month-${g}-${e.year}`,value:l.year,disabled:!0},b(l.year),9,pa)):D("",!0),(c(!0),_(I,null,V(s.years,v=>(c(),_("option",{key:`month-${g}-${v}`,value:v},b(v),9,_a))),128))],40,ha)),[[K,l.year]]):(c(),_("span",ma,b(l.year),1))]),o("table",fa,[o("tbody",null,[(c(!0),_(I,null,V(l.weeks,(v,C)=>(c(),_("tr",{key:C,class:"asd__week"},[(c(!0),_(I,null,V(v,({dayDate:x,dayNumber:L},J)=>(c(),_("td",{key:J+"_"+L,ref:`date-${x}`,class:w(["asd__day",n.getDayClasses(L,x)]),"data-date":x,tabindex:n.isDateVisible(x)&&n.isSameDate(s.focusedDate,x)?0:-1,onMouseover:()=>{n.setHoverDate(x)}},[L?(c(),_("button",{key:0,class:"asd__day-button",type:"button",tabindex:"-1",date:x,disabled:n.isDisabled(x),onClick:oe=>n.selectDate(x)},[o("span",ba,b(L),1)],8,ya)):D("",!0)],42,ga))),128))]))),128))])])],6))),128))]),_:1})],4),T(e.$slots,"default",{},void 0,!0)],14,na),[[U,s.showDatepicker],[h,n.handleClickOutside]])]),_:3})}var Ie=S(ia,[["render",va],["__scopeId","data-v-9936b010"]]);const Ce=["text","date","datetime-local","email","month","number","password","search","tel","time","url","week"],Da={name:"CpInput",components:{CpIcon:N,BaseInputLabel:ee,TransitionExpand:H},props:{modelValue:{type:[String,Number,Boolean],default:""},label:{type:String,default:""},placeholder:{type:String,default:"",required:!0},required:{type:Boolean,default:!1},inputId:{type:String,default:""},type:{type:String,default:Ce[0],validator:e=>Ce.includes(e)},name:{type:String,default:""},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:null},autocomplete:{type:String,default:"on"},inputMode:{type:String,default:"text"},isInvalid:{type:Boolean,default:!1},errorMessage:{type:String,default:""},mask:{type:[String,Object],default:null},removeBorder:{type:Boolean,default:!1},hideValidityIcon:{type:Boolean,default:!1},isLarge:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{inputReferenceId:this.inputId,isDOMElementValid:!0}},computed:{dynamicClasses(){return[{"cpInput--isInvalid":this.isInputInvalid,"cpInput--isDisabled":this.disabled,"cpInput--hasNoBorder":this.removeBorder,"cpInput--isLarge":this.isLarge}]},iconValidityClasses(){return{"cpInput__icon--isInvalid":this.isInputInvalid,"cpInput__icon--isValid":this.isValid,"cpInput__icon--hasAfterAndValidityIcon":this.hasAfterIcon}},inputLabelTitle(){const e=this.required&&this.label?"*":"";return`${this.label} ${e}`},isValid(){return this.modelValue&&!this.readonly&&!this.isInvalid&&this.isDOMElementValid},isInputInvalid(){return this.isInvalid||!this.isDOMElementValid},hasBeforeIcon(){return!!this.$slots["input-icon"]},hasAfterIcon(){return!!this.$slots["input-icon-after"]},DOMElement(){return this.$refs.cpInputContainer.children.namedItem(this.inputReferenceId)}},mounted(){this.inputReferenceId||(this.inputReferenceId=B()),this.$nextTick(()=>{this.checkInputValidity()})},methods:{handleChange(e){this.$emit("update:modelValue",e.target.value),this.checkInputValidity()},focusOnInput(){!this.DOMElement||this.DOMElement.focus()},checkInputValidity(){if(!this.DOMElement)return!1;this.isDOMElementValid=this.DOMElement.validity&&this.DOMElement.validity.valid||this.DOMElement.validity&&this.DOMElement.validity.valueMissing}}},Sa=["aria-disabled"],ka={key:0,class:"cpInput__icon cpInput__icon--isBefore"},wa={key:2,class:"cpInput__icon cpInput__icon--isAfter"},Ia=["id","disabled","name","placeholder","readonly","required","autocomplete","inputmode","type","value"];function Ca(e,t,i,p,s,n){const u=f("base-input-label"),r=f("cp-icon"),h=f("transition-expand"),l=j("maska");return c(),_("div",{class:w(["cpInput",n.dynamicClasses]),"aria-disabled":i.disabled,onClick:t[1]||(t[1]=(...g)=>n.focusOnInput&&n.focusOnInput(...g))},[i.label?(c(),k(u,{key:0,for:s.inputReferenceId},{default:d(()=>[m(b(n.inputLabelTitle),1)]),_:1},8,["for"])):D("",!0),o("div",{ref:"cpInputContainer",class:w([{"cpInput__container--hasBeforeIcon":n.hasBeforeIcon},"cpInput__container"])},[n.hasBeforeIcon?(c(),_("div",ka,[T(e.$slots,"input-icon")])):D("",!0),i.hideValidityIcon?D("",!0):(c(),_("div",{key:1,class:w(["cpInput__icon cpInput__icon--isValidity",n.iconValidityClasses])},[a($,{name:"fade-in"},{default:d(()=>[n.isInputInvalid?(c(),k(r,{key:0,type:"alert-circle"})):n.isValid?(c(),k(r,{key:1,type:"check"})):D("",!0)]),_:1})],2)),n.hasAfterIcon?(c(),_("div",wa,[T(e.$slots,"input-icon-after")])):D("",!0),O(o("input",{id:s.inputReferenceId,disabled:i.disabled,name:i.name,placeholder:i.placeholder,readonly:i.readonly,required:i.required,autocomplete:i.autocomplete,inputmode:i.inputMode,type:i.type,value:i.modelValue,class:"cpInput__inner",onInput:t[0]||(t[0]=(...g)=>n.handleChange&&n.handleChange(...g))},null,40,Ia),[[l,i.mask]])],2),a(h,null,{default:d(()=>[n.isInputInvalid&&i.errorMessage?(c(),k(u,{key:0,"is-invalid":i.isInvalid,for:s.inputReferenceId},{default:d(()=>[m(b(i.errorMessage),1)]),_:1},8,["is-invalid","for"])):D("",!0)]),_:1})],10,Sa)}var se=S(Da,[["render",Ca]]);const xa={name:"CpDatepicker",components:{CoreDatepicker:Ie,CpInput:se},props:{triggerElementId:{type:String,default:""},mode:{type:String,default:"single",validator:e=>["range","single"].includes(e)},closeAfterSelect:{type:Boolean,default:!0},label:{type:String,default:""},placeholder:{type:String,default:"Select a date"},inputValue:{type:String,default:""},isError:{type:Boolean,default:!1},errorMessage:{type:String,default:""},initDateOne:{type:String,default:"",validator:e=>e===""||e.length===10},initDateTwo:{type:String,default:"",validator:e=>e===""||e.length===10},minDate:{type:[String,Date],default:()=>y.local().toISODate()},maxDate:{type:[String,Date],default:""},allowPastDates:{type:Boolean,default:!1},isInline:{type:Boolean,default:!1},singleMonth:{type:Boolean,default:!1}},emits:["dates"],data(){return{calendarFormat:"YYYY-MM-DD",humanFormat:"EEE DD",dateOne:this.initDateOne||"",dateTwo:this.mode==="range"?this.initDateTwo:"",isDisabled:null,datePickerReferenceId:this.triggerElementId||B()}},computed:{inputComputedValue(){return this.inputValue||_e(this.dateOne,this.dateTwo,this.humanFormat)},numberOfMonths(){return this.singleMonth?1:2},computedMinDate(){return this.allowPastDates?"":this.minDate}},watch:{initDateOne(e,t){this.updateDateValue("dateOne",e,t)},initDateTwo(e,t){this.updateDateValue("dateTwo",e,t)}},methods:{selectDate(e,t){this[e]=t,this.$emit("dates",[this.dateOne,...this.dateTwo&&this.dateTwo])},updateDateValue(e,t,i){t!==i&&(this[e]=t)}}},Va={class:"cpDatepicker"};function Ta(e,t,i,p,s,n){const u=f("cp-input"),r=f("core-datepicker");return c(),_("div",Va,[O(a(u,{"model-value":n.inputComputedValue,type:"text","input-id":s.datePickerReferenceId,placeholder:i.placeholder,"is-invalid":i.isError,"error-message":i.errorMessage,disabled:s.isDisabled,label:i.label,class:"cpDatepicker__input"},null,8,["model-value","input-id","placeholder","is-invalid","error-message","disabled","label"]),[[U,!i.isInline]]),a(r,{"date-one":s.dateOne,"date-two":s.dateTwo,"trigger-element-id":s.datePickerReferenceId,"close-after-select":i.closeAfterSelect,mode:i.mode,inline:i.isInline,"months-to-show":n.numberOfMonths,"min-date":n.computedMinDate,"max-date":i.maxDate,onDateOneSelected:t[0]||(t[0]=h=>n.selectDate("dateOne",h)),onDateTwoSelected:t[1]||(t[1]=h=>n.selectDate("dateTwo",h)),onOpened:t[2]||(t[2]=()=>s.isDisabled=!0),onClosed:t[3]||(t[3]=()=>s.isDisabled=null)},null,8,["date-one","date-two","trigger-element-id","close-after-select","mode","inline","months-to-show","min-date","max-date"])])}var Oa=S(xa,[["render",Ta]]);const Ma={name:"CpCalendar",components:{CoreDatepicker:Ie,CpInput:se,CpIcon:N,CpButton:Se},props:{triggerElementId:{type:String,default:"calendar-trigger-"+B()},closeAfterSelect:{type:Boolean,default:!1},label:{type:String,default:""},isError:{type:Boolean,default:!1},errorMessage:{type:String,default:""},initDateOne:{type:String,default:"",validator:e=>e===""||e.length===10}},emits:["dates"],data(){return{humanFormat:"EEE DD",dateOne:this.initDateOne||"",dateTwo:"",days:z.weekdays("short",{locale:"en-EN"}).map((e,t)=>({day:e,selected:!1,value:t})),recurenceDates:[],mode:"single",triggerCalendar:!1,isInline:!1,isDisabled:null}},computed:{selectedDays(){return this.days.filter(e=>e.selected===!0).map(e=>e.value+1)},summary(){const e=y.fromISO(this.dateOne).toFormat(this.humanFormat),t=y.fromISO(this.dateTwo).toFormat(this.humanFormat);return{start:e,end:t}},isDaysDisplayed(){return this.mode==="range"}},watch:{isInline(e){e&&this.removeRecurency()}},methods:{done(){this.emitToParent(),this.closeCalendar()},closeCalendar(){this.triggerCalendar=!this.triggerCalendar},humanDateFormat(e,t){return _e(e,t,this.humanFormat)},toggleDay(e){this.days[e].selected=!this.days[e].selected,this.recurenceDates=this.generateDates(this.dateOne,this.dateTwo,this.selectedDays),this.emitToParent()},addRecurency(){const e=y.local();this.mode="range",this.dateOne||(this.dateOne=e.plus({days:1}).toISODate()),this.dateTwo||(this.dateTwo=y.fromISO(this.dateOne).plus({days:7}).toISODate())},removeRecurency(){this.mode="single",this.recurenceDates=[],this.dateTwo="",this.days=z.weekdays("short",{locale:"en-EN"}).map((e,t)=>({day:e,selected:!1,value:t}))},emitToParent(){let e=[this.dateOne];return this.isDaysDisplayed&&(e=this.recurenceDates.length?this.datesToStringArray(this.recurenceDates):[]),this.$emit("dates",e)},generateDates(e,t,i){const p=y.fromISO(e),s=y.fromISO(t);let n=[];return qe.fromDateTimes(p.startOf("day"),s.endOf("day")).splitBy({days:1}).map(r=>r.start).forEach(r=>{const h=Number(y.fromISO(r).toFormat("c"));i.includes(h)&&n.push(r)}),n},selectDate(e,t){return this[e]=t,this.isDaysDisplayed&&(this.recurenceDates=this.generateDates(this.dateOne,this.dateTwo,this.selectedDays)),this.emitToParent()},datesToStringArray(e){return e.map(t=>t.toISODate())}}},Ba={class:"cpCalendar"},Ea={key:0,class:"footer-container"},Ra={key:"days",class:"asd__recurency--container"},La={class:"asd__recurency--days"},Pa={class:"asd__recurency--ul"},$a=["onClick"],za={class:"checkbox"},qa={key:0,class:"checkbox--border"},Aa={class:"asd__recurency--summary"},Fa={class:"asd__recurency--text"},Ua={key:1},Na=m(" Between the "),Wa=m(" and the "),ja={key:2},Ya={key:"action",class:"asd__recurency--action"},Ha=m(" Done ");function Ga(e,t,i,p,s,n){const u=f("cp-input"),r=f("cp-icon"),h=f("cp-button"),l=f("core-datepicker");return c(),_("div",Ba,[a(u,{type:"text","input-id":i.triggerElementId,"model-value":n.humanDateFormat(s.dateOne,s.dateTwo),placeholder:"Select a date","is-invalid":i.isError,"error-message":i.errorMessage,disabled:s.isDisabled,label:i.label,class:"cpCalendar__input"},null,8,["input-id","model-value","is-invalid","error-message","disabled","label"]),a(l,{"date-one":s.dateOne,"date-two":s.dateTwo,"customized-dates":[{cssClass:"recurency",dates:n.datesToStringArray(s.recurenceDates)}],"trigger-element-id":i.triggerElementId,mode:s.mode,"close-after-select":i.closeAfterSelect,"close-calendar":s.triggerCalendar,inline:s.isInline,onDateOneSelected:t[1]||(t[1]=g=>n.selectDate("dateOne",g)),onDateTwoSelected:t[2]||(t[2]=g=>n.selectDate("dateTwo",g)),onIsInline:t[3]||(t[3]=g=>s.isInline=g),onOpened:t[4]||(t[4]=()=>s.isDisabled=!0),onClosed:t[5]||(t[5]=()=>s.isDisabled=!1)},{default:d(()=>[s.isInline?D("",!0):(c(),_("div",Ea,[a(he,{name:"fade",mode:"out-in"},{default:d(()=>[n.isDaysDisplayed?(c(),_("div",Ra,[o("div",La,[o("ul",Pa,[(c(!0),_(I,null,V(s.days,({day:g,selected:v,value:C},x)=>(c(),_("li",{key:x,class:w(["asd__recurency--li",{"asd__recurency--li--selected":v}]),onClick:L=>n.toggleDay(C)},[o("div",za,[a($,{name:"fade",mode:"out-in"},{default:d(()=>[v?(c(),k(r,{key:1,type:"check"})):(c(),_("div",qa))]),_:2},1024)]),o("span",null,b(g),1)],10,$a))),128))])]),o("div",Aa,[o("div",Fa,[s.recurenceDates.length>0?(c(),k(r,{key:0,type:"refresh-cw"})):D("",!0),s.recurenceDates.length>0?(c(),_("span",Ua,[Na,o("strong",null,b(n.summary.start),1),Wa,o("strong",null,b(n.summary.end),1)])):(c(),_("span",ja,"Please select at least one day."))])])])):D("",!0),o("div",Ya,[a(h,{class:"asd__button-switch",size:"mini",onClick:t[0]||(t[0]=Y(g=>n.isDaysDisplayed?n.removeRecurency():n.addRecurency(),["stop"]))},{default:d(()=>[m(b(n.isDaysDisplayed?"Remove recurency":"Add recurency"),1)]),_:1}),a(h,{class:"asd__button-done",size:"mini",disabled:n.isDaysDisplayed&&!s.recurenceDates.length||!s.dateOne,onClick:Y(n.done,["stop"])},{default:d(()=>[Ha]),_:1},8,["disabled","onClick"])])]),_:1})]))]),_:1},8,["date-one","date-two","customized-dates","trigger-element-id","mode","close-after-select","close-calendar","inline"])])}var Ja=S(Ma,[["render",Ga]]),R={SUCCESS:{value:"success",icon:"check-circle"},CRITICAL:{value:"critical",icon:"alert-octagon"},WARNING:{value:"warning",icon:"alert-triangle"},INFO:{value:"info",icon:"info"}};const Xa={props:{intent:{type:String,required:!0,validator(e){return Object.values(R).map(i=>i.value).includes(e)}},title:{type:String,required:!1,default:""},isClosable:{type:Boolean,required:!1,default:!1}},data(){return{isDisplayed:!0}},computed:{alertIcon(){return Object.values(R).find(t=>t.value===this.intent).icon},hasContent(){return!!this.$slots.default}},methods:{dismissAlert(){this.isDisplayed=!1}}},Ka={class:"cpAlert__body"},Za={key:1,class:"cpAlert__content"};function Qa(e,t,i,p,s,n){const u=f("cp-icon"),r=f("cp-heading");return s.isDisplayed?(c(),_("div",{key:0,class:w(["cpAlert",`cpAlert--${i.intent}`])},[a(u,{type:n.alertIcon,class:"cpAlert__icon"},null,8,["type"]),o("div",Ka,[i.title?(c(),k(r,{key:0,"heading-level":"h4",size:400,class:"cpAlert__title"},{default:d(()=>[m(b(i.title),1)]),_:1})):D("",!0),n.hasContent?(c(),_("div",Za,[T(e.$slots,"default")])):D("",!0)]),i.isClosable?(c(),_("button",{key:0,class:"cpAlert__button",onClick:t[0]||(t[0]=(...h)=>n.dismissAlert&&n.dismissAlert(...h))},[a(u,{type:"x"})])):D("",!0)],2)):D("",!0)}var el=S(Xa,[["render",Qa]]);const tl={name:"CpSelect",components:{BaseInputLabel:ee,TransitionExpand:H},props:{label:{type:String,default:""},modelValue:{type:[String,Number],default:""},defaultValue:{type:String,default:"Select an option"},options:{type:Array,required:!0},name:{type:String,default:null},required:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autocomplete:{type:String,default:"on"},isInvalid:{type:Boolean,default:!1},errorMessage:{type:String,default:""},isLarge:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{selectReferenceId:""}},computed:{selectLabelTitle(){const e=this.required&&this.label?"*":"";return`${this.label} ${e}`},dynamicClasses(){return{"cpSelect--isInvalid":this.isInvalid,"cpSelect--isDisabled":this.disabled,"cpSelect--isLarge":this.isLarge}}},mounted(){this.selectReferenceId=B()},methods:{handleChange(e){this.$emit("update:modelValue",e.target.value)}}},sl={class:"cpSelect__container"},il=["id","value","disabled","required","autocomplete","name"],nl={value:""},ol=["value"];function al(e,t,i,p,s,n){const u=f("base-input-label"),r=f("transition-expand");return c(),_("div",{class:w(["cpSelect",n.dynamicClasses])},[i.label?(c(),k(u,{key:0,for:s.selectReferenceId},{default:d(()=>[m(b(n.selectLabelTitle),1)]),_:1},8,["for"])):D("",!0),o("div",sl,[o("select",{id:s.selectReferenceId,ref:"cpSelect",value:i.modelValue,disabled:i.disabled,required:i.required,autocomplete:i.autocomplete,name:i.name,class:"cpSelect__inner",onInput:t[0]||(t[0]=(...h)=>n.handleChange&&n.handleChange(...h))},[o("option",nl,b(i.defaultValue),1),(c(!0),_(I,null,V(i.options,(h,l)=>(c(),_("option",{key:l,value:h.value},b(h.label),9,ol))),128))],40,il)]),a(r,null,{default:d(()=>[i.isInvalid?(c(),k(u,{key:0,"is-invalid":i.isInvalid,for:s.selectReferenceId},{default:d(()=>[m(b(i.errorMessage),1)]),_:1},8,["is-invalid","for"])):D("",!0)]),_:1})],2)}var ll=S(tl,[["render",al]]);const rl={props:{values:{type:Array,default:()=>[],required:!0},selectedValue:{type:Object,default:()=>{},required:!0},isMultiSelect:{type:Boolean,default:!1,required:!1},hasFilter:{type:Boolean,default:!1,required:!1},dropdownTitle:{type:String,default:"Select value",required:!1},dropdownFilterPlaceholder:{type:String,default:"Filter...",required:!1},dropdownEmptyViewPlaceholder:{type:String,default:"No option found",required:!1},closeOnSelect:{type:Boolean,default:!0,required:!1}},emits:["update:selectedValue","on-close","on-filter-change"],data(){return{isDropdownOpen:!1}},computed:{inputType(){return this.isMultiSelect&&"checkbox"||"radio"}},methods:{enter(){Q({targets:this.$refs.dropdownRef,scale:[.8,1],opacity:[0,1],duration:200,easing:"cubicBezier(0.175, 0.885, 0.32, 1.175)"})},toggleDropdown(){this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&this.hasFilter&&this.$nextTick(()=>this.$refs.dropdownFilterRef.focus())},closeDropdown(){!this.isDropdownOpen||(this.isDropdownOpen=!1,this.resetInputValue(),this.$emit("on-close"))},onChange(e){e.value!==this.selectedValue.value&&this.$emit("update:selectedValue",e),this.closeOnSelect&&this.closeDropdown()},updateFilterValue(e){this.$emit("on-filter-change",e.target.value)},resetInputValue(){this.$emit("on-filter-change","")},isSelectedValue(e){return e===this.selectedValue.value}}},dl={class:"cpSelectMenu"},cl={class:"cpSelectMenu__label"},ul={key:0,ref:"dropdownRef",class:"cpSelectMenu__dropdown dropdown"},hl={key:0,class:"dropdown__title"},pl={class:"dropdown__list"},_l={key:0,class:"dropdown__filterBar"},ml=["placeholder"],fl={key:1,class:"dropdown__items"},gl=["for"],yl=["id","checked","value","type","onChange"],bl={key:2,class:"dropdown__emptyState"};function vl(e,t,i,p,s,n){const u=f("cp-icon"),r=j("click-outside");return O((c(),_("div",dl,[o("button",{class:"cpSelectMenu__button",type:"button",onClick:t[0]||(t[0]=(...h)=>n.toggleDropdown&&n.toggleDropdown(...h))},[o("span",cl,b(i.selectedValue.label),1),a(u,{type:"chevron-down",class:w([{"cpSelectMenu__icon--isOpened":s.isDropdownOpen},"cpSelectMenu__icon"])},null,8,["class"])]),a($,{onEnter:n.enter},{default:d(()=>[s.isDropdownOpen?(c(),_("div",ul,[i.dropdownTitle?(c(),_("p",hl,[m(b(i.dropdownTitle)+" ",1),o("button",{type:"button",onClick:t[1]||(t[1]=(...h)=>n.closeDropdown&&n.closeDropdown(...h))},[a(u,{type:"x"})])])):D("",!0),o("div",pl,[i.hasFilter?(c(),_("label",_l,[a(u,{type:"search"}),o("input",{ref:"dropdownFilterRef",type:"text",placeholder:i.dropdownFilterPlaceholder,onInput:t[2]||(t[2]=(...h)=>n.updateFilterValue&&n.updateFilterValue(...h))},null,40,ml)])):D("",!0),i.values.length?(c(),_("ul",fl,[(c(!0),_(I,null,V(i.values,({value:h,label:l},g)=>(c(),_("li",{key:g},[o("label",{for:h,class:"dropdown__item"},[o("input",{id:h,checked:n.isSelectedValue(h),value:h,type:n.inputType,onChange:v=>n.onChange({value:h,label:l})},null,40,yl),n.isSelectedValue(h)?(c(),k(u,{key:0,type:"check",class:"dropdown__icon"})):D("",!0),m(" "+b(l),1)],8,gl)]))),128))])):(c(),_("p",bl,b(i.dropdownEmptyViewPlaceholder),1))])],512)):D("",!0)]),_:1},8,["onEnter"])],512)),[[r,n.closeDropdown]])}var Dl=S(rl,[["render",vl]]);const Sl={props:{value:{type:[Array,Boolean],default:()=>[],required:!1},checkboxValue:{type:String,default:"",required:!1},checkboxLabel:{type:String,required:!0},isDisabled:{type:Boolean,default:!1,required:!1},groupName:{type:String,default:"",required:!1},capitalizeLabel:{type:Boolean,default:!0},color:{type:String,required:!1,default:A.BLUE,validator:e=>Object.values(A).includes(e)},reverseLabel:{type:Boolean,required:!1,default:!1},autofocus:{type:Boolean,required:!1,default:!1}},emits:["update:value"],data(){return{checkedProxy:!1,checkboxUniqueId:""}},computed:{isChecked:{get(){return this.value},set(e){this.checkedProxy=e}},capitalizedColor(){return q(this.color)},computedClasses(){return[{"cpCheckbox--isDisabled":this.isDisabled,"cpCheckbox--isReversed":this.reverseLabel},`cpCheckbox--is${this.capitalizedColor}`]}},mounted(){this.checkboxUniqueId=B()},methods:{onChange(){this.$emit("update:value",this.checkedProxy)}}},kl=["for"],wl=["id","value","disabled","name","autofocus"];function Il(e,t,i,p,s,n){const u=f("cp-icon");return c(),_("label",{class:w([n.computedClasses,"cpCheckbox"]),for:s.checkboxUniqueId},[O(o("input",{id:s.checkboxUniqueId,"onUpdate:modelValue":t[0]||(t[0]=r=>n.isChecked=r),value:i.checkboxValue,disabled:i.isDisabled,type:"checkbox",name:i.groupName,autofocus:i.autofocus,onChange:t[1]||(t[1]=r=>n.onChange(i.checkboxValue))},null,40,wl),[[Ae,n.isChecked]]),a(u,{type:"check"}),o("span",{class:w(["cpCheckbox__label",{"cpCheckbox__label--isCapitalized":i.capitalizeLabel}])},b(i.checkboxLabel),3)],10,kl)}var Cl=S(Sl,[["render",Il]]);const xl={props:{modelValue:{type:String,default:"",required:!0},options:{type:Array,required:!0},groupName:{type:String,default:"",required:!1},color:{type:String,required:!1,default:A.BLUE,validator:e=>Object.values(A).includes(e)},autofocus:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],data(){return{radioUniqueId:""}},mounted(){this.radioUniqueId=B()},methods:{onChange(e){this.$emit("update:modelValue",e)},getRadioId(e){return`${this.radioUniqueId}${e}`},isActive(e){return e===this.modelValue},computedClasses({value:e,disabled:t}){return[{"cpRadio--isActive":this.isActive(e),"cpRadio--isDisabled":t},`cpRadio--is${q(this.color)}`]}}},Vl=["for"],Tl=["id","checked","value","disabled","autofocus","name","onInput"],Ol={class:"cpRadio__content"},Ml={class:"cpRadio__information"},Bl={class:"cpRadio__label"},El={key:0,class:"cpRadio__description"},Rl={key:0,class:"cpRadio__additionalData"};function Ll(e,t,i,p,s,n){return c(!0),_(I,null,V(i.options,({label:u,value:r,description:h,additionalData:l,disabled:g},v)=>(c(),_("label",{key:n.getRadioId(v),class:w([n.computedClasses({value:r,disabled:g}),"cpRadio"]),for:n.getRadioId(v)},[o("input",{id:n.getRadioId(v),checked:n.isActive(r),value:r,disabled:g,type:"radio",autofocus:i.autofocus,name:i.groupName,onInput:C=>n.onChange(r)},null,40,Tl),o("span",Ol,[o("span",Ml,[o("span",Bl,b(u),1),h?(c(),_("span",El,b(h),1)):D("",!0)]),l?(c(),_("span",Rl,b(l),1)):D("",!0)])],10,Vl))),128)}var Pl=S(xl,[["render",Ll]]);const $l={props:{modelValue:{type:Boolean,default:null},label:{type:String,default:""},disabled:{type:Boolean,default:!1},groupName:{type:String,default:"",required:!1},color:{type:String,required:!1,default:A.BLUE,validator:e=>Object.values(A).includes(e)},reverseLabel:{type:Boolean,required:!1,default:!1},autofocus:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],data(){return{switchUniqueId:""}},computed:{capitalizedColor(){return q(this.color)},computedClasses(){return[{"cpSwitch--hasLabel":this.label,"cpSwitch--isActive":this.modelValue,"cpSwitch--isDisabled":this.disabled,"cpSwitch--isReversed":this.reverseLabel},`cpSwitch--is${this.capitalizedColor}`]}},mounted(){this.switchUniqueId=B()},methods:{handleClick(e){this.$emit("update:modelValue",!e)}}},zl=["for"],ql={class:"cpSwitch__switch"},Al=["id","disabled","checked","value","name","autofocus"],Fl={class:"cpSwitch__icon"},Ul=o("span",{class:"cpSwitch__knobContainer"},[o("span",{class:"cpSwitch__knob"})],-1),Nl={key:0,class:"cpSwitch__label"};function Wl(e,t,i,p,s,n){const u=f("cp-icon");return c(),_("label",{class:w(["cpSwitch",n.computedClasses]),for:s.switchUniqueId},[o("span",ql,[o("input",{id:s.switchUniqueId,disabled:i.disabled,checked:i.modelValue,value:i.modelValue,type:"checkbox",name:i.groupName,autofocus:i.autofocus,onChange:t[0]||(t[0]=r=>n.handleClick(i.modelValue))},null,40,Al),o("span",Fl,[a(u,{type:"check"})]),Ul]),i.label?(c(),_("span",Nl,b(i.label),1)):D("",!0)],10,zl)}var jl=S($l,[["render",Wl]]);function xe(e){return e.replace(/^\w|[A-Z]|\b\w|\s+/g,(t,i)=>+t==0?"":i===0?t.toLowerCase():t.toUpperCase())}function Yl(e,t=" "){return e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}const Hl={props:{placeholder:{type:String,required:!0}}},Gl={class:"cpTableEmptyState"},Jl={class:"cpTableEmptyState__wrapper"},Xl={class:"cpTableEmptyState__icon"},Kl={class:"cpTableEmptyState__headline"},Zl=o("p",{class:"cpTableEmptyState__description"},"There aren't any results for that query.",-1);function Ql(e,t,i,p,s,n){const u=f("cp-icon");return c(),_("div",Gl,[o("div",Jl,[o("figure",Xl,[a(u,{type:"search"})]),o("p",Kl,[o("strong",null,b(i.placeholder),1)]),Zl])])}var er=S(Hl,[["render",Ql]]);const ie=100,F={GROUP_BY:"groupBy",FULL_WIDTH:"fullWidth",IS_SELECTED:"isSelected"},ne={RESULTS:"results",PAGES:"pages"},tr="#5341F9",sr={components:{CpTableEmptyState:er},props:{caption:{type:String,default:"",required:!1},columns:{type:Array,default:()=>[],required:!1},data:{type:Array,required:!0},pagination:{type:[Boolean,Object],default:!1,required:!1,validator:e=>{const t=e.limit?e.limit<=ie:!0,i=e.format?Object.values(ne).includes(e.format):!0;return t&&i}},areRowsClickable:{type:Boolean,default:!1,required:!1},emptyCellPlaceholder:{type:String,default:"n/a",required:!1},noResultPlaceholder:{type:String,default:"No results found",required:!1},isLoading:{type:Boolean,default:!1,required:!1},enableRowOptions:{type:Boolean,default:!1,required:!1}},emits:["on-row-click","on-row-right-click","on-next-click","on-previous-click"],data(){return{uniqueId:B(),pageNumber:0,LoaderColor:tr}},computed:{containerDOMElement(){return this.$refs.cpTableContainer},mainClasses(){return{"cpTable--isLoading":this.isLoading}},containerClasses(){return{"cpTable__container--hasPagination":this.hasPagination}},normalizedColumns(){return this.columns?(this.columns.length?[...this.columns]:[...this.columnsFromRows]).map(t=>typeof t=="string"?{id:xe(t),name:Yl(t)}:M({id:t.id||xe(t.name)},t)):[]},numberOfColumns(){return this.normalizedColumns.length},hasGroupBy(){return this.data.length?this.data.some(e=>F.GROUP_BY in e):!1},columnsFromRows(){if(!this.data.length)return[];const e=this.hasGroupBy?this.data[0].rows[0]:this.data[0];return Object.keys(e)},numberOfResults(){return this.isServerSidePagination?this.pagination.server.total:this.flattenedRows.length},hasNoResult(){return this.numberOfResults===0},rowsPerPageLimit(){return this.pagination.limit||ie},flattenedRows(){return this.data?this.hasGroupBy?this.data.reduce((e,t)=>{const i={[F.FULL_WIDTH]:t.groupBy};return[...e,i,...t.rows]},[]):this.data:[]},rawVisibleRows(){const e=[...this.flattenedRows];return this.isServerSidePagination?e:this.hasPagination?e.splice(this.pagesStartIndex,this.rowsPerPageLimit):e},visibleRows(){return this.rawVisibleRows.map(e=>{const t=this.normalizeRowData({rowPayload:e});return this.mapCellToColumn({rowPayload:t})})},paginationState(){return typeof this.pagination=="boolean"?this.pagination:this.pagination.enabled},hasPagination(){return this.paginationState||this.numberOfResults>ie},paginationFormat(){var e;return((e=this.pagination)==null?void 0:e.format)||ne.PAGES},hasRemainingPages(){return this.numberOfPages>this.activePage},isNextEnabled(){return this.hasRemainingPages&&!this.isLoading},hasPreviousPages(){return this.isServerSidePagination?this.serverActivePage>0:this.pagesStartIndex-this.rowsPerPageLimit>=0},isPreviousEnabled(){return this.hasPreviousPages&&!this.isLoading},pagesStartIndex(){return this.pageNumber*this.rowsPerPageLimit},pagesEndIndex(){return this.rowsPerPageLimit*(1+this.pageNumber)},numberOfPages(){return Math.ceil(this.numberOfResults/this.rowsPerPageLimit)},activePage(){return this.isServerSidePagination?this.serverActivePage+1:this.pageNumber+1},isServerSidePagination(){return typeof this.pagination=="boolean"?!1:"server"in this.pagination},serverActivePage(){return this.pagination.server.activePage},serverPagesStartIndex(){return this.serverActivePage*this.rowsPerPageLimit+1},serverPagesEndIndex(){return this.rowsPerPageLimit*(1+this.serverActivePage)},pageFirstResultIndex(){return this.isServerSidePagination?this.serverPagesStartIndex:this.pagesStartIndex+1},pageLastResultIndex(){const e=this.isServerSidePagination?this.serverPagesEndIndex:this.pagesEndIndex;return this.hasRemainingPages?e:this.numberOfResults},paginationLabel(){if(this.paginationFormat===ne.PAGES){const e=this.numberOfPages>1?"pages":"page";return`${this.activePage}/${this.numberOfPages} ${e}`}return`${this.pageFirstResultIndex} \u2013 ${this.pageLastResultIndex}`},paginationResultsDetails(){const e=this.numberOfResults>1?"results":"result";return`${this.numberOfResults} ${e}`}},methods:{getRowPayload(e){return this.rawVisibleRows[e]},handleRowClick(e,t){if(this.isFullWidthRow(e))return;const i=this.getRowPayload(t);this.$emit("on-row-click",i)},handleRowRightClick({rowData:e,rowIndex:t},i){if(this.isFullWidthRow(e))return;const p=this.getRowPayload(t);this.$emit("on-row-right-click",{data:p,event:i})},handleNavigationClick(e=!0){if(this.resetScrollPosition(),e){this.hasRemainingPages&&this.augmentOffset(),this.$emit("on-next-click");return}this.hasPreviousPages&&this.decreaseOffset(),this.$emit("on-previous-click")},normalizeRowData({columns:e=this.normalizedColumns,rowPayload:t}){return Array.isArray(t)?t.reduce((i,p,s)=>{var u;const n={[(u=e[s])==null?void 0:u.id]:p};return M(M({},i),n)},{}):M({},t)},mapCellToColumn({columns:e=this.normalizedColumns,rowPayload:t}){return this.isFullWidthRow(t)?t:e.reduce((i,p)=>{const s=(p==null?void 0:p.id)||p,n=t[s]||this.emptyCellPlaceholder,u={[s]:n};return M(M({},i),u)},{})},augmentOffset(){this.isNextEnabled&&this.pageNumber++},decreaseOffset(){this.isPreviousEnabled&&this.pageNumber--},resetScrollPosition(){this.containerDOMElement.scrollTop=0},getColumnStyle(e){return{width:(e==null?void 0:e.width)&&`${e.width}px`,textAlign:e.textAlign}},getCellStyle(e){var t;return{textAlign:(t=this.normalizedColumns[e])==null?void 0:t.textAlign}},getRowClasses(e,t){return{"cpTable__row--isFullWidth":this.isFullWidthRow(e),"cpTable__row--isClickable":!this.isFullWidthRow(e)&&this.areRowsClickable,"cpTable__row--isSelected":this.isRowSelected(t)}},getCellClasses(e){return{"cpTable__cell--isFullWidth":e===F.FULL_WIDTH}},getColspan(e){const t=this.enableRowOptions?this.numberOfColumns+1:this.numberOfColumns;return e===F.FULL_WIDTH?t:null},getTabindex(e){return this.isFullWidthRow(e)?-1:0},isFullWidthRow(e){return F.FULL_WIDTH in e},isRowSelected(e){return this.rawVisibleRows[e][F.IS_SELECTED]},areRowOptionsEnabled(e){return this.enableRowOptions&&!this.isFullWidthRow(e)}}},ir=["aria-labelledby"],nr={class:"cpTable__table"},or=["id"],ar={class:"cpTable__header"},lr={class:"cpTable__row cpTable__row--header"},rr={class:"cpTable__column cpTable__column--isOptions"},dr=o("span",null,null,-1),cr=[dr],ur={class:"cpTable__body"},hr=["tabindex","onClick","onContextmenu","onKeydown"],pr=["colspan"],_r={key:0},mr={class:"cpTable__cell cpTable__cell--isOptions"},fr=["onClick"],gr={key:0,class:"cpTable__footer"},yr={class:"footer__details"},br={class:"footer__results"},vr={class:"footer__resultsCount"},Dr=m(" No results "),Sr=m(" Loading "),kr={class:"footer__pagination"},wr=["disabled"],Ir=["disabled"],Cr=o("div",{class:"cpTable__overlay"},null,-1);function xr(e,t,i,p,s,n){const u=f("cp-icon"),r=f("cp-table-empty-state"),h=f("cp-loader");return c(),_("div",{class:w(["cpTable",n.mainClasses])},[o("div",{ref:"cpTableContainer",role:"region","aria-labelledby":s.uniqueId,tabindex:"0",class:w(["cpTable__container",n.containerClasses])},[o("table",nr,[i.caption?(c(),_("caption",{key:0,id:s.uniqueId,class:"cpTable__caption"},b(i.caption),9,or)):D("",!0),o("thead",ar,[o("tr",lr,[(c(!0),_(I,null,V(n.normalizedColumns,l=>(c(),_("th",{key:l.id,class:"cpTable__column",style:P(n.getColumnStyle(l))},[T(e.$slots,"column",{column:l},()=>[m(b(l.name),1)])],4))),128)),O(o("th",rr,cr,512),[[U,i.enableRowOptions]])])]),o("tbody",ur,[(c(!0),_(I,null,V(n.visibleRows,(l,g)=>(c(),_("tr",{key:g,class:w(["cpTable__row cpTable__row--body",n.getRowClasses(l,g)]),tabindex:n.getTabindex(l),onClick:v=>n.handleRowClick(l,g),onContextmenu:Y(v=>n.handleRowRightClick({rowData:l,rowIndex:g},v),["right"]),onKeydown:Fe(v=>n.handleRowClick(l,g),["enter"])},[T(e.$slots,"row",{row:l},()=>[(c(!0),_(I,null,V(l,(v,C,x)=>(c(),_("td",{key:`${C}_${g}`,class:w(["cpTable__cell",n.getCellClasses(C)]),style:P(n.getCellStyle(x)),colspan:n.getColspan(C)},[T(e.$slots,C,{cell:v},()=>[n.isFullWidthRow(l)?(c(),_("span",_r,b(v),1)):(c(),_(I,{key:1},[m(b(v),1)],64))])],14,pr))),128)),O(o("td",mr,[o("button",{onClick:Y(v=>n.handleRowRightClick({rowData:l,rowIndex:g},v),["stop"])},[a(u,{type:"more-vertical"})],8,fr)],512),[[U,n.areRowOptionsEnabled(l)]])])],42,hr))),128))])]),n.hasNoResult?(c(),k(r,{key:0,placeholder:i.noResultPlaceholder,class:"cpTable__emptyState"},null,8,["placeholder"])):D("",!0)],10,ir),n.hasPagination?(c(),_("div",gr,[o("div",yr,[o("p",br,[i.isLoading?(c(),_(I,{key:1},[Sr,a(h,{color:s.LoaderColor,class:"cpTable__loader--isSmall"},null,8,["color"])],64)):T(e.$slots,"footer-details",{key:0},()=>[n.numberOfResults?(c(),_(I,{key:0},[o("strong",null,b(n.paginationLabel),1),o("span",vr,"on "+b(n.paginationResultsDetails),1)],64)):(c(),_(I,{key:1},[Dr],64))])])]),o("div",kr,[o("button",{disabled:!n.isPreviousEnabled,onClick:t[0]||(t[0]=l=>n.handleNavigationClick(!1))},"Prev.",8,wr),o("button",{disabled:!n.isNextEnabled,onClick:t[1]||(t[1]=l=>n.handleNavigationClick())},"Next",8,Ir)])])):D("",!0),Cr],2)}var Vr=S(sr,[["render",xr]]);const Ve={CpBadge:Io,CpHeading:ge,CpButton:Se,CpDate:ta,CpDatepicker:Oa,CpCalendar:Ja,CpAlert:el,CpLoader:ye,CpInput:se,CpTextarea:me,CpSelect:ll,CpSelectMenu:Dl,CpCheckbox:Cl,CpRadio:Pl,CpSwitch:jl,CpTable:Vr,CpIcon:N,TransitionExpand:H},Tr={install(e){Object.keys(Ve).forEach(t=>{e.component(t,Ve[t])})}};const Or={name:"CpToaster",components:{CpHeading:ge,CpIcon:N},props:{title:{type:String,required:!0,default:""},description:{type:String,required:!1,default:""},type:{type:String,required:!1,default:"info",validator(e){return Object.values(R).map(i=>i.value).includes(e)}},delayBeforeCloseInMs:{type:Number,required:!1,default:5e3},actionLabel:{type:String,required:!1,default:""},actionMethod:{type:Function,required:!1,default:()=>{}},isUnique:{type:Boolean,default:!1}},data(){return{toasterId:null,toastersContainer:null,isOpen:!1,isHovered:!1,deleteCountDown:this.delayBeforeCloseInMs,timeoutID:null,countDownInterval:null,publicProperties:["closeToaster"]}},computed:{toasterIcon(){const t=Object.values(R).find(i=>i.value===this.type);return t?t.icon:R.INFO.icon},dynamicClass(){return`cpToaster--${this.type||R.INFO.value}`}},watch:{isHovered(e){e?this.cancelDelete():this.handleDeleteEvent()}},beforeMount(){this.createContainer(),this.setupContainer(),this.removeSiblings(),this.setToasterId()},mounted(){this.showToaster(),this.handleDeleteEvent()},methods:{createContainer(){this.toastersContainer=document.querySelector(".cpToaster__container"),!this.toastersContainer&&(this.toastersContainer||(this.toastersContainer=document.createElement("section"),this.toastersContainer.className="cpToaster__container"))},setupContainer(){document.body.appendChild(this.toastersContainer)},removeSiblings(){if(!this.isUnique)return;document.querySelectorAll(".cpToaster").forEach(this.removeElement)},setToasterId(){this.toasterId=B()},showToaster(){this.isOpen=!0,this.$nextTick(()=>{this.toastersContainer.insertAdjacentElement("afterbegin",this.$el)})},setHoverState(e=!0){this.isHovered=e},handleDeleteEvent(){this.startCountDown(),this.timeoutID=setTimeout(()=>{this.closeToaster()},this.delayBeforeCloseInMs)},cancelDelete(){clearTimeout(this.timeoutID),clearInterval(this.countDownInterval),this.resetCountDown()},startCountDown(){this.countDownInterval=setInterval(()=>{this.deleteCountDown-=1e3,this.deleteCountDown<=0&&clearInterval(this.countDownInterval)},1e3)},resetCountDown(){this.deleteCountDown=this.delayBeforeCloseInMs},handleActionMethod(){const e=this,t=Object.keys(e).filter(i=>this.publicProperties.includes(i)).reduce((i,p)=>(i[p]=e[p],i),{});return this.actionMethod(t)},closeToaster(){this.cancelDelete(),this.isOpen=!1,setTimeout(()=>{this.removeElement(this.$el)},240)},removeElement(e){typeof e.remove!="undefined"?e.remove():e.parentNode.removeChild(e)},async enter(e,t){Q({targets:e,translateY:[-60,0],opacity:[0,1],duration:240,easing:"cubicBezier(0.175, 0.885, 0.32, 1.175)",complete:function(){t()}})},async leave(e,t){Q({targets:e,scale:[1,.8],opacity:[1,0],duration:240,easing:"cubicBezier(0.0, 0.0, 0.2, 1)",complete:function(){t()}})}}},Mr=["id"],Br={class:"cpToaster__content"},Er={class:"cpToaster__body"},Rr={key:0,class:"cpToaster__description"},Lr={key:0,class:"cpToaster__footer"};function Pr(e,t,i,p,s,n){const u=f("cp-icon"),r=f("cp-heading");return c(),k($,{onEnter:n.enter,onLeave:n.leave},{default:d(()=>[O((c(),_("div",{id:s.toasterId,key:s.toasterId,class:w(["cpToaster",n.dynamicClass]),role:"alert",onMouseenter:t[2]||(t[2]=h=>n.setHoverState()),onMouseleave:t[3]||(t[3]=h=>n.setHoverState(!1))},[o("div",Br,[a(u,{type:n.toasterIcon,class:"cpToaster__icon"},null,8,["type"]),o("div",Er,[a(r,{"heading-level":"h4",size:400,class:"cpToaster__title"},{default:d(()=>[m(b(i.title),1)]),_:1}),i.description?(c(),_("p",Rr,b(i.description),1)):D("",!0)])]),o("button",{class:"cpToaster__close",onClick:t[0]||(t[0]=(...h)=>n.closeToaster&&n.closeToaster(...h))},[a(u,{type:"x"})]),i.actionLabel?(c(),_("div",Lr,[o("button",{class:"cpToaster__button",onClick:t[1]||(t[1]=(...h)=>n.handleActionMethod&&n.handleActionMethod(...h))},b(i.actionLabel),1)])):D("",!0)],42,Mr)),[[U,s.isOpen]])]),_:1},8,["onEnter","onLeave"])}var Te=S(Or,[["render",Pr]]);const $r=()=>typeof document!="undefined"&&document.createElement("div"),zr=(e,{props:t,children:i,element:p,app:s}={})=>{let n=p||$r(),u=Z(e,t,i);return s&&s._context&&(u.appContext=s._context),pe(u,n),{vNode:u,destroy:()=>{n&&pe(null,n),n=null,u=null},el:n}},qr=(e={})=>({show(t={}){let i=M({},t);zr(Te,{props:M(M({},e),i)})},unique(t={}){return t.isUnique=!0,this.show(t)},success(t={}){return t.type=R.SUCCESS.value,this.show(t)},critical(t={}){return t.type=R.CRITICAL.value,this.show(t)},info(t={}){return t.type=R.INFO.value,this.show(t)},warning(t={}){return t.type=R.WARNING.value,this.show(t)}});var Ar={install(e,t){e.component("CpToaster",Te);let i=qr(t);e.$toaster=i,e.config.globalProperties.$toaster=i}},Fr={beforeMount(e,t){e.clickOutsideEvent=function(i){e===i.target||e.contains(i.target)||t.value(i,e)},document.body.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.body.removeEventListener("click",e.clickOutsideEvent)}};const W=Ue(vo);W.use(Tr);W.use(Ar);W.use(Ne);W.directive("click-outside",Fr);W.mount("#app");