@iankibetsh/sh-tailwind 0.1.0 → 0.1.2

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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@iankibetsh/sh-core"),t=require("vue");var n={form:{form:`space-y-4`,group:`space-y-1`,label:`block text-sm font-medium text-gray-700 dark:text-gray-200`,required:`text-red-500`,input:`block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100`,inputInvalid:`block w-full rounded-md border border-red-500 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-red-500 focus:outline-none focus:ring-2 focus:ring-red-500/30 dark:bg-gray-800 dark:text-gray-100`,helper:`text-xs text-gray-500 dark:text-gray-400`,error:`text-xs text-red-600`,errorTitle:`rounded-md bg-red-50 px-4 py-3 text-sm text-red-700 dark:bg-red-950 dark:text-red-300`,nav:`flex items-center justify-end gap-3 pt-2`,submitBtn:`inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-60`,prevBtn:`inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200`,nextBtn:`inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40`,steps:{wrapper:`mb-6 flex items-start`,step:`relative flex flex-1 flex-col items-center gap-1`,circle:`z-10 flex size-9 items-center justify-center rounded-full border-2 border-gray-300 bg-white text-sm font-semibold text-gray-500 dark:border-gray-600 dark:bg-gray-800`,circleActive:`z-10 flex size-9 items-center justify-center rounded-full border-2 border-blue-600 bg-blue-600 text-sm font-semibold text-white`,circleDone:`z-10 flex size-9 items-center justify-center rounded-full border-2 border-emerald-500 bg-emerald-500 text-sm font-semibold text-white`,title:`text-xs text-gray-600 dark:text-gray-300`,titleActive:`text-xs font-semibold text-blue-600`,connector:`absolute top-4 right-1/2 -z-0 h-0.5 w-full bg-gray-200 dark:bg-gray-700`,connectorDone:`absolute top-4 right-1/2 -z-0 h-0.5 w-full bg-emerald-500`}},inputs:{select:`block w-full appearance-none rounded-md border border-gray-300 bg-white px-3 py-2 pr-8 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100`,passwordWrapper:`relative`,passwordToggle:`absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300`,suggest:{wrapper:`relative`,badges:`mb-1 flex flex-wrap gap-1`,badge:`inline-flex items-center gap-1 rounded-full bg-gray-200 px-2 py-0.5 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-200`,badgeRemove:`cursor-pointer text-gray-500 hover:text-red-600`,dropdown:`absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-800`,option:`cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700`,optionActive:`cursor-pointer bg-blue-50 px-3 py-2 text-sm text-blue-700 dark:bg-gray-700 dark:text-blue-300`,empty:`px-3 py-2 text-sm text-gray-400`},phone:{wrapper:`relative flex items-stretch rounded-md border border-gray-300 bg-white shadow-sm focus-within:border-blue-500 focus-within:ring-2 focus-within:ring-blue-500/30 dark:border-gray-600 dark:bg-gray-800`,trigger:`flex shrink-0 cursor-pointer items-center gap-1.5 rounded-l-md border-r border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600`,flag:`text-base leading-none`,dial:`text-sm font-medium text-gray-600 dark:text-gray-300`,chevron:`size-3.5 text-gray-400`,input:`block w-full rounded-r-md border-0 bg-transparent px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-0 dark:text-gray-100`,dropdown:`absolute left-0 top-full z-20 mt-1 w-72 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800`,search:`block w-full border-0 border-b border-gray-100 bg-transparent px-3 py-2.5 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-0 dark:border-gray-700 dark:text-gray-100`,list:`max-h-60 overflow-y-auto py-1`,option:`flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700`,optionActive:`flex w-full cursor-pointer items-center gap-2.5 bg-blue-50 px-3 py-2 text-left text-sm text-blue-700 dark:bg-gray-700 dark:text-blue-300`,optionName:`flex-1 truncate`,optionDial:`text-xs text-gray-400`,empty:`px-3 py-3 text-center text-sm text-gray-400`}},dialog:{backdrop:`fixed inset-0 bg-black/50`,wrapper:`fixed inset-0 flex items-center justify-center overflow-y-auto p-4`,panel:`relative flex max-h-[90vh] w-full flex-col rounded-xl bg-white shadow-xl outline-none dark:bg-gray-900`,header:`flex items-center justify-between border-b border-gray-100 px-5 py-3.5 dark:border-gray-800`,title:`text-base font-semibold text-gray-900 dark:text-gray-100`,closeBtn:`rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus:outline-none dark:hover:bg-gray-800`,body:`overflow-y-auto px-5 py-4`,footer:`flex justify-end gap-2 border-t border-gray-100 px-5 py-3 dark:border-gray-800`,sizes:{sm:`max-w-sm`,md:`max-w-lg`,lg:`max-w-2xl`,xl:`max-w-4xl`,full:`h-[95vh] max-w-[95vw]`}},drawer:{backdrop:`fixed inset-0 bg-black/50`,panel:`fixed flex flex-col bg-white shadow-xl outline-none dark:bg-gray-900`,header:`flex items-center justify-between border-b border-gray-100 px-5 py-3.5 dark:border-gray-800`,title:`text-base font-semibold text-gray-900 dark:text-gray-100`,closeBtn:`rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus:outline-none dark:hover:bg-gray-800`,body:`flex-1 overflow-y-auto px-5 py-4`,sizes:{sm:`max-w-xs`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-2xl`,full:`max-w-full`},sizesVertical:{sm:`max-h-48`,md:`max-h-72`,lg:`max-h-96`,xl:`max-h-[60vh]`,full:`max-h-full`}},table:{wrapper:`space-y-3`,toolbar:`flex flex-col gap-3 md:flex-row md:items-center md:justify-between`,search:`block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 md:max-w-xs dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100`,exactLabel:`inline-flex items-center gap-1.5 text-xs text-gray-500`,rangeWrapper:`flex items-center gap-2`,rangeInput:`rounded-md border border-gray-300 px-2 py-1.5 text-sm text-gray-700 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200`,offline:`flex items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-300`,container:`hidden overflow-x-auto rounded-lg border border-gray-200 md:block dark:border-gray-700`,table:`w-full min-w-full divide-y divide-gray-200 text-sm dark:divide-gray-700`,thead:`bg-gray-50 dark:bg-gray-800`,th:`px-4 py-2.5 text-left text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400`,sortBtn:`inline-flex cursor-pointer items-center gap-1 uppercase hover:text-gray-800 dark:hover:text-gray-200`,tbody:`divide-y divide-gray-100 bg-white dark:divide-gray-800 dark:bg-gray-900`,tr:``,trClickable:`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800`,td:`px-4 py-2.5 text-gray-700 dark:text-gray-200`,money:`font-semibold text-emerald-600`,empty:`px-4 py-10 text-center text-sm text-gray-400`,error:`rounded-md bg-red-50 px-4 py-3 text-sm text-red-700 dark:bg-red-950 dark:text-red-300`,loading:`flex justify-center px-4 py-10 text-gray-400`,actionsCell:`whitespace-nowrap px-4 py-2.5 text-right`,actionBtn:`ml-3 inline-flex cursor-pointer items-center gap-1 text-sm text-blue-600 hover:underline first:ml-0`,checkbox:`size-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500`,cards:`space-y-3 md:hidden`,card:`rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-900`,cardLabel:`text-xs font-semibold uppercase tracking-wide text-gray-400`,cardValue:`mb-2 text-sm text-gray-700 dark:text-gray-200`,pagination:{wrapper:`flex flex-col items-center justify-between gap-3 md:flex-row`,info:`text-xs text-gray-500`,perPage:`rounded-md border border-gray-300 px-2 py-1 text-xs text-gray-600 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300`,pages:`flex items-center gap-1`,pageBtn:`inline-flex size-8 cursor-pointer items-center justify-center rounded-md border border-gray-300 text-xs text-gray-600 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-40 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800`,pageBtnActive:`inline-flex size-8 items-center justify-center rounded-md border border-blue-600 bg-blue-600 text-xs font-semibold text-white`,ellipsis:`px-1 text-xs text-gray-400`,loadMore:`inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-60 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200`},multiBar:`fixed bottom-5 left-1/2 z-40 flex min-w-80 -translate-x-1/2 items-center justify-between gap-4 rounded-xl border border-gray-200 bg-white p-3 shadow-lg dark:border-gray-700 dark:bg-gray-900`,multiCount:`inline-flex items-center justify-center rounded-full bg-blue-600 px-2 py-0.5 text-xs font-semibold text-white`,multiBtn:`inline-flex items-center justify-center gap-1 rounded-md border border-blue-200 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-50 dark:border-blue-800 dark:text-blue-300`},buttons:{primary:`inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:opacity-60`,secondary:`inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200`,danger:`inline-flex items-center justify-center gap-2 rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500/40`,link:`inline-flex cursor-pointer items-center gap-1 text-sm text-blue-600 hover:underline`}},r=Symbol(`sh-tw-theme`),i=Symbol(`sh-tw-components`),a=Symbol(`sh-dialog-context`),o=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function s(e,t){if(!o(e))return t??e;let n={...e};return o(t)&&Object.keys(t).forEach(r=>{o(e[r])&&o(t[r])?n[r]=s(e[r],t[r]):n[r]=t[r]}),n}var c={install(t,a={}){e.ShCore.install(t,a);let o=s(n,a.theme??{});t.provide(r,o),t.provide(i,a.formComponents??{}),t.provide(`formComponents`,a.formComponents??{}),t.provide(`shFormElementClasses`,{formGroup:o.form.group,formLabel:o.form.label,formControl:o.form.input,helperText:o.form.helper,invalidFeedback:o.form.error,formErrorTitle:o.form.errorTitle,actionBtn:o.form.submitBtn})}},l=(e={})=>({install:t=>c.install(t,e)});function u(e,i=null){let a=(0,t.inject)(r,n);return(0,t.computed)(()=>s(a[e]??n[e],(0,t.unref)(i)??{}))}var d=0;function f(){if(++d===1){let e=window.innerWidth-document.documentElement.clientWidth;e>0&&(document.body.style.paddingRight=`${e}px`),document.body.style.overflow=`hidden`}}function p(){d>0&&--d===0&&(document.body.style.overflow=``,document.body.style.paddingRight=``)}var m=50,h=[];function g({isStatic:e,onClose:n,onOpen:r}={}){let i=(0,t.ref)(!1),a=(0,t.ref)(m),o=null,s={},c=t=>{t.key===`Escape`&&h[h.length-1]===s&&(e?.()||u(`escape`))};function l(){i.value||(o=document.activeElement,a.value=m+h.length*10,h.push(s),i.value=!0,f(),document.addEventListener(`keydown`,c),r?.())}function u(e=`api`){if(!i.value)return;i.value=!1;let t=h.indexOf(s);t>=0&&h.splice(t,1),p(),document.removeEventListener(`keydown`,c),o?.focus?.(),n?.(e)}function d(){e?.()||u(`backdrop`)}return(0,t.onScopeDispose)(()=>{i.value&&u(`unmount`)}),{isOpen:i,zIndex:a,show:l,close:u,onBackdrop:d}}var _=e=>String(e??``).replace(/[_-]+/g,` `).replace(/([a-z\d])([A-Z])/g,`$1 $2`).trim().split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),v={password:`password`,pin:`password`,password_confirmation:`password`,message:`textarea`,description:`textarea`,comments:`textarea`,notes:`textarea`,email:`email`,phone:`phone`,phone_number:`phone`,age:`number`,date:`date`};function y(e){if(e.type)return e.type;if(e.component)return`custom`;if(e.options)return e.multiple||e.allowCustom?`suggest`:`select`;let t=e.name??``;return v[t]?v[t]:/_email$/.test(t)?`email`:/_phone$/.test(t)?`phone`:/(_at|_date|_on)$/.test(t)?`date`:`text`}function b(e,t={}){return(e??[]).map(e=>{let n=typeof e==`string`?{name:e}:{...e};return n.name=n.name??n.field,n.name?(n.type=y(n),n.label!==!1&&(n.label=n.label??_(n.name)),n.placeholder=n.placeholder??``,n.helper=n.helper??``,n.required=!!n.required,n.value=n.value??t?.[n.name]??null,n):(console.warn(`[sh-tailwind] form field without a name was skipped`,e),null)}).filter(Boolean)}var x={key:0,xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2.5`},S={__name:`ShFormSteps`,props:{steps:{type:Array,required:!0},current:{type:Number,default:0}},setup(e){let n=u(`form`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(n).steps.wrapper)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.steps,(r,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:a,class:(0,t.normalizeClass)((0,t.unref)(n).steps.step)},[a>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)(a<=e.current?(0,t.unref)(n).steps.connectorDone:(0,t.unref)(n).steps.connector)},null,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)(a<e.current?(0,t.unref)(n).steps.circleDone:a===e.current?(0,t.unref)(n).steps.circleActive:(0,t.unref)(n).steps.circle)},[a<e.current?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,x,[...i[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M4.5 12.75l6 6 9-13.5`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(a+1),1)],64))],2),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)(a===e.current?(0,t.unref)(n).steps.titleActive:(0,t.unref)(n).steps.title)},(0,t.toDisplayString)(r.title),3)],2))),128))],2))}},C=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},w={},T={class:`animate-spin`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`};function E(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,T,[...n[0]||=[(0,t.createElementVNode)(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),(0,t.createElementVNode)(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`},null,-1)]])}var D=C(w,[[`render`,E]]),ee=[`placeholder`,`disabled`],O={__name:`TextInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:`text`,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,ee)),[[t.vModelText,a.value]])}},k=[`rows`,`placeholder`,`disabled`],A={__name:`TextAreaInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean,rows:{type:[Number,String],default:3}},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`textarea`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,k)),[[t.vModelText,a.value]])}},j=[`placeholder`,`disabled`],M={__name:`EmailInput`,props:{modelValue:String,placeholder:String,isInvalid:Boolean,disabled:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:`email`,autocomplete:`email`,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,j)),[[t.vModelText,a.value]])}},te=[`type`,`autocomplete`,`placeholder`,`disabled`],N={key:0,xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},P={key:1,xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},F=Object.assign({inheritAttrs:!1},{__name:`PasswordInput`,props:{modelValue:String,placeholder:String,isInvalid:Boolean,disabled:Boolean,autocomplete:{type:String,default:`current-password`}},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=u(`inputs`),o=(0,t.ref)(!1),s=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(a).passwordWrapper)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,(0,t.mergeProps)(n.$attrs,{"onUpdate:modelValue":r[0]||=e=>s.value=e,type:o.value?`text`:`password`,autocomplete:e.autocomplete,placeholder:e.placeholder,disabled:e.disabled,class:`pr-9`,onFocus:r[1]||=e=>i(`clearValidationErrors`)}),null,16,te),[[t.vModelDynamic,s.value]]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)((0,t.unref)(a).passwordToggle),tabindex:`-1`,onClick:r[2]||=e=>o.value=!o.value},[o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,P,[...r[4]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M3.98 8.22A10.48 10.48 0 002.04 11.68a1.01 1.01 0 000 .64C3.42 16.49 7.36 19.5 12 19.5c.99 0 1.95-.14 2.86-.39M6.23 6.23A10.45 10.45 0 0112 4.5c4.64 0 8.57 3.01 9.96 7.18.07.21.07.43 0 .64a10.5 10.5 0 01-4.19 5.45M6.23 6.23L3 3m3.23 3.23l3.65 3.65m7.89 7.89L21 21m-3.23-3.23l-3.65-3.65m0 0a3 3 0 10-4.24-4.24m4.24 4.24L9.88 9.88`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,N,[...r[3]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M2.04 12.32a1.01 1.01 0 010-.64C3.42 7.51 7.36 4.5 12 4.5c4.64 0 8.57 3.01 9.96 7.18.07.21.07.43 0 .64C20.58 16.49 16.64 19.5 12 19.5c-4.64 0-8.57-3.01-9.96-7.18z`},null,-1),(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`},null,-1)]]))],2)],2))}}),ne=[`min`,`max`,`step`,`placeholder`,`disabled`],I={__name:`NumberInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean,min:[Number,String],max:[Number,String],step:[Number,String]},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:`number`,min:e.min,max:e.max,step:e.step,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,ne)),[[t.vModelText,a.value]])}},L=[`type`,`min`,`max`,`disabled`],R={__name:`DateInput`,props:{modelValue:String,isInvalid:Boolean,disabled:Boolean,withTime:Boolean,min:String,max:String},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:e.withTime?`datetime-local`:`date`,min:e.min,max:e.max,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,L)),[[t.vModelDynamic,a.value]])}};function z(e){return Array.isArray(e)?e.map(e=>{if(e==null)return null;if(typeof e!=`object`)return{id:e,label:String(e)};let t=e.id??e.key??e.value??e.name;return{id:t,label:e.label??e.name??e.option??e.value??String(t),raw:e}}).filter(Boolean):[]}var re=[`disabled`],ie={value:null,disabled:``},B=[`value`],V={__name:`SelectInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean,options:Array,url:String},emits:[`update:modelValue`,`clearValidationErrors`],setup(n,{emit:r}){let i=n,a=r,o=(0,t.ref)([]),s=(0,t.ref)(!1),c=(0,t.computed)(()=>z(i.options??o.value)),l=(0,t.computed)({get:()=>i.modelValue,set:e=>a(`update:modelValue`,e)});return(0,t.onMounted)(()=>{!i.options&&i.url&&(s.value=!0,e.shApis.doGet(i.url,{all:1}).then(e=>{o.value=Array.isArray(e.data)?e.data:e.data?.data??[]}).finally(()=>{s.value=!1}))}),(e,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`select`,{"onUpdate:modelValue":r[0]||=e=>l.value=e,disabled:n.disabled||s.value,onFocus:r[1]||=e=>a(`clearValidationErrors`)},[(0,t.createElementVNode)(`option`,ie,(0,t.toDisplayString)(s.value?`Loading...`:n.placeholder||`Select...`),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.id,value:e.id},(0,t.toDisplayString)(e.label),9,B))),128))],40,re)),[[t.vModelSelect,l.value]])}},H=[{name:`Afghanistan`,dialCode:`+93`,isoCode:`AF`,flag:`https://www.countryflags.io/AF/flat/64.png`},{name:`Aland Islands`,dialCode:`+358`,isoCode:`AX`,flag:`https://www.countryflags.io/AX/flat/64.png`},{name:`Albania`,dialCode:`+355`,isoCode:`AL`,flag:`https://www.countryflags.io/AL/flat/64.png`},{name:`Algeria`,dialCode:`+213`,isoCode:`DZ`,flag:`https://www.countryflags.io/DZ/flat/64.png`},{name:`AmericanSamoa`,dialCode:`+1684`,isoCode:`AS`,flag:`https://www.countryflags.io/AS/flat/64.png`},{name:`Andorra`,dialCode:`+376`,isoCode:`AD`,flag:`https://www.countryflags.io/AD/flat/64.png`},{name:`Angola`,dialCode:`+244`,isoCode:`AO`,flag:`https://www.countryflags.io/AO/flat/64.png`},{name:`Anguilla`,dialCode:`+1264`,isoCode:`AI`,flag:`https://www.countryflags.io/AI/flat/64.png`},{name:`Antarctica`,dialCode:`+672`,isoCode:`AQ`,flag:`https://www.countryflags.io/AQ/flat/64.png`},{name:`Antigua and Barbuda`,dialCode:`+1268`,isoCode:`AG`,flag:`https://www.countryflags.io/AG/flat/64.png`},{name:`Argentina`,dialCode:`+54`,isoCode:`AR`,flag:`https://www.countryflags.io/AR/flat/64.png`},{name:`Armenia`,dialCode:`+374`,isoCode:`AM`,flag:`https://www.countryflags.io/AM/flat/64.png`},{name:`Aruba`,dialCode:`+297`,isoCode:`AW`,flag:`https://www.countryflags.io/AW/flat/64.png`},{name:`Ascension Island`,dialCode:`+247`,isoCode:`AC`,flag:`https://cdn.kcak11.com/flags/AC_64.png`},{name:`Australia`,dialCode:`+61`,isoCode:`AU`,flag:`https://www.countryflags.io/AU/flat/64.png`},{name:`Austria`,dialCode:`+43`,isoCode:`AT`,flag:`https://www.countryflags.io/AT/flat/64.png`},{name:`Azerbaijan`,dialCode:`+994`,isoCode:`AZ`,flag:`https://www.countryflags.io/AZ/flat/64.png`},{name:`Bahamas`,dialCode:`+1242`,isoCode:`BS`,flag:`https://www.countryflags.io/BS/flat/64.png`},{name:`Bahrain`,dialCode:`+973`,isoCode:`BH`,flag:`https://www.countryflags.io/BH/flat/64.png`},{name:`Bangladesh`,dialCode:`+880`,isoCode:`BD`,flag:`https://www.countryflags.io/BD/flat/64.png`},{name:`Barbados`,dialCode:`+1246`,isoCode:`BB`,flag:`https://www.countryflags.io/BB/flat/64.png`},{name:`Belarus`,dialCode:`+375`,isoCode:`BY`,flag:`https://www.countryflags.io/BY/flat/64.png`},{name:`Belgium`,dialCode:`+32`,isoCode:`BE`,flag:`https://www.countryflags.io/BE/flat/64.png`},{name:`Belize`,dialCode:`+501`,isoCode:`BZ`,flag:`https://www.countryflags.io/BZ/flat/64.png`},{name:`Benin`,dialCode:`+229`,isoCode:`BJ`,flag:`https://www.countryflags.io/BJ/flat/64.png`},{name:`Bermuda`,dialCode:`+1441`,isoCode:`BM`,flag:`https://www.countryflags.io/BM/flat/64.png`},{name:`Bhutan`,dialCode:`+975`,isoCode:`BT`,flag:`https://www.countryflags.io/BT/flat/64.png`},{name:`Bolivia`,dialCode:`+591`,isoCode:`BO`,flag:`https://www.countryflags.io/BO/flat/64.png`},{name:`Bosnia and Herzegovina`,dialCode:`+387`,isoCode:`BA`,flag:`https://www.countryflags.io/BA/flat/64.png`},{name:`Botswana`,dialCode:`+267`,isoCode:`BW`,flag:`https://www.countryflags.io/BW/flat/64.png`},{name:`Brazil`,dialCode:`+55`,isoCode:`BR`,flag:`https://www.countryflags.io/BR/flat/64.png`},{name:`British Indian Ocean Territory`,dialCode:`+246`,isoCode:`IO`,flag:`https://www.countryflags.io/IO/flat/64.png`},{name:`Brunei Darussalam`,dialCode:`+673`,isoCode:`BN`,flag:`https://www.countryflags.io/BN/flat/64.png`},{name:`Bulgaria`,dialCode:`+359`,isoCode:`BG`,flag:`https://www.countryflags.io/BG/flat/64.png`},{name:`Burkina Faso`,dialCode:`+226`,isoCode:`BF`,flag:`https://www.countryflags.io/BF/flat/64.png`},{name:`Burundi`,dialCode:`+257`,isoCode:`BI`,flag:`https://www.countryflags.io/BI/flat/64.png`},{name:`Cambodia`,dialCode:`+855`,isoCode:`KH`,flag:`https://www.countryflags.io/KH/flat/64.png`},{name:`Cameroon`,dialCode:`+237`,isoCode:`CM`,flag:`https://www.countryflags.io/CM/flat/64.png`},{name:`Canada`,dialCode:`+1`,isoCode:`CA`,flag:`https://www.countryflags.io/CA/flat/64.png`},{name:`Cape Verde`,dialCode:`+238`,isoCode:`CV`,flag:`https://www.countryflags.io/CV/flat/64.png`},{name:`Cayman Islands`,dialCode:`+1345`,isoCode:`KY`,flag:`https://www.countryflags.io/KY/flat/64.png`},{name:`Central African Republic`,dialCode:`+236`,isoCode:`CF`,flag:`https://www.countryflags.io/CF/flat/64.png`},{name:`Chad`,dialCode:`+235`,isoCode:`TD`,flag:`https://www.countryflags.io/TD/flat/64.png`},{name:`Chile`,dialCode:`+56`,isoCode:`CL`,flag:`https://www.countryflags.io/CL/flat/64.png`},{name:`China`,dialCode:`+86`,isoCode:`CN`,flag:`https://www.countryflags.io/CN/flat/64.png`},{name:`Christmas Island`,dialCode:`+61`,isoCode:`CX`,flag:`https://www.countryflags.io/CX/flat/64.png`},{name:`Cocos (Keeling) Islands`,dialCode:`+61`,isoCode:`CC`,flag:`https://www.countryflags.io/CC/flat/64.png`},{name:`Colombia`,dialCode:`+57`,isoCode:`CO`,flag:`https://www.countryflags.io/CO/flat/64.png`},{name:`Comoros`,dialCode:`+269`,isoCode:`KM`,flag:`https://www.countryflags.io/KM/flat/64.png`},{name:`Congo`,dialCode:`+242`,isoCode:`CG`,flag:`https://www.countryflags.io/CG/flat/64.png`},{name:`Cook Islands`,dialCode:`+682`,isoCode:`CK`,flag:`https://www.countryflags.io/CK/flat/64.png`},{name:`Costa Rica`,dialCode:`+506`,isoCode:`CR`,flag:`https://www.countryflags.io/CR/flat/64.png`},{name:`Croatia`,dialCode:`+385`,isoCode:`HR`,flag:`https://www.countryflags.io/HR/flat/64.png`},{name:`Cuba`,dialCode:`+53`,isoCode:`CU`,flag:`https://www.countryflags.io/CU/flat/64.png`},{name:`Cyprus`,dialCode:`+357`,isoCode:`CY`,flag:`https://www.countryflags.io/CY/flat/64.png`},{name:`Czech Republic`,dialCode:`+420`,isoCode:`CZ`,flag:`https://www.countryflags.io/CZ/flat/64.png`},{name:`Democratic Republic of the Congo`,dialCode:`+243`,isoCode:`CD`,flag:`https://www.countryflags.io/CD/flat/64.png`},{name:`Denmark`,dialCode:`+45`,isoCode:`DK`,flag:`https://www.countryflags.io/DK/flat/64.png`},{name:`Djibouti`,dialCode:`+253`,isoCode:`DJ`,flag:`https://www.countryflags.io/DJ/flat/64.png`},{name:`Dominica`,dialCode:`+1767`,isoCode:`DM`,flag:`https://www.countryflags.io/DM/flat/64.png`},{name:`Dominican Republic`,dialCode:`+1849`,isoCode:`DO`,flag:`https://www.countryflags.io/DO/flat/64.png`},{name:`Ecuador`,dialCode:`+593`,isoCode:`EC`,flag:`https://www.countryflags.io/EC/flat/64.png`},{name:`Egypt`,dialCode:`+20`,isoCode:`EG`,flag:`https://www.countryflags.io/EG/flat/64.png`},{name:`El Salvador`,dialCode:`+503`,isoCode:`SV`,flag:`https://www.countryflags.io/SV/flat/64.png`},{name:`Equatorial Guinea`,dialCode:`+240`,isoCode:`GQ`,flag:`https://www.countryflags.io/GQ/flat/64.png`},{name:`Eritrea`,dialCode:`+291`,isoCode:`ER`,flag:`https://www.countryflags.io/ER/flat/64.png`},{name:`Estonia`,dialCode:`+372`,isoCode:`EE`,flag:`https://www.countryflags.io/EE/flat/64.png`},{name:`Eswatini`,dialCode:`+268`,isoCode:`SZ`,flag:`https://www.countryflags.io/SZ/flat/64.png`},{name:`Ethiopia`,dialCode:`+251`,isoCode:`ET`,flag:`https://www.countryflags.io/ET/flat/64.png`},{name:`Falkland Islands (Malvinas)`,dialCode:`+500`,isoCode:`FK`,flag:`https://www.countryflags.io/FK/flat/64.png`},{name:`Faroe Islands`,dialCode:`+298`,isoCode:`FO`,flag:`https://www.countryflags.io/FO/flat/64.png`},{name:`Fiji`,dialCode:`+679`,isoCode:`FJ`,flag:`https://www.countryflags.io/FJ/flat/64.png`},{name:`Finland`,dialCode:`+358`,isoCode:`FI`,flag:`https://www.countryflags.io/FI/flat/64.png`},{name:`France`,dialCode:`+33`,isoCode:`FR`,flag:`https://www.countryflags.io/FR/flat/64.png`},{name:`French Guiana`,dialCode:`+594`,isoCode:`GF`,flag:`https://www.countryflags.io/GF/flat/64.png`},{name:`French Polynesia`,dialCode:`+689`,isoCode:`PF`,flag:`https://www.countryflags.io/PF/flat/64.png`},{name:`Gabon`,dialCode:`+241`,isoCode:`GA`,flag:`https://www.countryflags.io/GA/flat/64.png`},{name:`Gambia`,dialCode:`+220`,isoCode:`GM`,flag:`https://www.countryflags.io/GM/flat/64.png`},{name:`Georgia`,dialCode:`+995`,isoCode:`GE`,flag:`https://www.countryflags.io/GE/flat/64.png`},{name:`Germany`,dialCode:`+49`,isoCode:`DE`,flag:`https://www.countryflags.io/DE/flat/64.png`},{name:`Ghana`,dialCode:`+233`,isoCode:`GH`,flag:`https://www.countryflags.io/GH/flat/64.png`},{name:`Gibraltar`,dialCode:`+350`,isoCode:`GI`,flag:`https://www.countryflags.io/GI/flat/64.png`},{name:`Greece`,dialCode:`+30`,isoCode:`GR`,flag:`https://www.countryflags.io/GR/flat/64.png`},{name:`Greenland`,dialCode:`+299`,isoCode:`GL`,flag:`https://www.countryflags.io/GL/flat/64.png`},{name:`Grenada`,dialCode:`+1473`,isoCode:`GD`,flag:`https://www.countryflags.io/GD/flat/64.png`},{name:`Guadeloupe`,dialCode:`+590`,isoCode:`GP`,flag:`https://www.countryflags.io/GP/flat/64.png`},{name:`Guam`,dialCode:`+1671`,isoCode:`GU`,flag:`https://www.countryflags.io/GU/flat/64.png`},{name:`Guatemala`,dialCode:`+502`,isoCode:`GT`,flag:`https://www.countryflags.io/GT/flat/64.png`},{name:`Guernsey`,dialCode:`+44`,isoCode:`GG`,flag:`https://www.countryflags.io/GG/flat/64.png`},{name:`Guinea`,dialCode:`+224`,isoCode:`GN`,flag:`https://www.countryflags.io/GN/flat/64.png`},{name:`Guinea-Bissau`,dialCode:`+245`,isoCode:`GW`,flag:`https://www.countryflags.io/GW/flat/64.png`},{name:`Guyana`,dialCode:`+592`,isoCode:`GY`,flag:`https://www.countryflags.io/GY/flat/64.png`},{name:`Haiti`,dialCode:`+509`,isoCode:`HT`,flag:`https://www.countryflags.io/HT/flat/64.png`},{name:`Holy See (Vatican City State)`,dialCode:`+379`,isoCode:`VA`,flag:`https://www.countryflags.io/VA/flat/64.png`},{name:`Honduras`,dialCode:`+504`,isoCode:`HN`,flag:`https://www.countryflags.io/HN/flat/64.png`},{name:`Hong Kong`,dialCode:`+852`,isoCode:`HK`,flag:`https://www.countryflags.io/HK/flat/64.png`},{name:`Hungary`,dialCode:`+36`,isoCode:`HU`,flag:`https://www.countryflags.io/HU/flat/64.png`},{name:`Iceland`,dialCode:`+354`,isoCode:`IS`,flag:`https://www.countryflags.io/IS/flat/64.png`},{name:`India`,dialCode:`+91`,isoCode:`IN`,flag:`https://www.countryflags.io/IN/flat/64.png`},{name:`Indonesia`,dialCode:`+62`,isoCode:`ID`,flag:`https://www.countryflags.io/ID/flat/64.png`},{name:`Iran`,dialCode:`+98`,isoCode:`IR`,flag:`https://www.countryflags.io/IR/flat/64.png`},{name:`Iraq`,dialCode:`+964`,isoCode:`IQ`,flag:`https://www.countryflags.io/IQ/flat/64.png`},{name:`Ireland`,dialCode:`+353`,isoCode:`IE`,flag:`https://www.countryflags.io/IE/flat/64.png`},{name:`Isle of Man`,dialCode:`+44`,isoCode:`IM`,flag:`https://www.countryflags.io/IM/flat/64.png`},{name:`Israel`,dialCode:`+972`,isoCode:`IL`,flag:`https://www.countryflags.io/IL/flat/64.png`},{name:`Italy`,dialCode:`+39`,isoCode:`IT`,flag:`https://www.countryflags.io/IT/flat/64.png`},{name:`Ivory Coast / Cote d'Ivoire`,dialCode:`+225`,isoCode:`CI`,flag:`https://www.countryflags.io/CI/flat/64.png`},{name:`Jamaica`,dialCode:`+1876`,isoCode:`JM`,flag:`https://www.countryflags.io/JM/flat/64.png`},{name:`Japan`,dialCode:`+81`,isoCode:`JP`,flag:`https://www.countryflags.io/JP/flat/64.png`},{name:`Jersey`,dialCode:`+44`,isoCode:`JE`,flag:`https://www.countryflags.io/JE/flat/64.png`},{name:`Jordan`,dialCode:`+962`,isoCode:`JO`,flag:`https://www.countryflags.io/JO/flat/64.png`},{name:`Kazakhstan`,dialCode:`+77`,isoCode:`KZ`,flag:`https://www.countryflags.io/KZ/flat/64.png`},{name:`Kenya`,dialCode:`+254`,isoCode:`KE`,flag:`https://www.countryflags.io/KE/flat/64.png`},{name:`Kiribati`,dialCode:`+686`,isoCode:`KI`,flag:`https://www.countryflags.io/KI/flat/64.png`},{name:`Korea, Democratic People's Republic of Korea`,dialCode:`+850`,isoCode:`KP`,flag:`https://www.countryflags.io/KP/flat/64.png`},{name:`Korea, Republic of South Korea`,dialCode:`+82`,isoCode:`KR`,flag:`https://www.countryflags.io/KR/flat/64.png`},{name:`Kosovo`,dialCode:`+383`,isoCode:`XK`,flag:`https://www.countryflags.io/XK/flat/64.png`},{name:`Kuwait`,dialCode:`+965`,isoCode:`KW`,flag:`https://www.countryflags.io/KW/flat/64.png`},{name:`Kyrgyzstan`,dialCode:`+996`,isoCode:`KG`,flag:`https://www.countryflags.io/KG/flat/64.png`},{name:`Laos`,dialCode:`+856`,isoCode:`LA`,flag:`https://www.countryflags.io/LA/flat/64.png`},{name:`Latvia`,dialCode:`+371`,isoCode:`LV`,flag:`https://www.countryflags.io/LV/flat/64.png`},{name:`Lebanon`,dialCode:`+961`,isoCode:`LB`,flag:`https://www.countryflags.io/LB/flat/64.png`},{name:`Lesotho`,dialCode:`+266`,isoCode:`LS`,flag:`https://www.countryflags.io/LS/flat/64.png`},{name:`Liberia`,dialCode:`+231`,isoCode:`LR`,flag:`https://www.countryflags.io/LR/flat/64.png`},{name:`Libya`,dialCode:`+218`,isoCode:`LY`,flag:`https://www.countryflags.io/LY/flat/64.png`},{name:`Liechtenstein`,dialCode:`+423`,isoCode:`LI`,flag:`https://www.countryflags.io/LI/flat/64.png`},{name:`Lithuania`,dialCode:`+370`,isoCode:`LT`,flag:`https://www.countryflags.io/LT/flat/64.png`},{name:`Luxembourg`,dialCode:`+352`,isoCode:`LU`,flag:`https://www.countryflags.io/LU/flat/64.png`},{name:`Macau`,dialCode:`+853`,isoCode:`MO`,flag:`https://www.countryflags.io/MO/flat/64.png`},{name:`Madagascar`,dialCode:`+261`,isoCode:`MG`,flag:`https://www.countryflags.io/MG/flat/64.png`},{name:`Malawi`,dialCode:`+265`,isoCode:`MW`,flag:`https://www.countryflags.io/MW/flat/64.png`},{name:`Malaysia`,dialCode:`+60`,isoCode:`MY`,flag:`https://www.countryflags.io/MY/flat/64.png`},{name:`Maldives`,dialCode:`+960`,isoCode:`MV`,flag:`https://www.countryflags.io/MV/flat/64.png`},{name:`Mali`,dialCode:`+223`,isoCode:`ML`,flag:`https://www.countryflags.io/ML/flat/64.png`},{name:`Malta`,dialCode:`+356`,isoCode:`MT`,flag:`https://www.countryflags.io/MT/flat/64.png`},{name:`Marshall Islands`,dialCode:`+692`,isoCode:`MH`,flag:`https://www.countryflags.io/MH/flat/64.png`},{name:`Martinique`,dialCode:`+596`,isoCode:`MQ`,flag:`https://www.countryflags.io/MQ/flat/64.png`},{name:`Mauritania`,dialCode:`+222`,isoCode:`MR`,flag:`https://www.countryflags.io/MR/flat/64.png`},{name:`Mauritius`,dialCode:`+230`,isoCode:`MU`,flag:`https://www.countryflags.io/MU/flat/64.png`},{name:`Mayotte`,dialCode:`+262`,isoCode:`YT`,flag:`https://www.countryflags.io/YT/flat/64.png`},{name:`Mexico`,dialCode:`+52`,isoCode:`MX`,flag:`https://www.countryflags.io/MX/flat/64.png`},{name:`Micronesia, Federated States of Micronesia`,dialCode:`+691`,isoCode:`FM`,flag:`https://www.countryflags.io/FM/flat/64.png`},{name:`Moldova`,dialCode:`+373`,isoCode:`MD`,flag:`https://www.countryflags.io/MD/flat/64.png`},{name:`Monaco`,dialCode:`+377`,isoCode:`MC`,flag:`https://www.countryflags.io/MC/flat/64.png`},{name:`Mongolia`,dialCode:`+976`,isoCode:`MN`,flag:`https://www.countryflags.io/MN/flat/64.png`},{name:`Montenegro`,dialCode:`+382`,isoCode:`ME`,flag:`https://www.countryflags.io/ME/flat/64.png`},{name:`Montserrat`,dialCode:`+1664`,isoCode:`MS`,flag:`https://www.countryflags.io/MS/flat/64.png`},{name:`Morocco`,dialCode:`+212`,isoCode:`MA`,flag:`https://www.countryflags.io/MA/flat/64.png`},{name:`Mozambique`,dialCode:`+258`,isoCode:`MZ`,flag:`https://www.countryflags.io/MZ/flat/64.png`},{name:`Myanmar`,dialCode:`+95`,isoCode:`MM`,flag:`https://www.countryflags.io/MM/flat/64.png`},{name:`Namibia`,dialCode:`+264`,isoCode:`NA`,flag:`https://www.countryflags.io/NA/flat/64.png`},{name:`Nauru`,dialCode:`+674`,isoCode:`NR`,flag:`https://www.countryflags.io/NR/flat/64.png`},{name:`Nepal`,dialCode:`+977`,isoCode:`NP`,flag:`https://www.countryflags.io/NP/flat/64.png`},{name:`Netherlands`,dialCode:`+31`,isoCode:`NL`,flag:`https://www.countryflags.io/NL/flat/64.png`},{name:`Netherlands Antilles`,dialCode:`+599`,isoCode:`AN`,flag:`https://www.countryflags.io/AN/flat/64.png`},{name:`New Caledonia`,dialCode:`+687`,isoCode:`NC`,flag:`https://www.countryflags.io/NC/flat/64.png`},{name:`New Zealand`,dialCode:`+64`,isoCode:`NZ`,flag:`https://www.countryflags.io/NZ/flat/64.png`},{name:`Nicaragua`,dialCode:`+505`,isoCode:`NI`,flag:`https://www.countryflags.io/NI/flat/64.png`},{name:`Niger`,dialCode:`+227`,isoCode:`NE`,flag:`https://www.countryflags.io/NE/flat/64.png`},{name:`Nigeria`,dialCode:`+234`,isoCode:`NG`,flag:`https://www.countryflags.io/NG/flat/64.png`},{name:`Niue`,dialCode:`+683`,isoCode:`NU`,flag:`https://www.countryflags.io/NU/flat/64.png`},{name:`Norfolk Island`,dialCode:`+672`,isoCode:`NF`,flag:`https://www.countryflags.io/NF/flat/64.png`},{name:`North Macedonia`,dialCode:`+389`,isoCode:`MK`,flag:`https://www.countryflags.io/MK/flat/64.png`},{name:`Northern Mariana Islands`,dialCode:`+1670`,isoCode:`MP`,flag:`https://www.countryflags.io/MP/flat/64.png`},{name:`Norway`,dialCode:`+47`,isoCode:`NO`,flag:`https://www.countryflags.io/NO/flat/64.png`},{name:`Oman`,dialCode:`+968`,isoCode:`OM`,flag:`https://www.countryflags.io/OM/flat/64.png`},{name:`Pakistan`,dialCode:`+92`,isoCode:`PK`,flag:`https://www.countryflags.io/PK/flat/64.png`},{name:`Palau`,dialCode:`+680`,isoCode:`PW`,flag:`https://www.countryflags.io/PW/flat/64.png`},{name:`Palestine`,dialCode:`+970`,isoCode:`PS`,flag:`https://www.countryflags.io/PS/flat/64.png`},{name:`Panama`,dialCode:`+507`,isoCode:`PA`,flag:`https://www.countryflags.io/PA/flat/64.png`},{name:`Papua New Guinea`,dialCode:`+675`,isoCode:`PG`,flag:`https://www.countryflags.io/PG/flat/64.png`},{name:`Paraguay`,dialCode:`+595`,isoCode:`PY`,flag:`https://www.countryflags.io/PY/flat/64.png`},{name:`Peru`,dialCode:`+51`,isoCode:`PE`,flag:`https://www.countryflags.io/PE/flat/64.png`},{name:`Philippines`,dialCode:`+63`,isoCode:`PH`,flag:`https://www.countryflags.io/PH/flat/64.png`},{name:`Pitcairn`,dialCode:`+872`,isoCode:`PN`,flag:`https://www.countryflags.io/PN/flat/64.png`},{name:`Poland`,dialCode:`+48`,isoCode:`PL`,flag:`https://www.countryflags.io/PL/flat/64.png`},{name:`Portugal`,dialCode:`+351`,isoCode:`PT`,flag:`https://www.countryflags.io/PT/flat/64.png`},{name:`Puerto Rico`,dialCode:`+1939`,isoCode:`PR`,flag:`https://www.countryflags.io/PR/flat/64.png`},{name:`Qatar`,dialCode:`+974`,isoCode:`QA`,flag:`https://www.countryflags.io/QA/flat/64.png`},{name:`Reunion`,dialCode:`+262`,isoCode:`RE`,flag:`https://www.countryflags.io/RE/flat/64.png`},{name:`Romania`,dialCode:`+40`,isoCode:`RO`,flag:`https://www.countryflags.io/RO/flat/64.png`},{name:`Russia`,dialCode:`+7`,isoCode:`RU`,flag:`https://www.countryflags.io/RU/flat/64.png`},{name:`Rwanda`,dialCode:`+250`,isoCode:`RW`,flag:`https://www.countryflags.io/RW/flat/64.png`},{name:`Saint Barthelemy`,dialCode:`+590`,isoCode:`BL`,flag:`https://www.countryflags.io/BL/flat/64.png`},{name:`Saint Helena, Ascension and Tristan Da Cunha`,dialCode:`+290`,isoCode:`SH`,flag:`https://www.countryflags.io/SH/flat/64.png`},{name:`Saint Kitts and Nevis`,dialCode:`+1869`,isoCode:`KN`,flag:`https://www.countryflags.io/KN/flat/64.png`},{name:`Saint Lucia`,dialCode:`+1758`,isoCode:`LC`,flag:`https://www.countryflags.io/LC/flat/64.png`},{name:`Saint Martin`,dialCode:`+590`,isoCode:`MF`,flag:`https://www.countryflags.io/MF/flat/64.png`},{name:`Saint Pierre and Miquelon`,dialCode:`+508`,isoCode:`PM`,flag:`https://www.countryflags.io/PM/flat/64.png`},{name:`Saint Vincent and the Grenadines`,dialCode:`+1784`,isoCode:`VC`,flag:`https://www.countryflags.io/VC/flat/64.png`},{name:`Samoa`,dialCode:`+685`,isoCode:`WS`,flag:`https://www.countryflags.io/WS/flat/64.png`},{name:`San Marino`,dialCode:`+378`,isoCode:`SM`,flag:`https://www.countryflags.io/SM/flat/64.png`},{name:`Sao Tome and Principe`,dialCode:`+239`,isoCode:`ST`,flag:`https://www.countryflags.io/ST/flat/64.png`},{name:`Saudi Arabia`,dialCode:`+966`,isoCode:`SA`,flag:`https://www.countryflags.io/SA/flat/64.png`},{name:`Senegal`,dialCode:`+221`,isoCode:`SN`,flag:`https://www.countryflags.io/SN/flat/64.png`},{name:`Serbia`,dialCode:`+381`,isoCode:`RS`,flag:`https://www.countryflags.io/RS/flat/64.png`},{name:`Seychelles`,dialCode:`+248`,isoCode:`SC`,flag:`https://www.countryflags.io/SC/flat/64.png`},{name:`Sierra Leone`,dialCode:`+232`,isoCode:`SL`,flag:`https://www.countryflags.io/SL/flat/64.png`},{name:`Singapore`,dialCode:`+65`,isoCode:`SG`,flag:`https://www.countryflags.io/SG/flat/64.png`},{name:`Sint Maarten`,dialCode:`+1721`,isoCode:`SX`,flag:`https://www.countryflags.io/SX/flat/64.png`},{name:`Slovakia`,dialCode:`+421`,isoCode:`SK`,flag:`https://www.countryflags.io/SK/flat/64.png`},{name:`Slovenia`,dialCode:`+386`,isoCode:`SI`,flag:`https://www.countryflags.io/SI/flat/64.png`},{name:`Solomon Islands`,dialCode:`+677`,isoCode:`SB`,flag:`https://www.countryflags.io/SB/flat/64.png`},{name:`Somalia`,dialCode:`+252`,isoCode:`SO`,flag:`https://www.countryflags.io/SO/flat/64.png`},{name:`South Africa`,dialCode:`+27`,isoCode:`ZA`,flag:`https://www.countryflags.io/ZA/flat/64.png`},{name:`South Georgia and the South Sandwich Islands`,dialCode:`+500`,isoCode:`GS`,flag:`https://www.countryflags.io/GS/flat/64.png`},{name:`South Sudan`,dialCode:`+211`,isoCode:`SS`,flag:`https://www.countryflags.io/SS/flat/64.png`},{name:`Spain`,dialCode:`+34`,isoCode:`ES`,flag:`https://www.countryflags.io/ES/flat/64.png`},{name:`Sri Lanka`,dialCode:`+94`,isoCode:`LK`,flag:`https://www.countryflags.io/LK/flat/64.png`},{name:`Sudan`,dialCode:`+249`,isoCode:`SD`,flag:`https://www.countryflags.io/SD/flat/64.png`},{name:`Suriname`,dialCode:`+597`,isoCode:`SR`,flag:`https://www.countryflags.io/SR/flat/64.png`},{name:`Svalbard and Jan Mayen`,dialCode:`+47`,isoCode:`SJ`,flag:`https://www.countryflags.io/SJ/flat/64.png`},{name:`Sweden`,dialCode:`+46`,isoCode:`SE`,flag:`https://www.countryflags.io/SE/flat/64.png`},{name:`Switzerland`,dialCode:`+41`,isoCode:`CH`,flag:`https://www.countryflags.io/CH/flat/64.png`},{name:`Syrian Arab Republic`,dialCode:`+963`,isoCode:`SY`,flag:`https://www.countryflags.io/SY/flat/64.png`},{name:`Taiwan`,dialCode:`+886`,isoCode:`TW`,flag:`https://www.countryflags.io/TW/flat/64.png`},{name:`Tajikistan`,dialCode:`+992`,isoCode:`TJ`,flag:`https://www.countryflags.io/TJ/flat/64.png`},{name:`Tanzania, United Republic of Tanzania`,dialCode:`+255`,isoCode:`TZ`,flag:`https://www.countryflags.io/TZ/flat/64.png`},{name:`Thailand`,dialCode:`+66`,isoCode:`TH`,flag:`https://www.countryflags.io/TH/flat/64.png`},{name:`Timor-Leste`,dialCode:`+670`,isoCode:`TL`,flag:`https://www.countryflags.io/TL/flat/64.png`},{name:`Togo`,dialCode:`+228`,isoCode:`TG`,flag:`https://www.countryflags.io/TG/flat/64.png`},{name:`Tokelau`,dialCode:`+690`,isoCode:`TK`,flag:`https://www.countryflags.io/TK/flat/64.png`},{name:`Tonga`,dialCode:`+676`,isoCode:`TO`,flag:`https://www.countryflags.io/TO/flat/64.png`},{name:`Trinidad and Tobago`,dialCode:`+1868`,isoCode:`TT`,flag:`https://www.countryflags.io/TT/flat/64.png`},{name:`Tunisia`,dialCode:`+216`,isoCode:`TN`,flag:`https://www.countryflags.io/TN/flat/64.png`},{name:`Turkey`,dialCode:`+90`,isoCode:`TR`,flag:`https://www.countryflags.io/TR/flat/64.png`},{name:`Turkmenistan`,dialCode:`+993`,isoCode:`TM`,flag:`https://www.countryflags.io/TM/flat/64.png`},{name:`Turks and Caicos Islands`,dialCode:`+1649`,isoCode:`TC`,flag:`https://www.countryflags.io/TC/flat/64.png`},{name:`Tuvalu`,dialCode:`+688`,isoCode:`TV`,flag:`https://www.countryflags.io/TV/flat/64.png`},{name:`Uganda`,dialCode:`+256`,isoCode:`UG`,flag:`https://www.countryflags.io/UG/flat/64.png`},{name:`Ukraine`,dialCode:`+380`,isoCode:`UA`,flag:`https://www.countryflags.io/UA/flat/64.png`},{name:`United Arab Emirates`,dialCode:`+971`,isoCode:`AE`,flag:`https://www.countryflags.io/AE/flat/64.png`},{name:`United Kingdom`,dialCode:`+44`,isoCode:`GB`,flag:`https://www.countryflags.io/GB/flat/64.png`},{name:`United States`,dialCode:`+1`,isoCode:`US`,flag:`https://www.countryflags.io/US/flat/64.png`},{name:`Uruguay`,dialCode:`+598`,isoCode:`UY`,flag:`https://www.countryflags.io/UY/flat/64.png`},{name:`Uzbekistan`,dialCode:`+998`,isoCode:`UZ`,flag:`https://www.countryflags.io/UZ/flat/64.png`},{name:`Vanuatu`,dialCode:`+678`,isoCode:`VU`,flag:`https://www.countryflags.io/VU/flat/64.png`},{name:`Venezuela, Bolivarian Republic of Venezuela`,dialCode:`+58`,isoCode:`VE`,flag:`https://www.countryflags.io/VE/flat/64.png`},{name:`Vietnam`,dialCode:`+84`,isoCode:`VN`,flag:`https://www.countryflags.io/VN/flat/64.png`},{name:`Virgin Islands, British`,dialCode:`+1284`,isoCode:`VG`,flag:`https://www.countryflags.io/VG/flat/64.png`},{name:`Virgin Islands, U.S.`,dialCode:`+1340`,isoCode:`VI`,flag:`https://www.countryflags.io/VI/flat/64.png`},{name:`Wallis and Futuna`,dialCode:`+681`,isoCode:`WF`,flag:`https://www.countryflags.io/WF/flat/64.png`},{name:`Yemen`,dialCode:`+967`,isoCode:`YE`,flag:`https://www.countryflags.io/YE/flat/64.png`},{name:`Zambia`,dialCode:`+260`,isoCode:`ZM`,flag:`https://www.countryflags.io/ZM/flat/64.png`},{name:`Zimbabwe`,dialCode:`+263`,isoCode:`ZW`,flag:`https://www.countryflags.io/ZW/flat/64.png`}],U=[`disabled`,`aria-expanded`],W=[`placeholder`,`disabled`],ae=[`aria-selected`,`onPointerdown`,`onMouseenter`],G=Object.assign({inheritAttrs:!1},{__name:`PhoneInput`,props:{modelValue:String,placeholder:{type:String,default:`712345678`},isInvalid:Boolean,disabled:Boolean,countryCode:{type:String,default:`KE`},detectCountry:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(n,{emit:r}){let i=n,a=r,o=u(`inputs`),s=(0,t.ref)(null),c=(0,t.ref)(null),l=(0,t.ref)(``),d=(0,t.ref)(!1),f=(0,t.ref)(``),p=(0,t.ref)(-1),m=(0,t.ref)(H.find(e=>e.isoCode===i.countryCode.toUpperCase())??H[0]),h=e=>String(e??``).toUpperCase().split(``).map(e=>String.fromCodePoint(127462+e.charCodeAt(0)-65)).join(``),g=(0,t.computed)(()=>{let e=f.value.trim().toLowerCase();return e?H.filter(t=>t.name.toLowerCase().includes(e)||t.dialCode.includes(e)||t.isoCode.toLowerCase().includes(e)):H}),_=async()=>{i.disabled||(d.value=!d.value,d.value&&(f.value=``,p.value=-1,await(0,t.nextTick)(),c.value?.focus()))},v=e=>{m.value=e,d.value=!1,b()},y=e=>{if(e.key===`ArrowDown`)e.preventDefault(),p.value=Math.min(p.value+1,g.value.length-1);else if(e.key===`ArrowUp`)e.preventDefault(),p.value=Math.max(p.value-1,0);else if(e.key===`Enter`){e.preventDefault();let t=g.value[Math.max(p.value,0)];t&&v(t)}else e.key===`Escape`&&(d.value=!1)},b=()=>{let e=(l.value||``).replace(/^0/,``);a(`update:modelValue`,e?m.value.dialCode+e:``)},x=e=>{if(!e){l.value=``;return}let t=H.find(t=>e.startsWith(t.dialCode));t?(m.value=t,l.value=e.replace(t.dialCode,``)):l.value=e};(0,t.watch)(()=>i.modelValue,x);let S=e=>{s.value&&!s.value.contains(e.target)&&(d.value=!1)};return(0,t.onMounted)(()=>{document.addEventListener(`pointerdown`,S),x(i.modelValue),i.detectCountry&&!i.modelValue&&e.shApis.doGet(`sh-country-code`).then(e=>{let t=e.data?.countryCode,n=t&&H.find(e=>e.isoCode===t.toUpperCase());n&&(m.value=n)}).catch(()=>{})}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`pointerdown`,S)}),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`root`,ref:s,class:(0,t.normalizeClass)([(0,t.unref)(o).phone.wrapper,n.isInvalid?`border-red-500 focus-within:ring-red-500/30`:``])},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.trigger),disabled:n.disabled,"aria-haspopup":`listbox`,"aria-expanded":d.value,onClick:_},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.flag)},(0,t.toDisplayString)(h(m.value.isoCode)),3),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.dial)},(0,t.toDisplayString)(m.value.dialCode),3),((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.chevron),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2`},[...r[4]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M19.5 8.25l-7.5 7.5-7.5-7.5`},null,-1)]],2))],10,U),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[0]||=e=>l.value=e,type:`tel`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.input),placeholder:n.placeholder,disabled:n.disabled,onInput:b,onFocus:r[1]||=e=>a(`clearValidationErrors`)},null,42,W),[[t.vModelText,l.value]]),d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).phone.dropdown)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`searchEl`,ref:c,"onUpdate:modelValue":r[2]||=e=>f.value=e,type:`text`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.search),placeholder:`Search country or code...`,onKeydown:y,onInput:r[3]||=e=>p.value=0},null,34),[[t.vModelText,f.value]]),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.list),role:`listbox`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(g.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.isoCode,type:`button`,role:`option`,"aria-selected":e.isoCode===m.value.isoCode,class:(0,t.normalizeClass)(n===p.value?(0,t.unref)(o).phone.optionActive:(0,t.unref)(o).phone.option),onPointerdown:(0,t.withModifiers)(t=>v(e),[`prevent`]),onMouseenter:e=>p.value=n},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.flag)},(0,t.toDisplayString)(h(e.isoCode)),3),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.optionName)},(0,t.toDisplayString)(e.name),3),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.optionDial)},(0,t.toDisplayString)(e.dialCode),3)],42,ae))),128)),g.value.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).phone.empty)},`No country matches "`+(0,t.toDisplayString)(f.value)+`"`,3))],2)],2)):(0,t.createCommentVNode)(``,!0)],2))}}),K=[`onClick`],oe=[`placeholder`,`disabled`],se=[`onPointerdown`,`onMouseenter`],q=Object.assign({inheritAttrs:!1},{__name:`ShSuggest`,props:{modelValue:[String,Number,Array],placeholder:{type:String,default:`Type to search...`},isInvalid:Boolean,disabled:Boolean,options:Array,url:String,multiple:Boolean,allowCustom:Boolean,optionTemplate:[Object,Function]},emits:[`update:modelValue`,`clearValidationErrors`],setup(n,{emit:r}){let i=n,a=r,o=u(`inputs`),s=(0,t.ref)(null),c=(0,t.ref)(``),l=(0,t.ref)(!1),d=(0,t.ref)(!1),f=(0,t.ref)(-1),p=(0,t.ref)([]),m=(0,t.ref)([]),h=(0,t.computed)(()=>{let e=z(i.options??p.value),t=new Set(m.value.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));if(i.options&&c.value){let e=c.value.toLowerCase();n=n.filter(t=>t.label.toLowerCase().includes(e))}return n}),g=null,_=()=>{i.url&&(clearTimeout(g),g=setTimeout(()=>{d.value=!0,e.shApis.doGet(i.url,{all:1,filter_value:c.value}).then(e=>{p.value=Array.isArray(e.data)?e.data:e.data?.data??[]}).finally(()=>{d.value=!1})},300))},v=()=>{i.multiple?a(`update:modelValue`,m.value.map(e=>e.id)):a(`update:modelValue`,m.value[0]?.id??null)},y=e=>{i.multiple?m.value.push(e):(m.value=[e],l.value=!1),c.value=``,f.value=-1,v()},b=e=>{m.value=m.value.filter(t=>t.id!==e.id),v()},x=()=>{!i.allowCustom||!c.value||y({id:c.value,label:c.value})},S=()=>{l.value=!0,a(`clearValidationErrors`),i.url&&_()},C=e=>{e.key===`ArrowDown`?(e.preventDefault(),l.value=!0,f.value=Math.min(f.value+1,h.value.length-1)):e.key===`ArrowUp`?(e.preventDefault(),f.value=Math.max(f.value-1,0)):e.key===`Enter`?(e.preventDefault(),f.value>=0&&h.value[f.value]?y(h.value[f.value]):x()):e.key===`Escape`?l.value=!1:e.key===`Backspace`&&!c.value&&m.value.length&&b(m.value[m.value.length-1])},w=()=>{let e=i.modelValue;if(e==null||e===``)return;let t=Array.isArray(e)?e:[e],n=z(i.options??p.value);m.value=t.map(e=>n.find(t=>t.id===e)??{id:e,label:String(e)})},T=e=>{s.value&&!s.value.contains(e.target)&&(l.value=!1)};return(0,t.watch)(()=>i.options,w),(0,t.onMounted)(()=>{document.addEventListener(`pointerdown`,T),w(),i.url&&!i.options&&_()}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`pointerdown`,T),clearTimeout(g)}),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`root`,ref:s,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.wrapper)},[n.multiple&&m.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.badges)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(m.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.badge)},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).suggest.badgeRemove),onClick:t=>b(e)},`×`,10,K)],2))),128))],2)):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`input`,(0,t.mergeProps)(e.$attrs,{"onUpdate:modelValue":r[0]||=e=>c.value=e,type:`text`,placeholder:!n.multiple&&m.value.length?m.value[0].label:n.placeholder,disabled:n.disabled,autocomplete:`off`,onInput:S,onKeydown:C,onFocus:r[1]||=e=>{l.value=!0,a(`clearValidationErrors`)}}),null,16,oe),[[t.vModelText,c.value]]),l.value&&!n.disabled?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.dropdown)},[d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.empty)},`Searching...`,2)):h.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(h.value,(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:(0,t.normalizeClass)(r===f.value?(0,t.unref)(o).suggest.optionActive:(0,t.unref)(o).suggest.option),onPointerdown:(0,t.withModifiers)(t=>y(e),[`prevent`]),onMouseenter:e=>f.value=r},[n.optionTemplate?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.optionTemplate),{key:0,option:e.raw??e},null,8,[`option`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label),1)],64))],42,se))),128)):n.allowCustom&&c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.option),onPointerdown:(0,t.withModifiers)(x,[`prevent`])},` Use "`+(0,t.toDisplayString)(c.value)+`" `,35)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.empty)},`No matches`,2))],2)):(0,t.createCommentVNode)(``,!0)],2))}}),ce=[`onUpdate:modelValue`],le=[`innerHTML`],ue=[`disabled`],de={__name:`ShForm`,props:{action:{type:String,required:!0},method:{type:String,default:`post`},fields:{type:Array,required:!0},currentData:Object,steps:Array,submitLabel:{type:String,default:`Submit`},successMessage:String,retainData:Boolean,preSubmit:Function,hiddenId:{type:Boolean,default:!0},classes:Object,disabled:Boolean},emits:[`success`,`error`,`fieldChanged`,`preSubmit`,`formSubmitted`,`formError`],setup(n,{emit:r}){let o=n,s=r,c=u(`form`,(0,t.computed)(()=>o.classes)),l=u(`inputs`),d=(0,t.inject)(i,{}),f=(0,t.inject)(a,null),p={text:O,textarea:A,email:M,password:F,number:I,date:R,select:V,phone:G,suggest:q},m=(0,t.ref)([]),h=(0,t.reactive)({}),g=(0,t.ref)(!1),_=(0,t.ref)(0),v=(0,t.ref)(!1),y=()=>{let e=b(o.fields,o.currentData);o.hiddenId&&o.currentData?.id&&!e.some(e=>e.name===`id`)&&e.push({name:`id`,type:`hidden`,value:o.currentData.id}),m.value=e};y(),(0,t.watch)(()=>o.currentData,()=>{v.value||y()},{deep:!0}),(0,t.watch)(()=>o.fields,y);let x=(0,t.computed)(()=>o.steps?.length?o.steps.map(e=>({title:e.title??``,fields:m.value.filter(t=>(e.fields??[]).includes(t.name)||t.type===`hidden`)})):[{title:``,fields:m.value}]),C=(0,t.computed)(()=>_.value>=x.value.length-1),w=e=>e.component??d[e.type]??p[e.type]??p.text,T=e=>h[e.name]?c.value.inputInvalid:e.type===`select`?l.value.select:c.value.input,E=e=>({placeholder:e.placeholder||void 0,disabled:o.disabled||e.disabled,...e.type===`select`||e.type===`suggest`?{options:Array.isArray(e.options)?e.options:void 0,url:Array.isArray(e.options)?void 0:e.options?.url,multiple:e.multiple,allowCustom:e.allowCustom,optionTemplate:e.optionTemplate}:{},...e.type===`number`?{min:e.min,max:e.max,step:e.step}:{},...e.type===`textarea`?{rows:e.rows}:{},...e.type===`date`?{withTime:e.withTime,min:e.min,max:e.max}:{},...e.type===`phone`?{countryCode:e.countryCode,detectCountry:e.detectCountry}:{},...e.props??{}}),ee=(e,t)=>{v.value=!0,delete h[e.name];let n=k();s(`fieldChanged`,e.name,t,n)},k=()=>{let e={};return m.value.forEach(t=>{t.value!==null&&t.value!==void 0&&(e[t.name]=t.value)}),e},j=()=>{m.value.forEach(e=>{e.type!==`hidden`&&(e.value=null)}),v.value=!1},te=()=>{let e=Object.keys(h);if(!e.length||!o.steps?.length)return;let t=x.value.findIndex(t=>t.fields.some(t=>e.includes(t.name)));t>=0&&(_.value=t)},N=async()=>{if(!C.value){_.value++;return}Object.keys(h).forEach(e=>delete h[e]);let t=k();if(o.preSubmit){let e=await o.preSubmit(t);if(e===!1)return;e&&typeof e==`object`&&(t=e)}s(`preSubmit`,t);let n={post:e.shApis.doPost,put:e.shApis.doPut,patch:e.shApis.doPatch,delete:e.shApis.doDelete}[o.method.toLowerCase()]??e.shApis.doPost;g.value=!0;try{let r=await n(o.action,t);o.successMessage&&e.shRepo.showToast(o.successMessage),s(`success`,r.data),s(`formSubmitted`,r.data),o.retainData||(j(),_.value=0),f?.requestClose?.(`success`)}catch(t){if(t.response?.status===422){let e=t.response.data?.errors??{};Object.keys(e).forEach(t=>{let n=e[t];h[t]=Array.isArray(n)?n[0]:n}),te()}else e.shRepo.showToast(t.response?.data?.message??t.message??`Request failed`,`error`);s(`error`,t),s(`formError`,t)}finally{g.value=!1}};return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`form`,{class:(0,t.normalizeClass)((0,t.unref)(c).form),onSubmit:(0,t.withModifiers)(N,[`prevent`])},[x.value.length>1?((0,t.openBlock)(),(0,t.createBlock)(S,{key:0,steps:x.value,current:_.value},null,8,[`steps`,`current`])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(x.value,(e,n)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`space-y-4`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fields,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.name,class:(0,t.normalizeClass)(e.type===`hidden`?``:(0,t.unref)(c).group)},[e.type===`hidden`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,"onUpdate:modelValue":t=>e.value=t,type:`hidden`},null,8,ce)),[[t.vModelText,e.value]]):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(c).label)},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),e.required?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(c).required)},`*`,2)):(0,t.createCommentVNode)(``,!0)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(w(e)),(0,t.mergeProps)({modelValue:e.value,"onUpdate:modelValue":t=>e.value=t},{ref_for:!0},E(e),{"is-invalid":!!h[e.name],class:[T(e),e.class],"onUpdate:modelValue":t=>ee(e,t),onClearValidationErrors:t=>delete h[e.name]}),null,16,[`modelValue`,`onUpdate:modelValue`,`is-invalid`,`class`,`onClearValidationErrors`])),e.helper?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(c).helper),innerHTML:e.helper},null,10,le)):(0,t.createCommentVNode)(``,!0),h[e.name]?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:2,class:(0,t.normalizeClass)((0,t.unref)(c).error)},(0,t.toDisplayString)(h[e.name]),3)):(0,t.createCommentVNode)(``,!0)],64))],2))),128))],512)),[[t.vShow,_.value===n]])),128)),(0,t.renderSlot)(e.$slots,`default`),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(c).nav)},[_.value>0?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(c).prevBtn),onClick:r[0]||=e=>_.value--},` Back `,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`submit`,class:(0,t.normalizeClass)(C.value?(0,t.unref)(c).submitBtn:(0,t.unref)(c).nextBtn),disabled:g.value||n.disabled},[g.value?((0,t.openBlock)(),(0,t.createBlock)(D,{key:0,class:`size-4`})):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(C.value?n.submitLabel:`Next`),1)],10,ue)],2)],34))}},fe={__name:`ShDialog`,props:{open:Boolean,title:String,size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,retainOnSuccess:Boolean,classes:Object},emits:[`update:open`,`opened`,`closed`],setup(e,{expose:n,emit:r}){let i=e,o=r,s=u(`dialog`,(0,t.computed)(()=>i.classes)),c=(0,t.ref)(null),l=(0,t.ref)(!1),d=(0,t.ref)(!1),f=(0,t.ref)(!1),p=g({isStatic:()=>i.static,onClose:()=>o(`update:open`,!1)}),m=()=>{l.value=!0,p.show(),requestAnimationFrame(()=>{d.value=!0}),i.open||o(`update:open`,!0)},h=e=>{d.value=!1,p.close(e)},_=()=>{if(i.static){f.value=!0,setTimeout(()=>{f.value=!1},150);return}h(`backdrop`)};return(0,t.watch)(()=>i.open,e=>{e?m():d.value&&h(`prop`)},{immediate:!0}),(0,t.watch)(p.isOpen,e=>{!e&&d.value&&(d.value=!1)}),(0,t.provide)(a,{close:()=>h(`context`),requestClose:e=>{if(e===`success`){if(i.retainOnSuccess)return;setTimeout(()=>h(`success`),600);return}h(e)}}),n({show:m,close:h}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`fixed inset-0`,style:(0,t.normalizeStyle)({zIndex:(0,t.unref)(p).zIndex.value})},[(0,t.createVNode)(t.Transition,{"enter-active-class":`transition-opacity duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition-opacity duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).backdrop),onClick:_},null,2),[[t.vShow,d.value]])]),_:1}),(0,t.createVNode)(t.Transition,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0 scale-95 translate-y-2`,"enter-to-class":`opacity-100 scale-100 translate-y-0`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100 scale-100`,"leave-to-class":`opacity-0 scale-95`,onAfterEnter:r[1]||=e=>{c.value?.focus(),o(`opened`)},onAfterLeave:r[2]||=e=>{l.value=!1,o(`closed`)}},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).wrapper),onClick:(0,t.withModifiers)(_,[`self`])},[(0,t.createElementVNode)(`div`,{ref_key:`panel`,ref:c,tabindex:`-1`,role:`dialog`,"aria-modal":`true`,class:(0,t.normalizeClass)([(0,t.unref)(s).panel,(0,t.unref)(s).sizes[e.size]??(0,t.unref)(s).sizes.md,f.value?`scale-[1.02] transition-transform duration-150`:``])},[e.title||n.$slots.title||!e.hideClose?((0,t.openBlock)(),(0,t.createElementBlock)(`header`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).header)},[(0,t.renderSlot)(n.$slots,`title`,{},()=>[(0,t.createElementVNode)(`h3`,{class:(0,t.normalizeClass)((0,t.unref)(s).title)},(0,t.toDisplayString)(e.title),3)]),e.hideClose?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(s).closeBtn),"aria-label":`Close`,onClick:r[0]||=e=>h(`button`)},[...r[3]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`size-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18L18 6M6 6l12 12`})],-1)]],2))],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).body)},[(0,t.renderSlot)(n.$slots,`default`,{close:h})],2),n.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`footer`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).footer)},[(0,t.renderSlot)(n.$slots,`footer`,{close:h})],2)):(0,t.createCommentVNode)(``,!0)],2)],2),[[t.vShow,d.value]])]),_:3})],4)):(0,t.createCommentVNode)(``,!0)]))}},pe={__name:`ShDrawer`,props:{open:Boolean,title:String,position:{type:String,default:`end`},size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,classes:Object},emits:[`update:open`,`opened`,`closed`],setup(e,{expose:n,emit:r}){let i=e,o=r,s=u(`drawer`,(0,t.computed)(()=>i.classes)),c=(0,t.ref)(null),l=(0,t.ref)(!1),d=(0,t.ref)(!1),f={start:{panel:`inset-y-0 left-0 h-full w-full`,hidden:`-translate-x-full`},end:{panel:`inset-y-0 right-0 h-full w-full`,hidden:`translate-x-full`},top:{panel:`inset-x-0 top-0 w-full`,hidden:`-translate-y-full`},bottom:{panel:`inset-x-0 bottom-0 w-full`,hidden:`translate-y-full`}},p=(0,t.computed)(()=>f[i.position]??f.end),m=(0,t.computed)(()=>[`top`,`bottom`].includes(i.position)),h=(0,t.computed)(()=>m.value?s.value.sizesVertical[i.size]??s.value.sizesVertical.md:s.value.sizes[i.size]??s.value.sizes.md),_=g({isStatic:()=>i.static,onClose:()=>o(`update:open`,!1)}),v=()=>{l.value=!0,_.show(),requestAnimationFrame(()=>{d.value=!0}),i.open||o(`update:open`,!0)},y=e=>{d.value=!1,_.close(e)};return(0,t.watch)(()=>i.open,e=>{e?v():d.value&&y(`prop`)},{immediate:!0}),(0,t.watch)(_.isOpen,e=>{!e&&d.value&&(d.value=!1)}),(0,t.provide)(a,{close:()=>y(`context`),requestClose:e=>y(e)}),n({show:v,close:y}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`fixed inset-0`,style:(0,t.normalizeStyle)({zIndex:(0,t.unref)(_).zIndex.value})},[(0,t.createVNode)(t.Transition,{"enter-active-class":`transition-opacity duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition-opacity duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).backdrop),onClick:r[0]||=(...e)=>(0,t.unref)(_).onBackdrop&&(0,t.unref)(_).onBackdrop(...e)},null,2),[[t.vShow,d.value]])]),_:1}),(0,t.createVNode)(t.Transition,{"enter-active-class":`transition-transform duration-250 ease-out`,"enter-from-class":p.value.hidden,"enter-to-class":`translate-x-0 translate-y-0`,"leave-active-class":`transition-transform duration-200 ease-in`,"leave-from-class":`translate-x-0 translate-y-0`,"leave-to-class":p.value.hidden,onAfterEnter:r[2]||=e=>{c.value?.focus(),o(`opened`)},onAfterLeave:r[3]||=e=>{l.value=!1,o(`closed`)}},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{ref_key:`panel`,ref:c,tabindex:`-1`,role:`dialog`,"aria-modal":`true`,class:(0,t.normalizeClass)([(0,t.unref)(s).panel,p.value.panel,h.value])},[e.title||n.$slots.title||!e.hideClose?((0,t.openBlock)(),(0,t.createElementBlock)(`header`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).header)},[(0,t.renderSlot)(n.$slots,`title`,{},()=>[(0,t.createElementVNode)(`h3`,{class:(0,t.normalizeClass)((0,t.unref)(s).title)},(0,t.toDisplayString)(e.title),3)]),e.hideClose?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(s).closeBtn),"aria-label":`Close`,onClick:r[1]||=e=>y(`button`)},[...r[4]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`size-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18L18 6M6 6l12 12`})],-1)]],2))],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).body)},[(0,t.renderSlot)(n.$slots,`default`,{close:y})],2)],2),[[t.vShow,d.value]])]),_:3},8,[`enter-from-class`,`leave-to-class`])],4)):(0,t.createCommentVNode)(``,!0)]))}},me={__name:`ShDialogBtn`,props:{title:String,size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,btnClass:String,classes:Object},emits:[`opened`,`closed`],setup(e){let n=u(`buttons`),r=(0,t.ref)(!1);return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.btnClass??(0,t.unref)(n).secondary),onClick:a[0]||=e=>r.value=!0},[(0,t.renderSlot)(i.$slots,`trigger`,{},()=>[a[4]||=(0,t.createTextVNode)(`Open`,-1)])],2),(0,t.createVNode)(fe,{open:r.value,"onUpdate:open":a[1]||=e=>r.value=e,title:e.title,size:e.size,static:e.static,"hide-close":e.hideClose,classes:e.classes,onOpened:a[2]||=e=>i.$emit(`opened`),onClosed:a[3]||=e=>i.$emit(`closed`)},(0,t.createSlots)({default:(0,t.withCtx)(({close:e})=>[(0,t.renderSlot)(i.$slots,`default`,{close:e})]),_:2},[i.$slots.footer?{name:`footer`,fn:(0,t.withCtx)(({close:e})=>[(0,t.renderSlot)(i.$slots,`footer`,{close:e})]),key:`0`}:void 0]),1032,[`open`,`title`,`size`,`static`,`hide-close`,`classes`])],64))}},he={__name:`ShDrawerBtn`,props:{title:String,position:{type:String,default:`end`},size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,btnClass:String,classes:Object},emits:[`opened`,`closed`],setup(e){let n=u(`buttons`),r=(0,t.ref)(!1);return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.btnClass??(0,t.unref)(n).secondary),onClick:a[0]||=e=>r.value=!0},[(0,t.renderSlot)(i.$slots,`trigger`,{},()=>[a[4]||=(0,t.createTextVNode)(`Open`,-1)])],2),(0,t.createVNode)(pe,{open:r.value,"onUpdate:open":a[1]||=e=>r.value=e,title:e.title,position:e.position,size:e.size,static:e.static,"hide-close":e.hideClose,classes:e.classes,onOpened:a[2]||=e=>i.$emit(`opened`),onClosed:a[3]||=e=>i.$emit(`closed`)},{default:(0,t.withCtx)(({close:e})=>[(0,t.renderSlot)(i.$slots,`default`,{close:e})]),_:3},8,[`open`,`title`,`position`,`size`,`static`,`hide-close`,`classes`])],64))}},ge={__name:`ShDialogForm`,props:{title:String,size:{type:String,default:`md`},static:Boolean,retainDialog:Boolean,btnClass:String,dialogClasses:Object,action:{type:String,required:!0},method:{type:String,default:`post`},fields:{type:Array,required:!0},currentData:Object,steps:Array,submitLabel:{type:String,default:`Submit`},successMessage:String,retainData:Boolean,preSubmit:Function,hiddenId:{type:Boolean,default:!0},classes:Object},emits:[`success`,`error`,`fieldChanged`,`opened`,`closed`],setup(e,{expose:n,emit:r}){let i=e,a=r,o=u(`buttons`),s=(0,t.ref)(!1),c=(0,t.computed)(()=>JSON.stringify(i.currentData??{})),l=e=>{a(`success`,e)};return n({show:()=>{s.value=!0},close:()=>{s.value=!1}}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.btnClass??(0,t.unref)(o).primary),onClick:r[0]||=e=>s.value=!0},[(0,t.renderSlot)(n.$slots,`trigger`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.title??`Open form`),1)])],2),(0,t.createVNode)(fe,{open:s.value,"onUpdate:open":r[3]||=e=>s.value=e,title:e.title,size:e.size,static:e.static,"retain-on-success":e.retainDialog,classes:e.dialogClasses,onOpened:r[4]||=e=>n.$emit(`opened`),onClosed:r[5]||=e=>n.$emit(`closed`)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)(de,{key:c.value,action:e.action,method:e.method,fields:e.fields,"current-data":e.currentData,steps:e.steps,"submit-label":e.submitLabel,"success-message":e.successMessage,"retain-data":e.retainData,"pre-submit":e.preSubmit,"hidden-id":e.hiddenId,classes:e.classes,onSuccess:l,onError:r[1]||=e=>n.$emit(`error`,e),onFieldChanged:r[2]||=(e,t,r)=>n.$emit(`fieldChanged`,e,t,r)},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},8,[`action`,`method`,`fields`,`current-data`,`steps`,`submit-label`,`success-message`,`retain-data`,`pre-submit`,`hidden-id`,`classes`]))]),_:3},8,[`open`,`title`,`size`,`static`,`retain-on-success`,`classes`])],64))}},_e=`sh_tw_table_cache`,J=`pages`,Y=`rows`,ve=1,ye=3e3,be=null;function xe(){return be||(be=new Promise((e,t)=>{let n=indexedDB.open(_e,ve);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(J)||t.createObjectStore(J),t.objectStoreNames.contains(Y)||t.createObjectStore(Y)},n.onsuccess=t=>e(t.target.result),n.onerror=e=>t(e.target.error)}),be)}function X(){try{let t=e.shStorage.getItem(`user`);return t?.id?`u${t.id}_`:``}catch{return``}}function Z(e,t,n){return xe().then(r=>new Promise((i,a)=>{let o=n(r.transaction(e,t).objectStore(e));o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)})).catch(e=>{console.error(`[sh-tailwind] table cache error`,e)})}async function Se(e){return(await Z(J,`readonly`,t=>t.get(X()+e)))?.response??null}function Ce(e,t){return Z(J,`readwrite`,n=>n.put({response:t,timestamp:Date.now()},X()+e))}async function we(e){return(await Z(Y,`readonly`,t=>t.get(X()+e)))?.rows??[]}async function Te(e,t){if(!Array.isArray(t)||!t.length)return;let n=await we(e),r=new Map;n.forEach(e=>{e&&e.id!==void 0&&r.set(e.id,e)}),t.forEach(e=>{e&&e.id!==void 0&&r.set(e.id,e)});let i=[...r.values()];return i.length>ye&&(i=i.slice(i.length-ye)),Z(Y,`readwrite`,t=>t.put({rows:i,timestamp:Date.now()},X()+e))}async function Ee(){await Z(J,`readwrite`,e=>e.clear()),await Z(Y,`readwrite`,e=>e.clear())}var Q={getPage:Se,setPage:Ce,getRows:we,mergeRows:Te,clear:Ee};function $(e,t){return!e||!t||typeof t!=`string`?``:t.split(`.`).reduce((e,t)=>e?e[t]:``,e)}function De(e,t,n,r=0){if(e==null)return!1;if(typeof e==`object`)return r>2?!1:Object.values(e).some(e=>De(e,t,n,r+1));let i=String(e).toLowerCase();return n?i===t:i.includes(t)}function Oe(e,{search:t,exact:n,orderBy:r,orderMethod:i,page:a,perPage:o}={}){let s=e;if(t){let r=String(t).toLowerCase();s=e.filter(e=>De(e,r,!!n))}if(r){let e=i===`asc`?1:-1;s=[...s].sort((t,n)=>{let i=$(t,r),a=$(n,r);return typeof i==`number`&&typeof a==`number`?(i-a)*e:String(i??``).localeCompare(String(a??``),void 0,{numeric:!0})*e})}let c=s.length,l=Math.max(1,Number(o)||10),u=Math.max(1,Math.ceil(c/l)),d=Math.min(Math.max(1,Number(a)||1),u),f=(d-1)*l;return{data:s.slice(f,f+l),total:c,per_page:l,current_page:d,last_page:u,from:c===0?0:f+1}}function ke({query:n,cacheEnabled:r=()=>!1,networkTimeout:i=()=>1e4}){let a=(0,t.ref)([]),o=(0,t.ref)(null),s=(0,t.ref)(`loading`),c=(0,t.ref)(``),l=(0,t.ref)(!1),u=(0,t.ref)(!1),d=0,f=(e,t)=>e+`|`+JSON.stringify(t),p=(e,{append:t=!1}={})=>{t?a.value.push(...e.data??[]):a.value=e.data??[],o.value={total:e.total??a.value.length,per_page:e.per_page,current_page:e.current_page??1,last_page:e.last_page??1,from:e.from??1},s.value=`done`};return{records:a,meta:o,status:s,error:c,offline:l,fromCache:u,load:async({append:t=!1}={})=>{let o=++d,{endpoint:m,params:h}=n(),g=f(m,h),_=!!r(),v=!1;if(a.value.length||(s.value=`loading`),_&&!t){let e=await Q.getPage(g);e&&o===d&&(p(e),u.value=!0,v=!0)}try{let n=await e.shApis.doGet(m,h,{timeout:i()});if(o!==d)return;let r=n.data?.data??n.data;return p(r,{append:t}),l.value=!1,u.value=!1,c.value=``,_&&(Q.setPage(g,r),Q.mergeRows(m,r.data)),r}catch(e){if(o!==d)return;if(e.response){v||(s.value=`error`,c.value=`${e.response.status}: ${e.response.statusText} (${m})`);return}if(l.value=!0,v)return;if(_){let e=await Q.getRows(m);if(o!==d)return;if(e.length){p(Oe(e,{search:h.filter_value,exact:h.exact,orderBy:h.order_by,orderMethod:h.order_method,page:h.page,perPage:h.per_page}),{append:!1}),u.value=!0;return}}s.value=`error`,c.value=`You appear to be offline and there is no cached data yet`}}}}var Ae=[`value`],je=[`value`],Me=[`disabled`],Ne=[`disabled`],Pe=[`onClick`],Fe=[`disabled`],Ie={__name:`ShTablePagination`,props:{meta:{type:Object,required:!0},perPage:Number,mode:{type:String,default:`pages`},loading:Boolean,theme:{type:Object,required:!0}},emits:[`page`,`perPage`,`loadMore`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>Math.min(r.meta.current_page*r.meta.per_page,r.meta.total)),o=(0,t.computed)(()=>{let e=r.meta.last_page,t=r.meta.current_page;if(e<=7)return Array.from({length:e},(e,t)=>t+1);let n=[1];t>3&&n.push(`...`);for(let r=Math.max(2,t-1);r<=Math.min(e-1,t+1);r++)n.push(r);return t<e-2&&n.push(`...`),n.push(e),n});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)(e.theme.wrapper)},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)(e.theme.info)},[(0,t.createTextVNode)(` Showing `+(0,t.toDisplayString)(a.value)+` of `+(0,t.toDisplayString)(e.meta.total)+` `,1),(0,t.createElementVNode)(`select`,{value:e.perPage,class:(0,t.normalizeClass)([e.theme.perPage,`ml-2`]),onChange:r[0]||=e=>i(`perPage`,Number(e.target.value))},[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([10,20,30,50,100],e=>(0,t.createElementVNode)(`option`,{key:e,value:e},(0,t.toDisplayString)(e)+` / page`,9,je)),64))],42,Ae)],2),e.mode===`loadMore`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)(e.theme.loadMore),disabled:e.loading||e.meta.current_page>=e.meta.last_page,onClick:r[1]||=e=>i(`loadMore`)},(0,t.toDisplayString)(e.meta.current_page>=e.meta.last_page?`All loaded`:`Load more`),11,Me)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)(e.theme.pages)},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.theme.pageBtn),disabled:e.meta.current_page<=1,"aria-label":`Previous page`,onClick:r[2]||=t=>i(`page`,e.meta.current_page-1)},` ‹ `,10,Ne),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:r},[n===`...`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)(e.theme.ellipsis)},`…`,2)):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:(0,t.normalizeClass)(n===e.meta.current_page?e.theme.pageBtnActive:e.theme.pageBtn),onClick:e=>i(`page`,n)},(0,t.toDisplayString)(n),11,Pe))],64))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.theme.pageBtn),disabled:e.meta.current_page>=e.meta.last_page,"aria-label":`Next page`,onClick:r[3]||=t=>i(`page`,e.meta.current_page+1)},` › `,10,Fe)],2))],2))}},Le={key:0,class:`flex w-full items-center gap-3 md:w-auto`},Re=[`placeholder`],ze=[`checked`],Be=[`onClick`],Ve={key:0},He={key:0},Ue=[`colspan`],We=[`onClick`],Ge=[`checked`,`onChange`],Ke=[`innerHTML`],qe=[`onClick`],Je=[`onClick`],Ye=[`checked`,`onChange`],Xe=[`innerHTML`],Ze=[`onClick`],Qe={class:`text-sm text-gray-700 dark:text-gray-200`},$e={class:`flex items-center gap-2`},et=[`onClick`],tt={__name:`ShTable`,props:{endpoint:{type:String,required:!0},columns:{type:Array,required:!0},actions:{type:Array,default:()=>[]},multiActions:{type:Array,default:()=>[]},searchable:{type:Boolean,default:!0},searchPlaceholder:{type:String,default:`Search`},hasRange:Boolean,perPage:Number,sortBy:String,sortMethod:{type:String,default:`desc`},paginationStyle:String,rowLink:String,cache:{type:Boolean,default:null},networkTimeout:{type:Number,default:1e4},reload:[Number,String,Boolean],emptyMessage:{type:String,default:`No records found`},classes:Object},emits:[`rowClick`,`loaded`,`action`],setup(n,{expose:r,emit:i}){let a=n,o=i,s=u(`table`,(0,t.computed)(()=>a.classes)),c=(0,e.useUserStore)(),l=(0,t.getCurrentInstance)()?.appContext.config.globalProperties.$router??null,d=e=>{l?l.push(e):window.location.href=e},f=(0,t.computed)(()=>a.columns.map(e=>{let t=typeof e==`string`?{name:e}:{...e};return t.label=t.label??_(t.name.split(`.`).pop()),t.sortable=t.sortable??!t.component,t}).filter(e=>e.show?e.show():!0)),p=()=>`sh_table_per_page_${typeof window<`u`?window.location.pathname:`server`}_${a.endpoint}`.replace(/[^a-z0-9]+/gi,`_`).toLowerCase(),m=()=>{let t=Number(e.shStorage.getItem(p()));return t>0?t:Number(a.perPage??(0,e.getShConfig)(`tablePerPage`,10))},h=(0,t.ref)(1),g=(0,t.ref)(m()),v=(0,t.ref)(``),y=(0,t.ref)(!1),b=(0,t.ref)(a.sortBy),x=(0,t.ref)(a.sortMethod),S=(0,t.ref)(null),C=(0,t.ref)(null),w=(0,t.ref)(``),T=(0,t.ref)(``),E=(0,t.computed)(()=>a.paginationStyle??(0,e.getShConfig)(`tablePaginationStyle`,`pages`)),ee=(0,t.computed)(()=>a.cache===null?!!(0,e.getShConfig)(`enableTableCache`,!1):a.cache),{records:O,meta:k,status:A,error:j,offline:M,fromCache:te,load:N}=ke({query:()=>{let e={order_by:b.value,order_method:x.value,per_page:g.value,page:h.value,filter_value:v.value,paginated:!0,from:S.value,to:C.value,exact:y.value||null};return Object.keys(e).forEach(t=>{(e[t]===null||e[t]===``||e[t]===void 0)&&delete e[t]}),{endpoint:a.endpoint,params:e}},cacheEnabled:()=>ee.value,networkTimeout:()=>a.networkTimeout}),P=async({append:e=!1}={})=>{let t=await N({append:e});t&&o(`loaded`,t)};P();let F=null,ne=()=>{clearTimeout(F),F=setTimeout(()=>{h.value=1,P()},500)};(0,t.onBeforeUnmount)(()=>clearTimeout(F));let I=e=>{if(!e)return null;let[t,n,r]=e.split(`-`);return`${n}/${r}/${t}`},L=()=>{S.value=I(w.value),C.value=I(T.value),h.value=1,P()},R=e=>{e.sortable&&(b.value===e.name?x.value=x.value===`desc`?`asc`:`desc`:(b.value=e.name,x.value=`desc`),P())},z=e=>{h.value=e,P()},re=t=>{g.value=t,h.value=1,e.shStorage.setItem(p(),t),P()},ie=()=>{h.value++,P({append:!0})};(0,t.watch)(()=>a.reload,()=>P()),(0,t.watch)(()=>a.endpoint,()=>{h.value=1,g.value=m(),P()});let B=(t,n)=>{let r=$(t,n.name);if(r==null||r===``)return``;switch(n.format){case`date`:return e.shRepo.formatDate(r,`ll`);case`datetime`:return e.shRepo.formatDate(r);case`number`:return e.shRepo.formatNumber(r);case`money`:return e.shRepo.formatNumber(r,2);default:return r}},V=e=>!e.permission||c.isAllowedTo(e.permission),H=e=>a.actions.filter(t=>V(t)&&(t.show?t.show(e):!0)),U=(0,t.computed)(()=>a.multiActions.filter(V)),W=(e,t)=>String(e).replace(/\{(.*?)\}/g,(e,n)=>$(t,n)),ae=async(t,n)=>{if(t.handler)return t.handler(n);if(t.emit){o(`action`,t.emit,n),o(t.emit,n);return}if(t.link)return d(W(t.link,n));if(t.url){let r=W(t.url,n);if(t.confirm){let n=await e.shRepo.runPlainRequest(r,t.confirm,t.label,t.data);n.isConfirmed&&n.value?.success?(e.shRepo.showToast(n.value.response?.message??`Action successful`),P()):n.isConfirmed&&e.shRepo.showToast(t.failMessage??`Action failed`,`error`);return}try{let n=await e.shApis.doPost(r,t.data);e.shRepo.showToast(n.data?.message??`Action successful`),P()}catch(t){e.shRepo.showToast(t.response?.data?.message??`Action failed`,`error`)}}},G=e=>{o(`rowClick`,e),a.rowLink&&d(W(a.rowLink,e))},K=(0,t.ref)([]),oe=(0,t.computed)(()=>O.value.length>0&&K.value.length===O.value.length),se=()=>{K.value=oe.value?[]:O.value.map(e=>e.id)},q=e=>{let t=K.value.indexOf(e);t>-1?K.value.splice(t,1):K.value.push(e)},ce=e=>{let t=O.value.filter(e=>K.value.includes(e.id));e.handler?.(t),K.value=[]},le=(0,t.computed)(()=>f.value.length+ +!!U.value.length+ +!!a.actions.length);return r({reload:()=>P(),records:O}),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).wrapper)},[n.searchable||n.hasRange?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).toolbar)},[n.searchable?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Le,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[0]||=e=>v.value=e,type:`search`,placeholder:n.searchPlaceholder,class:(0,t.normalizeClass)((0,t.unref)(s).search),onInput:ne},null,42,Re),[[t.vModelText,v.value]]),v.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).exactLabel)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[1]||=e=>y.value=e,type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),onChange:r[2]||=e=>P()},null,34),[[t.vModelCheckbox,y.value]]),r[10]||=(0,t.createTextVNode)(` Exact `,-1)],2)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),n.hasRange?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).rangeWrapper)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[3]||=e=>w.value=e,type:`date`,class:(0,t.normalizeClass)((0,t.unref)(s).rangeInput),onChange:L},null,34),[[t.vModelText,w.value]]),r[11]||=(0,t.createElementVNode)(`span`,{class:`text-xs text-gray-400`},`to`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[4]||=e=>T.value=e,type:`date`,class:(0,t.normalizeClass)((0,t.unref)(s).rangeInput),onChange:L},null,34),[[t.vModelText,T.value]])],2)):(0,t.createCommentVNode)(``,!0)],2)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(M)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).offline)},[...r[12]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M12 9v3.75m0 3.75h.008v.008H12v-.008zM3.34 17.25h17.32c1.16 0 1.88-1.25 1.3-2.25L13.3 4.5c-.58-1-2.02-1-2.6 0L2.04 15c-.58 1 .14 2.25 1.3 2.25z`})],-1),(0,t.createElementVNode)(`span`,null,`You appear to be offline — showing cached results. Search and pagination run on cached data.`,-1)]],2)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(A)===`error`&&!(0,t.unref)(O).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:(0,t.normalizeClass)((0,t.unref)(s).error)},(0,t.toDisplayString)((0,t.unref)(j)),3)):(0,t.unref)(A)===`loading`&&!(0,t.unref)(O).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:(0,t.normalizeClass)((0,t.unref)(s).loading)},[(0,t.createVNode)(D,{class:`size-6`})],2)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).container)},[(0,t.createElementVNode)(`table`,{class:(0,t.normalizeClass)((0,t.unref)(s).table)},[(0,t.createElementVNode)(`thead`,{class:(0,t.normalizeClass)((0,t.unref)(s).thead)},[(0,t.createElementVNode)(`tr`,null,[U.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:0,class:(0,t.normalizeClass)([(0,t.unref)(s).th,`w-10`])},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),checked:oe.value,onChange:se},null,42,ze)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.name,class:(0,t.normalizeClass)((0,t.unref)(s).th)},[e.sortable?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).sortBtn),onClick:t=>R(e)},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),b.value===e.name?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ve,(0,t.toDisplayString)(x.value===`desc`?`↓`:`↑`),1)):(0,t.createCommentVNode)(``,!0)],10,Be)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label),1)],64))],2))),128)),n.actions.length?((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:1,class:(0,t.normalizeClass)([(0,t.unref)(s).th,`text-right`])},`Actions`,2)):(0,t.createCommentVNode)(``,!0)])],2),(0,t.createElementVNode)(`tbody`,{class:(0,t.normalizeClass)((0,t.unref)(s).tbody)},[(0,t.unref)(O).length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,He,[(0,t.createElementVNode)(`td`,{colspan:le.value,class:(0,t.normalizeClass)((0,t.unref)(s).empty)},[(0,t.renderSlot)(e.$slots,`empty`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.emptyMessage),1)])],10,Ue)])),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(O),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:i.id??a,class:(0,t.normalizeClass)([(0,t.unref)(s).tr,n.rowLink?(0,t.unref)(s).trClickable:``]),onClick:e=>G(i)},[U.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).td),onClick:r[5]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),checked:K.value.includes(i.id),onChange:e=>q(i.id)},null,42,Ge)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:n.name,class:(0,t.normalizeClass)([(0,t.unref)(s).td,n.class])},[(0,t.renderSlot)(e.$slots,`cell-${n.name}`,{row:i,value:B(i,n),index:a},()=>[n.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.component),{key:0,row:i,value:(0,t.unref)($)(i,n.name)},null,8,[`row`,`value`])):n.format===`money`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).money)},(0,t.toDisplayString)(B(i,n)),3)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,innerHTML:B(i,n)},null,8,Ke))])],2))),128)),n.actions.length?((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).actionsCell),onClick:r[6]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.renderSlot)(e.$slots,`actions`,{row:i},()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(H(i),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:e.label,class:(0,t.normalizeClass)([(0,t.unref)(s).actionBtn,e.class]),onClick:t=>ae(e,i)},(0,t.toDisplayString)(e.label),11,qe))),128))])],2)):(0,t.createCommentVNode)(``,!0)],10,We))),128))],2)],2)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).cards)},[(0,t.unref)(O).length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).empty)},[(0,t.renderSlot)(e.$slots,`empty`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.emptyMessage),1)])],2)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(O),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i.id??a,class:(0,t.normalizeClass)([(0,t.unref)(s).card,n.rowLink?(0,t.unref)(s).trClickable:``]),onClick:e=>G(i)},[U.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)([(0,t.unref)(s).exactLabel,`mb-2`]),onClick:r[7]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),checked:K.value.includes(i.id),onChange:e=>q(i.id)},null,42,Ye),r[13]||=(0,t.createTextVNode)(` Select `,-1)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.name},[(0,t.createElementVNode)(`p`,{class:(0,t.normalizeClass)((0,t.unref)(s).cardLabel)},(0,t.toDisplayString)(n.label),3),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).cardValue)},[(0,t.renderSlot)(e.$slots,`cell-${n.name}`,{row:i,value:B(i,n),index:a},()=>[n.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.component),{key:0,row:i,value:(0,t.unref)($)(i,n.name)},null,8,[`row`,`value`])):n.format===`money`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).money)},(0,t.toDisplayString)(B(i,n)),3)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,innerHTML:B(i,n)},null,8,Xe))])],2)],64))),128)),n.actions.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`mt-2`,onClick:r[8]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.renderSlot)(e.$slots,`actions`,{row:i},()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(H(i),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:e.label,class:(0,t.normalizeClass)([(0,t.unref)(s).actionBtn,e.class]),onClick:t=>ae(e,i)},(0,t.toDisplayString)(e.label),11,Ze))),128))])])):(0,t.createCommentVNode)(``,!0)],10,Je))),128))],2),(0,t.unref)(k)&&(0,t.unref)(O).length?((0,t.openBlock)(),(0,t.createBlock)(Ie,{key:0,meta:(0,t.unref)(k),"per-page":g.value,mode:E.value,loading:(0,t.unref)(A)===`loading`,theme:(0,t.unref)(s).pagination,onPage:z,onPerPage:re,onLoadMore:ie},null,8,[`meta`,`per-page`,`mode`,`loading`,`theme`])):(0,t.createCommentVNode)(``,!0)],64)),K.value.length&&U.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:5,class:(0,t.normalizeClass)((0,t.unref)(s).multiBar)},[(0,t.createElementVNode)(`div`,Qe,[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(s).multiCount)},(0,t.toDisplayString)(K.value.length),3),r[14]||=(0,t.createTextVNode)(` selected `,-1)]),(0,t.createElementVNode)(`div`,$e,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(U.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.label,type:`button`,class:(0,t.normalizeClass)([(0,t.unref)(s).multiBtn,e.class]),onClick:t=>ce(e)},(0,t.toDisplayString)(e.label),11,et))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)((0,t.unref)(s).multiBtn),onClick:r[9]||=e=>K.value=[]},`Cancel`,2)])],2)):(0,t.createCommentVNode)(``,!0)],2))}},nt={__name:`ShConfirmAction`,props:{url:{type:String,required:!0},data:Object,title:String,message:String,loadingMessage:{type:String,default:`Processing...`},successMessage:{type:String,default:`Action Successful`},failMessage:{type:String,default:`Action failed`},tag:{type:String,default:`button`},btnClass:String},emits:[`success`,`failed`,`canceled`,`actionSuccessful`,`actionFailed`,`actionCanceled`],setup(n,{emit:r}){let i=n,a=r,o=u(`buttons`),s=(0,t.ref)(!1),c=t=>{s.value=!1,a(`actionSuccessful`,t),a(`success`,t),(i.successMessage||t?.message)&&e.shRepo.showToast(t?.message??i.successMessage)},l=t=>{s.value=!1,a(`actionFailed`,t),a(`failed`,t),(i.failMessage||t?.value?.message)&&e.shRepo.showToast(t?.value?.message??i.failMessage,`error`)};function d(){s.value=!0,e.shRepo.runPlainRequest(i.url,i.message,i.title,i.data).then(e=>{e.isConfirmed?e.value?.success?c(e.value.response):l(e):(s.value=!1,a(`actionCanceled`),a(`canceled`))}).catch(e=>{l(e)})}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.tag),{class:(0,t.normalizeClass)([n.btnClass??(0,t.unref)(o).link,s.value?`pointer-events-none opacity-60`:``]),onClick:d},{default:(0,t.withCtx)(()=>[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)(D,{class:`size-4`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(n.loadingMessage),1)],64)):(0,t.renderSlot)(e.$slots,`default`,{key:1})]),_:3},8,[`class`]))}},rt={__name:`ShSilentAction`,props:{url:{type:String,required:!0},data:Object,method:{type:String,default:`POST`},loadingMessage:{type:String,default:`Processing`},successMessage:{type:String,default:`Action Successful`},failMessage:{type:String,default:`Action failed`},disableSuccessMessage:Boolean,tag:{type:String,default:`button`},btnClass:String},emits:[`success`,`failed`,`actionSuccessful`,`actionFailed`],setup(n,{emit:r}){let i=n,a=r,o=u(`buttons`),s=(0,t.ref)(!1),c={GET:e.shApis.doGet,POST:e.shApis.doPost,PUT:e.shApis.doPut,DELETE:e.shApis.doDelete};function l(){s.value=!0,(c[i.method.toUpperCase()]??e.shApis.doPost)(i.url,i.data).then(t=>{s.value=!1,a(`actionSuccessful`,t),a(`success`,t),i.disableSuccessMessage||e.shRepo.showToast(t.data?.message??i.successMessage)}).catch(t=>{s.value=!1,a(`actionFailed`,t),a(`failed`,t),e.shRepo.showToast(t?.message??i.failMessage,`error`)})}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.tag),{class:(0,t.normalizeClass)([n.btnClass??(0,t.unref)(o).link,s.value?`pointer-events-none opacity-60`:``]),onClick:l},{default:(0,t.withCtx)(()=>[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)(D,{class:`size-4`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(n.loadingMessage),1)],64)):(0,t.renderSlot)(e.$slots,`default`,{key:1})]),_:3},8,[`class`]))}};exports.DateInput=R,exports.EmailInput=M,exports.NumberInput=I,exports.PasswordInput=F,exports.PhoneInput=G,exports.SH_DIALOG_CONTEXT=a,exports.SH_TW_COMPONENTS=i,exports.SH_TW_THEME=r,exports.SelectInput=V,exports.ShConfirmAction=nt,exports.ShDialog=fe,exports.ShDialogBtn=me,exports.ShDialogForm=ge,exports.ShDrawer=pe,exports.ShDrawerBtn=he,exports.ShForm=de,exports.ShFormSteps=S,exports.ShSilentAction=rt,exports.ShSpinner=D,exports.ShSuggest=q,exports.ShTable=tt,exports.ShTablePagination=Ie,exports.ShTailwind=c,exports.TextAreaInput=A,exports.TextInput=O,exports.clearTableCache=Ee,exports.countries=H,exports.createShTailwind=l,exports.defaultTheme=n,exports.localQuery=Oe,exports.shTableCache=Q,exports.useDialog=g,exports.useTableData=ke,exports.useTheme=u;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@iankibetsh/sh-core"),t=require("vue");var n={form:{form:`space-y-4`,group:`space-y-1`,label:`block text-sm font-medium text-gray-700`,required:`text-red-500`,input:`block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 disabled:cursor-not-allowed disabled:opacity-50`,inputInvalid:`block w-full rounded-md border border-red-500 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-red-500 focus:outline-none focus:ring-2 focus:ring-red-500/30`,helper:`text-xs text-gray-500`,error:`text-xs text-red-600`,errorTitle:`rounded-md bg-red-50 px-4 py-3 text-sm text-red-700`,nav:`flex items-center justify-end gap-3 pt-2`,submitBtn:`inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-60`,prevBtn:`inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-300`,nextBtn:`inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40`,steps:{wrapper:`mb-6 flex items-start`,step:`relative flex flex-1 flex-col items-center gap-1`,circle:`z-10 flex size-9 items-center justify-center rounded-full border-2 border-gray-300 bg-white text-sm font-semibold text-gray-500`,circleActive:`z-10 flex size-9 items-center justify-center rounded-full border-2 border-blue-600 bg-blue-600 text-sm font-semibold text-white`,circleDone:`z-10 flex size-9 items-center justify-center rounded-full border-2 border-emerald-500 bg-emerald-500 text-sm font-semibold text-white`,title:`text-xs text-gray-600`,titleActive:`text-xs font-semibold text-blue-600`,connector:`absolute top-4 right-1/2 -z-0 h-0.5 w-full bg-gray-200`,connectorDone:`absolute top-4 right-1/2 -z-0 h-0.5 w-full bg-emerald-500`}},inputs:{select:`block w-full appearance-none rounded-md border border-gray-300 bg-white px-3 py-2 pr-8 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 disabled:opacity-50`,passwordWrapper:`relative`,passwordToggle:`absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600`,pin:{wrapper:`flex items-center gap-2`,box:`size-11 rounded-md border border-gray-300 bg-white text-center text-lg font-semibold text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 disabled:cursor-not-allowed disabled:opacity-50`,boxFilled:`size-11 rounded-md border border-blue-400 bg-blue-50 text-center text-lg font-semibold text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30`,boxInvalid:`size-11 rounded-md border border-red-500 bg-white text-center text-lg font-semibold text-gray-900 shadow-sm focus:border-red-500 focus:outline-none focus:ring-2 focus:ring-red-500/30`},suggest:{wrapper:`relative`,badges:`mb-1 flex flex-wrap gap-1`,badge:`inline-flex items-center gap-1 rounded-full bg-gray-200 px-2 py-0.5 text-xs text-gray-700`,badgeRemove:`cursor-pointer text-gray-500 hover:text-red-600`,dropdown:`absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md border border-gray-200 bg-white py-1 shadow-lg`,option:`cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100`,optionActive:`cursor-pointer bg-blue-50 px-3 py-2 text-sm text-blue-700`,empty:`px-3 py-2 text-sm text-gray-400`},phone:{wrapper:`relative flex items-stretch rounded-md border border-gray-300 bg-white shadow-sm focus-within:border-blue-500 focus-within:ring-2 focus-within:ring-blue-500/30`,trigger:`flex shrink-0 cursor-pointer items-center gap-1.5 rounded-l-md border-r border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:outline-none`,flag:`text-base leading-none`,dial:`text-sm font-medium text-gray-600`,chevron:`size-3.5 text-gray-400`,input:`block w-full rounded-r-md border-0 bg-transparent px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-0`,dropdown:`absolute left-0 top-full z-20 mt-1 w-72 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-lg`,search:`block w-full border-0 border-b border-gray-100 bg-transparent px-3 py-2.5 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-0`,list:`max-h-60 overflow-y-auto py-1`,option:`flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100`,optionActive:`flex w-full cursor-pointer items-center gap-2.5 bg-blue-50 px-3 py-2 text-left text-sm text-blue-700`,optionName:`flex-1 truncate`,optionDial:`text-xs text-gray-400`,empty:`px-3 py-3 text-center text-sm text-gray-400`}},dialog:{backdrop:`fixed inset-0 bg-black/50`,wrapper:`fixed inset-0 flex items-center justify-center overflow-y-auto p-4`,panel:`relative flex max-h-[90vh] w-full flex-col rounded-xl bg-white shadow-xl outline-none`,header:`flex items-center justify-between border-b border-gray-100 px-5 py-3.5`,title:`text-base font-semibold text-gray-900`,closeBtn:`rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus:outline-none`,body:`overflow-y-auto px-5 py-4`,footer:`flex justify-end gap-2 border-t border-gray-100 px-5 py-3`,sizes:{sm:`max-w-sm`,md:`max-w-lg`,lg:`max-w-2xl`,xl:`max-w-4xl`,full:`h-[95vh] max-w-[95vw]`}},drawer:{backdrop:`fixed inset-0 bg-black/50`,panel:`fixed flex flex-col bg-white shadow-xl outline-none`,header:`flex items-center justify-between border-b border-gray-100 px-5 py-3.5`,title:`text-base font-semibold text-gray-900`,closeBtn:`rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus:outline-none`,body:`flex-1 overflow-y-auto px-5 py-4`,sizes:{sm:`max-w-xs`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-2xl`,full:`max-w-full`},sizesVertical:{sm:`max-h-48`,md:`max-h-72`,lg:`max-h-96`,xl:`max-h-[60vh]`,full:`max-h-full`}},table:{wrapper:`space-y-3`,toolbar:`flex flex-col gap-3 md:flex-row md:items-center md:justify-between`,search:`block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 md:max-w-xs`,exactLabel:`inline-flex items-center gap-1.5 text-xs text-gray-500`,rangeWrapper:`flex items-center gap-2`,rangeInput:`rounded-md border border-gray-300 px-2 py-1.5 text-sm text-gray-700`,offline:`flex items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700`,container:`hidden overflow-x-auto rounded-lg border border-gray-200 md:block`,table:`w-full min-w-full divide-y divide-gray-200 text-sm`,thead:`bg-gray-50`,th:`px-4 py-2.5 text-left text-xs font-semibold uppercase tracking-wide text-gray-500`,sortBtn:`inline-flex cursor-pointer items-center gap-1 uppercase hover:text-gray-800`,tbody:`divide-y divide-gray-100 bg-white`,tr:``,trClickable:`cursor-pointer hover:bg-gray-50`,td:`px-4 py-2.5 text-gray-700`,money:`font-semibold text-emerald-600`,empty:`px-4 py-10 text-center text-sm text-gray-400`,error:`rounded-md bg-red-50 px-4 py-3 text-sm text-red-700`,loading:`flex justify-center px-4 py-10 text-gray-400`,actionsCell:`whitespace-nowrap px-4 py-2.5 text-right`,actionBtn:`ml-3 inline-flex cursor-pointer items-center gap-1 text-sm text-blue-600 hover:underline first:ml-0`,checkbox:`size-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500`,cards:`space-y-3 md:hidden`,card:`rounded-lg border border-gray-200 bg-white p-4`,cardLabel:`text-xs font-semibold uppercase tracking-wide text-gray-400`,cardValue:`mb-2 text-sm text-gray-700`,pagination:{wrapper:`flex flex-col items-center justify-between gap-3 md:flex-row`,info:`text-xs text-gray-500`,perPage:`rounded-md border border-gray-300 px-2 py-1 text-xs text-gray-600`,pages:`flex items-center gap-1`,pageBtn:`inline-flex size-8 cursor-pointer items-center justify-center rounded-md border border-gray-300 text-xs text-gray-600 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-40`,pageBtnActive:`inline-flex size-8 items-center justify-center rounded-md border border-blue-600 bg-blue-600 text-xs font-semibold text-white`,ellipsis:`px-1 text-xs text-gray-400`,loadMore:`inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-60`},multiBar:`fixed bottom-5 left-1/2 z-40 flex min-w-80 -translate-x-1/2 items-center justify-between gap-4 rounded-xl border border-gray-200 bg-white p-3 shadow-lg`,multiCount:`inline-flex items-center justify-center rounded-full bg-blue-600 px-2 py-0.5 text-xs font-semibold text-white`,multiBtn:`inline-flex items-center justify-center gap-1 rounded-md border border-blue-200 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-50`},buttons:{primary:`inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:opacity-60`,secondary:`inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none`,danger:`inline-flex items-center justify-center gap-2 rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500/40`,link:`inline-flex cursor-pointer items-center gap-1 text-sm text-blue-600 hover:underline`}},r=Symbol(`sh-tw-theme`),i=Symbol(`sh-tw-components`),a=Symbol(`sh-dialog-context`),o=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function s(e,t){if(!o(e))return t??e;let n={...e};return o(t)&&Object.keys(t).forEach(r=>{o(e[r])&&o(t[r])?n[r]=s(e[r],t[r]):n[r]=t[r]}),n}var c={install(t,a={}){e.ShCore.install(t,a);let o=s(n,a.theme??{});t.provide(r,o),t.provide(i,a.formComponents??{}),t.provide(`formComponents`,a.formComponents??{}),t.provide(`shFormElementClasses`,{formGroup:o.form.group,formLabel:o.form.label,formControl:o.form.input,helperText:o.form.helper,invalidFeedback:o.form.error,formErrorTitle:o.form.errorTitle,actionBtn:o.form.submitBtn})}},l=(e={})=>({install:t=>c.install(t,e)});function u(e,i=null){let a=(0,t.inject)(r,n);return(0,t.computed)(()=>s(a[e]??n[e],(0,t.unref)(i)??{}))}var d=0;function f(){if(++d===1){let e=window.innerWidth-document.documentElement.clientWidth;e>0&&(document.body.style.paddingRight=`${e}px`),document.body.style.overflow=`hidden`}}function p(){d>0&&--d===0&&(document.body.style.overflow=``,document.body.style.paddingRight=``)}var m=50,h=[];function g({isStatic:e,onClose:n,onOpen:r}={}){let i=(0,t.ref)(!1),a=(0,t.ref)(m),o=null,s={},c=t=>{t.key===`Escape`&&h[h.length-1]===s&&(e?.()||u(`escape`))};function l(){i.value||(o=document.activeElement,a.value=m+h.length*10,h.push(s),i.value=!0,f(),document.addEventListener(`keydown`,c),r?.())}function u(e=`api`){if(!i.value)return;i.value=!1;let t=h.indexOf(s);t>=0&&h.splice(t,1),p(),document.removeEventListener(`keydown`,c),o?.focus?.(),n?.(e)}function d(){e?.()||u(`backdrop`)}return(0,t.onScopeDispose)(()=>{i.value&&u(`unmount`)}),{isOpen:i,zIndex:a,show:l,close:u,onBackdrop:d}}var _=e=>String(e??``).replace(/[_-]+/g,` `).replace(/([a-z\d])([A-Z])/g,`$1 $2`).trim().split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),v={password:`password`,pin:`pin`,password_confirmation:`password`,message:`textarea`,description:`textarea`,comments:`textarea`,notes:`textarea`,email:`email`,phone:`phone`,phone_number:`phone`,age:`number`,date:`date`};function y(e){if(e.type)return e.type;if(e.component)return`custom`;if(e.options)return e.multiple||e.allowCustom?`suggest`:`select`;let t=e.name??``;return v[t]?v[t]:/_email$/.test(t)?`email`:/_phone$/.test(t)?`phone`:/(_at|_date|_on)$/.test(t)?`date`:`text`}function b(e,t={}){return(e??[]).map(e=>{let n=typeof e==`string`?{name:e}:{...e};return n.name=n.name??n.field,n.name?(n.type=y(n),n.label!==!1&&(n.label=n.label??_(n.name)),n.placeholder=n.placeholder??``,n.helper=n.helper??``,n.required=!!n.required,n.value=n.value??t?.[n.name]??null,n):(console.warn(`[sh-tailwind] form field without a name was skipped`,e),null)}).filter(Boolean)}var x={key:0,xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2.5`},S={__name:`ShFormSteps`,props:{steps:{type:Array,required:!0},current:{type:Number,default:0}},setup(e){let n=u(`form`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(n).steps.wrapper)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.steps,(r,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:a,class:(0,t.normalizeClass)((0,t.unref)(n).steps.step)},[a>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)(a<=e.current?(0,t.unref)(n).steps.connectorDone:(0,t.unref)(n).steps.connector)},null,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)(a<e.current?(0,t.unref)(n).steps.circleDone:a===e.current?(0,t.unref)(n).steps.circleActive:(0,t.unref)(n).steps.circle)},[a<e.current?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,x,[...i[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M4.5 12.75l6 6 9-13.5`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(a+1),1)],64))],2),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)(a===e.current?(0,t.unref)(n).steps.titleActive:(0,t.unref)(n).steps.title)},(0,t.toDisplayString)(r.title),3)],2))),128))],2))}},C=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},w={},T={class:`animate-spin`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`};function ee(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,T,[...n[0]||=[(0,t.createElementVNode)(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),(0,t.createElementVNode)(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`},null,-1)]])}var E=C(w,[[`render`,ee]]),te=[`placeholder`,`disabled`],D={__name:`TextInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:`text`,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,te)),[[t.vModelText,a.value]])}},O=[`rows`,`placeholder`,`disabled`],k={__name:`TextAreaInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean,rows:{type:[Number,String],default:3}},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`textarea`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,O)),[[t.vModelText,a.value]])}},A=[`placeholder`,`disabled`],j={__name:`EmailInput`,props:{modelValue:String,placeholder:String,isInvalid:Boolean,disabled:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:`email`,autocomplete:`email`,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,A)),[[t.vModelText,a.value]])}},ne=[`type`,`autocomplete`,`placeholder`,`disabled`],M={key:0,xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},N={key:1,xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},P=Object.assign({inheritAttrs:!1},{__name:`PasswordInput`,props:{modelValue:String,placeholder:String,isInvalid:Boolean,disabled:Boolean,autocomplete:{type:String,default:`current-password`}},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=u(`inputs`),o=(0,t.ref)(!1),s=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(a).passwordWrapper)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,(0,t.mergeProps)(n.$attrs,{"onUpdate:modelValue":r[0]||=e=>s.value=e,type:o.value?`text`:`password`,autocomplete:e.autocomplete,placeholder:e.placeholder,disabled:e.disabled,class:`pr-9`,onFocus:r[1]||=e=>i(`clearValidationErrors`)}),null,16,ne),[[t.vModelDynamic,s.value]]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)((0,t.unref)(a).passwordToggle),tabindex:`-1`,onClick:r[2]||=e=>o.value=!o.value},[o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,N,[...r[4]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M3.98 8.22A10.48 10.48 0 002.04 11.68a1.01 1.01 0 000 .64C3.42 16.49 7.36 19.5 12 19.5c.99 0 1.95-.14 2.86-.39M6.23 6.23A10.45 10.45 0 0112 4.5c4.64 0 8.57 3.01 9.96 7.18.07.21.07.43 0 .64a10.5 10.5 0 01-4.19 5.45M6.23 6.23L3 3m3.23 3.23l3.65 3.65m7.89 7.89L21 21m-3.23-3.23l-3.65-3.65m0 0a3 3 0 10-4.24-4.24m4.24 4.24L9.88 9.88`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,M,[...r[3]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M2.04 12.32a1.01 1.01 0 010-.64C3.42 7.51 7.36 4.5 12 4.5c4.64 0 8.57 3.01 9.96 7.18.07.21.07.43 0 .64C20.58 16.49 16.64 19.5 12 19.5c-4.64 0-8.57-3.01-9.96-7.18z`},null,-1),(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`},null,-1)]]))],2)],2))}}),re=[`value`,`type`,`disabled`,`onInput`,`onKeydown`],F=Object.assign({inheritAttrs:!1},{__name:`PinInput`,props:{modelValue:[String,Number],length:{type:[Number,String],default:4},secret:Boolean,isInvalid:Boolean,disabled:Boolean},emits:[`update:modelValue`,`clearValidationErrors`,`complete`],setup(e,{emit:n}){let r=e,i=n,a=u(`inputs`),o=(0,t.computed)(()=>Math.max(1,parseInt(r.length)||4)),s=(0,t.ref)([]),c=(0,t.ref)([]),l=e=>{let t=String(e??``).replace(/\D/g,``).slice(0,o.value).split(``);c.value=Array.from({length:o.value},(e,n)=>t[n]??``)};l(r.modelValue),(0,t.watch)(o,()=>l(r.modelValue)),(0,t.watch)(()=>r.modelValue,e=>{e!==c.value.join(``)&&l(e)});let d=()=>{let e=c.value.join(``);i(`update:modelValue`,e),e.length===o.value&&i(`complete`,e)},f=e=>{(0,t.nextTick)(()=>{let t=s.value[e];t?.focus(),t?.select()})},p=(e,t)=>{i(`clearValidationErrors`);let n=t.target.value.replace(/\D/g,``);if(!n){c.value[e]=``,d();return}let r=n.split(``),a=e;for(let e of r){if(a>=o.value)break;c.value[a]=e,a++}d(),f(Math.min(a,o.value-1))},m=(e,t)=>{t.key===`Backspace`?(t.preventDefault(),c.value[e]?c.value[e]=``:e>0&&(c.value[e-1]=``,f(e-1)),d()):t.key===`ArrowLeft`&&e>0?f(e-1):t.key===`ArrowRight`&&e<o.value-1&&f(e+1)},h=e=>{e.preventDefault();let t=(e.clipboardData?.getData(`text`)??``).replace(/\D/g,``).slice(0,o.value);l(t),d(),f(Math.min(t.length,o.value-1))},g=e=>r.isInvalid?a.value.pin.boxInvalid:c.value[e]?a.value.pin.boxFilled:a.value.pin.box;return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(a).pin.wrapper)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:a,ref_for:!0,ref:e=>s.value[a]=e,value:n,type:e.secret?`password`:`text`,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`1`,disabled:e.disabled,class:(0,t.normalizeClass)(g(a)),onInput:e=>p(a,e),onKeydown:e=>m(a,e),onPaste:h,onFocus:r[0]||=e=>{e.target.select(),i(`clearValidationErrors`)}},null,42,re))),128))],2))}}),ie={"#":/[0-9]/,A:/[a-zA-Z]/,N:/[a-zA-Z0-9]/,"*":/[a-zA-Z0-9]/},ae=[`money`,`integer`,`number`,`decimal`];function oe(e){return typeof e==`string`&&ae.includes(e)}function I(e,t,{unmask:n=!1}={}){let r=String(e??``).split(``),i=``,a=``,o=0;for(let e=0;e<t.length;e++){let n=ie[t[e]];if(n){for(;o<r.length&&!n.test(r[o]);)o++;if(o>=r.length)break;i+=r[o],a+=r[o],o++}else o<r.length&&(i+=t[e])}return{display:i,model:n?a:i}}function L(e,{decimals:t=2,prefix:n=``,suffix:r=``,integer:i=!1}={}){let a=String(e??``).replace(/[^0-9.]/g,``),o=a.indexOf(`.`);o!==-1&&(a=a.slice(0,o+1)+a.slice(o+1).replace(/\./g,``)),i&&(a=a.split(`.`)[0]);let[s=``,c]=a.split(`.`);s=s.replace(/^0+(?=\d)/,``);let l=s.replace(/\B(?=(\d{3})+(?!\d))/g,`,`),u=a.includes(`.`)&&!i,d=l,f=s;return u&&(c=(c??``).slice(0,t),d=(l||`0`)+`.`+c,f=(s||`0`)+`.`+c),d&&=n+d+r,{display:d,model:f}}function R(e,t){if(typeof t==`function`){let n=t(e)??``;return{display:String(n),model:String(n)}}return t&&typeof t==`object`?t.pattern?I(e,t.pattern,t):L(e,t):oe(t)?L(e,{integer:t===`integer`||t===`number`,decimals:t===`integer`||t===`number`?0:2}):I(e,String(t))}function z(e){if(oe(e)||e&&typeof e==`object`&&!e.pattern)return`decimal`;let t=typeof e==`string`?e:e&&e.pattern;return typeof t==`string`&&/^[#\s().+-]*$/.test(t)?`numeric`:`text`}var B=[`value`,`inputmode`,`placeholder`,`disabled`],V={__name:`MaskedInput`,props:{modelValue:[String,Number],mask:{type:[String,Object,Function],required:!0},placeholder:String,isInvalid:Boolean,disabled:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=e=>{let{display:t}=R(e,r.mask);t!==a.value&&(a.value=t)};(0,t.watch)(()=>r.modelValue,o,{immediate:!0}),(0,t.watch)(()=>r.mask,()=>o(r.modelValue));let s=e=>{i(`clearValidationErrors`);let n=e.target,o=n.selectionStart??n.value.length,s=n.value.length,{display:c,model:l}=R(n.value,r.mask);a.value=c,i(`update:modelValue`,l),(0,t.nextTick)(()=>{if(n.type!==`text`&&n.type!==`tel`)return;let e=o+(c.length-s);e=Math.max(0,Math.min(e,c.length));try{n.setSelectionRange(e,e)}catch{}})};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{value:a.value,type:`text`,inputmode:(0,t.unref)(z)(e.mask),placeholder:e.placeholder,disabled:e.disabled,onInput:s,onFocus:r[0]||=e=>i(`clearValidationErrors`)},null,40,B))}},H=[`min`,`max`,`step`,`placeholder`,`disabled`],U={__name:`NumberInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean,min:[Number,String],max:[Number,String],step:[Number,String]},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:`number`,min:e.min,max:e.max,step:e.step,placeholder:e.placeholder,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,H)),[[t.vModelText,a.value]])}},W=[`type`,`min`,`max`,`disabled`],G={__name:`DateInput`,props:{modelValue:String,isInvalid:Boolean,disabled:Boolean,withTime:Boolean,min:String,max:String},emits:[`update:modelValue`,`clearValidationErrors`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)({get:()=>r.modelValue,set:e=>i(`update:modelValue`,e)});return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{"onUpdate:modelValue":r[0]||=e=>a.value=e,type:e.withTime?`datetime-local`:`date`,min:e.min,max:e.max,disabled:e.disabled,onFocus:r[1]||=e=>i(`clearValidationErrors`)},null,40,W)),[[t.vModelDynamic,a.value]])}};function K(e){return Array.isArray(e)?e.map(e=>{if(e==null)return null;if(typeof e!=`object`)return{id:e,label:String(e)};let t=e.id??e.key??e.value??e.name;return{id:t,label:e.label??e.name??e.option??e.value??String(t),raw:e}}).filter(Boolean):[]}var se=[`disabled`],ce={value:null,disabled:``},le=[`value`],ue={__name:`SelectInput`,props:{modelValue:[String,Number],placeholder:String,isInvalid:Boolean,disabled:Boolean,options:Array,url:String},emits:[`update:modelValue`,`clearValidationErrors`],setup(n,{emit:r}){let i=n,a=r,o=(0,t.ref)([]),s=(0,t.ref)(!1),c=(0,t.computed)(()=>K(i.options??o.value)),l=(0,t.computed)({get:()=>i.modelValue,set:e=>a(`update:modelValue`,e)});return(0,t.onMounted)(()=>{!i.options&&i.url&&(s.value=!0,e.shApis.doGet(i.url,{all:1}).then(e=>{o.value=Array.isArray(e.data)?e.data:e.data?.data??[]}).finally(()=>{s.value=!1}))}),(e,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`select`,{"onUpdate:modelValue":r[0]||=e=>l.value=e,disabled:n.disabled||s.value,onFocus:r[1]||=e=>a(`clearValidationErrors`)},[(0,t.createElementVNode)(`option`,ce,(0,t.toDisplayString)(s.value?`Loading...`:n.placeholder||`Select...`),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.id,value:e.id},(0,t.toDisplayString)(e.label),9,le))),128))],40,se)),[[t.vModelSelect,l.value]])}},q=[{name:`Afghanistan`,dialCode:`+93`,isoCode:`AF`,flag:`https://www.countryflags.io/AF/flat/64.png`},{name:`Aland Islands`,dialCode:`+358`,isoCode:`AX`,flag:`https://www.countryflags.io/AX/flat/64.png`},{name:`Albania`,dialCode:`+355`,isoCode:`AL`,flag:`https://www.countryflags.io/AL/flat/64.png`},{name:`Algeria`,dialCode:`+213`,isoCode:`DZ`,flag:`https://www.countryflags.io/DZ/flat/64.png`},{name:`AmericanSamoa`,dialCode:`+1684`,isoCode:`AS`,flag:`https://www.countryflags.io/AS/flat/64.png`},{name:`Andorra`,dialCode:`+376`,isoCode:`AD`,flag:`https://www.countryflags.io/AD/flat/64.png`},{name:`Angola`,dialCode:`+244`,isoCode:`AO`,flag:`https://www.countryflags.io/AO/flat/64.png`},{name:`Anguilla`,dialCode:`+1264`,isoCode:`AI`,flag:`https://www.countryflags.io/AI/flat/64.png`},{name:`Antarctica`,dialCode:`+672`,isoCode:`AQ`,flag:`https://www.countryflags.io/AQ/flat/64.png`},{name:`Antigua and Barbuda`,dialCode:`+1268`,isoCode:`AG`,flag:`https://www.countryflags.io/AG/flat/64.png`},{name:`Argentina`,dialCode:`+54`,isoCode:`AR`,flag:`https://www.countryflags.io/AR/flat/64.png`},{name:`Armenia`,dialCode:`+374`,isoCode:`AM`,flag:`https://www.countryflags.io/AM/flat/64.png`},{name:`Aruba`,dialCode:`+297`,isoCode:`AW`,flag:`https://www.countryflags.io/AW/flat/64.png`},{name:`Ascension Island`,dialCode:`+247`,isoCode:`AC`,flag:`https://cdn.kcak11.com/flags/AC_64.png`},{name:`Australia`,dialCode:`+61`,isoCode:`AU`,flag:`https://www.countryflags.io/AU/flat/64.png`},{name:`Austria`,dialCode:`+43`,isoCode:`AT`,flag:`https://www.countryflags.io/AT/flat/64.png`},{name:`Azerbaijan`,dialCode:`+994`,isoCode:`AZ`,flag:`https://www.countryflags.io/AZ/flat/64.png`},{name:`Bahamas`,dialCode:`+1242`,isoCode:`BS`,flag:`https://www.countryflags.io/BS/flat/64.png`},{name:`Bahrain`,dialCode:`+973`,isoCode:`BH`,flag:`https://www.countryflags.io/BH/flat/64.png`},{name:`Bangladesh`,dialCode:`+880`,isoCode:`BD`,flag:`https://www.countryflags.io/BD/flat/64.png`},{name:`Barbados`,dialCode:`+1246`,isoCode:`BB`,flag:`https://www.countryflags.io/BB/flat/64.png`},{name:`Belarus`,dialCode:`+375`,isoCode:`BY`,flag:`https://www.countryflags.io/BY/flat/64.png`},{name:`Belgium`,dialCode:`+32`,isoCode:`BE`,flag:`https://www.countryflags.io/BE/flat/64.png`},{name:`Belize`,dialCode:`+501`,isoCode:`BZ`,flag:`https://www.countryflags.io/BZ/flat/64.png`},{name:`Benin`,dialCode:`+229`,isoCode:`BJ`,flag:`https://www.countryflags.io/BJ/flat/64.png`},{name:`Bermuda`,dialCode:`+1441`,isoCode:`BM`,flag:`https://www.countryflags.io/BM/flat/64.png`},{name:`Bhutan`,dialCode:`+975`,isoCode:`BT`,flag:`https://www.countryflags.io/BT/flat/64.png`},{name:`Bolivia`,dialCode:`+591`,isoCode:`BO`,flag:`https://www.countryflags.io/BO/flat/64.png`},{name:`Bosnia and Herzegovina`,dialCode:`+387`,isoCode:`BA`,flag:`https://www.countryflags.io/BA/flat/64.png`},{name:`Botswana`,dialCode:`+267`,isoCode:`BW`,flag:`https://www.countryflags.io/BW/flat/64.png`},{name:`Brazil`,dialCode:`+55`,isoCode:`BR`,flag:`https://www.countryflags.io/BR/flat/64.png`},{name:`British Indian Ocean Territory`,dialCode:`+246`,isoCode:`IO`,flag:`https://www.countryflags.io/IO/flat/64.png`},{name:`Brunei Darussalam`,dialCode:`+673`,isoCode:`BN`,flag:`https://www.countryflags.io/BN/flat/64.png`},{name:`Bulgaria`,dialCode:`+359`,isoCode:`BG`,flag:`https://www.countryflags.io/BG/flat/64.png`},{name:`Burkina Faso`,dialCode:`+226`,isoCode:`BF`,flag:`https://www.countryflags.io/BF/flat/64.png`},{name:`Burundi`,dialCode:`+257`,isoCode:`BI`,flag:`https://www.countryflags.io/BI/flat/64.png`},{name:`Cambodia`,dialCode:`+855`,isoCode:`KH`,flag:`https://www.countryflags.io/KH/flat/64.png`},{name:`Cameroon`,dialCode:`+237`,isoCode:`CM`,flag:`https://www.countryflags.io/CM/flat/64.png`},{name:`Canada`,dialCode:`+1`,isoCode:`CA`,flag:`https://www.countryflags.io/CA/flat/64.png`},{name:`Cape Verde`,dialCode:`+238`,isoCode:`CV`,flag:`https://www.countryflags.io/CV/flat/64.png`},{name:`Cayman Islands`,dialCode:`+1345`,isoCode:`KY`,flag:`https://www.countryflags.io/KY/flat/64.png`},{name:`Central African Republic`,dialCode:`+236`,isoCode:`CF`,flag:`https://www.countryflags.io/CF/flat/64.png`},{name:`Chad`,dialCode:`+235`,isoCode:`TD`,flag:`https://www.countryflags.io/TD/flat/64.png`},{name:`Chile`,dialCode:`+56`,isoCode:`CL`,flag:`https://www.countryflags.io/CL/flat/64.png`},{name:`China`,dialCode:`+86`,isoCode:`CN`,flag:`https://www.countryflags.io/CN/flat/64.png`},{name:`Christmas Island`,dialCode:`+61`,isoCode:`CX`,flag:`https://www.countryflags.io/CX/flat/64.png`},{name:`Cocos (Keeling) Islands`,dialCode:`+61`,isoCode:`CC`,flag:`https://www.countryflags.io/CC/flat/64.png`},{name:`Colombia`,dialCode:`+57`,isoCode:`CO`,flag:`https://www.countryflags.io/CO/flat/64.png`},{name:`Comoros`,dialCode:`+269`,isoCode:`KM`,flag:`https://www.countryflags.io/KM/flat/64.png`},{name:`Congo`,dialCode:`+242`,isoCode:`CG`,flag:`https://www.countryflags.io/CG/flat/64.png`},{name:`Cook Islands`,dialCode:`+682`,isoCode:`CK`,flag:`https://www.countryflags.io/CK/flat/64.png`},{name:`Costa Rica`,dialCode:`+506`,isoCode:`CR`,flag:`https://www.countryflags.io/CR/flat/64.png`},{name:`Croatia`,dialCode:`+385`,isoCode:`HR`,flag:`https://www.countryflags.io/HR/flat/64.png`},{name:`Cuba`,dialCode:`+53`,isoCode:`CU`,flag:`https://www.countryflags.io/CU/flat/64.png`},{name:`Cyprus`,dialCode:`+357`,isoCode:`CY`,flag:`https://www.countryflags.io/CY/flat/64.png`},{name:`Czech Republic`,dialCode:`+420`,isoCode:`CZ`,flag:`https://www.countryflags.io/CZ/flat/64.png`},{name:`Democratic Republic of the Congo`,dialCode:`+243`,isoCode:`CD`,flag:`https://www.countryflags.io/CD/flat/64.png`},{name:`Denmark`,dialCode:`+45`,isoCode:`DK`,flag:`https://www.countryflags.io/DK/flat/64.png`},{name:`Djibouti`,dialCode:`+253`,isoCode:`DJ`,flag:`https://www.countryflags.io/DJ/flat/64.png`},{name:`Dominica`,dialCode:`+1767`,isoCode:`DM`,flag:`https://www.countryflags.io/DM/flat/64.png`},{name:`Dominican Republic`,dialCode:`+1849`,isoCode:`DO`,flag:`https://www.countryflags.io/DO/flat/64.png`},{name:`Ecuador`,dialCode:`+593`,isoCode:`EC`,flag:`https://www.countryflags.io/EC/flat/64.png`},{name:`Egypt`,dialCode:`+20`,isoCode:`EG`,flag:`https://www.countryflags.io/EG/flat/64.png`},{name:`El Salvador`,dialCode:`+503`,isoCode:`SV`,flag:`https://www.countryflags.io/SV/flat/64.png`},{name:`Equatorial Guinea`,dialCode:`+240`,isoCode:`GQ`,flag:`https://www.countryflags.io/GQ/flat/64.png`},{name:`Eritrea`,dialCode:`+291`,isoCode:`ER`,flag:`https://www.countryflags.io/ER/flat/64.png`},{name:`Estonia`,dialCode:`+372`,isoCode:`EE`,flag:`https://www.countryflags.io/EE/flat/64.png`},{name:`Eswatini`,dialCode:`+268`,isoCode:`SZ`,flag:`https://www.countryflags.io/SZ/flat/64.png`},{name:`Ethiopia`,dialCode:`+251`,isoCode:`ET`,flag:`https://www.countryflags.io/ET/flat/64.png`},{name:`Falkland Islands (Malvinas)`,dialCode:`+500`,isoCode:`FK`,flag:`https://www.countryflags.io/FK/flat/64.png`},{name:`Faroe Islands`,dialCode:`+298`,isoCode:`FO`,flag:`https://www.countryflags.io/FO/flat/64.png`},{name:`Fiji`,dialCode:`+679`,isoCode:`FJ`,flag:`https://www.countryflags.io/FJ/flat/64.png`},{name:`Finland`,dialCode:`+358`,isoCode:`FI`,flag:`https://www.countryflags.io/FI/flat/64.png`},{name:`France`,dialCode:`+33`,isoCode:`FR`,flag:`https://www.countryflags.io/FR/flat/64.png`},{name:`French Guiana`,dialCode:`+594`,isoCode:`GF`,flag:`https://www.countryflags.io/GF/flat/64.png`},{name:`French Polynesia`,dialCode:`+689`,isoCode:`PF`,flag:`https://www.countryflags.io/PF/flat/64.png`},{name:`Gabon`,dialCode:`+241`,isoCode:`GA`,flag:`https://www.countryflags.io/GA/flat/64.png`},{name:`Gambia`,dialCode:`+220`,isoCode:`GM`,flag:`https://www.countryflags.io/GM/flat/64.png`},{name:`Georgia`,dialCode:`+995`,isoCode:`GE`,flag:`https://www.countryflags.io/GE/flat/64.png`},{name:`Germany`,dialCode:`+49`,isoCode:`DE`,flag:`https://www.countryflags.io/DE/flat/64.png`},{name:`Ghana`,dialCode:`+233`,isoCode:`GH`,flag:`https://www.countryflags.io/GH/flat/64.png`},{name:`Gibraltar`,dialCode:`+350`,isoCode:`GI`,flag:`https://www.countryflags.io/GI/flat/64.png`},{name:`Greece`,dialCode:`+30`,isoCode:`GR`,flag:`https://www.countryflags.io/GR/flat/64.png`},{name:`Greenland`,dialCode:`+299`,isoCode:`GL`,flag:`https://www.countryflags.io/GL/flat/64.png`},{name:`Grenada`,dialCode:`+1473`,isoCode:`GD`,flag:`https://www.countryflags.io/GD/flat/64.png`},{name:`Guadeloupe`,dialCode:`+590`,isoCode:`GP`,flag:`https://www.countryflags.io/GP/flat/64.png`},{name:`Guam`,dialCode:`+1671`,isoCode:`GU`,flag:`https://www.countryflags.io/GU/flat/64.png`},{name:`Guatemala`,dialCode:`+502`,isoCode:`GT`,flag:`https://www.countryflags.io/GT/flat/64.png`},{name:`Guernsey`,dialCode:`+44`,isoCode:`GG`,flag:`https://www.countryflags.io/GG/flat/64.png`},{name:`Guinea`,dialCode:`+224`,isoCode:`GN`,flag:`https://www.countryflags.io/GN/flat/64.png`},{name:`Guinea-Bissau`,dialCode:`+245`,isoCode:`GW`,flag:`https://www.countryflags.io/GW/flat/64.png`},{name:`Guyana`,dialCode:`+592`,isoCode:`GY`,flag:`https://www.countryflags.io/GY/flat/64.png`},{name:`Haiti`,dialCode:`+509`,isoCode:`HT`,flag:`https://www.countryflags.io/HT/flat/64.png`},{name:`Holy See (Vatican City State)`,dialCode:`+379`,isoCode:`VA`,flag:`https://www.countryflags.io/VA/flat/64.png`},{name:`Honduras`,dialCode:`+504`,isoCode:`HN`,flag:`https://www.countryflags.io/HN/flat/64.png`},{name:`Hong Kong`,dialCode:`+852`,isoCode:`HK`,flag:`https://www.countryflags.io/HK/flat/64.png`},{name:`Hungary`,dialCode:`+36`,isoCode:`HU`,flag:`https://www.countryflags.io/HU/flat/64.png`},{name:`Iceland`,dialCode:`+354`,isoCode:`IS`,flag:`https://www.countryflags.io/IS/flat/64.png`},{name:`India`,dialCode:`+91`,isoCode:`IN`,flag:`https://www.countryflags.io/IN/flat/64.png`},{name:`Indonesia`,dialCode:`+62`,isoCode:`ID`,flag:`https://www.countryflags.io/ID/flat/64.png`},{name:`Iran`,dialCode:`+98`,isoCode:`IR`,flag:`https://www.countryflags.io/IR/flat/64.png`},{name:`Iraq`,dialCode:`+964`,isoCode:`IQ`,flag:`https://www.countryflags.io/IQ/flat/64.png`},{name:`Ireland`,dialCode:`+353`,isoCode:`IE`,flag:`https://www.countryflags.io/IE/flat/64.png`},{name:`Isle of Man`,dialCode:`+44`,isoCode:`IM`,flag:`https://www.countryflags.io/IM/flat/64.png`},{name:`Israel`,dialCode:`+972`,isoCode:`IL`,flag:`https://www.countryflags.io/IL/flat/64.png`},{name:`Italy`,dialCode:`+39`,isoCode:`IT`,flag:`https://www.countryflags.io/IT/flat/64.png`},{name:`Ivory Coast / Cote d'Ivoire`,dialCode:`+225`,isoCode:`CI`,flag:`https://www.countryflags.io/CI/flat/64.png`},{name:`Jamaica`,dialCode:`+1876`,isoCode:`JM`,flag:`https://www.countryflags.io/JM/flat/64.png`},{name:`Japan`,dialCode:`+81`,isoCode:`JP`,flag:`https://www.countryflags.io/JP/flat/64.png`},{name:`Jersey`,dialCode:`+44`,isoCode:`JE`,flag:`https://www.countryflags.io/JE/flat/64.png`},{name:`Jordan`,dialCode:`+962`,isoCode:`JO`,flag:`https://www.countryflags.io/JO/flat/64.png`},{name:`Kazakhstan`,dialCode:`+77`,isoCode:`KZ`,flag:`https://www.countryflags.io/KZ/flat/64.png`},{name:`Kenya`,dialCode:`+254`,isoCode:`KE`,flag:`https://www.countryflags.io/KE/flat/64.png`},{name:`Kiribati`,dialCode:`+686`,isoCode:`KI`,flag:`https://www.countryflags.io/KI/flat/64.png`},{name:`Korea, Democratic People's Republic of Korea`,dialCode:`+850`,isoCode:`KP`,flag:`https://www.countryflags.io/KP/flat/64.png`},{name:`Korea, Republic of South Korea`,dialCode:`+82`,isoCode:`KR`,flag:`https://www.countryflags.io/KR/flat/64.png`},{name:`Kosovo`,dialCode:`+383`,isoCode:`XK`,flag:`https://www.countryflags.io/XK/flat/64.png`},{name:`Kuwait`,dialCode:`+965`,isoCode:`KW`,flag:`https://www.countryflags.io/KW/flat/64.png`},{name:`Kyrgyzstan`,dialCode:`+996`,isoCode:`KG`,flag:`https://www.countryflags.io/KG/flat/64.png`},{name:`Laos`,dialCode:`+856`,isoCode:`LA`,flag:`https://www.countryflags.io/LA/flat/64.png`},{name:`Latvia`,dialCode:`+371`,isoCode:`LV`,flag:`https://www.countryflags.io/LV/flat/64.png`},{name:`Lebanon`,dialCode:`+961`,isoCode:`LB`,flag:`https://www.countryflags.io/LB/flat/64.png`},{name:`Lesotho`,dialCode:`+266`,isoCode:`LS`,flag:`https://www.countryflags.io/LS/flat/64.png`},{name:`Liberia`,dialCode:`+231`,isoCode:`LR`,flag:`https://www.countryflags.io/LR/flat/64.png`},{name:`Libya`,dialCode:`+218`,isoCode:`LY`,flag:`https://www.countryflags.io/LY/flat/64.png`},{name:`Liechtenstein`,dialCode:`+423`,isoCode:`LI`,flag:`https://www.countryflags.io/LI/flat/64.png`},{name:`Lithuania`,dialCode:`+370`,isoCode:`LT`,flag:`https://www.countryflags.io/LT/flat/64.png`},{name:`Luxembourg`,dialCode:`+352`,isoCode:`LU`,flag:`https://www.countryflags.io/LU/flat/64.png`},{name:`Macau`,dialCode:`+853`,isoCode:`MO`,flag:`https://www.countryflags.io/MO/flat/64.png`},{name:`Madagascar`,dialCode:`+261`,isoCode:`MG`,flag:`https://www.countryflags.io/MG/flat/64.png`},{name:`Malawi`,dialCode:`+265`,isoCode:`MW`,flag:`https://www.countryflags.io/MW/flat/64.png`},{name:`Malaysia`,dialCode:`+60`,isoCode:`MY`,flag:`https://www.countryflags.io/MY/flat/64.png`},{name:`Maldives`,dialCode:`+960`,isoCode:`MV`,flag:`https://www.countryflags.io/MV/flat/64.png`},{name:`Mali`,dialCode:`+223`,isoCode:`ML`,flag:`https://www.countryflags.io/ML/flat/64.png`},{name:`Malta`,dialCode:`+356`,isoCode:`MT`,flag:`https://www.countryflags.io/MT/flat/64.png`},{name:`Marshall Islands`,dialCode:`+692`,isoCode:`MH`,flag:`https://www.countryflags.io/MH/flat/64.png`},{name:`Martinique`,dialCode:`+596`,isoCode:`MQ`,flag:`https://www.countryflags.io/MQ/flat/64.png`},{name:`Mauritania`,dialCode:`+222`,isoCode:`MR`,flag:`https://www.countryflags.io/MR/flat/64.png`},{name:`Mauritius`,dialCode:`+230`,isoCode:`MU`,flag:`https://www.countryflags.io/MU/flat/64.png`},{name:`Mayotte`,dialCode:`+262`,isoCode:`YT`,flag:`https://www.countryflags.io/YT/flat/64.png`},{name:`Mexico`,dialCode:`+52`,isoCode:`MX`,flag:`https://www.countryflags.io/MX/flat/64.png`},{name:`Micronesia, Federated States of Micronesia`,dialCode:`+691`,isoCode:`FM`,flag:`https://www.countryflags.io/FM/flat/64.png`},{name:`Moldova`,dialCode:`+373`,isoCode:`MD`,flag:`https://www.countryflags.io/MD/flat/64.png`},{name:`Monaco`,dialCode:`+377`,isoCode:`MC`,flag:`https://www.countryflags.io/MC/flat/64.png`},{name:`Mongolia`,dialCode:`+976`,isoCode:`MN`,flag:`https://www.countryflags.io/MN/flat/64.png`},{name:`Montenegro`,dialCode:`+382`,isoCode:`ME`,flag:`https://www.countryflags.io/ME/flat/64.png`},{name:`Montserrat`,dialCode:`+1664`,isoCode:`MS`,flag:`https://www.countryflags.io/MS/flat/64.png`},{name:`Morocco`,dialCode:`+212`,isoCode:`MA`,flag:`https://www.countryflags.io/MA/flat/64.png`},{name:`Mozambique`,dialCode:`+258`,isoCode:`MZ`,flag:`https://www.countryflags.io/MZ/flat/64.png`},{name:`Myanmar`,dialCode:`+95`,isoCode:`MM`,flag:`https://www.countryflags.io/MM/flat/64.png`},{name:`Namibia`,dialCode:`+264`,isoCode:`NA`,flag:`https://www.countryflags.io/NA/flat/64.png`},{name:`Nauru`,dialCode:`+674`,isoCode:`NR`,flag:`https://www.countryflags.io/NR/flat/64.png`},{name:`Nepal`,dialCode:`+977`,isoCode:`NP`,flag:`https://www.countryflags.io/NP/flat/64.png`},{name:`Netherlands`,dialCode:`+31`,isoCode:`NL`,flag:`https://www.countryflags.io/NL/flat/64.png`},{name:`Netherlands Antilles`,dialCode:`+599`,isoCode:`AN`,flag:`https://www.countryflags.io/AN/flat/64.png`},{name:`New Caledonia`,dialCode:`+687`,isoCode:`NC`,flag:`https://www.countryflags.io/NC/flat/64.png`},{name:`New Zealand`,dialCode:`+64`,isoCode:`NZ`,flag:`https://www.countryflags.io/NZ/flat/64.png`},{name:`Nicaragua`,dialCode:`+505`,isoCode:`NI`,flag:`https://www.countryflags.io/NI/flat/64.png`},{name:`Niger`,dialCode:`+227`,isoCode:`NE`,flag:`https://www.countryflags.io/NE/flat/64.png`},{name:`Nigeria`,dialCode:`+234`,isoCode:`NG`,flag:`https://www.countryflags.io/NG/flat/64.png`},{name:`Niue`,dialCode:`+683`,isoCode:`NU`,flag:`https://www.countryflags.io/NU/flat/64.png`},{name:`Norfolk Island`,dialCode:`+672`,isoCode:`NF`,flag:`https://www.countryflags.io/NF/flat/64.png`},{name:`North Macedonia`,dialCode:`+389`,isoCode:`MK`,flag:`https://www.countryflags.io/MK/flat/64.png`},{name:`Northern Mariana Islands`,dialCode:`+1670`,isoCode:`MP`,flag:`https://www.countryflags.io/MP/flat/64.png`},{name:`Norway`,dialCode:`+47`,isoCode:`NO`,flag:`https://www.countryflags.io/NO/flat/64.png`},{name:`Oman`,dialCode:`+968`,isoCode:`OM`,flag:`https://www.countryflags.io/OM/flat/64.png`},{name:`Pakistan`,dialCode:`+92`,isoCode:`PK`,flag:`https://www.countryflags.io/PK/flat/64.png`},{name:`Palau`,dialCode:`+680`,isoCode:`PW`,flag:`https://www.countryflags.io/PW/flat/64.png`},{name:`Palestine`,dialCode:`+970`,isoCode:`PS`,flag:`https://www.countryflags.io/PS/flat/64.png`},{name:`Panama`,dialCode:`+507`,isoCode:`PA`,flag:`https://www.countryflags.io/PA/flat/64.png`},{name:`Papua New Guinea`,dialCode:`+675`,isoCode:`PG`,flag:`https://www.countryflags.io/PG/flat/64.png`},{name:`Paraguay`,dialCode:`+595`,isoCode:`PY`,flag:`https://www.countryflags.io/PY/flat/64.png`},{name:`Peru`,dialCode:`+51`,isoCode:`PE`,flag:`https://www.countryflags.io/PE/flat/64.png`},{name:`Philippines`,dialCode:`+63`,isoCode:`PH`,flag:`https://www.countryflags.io/PH/flat/64.png`},{name:`Pitcairn`,dialCode:`+872`,isoCode:`PN`,flag:`https://www.countryflags.io/PN/flat/64.png`},{name:`Poland`,dialCode:`+48`,isoCode:`PL`,flag:`https://www.countryflags.io/PL/flat/64.png`},{name:`Portugal`,dialCode:`+351`,isoCode:`PT`,flag:`https://www.countryflags.io/PT/flat/64.png`},{name:`Puerto Rico`,dialCode:`+1939`,isoCode:`PR`,flag:`https://www.countryflags.io/PR/flat/64.png`},{name:`Qatar`,dialCode:`+974`,isoCode:`QA`,flag:`https://www.countryflags.io/QA/flat/64.png`},{name:`Reunion`,dialCode:`+262`,isoCode:`RE`,flag:`https://www.countryflags.io/RE/flat/64.png`},{name:`Romania`,dialCode:`+40`,isoCode:`RO`,flag:`https://www.countryflags.io/RO/flat/64.png`},{name:`Russia`,dialCode:`+7`,isoCode:`RU`,flag:`https://www.countryflags.io/RU/flat/64.png`},{name:`Rwanda`,dialCode:`+250`,isoCode:`RW`,flag:`https://www.countryflags.io/RW/flat/64.png`},{name:`Saint Barthelemy`,dialCode:`+590`,isoCode:`BL`,flag:`https://www.countryflags.io/BL/flat/64.png`},{name:`Saint Helena, Ascension and Tristan Da Cunha`,dialCode:`+290`,isoCode:`SH`,flag:`https://www.countryflags.io/SH/flat/64.png`},{name:`Saint Kitts and Nevis`,dialCode:`+1869`,isoCode:`KN`,flag:`https://www.countryflags.io/KN/flat/64.png`},{name:`Saint Lucia`,dialCode:`+1758`,isoCode:`LC`,flag:`https://www.countryflags.io/LC/flat/64.png`},{name:`Saint Martin`,dialCode:`+590`,isoCode:`MF`,flag:`https://www.countryflags.io/MF/flat/64.png`},{name:`Saint Pierre and Miquelon`,dialCode:`+508`,isoCode:`PM`,flag:`https://www.countryflags.io/PM/flat/64.png`},{name:`Saint Vincent and the Grenadines`,dialCode:`+1784`,isoCode:`VC`,flag:`https://www.countryflags.io/VC/flat/64.png`},{name:`Samoa`,dialCode:`+685`,isoCode:`WS`,flag:`https://www.countryflags.io/WS/flat/64.png`},{name:`San Marino`,dialCode:`+378`,isoCode:`SM`,flag:`https://www.countryflags.io/SM/flat/64.png`},{name:`Sao Tome and Principe`,dialCode:`+239`,isoCode:`ST`,flag:`https://www.countryflags.io/ST/flat/64.png`},{name:`Saudi Arabia`,dialCode:`+966`,isoCode:`SA`,flag:`https://www.countryflags.io/SA/flat/64.png`},{name:`Senegal`,dialCode:`+221`,isoCode:`SN`,flag:`https://www.countryflags.io/SN/flat/64.png`},{name:`Serbia`,dialCode:`+381`,isoCode:`RS`,flag:`https://www.countryflags.io/RS/flat/64.png`},{name:`Seychelles`,dialCode:`+248`,isoCode:`SC`,flag:`https://www.countryflags.io/SC/flat/64.png`},{name:`Sierra Leone`,dialCode:`+232`,isoCode:`SL`,flag:`https://www.countryflags.io/SL/flat/64.png`},{name:`Singapore`,dialCode:`+65`,isoCode:`SG`,flag:`https://www.countryflags.io/SG/flat/64.png`},{name:`Sint Maarten`,dialCode:`+1721`,isoCode:`SX`,flag:`https://www.countryflags.io/SX/flat/64.png`},{name:`Slovakia`,dialCode:`+421`,isoCode:`SK`,flag:`https://www.countryflags.io/SK/flat/64.png`},{name:`Slovenia`,dialCode:`+386`,isoCode:`SI`,flag:`https://www.countryflags.io/SI/flat/64.png`},{name:`Solomon Islands`,dialCode:`+677`,isoCode:`SB`,flag:`https://www.countryflags.io/SB/flat/64.png`},{name:`Somalia`,dialCode:`+252`,isoCode:`SO`,flag:`https://www.countryflags.io/SO/flat/64.png`},{name:`South Africa`,dialCode:`+27`,isoCode:`ZA`,flag:`https://www.countryflags.io/ZA/flat/64.png`},{name:`South Georgia and the South Sandwich Islands`,dialCode:`+500`,isoCode:`GS`,flag:`https://www.countryflags.io/GS/flat/64.png`},{name:`South Sudan`,dialCode:`+211`,isoCode:`SS`,flag:`https://www.countryflags.io/SS/flat/64.png`},{name:`Spain`,dialCode:`+34`,isoCode:`ES`,flag:`https://www.countryflags.io/ES/flat/64.png`},{name:`Sri Lanka`,dialCode:`+94`,isoCode:`LK`,flag:`https://www.countryflags.io/LK/flat/64.png`},{name:`Sudan`,dialCode:`+249`,isoCode:`SD`,flag:`https://www.countryflags.io/SD/flat/64.png`},{name:`Suriname`,dialCode:`+597`,isoCode:`SR`,flag:`https://www.countryflags.io/SR/flat/64.png`},{name:`Svalbard and Jan Mayen`,dialCode:`+47`,isoCode:`SJ`,flag:`https://www.countryflags.io/SJ/flat/64.png`},{name:`Sweden`,dialCode:`+46`,isoCode:`SE`,flag:`https://www.countryflags.io/SE/flat/64.png`},{name:`Switzerland`,dialCode:`+41`,isoCode:`CH`,flag:`https://www.countryflags.io/CH/flat/64.png`},{name:`Syrian Arab Republic`,dialCode:`+963`,isoCode:`SY`,flag:`https://www.countryflags.io/SY/flat/64.png`},{name:`Taiwan`,dialCode:`+886`,isoCode:`TW`,flag:`https://www.countryflags.io/TW/flat/64.png`},{name:`Tajikistan`,dialCode:`+992`,isoCode:`TJ`,flag:`https://www.countryflags.io/TJ/flat/64.png`},{name:`Tanzania, United Republic of Tanzania`,dialCode:`+255`,isoCode:`TZ`,flag:`https://www.countryflags.io/TZ/flat/64.png`},{name:`Thailand`,dialCode:`+66`,isoCode:`TH`,flag:`https://www.countryflags.io/TH/flat/64.png`},{name:`Timor-Leste`,dialCode:`+670`,isoCode:`TL`,flag:`https://www.countryflags.io/TL/flat/64.png`},{name:`Togo`,dialCode:`+228`,isoCode:`TG`,flag:`https://www.countryflags.io/TG/flat/64.png`},{name:`Tokelau`,dialCode:`+690`,isoCode:`TK`,flag:`https://www.countryflags.io/TK/flat/64.png`},{name:`Tonga`,dialCode:`+676`,isoCode:`TO`,flag:`https://www.countryflags.io/TO/flat/64.png`},{name:`Trinidad and Tobago`,dialCode:`+1868`,isoCode:`TT`,flag:`https://www.countryflags.io/TT/flat/64.png`},{name:`Tunisia`,dialCode:`+216`,isoCode:`TN`,flag:`https://www.countryflags.io/TN/flat/64.png`},{name:`Turkey`,dialCode:`+90`,isoCode:`TR`,flag:`https://www.countryflags.io/TR/flat/64.png`},{name:`Turkmenistan`,dialCode:`+993`,isoCode:`TM`,flag:`https://www.countryflags.io/TM/flat/64.png`},{name:`Turks and Caicos Islands`,dialCode:`+1649`,isoCode:`TC`,flag:`https://www.countryflags.io/TC/flat/64.png`},{name:`Tuvalu`,dialCode:`+688`,isoCode:`TV`,flag:`https://www.countryflags.io/TV/flat/64.png`},{name:`Uganda`,dialCode:`+256`,isoCode:`UG`,flag:`https://www.countryflags.io/UG/flat/64.png`},{name:`Ukraine`,dialCode:`+380`,isoCode:`UA`,flag:`https://www.countryflags.io/UA/flat/64.png`},{name:`United Arab Emirates`,dialCode:`+971`,isoCode:`AE`,flag:`https://www.countryflags.io/AE/flat/64.png`},{name:`United Kingdom`,dialCode:`+44`,isoCode:`GB`,flag:`https://www.countryflags.io/GB/flat/64.png`},{name:`United States`,dialCode:`+1`,isoCode:`US`,flag:`https://www.countryflags.io/US/flat/64.png`},{name:`Uruguay`,dialCode:`+598`,isoCode:`UY`,flag:`https://www.countryflags.io/UY/flat/64.png`},{name:`Uzbekistan`,dialCode:`+998`,isoCode:`UZ`,flag:`https://www.countryflags.io/UZ/flat/64.png`},{name:`Vanuatu`,dialCode:`+678`,isoCode:`VU`,flag:`https://www.countryflags.io/VU/flat/64.png`},{name:`Venezuela, Bolivarian Republic of Venezuela`,dialCode:`+58`,isoCode:`VE`,flag:`https://www.countryflags.io/VE/flat/64.png`},{name:`Vietnam`,dialCode:`+84`,isoCode:`VN`,flag:`https://www.countryflags.io/VN/flat/64.png`},{name:`Virgin Islands, British`,dialCode:`+1284`,isoCode:`VG`,flag:`https://www.countryflags.io/VG/flat/64.png`},{name:`Virgin Islands, U.S.`,dialCode:`+1340`,isoCode:`VI`,flag:`https://www.countryflags.io/VI/flat/64.png`},{name:`Wallis and Futuna`,dialCode:`+681`,isoCode:`WF`,flag:`https://www.countryflags.io/WF/flat/64.png`},{name:`Yemen`,dialCode:`+967`,isoCode:`YE`,flag:`https://www.countryflags.io/YE/flat/64.png`},{name:`Zambia`,dialCode:`+260`,isoCode:`ZM`,flag:`https://www.countryflags.io/ZM/flat/64.png`},{name:`Zimbabwe`,dialCode:`+263`,isoCode:`ZW`,flag:`https://www.countryflags.io/ZW/flat/64.png`}],de=[`disabled`,`aria-expanded`],fe=[`placeholder`,`disabled`],pe=[`aria-selected`,`onPointerdown`,`onMouseenter`],me=Object.assign({inheritAttrs:!1},{__name:`PhoneInput`,props:{modelValue:String,placeholder:{type:String,default:`712345678`},isInvalid:Boolean,disabled:Boolean,countryCode:{type:String,default:`KE`},detectCountry:Boolean},emits:[`update:modelValue`,`clearValidationErrors`],setup(n,{emit:r}){let i=n,a=r,o=u(`inputs`),s=(0,t.ref)(null),c=(0,t.ref)(null),l=(0,t.ref)(``),d=(0,t.ref)(!1),f=(0,t.ref)(``),p=(0,t.ref)(-1),m=(0,t.ref)(q.find(e=>e.isoCode===i.countryCode.toUpperCase())??q[0]),h=e=>String(e??``).toUpperCase().split(``).map(e=>String.fromCodePoint(127462+e.charCodeAt(0)-65)).join(``),g=(0,t.computed)(()=>{let e=f.value.trim().toLowerCase();return e?q.filter(t=>t.name.toLowerCase().includes(e)||t.dialCode.includes(e)||t.isoCode.toLowerCase().includes(e)):q}),_=async()=>{i.disabled||(d.value=!d.value,d.value&&(f.value=``,p.value=-1,await(0,t.nextTick)(),c.value?.focus()))},v=e=>{m.value=e,d.value=!1,b()},y=e=>{if(e.key===`ArrowDown`)e.preventDefault(),p.value=Math.min(p.value+1,g.value.length-1);else if(e.key===`ArrowUp`)e.preventDefault(),p.value=Math.max(p.value-1,0);else if(e.key===`Enter`){e.preventDefault();let t=g.value[Math.max(p.value,0)];t&&v(t)}else e.key===`Escape`&&(d.value=!1)},b=()=>{let e=(l.value||``).replace(/^0/,``);a(`update:modelValue`,e?m.value.dialCode+e:``)},x=e=>{if(!e){l.value=``;return}let t=q.find(t=>e.startsWith(t.dialCode));t?(m.value=t,l.value=e.replace(t.dialCode,``)):l.value=e};(0,t.watch)(()=>i.modelValue,x);let S=e=>{s.value&&!s.value.contains(e.target)&&(d.value=!1)};return(0,t.onMounted)(()=>{document.addEventListener(`pointerdown`,S),x(i.modelValue),i.detectCountry&&!i.modelValue&&e.shApis.doGet(`sh-country-code`).then(e=>{let t=e.data?.countryCode,n=t&&q.find(e=>e.isoCode===t.toUpperCase());n&&(m.value=n)}).catch(()=>{})}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`pointerdown`,S)}),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`root`,ref:s,class:(0,t.normalizeClass)([(0,t.unref)(o).phone.wrapper,n.isInvalid?`border-red-500 focus-within:ring-red-500/30`:``])},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.trigger),disabled:n.disabled,"aria-haspopup":`listbox`,"aria-expanded":d.value,onClick:_},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.flag)},(0,t.toDisplayString)(h(m.value.isoCode)),3),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.dial)},(0,t.toDisplayString)(m.value.dialCode),3),((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.chevron),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2`},[...r[4]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M19.5 8.25l-7.5 7.5-7.5-7.5`},null,-1)]],2))],10,de),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[0]||=e=>l.value=e,type:`tel`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.input),placeholder:n.placeholder,disabled:n.disabled,onInput:b,onFocus:r[1]||=e=>a(`clearValidationErrors`)},null,42,fe),[[t.vModelText,l.value]]),d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).phone.dropdown)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`searchEl`,ref:c,"onUpdate:modelValue":r[2]||=e=>f.value=e,type:`text`,class:(0,t.normalizeClass)((0,t.unref)(o).phone.search),placeholder:`Search country or code...`,onKeydown:y,onInput:r[3]||=e=>p.value=0},null,34),[[t.vModelText,f.value]]),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.list),role:`listbox`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(g.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.isoCode,type:`button`,role:`option`,"aria-selected":e.isoCode===m.value.isoCode,class:(0,t.normalizeClass)(n===p.value?(0,t.unref)(o).phone.optionActive:(0,t.unref)(o).phone.option),onPointerdown:(0,t.withModifiers)(t=>v(e),[`prevent`]),onMouseenter:e=>p.value=n},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.flag)},(0,t.toDisplayString)(h(e.isoCode)),3),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.optionName)},(0,t.toDisplayString)(e.name),3),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).phone.optionDial)},(0,t.toDisplayString)(e.dialCode),3)],42,pe))),128)),g.value.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).phone.empty)},`No country matches "`+(0,t.toDisplayString)(f.value)+`"`,3))],2)],2)):(0,t.createCommentVNode)(``,!0)],2))}}),he=[`onClick`],ge=[`placeholder`,`disabled`],_e=[`onPointerdown`,`onMouseenter`],ve=Object.assign({inheritAttrs:!1},{__name:`ShSuggest`,props:{modelValue:[String,Number,Array],placeholder:{type:String,default:`Type to search...`},isInvalid:Boolean,disabled:Boolean,options:Array,url:String,multiple:Boolean,allowCustom:Boolean,optionTemplate:[Object,Function]},emits:[`update:modelValue`,`clearValidationErrors`],setup(n,{emit:r}){let i=n,a=r,o=u(`inputs`),s=(0,t.ref)(null),c=(0,t.ref)(``),l=(0,t.ref)(!1),d=(0,t.ref)(!1),f=(0,t.ref)(-1),p=(0,t.ref)([]),m=(0,t.ref)([]),h=(0,t.computed)(()=>{let e=K(i.options??p.value),t=new Set(m.value.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));if(i.options&&c.value){let e=c.value.toLowerCase();n=n.filter(t=>t.label.toLowerCase().includes(e))}return n}),g=null,_=()=>{i.url&&(clearTimeout(g),g=setTimeout(()=>{d.value=!0,e.shApis.doGet(i.url,{all:1,filter_value:c.value}).then(e=>{p.value=Array.isArray(e.data)?e.data:e.data?.data??[]}).finally(()=>{d.value=!1})},300))},v=()=>{i.multiple?a(`update:modelValue`,m.value.map(e=>e.id)):a(`update:modelValue`,m.value[0]?.id??null)},y=e=>{i.multiple?m.value.push(e):(m.value=[e],l.value=!1),c.value=``,f.value=-1,v()},b=e=>{m.value=m.value.filter(t=>t.id!==e.id),v()},x=()=>{!i.allowCustom||!c.value||y({id:c.value,label:c.value})},S=()=>{l.value=!0,a(`clearValidationErrors`),i.url&&_()},C=e=>{e.key===`ArrowDown`?(e.preventDefault(),l.value=!0,f.value=Math.min(f.value+1,h.value.length-1)):e.key===`ArrowUp`?(e.preventDefault(),f.value=Math.max(f.value-1,0)):e.key===`Enter`?(e.preventDefault(),f.value>=0&&h.value[f.value]?y(h.value[f.value]):x()):e.key===`Escape`?l.value=!1:e.key===`Backspace`&&!c.value&&m.value.length&&b(m.value[m.value.length-1])},w=()=>{let e=i.modelValue;if(e==null||e===``)return;let t=Array.isArray(e)?e:[e],n=K(i.options??p.value);m.value=t.map(e=>n.find(t=>t.id===e)??{id:e,label:String(e)})},T=e=>{s.value&&!s.value.contains(e.target)&&(l.value=!1)};return(0,t.watch)(()=>i.options,w),(0,t.onMounted)(()=>{document.addEventListener(`pointerdown`,T),w(),i.url&&!i.options&&_()}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`pointerdown`,T),clearTimeout(g)}),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`root`,ref:s,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.wrapper)},[n.multiple&&m.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.badges)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(m.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.badge)},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(o).suggest.badgeRemove),onClick:t=>b(e)},`×`,10,he)],2))),128))],2)):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`input`,(0,t.mergeProps)(e.$attrs,{"onUpdate:modelValue":r[0]||=e=>c.value=e,type:`text`,placeholder:!n.multiple&&m.value.length?m.value[0].label:n.placeholder,disabled:n.disabled,autocomplete:`off`,onInput:S,onKeydown:C,onFocus:r[1]||=e=>{l.value=!0,a(`clearValidationErrors`)}}),null,16,ge),[[t.vModelText,c.value]]),l.value&&!n.disabled?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.dropdown)},[d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.empty)},`Searching...`,2)):h.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(h.value,(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:(0,t.normalizeClass)(r===f.value?(0,t.unref)(o).suggest.optionActive:(0,t.unref)(o).suggest.option),onPointerdown:(0,t.withModifiers)(t=>y(e),[`prevent`]),onMouseenter:e=>f.value=r},[n.optionTemplate?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.optionTemplate),{key:0,option:e.raw??e},null,8,[`option`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label),1)],64))],42,_e))),128)):n.allowCustom&&c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.option),onPointerdown:(0,t.withModifiers)(x,[`prevent`])},` Use "`+(0,t.toDisplayString)(c.value)+`" `,35)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:(0,t.normalizeClass)((0,t.unref)(o).suggest.empty)},`No matches`,2))],2)):(0,t.createCommentVNode)(``,!0)],2))}}),ye=[`onUpdate:modelValue`],be=[`innerHTML`],xe=[`disabled`],Se={__name:`ShForm`,props:{action:{type:String,required:!0},method:{type:String,default:`post`},fields:{type:Array,required:!0},currentData:Object,steps:Array,submitLabel:{type:String,default:`Submit`},successMessage:String,retainData:Boolean,preSubmit:Function,hiddenId:{type:Boolean,default:!0},classes:Object,disabled:Boolean},emits:[`success`,`error`,`fieldChanged`,`preSubmit`,`formSubmitted`,`formError`],setup(n,{emit:r}){let o=n,s=r,c=u(`form`,(0,t.computed)(()=>o.classes)),l=u(`inputs`),d=(0,t.inject)(i,{}),f=(0,t.inject)(a,null),p={text:D,textarea:k,email:j,password:P,pin:F,number:U,date:G,select:ue,phone:me,suggest:ve},m=(0,t.ref)([]),h=(0,t.reactive)({}),g=(0,t.ref)(!1),_=(0,t.ref)(0),v=(0,t.ref)(!1),y=()=>{let e=b(o.fields,o.currentData);o.hiddenId&&o.currentData?.id&&!e.some(e=>e.name===`id`)&&e.push({name:`id`,type:`hidden`,value:o.currentData.id}),m.value=e};y(),(0,t.watch)(()=>o.currentData,()=>{v.value||y()},{deep:!0}),(0,t.watch)(()=>o.fields,y);let x=(0,t.computed)(()=>o.steps?.length?o.steps.map(e=>({title:e.title??``,fields:m.value.filter(t=>(e.fields??[]).includes(t.name)||t.type===`hidden`)})):[{title:``,fields:m.value}]),C=(0,t.computed)(()=>_.value>=x.value.length-1),w=e=>e.mask&&e.type!==`pin`?V:e.component??d[e.type]??p[e.type]??p.text,T=e=>h[e.name]?c.value.inputInvalid:e.type===`select`?l.value.select:c.value.input,ee=e=>({placeholder:e.placeholder||void 0,disabled:o.disabled||e.disabled,...e.type===`select`||e.type===`suggest`?{options:Array.isArray(e.options)?e.options:void 0,url:Array.isArray(e.options)?void 0:e.options?.url,multiple:e.multiple,allowCustom:e.allowCustom,optionTemplate:e.optionTemplate}:{},...e.type===`number`?{min:e.min,max:e.max,step:e.step}:{},...e.type===`textarea`?{rows:e.rows}:{},...e.type===`date`?{withTime:e.withTime,min:e.min,max:e.max}:{},...e.type===`phone`?{countryCode:e.countryCode,detectCountry:e.detectCountry}:{},...e.type===`pin`?{length:e.length??e.digits,secret:e.secret}:{},...e.mask&&e.type!==`pin`?{mask:e.mask}:{},...e.props??{}}),te=(e,t)=>{v.value=!0,delete h[e.name];let n=O();s(`fieldChanged`,e.name,t,n)},O=()=>{let e={};return m.value.forEach(t=>{t.value!==null&&t.value!==void 0&&(e[t.name]=t.value)}),e},A=()=>{m.value.forEach(e=>{e.type!==`hidden`&&(e.value=null)}),v.value=!1},ne=()=>{let e=Object.keys(h);if(!e.length||!o.steps?.length)return;let t=x.value.findIndex(t=>t.fields.some(t=>e.includes(t.name)));t>=0&&(_.value=t)},M=async()=>{if(!C.value){_.value++;return}Object.keys(h).forEach(e=>delete h[e]);let t=O();if(o.preSubmit){let e=await o.preSubmit(t);if(e===!1)return;e&&typeof e==`object`&&(t=e)}s(`preSubmit`,t);let n={post:e.shApis.doPost,put:e.shApis.doPut,patch:e.shApis.doPatch,delete:e.shApis.doDelete}[o.method.toLowerCase()]??e.shApis.doPost;g.value=!0;try{let r=await n(o.action,t);o.successMessage&&e.shRepo.showToast(o.successMessage),s(`success`,r.data),s(`formSubmitted`,r.data),o.retainData||(A(),_.value=0),f?.requestClose?.(`success`)}catch(t){if(t.response?.status===422){let e=t.response.data?.errors??{};Object.keys(e).forEach(t=>{let n=e[t];h[t]=Array.isArray(n)?n[0]:n}),ne()}else e.shRepo.showToast(t.response?.data?.message??t.message??`Request failed`,`error`);s(`error`,t),s(`formError`,t)}finally{g.value=!1}};return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`form`,{class:(0,t.normalizeClass)((0,t.unref)(c).form),onSubmit:(0,t.withModifiers)(M,[`prevent`])},[x.value.length>1?((0,t.openBlock)(),(0,t.createBlock)(S,{key:0,steps:x.value,current:_.value},null,8,[`steps`,`current`])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(x.value,(e,n)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`space-y-4`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fields,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.name,class:(0,t.normalizeClass)(e.type===`hidden`?``:(0,t.unref)(c).group)},[e.type===`hidden`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,"onUpdate:modelValue":t=>e.value=t,type:`hidden`},null,8,ye)),[[t.vModelText,e.value]]):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(c).label)},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),e.required?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(c).required)},`*`,2)):(0,t.createCommentVNode)(``,!0)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(w(e)),(0,t.mergeProps)({modelValue:e.value,"onUpdate:modelValue":t=>e.value=t},{ref_for:!0},ee(e),{"is-invalid":!!h[e.name],class:[T(e),e.class],"onUpdate:modelValue":t=>te(e,t),onClearValidationErrors:t=>delete h[e.name]}),null,16,[`modelValue`,`onUpdate:modelValue`,`is-invalid`,`class`,`onClearValidationErrors`])),e.helper?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(c).helper),innerHTML:e.helper},null,10,be)):(0,t.createCommentVNode)(``,!0),h[e.name]?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:2,class:(0,t.normalizeClass)((0,t.unref)(c).error)},(0,t.toDisplayString)(h[e.name]),3)):(0,t.createCommentVNode)(``,!0)],64))],2))),128))],512)),[[t.vShow,_.value===n]])),128)),(0,t.renderSlot)(e.$slots,`default`),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(c).nav)},[_.value>0?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(c).prevBtn),onClick:r[0]||=e=>_.value--},` Back `,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`submit`,class:(0,t.normalizeClass)(C.value?(0,t.unref)(c).submitBtn:(0,t.unref)(c).nextBtn),disabled:g.value||n.disabled},[g.value?((0,t.openBlock)(),(0,t.createBlock)(E,{key:0,class:`size-4`})):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(C.value?n.submitLabel:`Next`),1)],10,xe)],2)],34))}},Ce={__name:`ShDialog`,props:{open:Boolean,title:String,size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,retainOnSuccess:Boolean,classes:Object},emits:[`update:open`,`opened`,`closed`],setup(e,{expose:n,emit:r}){let i=e,o=r,s=u(`dialog`,(0,t.computed)(()=>i.classes)),c=(0,t.ref)(null),l=(0,t.ref)(!1),d=(0,t.ref)(!1),f=(0,t.ref)(!1),p=g({isStatic:()=>i.static,onClose:()=>o(`update:open`,!1)}),m=()=>{l.value=!0,p.show(),requestAnimationFrame(()=>{d.value=!0}),i.open||o(`update:open`,!0)},h=e=>{d.value=!1,p.close(e)},_=()=>{if(i.static){f.value=!0,setTimeout(()=>{f.value=!1},150);return}h(`backdrop`)};return(0,t.watch)(()=>i.open,e=>{e?m():d.value&&h(`prop`)},{immediate:!0}),(0,t.watch)(p.isOpen,e=>{!e&&d.value&&(d.value=!1)}),(0,t.provide)(a,{close:()=>h(`context`),requestClose:e=>{if(e===`success`){if(i.retainOnSuccess)return;setTimeout(()=>h(`success`),600);return}h(e)}}),n({show:m,close:h}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`fixed inset-0`,style:(0,t.normalizeStyle)({zIndex:(0,t.unref)(p).zIndex.value})},[(0,t.createVNode)(t.Transition,{"enter-active-class":`transition-opacity duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition-opacity duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).backdrop),onClick:_},null,2),[[t.vShow,d.value]])]),_:1}),(0,t.createVNode)(t.Transition,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0 scale-95 translate-y-2`,"enter-to-class":`opacity-100 scale-100 translate-y-0`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100 scale-100`,"leave-to-class":`opacity-0 scale-95`,onAfterEnter:r[1]||=e=>{c.value?.focus(),o(`opened`)},onAfterLeave:r[2]||=e=>{l.value=!1,o(`closed`)}},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).wrapper),onClick:(0,t.withModifiers)(_,[`self`])},[(0,t.createElementVNode)(`div`,{ref_key:`panel`,ref:c,tabindex:`-1`,role:`dialog`,"aria-modal":`true`,class:(0,t.normalizeClass)([(0,t.unref)(s).panel,(0,t.unref)(s).sizes[e.size]??(0,t.unref)(s).sizes.md,f.value?`scale-[1.02] transition-transform duration-150`:``])},[e.title||n.$slots.title||!e.hideClose?((0,t.openBlock)(),(0,t.createElementBlock)(`header`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).header)},[(0,t.renderSlot)(n.$slots,`title`,{},()=>[(0,t.createElementVNode)(`h3`,{class:(0,t.normalizeClass)((0,t.unref)(s).title)},(0,t.toDisplayString)(e.title),3)]),e.hideClose?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(s).closeBtn),"aria-label":`Close`,onClick:r[0]||=e=>h(`button`)},[...r[3]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`size-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18L18 6M6 6l12 12`})],-1)]],2))],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).body)},[(0,t.renderSlot)(n.$slots,`default`,{close:h})],2),n.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`footer`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).footer)},[(0,t.renderSlot)(n.$slots,`footer`,{close:h})],2)):(0,t.createCommentVNode)(``,!0)],2)],2),[[t.vShow,d.value]])]),_:3})],4)):(0,t.createCommentVNode)(``,!0)]))}},we={__name:`ShDrawer`,props:{open:Boolean,title:String,position:{type:String,default:`end`},size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,classes:Object},emits:[`update:open`,`opened`,`closed`],setup(e,{expose:n,emit:r}){let i=e,o=r,s=u(`drawer`,(0,t.computed)(()=>i.classes)),c=(0,t.ref)(null),l=(0,t.ref)(!1),d=(0,t.ref)(!1),f={start:{panel:`inset-y-0 left-0 h-full w-full`,hidden:`-translate-x-full`},end:{panel:`inset-y-0 right-0 h-full w-full`,hidden:`translate-x-full`},top:{panel:`inset-x-0 top-0 w-full`,hidden:`-translate-y-full`},bottom:{panel:`inset-x-0 bottom-0 w-full`,hidden:`translate-y-full`}},p=(0,t.computed)(()=>f[i.position]??f.end),m=(0,t.computed)(()=>[`top`,`bottom`].includes(i.position)),h=(0,t.computed)(()=>m.value?s.value.sizesVertical[i.size]??s.value.sizesVertical.md:s.value.sizes[i.size]??s.value.sizes.md),_=g({isStatic:()=>i.static,onClose:()=>o(`update:open`,!1)}),v=()=>{l.value=!0,_.show(),requestAnimationFrame(()=>{d.value=!0}),i.open||o(`update:open`,!0)},y=e=>{d.value=!1,_.close(e)};return(0,t.watch)(()=>i.open,e=>{e?v():d.value&&y(`prop`)},{immediate:!0}),(0,t.watch)(_.isOpen,e=>{!e&&d.value&&(d.value=!1)}),(0,t.provide)(a,{close:()=>y(`context`),requestClose:e=>y(e)}),n({show:v,close:y}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`fixed inset-0`,style:(0,t.normalizeStyle)({zIndex:(0,t.unref)(_).zIndex.value})},[(0,t.createVNode)(t.Transition,{"enter-active-class":`transition-opacity duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition-opacity duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).backdrop),onClick:r[0]||=(...e)=>(0,t.unref)(_).onBackdrop&&(0,t.unref)(_).onBackdrop(...e)},null,2),[[t.vShow,d.value]])]),_:1}),(0,t.createVNode)(t.Transition,{"enter-active-class":`transition-transform duration-250 ease-out`,"enter-from-class":p.value.hidden,"enter-to-class":`translate-x-0 translate-y-0`,"leave-active-class":`transition-transform duration-200 ease-in`,"leave-from-class":`translate-x-0 translate-y-0`,"leave-to-class":p.value.hidden,onAfterEnter:r[2]||=e=>{c.value?.focus(),o(`opened`)},onAfterLeave:r[3]||=e=>{l.value=!1,o(`closed`)}},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{ref_key:`panel`,ref:c,tabindex:`-1`,role:`dialog`,"aria-modal":`true`,class:(0,t.normalizeClass)([(0,t.unref)(s).panel,p.value.panel,h.value])},[e.title||n.$slots.title||!e.hideClose?((0,t.openBlock)(),(0,t.createElementBlock)(`header`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).header)},[(0,t.renderSlot)(n.$slots,`title`,{},()=>[(0,t.createElementVNode)(`h3`,{class:(0,t.normalizeClass)((0,t.unref)(s).title)},(0,t.toDisplayString)(e.title),3)]),e.hideClose?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(s).closeBtn),"aria-label":`Close`,onClick:r[1]||=e=>y(`button`)},[...r[4]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`size-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18L18 6M6 6l12 12`})],-1)]],2))],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).body)},[(0,t.renderSlot)(n.$slots,`default`,{close:y})],2)],2),[[t.vShow,d.value]])]),_:3},8,[`enter-from-class`,`leave-to-class`])],4)):(0,t.createCommentVNode)(``,!0)]))}},Te={__name:`ShDialogBtn`,props:{title:String,size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,btnClass:String,classes:Object},emits:[`opened`,`closed`],setup(e){let n=u(`buttons`),r=(0,t.ref)(!1);return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.btnClass??(0,t.unref)(n).secondary),onClick:a[0]||=e=>r.value=!0},[(0,t.renderSlot)(i.$slots,`trigger`,{},()=>[a[4]||=(0,t.createTextVNode)(`Open`,-1)])],2),(0,t.createVNode)(Ce,{open:r.value,"onUpdate:open":a[1]||=e=>r.value=e,title:e.title,size:e.size,static:e.static,"hide-close":e.hideClose,classes:e.classes,onOpened:a[2]||=e=>i.$emit(`opened`),onClosed:a[3]||=e=>i.$emit(`closed`)},(0,t.createSlots)({default:(0,t.withCtx)(({close:e})=>[(0,t.renderSlot)(i.$slots,`default`,{close:e})]),_:2},[i.$slots.footer?{name:`footer`,fn:(0,t.withCtx)(({close:e})=>[(0,t.renderSlot)(i.$slots,`footer`,{close:e})]),key:`0`}:void 0]),1032,[`open`,`title`,`size`,`static`,`hide-close`,`classes`])],64))}},Ee={__name:`ShDrawerBtn`,props:{title:String,position:{type:String,default:`end`},size:{type:String,default:`md`},static:Boolean,hideClose:Boolean,btnClass:String,classes:Object},emits:[`opened`,`closed`],setup(e){let n=u(`buttons`),r=(0,t.ref)(!1);return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.btnClass??(0,t.unref)(n).secondary),onClick:a[0]||=e=>r.value=!0},[(0,t.renderSlot)(i.$slots,`trigger`,{},()=>[a[4]||=(0,t.createTextVNode)(`Open`,-1)])],2),(0,t.createVNode)(we,{open:r.value,"onUpdate:open":a[1]||=e=>r.value=e,title:e.title,position:e.position,size:e.size,static:e.static,"hide-close":e.hideClose,classes:e.classes,onOpened:a[2]||=e=>i.$emit(`opened`),onClosed:a[3]||=e=>i.$emit(`closed`)},{default:(0,t.withCtx)(({close:e})=>[(0,t.renderSlot)(i.$slots,`default`,{close:e})]),_:3},8,[`open`,`title`,`position`,`size`,`static`,`hide-close`,`classes`])],64))}},De={__name:`ShDialogForm`,props:{title:String,size:{type:String,default:`md`},static:Boolean,retainDialog:Boolean,btnClass:String,dialogClasses:Object,action:{type:String,required:!0},method:{type:String,default:`post`},fields:{type:Array,required:!0},currentData:Object,steps:Array,submitLabel:{type:String,default:`Submit`},successMessage:String,retainData:Boolean,preSubmit:Function,hiddenId:{type:Boolean,default:!0},classes:Object},emits:[`success`,`error`,`fieldChanged`,`opened`,`closed`],setup(e,{expose:n,emit:r}){let i=e,a=r,o=u(`buttons`),s=(0,t.ref)(!1),c=(0,t.computed)(()=>JSON.stringify(i.currentData??{})),l=e=>{a(`success`,e)};return n({show:()=>{s.value=!0},close:()=>{s.value=!1}}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.btnClass??(0,t.unref)(o).primary),onClick:r[0]||=e=>s.value=!0},[(0,t.renderSlot)(n.$slots,`trigger`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.title??`Open form`),1)])],2),(0,t.createVNode)(Ce,{open:s.value,"onUpdate:open":r[3]||=e=>s.value=e,title:e.title,size:e.size,static:e.static,"retain-on-success":e.retainDialog,classes:e.dialogClasses,onOpened:r[4]||=e=>n.$emit(`opened`),onClosed:r[5]||=e=>n.$emit(`closed`)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)(Se,{key:c.value,action:e.action,method:e.method,fields:e.fields,"current-data":e.currentData,steps:e.steps,"submit-label":e.submitLabel,"success-message":e.successMessage,"retain-data":e.retainData,"pre-submit":e.preSubmit,"hidden-id":e.hiddenId,classes:e.classes,onSuccess:l,onError:r[1]||=e=>n.$emit(`error`,e),onFieldChanged:r[2]||=(e,t,r)=>n.$emit(`fieldChanged`,e,t,r)},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},8,[`action`,`method`,`fields`,`current-data`,`steps`,`submit-label`,`success-message`,`retain-data`,`pre-submit`,`hidden-id`,`classes`]))]),_:3},8,[`open`,`title`,`size`,`static`,`retain-on-success`,`classes`])],64))}},Oe=`sh_tw_table_cache`,J=`pages`,Y=`rows`,ke=1,Ae=3e3,je=null;function Me(){return je||(je=new Promise((e,t)=>{let n=indexedDB.open(Oe,ke);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(J)||t.createObjectStore(J),t.objectStoreNames.contains(Y)||t.createObjectStore(Y)},n.onsuccess=t=>e(t.target.result),n.onerror=e=>t(e.target.error)}),je)}function X(){try{let t=e.shStorage.getItem(`user`);return t?.id?`u${t.id}_`:``}catch{return``}}function Z(e,t,n){return Me().then(r=>new Promise((i,a)=>{let o=n(r.transaction(e,t).objectStore(e));o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)})).catch(e=>{console.error(`[sh-tailwind] table cache error`,e)})}async function Ne(e){return(await Z(J,`readonly`,t=>t.get(X()+e)))?.response??null}function Pe(e,t){return Z(J,`readwrite`,n=>n.put({response:t,timestamp:Date.now()},X()+e))}async function Fe(e){return(await Z(Y,`readonly`,t=>t.get(X()+e)))?.rows??[]}async function Ie(e,t){if(!Array.isArray(t)||!t.length)return;let n=await Fe(e),r=new Map;n.forEach(e=>{e&&e.id!==void 0&&r.set(e.id,e)}),t.forEach(e=>{e&&e.id!==void 0&&r.set(e.id,e)});let i=[...r.values()];return i.length>Ae&&(i=i.slice(i.length-Ae)),Z(Y,`readwrite`,t=>t.put({rows:i,timestamp:Date.now()},X()+e))}async function Le(){await Z(J,`readwrite`,e=>e.clear()),await Z(Y,`readwrite`,e=>e.clear())}var Q={getPage:Ne,setPage:Pe,getRows:Fe,mergeRows:Ie,clear:Le};function $(e,t){return!e||!t||typeof t!=`string`?``:t.split(`.`).reduce((e,t)=>e?e[t]:``,e)}function Re(e,t,n,r=0){if(e==null)return!1;if(typeof e==`object`)return r>2?!1:Object.values(e).some(e=>Re(e,t,n,r+1));let i=String(e).toLowerCase();return n?i===t:i.includes(t)}function ze(e,{search:t,exact:n,orderBy:r,orderMethod:i,page:a,perPage:o}={}){let s=e;if(t){let r=String(t).toLowerCase();s=e.filter(e=>Re(e,r,!!n))}if(r){let e=i===`asc`?1:-1;s=[...s].sort((t,n)=>{let i=$(t,r),a=$(n,r);return typeof i==`number`&&typeof a==`number`?(i-a)*e:String(i??``).localeCompare(String(a??``),void 0,{numeric:!0})*e})}let c=s.length,l=Math.max(1,Number(o)||10),u=Math.max(1,Math.ceil(c/l)),d=Math.min(Math.max(1,Number(a)||1),u),f=(d-1)*l;return{data:s.slice(f,f+l),total:c,per_page:l,current_page:d,last_page:u,from:c===0?0:f+1}}function Be({query:n,cacheEnabled:r=()=>!1,networkTimeout:i=()=>1e4}){let a=(0,t.ref)([]),o=(0,t.ref)(null),s=(0,t.ref)(`loading`),c=(0,t.ref)(``),l=(0,t.ref)(!1),u=(0,t.ref)(!1),d=0,f=(e,t)=>e+`|`+JSON.stringify(t),p=(e,{append:t=!1}={})=>{t?a.value.push(...e.data??[]):a.value=e.data??[],o.value={total:e.total??a.value.length,per_page:e.per_page,current_page:e.current_page??1,last_page:e.last_page??1,from:e.from??1},s.value=`done`};return{records:a,meta:o,status:s,error:c,offline:l,fromCache:u,load:async({append:t=!1}={})=>{let o=++d,{endpoint:m,params:h}=n(),g=f(m,h),_=!!r(),v=!1;if(a.value.length||(s.value=`loading`),_&&!t){let e=await Q.getPage(g);e&&o===d&&(p(e),u.value=!0,v=!0)}try{let n=await e.shApis.doGet(m,h,{timeout:i()});if(o!==d)return;let r=n.data?.data??n.data;return p(r,{append:t}),l.value=!1,u.value=!1,c.value=``,_&&(Q.setPage(g,r),Q.mergeRows(m,r.data)),r}catch(e){if(o!==d)return;if(e.response){v||(s.value=`error`,c.value=`${e.response.status}: ${e.response.statusText} (${m})`);return}if(l.value=!0,v)return;if(_){let e=await Q.getRows(m);if(o!==d)return;if(e.length){p(ze(e,{search:h.filter_value,exact:h.exact,orderBy:h.order_by,orderMethod:h.order_method,page:h.page,perPage:h.per_page}),{append:!1}),u.value=!0;return}}s.value=`error`,c.value=`You appear to be offline and there is no cached data yet`}}}}var Ve=[`value`],He=[`value`],Ue=[`disabled`],We=[`disabled`],Ge=[`onClick`],Ke=[`disabled`],qe={__name:`ShTablePagination`,props:{meta:{type:Object,required:!0},perPage:Number,mode:{type:String,default:`pages`},loading:Boolean,theme:{type:Object,required:!0}},emits:[`page`,`perPage`,`loadMore`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>Math.min(r.meta.current_page*r.meta.per_page,r.meta.total)),o=(0,t.computed)(()=>{let e=r.meta.last_page,t=r.meta.current_page;if(e<=7)return Array.from({length:e},(e,t)=>t+1);let n=[1];t>3&&n.push(`...`);for(let r=Math.max(2,t-1);r<=Math.min(e-1,t+1);r++)n.push(r);return t<e-2&&n.push(`...`),n.push(e),n});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)(e.theme.wrapper)},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)(e.theme.info)},[(0,t.createTextVNode)(` Showing `+(0,t.toDisplayString)(a.value)+` of `+(0,t.toDisplayString)(e.meta.total)+` `,1),(0,t.createElementVNode)(`select`,{value:e.perPage,class:(0,t.normalizeClass)([e.theme.perPage,`ml-2`]),onChange:r[0]||=e=>i(`perPage`,Number(e.target.value))},[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([10,20,30,50,100],e=>(0,t.createElementVNode)(`option`,{key:e,value:e},(0,t.toDisplayString)(e)+` / page`,9,He)),64))],42,Ve)],2),e.mode===`loadMore`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)(e.theme.loadMore),disabled:e.loading||e.meta.current_page>=e.meta.last_page,onClick:r[1]||=e=>i(`loadMore`)},(0,t.toDisplayString)(e.meta.current_page>=e.meta.last_page?`All loaded`:`Load more`),11,Ue)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)(e.theme.pages)},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.theme.pageBtn),disabled:e.meta.current_page<=1,"aria-label":`Previous page`,onClick:r[2]||=t=>i(`page`,e.meta.current_page-1)},` ‹ `,10,We),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:r},[n===`...`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)(e.theme.ellipsis)},`…`,2)):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:(0,t.normalizeClass)(n===e.meta.current_page?e.theme.pageBtnActive:e.theme.pageBtn),onClick:e=>i(`page`,n)},(0,t.toDisplayString)(n),11,Ge))],64))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)(e.theme.pageBtn),disabled:e.meta.current_page>=e.meta.last_page,"aria-label":`Next page`,onClick:r[3]||=t=>i(`page`,e.meta.current_page+1)},` › `,10,Ke)],2))],2))}},Je={key:0,class:`flex w-full items-center gap-3 md:w-auto`},Ye=[`placeholder`],Xe=[`checked`],Ze=[`onClick`],Qe={key:0},$e={key:0},et=[`colspan`],tt=[`onClick`],nt=[`checked`,`onChange`],rt=[`innerHTML`],it=[`onClick`],at=[`onClick`],ot=[`checked`,`onChange`],st=[`innerHTML`],ct=[`onClick`],lt={class:`text-sm text-gray-700`},ut={class:`flex items-center gap-2`},dt=[`onClick`],ft={__name:`ShTable`,props:{endpoint:{type:String,required:!0},columns:{type:Array,required:!0},actions:{type:Array,default:()=>[]},multiActions:{type:Array,default:()=>[]},searchable:{type:Boolean,default:!0},searchPlaceholder:{type:String,default:`Search`},hasRange:Boolean,perPage:Number,sortBy:String,sortMethod:{type:String,default:`desc`},paginationStyle:String,rowLink:String,cache:{type:Boolean,default:null},networkTimeout:{type:Number,default:1e4},reload:[Number,String,Boolean],emptyMessage:{type:String,default:`No records found`},classes:Object},emits:[`rowClick`,`loaded`,`action`],setup(n,{expose:r,emit:i}){let a=n,o=i,s=u(`table`,(0,t.computed)(()=>a.classes)),c=(0,e.useUserStore)(),l=(0,t.getCurrentInstance)()?.appContext.config.globalProperties.$router??null,d=e=>{l?l.push(e):window.location.href=e},f=(0,t.computed)(()=>a.columns.map(e=>{let t=typeof e==`string`?{name:e}:{...e};return t.label=t.label??_(t.name.split(`.`).pop()),t.sortable=t.sortable??!t.component,t}).filter(e=>e.show?e.show():!0)),p=()=>`sh_table_per_page_${typeof window<`u`?window.location.pathname:`server`}_${a.endpoint}`.replace(/[^a-z0-9]+/gi,`_`).toLowerCase(),m=()=>{let t=Number(e.shStorage.getItem(p()));return t>0?t:Number(a.perPage??(0,e.getShConfig)(`tablePerPage`,10))},h=(0,t.ref)(1),g=(0,t.ref)(m()),v=(0,t.ref)(``),y=(0,t.ref)(!1),b=(0,t.ref)(a.sortBy),x=(0,t.ref)(a.sortMethod),S=(0,t.ref)(null),C=(0,t.ref)(null),w=(0,t.ref)(``),T=(0,t.ref)(``),ee=(0,t.computed)(()=>a.paginationStyle??(0,e.getShConfig)(`tablePaginationStyle`,`pages`)),te=(0,t.computed)(()=>a.cache===null?!!(0,e.getShConfig)(`enableTableCache`,!1):a.cache),{records:D,meta:O,status:k,error:A,offline:j,fromCache:ne,load:M}=Be({query:()=>{let e={order_by:b.value,order_method:x.value,per_page:g.value,page:h.value,filter_value:v.value,paginated:!0,from:S.value,to:C.value,exact:y.value||null};return Object.keys(e).forEach(t=>{(e[t]===null||e[t]===``||e[t]===void 0)&&delete e[t]}),{endpoint:a.endpoint,params:e}},cacheEnabled:()=>te.value,networkTimeout:()=>a.networkTimeout}),N=async({append:e=!1}={})=>{let t=await M({append:e});t&&o(`loaded`,t)};N();let P=null,re=()=>{clearTimeout(P),P=setTimeout(()=>{h.value=1,N()},500)};(0,t.onBeforeUnmount)(()=>clearTimeout(P));let F=e=>{if(!e)return null;let[t,n,r]=e.split(`-`);return`${n}/${r}/${t}`},ie=()=>{S.value=F(w.value),C.value=F(T.value),h.value=1,N()},ae=e=>{e.sortable&&(b.value===e.name?x.value=x.value===`desc`?`asc`:`desc`:(b.value=e.name,x.value=`desc`),N())},oe=e=>{h.value=e,N()},I=t=>{g.value=t,h.value=1,e.shStorage.setItem(p(),t),N()},L=()=>{h.value++,N({append:!0})};(0,t.watch)(()=>a.reload,()=>N()),(0,t.watch)(()=>a.endpoint,()=>{h.value=1,g.value=m(),N()});let R=(t,n)=>{let r=$(t,n.name);if(r==null||r===``)return``;switch(n.format){case`date`:return e.shRepo.formatDate(r,`ll`);case`datetime`:return e.shRepo.formatDate(r);case`number`:return e.shRepo.formatNumber(r);case`money`:return e.shRepo.formatNumber(r,2);default:return r}},z=e=>!e.permission||c.isAllowedTo(e.permission),B=e=>a.actions.filter(t=>z(t)&&(t.show?t.show(e):!0)),V=(0,t.computed)(()=>a.multiActions.filter(z)),H=(e,t)=>String(e).replace(/\{(.*?)\}/g,(e,n)=>$(t,n)),U=async(t,n)=>{if(t.handler)return t.handler(n);if(t.emit){o(`action`,t.emit,n),o(t.emit,n);return}if(t.link)return d(H(t.link,n));if(t.url){let r=H(t.url,n);if(t.confirm){let n=await e.shRepo.runPlainRequest(r,t.confirm,t.label,t.data);n.isConfirmed&&n.value?.success?(e.shRepo.showToast(n.value.response?.message??`Action successful`),N()):n.isConfirmed&&e.shRepo.showToast(t.failMessage??`Action failed`,`error`);return}try{let n=await e.shApis.doPost(r,t.data);e.shRepo.showToast(n.data?.message??`Action successful`),N()}catch(t){e.shRepo.showToast(t.response?.data?.message??`Action failed`,`error`)}}},W=e=>{o(`rowClick`,e),a.rowLink&&d(H(a.rowLink,e))},G=(0,t.ref)([]),K=(0,t.computed)(()=>D.value.length>0&&G.value.length===D.value.length),se=()=>{G.value=K.value?[]:D.value.map(e=>e.id)},ce=e=>{let t=G.value.indexOf(e);t>-1?G.value.splice(t,1):G.value.push(e)},le=e=>{let t=D.value.filter(e=>G.value.includes(e.id));e.handler?.(t),G.value=[]},ue=(0,t.computed)(()=>f.value.length+ +!!V.value.length+ +!!a.actions.length);return r({reload:()=>N(),records:D}),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).wrapper)},[n.searchable||n.hasRange?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).toolbar)},[n.searchable?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Je,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[0]||=e=>v.value=e,type:`search`,placeholder:n.searchPlaceholder,class:(0,t.normalizeClass)((0,t.unref)(s).search),onInput:re},null,42,Ye),[[t.vModelText,v.value]]),v.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).exactLabel)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[1]||=e=>y.value=e,type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),onChange:r[2]||=e=>N()},null,34),[[t.vModelCheckbox,y.value]]),r[10]||=(0,t.createTextVNode)(` Exact `,-1)],2)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),n.hasRange?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).rangeWrapper)},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[3]||=e=>w.value=e,type:`date`,class:(0,t.normalizeClass)((0,t.unref)(s).rangeInput),onChange:ie},null,34),[[t.vModelText,w.value]]),r[11]||=(0,t.createElementVNode)(`span`,{class:`text-xs text-gray-400`},`to`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[4]||=e=>T.value=e,type:`date`,class:(0,t.normalizeClass)((0,t.unref)(s).rangeInput),onChange:ie},null,34),[[t.vModelText,T.value]])],2)):(0,t.createCommentVNode)(``,!0)],2)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(j)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).offline)},[...r[12]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`size-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M12 9v3.75m0 3.75h.008v.008H12v-.008zM3.34 17.25h17.32c1.16 0 1.88-1.25 1.3-2.25L13.3 4.5c-.58-1-2.02-1-2.6 0L2.04 15c-.58 1 .14 2.25 1.3 2.25z`})],-1),(0,t.createElementVNode)(`span`,null,`You appear to be offline — showing cached results. Search and pagination run on cached data.`,-1)]],2)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(k)===`error`&&!(0,t.unref)(D).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:(0,t.normalizeClass)((0,t.unref)(s).error)},(0,t.toDisplayString)((0,t.unref)(A)),3)):(0,t.unref)(k)===`loading`&&!(0,t.unref)(D).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:(0,t.normalizeClass)((0,t.unref)(s).loading)},[(0,t.createVNode)(E,{class:`size-6`})],2)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).container)},[(0,t.createElementVNode)(`table`,{class:(0,t.normalizeClass)((0,t.unref)(s).table)},[(0,t.createElementVNode)(`thead`,{class:(0,t.normalizeClass)((0,t.unref)(s).thead)},[(0,t.createElementVNode)(`tr`,null,[V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:0,class:(0,t.normalizeClass)([(0,t.unref)(s).th,`w-10`])},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),checked:K.value,onChange:se},null,42,Xe)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.name,class:(0,t.normalizeClass)((0,t.unref)(s).th)},[e.sortable?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).sortBtn),onClick:t=>ae(e)},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),b.value===e.name?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Qe,(0,t.toDisplayString)(x.value===`desc`?`↓`:`↑`),1)):(0,t.createCommentVNode)(``,!0)],10,Ze)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label),1)],64))],2))),128)),n.actions.length?((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:1,class:(0,t.normalizeClass)([(0,t.unref)(s).th,`text-right`])},`Actions`,2)):(0,t.createCommentVNode)(``,!0)])],2),(0,t.createElementVNode)(`tbody`,{class:(0,t.normalizeClass)((0,t.unref)(s).tbody)},[(0,t.unref)(D).length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,$e,[(0,t.createElementVNode)(`td`,{colspan:ue.value,class:(0,t.normalizeClass)((0,t.unref)(s).empty)},[(0,t.renderSlot)(e.$slots,`empty`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.emptyMessage),1)])],10,et)])),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(D),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:i.id??a,class:(0,t.normalizeClass)([(0,t.unref)(s).tr,n.rowLink?(0,t.unref)(s).trClickable:``]),onClick:e=>W(i)},[V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).td),onClick:r[5]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),checked:G.value.includes(i.id),onChange:e=>ce(i.id)},null,42,nt)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:n.name,class:(0,t.normalizeClass)([(0,t.unref)(s).td,n.class])},[(0,t.renderSlot)(e.$slots,`cell-${n.name}`,{row:i,value:R(i,n),index:a},()=>[n.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.component),{key:0,row:i,value:(0,t.unref)($)(i,n.name)},null,8,[`row`,`value`])):n.format===`money`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).money)},(0,t.toDisplayString)(R(i,n)),3)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,innerHTML:R(i,n)},null,8,rt))])],2))),128)),n.actions.length?((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).actionsCell),onClick:r[6]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.renderSlot)(e.$slots,`actions`,{row:i},()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(B(i),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:e.label,class:(0,t.normalizeClass)([(0,t.unref)(s).actionBtn,e.class]),onClick:t=>U(e,i)},(0,t.toDisplayString)(e.label),11,it))),128))])],2)):(0,t.createCommentVNode)(``,!0)],10,tt))),128))],2)],2)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).cards)},[(0,t.unref)(D).length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(s).empty)},[(0,t.renderSlot)(e.$slots,`empty`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.emptyMessage),1)])],2)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(D),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i.id??a,class:(0,t.normalizeClass)([(0,t.unref)(s).card,n.rowLink?(0,t.unref)(s).trClickable:``]),onClick:e=>W(i)},[V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)([(0,t.unref)(s).exactLabel,`mb-2`]),onClick:r[7]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:(0,t.normalizeClass)((0,t.unref)(s).checkbox),checked:G.value.includes(i.id),onChange:e=>ce(i.id)},null,42,ot),r[13]||=(0,t.createTextVNode)(` Select `,-1)],2)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.name},[(0,t.createElementVNode)(`p`,{class:(0,t.normalizeClass)((0,t.unref)(s).cardLabel)},(0,t.toDisplayString)(n.label),3),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(s).cardValue)},[(0,t.renderSlot)(e.$slots,`cell-${n.name}`,{row:i,value:R(i,n),index:a},()=>[n.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.component),{key:0,row:i,value:(0,t.unref)($)(i,n.name)},null,8,[`row`,`value`])):n.format===`money`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:(0,t.normalizeClass)((0,t.unref)(s).money)},(0,t.toDisplayString)(R(i,n)),3)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,innerHTML:R(i,n)},null,8,st))])],2)],64))),128)),n.actions.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`mt-2`,onClick:r[8]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.renderSlot)(e.$slots,`actions`,{row:i},()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(B(i),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:e.label,class:(0,t.normalizeClass)([(0,t.unref)(s).actionBtn,e.class]),onClick:t=>U(e,i)},(0,t.toDisplayString)(e.label),11,ct))),128))])])):(0,t.createCommentVNode)(``,!0)],10,at))),128))],2),(0,t.unref)(O)&&(0,t.unref)(D).length?((0,t.openBlock)(),(0,t.createBlock)(qe,{key:0,meta:(0,t.unref)(O),"per-page":g.value,mode:ee.value,loading:(0,t.unref)(k)===`loading`,theme:(0,t.unref)(s).pagination,onPage:oe,onPerPage:I,onLoadMore:L},null,8,[`meta`,`per-page`,`mode`,`loading`,`theme`])):(0,t.createCommentVNode)(``,!0)],64)),G.value.length&&V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:5,class:(0,t.normalizeClass)((0,t.unref)(s).multiBar)},[(0,t.createElementVNode)(`div`,lt,[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(s).multiCount)},(0,t.toDisplayString)(G.value.length),3),r[14]||=(0,t.createTextVNode)(` selected `,-1)]),(0,t.createElementVNode)(`div`,ut,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(V.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.label,type:`button`,class:(0,t.normalizeClass)([(0,t.unref)(s).multiBtn,e.class]),onClick:t=>le(e)},(0,t.toDisplayString)(e.label),11,dt))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)((0,t.unref)(s).multiBtn),onClick:r[9]||=e=>G.value=[]},`Cancel`,2)])],2)):(0,t.createCommentVNode)(``,!0)],2))}},pt={__name:`ShConfirmAction`,props:{url:{type:String,required:!0},data:Object,title:String,message:String,loadingMessage:{type:String,default:`Processing...`},successMessage:{type:String,default:`Action Successful`},failMessage:{type:String,default:`Action failed`},tag:{type:String,default:`button`},btnClass:String},emits:[`success`,`failed`,`canceled`,`actionSuccessful`,`actionFailed`,`actionCanceled`],setup(n,{emit:r}){let i=n,a=r,o=u(`buttons`),s=(0,t.ref)(!1),c=t=>{s.value=!1,a(`actionSuccessful`,t),a(`success`,t),(i.successMessage||t?.message)&&e.shRepo.showToast(t?.message??i.successMessage)},l=t=>{s.value=!1,a(`actionFailed`,t),a(`failed`,t),(i.failMessage||t?.value?.message)&&e.shRepo.showToast(t?.value?.message??i.failMessage,`error`)};function d(){s.value=!0,e.shRepo.runPlainRequest(i.url,i.message,i.title,i.data).then(e=>{e.isConfirmed?e.value?.success?c(e.value.response):l(e):(s.value=!1,a(`actionCanceled`),a(`canceled`))}).catch(e=>{l(e)})}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.tag),{class:(0,t.normalizeClass)([n.btnClass??(0,t.unref)(o).link,s.value?`pointer-events-none opacity-60`:``]),onClick:d},{default:(0,t.withCtx)(()=>[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)(E,{class:`size-4`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(n.loadingMessage),1)],64)):(0,t.renderSlot)(e.$slots,`default`,{key:1})]),_:3},8,[`class`]))}},mt={__name:`ShSilentAction`,props:{url:{type:String,required:!0},data:Object,method:{type:String,default:`POST`},loadingMessage:{type:String,default:`Processing`},successMessage:{type:String,default:`Action Successful`},failMessage:{type:String,default:`Action failed`},disableSuccessMessage:Boolean,tag:{type:String,default:`button`},btnClass:String},emits:[`success`,`failed`,`actionSuccessful`,`actionFailed`],setup(n,{emit:r}){let i=n,a=r,o=u(`buttons`),s=(0,t.ref)(!1),c={GET:e.shApis.doGet,POST:e.shApis.doPost,PUT:e.shApis.doPut,DELETE:e.shApis.doDelete};function l(){s.value=!0,(c[i.method.toUpperCase()]??e.shApis.doPost)(i.url,i.data).then(t=>{s.value=!1,a(`actionSuccessful`,t),a(`success`,t),i.disableSuccessMessage||e.shRepo.showToast(t.data?.message??i.successMessage)}).catch(t=>{s.value=!1,a(`actionFailed`,t),a(`failed`,t),e.shRepo.showToast(t?.message??i.failMessage,`error`)})}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.tag),{class:(0,t.normalizeClass)([n.btnClass??(0,t.unref)(o).link,s.value?`pointer-events-none opacity-60`:``]),onClick:l},{default:(0,t.withCtx)(()=>[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)(E,{class:`size-4`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(n.loadingMessage),1)],64)):(0,t.renderSlot)(e.$slots,`default`,{key:1})]),_:3},8,[`class`]))}};exports.DateInput=G,exports.EmailInput=j,exports.MaskedInput=V,exports.NumberInput=U,exports.PasswordInput=P,exports.PhoneInput=me,exports.PinInput=F,exports.SH_DIALOG_CONTEXT=a,exports.SH_TW_COMPONENTS=i,exports.SH_TW_THEME=r,exports.SelectInput=ue,exports.ShConfirmAction=pt,exports.ShDialog=Ce,exports.ShDialogBtn=Te,exports.ShDialogForm=De,exports.ShDrawer=we,exports.ShDrawerBtn=Ee,exports.ShForm=Se,exports.ShFormSteps=S,exports.ShSilentAction=mt,exports.ShSpinner=E,exports.ShSuggest=ve,exports.ShTable=ft,exports.ShTablePagination=qe,exports.ShTailwind=c,exports.TextAreaInput=k,exports.TextInput=D,exports.applyMask=R,exports.clearTableCache=Le,exports.countries=q,exports.createShTailwind=l,exports.defaultTheme=n,exports.localQuery=ze,exports.maskMoney=L,exports.maskPattern=I,exports.shTableCache=Q,exports.useDialog=g,exports.useTableData=Be,exports.useTheme=u;