@platforma-sdk/ui-vue 1.8.19 → 1.8.21
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.
- package/CHANGELOG.md +13 -0
- package/dist/lib.js +7 -4
- package/dist/lib.umd.cjs +2 -2
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/PlAgDataTable/PlAgDataTable.vue +6 -3
package/dist/lib.umd.cjs
CHANGED
|
@@ -62,7 +62,7 @@ ${r}}
|
|
|
62
62
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
|
|
63
63
|
</svg>
|
|
64
64
|
`,vx=["innerHTML"],yx={class:"dropdown-list-item__title-container"},bx={class:"dropdown-list-item__title text-s"},wx={key:0,class:"dropdown-list-item__description text-description"},xx={key:1,class:"dropdown-list-item__icon flex-self-start"},aa=n.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,r=n.computed(()=>{const s=[];return e.size==="small"&&s.push("dropdown-list-item__small"),e.isSelected&&s.push("dropdown-list-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")}),o=n.computed(()=>{const s=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&s.push("checked"),s.join(" ")}),i=n.computed(()=>e.isSelected?mx:fx);return(s,d)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([r.value,"dropdown-list-item"])},[e.useCheckbox?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(o.value),innerHTML:i.value},null,10,vx)):n.createCommentVNode("",!0),d[1]||(d[1]=n.createTextVNode()),n.createElementVNode("div",yx,[n.createElementVNode("div",bx,n.toDisplayString(s.option.label),1),d[0]||(d[0]=n.createTextVNode()),s.option.description?(n.openBlock(),n.createElementBlock("div",wx,n.toDisplayString(s.option.description),1)):n.createCommentVNode("",!0)]),d[2]||(d[2]=n.createTextVNode()),!e.useCheckbox&&e.isSelected?(n.openBlock(),n.createElementBlock("div",xx)):n.createCommentVNode("",!0)],2))}}),vs=n.defineComponent({__name:"LongText",setup(t){n.useCssVars(f=>({"8d68520c":d.value}));const e=n.ref(!1),r=n.ref(),o=n.ref(!1),i=n.computed(()=>o.value&&e.value?"ui-lt-animate":""),s=Au(f=>o.value=f,500),d=n.computed(()=>{var f;return r.value?`${((f=r.value)==null?void 0:f.innerHTML.length)*.4}s`:"5s"});function u(){const f=os(r.value,"span cannot be empty");e.value=f.clientWidth<f.scrollWidth}function p(){u(),s(!0)}function h(){s(!1)}return(f,y)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps(f.$attrs,{class:"ui-lt-container"}),[n.createElementVNode("span",{onMouseover:p,onMouseleave:h},[n.createElementVNode("span",{ref_key:"span",ref:r,class:n.normalizeClass(i.value)},[n.renderSlot(f.$slots,"default")],2)],32)],16))}}),Lr=n.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,r=n.computed(()=>`mask-24 mask-${e.name}`);return(o,i)=>(n.openBlock(),n.createElementBlock("i",{class:n.normalizeClass(r.value)},null,2))}}),Cx={class:"pl-dropdown__envelope"},_x=["tabindex"],kx={class:"pl-dropdown__container"},Sx={class:"pl-dropdown__field"},Tx=["disabled","placeholder"],Ex={class:"pl-dropdown__controls"},Nx={key:0},Ax={key:0,class:"required-icon"},Mx={key:0,class:"nothing-found"},Bx={key:0,class:"pl-dropdown__error"},Px={key:1,class:"pl-dropdown__helper"},Dx={key:2,class:"pl-dropdown__helper"},Vx={name:"PlDropdown"},ys=n.defineComponent({...Vx,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const r=e,o=t,i=n.useSlots(),s=n.ref(),d=n.ref(),u=n.ref(),p=n.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),h=()=>na(R.value.findIndex(B=>Et(B.value,o.modelValue)),B=>B<0?0:B),f=()=>p.activeIndex=h(),y=n.computed(()=>o.options===void 0),S=n.computed(()=>y.value?!0:o.disabled),k=n.computed(()=>(o.options??[]).findIndex(B=>Et(B.value,o.modelValue))),D=n.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&k.value===-1)return"The selected value is not one of the options"}}),E=n.computed(()=>Bn(o.options??[]).map((B,O)=>({...B,index:O,isSelected:O===k.value,isActive:O===p.activeIndex}))),A=n.computed(()=>{const B=n.unref(E).find(O=>Et(O.value,o.modelValue));return(B==null?void 0:B.label)||o.modelValue}),w=n.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(A.value):o.placeholder),L=n.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),R=n.computed(()=>{const B=E.value;return p.search?B.filter(O=>{const X=p.search.toLowerCase();return O.label.toLowerCase().includes(X)||O.description&&O.description.toLowerCase().includes(X)?!0:typeof O.value=="string"?O.value.toLowerCase().includes(X):O.value===p.search}):B}),H=n.computed(()=>S.value?void 0:"0"),G=B=>{var O;r("update:modelValue",B),p.search="",p.open=!1,(O=s==null?void 0:s.value)==null||O.focus()},K=()=>r("update:modelValue",void 0),U=()=>{var B;return(B=u.value)==null?void 0:B.focus()},P=()=>p.open=!p.open,W=()=>p.open=!0,F=B=>{var O,X;const ye=B.relatedTarget;!((O=s.value)!=null&&O.contains(ye))&&!((X=d.value)!=null&&X.contains(ye))&&(p.search="",p.open=!1)},Y=()=>{const B=d.value;B&&ot(B.querySelector(".hovered-item"),O=>{oa(B,O)})},ue=B=>{var O,X;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(B.code))B.preventDefault();else return;const{open:ye,activeIndex:_e}=p;if(!ye){B.code==="Enter"&&(p.open=!0);return}B.code==="Escape"&&(p.open=!1,(O=s.value)==null||O.focus());const zt=n.unref(R),{length:Ht}=zt;if(!Ht)return;B.code==="Enter"&&G((X=zt.find(Ea=>Ea.index===_e))==null?void 0:X.value);const Nt=zt.findIndex(Ea=>Ea.index===_e)??-1,Ta=B.code==="ArrowDown"?1:B.code==="ArrowUp"?-1:0,On=Math.abs(Nt+Ta+Ht)%Ht;p.activeIndex=R.value[On].index??-1};Vr(s),n.watch(()=>o.modelValue,f,{immediate:!0}),n.watch(()=>p.open,B=>{var O;return B?(O=u.value)==null?void 0:O.focus():""}),n.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&Y()});const j=n.reactive({top:"0px",left:"0px",width:"0px"});return n.watch(d,B=>{if(B){const O=B.getBoundingClientRect();p.optionsHeight=O.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ra(s,B=>{const O=B.top+B.height+3;O+p.optionsHeight>B.clientHeight?j.top=B.top-p.optionsHeight-3+"px":j.top=O+"px",j.left=B.left+"px",j.width=B.width+"px"}),(B,O)=>(n.openBlock(),n.createElementBlock("div",Cx,[n.createElementVNode("div",{ref_key:"root",ref:s,tabindex:H.value,class:n.normalizeClass(["pl-dropdown",{open:p.open,error:B.error,disabled:S.value}]),onKeydown:ue,onFocusout:F},[n.createElementVNode("div",kx,[n.createElementVNode("div",Sx,[n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":O[0]||(O[0]=X=>p.search=X),type:"text",tabindex:"-1",disabled:S.value,placeholder:w.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:W},null,40,Tx),[[n.vModelText,p.search]]),O[4]||(O[4]=n.createTextVNode()),p.open?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:U},[n.createVNode(vs,{class:"input-value"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A.value),1)]),_:1})])),O[5]||(O[5]=n.createTextVNode()),n.createElementVNode("div",Ex,[y.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:0,name:"loading"})):n.createCommentVNode("",!0),O[1]||(O[1]=n.createTextVNode()),B.clearable&&L.value?(n.openBlock(),n.createBlock(n.unref(hi),{key:1,name:"delete-clear",onClick:n.withModifiers(K,["stop"])})):n.createCommentVNode("",!0),O[2]||(O[2]=n.createTextVNode()),n.renderSlot(B.$slots,"append"),O[3]||(O[3]=n.createTextVNode()),B.arrowIconLarge?(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["arrow-icon",[`icon-24 ${B.arrowIconLarge}`]]),onClick:n.withModifiers(P,["stop"])},null,2)):B.arrowIcon?(n.openBlock(),n.createElementBlock("div",{key:3,class:n.normalizeClass(["arrow-icon",[`icon-16 ${B.arrowIcon}`]]),onClick:n.withModifiers(P,["stop"])},null,2)):(n.openBlock(),n.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:n.withModifiers(P,["stop"])}))])]),O[9]||(O[9]=n.createTextVNode()),B.label?(n.openBlock(),n.createElementBlock("label",Nx,[B.required?(n.openBlock(),n.createElementBlock("i",Ax)):n.createCommentVNode("",!0),O[6]||(O[6]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(B.label),1),O[7]||(O[7]=n.createTextVNode()),n.unref(i).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(B.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),O[10]||(O[10]=n.createTextVNode()),p.open?(n.openBlock(),n.createBlock(n.Teleport,{key:1,to:"body"},[n.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:n.normalizeStyle(j),tabindex:"-1"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(R.value,(X,ye)=>(n.openBlock(),n.createBlock(aa,{key:ye,option:X,"is-selected":X.isSelected,"is-hovered":X.isActive,size:B.optionSize,onClick:n.withModifiers(_e=>G(X.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),O[8]||(O[8]=n.createTextVNode()),R.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Mx,"Nothing found"))],4)])):n.createCommentVNode("",!0),O[11]||(O[11]=n.createTextVNode()),n.createVNode(on,{class:"pl-dropdown__contour"})])],42,_x),O[12]||(O[12]=n.createTextVNode()),D.value?(n.openBlock(),n.createElementBlock("div",Bx,n.toDisplayString(D.value),1)):y.value&&B.loadingOptionsHelper?(n.openBlock(),n.createElementBlock("div",Px,n.toDisplayString(B.loadingOptionsHelper),1)):B.helper?(n.openBlock(),n.createElementBlock("div",Dx,n.toDisplayString(B.helper),1)):n.createCommentVNode("",!0)]))}}),Lx={name:"PlDropdownRef"},Ix=n.defineComponent({...Lx,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,r=n.computed(()=>{var i;return(i=e.options)==null?void 0:i.map(s=>({label:s.label,value:s.ref}))}),o=n.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(i,s)=>(n.openBlock(),n.createBlock(n.unref(ys),n.mergeProps(e,{options:r.value,"loading-options-helper":i.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":s[0]||(s[0]=d=>i.$emit("update:modelValue",d))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function Fx(t,e){return n.computed(()=>{const r=Bn(t.value);return e.value?r.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):r})}const Rx={class:"resizable-input"},Ox=["placeholder","value","disabled"],zx=n.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const r=t,o=e,i=n.computed(()=>{var u;return r.placeholder?r.placeholder:(u=r.modelValue||r.value)==null?void 0:u.replace('"',"")}),s=n.computed(()=>{const u={};return r.width&&(u.width=r.width),r.maxWidth&&(u.maxWidth=r.maxWidth),u});function d(u){const p=u.target.value;o("update:modelValue",p)}return(u,p)=>(n.openBlock(),n.createElementBlock("div",Rx,[n.createElementVNode("span",{style:n.normalizeStyle(s.value),class:"resizable-input__size-span"},n.toDisplayString(i.value),5),p[0]||(p[0]=n.createTextVNode()),n.createElementVNode("input",n.mergeProps(u.$attrs,{placeholder:u.placeholder,value:r.modelValue,disabled:r.disabled,style:s.value,onInput:d}),null,16,Ox)]))}}),Gx={class:"dropdown-tab-item__title text-caps13"},jx=n.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,r=n.computed(()=>e.option.label),o=n.computed(()=>{const i=[];return e.isSelected&&i.push("dropdown-tab-item__selected"),e.isHovered&&i.push("hovered-item"),i.join(" ")});return(i,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([o.value,"dropdown-tab-item"])},[n.createElementVNode("div",Gx,n.toDisplayString(r.value),1)],2))}}),Ux={class:"pl-line-dropdown__prefix"},Zx={class:"pl-line-dropdown__icon-wrapper"},$x={class:"pl-line-dropdown__icon"},Wx={key:0,class:"pl-line-dropdown__no-item"},Hx={key:0,class:"pl-line-dropdown__no-item"},Wu=n.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const r=e,o=t,i=n.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),s=n.ref(),d=n.ref(),u=n.computed(()=>{const F=[];return i.isOpen&&F.push("open"),o.disabled&&F.push("disabled"),F.join(" ")}),p=n.ref(""),h=Fx(n.toRef(o,"options"),p),f=n.computed(()=>!!(o.clearable&&i.isOpen&&o.modelValue&&y.value)),y=n.computed(()=>{if(o.modelValue){const F=D();if(F!==-1){const Y=Bn(o.options)[F];return typeof Y.label=="object"?Y.label.title:Y.label}}return""}),S=n.ref(y.value),k=n.computed(()=>i.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");gi(s,()=>{o.mode==="list"&&(i.isOpen=!1)}),n.watch(()=>S.value,F=>{y.value!==F?p.value=F:p.value=""}),n.watch(()=>i.isOpen,F=>{var Y;F&&s.value&&((Y=s.value.querySelector("input"))==null||Y.focus(),n.nextTick(()=>U()))}),n.watch(()=>o.modelValue,()=>E(),{immediate:!0});function D(){return o.options.findIndex(F=>Et(F.value,o.modelValue))}function E(){i.activeOption=na(h.value.findIndex(F=>Et(F.value,o.modelValue)),F=>F<0?0:F),S.value=y.value}function A(){p.value=""}function w(){o.disabled?i.isOpen=!1:n.nextTick(()=>{i.isOpen=!i.isOpen})}function L(){o.mode==="list"&&(i.isOpen=!1)}function R(F){F&&(r("update:modelValue",F.value),L(),A())}function H(F){return Et(F.value,o.modelValue)}const G=F=>{var Y,ue;const j=F.relatedTarget;!((Y=s.value)!=null&&Y.contains(j))&&!((ue=d.value)!=null&&ue.contains(j))&&(p.value="",i.isOpen=!1)};function K(F){const{activeOption:Y}=i;if(!i.isOpen&&F.code==="Enter"){i.isOpen=!0;return}const{length:ue}=h.value;if(!ue)return;["ArrowDown","ArrowUp","Enter"].includes(F.code)&&F.preventDefault(),F.code==="Enter"&&R(h.value[Y]);const j=F.code==="ArrowDown"?1:F.code==="ArrowUp"?-1:0;i.activeOption=Math.abs(Y+j+ue)%ue,requestAnimationFrame(U)}function U(){const F=d.value;F&&ot(F.querySelector(".hovered-item"),Y=>{o.mode==="list"?oa(F,Y):Y.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function P(){r("update:modelValue",void 0)}const W=n.reactive({top:"0px",left:"0px"});return n.watch(d,F=>{if(F){const Y=F.getBoundingClientRect();i.optionsHeight=Y.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ra(s,F=>{const Y=F.top+F.height+2;Y+i.optionsHeight>F.clientHeight?W.top=F.top-i.optionsHeight-2+"px":W.top=Y+"px",W.left=F.left+"px"}),(F,Y)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:s,tabindex:"0",class:n.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:K,onFocusout:G,onClick:w},[n.createElementVNode("div",Ux,n.toDisplayString(o==null?void 0:o.prefix),1),Y[6]||(Y[6]=n.createTextVNode()),n.createVNode(zx,{modelValue:S.value,"onUpdate:modelValue":Y[0]||(Y[0]=ue=>S.value=ue),placeholder:k.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),Y[7]||(Y[7]=n.createTextVNode()),n.createElementVNode("div",Zx,[n.withDirectives(n.createElementVNode("div",$x,null,512),[[n.vShow,!f.value]]),Y[1]||(Y[1]=n.createTextVNode()),n.withDirectives(n.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:P},null,512),[[n.vShow,f.value]])]),Y[8]||(Y[8]=n.createTextVNode()),i.isOpen?(n.openBlock(),n.createBlock(n.Teleport,{key:0,to:"body"},[o.mode==="list"?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"list",ref:d,style:n.normalizeStyle(W),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:G},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(h),(ue,j)=>n.renderSlot(F.$slots,"item",{key:j,item:ue,textItem:"text",isSelected:H(ue),isHovered:i.activeOption==j,onClick:n.withModifiers(B=>R(ue),["stop"])},()=>[n.createVNode(aa,{option:ue,"text-item":"text","is-selected":H(ue),"is-hovered":i.activeOption==j,size:"medium",onClick:n.withModifiers(B=>R(ue),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),Y[3]||(Y[3]=n.createTextVNode()),n.unref(h).length===0?(n.openBlock(),n.createElementBlock("div",Wx,Y[2]||(Y[2]=[n.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):n.createCommentVNode("",!0)],36)):o.mode==="tabs"?(n.openBlock(),n.createElementBlock("div",{key:1,ref_key:"list",ref:d,style:n.normalizeStyle(W),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:G},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(h),(ue,j)=>n.renderSlot(F.$slots,"item",{key:j,item:ue,isSelected:H(ue),isHovered:i.activeOption==j,onClick:n.withModifiers(B=>R(ue),["stop"])},()=>[n.createVNode(jx,{option:ue,"is-selected":H(ue),"is-hovered":i.activeOption==j,onClick:n.withModifiers(B=>R(ue),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),Y[5]||(Y[5]=n.createTextVNode()),n.unref(h).length===0?(n.openBlock(),n.createElementBlock("div",Hx,Y[4]||(Y[4]=[n.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):n.createCommentVNode("",!0)],36)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],34))}}),qx={class:"ui-dropdown__envelope"},Kx=["tabindex"],Yx={class:"ui-dropdown__container"},Jx={class:"ui-dropdown__field"},Qx=["disabled","placeholder"],Xx={class:"ui-dropdown__controls"},eC={key:0},tC={key:0,class:"required-icon"},rC={key:0,class:"nothing-found"},nC={key:0,class:"ui-dropdown__error"},oC={key:1,class:"ui-dropdown__helper"},aC={key:2,class:"ui-dropdown__helper"},iC={name:"PlDropdown"},lC=n.defineComponent({...iC,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const r=e,o=t,i=n.useSlots(),s=n.ref(),d=n.ref(),u=n.ref(),p=n.reactive({search:"",activeIndex:-1,open:!1}),h=()=>na(R.value.findIndex(j=>Et(j.value,o.modelValue)),j=>j<0?0:j),f=()=>p.activeIndex=h(),y=n.computed(()=>o.options===void 0),S=n.computed(()=>y.value?!0:o.disabled),k=n.computed(()=>(o.options??[]).findIndex(j=>Et(j.value,o.modelValue))),D=n.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&k.value===-1)return"The selected value is not one of the options"}}),E=n.computed(()=>Bn(o.options??[]).map((j,B)=>({...j,index:B,isSelected:B===k.value,isActive:B===p.activeIndex}))),A=n.computed(()=>{const j=n.unref(E).find(B=>Et(B.value,o.modelValue));return(j==null?void 0:j.label)||o.modelValue}),w=n.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(A.value):o.placeholder),L=n.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),R=n.computed(()=>{const j=E.value;return p.search?j.filter(B=>{const O=p.search.toLowerCase();return B.label.toLowerCase().includes(O)||B.description&&B.description.toLowerCase().includes(O)?!0:typeof B.value=="string"?B.value.toLowerCase().includes(O):B.value===p.search}):j}),H=n.computed(()=>S.value?void 0:"0"),G=j=>{var B;r("update:modelValue",j),p.search="",p.open=!1,(B=s==null?void 0:s.value)==null||B.focus()},K=()=>r("update:modelValue",void 0),U=()=>{var j;return(j=u.value)==null?void 0:j.focus()},P=()=>p.open=!p.open,W=()=>p.open=!0,F=j=>{var B;(B=s==null?void 0:s.value)!=null&&B.contains(j.relatedTarget)||(p.search="",p.open=!1)},Y=()=>{const j=d.value;j&&ot(j.querySelector(".hovered-item"),B=>{oa(j,B)})},ue=j=>{var B,O;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(j.code))j.preventDefault();else return;const{open:X,activeIndex:ye}=p;if(!X){j.code==="Enter"&&(p.open=!0);return}j.code==="Escape"&&(p.open=!1,(B=s.value)==null||B.focus());const _e=n.unref(R),{length:zt}=_e;if(!zt)return;j.code==="Enter"&&G((O=_e.find(On=>On.index===ye))==null?void 0:O.value);const Ht=_e.findIndex(On=>On.index===ye)??-1,Nt=j.code==="ArrowDown"?1:j.code==="ArrowUp"?-1:0,Ta=Math.abs(Ht+Nt+zt)%zt;p.activeIndex=R.value[Ta].index??-1};return Vr(s),n.watch(()=>o.modelValue,f,{immediate:!0}),n.watch(()=>p.open,j=>{var B;return j?(B=u.value)==null?void 0:B.focus():""}),n.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&Y()}),(j,B)=>(n.openBlock(),n.createElementBlock("div",qx,[n.createElementVNode("div",{ref_key:"root",ref:s,tabindex:H.value,class:n.normalizeClass(["ui-dropdown",{open:p.open,error:j.error,disabled:S.value}]),onKeydown:ue,onFocusout:F},[n.createElementVNode("div",Yx,[n.createElementVNode("div",Jx,[n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":B[0]||(B[0]=O=>p.search=O),type:"text",tabindex:"-1",disabled:S.value,placeholder:w.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:W},null,40,Qx),[[n.vModelText,p.search]]),B[4]||(B[4]=n.createTextVNode()),p.open?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:U},[n.createVNode(vs,{class:"input-value"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A.value),1)]),_:1})])),B[5]||(B[5]=n.createTextVNode()),n.createElementVNode("div",Xx,[y.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:0,name:"loading"})):n.createCommentVNode("",!0),B[1]||(B[1]=n.createTextVNode()),j.clearable&&L.value?(n.openBlock(),n.createBlock(n.unref(hi),{key:1,name:"delete-clear",onClick:n.withModifiers(K,["stop"])})):n.createCommentVNode("",!0),B[2]||(B[2]=n.createTextVNode()),n.renderSlot(j.$slots,"append"),B[3]||(B[3]=n.createTextVNode()),j.arrowIconLarge?(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["arrow-icon",[`icon-24 ${j.arrowIconLarge}`]]),onClick:n.withModifiers(P,["stop"])},null,2)):j.arrowIcon?(n.openBlock(),n.createElementBlock("div",{key:3,class:n.normalizeClass(["arrow-icon",[`icon-16 ${j.arrowIcon}`]]),onClick:n.withModifiers(P,["stop"])},null,2)):(n.openBlock(),n.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:n.withModifiers(P,["stop"])}))])]),B[9]||(B[9]=n.createTextVNode()),j.label?(n.openBlock(),n.createElementBlock("label",eC,[j.required?(n.openBlock(),n.createElementBlock("i",tC)):n.createCommentVNode("",!0),B[6]||(B[6]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(j.label),1),B[7]||(B[7]=n.createTextVNode()),n.unref(i).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(j.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),B[10]||(B[10]=n.createTextVNode()),p.open?(n.openBlock(),n.createElementBlock("div",{key:1,ref_key:"list",ref:d,class:"ui-dropdown__options"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(R.value,(O,X)=>(n.openBlock(),n.createBlock(aa,{key:X,option:O,"is-selected":O.isSelected,"is-hovered":O.isActive,size:j.optionSize,onClick:n.withModifiers(ye=>G(O.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),B[8]||(B[8]=n.createTextVNode()),R.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",rC,"Nothing found"))],512)):n.createCommentVNode("",!0),B[11]||(B[11]=n.createTextVNode()),n.createVNode(on,{class:"ui-dropdown__contour"})])],42,Kx),B[12]||(B[12]=n.createTextVNode()),D.value?(n.openBlock(),n.createElementBlock("div",nC,n.toDisplayString(D.value),1)):y.value&&j.loadingOptionsHelper?(n.openBlock(),n.createElementBlock("div",oC,n.toDisplayString(j.loadingOptionsHelper),1)):j.helper?(n.openBlock(),n.createElementBlock("div",aC,n.toDisplayString(j.helper),1)):n.createCommentVNode("",!0)]))}}),sC={key:0,class:"ui-progress-bar"},cC={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},dC={class:"ui-progress-bar__message flex-grow-1"},uC={class:"ui-progress-bar__percent"},pC=n.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,r=n.computed(()=>e.progress===100?e.completeMessage:"");return(o,i)=>o.loading?(n.openBlock(),n.createElementBlock("div",sC,[n.createElementVNode("div",{class:"ui-progress-bar__indicator",style:n.normalizeStyle({width:o.progress+"%"})},null,4),i[1]||(i[1]=n.createTextVNode()),n.createElementVNode("div",cC,[n.createElementVNode("div",dC,n.toDisplayString(r.value),1),i[0]||(i[0]=n.createTextVNode()),n.createElementVNode("div",uC,n.toDisplayString(o.progress+"%"),1)])])):n.createCommentVNode("",!0)}}),gC={class:"mi-number-field__main-wrapper d-flex"},hC={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},fC={key:0,class:"text-description"},mC=["disabled","placeholder"],vC={class:"mi-number-field__icons d-flex-column"},yC={key:0,class:"mi-number-field__hint text-description"},bC=n.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t,o=e,i=n.ref(),s=n.useSlots(),d=n.ref();Vr(i);const u=n.ref(!0),p=n.computed({get(){return u.value&&r.modelValue!==void 0?new Number(r.modelValue).toString():""},set(w){var L;w=w.replace(/,/g,""),S(w)?(o("update:modelValue",+w),w.toString()!==((L=r.modelValue)==null?void 0:L.toString())&&+w===r.modelValue&&w[w.length-1]!=="."&&(u.value=!1,n.nextTick(()=>{u.value=!0}))):(w.trim()===""&&o("update:modelValue",void 0),u.value=!1,n.nextTick(()=>{u.value=!0}))}}),h=n.computed(()=>{let w=[];return r.errorMessage&&w.push(r.errorMessage),S(r.modelValue)?(r.minValue!==void 0&&r.modelValue!==void 0&&r.modelValue<r.minValue&&w.push(`Model value must be higher than ${r.minValue}`),r.maxValue!==void 0&&r.modelValue!==void 0&&r.modelValue>r.maxValue&&w.push(`Model value must be less than ${r.maxValue}`)):w.push("Model value is not a number."),w=[...w],w.join(" ")}),f=n.computed(()=>!!(r.maxValue&&r.modelValue!==void 0&&(r.modelValue||0)+r.step>r.maxValue)),y=n.computed(()=>!!(r.minValue&&r.modelValue!==void 0&&(r.modelValue||0)-r.step<r.minValue));function S(w){return w!==void 0?(w=w==null?void 0:w.toString(),!isNaN(+w)&&!isNaN(parseFloat(w))):!1}function k(){if(!f.value){let w=0;r.modelValue===void 0?w=r.minValue?r.minValue:0:w=+(r.modelValue||0)+r.step,p.value=w.toString()}}function D(){if(!y.value){let w=0;r.modelValue===void 0?w=0:w=+(r.modelValue||0)-r.step,p.value=r.minValue?Math.max(r.minValue,w).toString():w.toString()}}function E(w){["ArrowDown","ArrowUp"].includes(w.code)&&w.preventDefault(),w.code==="ArrowUp"?k():w.code==="ArrowDown"&&D()}const A=w=>{w.detail>1&&w.preventDefault()};return(w,L)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:i,class:n.normalizeClass([{error:!!h.value.trim(),disabled:w.disabled},"mi-number-field d-flex-column"]),onMousedown:A,onKeydown:L[1]||(L[1]=R=>E(R))},[n.createElementVNode("div",gC,[n.createVNode(on,{class:"mi-number-field__contour"}),L[6]||(L[6]=n.createTextVNode()),n.createElementVNode("div",hC,[w.label?(n.openBlock(),n.createElementBlock("label",fC,[n.createTextVNode(n.toDisplayString(w.label)+" ",1),n.unref(s).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(w.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),L[2]||(L[2]=n.createTextVNode()),n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":L[0]||(L[0]=R=>p.value=R),disabled:w.disabled,placeholder:w.placeholder,class:"text-s flex-grow"},null,8,mC),[[n.vModelText,p.value]])]),L[7]||(L[7]=n.createTextVNode()),n.createElementVNode("div",vC,[n.createElementVNode("div",{class:n.normalizeClass([{disabled:f.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:k},L[3]||(L[3]=[n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),L[5]||(L[5]=n.createTextVNode()),n.createElementVNode("div",{class:n.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:D},L[4]||(L[4]=[n.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[n.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),L[8]||(L[8]=n.createTextVNode()),h.value.trim()?(n.openBlock(),n.createElementBlock("div",yC,n.toDisplayString(h.value),1)):n.createCommentVNode("",!0)],34))}}),wC={class:"pl-chip__text"},bs=n.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=n.ref(),r=n.ref(!1);return n.onMounted(()=>{var o;e.value&&(r.value=((o=e.value)==null?void 0:o.clientWidth)>=256)}),(o,i)=>(n.openBlock(),n.createBlock(n.unref(Vt),{position:"top",class:"pl-chip-tooltip",delay:500},n.createSlots({default:n.withCtx(()=>[i[4]||(i[4]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"chip",ref:e,class:n.normalizeClass(["pl-chip",{small:o.small}])},[n.createElementVNode("div",wC,[n.renderSlot(o.$slots,"default")]),i[3]||(i[3]=n.createTextVNode()),o.closeable?(n.openBlock(),n.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:i[0]||(i[0]=n.withKeys(s=>o.$emit("close"),["enter"])),onClick:i[1]||(i[1]=n.withModifiers(s=>o.$emit("close"),["stop"]))},i[2]||(i[2]=[n.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):n.createCommentVNode("",!0)],2)]),_:2},[r.value?{name:"tooltip",fn:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),key:"0"}:void 0]),1024))}}),xC={class:"pl-multi-dropdown__envelope"},CC=["tabindex"],_C={class:"pl-multi-dropdown__container"},kC={class:"pl-multi-dropdown__field"},SC=["disabled","placeholder"],TC={class:"pl-multi-dropdown__append"},EC={key:0},NC={key:0,class:"required-icon"},AC={class:"pl-multi-dropdown__open-chips-container"},MC={key:0,class:"nothing-found"},BC={key:0,class:"pl-multi-dropdown__error"},PC={key:1,class:"pl-multi-dropdown__helper"},DC={name:"PlDropdownMulti"},VC=n.defineComponent({...DC,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const r=e,o=P=>r("update:modelValue",P),i=n.useSlots(),s=t,d=n.ref(),u=n.ref(),p=n.ref(),h=n.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),f=n.computed(()=>Array.isArray(s.modelValue)?s.modelValue:[]),y=n.computed(()=>h.open&&s.modelValue.length>0?s.placeholder:s.modelValue.length>0?"":s.placeholder),S=n.computed(()=>Bn(s.options).filter(P=>ms(f.value,P.value))),k=n.computed(()=>{const P=n.unref(f),W=Bn(s.options);return(h.search?W.filter(F=>{const Y=h.search.toLowerCase();return F.label.toLowerCase().includes(Y)?!0:typeof F.value=="string"?F.value.toLowerCase().includes(Y):F.value===h.search}):[...W]).map(F=>({...F,selected:ms(P,F.value)}))}),D=n.computed(()=>s.disabled?void 0:"0"),E=()=>{h.activeOption=na(k.value.findIndex(P=>Et(P.value,s.modelValue)),P=>P<0?0:P)},A=P=>{var W;const F=n.unref(f);o(ms(F,P)?F.filter(Y=>!Et(Y,P)):[...F,P]),h.search="",(W=d==null?void 0:d.value)==null||W.focus()},w=P=>o(n.unref(f).filter(W=>!Et(W,P))),L=()=>{var P;return(P=p.value)==null?void 0:P.focus()},R=()=>h.open=!h.open,H=P=>{var W,F;const Y=P.relatedTarget;!((W=d.value)!=null&&W.contains(Y))&&!((F=u.value)!=null&&F.contains(Y))&&(h.search="",h.open=!1)},G=()=>{const P=u.value;P&&ot(P.querySelector(".hovered-item"),W=>{oa(P,W)})},K=P=>{var W;const{open:F,activeOption:Y}=h;if(!F){P.code==="Enter"&&(h.open=!0);return}P.code==="Escape"&&(h.open=!1,(W=d.value)==null||W.focus());const ue=n.unref(k),{length:j}=ue;if(!j)return;["ArrowDown","ArrowUp","Enter"].includes(P.code)&&P.preventDefault(),P.code==="Enter"&&A(ue[Y].value);const B=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(Y+B+j)%j,requestAnimationFrame(G)};Vr(d),n.watch(()=>s.modelValue,()=>E(),{immediate:!0}),n.watchPostEffect(()=>{h.search,h.open&&G()});const U=n.reactive({top:"0px",left:"0px",width:"0px"});return n.watch(u,P=>{if(P){const W=P.getBoundingClientRect();h.optionsHeight=W.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ra(d,P=>{const W=P.top+P.height+5;W+h.optionsHeight>P.clientHeight?U.top=P.top-h.optionsHeight-5+"px":U.top=W+"px",U.left=P.left+"px",U.width=P.width+"px"}),(P,W)=>(n.openBlock(),n.createElementBlock("div",xC,[n.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:D.value,class:n.normalizeClass(["pl-multi-dropdown",{open:h.open,error:P.error,disabled:P.disabled}]),onKeydown:K,onFocusout:H},[n.createElementVNode("div",_C,[n.createElementVNode("div",kC,[n.withDirectives(n.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":W[0]||(W[0]=F=>h.search=F),type:"text",tabindex:"-1",disabled:P.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:W[1]||(W[1]=F=>h.open=!0)},null,40,SC),[[n.vModelText,h.search]]),W[3]||(W[3]=n.createTextVNode()),h.open?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:"chips-container",onClick:L},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S.value,(F,Y)=>(n.openBlock(),n.createBlock(n.unref(bs),{key:Y,closeable:"",small:"",onClick:W[2]||(W[2]=n.withModifiers(ue=>h.open=!0,["stop"])),onClose:ue=>w(F.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(F.label||F.value),1)]),_:2},1032,["onClose"]))),128))])),W[4]||(W[4]=n.createTextVNode()),n.createElementVNode("div",{class:"arrow",onClick:n.withModifiers(R,["stop"])}),W[5]||(W[5]=n.createTextVNode()),n.createElementVNode("div",TC,[n.renderSlot(P.$slots,"append")])]),W[10]||(W[10]=n.createTextVNode()),P.label?(n.openBlock(),n.createElementBlock("label",EC,[P.required?(n.openBlock(),n.createElementBlock("i",NC)):n.createCommentVNode("",!0),W[6]||(W[6]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(P.label),1),W[7]||(W[7]=n.createTextVNode()),n.unref(i).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(P.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),W[11]||(W[11]=n.createTextVNode()),h.open?(n.openBlock(),n.createBlock(n.Teleport,{key:1,to:"body"},[n.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-multi-dropdown__options",style:n.normalizeStyle(U),tabindex:"-1",onFocusout:H},[n.createElementVNode("div",AC,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S.value,(F,Y)=>(n.openBlock(),n.createBlock(n.unref(bs),{key:Y,closeable:"",small:"",onClose:ue=>w(F.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(F.label||F.value),1)]),_:2},1032,["onClose"]))),128))]),W[8]||(W[8]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,(F,Y)=>(n.openBlock(),n.createBlock(aa,{key:Y,option:F,"text-item":"text","is-selected":F.selected,"is-hovered":h.activeOption==Y,size:"medium","use-checkbox":"",onClick:n.withModifiers(ue=>A(F.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),W[9]||(W[9]=n.createTextVNode()),k.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",MC,"Nothing found"))],36)])):n.createCommentVNode("",!0),W[12]||(W[12]=n.createTextVNode()),n.createVNode(on,{class:"pl-multi-dropdown__contour"})])],42,CC),W[13]||(W[13]=n.createTextVNode()),P.error?(n.openBlock(),n.createElementBlock("div",BC,n.toDisplayString(P.error),1)):P.helper?(n.openBlock(),n.createElementBlock("div",PC,n.toDisplayString(P.helper),1)):n.createCommentVNode("",!0)]))}}),ws=n.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,r=n.computed(()=>e.modelValue);return(o,i)=>(n.openBlock(),n.createElementBlock("div",{tabindex:"0",class:n.normalizeClass(["pl-checkbox-base",{checked:r.value,disabled:o.disabled}]),onClick:i[0]||(i[0]=s=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:i[1]||(i[1]=n.withKeys(s=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),LC={name:"PlCheckbox"},IC=n.defineComponent({...LC,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,r=n.useSlots();return(o,i)=>n.unref(r).default?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[n.createVNode(ws,n.mergeProps(e,{"onUpdate:modelValue":i[0]||(i[0]=s=>o.$emit("update:modelValue",s))}),null,16),i[3]||(i[3]=n.createTextVNode()),n.createElementVNode("label",{onClick:i[1]||(i[1]=s=>o.$emit("update:modelValue",!o.$props.modelValue))},[n.renderSlot(o.$slots,"default")])],2)):(n.openBlock(),n.createBlock(ws,n.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=s=>o.$emit("update:modelValue",s))}),null,16))}}),FC={key:0},RC=["onClick"],OC={name:"PlCheckboxGroup"},zC=n.defineComponent({...OC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=e,o=t,i=d=>o.modelValue.includes(d),s=d=>{const u=o.modelValue??[];r("update:modelValue",i(d)?u.filter(p=>p!==d):[...u,d])};return(d,u)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["ui-checkbox-group",{disabled:d.disabled}])},[d.label?(n.openBlock(),n.createElementBlock("label",FC,n.toDisplayString(d.label),1)):n.createCommentVNode("",!0),u[1]||(u[1]=n.createTextVNode()),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,h)=>(n.openBlock(),n.createElementBlock("div",{key:h},[n.createVNode(ws,{disabled:d.disabled,label:p.label,"model-value":i(p.value),"onUpdate:modelValue":()=>s(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=n.createTextVNode()),n.createElementVNode("label",{onClick:n.withModifiers(()=>s(p.value),["stop"])},n.toDisplayString(p.label),9,RC)]))),128))],2))}}),GC="_component_tupwt_1",jC={component:GC},UC={};function ZC(t,e){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(t.$style.component)},e[0]||(e[0]=[n.createElementVNode("div",null,null,-1)]),2)}const $C={$style:jC},WC=rn(UC,[["render",ZC],["__cssModules",$C]]),HC={key:1,class:"pl-dialog-modal__title"},qC={inheritAttrs:!1},xs=n.defineComponent({...qC,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const r=n.useSlots(),o=e,i=t,s=n.ref(),d=n.useAttrs();function u(p){s.value&&document.contains(p.target)&&!s.value.contains(p.target)&&o("update:modelValue",!1)}return et(document.body,"keyup",p=>{i.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,h)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,{name:"dialog"},{default:n.withCtx(()=>[p.modelValue?(n.openBlock(),n.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[n.createElementVNode("div",n.mergeProps(n.unref(d),{ref_key:"modal",ref:s,class:["pl-dialog-modal",{"has-title":n.unref(r).title,"has-content":n.unref(r).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(n.openBlock(),n.createBlock(WC,{key:0,class:"close-modal-btn",onClick:h[0]||(h[0]=n.withModifiers(f=>o("update:modelValue",!1),["stop"]))})):n.createCommentVNode("",!0),h[1]||(h[1]=n.createTextVNode()),n.unref(r).title?(n.openBlock(),n.createElementBlock("div",HC,[n.renderSlot(p.$slots,"title")])):n.createCommentVNode("",!0),h[2]||(h[2]=n.createTextVNode()),n.createElementVNode("div",{class:n.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[n.renderSlot(p.$slots,"default")],2),h[3]||(h[3]=n.createTextVNode()),n.unref(r).actions?(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[n.renderSlot(p.$slots,"actions")],2)):n.createCommentVNode("",!0)],16)])):n.createCommentVNode("",!0)]),_:3})]))}}),KC=n.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function r(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,i)=>(n.openBlock(),n.createBlock(n.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:r},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3}))}}),YC={key:0,class:"pl-slide-modal__title"},JC={class:"pl-slide-modal__content"},QC={key:1,class:"pl-slide-modal__actions"},XC={name:"PlSlideModal",inheritAttrs:!1},e_=n.defineComponent({...XC,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const r=n.useSlots(),o=e,i=t,s=n.ref(),d=n.useAttrs();return gi(s,()=>{i.modelValue&&i.closeOnOutsideClick&&o("update:modelValue",!1)}),et(document,"keydown",u=>{u.key==="Escape"&&o("update:modelValue",!1)}),(u,p)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(KC,null,{default:n.withCtx(()=>[u.modelValue?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,ref_key:"modal",ref:s,style:{width:u.width}},n.unref(d),{class:["pl-slide-modal",{"has-title":n.unref(r).title,"has-actions":n.unref(r).actions}],onKeyup:p[1]||(p[1]=n.withKeys(h=>o("update:modelValue",!1),["esc"]))}),[n.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=h=>o("update:modelValue",!1))}),p[3]||(p[3]=n.createTextVNode()),n.unref(r).title?(n.openBlock(),n.createElementBlock("div",YC,[n.renderSlot(u.$slots,"title")])):n.createCommentVNode("",!0),p[4]||(p[4]=n.createTextVNode()),n.createElementVNode("div",JC,[n.renderSlot(u.$slots,"default")]),p[5]||(p[5]=n.createTextVNode()),n.unref(r).actions?(n.openBlock(),n.createElementBlock("div",QC,[n.renderSlot(u.$slots,"actions")])):n.createCommentVNode("",!0)],16)):n.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=n.createTextVNode()),u.modelValue&&u.shadow?(n.openBlock(),n.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=n.withKeys(h=>o("update:modelValue",!1),["esc"]))},null,32)):n.createCommentVNode("",!0)]))}}),t_={key:0,class:"label"},r_={name:"PlToggleSwitch"},n_=n.defineComponent({...r_,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{tabindex:"0",class:n.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:r[0]||(r[0]=o=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:r[1]||(r[1]=n.withKeys(o=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[r[2]||(r[2]=n.createElementVNode("div",{class:"ui-toggle-switch__body"},[n.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),r[3]||(r[3]=n.createTextVNode()),e.label?(n.openBlock(),n.createElementBlock("span",t_,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0)],34))}});function Hu(t){return n.getCurrentScope()?(n.onScopeDispose(t),!0):!1}function o_(t){return n.unref(t)}const a_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function i_(t,e,r={}){const{immediate:o=!0}=r,i=n.ref(!1);let s=null;function d(){s&&(clearTimeout(s),s=null)}function u(){i.value=!1,d()}function p(...h){d(),i.value=!0,s=setTimeout(()=>{i.value=!1,s=null,t(...h)},o_(e))}return o&&(i.value=!0,a_&&p()),Hu(u),{isPending:n.readonly(i),start:p,stop:u}}function l_(t,e,r){return n.watch(t,(o,i,s)=>{o&&e(o,i,s)},{...r,once:!1})}function s_(t,e,r){const{start:o}=i_(s,e,{immediate:!1}),i=n.ref(!1);async function s(){i.value&&(await t(),o())}function d(){i.value||(i.value=!0,s())}function u(){i.value=!1}return r!=null&&r.immediate&&d(),Hu(u),{isActive:i,pause:u,resume:d}}const c_="[==PROGRESS==]";function d_(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function u_(t){const e=n.ref(),r=n.reactive({errorCount:0});async function o(){var s;let d=e.value;if(d===void 0)return;const u=t.mockPlatforma??window.platforma;if(!u){console.warn("Platforma API is not available");return}for(;;){const p=await u.logDriver.readText(d.logHandle,100,d.lastOffset);if(d.error=void 0,r.errorCount=0,p.shouldUpdateHandle||d.logHandle!==((s=e.value)==null?void 0:s.logHandle))return;const h=t.progressPrefix??c_,f=new TextDecoder().decode(p.data).replace(new RegExp(`${d_(h)}`,"g"),"");if(d=Object.assign(d,{lines:d.lines+f,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const i=s_(()=>o().catch(s=>{e.value&&(r.errorCount++,r.errorCount>(t.maxRetries??3)?e.value.error=s:console.warn("skip error:",s,"retry..."))}),1500,{immediate:!1});return l_(()=>{var s;return(s=e==null?void 0:e.value)==null?void 0:s.finished},()=>i.pause()),n.watch(()=>t.logHandle,s=>{var d;s===void 0?(e.value=void 0,i.pause()):s!==((d=e.value)==null?void 0:d.logHandle)&&(e.value={logHandle:s,lastOffset:0,lines:"",finished:!1,error:void 0},r.errorCount=0,i.resume())},{immediate:!0}),e}const p_={key:0},g_={key:1,class:"pl-log-view__error"},h_={name:"PlLogView"},f_=n.defineComponent({...h_,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=S=>{if(S&&S.ok===!1)return S.errors.join(`
|
|
65
|
-
`)},r=t,o=u_(r),i=n.ref(!0),s=n.ref(),d=n.ref(),u=n.computed(()=>{var S;return((S=o.value)==null?void 0:S.error)??r.error??e(r.output)}),p=n.computed(()=>{var S;return((S=o.value)==null?void 0:S.lines)??r.value??pb(r.output)});Vr(d);const h=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},f=()=>{Mn(s.value,S=>{i.value&&S.scrollTo(S.scrollLeft,S.scrollHeight)})};n.watch(p,()=>{requestAnimationFrame(()=>{f()})},{immediate:!0});const y=S=>{const k=S.target;i.value=k.scrollTop+20>=k.scrollHeight-k.offsetHeight};return(S,k)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:d,class:n.normalizeClass(["pl-log-view",{"has-error":u.value}])},[S.label?(n.openBlock(),n.createElementBlock("label",p_,n.toDisplayString(S.label),1)):n.createCommentVNode("",!0),k[0]||(k[0]=n.createTextVNode()),n.createVNode(on,{class:"pl-log-view__contour"}),k[1]||(k[1]=n.createTextVNode()),n.createVNode(n.unref(Lr),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:h}),k[2]||(k[2]=n.createTextVNode()),u.value?(n.openBlock(),n.createElementBlock("div",g_,n.toDisplayString(u.value),1)):(n.openBlock(),n.createElementBlock("div",{key:2,ref_key:"contentRef",ref:s,class:"pl-log-view__content",onScroll:y},n.toDisplayString(p.value),545))],2))}});function m_(t){const e=t.split("/"),r=[];for(let o=0;o<e.length;o++)r.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).join("/")});return r}const v_={class:"file-dialog"},y_={class:"file-dialog__search"},b_={class:"ls-container"},w_={class:"ls-head"},x_={class:"ls-head__breadcrumbs"},C_=["title","onClick"],__={key:0,class:"icon-16 icon-chevron-right"},k_={class:"d-flex ml-auto align-center gap-12"},S_={class:"ls-head__selected"},T_={key:0,class:"ls-loader"},E_={key:1,class:"ls-empty"},N_={key:2,class:"ls-error"},A_={class:"ls-error__message"},M_={key:3,class:"ls-body"},B_=["onClick"],P_=["title"],D_=["onClick"],V_=["title"],qu=n.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const r=e,o=t,i=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),s=n.reactive(i()),d=n.computed(()=>s.showHiddenItems?s.items:s.items.filter(U=>!U.name.startsWith("."))),u=n.computed(()=>{var U;return{modelValue:o.modelValue,dirPath:s.dirPath,storageHandle:(U=s.storageEntry)==null?void 0:U.handle}}),p=(U,P)=>{window.platforma&&s.currentLoadingPath!==P&&(s.error="",s.items=[],s.lastSelected=void 0,s.currentLoadingPath=P,window.platforma.lsDriver.listFiles(U,P).then(W=>{P===s.dirPath&&(s.items=gu(W).entries.map(F=>({path:F.fullPath,name:F.name,isDir:F.type==="dir",canBeSelected:F.type==="file"&&(!o.extensions||o.extensions.some(Y=>F.fullPath.endsWith(Y))),handle:F.type==="file"?F.handle:void 0,selected:!1})).sort((F,Y)=>F.isDir&&!Y.isDir?-1:!F.isDir&&Y.isDir?1:F.name.localeCompare(Y.name)).map((F,Y)=>({id:Y,...F})),s.lastSelected=void 0)}).catch(W=>s.error=String(W)).finally(()=>{s.currentLoadingPath=void 0}))},h=()=>{const{storageHandle:U,dirPath:P,modelValue:W}=u.value;U&&W&&P&&p(U,P)},f=mu(U=>{U&&(s.dirPath=U)},1e3),y=n.computed(()=>m_(s.dirPath)),S=n.computed(()=>s.items.filter(U=>U.canBeSelected&&U.selected&&!U.isDir)),k=n.computed(()=>S.value.length>0),D=()=>{r("update:modelValue",!1)},E=()=>{var U;k.value&&(U=s.storageEntry)!=null&&U.handle&&(r("import:files",{storageHandle:s.storageEntry.handle,files:S.value.map(P=>P.handle)}),D())},A=U=>{s.dirPath=U,s.storageEntry&&h()},w=(U,P)=>{const{shiftKey:W,metaKey:F}=U,{lastSelected:Y}=s;if(U.preventDefault(),P.canBeSelected){if(o.multi||s.items.forEach(ue=>ue.selected=!1),P.selected=!0,!o.multi)return;!F&&!W&&s.items.forEach(ue=>{ue.id!==P.id&&(ue.selected=!1)}),W&&Y!==void 0&&s.items.forEach(ue=>{cb(ue.id,Y,P.id)&&(ue.selected=!0)}),P.selected&&(s.lastSelected=P.id)}},L=U=>{U&&!o.multi||s.items.filter(P=>P.canBeSelected).forEach(P=>{P.selected=U})},R=()=>L(!0),H=()=>L(!1),G=()=>{if(s.error="",s.lastSelected=void 0,H(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(U=>{s.storageOptions=U.map(P=>({text:P.name,value:P})),o.autoSelectStorage&&Mn(U.find(P=>P.name==="local"||P.name.startsWith("local_disk_")&&P.initialFullPath.length>4),P=>{s.storageEntry=P,s.dirPath=P.initialFullPath})}).catch(U=>s.error=String(U))};n.watch(n.toRef(s,"storageEntry"),U=>{s.dirPath=(U==null?void 0:U.initialFullPath)??""}),n.watch([()=>s.dirPath,()=>s.storageEntry],()=>{h()}),n.watch(()=>o.modelValue,U=>{U?G():Object.assign(s,i())},{immediate:!0}),et(document,"keydown",U=>{o.modelValue&&U.target===document.body&&(U.metaKey&&U.code==="KeyA"&&(U.preventDefault(),R()),U.metaKey&&U.shiftKey&&U.code==="Period"&&(U.preventDefault(),s.showHiddenItems=!s.showHiddenItems),U.code==="Enter"&&E())}),n.onUpdated(G);const K={mounted:U=>{if(U.clientWidth<U.scrollWidth){const P=U.innerText;U.innerText=P.substring(0,57)+"..."+P.substring(P.length-10)}}};return(U,P)=>(n.openBlock(),n.createBlock(n.unref(xs),{"no-content-gutters":!0,class:"split","model-value":U.modelValue,width:"688px",height:"720px","onUpdate:modelValue":D,onClick:n.withModifiers(H,["stop"])},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(U.title??"Select files"),1)]),actions:n.withCtx(()=>[n.createVNode(n.unref(cs),{style:{"min-width":"160px"},disabled:!k.value,onClick:n.withModifiers(E,["stop"])},{default:n.withCtx(()=>P[14]||(P[14]=[n.createTextVNode("Import")])),_:1},8,["disabled"]),P[16]||(P[16]=n.createTextVNode()),n.createVNode(n.unref(us),{"justify-center":!1,onClick:n.withModifiers(D,["stop"])},{default:n.withCtx(()=>P[15]||(P[15]=[n.createTextVNode("Cancel")])),_:1})]),default:n.withCtx(()=>[P[17]||(P[17]=n.createTextVNode()),n.createElementVNode("div",v_,[n.createElementVNode("div",y_,[n.createVNode(n.unref(ys),{modelValue:s.storageEntry,"onUpdate:modelValue":P[0]||(P[0]=W=>s.storageEntry=W),label:"Select storage",options:s.storageOptions},null,8,["modelValue","options"]),P[1]||(P[1]=n.createTextVNode()),n.createVNode(n.unref(ju),{"model-value":s.dirPath,label:"Enter path","onUpdate:modelValue":n.unref(f)},null,8,["model-value","onUpdate:modelValue"])]),P[13]||(P[13]=n.createTextVNode()),n.createElementVNode("div",b_,[n.createElementVNode("div",w_,[n.createElementVNode("div",x_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value,(W,F)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:F},[n.createElementVNode("div",{title:W.path,onClick:Y=>A(W.path)},n.toDisplayString(W.name),9,C_),P[2]||(P[2]=n.createTextVNode()),W.index!==y.value.length-1?(n.openBlock(),n.createElementBlock("i",__)):n.createCommentVNode("",!0)],64))),128))]),P[3]||(P[3]=n.createTextVNode()),n.createElementVNode("div",k_,[n.createElementVNode("span",S_,"Selected: "+n.toDisplayString(S.value.length),1)])]),P[12]||(P[12]=n.createTextVNode()),s.currentLoadingPath!==void 0?(n.openBlock(),n.createElementBlock("div",T_,P[4]||(P[4]=[n.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):s.storageEntry?s.error?(n.openBlock(),n.createElementBlock("div",N_,[P[6]||(P[6]=n.createElementVNode("div",{class:"ls-error__cat"},null,-1)),P[7]||(P[7]=n.createTextVNode()),n.createElementVNode("div",A_,n.toDisplayString(s.error),1)])):(n.openBlock(),n.createElementBlock("div",M_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,W=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:W.id},[W.isDir?(n.openBlock(),n.createElementBlock("div",{key:0,class:"isDir",onClick:F=>A(W.path)},[P[8]||(P[8]=n.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),P[9]||(P[9]=n.createTextVNode()),n.withDirectives((n.openBlock(),n.createElementBlock("span",{title:W.name},[n.createTextVNode(n.toDisplayString(W.name),1)],8,P_)),[[K]])],8,B_)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass({canBeSelected:W.canBeSelected,selected:W.selected}),onClick:n.withModifiers(F=>w(F,W),["stop"])},[P[10]||(P[10]=n.createElementVNode("i",{class:"mask-16 mask-comp isFile"},null,-1)),P[11]||(P[11]=n.createTextVNode()),n.withDirectives((n.openBlock(),n.createElementBlock("span",{title:W.name},[n.createTextVNode(n.toDisplayString(W.name),1)],8,V_)),[[K]])],10,D_))],64))),128))])):(n.openBlock(),n.createElementBlock("div",E_,P[5]||(P[5]=[n.createElementVNode("div",{class:"ls-empty__cat"},null,-1),n.createTextVNode(),n.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),P[18]||(P[18]=n.createTextVNode())]),_:1},8,["model-value"]))}});var Fe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const d of i)s[d]=d;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),d={};for(const u of s)d[u]=i[u];return t.objectValues(d)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const d in i)Object.prototype.hasOwnProperty.call(i,d)&&s.push(d);return s},t.find=(i,s)=>{for(const d of i)if(s(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,s=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(s)}t.joinValues=o,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Fe||(Fe={}));var Cs;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Cs||(Cs={}));const ae=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),an=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=Fe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),L_=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(s){return s.message},o={_errors:[]},i=s=>{for(const d of s.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)o._errors.push(r(d));else{let u=o,p=0;for(;p<d.path.length;){const h=d.path[p];p===d.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(r(d))):u[h]=u[h]||{_errors:[]},u=u[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Lt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},o=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}}Lt.create=t=>new Lt(t);const oo=(t,e)=>{let r;switch(t.code){case Q.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Fe.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:r="Invalid input";break;case Q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(t.options)}`;break;case Q.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:r="Invalid function arguments";break;case Q.invalid_return_type:r="Invalid function return type";break;case Q.invalid_date:r="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Fe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Q.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Q.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Q.custom:r="Invalid input";break;case Q.invalid_intersection_types:r="Intersection results could not be merged";break;case Q.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:r="Number must be finite";break;default:r=e.defaultError,Fe.assertNever(t)}return{message:r}};let Ku=oo;function I_(t){Ku=t}function fi(){return Ku}const mi=t=>{const{data:e,path:r,errorMaps:o,issueData:i}=t,s=[...r,...i.path||[]],d={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let u="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)u=h(d,{data:e,defaultError:u}).message;return{...i,path:s,message:u}},F_=[];function ne(t,e){const r=fi(),o=mi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===oo?void 0:oo].filter(i=>!!i)});t.common.issues.push(o)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const o=[];for(const i of r){if(i.status==="aborted")return we;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){const o=[];for(const i of r){const s=await i.key,d=await i.value;o.push({key:s,value:d})}return ft.mergeObjectSync(e,o)}static mergeObjectSync(e,r){const o={};for(const i of r){const{key:s,value:d}=i;if(s.status==="aborted"||d.status==="aborted")return we;s.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(o[s.value]=d.value)}return{status:e.value,value:o}}}const we=Object.freeze({status:"aborted"}),vi=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),_s=t=>t.status==="aborted",ks=t=>t.status==="dirty",ia=t=>t.status==="valid",la=t=>typeof Promise<"u"&&t instanceof Promise;function yi(t,e,r,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Yu(t,e,r,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var sa,ca;class Sr{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ju=(t,e)=>{if(ia(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Lt(t.common.issues);return this._error=r,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:o,description:i}=t;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,d)=>{var u,p;const{message:h}=t;return s.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:(u=h??o)!==null&&u!==void 0?u:d.defaultError}:s.code!=="invalid_type"?{message:d.defaultError}:{message:(p=h??r)!==null&&p!==void 0?p:d.defaultError}},description:i}}class Ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return an(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:an(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:an(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(la(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;const i={common:{issues:[],async:(o=r==null?void 0:r.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:an(e)},s=this._parseSync({data:e,path:i.path,parent:i});return Ju(i,s)}async parseAsync(e,r){const o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){const o={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:an(e)},i=this._parse({data:e,path:o.path,parent:o}),s=await(la(i)?i:Promise.resolve(i));return Ju(o,s)}refine(e,r){const o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const d=e(i),u=()=>s.addIssue({code:Q.custom,...o(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new lr({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Er.create(this,this._def)}nullable(){return un.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ir.create(this,this._def)}promise(){return so.create(this,this._def)}or(e){return ga.create([this,e],this._def)}and(e){return ha.create(this,e,this._def)}transform(e){return new lr({...Te(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ba({...Te(this._def),innerType:this,defaultValue:r,typeName:ve.ZodDefault})}brand(){return new Es({typeName:ve.ZodBranded,type:this,...Te(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new wa({...Te(this._def),innerType:this,catchValue:r,typeName:ve.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xa.create(this,e)}readonly(){return Ca.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R_=/^c[^\s-]{8,}$/i,O_=/^[0-9a-z]+$/,z_=/^[0-9A-HJKMNP-TV-Z]{26}$/,G_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,j_=/^[a-z0-9_-]{21}$/i,U_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Z_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ss;const W_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H_=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,q_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",K_=new RegExp(`^${Qu}$`);function Xu(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Y_(t){return new RegExp(`^${Xu(t)}$`)}function ep(t){let e=`${Qu}T${Xu(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function J_(t,e){return!!((e==="v4"||!e)&&W_.test(t)||(e==="v6"||!e)&&H_.test(t))}class ar extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.string,received:i.parsedType}),we}const r=new ft;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,d=e.data.length<i.value;(s||d)&&(o=this._getOrReturnCtx(e,o),s?ne(o,{code:Q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):d&&ne(o,{code:Q.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Z_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"email",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Ss||(Ss=new RegExp($_,"u")),Ss.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"emoji",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")G_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"uuid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")j_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"nanoid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")R_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"cuid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")O_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"cuid2",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")z_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"ulid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),ne(o,{validation:"url",code:Q.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"regex",code:Q.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?ep(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?K_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Y_(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?U_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"duration",code:Q.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?J_(e.data,i.version)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"ip",code:Q.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?q_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"base64",code:Q.invalid_string,message:i.message}),r.dirty()):Fe.assertNever(i);return{status:r.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:Q.invalid_string,...de.errToObj(o)})}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var r,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...de.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...de.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...de.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...de.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...de.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...de.errToObj(r)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ar({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ar({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}ar.create=t=>{var e;return new ar({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Q_(t,e){const r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,s=parseInt(t.toFixed(i).replace(".","")),d=parseInt(e.toFixed(i).replace(".",""));return s%d/Math.pow(10,i)}class ln extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.number,received:i.parsedType}),we}let r;const o=new ft;for(const i of this._def.checks)i.kind==="int"?Fe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Q_(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.not_finite,message:i.message}),o.dirty()):Fe.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,de.toString(r))}gt(e,r){return this.setLimit("min",e,!1,de.toString(r))}lte(e,r){return this.setLimit("max",e,!0,de.toString(r))}lt(e,r){return this.setLimit("max",e,!1,de.toString(r))}setLimit(e,r,o,i){return new ln({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:de.toString(i)}]})}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Fe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}}ln.create=t=>new ln({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class sn extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.bigint,received:i.parsedType}),we}let r;const o=new ft;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Fe.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,de.toString(r))}gt(e,r){return this.setLimit("min",e,!1,de.toString(r))}lte(e,r){return this.setLimit("max",e,!0,de.toString(r))}lt(e,r){return this.setLimit("max",e,!1,de.toString(r))}setLimit(e,r,o,i){return new sn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:de.toString(i)}]})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}sn.create=t=>{var e;return new sn({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class da extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.boolean,received:r.parsedType}),we}return xt(e.data)}}da.create=t=>new da({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Pn extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.date,received:i.parsedType}),we}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_date}),we}const r=new ft;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Fe.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Pn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:de.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Pn.create=t=>new Pn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Te(t)});class bi extends Ae{_parse(e){if(this._getType(e)!==ae.symbol){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.symbol,received:r.parsedType}),we}return xt(e.data)}}bi.create=t=>new bi({typeName:ve.ZodSymbol,...Te(t)});class ua extends Ae{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.undefined,received:r.parsedType}),we}return xt(e.data)}}ua.create=t=>new ua({typeName:ve.ZodUndefined,...Te(t)});class pa extends Ae{_parse(e){if(this._getType(e)!==ae.null){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.null,received:r.parsedType}),we}return xt(e.data)}}pa.create=t=>new pa({typeName:ve.ZodNull,...Te(t)});class ao extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}ao.create=t=>new ao({typeName:ve.ZodAny,...Te(t)});class Dn extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}}Dn.create=t=>new Dn({typeName:ve.ZodUnknown,...Te(t)});class Ir extends Ae{_parse(e){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.never,received:r.parsedType}),we}}Ir.create=t=>new Ir({typeName:ve.ZodNever,...Te(t)});class wi extends Ae{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.void,received:r.parsedType}),we}return xt(e.data)}}wi.create=t=>new wi({typeName:ve.ZodVoid,...Te(t)});class ir extends Ae{_parse(e){const{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ne(r,{code:Q.invalid_type,expected:ae.array,received:r.parsedType}),we;if(i.exactLength!==null){const d=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(d||u)&&(ne(r,{code:d?Q.too_big:Q.too_small,minimum:u?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ne(r,{code:Q.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ne(r,{code:Q.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((d,u)=>i.type._parseAsync(new Sr(r,d,r.path,u)))).then(d=>ft.mergeArray(o,d));const s=[...r.data].map((d,u)=>i.type._parseSync(new Sr(r,d,r.path,u)));return ft.mergeArray(o,s)}get element(){return this._def.type}min(e,r){return new ir({...this._def,minLength:{value:e,message:de.toString(r)}})}max(e,r){return new ir({...this._def,maxLength:{value:e,message:de.toString(r)}})}length(e,r){return new ir({...this._def,exactLength:{value:e,message:de.toString(r)}})}nonempty(e){return this.min(1,e)}}ir.create=(t,e)=>new ir({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Te(e)});function io(t){if(t instanceof Ye){const e={};for(const r in t.shape){const o=t.shape[r];e[r]=Er.create(io(o))}return new Ye({...t._def,shape:()=>e})}else return t instanceof ir?new ir({...t._def,type:io(t.element)}):t instanceof Er?Er.create(io(t.unwrap())):t instanceof un?un.create(io(t.unwrap())):t instanceof Tr?Tr.create(t.items.map(e=>io(e))):t}class Ye extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Fe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){const p=this._getOrReturnCtx(e);return ne(p,{code:Q.invalid_type,expected:ae.object,received:p.parsedType}),we}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),d=[];if(!(this._def.catchall instanceof Ir&&this._def.unknownKeys==="strip"))for(const p in o.data)s.includes(p)||d.push(p);const u=[];for(const p of s){const h=i[p],f=o.data[p];u.push({key:{status:"valid",value:p},value:h._parse(new Sr(o,f,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Ir){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of d)u.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(p==="strict")d.length>0&&(ne(o,{code:Q.unrecognized_keys,keys:d}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of d){const f=o.data[h];u.push({key:{status:"valid",value:h},value:p._parse(new Sr(o,f,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of u){const f=await h.key,y=await h.value;p.push({key:f,value:y,alwaysSet:h.alwaysSet})}return p}).then(p=>ft.mergeObjectSync(r,p)):ft.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{var i,s,d,u;const p=(d=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,o).message)!==null&&d!==void 0?d:o.defaultError;return r.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ye({...this._def,unknownKeys:"strip"})}passthrough(){return new Ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ye({...this._def,catchall:e})}pick(e){const r={};return Fe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new Ye({...this._def,shape:()=>r})}omit(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new Ye({...this._def,shape:()=>r})}deepPartial(){return io(this)}partial(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new Ye({...this._def,shape:()=>r})}required(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Er;)i=i._def.innerType;r[o]=i}}),new Ye({...this._def,shape:()=>r})}keyof(){return tp(Fe.objectKeys(this.shape))}}Ye.create=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strip",catchall:Ir.create(),typeName:ve.ZodObject,...Te(e)}),Ye.strictCreate=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strict",catchall:Ir.create(),typeName:ve.ZodObject,...Te(e)}),Ye.lazycreate=(t,e)=>new Ye({shape:t,unknownKeys:"strip",catchall:Ir.create(),typeName:ve.ZodObject,...Te(e)});class ga extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=this._def.options;function i(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;const d=s.map(u=>new Lt(u.ctx.common.issues));return ne(r,{code:Q.invalid_union,unionErrors:d}),we}if(r.common.async)return Promise.all(o.map(async s=>{const d={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(i);{let s;const d=[];for(const p of o){const h={...r,common:{...r.common,issues:[]},parent:null},f=p._parseSync({data:r.data,path:r.path,parent:h});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:h}),h.common.issues.length&&d.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const u=d.map(p=>new Lt(p));return ne(r,{code:Q.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}ga.create=(t,e)=>new ga({options:t,typeName:ve.ZodUnion,...Te(e)});const cn=t=>t instanceof ma?cn(t.schema):t instanceof lr?cn(t.innerType()):t instanceof va?[t.value]:t instanceof dn?t.options:t instanceof ya?Fe.objectValues(t.enum):t instanceof ba?cn(t._def.innerType):t instanceof ua?[void 0]:t instanceof pa?[null]:t instanceof Er?[void 0,...cn(t.unwrap())]:t instanceof un?[null,...cn(t.unwrap())]:t instanceof Es||t instanceof Ca?cn(t.unwrap()):t instanceof wa?cn(t._def.innerType):[];class xi extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ne(r,{code:Q.invalid_type,expected:ae.object,received:r.parsedType}),we;const o=this.discriminator,i=r.data[o],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ne(r,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){const i=new Map;for(const s of r){const d=cn(s.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,s)}}return new xi({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Te(o)})}}function Ts(t,e){const r=an(t),o=an(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&o===ae.object){const i=Fe.objectKeys(e),s=Fe.objectKeys(t).filter(u=>i.indexOf(u)!==-1),d={...t,...e};for(const u of s){const p=Ts(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(r===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const d=t[s],u=e[s],p=Ts(d,u);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ha extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=(s,d)=>{if(_s(s)||_s(d))return we;const u=Ts(s.value,d.value);return u.valid?((ks(s)||ks(d))&&r.dirty(),{status:r.value,value:u.data}):(ne(o,{code:Q.invalid_intersection_types}),we)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([s,d])=>i(s,d)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ha.create=(t,e,r)=>new ha({left:t,right:e,typeName:ve.ZodIntersection,...Te(r)});class Tr extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ne(o,{code:Q.invalid_type,expected:ae.array,received:o.parsedType}),we;if(o.data.length<this._def.items.length)return ne(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&o.data.length>this._def.items.length&&(ne(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...o.data].map((s,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new Sr(o,s,o.path,d)):null}).filter(s=>!!s);return o.common.async?Promise.all(i).then(s=>ft.mergeArray(r,s)):ft.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Tr({...this._def,rest:e})}}Tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tr({items:t,typeName:ve.ZodTuple,rest:null,...Te(e)})};class fa extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ne(o,{code:Q.invalid_type,expected:ae.object,received:o.parsedType}),we;const i=[],s=this._def.keyType,d=this._def.valueType;for(const u in o.data)i.push({key:s._parse(new Sr(o,u,o.path,u)),value:d._parse(new Sr(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?ft.mergeObjectAsync(r,i):ft.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ae?new fa({keyType:e,valueType:r,typeName:ve.ZodRecord,...Te(o)}):new fa({keyType:ar.create(),valueType:e,typeName:ve.ZodRecord,...Te(r)})}}class Ci extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ne(o,{code:Q.invalid_type,expected:ae.map,received:o.parsedType}),we;const i=this._def.keyType,s=this._def.valueType,d=[...o.data.entries()].map(([u,p],h)=>({key:i._parse(new Sr(o,u,o.path,[h,"key"])),value:s._parse(new Sr(o,p,o.path,[h,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){const h=await p.key,f=await p.value;if(h.status==="aborted"||f.status==="aborted")return we;(h.status==="dirty"||f.status==="dirty")&&r.dirty(),u.set(h.value,f.value)}return{status:r.value,value:u}})}else{const u=new Map;for(const p of d){const h=p.key,f=p.value;if(h.status==="aborted"||f.status==="aborted")return we;(h.status==="dirty"||f.status==="dirty")&&r.dirty(),u.set(h.value,f.value)}return{status:r.value,value:u}}}}Ci.create=(t,e,r)=>new Ci({valueType:e,keyType:t,typeName:ve.ZodMap,...Te(r)});class Vn extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ne(o,{code:Q.invalid_type,expected:ae.set,received:o.parsedType}),we;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ne(o,{code:Q.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ne(o,{code:Q.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function d(p){const h=new Set;for(const f of p){if(f.status==="aborted")return we;f.status==="dirty"&&r.dirty(),h.add(f.value)}return{status:r.value,value:h}}const u=[...o.data.values()].map((p,h)=>s._parse(new Sr(o,p,o.path,h)));return o.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,r){return new Vn({...this._def,minSize:{value:e,message:de.toString(r)}})}max(e,r){return new Vn({...this._def,maxSize:{value:e,message:de.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Vn.create=(t,e)=>new Vn({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Te(e)});class lo extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ne(r,{code:Q.invalid_type,expected:ae.function,received:r.parsedType}),we;function o(u,p){return mi({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fi(),oo].filter(h=>!!h),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function i(u,p){return mi({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fi(),oo].filter(h=>!!h),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const s={errorMap:r.common.contextualErrorMap},d=r.data;if(this._def.returns instanceof so){const u=this;return xt(async function(...p){const h=new Lt([]),f=await u._def.args.parseAsync(p,s).catch(S=>{throw h.addIssue(o(p,S)),h}),y=await Reflect.apply(d,this,f);return await u._def.returns._def.type.parseAsync(y,s).catch(S=>{throw h.addIssue(i(y,S)),h})})}else{const u=this;return xt(function(...p){const h=u._def.args.safeParse(p,s);if(!h.success)throw new Lt([o(p,h.error)]);const f=Reflect.apply(d,this,h.data),y=u._def.returns.safeParse(f,s);if(!y.success)throw new Lt([i(f,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new lo({...this._def,args:Tr.create(e).rest(Dn.create())})}returns(e){return new lo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new lo({args:e||Tr.create([]).rest(Dn.create()),returns:r||Dn.create(),typeName:ve.ZodFunction,...Te(o)})}}class ma extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ma.create=(t,e)=>new ma({getter:t,typeName:ve.ZodLazy,...Te(e)});class va extends Ae{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return ne(r,{received:r.data,code:Q.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}}va.create=(t,e)=>new va({value:t,typeName:ve.ZodLiteral,...Te(e)});function tp(t,e){return new dn({values:t,typeName:ve.ZodEnum,...Te(e)})}class dn extends Ae{constructor(){super(...arguments),sa.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),o=this._def.values;return ne(r,{expected:Fe.joinValues(o),received:r.parsedType,code:Q.invalid_type}),we}if(yi(this,sa)||Yu(this,sa,new Set(this._def.values)),!yi(this,sa).has(e.data)){const r=this._getOrReturnCtx(e),o=this._def.values;return ne(r,{received:r.data,code:Q.invalid_enum_value,options:o}),we}return xt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return dn.create(e,{...this._def,...r})}exclude(e,r=this._def){return dn.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}}sa=new WeakMap,dn.create=tp;class ya extends Ae{constructor(){super(...arguments),ca.set(this,void 0)}_parse(e){const r=Fe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const i=Fe.objectValues(r);return ne(o,{expected:Fe.joinValues(i),received:o.parsedType,code:Q.invalid_type}),we}if(yi(this,ca)||Yu(this,ca,new Set(Fe.getValidEnumValues(this._def.values))),!yi(this,ca).has(e.data)){const i=Fe.objectValues(r);return ne(o,{received:o.data,code:Q.invalid_enum_value,options:i}),we}return xt(e.data)}get enum(){return this._def.values}}ca=new WeakMap,ya.create=(t,e)=>new ya({values:t,typeName:ve.ZodNativeEnum,...Te(e)});class so extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ne(r,{code:Q.invalid_type,expected:ae.promise,received:r.parsedType}),we;const o=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return xt(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}so.create=(t,e)=>new so({type:t,typeName:ve.ZodPromise,...Te(e)});class lr extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:d=>{ne(o,d),d.fatal?r.abort():r.dirty()},get path(){return o.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const d=i.transform(o.data,s);if(o.common.async)return Promise.resolve(d).then(async u=>{if(r.value==="aborted")return we;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?we:p.status==="dirty"||r.value==="dirty"?vi(p.value):p});{if(r.value==="aborted")return we;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?we:u.status==="dirty"||r.value==="dirty"?vi(u.value):u}}if(i.type==="refinement"){const d=u=>{const p=i.refinement(u,s);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?we:(u.status==="dirty"&&r.dirty(),d(u.value),{status:r.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&r.dirty(),d(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!ia(d))return d;const u=i.transform(d.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>ia(d)?Promise.resolve(i.transform(d.value,s)).then(u=>({status:r.value,value:u})):d);Fe.assertNever(i)}}lr.create=(t,e,r)=>new lr({schema:t,typeName:ve.ZodEffects,effect:e,...Te(r)}),lr.createWithPreprocess=(t,e,r)=>new lr({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Te(r)});class Er extends Ae{_parse(e){return this._getType(e)===ae.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(t,e)=>new Er({innerType:t,typeName:ve.ZodOptional,...Te(e)});class un extends Ae{_parse(e){return this._getType(e)===ae.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}un.create=(t,e)=>new un({innerType:t,typeName:ve.ZodNullable,...Te(e)});class ba extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);let o=r.data;return r.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ba.create=(t,e)=>new ba({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class wa extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return la(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}wa.create=(t,e)=>new wa({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class _i extends Ae{_parse(e){if(this._getType(e)!==ae.nan){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.nan,received:r.parsedType}),we}return{status:"valid",value:e.data}}}_i.create=t=>new _i({typeName:ve.ZodNaN,...Te(t)});const X_=Symbol("zod_brand");class Es extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}}class xa extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?we:i.status==="dirty"?(r.dirty(),vi(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?we:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new xa({in:e,out:r,typeName:ve.ZodPipeline})}}class Ca extends Ae{_parse(e){const r=this._def.innerType._parse(e),o=i=>(ia(i)&&(i.value=Object.freeze(i.value)),i);return la(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}}Ca.create=(t,e)=>new Ca({innerType:t,typeName:ve.ZodReadonly,...Te(e)});function rp(t,e={},r){return t?ao.create().superRefine((o,i)=>{var s,d;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(d=(s=u.fatal)!==null&&s!==void 0?s:r)!==null&&d!==void 0?d:!0,h=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...h,fatal:p})}}):ao.create()}const e1={object:Ye.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const t1=(t,e={message:`Input not instance of ${t.name}`})=>rp(r=>r instanceof t,e),np=ar.create,op=ln.create,r1=_i.create,n1=sn.create,ap=da.create,o1=Pn.create,a1=bi.create,i1=ua.create,l1=pa.create,s1=ao.create,c1=Dn.create,d1=Ir.create,u1=wi.create,p1=ir.create,g1=Ye.create,h1=Ye.strictCreate,f1=ga.create,m1=xi.create,v1=ha.create,y1=Tr.create,b1=fa.create,w1=Ci.create,x1=Vn.create,C1=lo.create,_1=ma.create,k1=va.create,S1=dn.create,T1=ya.create,E1=so.create,ip=lr.create,N1=Er.create,A1=un.create,M1=lr.createWithPreprocess,B1=xa.create;var ki=Object.freeze({__proto__:null,defaultErrorMap:oo,setErrorMap:I_,getErrorMap:fi,makeIssue:mi,EMPTY_PATH:F_,addIssueToContext:ne,ParseStatus:ft,INVALID:we,DIRTY:vi,OK:xt,isAborted:_s,isDirty:ks,isValid:ia,isAsync:la,get util(){return Fe},get objectUtil(){return Cs},ZodParsedType:ae,getParsedType:an,ZodType:Ae,datetimeRegex:ep,ZodString:ar,ZodNumber:ln,ZodBigInt:sn,ZodBoolean:da,ZodDate:Pn,ZodSymbol:bi,ZodUndefined:ua,ZodNull:pa,ZodAny:ao,ZodUnknown:Dn,ZodNever:Ir,ZodVoid:wi,ZodArray:ir,ZodObject:Ye,ZodUnion:ga,ZodDiscriminatedUnion:xi,ZodIntersection:ha,ZodTuple:Tr,ZodRecord:fa,ZodMap:Ci,ZodSet:Vn,ZodFunction:lo,ZodLazy:ma,ZodLiteral:va,ZodEnum:dn,ZodNativeEnum:ya,ZodPromise:so,ZodEffects:lr,ZodTransformer:lr,ZodOptional:Er,ZodNullable:un,ZodDefault:ba,ZodCatch:wa,ZodNaN:_i,BRAND:X_,ZodBranded:Es,ZodPipeline:xa,ZodReadonly:Ca,custom:rp,Schema:Ae,ZodSchema:Ae,late:e1,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>ar.create({...t,coerce:!0}),number:t=>ln.create({...t,coerce:!0}),boolean:t=>da.create({...t,coerce:!0}),bigint:t=>sn.create({...t,coerce:!0}),date:t=>Pn.create({...t,coerce:!0})},any:s1,array:p1,bigint:n1,boolean:ap,date:o1,discriminatedUnion:m1,effect:ip,enum:S1,function:C1,instanceof:t1,intersection:v1,lazy:_1,literal:k1,map:w1,nan:r1,nativeEnum:T1,never:d1,null:l1,nullable:A1,number:op,object:g1,oboolean:()=>ap().optional(),onumber:()=>op().optional(),optional:N1,ostring:()=>np().optional(),pipeline:B1,preprocess:M1,promise:E1,record:b1,set:x1,strictObject:h1,string:np,symbol:a1,transformer:ip,tuple:y1,undefined:i1,union:f1,unknown:c1,void:u1,NEVER:we,ZodIssueCode:Q,quotelessJson:L_,ZodError:Lt});function P1(t){throw new Error("Unexpected object: "+t)}const lp="upload://upload/",sp="index://index/";function D1(t){return t.startsWith(lp)}function V1(t){return t.startsWith(sp)}function L1(t){if(V1(t)){const e=t.slice(sp.length);return JSON.parse(decodeURIComponent(e)).path}else if(D1(t)){const e=t.slice(lp.length);return JSON.parse(decodeURIComponent(e)).localPath}P1(t)}ki.object({__isRef:ki.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ki.string().describe("Upstream block id"),name:ki.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function I1(t){return t.replace(/^.*[\\/]/,"")}const F1={key:0,ref:"label"},R1={key:0,class:"required-icon"},O1=["data-placeholder"],z1={key:5,class:"pl-file-input__stats"},G1={key:0,class:"pl-file-input__error"},j1={key:1,class:"upl-file-input__helper"},cp=n.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const r=n.reactive({fileDialogOpen:!1}),o=n.useSlots(),i=e,s=t,d=n.computed(()=>{if(s.modelValue)try{const w=L1(s.modelValue).trim();return s.showFilenameOnly?I1(w):w}catch(w){return console.error(w),s.modelValue}return""}),u=n.computed(()=>s.progress&&!s.progress.done),p=n.computed(()=>s.progress&&s.progress.done),h=n.computed(()=>s.error),f=n.computed(()=>s.error),y=n.computed(()=>{const{status:w,done:L}=s.progress??{};return!w||!w.bytesTotal?"":w.bytesProcessed&&!L?es(w.bytesProcessed,{})+" / "+es(w.bytesTotal,{}):es(w.bytesTotal,{})}),S=n.computed(()=>{var w;const{progress:L}=s;return L?{width:L.done?"100%":Math.round((((w=L.status)==null?void 0:w.progress)??0)*100)+"%"}:{}}),k=()=>{r.fileDialogOpen=!0},D=w=>{w.files.length&&i("update:modelValue",w.files[0])},E=()=>i("update:modelValue",void 0),A=n.ref();return s.cellStyle||Vr(A),(w,L)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{class:n.normalizeClass([{"pl-file-input__cell-style":!!w.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[n.createElementVNode("div",{ref_key:"rootRef",ref:A,class:n.normalizeClass(["pl-file-input",{dashed:w.dashed,error:h.value}]),tabindex:"0",onKeyup:n.withKeys(k,["enter"])},[n.createElementVNode("div",{class:"pl-file-input__progress",style:n.normalizeStyle(S.value)},null,4),L[3]||(L[3]=n.createTextVNode()),!w.cellStyle&&w.label?(n.openBlock(),n.createElementBlock("label",F1,[w.required?(n.openBlock(),n.createElementBlock("i",R1)):n.createCommentVNode("",!0),L[1]||(L[1]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(w.label),1),L[2]||(L[2]=n.createTextVNode()),n.unref(o).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(w.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0),L[4]||(L[4]=n.createTextVNode()),h.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:1,name:"restart"})):u.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:2,name:"cloud-upload"})):p.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:3,name:"success"})):(n.openBlock(),n.createBlock(n.unref(Lr),{key:4,name:"paper-clip"})),L[5]||(L[5]=n.createTextVNode()),n.createElementVNode("div",{"data-placeholder":w.placeholder??"Choose file",class:"pl-file-input__filename",onClick:n.withModifiers(k,["stop"])},n.toDisplayString(d.value),9,O1),L[6]||(L[6]=n.createTextVNode()),y.value?(n.openBlock(),n.createElementBlock("div",z1,n.toDisplayString(y.value),1)):n.createCommentVNode("",!0),L[7]||(L[7]=n.createTextVNode()),w.modelValue?(n.openBlock(),n.createBlock(n.unref(Lr),{key:6,name:"close",onClick:n.withModifiers(E,["stop"])})):n.createCommentVNode("",!0),L[8]||(L[8]=n.createTextVNode()),n.createVNode(on,{class:"pl-file-input__contour"})],34),L[9]||(L[9]=n.createTextVNode()),h.value?(n.openBlock(),n.createElementBlock("div",G1,n.toDisplayString(f.value),1)):w.helper?(n.openBlock(),n.createElementBlock("div",j1,n.toDisplayString(w.helper),1)):n.createCommentVNode("",!0)],2),L[10]||(L[10]=n.createTextVNode()),n.createVNode(n.unref(qu),{modelValue:r.fileDialogOpen,"onUpdate:modelValue":L[0]||(L[0]=R=>r.fileDialogOpen=R),extensions:w.extensions,title:w.fileDialogTitle,"onImport:files":D},null,8,["modelValue","extensions","title"])],64))}}),U1={class:"pl-notification-alert__wrapper d-flex"},Z1={class:"pl-notification-alert__content flex-grow-1"},$1={key:0,class:"pl-notification-alert__close"},W1={key:0,class:"pl-notification-alert__actions d-flex"},dp=n.defineComponent({__name:"PlNotificationAlert",props:n.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,r=n.useModel(t,"modelValue");function o(){e.closable&&(r.value=!1)}return(i,s)=>r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([i.type,"pl-notification-alert d-flex flex-column gap-16"]),style:n.normalizeStyle({width:`${i.width}`})},[n.createElementVNode("div",U1,[n.createElementVNode("div",Z1,[n.renderSlot(i.$slots,"default")]),s[0]||(s[0]=n.createTextVNode()),i.closable?(n.openBlock(),n.createElementBlock("div",$1,[n.createVNode(n.unref(us),{icon:"close",onClick:o})])):n.createCommentVNode("",!0)]),s[1]||(s[1]=n.createTextVNode()),i.$slots.actions?(n.openBlock(),n.createElementBlock("div",W1,[n.renderSlot(i.$slots,"actions")])):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)}}),up=n.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const r=e,o=n.ref(!1),i=n.computed(()=>o.value?"mask-clipboard-copied":"mask-clipboard");function s(){o.value=!0,setTimeout(()=>o.value=!1,700),r("copy")}return(d,u)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([i.value,"mask-24"]),onClick:s},null,2))}}),H1=n.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return n.provide(e.contextKey,n.computed(()=>e.context)),(r,o)=>n.renderSlot(r.$slots,"default")}});function mt(t,e,r){return e>t?e:t>r?r:t}const Ns=t=>n.computed(()=>{const e=[100],{min:r,max:o,step:i}=t.value;let s=r;for(;s<o;){s+=i;const d=(1-(mt(s,r,o)-r)/(o-r))*100;e.push(d)}return e}),q1={class:"ui-slider__wrapper"},K1={class:"ui-slider__label-section"},Y1={key:0,class:"text-s"},J1={key:1,class:"ui-slider__value-static text-s"},Q1={class:"ui-slider__base"},X1={class:"ui-slider__container"},ek={class:"ui-slider__container ui-slider__container-thumb"},tk={class:"ui-slider__input-wrapper d-flex"},rk=["value"],nk={key:0,class:"ui-slider__error"},ok=n.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const r=n.useSlots(),o=e,i=t,s=n.reactive({deltaValue:0}),d=n.computed(()=>i.max-i.min),u=n.computed(()=>mt((i.modelValue??0)+s.deltaValue,i.min,i.max)),p=n.ref(i.modelValue),h=n.computed(()=>{const G=i.modelValue;return Number.isFinite(G)?G<i.min?`Min value: ${i.min}`:G>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),f=n.computed(()=>i),y=Ns(f),S=n.computed(()=>(u.value-i.min)/d.value),k=n.computed(()=>({right:Math.ceil((1-S.value)*100)+"%"})),D=n.computed(()=>({right:`calc(${Math.ceil((1-S.value)*100)}%) `})),E=n.ref(),A=n.ref();n.watch(()=>i.modelValue,G=>{p.value=G});function w(G){const K=mt(G,i.min,i.max);return Math.round((K+Number.EPSILON)*(1/i.step))/(1/i.step)}nn(A,G=>{var K;ot((K=n.unref(E))==null?void 0:K.getBoundingClientRect(),U=>{const{dx:P}=G;s.deltaValue=P/U.width*d.value,p.value=w(mt((i.modelValue??0)+s.deltaValue,i.min,i.max)),G.stop&&(o("update:modelValue",w(u.value)),s.deltaValue=0)})});function L(G){o("update:modelValue",w(G))}function R(G){L(+G.target.value)}function H(G){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const K=G.code==="ArrowUp"||G.code==="ArrowRight"?i.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?i.step*-1:0;L(i.modelValue+K)}return(G,K)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[n.createElementVNode("div",{class:n.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[n.createElementVNode("div",q1,[n.createElementVNode("div",K1,[G.label?(n.openBlock(),n.createElementBlock("label",Y1,[n.createElementVNode("span",null,n.toDisplayString(G.label),1),K[1]||(K[1]=n.createTextVNode()),n.unref(r).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(G.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),K[2]||(K[2]=n.createTextVNode()),i.mode==="text"?(n.openBlock(),n.createElementBlock("div",J1,n.toDisplayString(p.value)+n.toDisplayString(G.measure),1)):n.createCommentVNode("",!0)]),K[6]||(K[6]=n.createTextVNode()),n.createElementVNode("div",Q1,[n.createElementVNode("div",X1,[n.createElementVNode("div",{ref_key:"barRef",ref:E,class:"ui-slider__bar"},[n.createElementVNode("div",{class:"ui-slider__progress",style:n.normalizeStyle(k.value)},null,4)],512)]),K[5]||(K[5]=n.createTextVNode()),n.createElementVNode("div",ek,[i.breakpoints?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(y),(U,P)=>(n.openBlock(),n.createElementBlock("div",{key:P,style:n.normalizeStyle({right:`${U}%`}),class:"ui-slider__thumb-step"},null,4))),128)):n.createCommentVNode("",!0),K[4]||(K[4]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef",ref:A,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:n.normalizeStyle(D.value),onKeydown:H},K[3]||(K[3]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),K[7]||(K[7]=n.createTextVNode()),n.createElementVNode("div",tk,[i.mode==="input"?(n.openBlock(),n.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:K[0]||(K[0]=U=>R(U))},null,40,rk)):n.createCommentVNode("",!0)])],2),K[8]||(K[8]=n.createTextVNode()),h.value?(n.openBlock(),n.createElementBlock("div",nk,n.toDisplayString(h.value),1)):n.createCommentVNode("",!0)],2))}});function ak(t,e=null,r=null){function o(u){const{scrollTop:p,scrollHeight:h,clientHeight:f}=u;if(!(h>f)||!e)return null;const y=h-p-f,S=p>e?e:0,k=y>e?f-e-S:f;return`linear-gradient(
|
|
65
|
+
`)},r=t,o=u_(r),i=n.ref(!0),s=n.ref(),d=n.ref(),u=n.computed(()=>{var S;return((S=o.value)==null?void 0:S.error)??r.error??e(r.output)}),p=n.computed(()=>{var S;return((S=o.value)==null?void 0:S.lines)??r.value??pb(r.output)});Vr(d);const h=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},f=()=>{Mn(s.value,S=>{i.value&&S.scrollTo(S.scrollLeft,S.scrollHeight)})};n.watch(p,()=>{requestAnimationFrame(()=>{f()})},{immediate:!0});const y=S=>{const k=S.target;i.value=k.scrollTop+20>=k.scrollHeight-k.offsetHeight};return(S,k)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:d,class:n.normalizeClass(["pl-log-view",{"has-error":u.value}])},[S.label?(n.openBlock(),n.createElementBlock("label",p_,n.toDisplayString(S.label),1)):n.createCommentVNode("",!0),k[0]||(k[0]=n.createTextVNode()),n.createVNode(on,{class:"pl-log-view__contour"}),k[1]||(k[1]=n.createTextVNode()),n.createVNode(n.unref(Lr),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:h}),k[2]||(k[2]=n.createTextVNode()),u.value?(n.openBlock(),n.createElementBlock("div",g_,n.toDisplayString(u.value),1)):(n.openBlock(),n.createElementBlock("div",{key:2,ref_key:"contentRef",ref:s,class:"pl-log-view__content",onScroll:y},n.toDisplayString(p.value),545))],2))}});function m_(t){const e=t.split("/"),r=[];for(let o=0;o<e.length;o++)r.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).join("/")});return r}const v_={class:"file-dialog"},y_={class:"file-dialog__search"},b_={class:"ls-container"},w_={class:"ls-head"},x_={class:"ls-head__breadcrumbs"},C_=["title","onClick"],__={key:0,class:"icon-16 icon-chevron-right"},k_={class:"d-flex ml-auto align-center gap-12"},S_={class:"ls-head__selected"},T_={key:0,class:"ls-loader"},E_={key:1,class:"ls-empty"},N_={key:2,class:"ls-error"},A_={class:"ls-error__message"},M_={key:3,class:"ls-body"},B_=["onClick"],P_=["title"],D_=["onClick"],V_=["title"],qu=n.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const r=e,o=t,i=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),s=n.reactive(i()),d=n.computed(()=>s.showHiddenItems?s.items:s.items.filter(U=>!U.name.startsWith("."))),u=n.computed(()=>{var U;return{modelValue:o.modelValue,dirPath:s.dirPath,storageHandle:(U=s.storageEntry)==null?void 0:U.handle}}),p=(U,P)=>{window.platforma&&s.currentLoadingPath!==P&&(s.error="",s.items=[],s.lastSelected=void 0,s.currentLoadingPath=P,window.platforma.lsDriver.listFiles(U,P).then(W=>{P===s.dirPath&&(s.items=gu(W).entries.map(F=>({path:F.fullPath,name:F.name,isDir:F.type==="dir",canBeSelected:F.type==="file"&&(!o.extensions||o.extensions.some(Y=>F.fullPath.endsWith(Y))),handle:F.type==="file"?F.handle:void 0,selected:!1})).sort((F,Y)=>F.isDir&&!Y.isDir?-1:!F.isDir&&Y.isDir?1:F.name.localeCompare(Y.name)).map((F,Y)=>({id:Y,...F})),s.lastSelected=void 0)}).catch(W=>s.error=String(W)).finally(()=>{s.currentLoadingPath=void 0}))},h=()=>{const{storageHandle:U,dirPath:P,modelValue:W}=u.value;U&&W&&p(U,P)},f=mu(U=>{s.dirPath=U??""},1e3),y=n.computed(()=>m_(s.dirPath)),S=n.computed(()=>s.items.filter(U=>U.canBeSelected&&U.selected&&!U.isDir)),k=n.computed(()=>S.value.length>0),D=()=>{r("update:modelValue",!1)},E=()=>{var U;k.value&&(U=s.storageEntry)!=null&&U.handle&&(r("import:files",{storageHandle:s.storageEntry.handle,files:S.value.map(P=>P.handle)}),D())},A=U=>{s.dirPath=U,s.storageEntry&&h()},w=(U,P)=>{const{shiftKey:W,metaKey:F}=U,{lastSelected:Y}=s;if(U.preventDefault(),P.canBeSelected){if(o.multi||s.items.forEach(ue=>ue.selected=!1),P.selected=!0,!o.multi)return;!F&&!W&&s.items.forEach(ue=>{ue.id!==P.id&&(ue.selected=!1)}),W&&Y!==void 0&&s.items.forEach(ue=>{cb(ue.id,Y,P.id)&&(ue.selected=!0)}),P.selected&&(s.lastSelected=P.id)}},L=U=>{U&&!o.multi||s.items.filter(P=>P.canBeSelected).forEach(P=>{P.selected=U})},R=()=>L(!0),H=()=>L(!1),G=()=>{if(s.error="",s.lastSelected=void 0,H(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(U=>{s.storageOptions=U.map(P=>({text:P.name,value:P})),o.autoSelectStorage&&Mn(U.find(P=>P.name==="local"||P.name.startsWith("local_disk_")&&P.initialFullPath.length>4),P=>{s.storageEntry=P,s.dirPath=P.initialFullPath})}).catch(U=>s.error=String(U))};n.watch(n.toRef(s,"storageEntry"),U=>{s.dirPath=(U==null?void 0:U.initialFullPath)??""}),n.watch([()=>s.dirPath,()=>s.storageEntry],()=>{h()}),n.watch(()=>o.modelValue,U=>{U?G():Object.assign(s,i())},{immediate:!0}),et(document,"keydown",U=>{o.modelValue&&U.target===document.body&&(U.metaKey&&U.code==="KeyA"&&(U.preventDefault(),R()),U.metaKey&&U.shiftKey&&U.code==="Period"&&(U.preventDefault(),s.showHiddenItems=!s.showHiddenItems),U.code==="Enter"&&E())}),n.onUpdated(G);const K={mounted:U=>{if(U.clientWidth<U.scrollWidth){const P=U.innerText;U.innerText=P.substring(0,57)+"..."+P.substring(P.length-10)}}};return(U,P)=>(n.openBlock(),n.createBlock(n.unref(xs),{"no-content-gutters":!0,class:"split","model-value":U.modelValue,width:"688px",height:"720px","onUpdate:modelValue":D,onClick:n.withModifiers(H,["stop"])},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(U.title??"Select files"),1)]),actions:n.withCtx(()=>[n.createVNode(n.unref(cs),{style:{"min-width":"160px"},disabled:!k.value,onClick:n.withModifiers(E,["stop"])},{default:n.withCtx(()=>P[14]||(P[14]=[n.createTextVNode("Import")])),_:1},8,["disabled"]),P[16]||(P[16]=n.createTextVNode()),n.createVNode(n.unref(us),{"justify-center":!1,onClick:n.withModifiers(D,["stop"])},{default:n.withCtx(()=>P[15]||(P[15]=[n.createTextVNode("Cancel")])),_:1})]),default:n.withCtx(()=>[P[17]||(P[17]=n.createTextVNode()),n.createElementVNode("div",v_,[n.createElementVNode("div",y_,[n.createVNode(n.unref(ys),{modelValue:s.storageEntry,"onUpdate:modelValue":P[0]||(P[0]=W=>s.storageEntry=W),label:"Select storage",options:s.storageOptions},null,8,["modelValue","options"]),P[1]||(P[1]=n.createTextVNode()),n.createVNode(n.unref(ju),{"model-value":s.dirPath,label:"Enter path","onUpdate:modelValue":n.unref(f)},null,8,["model-value","onUpdate:modelValue"])]),P[13]||(P[13]=n.createTextVNode()),n.createElementVNode("div",b_,[n.createElementVNode("div",w_,[n.createElementVNode("div",x_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value,(W,F)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:F},[n.createElementVNode("div",{title:W.path,onClick:Y=>A(W.path)},n.toDisplayString(W.name),9,C_),P[2]||(P[2]=n.createTextVNode()),W.index!==y.value.length-1?(n.openBlock(),n.createElementBlock("i",__)):n.createCommentVNode("",!0)],64))),128))]),P[3]||(P[3]=n.createTextVNode()),n.createElementVNode("div",k_,[n.createElementVNode("span",S_,"Selected: "+n.toDisplayString(S.value.length),1)])]),P[12]||(P[12]=n.createTextVNode()),s.currentLoadingPath!==void 0?(n.openBlock(),n.createElementBlock("div",T_,P[4]||(P[4]=[n.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):s.storageEntry?s.error?(n.openBlock(),n.createElementBlock("div",N_,[P[6]||(P[6]=n.createElementVNode("div",{class:"ls-error__cat"},null,-1)),P[7]||(P[7]=n.createTextVNode()),n.createElementVNode("div",A_,n.toDisplayString(s.error),1)])):(n.openBlock(),n.createElementBlock("div",M_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,W=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:W.id},[W.isDir?(n.openBlock(),n.createElementBlock("div",{key:0,class:"isDir",onClick:F=>A(W.path)},[P[8]||(P[8]=n.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),P[9]||(P[9]=n.createTextVNode()),n.withDirectives((n.openBlock(),n.createElementBlock("span",{title:W.name},[n.createTextVNode(n.toDisplayString(W.name),1)],8,P_)),[[K]])],8,B_)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass({canBeSelected:W.canBeSelected,selected:W.selected}),onClick:n.withModifiers(F=>w(F,W),["stop"])},[P[10]||(P[10]=n.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),P[11]||(P[11]=n.createTextVNode()),n.withDirectives((n.openBlock(),n.createElementBlock("span",{title:W.name},[n.createTextVNode(n.toDisplayString(W.name),1)],8,V_)),[[K]])],10,D_))],64))),128))])):(n.openBlock(),n.createElementBlock("div",E_,P[5]||(P[5]=[n.createElementVNode("div",{class:"ls-empty__cat"},null,-1),n.createTextVNode(),n.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),P[18]||(P[18]=n.createTextVNode())]),_:1},8,["model-value"]))}});var Fe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const d of i)s[d]=d;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),d={};for(const u of s)d[u]=i[u];return t.objectValues(d)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const d in i)Object.prototype.hasOwnProperty.call(i,d)&&s.push(d);return s},t.find=(i,s)=>{for(const d of i)if(s(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,s=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(s)}t.joinValues=o,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Fe||(Fe={}));var Cs;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Cs||(Cs={}));const ae=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),an=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=Fe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),L_=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(s){return s.message},o={_errors:[]},i=s=>{for(const d of s.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)o._errors.push(r(d));else{let u=o,p=0;for(;p<d.path.length;){const h=d.path[p];p===d.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(r(d))):u[h]=u[h]||{_errors:[]},u=u[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Lt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},o=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}}Lt.create=t=>new Lt(t);const oo=(t,e)=>{let r;switch(t.code){case Q.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Fe.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:r="Invalid input";break;case Q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(t.options)}`;break;case Q.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:r="Invalid function arguments";break;case Q.invalid_return_type:r="Invalid function return type";break;case Q.invalid_date:r="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Fe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Q.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Q.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Q.custom:r="Invalid input";break;case Q.invalid_intersection_types:r="Intersection results could not be merged";break;case Q.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:r="Number must be finite";break;default:r=e.defaultError,Fe.assertNever(t)}return{message:r}};let Ku=oo;function I_(t){Ku=t}function fi(){return Ku}const mi=t=>{const{data:e,path:r,errorMaps:o,issueData:i}=t,s=[...r,...i.path||[]],d={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let u="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)u=h(d,{data:e,defaultError:u}).message;return{...i,path:s,message:u}},F_=[];function ne(t,e){const r=fi(),o=mi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===oo?void 0:oo].filter(i=>!!i)});t.common.issues.push(o)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const o=[];for(const i of r){if(i.status==="aborted")return we;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){const o=[];for(const i of r){const s=await i.key,d=await i.value;o.push({key:s,value:d})}return ft.mergeObjectSync(e,o)}static mergeObjectSync(e,r){const o={};for(const i of r){const{key:s,value:d}=i;if(s.status==="aborted"||d.status==="aborted")return we;s.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(o[s.value]=d.value)}return{status:e.value,value:o}}}const we=Object.freeze({status:"aborted"}),vi=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),_s=t=>t.status==="aborted",ks=t=>t.status==="dirty",ia=t=>t.status==="valid",la=t=>typeof Promise<"u"&&t instanceof Promise;function yi(t,e,r,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Yu(t,e,r,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var sa,ca;class Sr{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ju=(t,e)=>{if(ia(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Lt(t.common.issues);return this._error=r,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:o,description:i}=t;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,d)=>{var u,p;const{message:h}=t;return s.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:(u=h??o)!==null&&u!==void 0?u:d.defaultError}:s.code!=="invalid_type"?{message:d.defaultError}:{message:(p=h??r)!==null&&p!==void 0?p:d.defaultError}},description:i}}class Ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return an(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:an(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:an(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(la(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;const i={common:{issues:[],async:(o=r==null?void 0:r.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:an(e)},s=this._parseSync({data:e,path:i.path,parent:i});return Ju(i,s)}async parseAsync(e,r){const o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){const o={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:an(e)},i=this._parse({data:e,path:o.path,parent:o}),s=await(la(i)?i:Promise.resolve(i));return Ju(o,s)}refine(e,r){const o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const d=e(i),u=()=>s.addIssue({code:Q.custom,...o(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new lr({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Er.create(this,this._def)}nullable(){return un.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ir.create(this,this._def)}promise(){return so.create(this,this._def)}or(e){return ga.create([this,e],this._def)}and(e){return ha.create(this,e,this._def)}transform(e){return new lr({...Te(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ba({...Te(this._def),innerType:this,defaultValue:r,typeName:ve.ZodDefault})}brand(){return new Es({typeName:ve.ZodBranded,type:this,...Te(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new wa({...Te(this._def),innerType:this,catchValue:r,typeName:ve.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xa.create(this,e)}readonly(){return Ca.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R_=/^c[^\s-]{8,}$/i,O_=/^[0-9a-z]+$/,z_=/^[0-9A-HJKMNP-TV-Z]{26}$/,G_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,j_=/^[a-z0-9_-]{21}$/i,U_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Z_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ss;const W_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H_=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,q_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",K_=new RegExp(`^${Qu}$`);function Xu(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Y_(t){return new RegExp(`^${Xu(t)}$`)}function ep(t){let e=`${Qu}T${Xu(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function J_(t,e){return!!((e==="v4"||!e)&&W_.test(t)||(e==="v6"||!e)&&H_.test(t))}class ar extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.string,received:i.parsedType}),we}const r=new ft;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,d=e.data.length<i.value;(s||d)&&(o=this._getOrReturnCtx(e,o),s?ne(o,{code:Q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):d&&ne(o,{code:Q.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Z_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"email",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Ss||(Ss=new RegExp($_,"u")),Ss.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"emoji",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")G_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"uuid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")j_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"nanoid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")R_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"cuid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")O_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"cuid2",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")z_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"ulid",code:Q.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),ne(o,{validation:"url",code:Q.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"regex",code:Q.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?ep(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?K_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Y_(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?U_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"duration",code:Q.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?J_(e.data,i.version)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"ip",code:Q.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?q_.test(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{validation:"base64",code:Q.invalid_string,message:i.message}),r.dirty()):Fe.assertNever(i);return{status:r.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:Q.invalid_string,...de.errToObj(o)})}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var r,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...de.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...de.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...de.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...de.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...de.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...de.errToObj(r)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ar({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ar({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}ar.create=t=>{var e;return new ar({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Q_(t,e){const r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,s=parseInt(t.toFixed(i).replace(".","")),d=parseInt(e.toFixed(i).replace(".",""));return s%d/Math.pow(10,i)}class ln extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.number,received:i.parsedType}),we}let r;const o=new ft;for(const i of this._def.checks)i.kind==="int"?Fe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Q_(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.not_finite,message:i.message}),o.dirty()):Fe.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,de.toString(r))}gt(e,r){return this.setLimit("min",e,!1,de.toString(r))}lte(e,r){return this.setLimit("max",e,!0,de.toString(r))}lt(e,r){return this.setLimit("max",e,!1,de.toString(r))}setLimit(e,r,o,i){return new ln({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:de.toString(i)}]})}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Fe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}}ln.create=t=>new ln({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class sn extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.bigint,received:i.parsedType}),we}let r;const o=new ft;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:Q.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Fe.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,de.toString(r))}gt(e,r){return this.setLimit("min",e,!1,de.toString(r))}lte(e,r){return this.setLimit("max",e,!0,de.toString(r))}lt(e,r){return this.setLimit("max",e,!1,de.toString(r))}setLimit(e,r,o,i){return new sn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:de.toString(i)}]})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}sn.create=t=>{var e;return new sn({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class da extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.boolean,received:r.parsedType}),we}return xt(e.data)}}da.create=t=>new da({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Pn extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_type,expected:ae.date,received:i.parsedType}),we}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ne(i,{code:Q.invalid_date}),we}const r=new ft;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),ne(o,{code:Q.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Fe.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Pn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:de.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Pn.create=t=>new Pn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Te(t)});class bi extends Ae{_parse(e){if(this._getType(e)!==ae.symbol){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.symbol,received:r.parsedType}),we}return xt(e.data)}}bi.create=t=>new bi({typeName:ve.ZodSymbol,...Te(t)});class ua extends Ae{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.undefined,received:r.parsedType}),we}return xt(e.data)}}ua.create=t=>new ua({typeName:ve.ZodUndefined,...Te(t)});class pa extends Ae{_parse(e){if(this._getType(e)!==ae.null){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.null,received:r.parsedType}),we}return xt(e.data)}}pa.create=t=>new pa({typeName:ve.ZodNull,...Te(t)});class ao extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}ao.create=t=>new ao({typeName:ve.ZodAny,...Te(t)});class Dn extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}}Dn.create=t=>new Dn({typeName:ve.ZodUnknown,...Te(t)});class Ir extends Ae{_parse(e){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.never,received:r.parsedType}),we}}Ir.create=t=>new Ir({typeName:ve.ZodNever,...Te(t)});class wi extends Ae{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.void,received:r.parsedType}),we}return xt(e.data)}}wi.create=t=>new wi({typeName:ve.ZodVoid,...Te(t)});class ir extends Ae{_parse(e){const{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ne(r,{code:Q.invalid_type,expected:ae.array,received:r.parsedType}),we;if(i.exactLength!==null){const d=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(d||u)&&(ne(r,{code:d?Q.too_big:Q.too_small,minimum:u?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ne(r,{code:Q.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ne(r,{code:Q.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((d,u)=>i.type._parseAsync(new Sr(r,d,r.path,u)))).then(d=>ft.mergeArray(o,d));const s=[...r.data].map((d,u)=>i.type._parseSync(new Sr(r,d,r.path,u)));return ft.mergeArray(o,s)}get element(){return this._def.type}min(e,r){return new ir({...this._def,minLength:{value:e,message:de.toString(r)}})}max(e,r){return new ir({...this._def,maxLength:{value:e,message:de.toString(r)}})}length(e,r){return new ir({...this._def,exactLength:{value:e,message:de.toString(r)}})}nonempty(e){return this.min(1,e)}}ir.create=(t,e)=>new ir({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Te(e)});function io(t){if(t instanceof Ye){const e={};for(const r in t.shape){const o=t.shape[r];e[r]=Er.create(io(o))}return new Ye({...t._def,shape:()=>e})}else return t instanceof ir?new ir({...t._def,type:io(t.element)}):t instanceof Er?Er.create(io(t.unwrap())):t instanceof un?un.create(io(t.unwrap())):t instanceof Tr?Tr.create(t.items.map(e=>io(e))):t}class Ye extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Fe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){const p=this._getOrReturnCtx(e);return ne(p,{code:Q.invalid_type,expected:ae.object,received:p.parsedType}),we}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),d=[];if(!(this._def.catchall instanceof Ir&&this._def.unknownKeys==="strip"))for(const p in o.data)s.includes(p)||d.push(p);const u=[];for(const p of s){const h=i[p],f=o.data[p];u.push({key:{status:"valid",value:p},value:h._parse(new Sr(o,f,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Ir){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of d)u.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(p==="strict")d.length>0&&(ne(o,{code:Q.unrecognized_keys,keys:d}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of d){const f=o.data[h];u.push({key:{status:"valid",value:h},value:p._parse(new Sr(o,f,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of u){const f=await h.key,y=await h.value;p.push({key:f,value:y,alwaysSet:h.alwaysSet})}return p}).then(p=>ft.mergeObjectSync(r,p)):ft.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{var i,s,d,u;const p=(d=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,o).message)!==null&&d!==void 0?d:o.defaultError;return r.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ye({...this._def,unknownKeys:"strip"})}passthrough(){return new Ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ye({...this._def,catchall:e})}pick(e){const r={};return Fe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new Ye({...this._def,shape:()=>r})}omit(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new Ye({...this._def,shape:()=>r})}deepPartial(){return io(this)}partial(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new Ye({...this._def,shape:()=>r})}required(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Er;)i=i._def.innerType;r[o]=i}}),new Ye({...this._def,shape:()=>r})}keyof(){return tp(Fe.objectKeys(this.shape))}}Ye.create=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strip",catchall:Ir.create(),typeName:ve.ZodObject,...Te(e)}),Ye.strictCreate=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strict",catchall:Ir.create(),typeName:ve.ZodObject,...Te(e)}),Ye.lazycreate=(t,e)=>new Ye({shape:t,unknownKeys:"strip",catchall:Ir.create(),typeName:ve.ZodObject,...Te(e)});class ga extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=this._def.options;function i(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;const d=s.map(u=>new Lt(u.ctx.common.issues));return ne(r,{code:Q.invalid_union,unionErrors:d}),we}if(r.common.async)return Promise.all(o.map(async s=>{const d={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(i);{let s;const d=[];for(const p of o){const h={...r,common:{...r.common,issues:[]},parent:null},f=p._parseSync({data:r.data,path:r.path,parent:h});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:h}),h.common.issues.length&&d.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const u=d.map(p=>new Lt(p));return ne(r,{code:Q.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}ga.create=(t,e)=>new ga({options:t,typeName:ve.ZodUnion,...Te(e)});const cn=t=>t instanceof ma?cn(t.schema):t instanceof lr?cn(t.innerType()):t instanceof va?[t.value]:t instanceof dn?t.options:t instanceof ya?Fe.objectValues(t.enum):t instanceof ba?cn(t._def.innerType):t instanceof ua?[void 0]:t instanceof pa?[null]:t instanceof Er?[void 0,...cn(t.unwrap())]:t instanceof un?[null,...cn(t.unwrap())]:t instanceof Es||t instanceof Ca?cn(t.unwrap()):t instanceof wa?cn(t._def.innerType):[];class xi extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ne(r,{code:Q.invalid_type,expected:ae.object,received:r.parsedType}),we;const o=this.discriminator,i=r.data[o],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ne(r,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){const i=new Map;for(const s of r){const d=cn(s.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,s)}}return new xi({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Te(o)})}}function Ts(t,e){const r=an(t),o=an(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&o===ae.object){const i=Fe.objectKeys(e),s=Fe.objectKeys(t).filter(u=>i.indexOf(u)!==-1),d={...t,...e};for(const u of s){const p=Ts(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(r===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const d=t[s],u=e[s],p=Ts(d,u);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ha extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=(s,d)=>{if(_s(s)||_s(d))return we;const u=Ts(s.value,d.value);return u.valid?((ks(s)||ks(d))&&r.dirty(),{status:r.value,value:u.data}):(ne(o,{code:Q.invalid_intersection_types}),we)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([s,d])=>i(s,d)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ha.create=(t,e,r)=>new ha({left:t,right:e,typeName:ve.ZodIntersection,...Te(r)});class Tr extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ne(o,{code:Q.invalid_type,expected:ae.array,received:o.parsedType}),we;if(o.data.length<this._def.items.length)return ne(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&o.data.length>this._def.items.length&&(ne(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...o.data].map((s,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new Sr(o,s,o.path,d)):null}).filter(s=>!!s);return o.common.async?Promise.all(i).then(s=>ft.mergeArray(r,s)):ft.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Tr({...this._def,rest:e})}}Tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tr({items:t,typeName:ve.ZodTuple,rest:null,...Te(e)})};class fa extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ne(o,{code:Q.invalid_type,expected:ae.object,received:o.parsedType}),we;const i=[],s=this._def.keyType,d=this._def.valueType;for(const u in o.data)i.push({key:s._parse(new Sr(o,u,o.path,u)),value:d._parse(new Sr(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?ft.mergeObjectAsync(r,i):ft.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ae?new fa({keyType:e,valueType:r,typeName:ve.ZodRecord,...Te(o)}):new fa({keyType:ar.create(),valueType:e,typeName:ve.ZodRecord,...Te(r)})}}class Ci extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ne(o,{code:Q.invalid_type,expected:ae.map,received:o.parsedType}),we;const i=this._def.keyType,s=this._def.valueType,d=[...o.data.entries()].map(([u,p],h)=>({key:i._parse(new Sr(o,u,o.path,[h,"key"])),value:s._parse(new Sr(o,p,o.path,[h,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){const h=await p.key,f=await p.value;if(h.status==="aborted"||f.status==="aborted")return we;(h.status==="dirty"||f.status==="dirty")&&r.dirty(),u.set(h.value,f.value)}return{status:r.value,value:u}})}else{const u=new Map;for(const p of d){const h=p.key,f=p.value;if(h.status==="aborted"||f.status==="aborted")return we;(h.status==="dirty"||f.status==="dirty")&&r.dirty(),u.set(h.value,f.value)}return{status:r.value,value:u}}}}Ci.create=(t,e,r)=>new Ci({valueType:e,keyType:t,typeName:ve.ZodMap,...Te(r)});class Vn extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ne(o,{code:Q.invalid_type,expected:ae.set,received:o.parsedType}),we;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ne(o,{code:Q.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ne(o,{code:Q.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function d(p){const h=new Set;for(const f of p){if(f.status==="aborted")return we;f.status==="dirty"&&r.dirty(),h.add(f.value)}return{status:r.value,value:h}}const u=[...o.data.values()].map((p,h)=>s._parse(new Sr(o,p,o.path,h)));return o.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,r){return new Vn({...this._def,minSize:{value:e,message:de.toString(r)}})}max(e,r){return new Vn({...this._def,maxSize:{value:e,message:de.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Vn.create=(t,e)=>new Vn({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Te(e)});class lo extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ne(r,{code:Q.invalid_type,expected:ae.function,received:r.parsedType}),we;function o(u,p){return mi({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fi(),oo].filter(h=>!!h),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function i(u,p){return mi({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fi(),oo].filter(h=>!!h),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const s={errorMap:r.common.contextualErrorMap},d=r.data;if(this._def.returns instanceof so){const u=this;return xt(async function(...p){const h=new Lt([]),f=await u._def.args.parseAsync(p,s).catch(S=>{throw h.addIssue(o(p,S)),h}),y=await Reflect.apply(d,this,f);return await u._def.returns._def.type.parseAsync(y,s).catch(S=>{throw h.addIssue(i(y,S)),h})})}else{const u=this;return xt(function(...p){const h=u._def.args.safeParse(p,s);if(!h.success)throw new Lt([o(p,h.error)]);const f=Reflect.apply(d,this,h.data),y=u._def.returns.safeParse(f,s);if(!y.success)throw new Lt([i(f,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new lo({...this._def,args:Tr.create(e).rest(Dn.create())})}returns(e){return new lo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new lo({args:e||Tr.create([]).rest(Dn.create()),returns:r||Dn.create(),typeName:ve.ZodFunction,...Te(o)})}}class ma extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ma.create=(t,e)=>new ma({getter:t,typeName:ve.ZodLazy,...Te(e)});class va extends Ae{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return ne(r,{received:r.data,code:Q.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}}va.create=(t,e)=>new va({value:t,typeName:ve.ZodLiteral,...Te(e)});function tp(t,e){return new dn({values:t,typeName:ve.ZodEnum,...Te(e)})}class dn extends Ae{constructor(){super(...arguments),sa.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),o=this._def.values;return ne(r,{expected:Fe.joinValues(o),received:r.parsedType,code:Q.invalid_type}),we}if(yi(this,sa)||Yu(this,sa,new Set(this._def.values)),!yi(this,sa).has(e.data)){const r=this._getOrReturnCtx(e),o=this._def.values;return ne(r,{received:r.data,code:Q.invalid_enum_value,options:o}),we}return xt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return dn.create(e,{...this._def,...r})}exclude(e,r=this._def){return dn.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}}sa=new WeakMap,dn.create=tp;class ya extends Ae{constructor(){super(...arguments),ca.set(this,void 0)}_parse(e){const r=Fe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const i=Fe.objectValues(r);return ne(o,{expected:Fe.joinValues(i),received:o.parsedType,code:Q.invalid_type}),we}if(yi(this,ca)||Yu(this,ca,new Set(Fe.getValidEnumValues(this._def.values))),!yi(this,ca).has(e.data)){const i=Fe.objectValues(r);return ne(o,{received:o.data,code:Q.invalid_enum_value,options:i}),we}return xt(e.data)}get enum(){return this._def.values}}ca=new WeakMap,ya.create=(t,e)=>new ya({values:t,typeName:ve.ZodNativeEnum,...Te(e)});class so extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ne(r,{code:Q.invalid_type,expected:ae.promise,received:r.parsedType}),we;const o=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return xt(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}so.create=(t,e)=>new so({type:t,typeName:ve.ZodPromise,...Te(e)});class lr extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:d=>{ne(o,d),d.fatal?r.abort():r.dirty()},get path(){return o.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const d=i.transform(o.data,s);if(o.common.async)return Promise.resolve(d).then(async u=>{if(r.value==="aborted")return we;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?we:p.status==="dirty"||r.value==="dirty"?vi(p.value):p});{if(r.value==="aborted")return we;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?we:u.status==="dirty"||r.value==="dirty"?vi(u.value):u}}if(i.type==="refinement"){const d=u=>{const p=i.refinement(u,s);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?we:(u.status==="dirty"&&r.dirty(),d(u.value),{status:r.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&r.dirty(),d(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!ia(d))return d;const u=i.transform(d.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>ia(d)?Promise.resolve(i.transform(d.value,s)).then(u=>({status:r.value,value:u})):d);Fe.assertNever(i)}}lr.create=(t,e,r)=>new lr({schema:t,typeName:ve.ZodEffects,effect:e,...Te(r)}),lr.createWithPreprocess=(t,e,r)=>new lr({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Te(r)});class Er extends Ae{_parse(e){return this._getType(e)===ae.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(t,e)=>new Er({innerType:t,typeName:ve.ZodOptional,...Te(e)});class un extends Ae{_parse(e){return this._getType(e)===ae.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}un.create=(t,e)=>new un({innerType:t,typeName:ve.ZodNullable,...Te(e)});class ba extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);let o=r.data;return r.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ba.create=(t,e)=>new ba({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class wa extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return la(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}wa.create=(t,e)=>new wa({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class _i extends Ae{_parse(e){if(this._getType(e)!==ae.nan){const r=this._getOrReturnCtx(e);return ne(r,{code:Q.invalid_type,expected:ae.nan,received:r.parsedType}),we}return{status:"valid",value:e.data}}}_i.create=t=>new _i({typeName:ve.ZodNaN,...Te(t)});const X_=Symbol("zod_brand");class Es extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}}class xa extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?we:i.status==="dirty"?(r.dirty(),vi(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?we:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new xa({in:e,out:r,typeName:ve.ZodPipeline})}}class Ca extends Ae{_parse(e){const r=this._def.innerType._parse(e),o=i=>(ia(i)&&(i.value=Object.freeze(i.value)),i);return la(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}}Ca.create=(t,e)=>new Ca({innerType:t,typeName:ve.ZodReadonly,...Te(e)});function rp(t,e={},r){return t?ao.create().superRefine((o,i)=>{var s,d;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(d=(s=u.fatal)!==null&&s!==void 0?s:r)!==null&&d!==void 0?d:!0,h=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...h,fatal:p})}}):ao.create()}const e1={object:Ye.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const t1=(t,e={message:`Input not instance of ${t.name}`})=>rp(r=>r instanceof t,e),np=ar.create,op=ln.create,r1=_i.create,n1=sn.create,ap=da.create,o1=Pn.create,a1=bi.create,i1=ua.create,l1=pa.create,s1=ao.create,c1=Dn.create,d1=Ir.create,u1=wi.create,p1=ir.create,g1=Ye.create,h1=Ye.strictCreate,f1=ga.create,m1=xi.create,v1=ha.create,y1=Tr.create,b1=fa.create,w1=Ci.create,x1=Vn.create,C1=lo.create,_1=ma.create,k1=va.create,S1=dn.create,T1=ya.create,E1=so.create,ip=lr.create,N1=Er.create,A1=un.create,M1=lr.createWithPreprocess,B1=xa.create;var ki=Object.freeze({__proto__:null,defaultErrorMap:oo,setErrorMap:I_,getErrorMap:fi,makeIssue:mi,EMPTY_PATH:F_,addIssueToContext:ne,ParseStatus:ft,INVALID:we,DIRTY:vi,OK:xt,isAborted:_s,isDirty:ks,isValid:ia,isAsync:la,get util(){return Fe},get objectUtil(){return Cs},ZodParsedType:ae,getParsedType:an,ZodType:Ae,datetimeRegex:ep,ZodString:ar,ZodNumber:ln,ZodBigInt:sn,ZodBoolean:da,ZodDate:Pn,ZodSymbol:bi,ZodUndefined:ua,ZodNull:pa,ZodAny:ao,ZodUnknown:Dn,ZodNever:Ir,ZodVoid:wi,ZodArray:ir,ZodObject:Ye,ZodUnion:ga,ZodDiscriminatedUnion:xi,ZodIntersection:ha,ZodTuple:Tr,ZodRecord:fa,ZodMap:Ci,ZodSet:Vn,ZodFunction:lo,ZodLazy:ma,ZodLiteral:va,ZodEnum:dn,ZodNativeEnum:ya,ZodPromise:so,ZodEffects:lr,ZodTransformer:lr,ZodOptional:Er,ZodNullable:un,ZodDefault:ba,ZodCatch:wa,ZodNaN:_i,BRAND:X_,ZodBranded:Es,ZodPipeline:xa,ZodReadonly:Ca,custom:rp,Schema:Ae,ZodSchema:Ae,late:e1,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>ar.create({...t,coerce:!0}),number:t=>ln.create({...t,coerce:!0}),boolean:t=>da.create({...t,coerce:!0}),bigint:t=>sn.create({...t,coerce:!0}),date:t=>Pn.create({...t,coerce:!0})},any:s1,array:p1,bigint:n1,boolean:ap,date:o1,discriminatedUnion:m1,effect:ip,enum:S1,function:C1,instanceof:t1,intersection:v1,lazy:_1,literal:k1,map:w1,nan:r1,nativeEnum:T1,never:d1,null:l1,nullable:A1,number:op,object:g1,oboolean:()=>ap().optional(),onumber:()=>op().optional(),optional:N1,ostring:()=>np().optional(),pipeline:B1,preprocess:M1,promise:E1,record:b1,set:x1,strictObject:h1,string:np,symbol:a1,transformer:ip,tuple:y1,undefined:i1,union:f1,unknown:c1,void:u1,NEVER:we,ZodIssueCode:Q,quotelessJson:L_,ZodError:Lt});function P1(t){throw new Error("Unexpected object: "+t)}const lp="upload://upload/",sp="index://index/";function D1(t){return t.startsWith(lp)}function V1(t){return t.startsWith(sp)}function L1(t){if(V1(t)){const e=t.slice(sp.length);return JSON.parse(decodeURIComponent(e)).path}else if(D1(t)){const e=t.slice(lp.length);return JSON.parse(decodeURIComponent(e)).localPath}P1(t)}ki.object({__isRef:ki.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ki.string().describe("Upstream block id"),name:ki.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function I1(t){return t.replace(/^.*[\\/]/,"")}const F1={key:0,ref:"label"},R1={key:0,class:"required-icon"},O1=["data-placeholder"],z1={key:5,class:"pl-file-input__stats"},G1={key:0,class:"pl-file-input__error"},j1={key:1,class:"upl-file-input__helper"},cp=n.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const r=n.reactive({fileDialogOpen:!1}),o=n.useSlots(),i=e,s=t,d=n.computed(()=>{if(s.modelValue)try{const w=L1(s.modelValue).trim();return s.showFilenameOnly?I1(w):w}catch(w){return console.error(w),s.modelValue}return""}),u=n.computed(()=>s.progress&&!s.progress.done),p=n.computed(()=>s.progress&&s.progress.done),h=n.computed(()=>s.error),f=n.computed(()=>s.error),y=n.computed(()=>{const{status:w,done:L}=s.progress??{};return!w||!w.bytesTotal?"":w.bytesProcessed&&!L?es(w.bytesProcessed,{})+" / "+es(w.bytesTotal,{}):es(w.bytesTotal,{})}),S=n.computed(()=>{var w;const{progress:L}=s;return L?{width:L.done?"100%":Math.round((((w=L.status)==null?void 0:w.progress)??0)*100)+"%"}:{}}),k=()=>{r.fileDialogOpen=!0},D=w=>{w.files.length&&i("update:modelValue",w.files[0])},E=()=>i("update:modelValue",void 0),A=n.ref();return s.cellStyle||Vr(A),(w,L)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{class:n.normalizeClass([{"pl-file-input__cell-style":!!w.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[n.createElementVNode("div",{ref_key:"rootRef",ref:A,class:n.normalizeClass(["pl-file-input",{dashed:w.dashed,error:h.value}]),tabindex:"0",onKeyup:n.withKeys(k,["enter"])},[n.createElementVNode("div",{class:"pl-file-input__progress",style:n.normalizeStyle(S.value)},null,4),L[3]||(L[3]=n.createTextVNode()),!w.cellStyle&&w.label?(n.openBlock(),n.createElementBlock("label",F1,[w.required?(n.openBlock(),n.createElementBlock("i",R1)):n.createCommentVNode("",!0),L[1]||(L[1]=n.createTextVNode()),n.createElementVNode("span",null,n.toDisplayString(w.label),1),L[2]||(L[2]=n.createTextVNode()),n.unref(o).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(w.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)],512)):n.createCommentVNode("",!0),L[4]||(L[4]=n.createTextVNode()),h.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:1,name:"restart"})):u.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:2,name:"cloud-upload"})):p.value?(n.openBlock(),n.createBlock(n.unref(Lr),{key:3,name:"success"})):(n.openBlock(),n.createBlock(n.unref(Lr),{key:4,name:"paper-clip"})),L[5]||(L[5]=n.createTextVNode()),n.createElementVNode("div",{"data-placeholder":w.placeholder??"Choose file",class:"pl-file-input__filename",onClick:n.withModifiers(k,["stop"])},n.toDisplayString(d.value),9,O1),L[6]||(L[6]=n.createTextVNode()),y.value?(n.openBlock(),n.createElementBlock("div",z1,n.toDisplayString(y.value),1)):n.createCommentVNode("",!0),L[7]||(L[7]=n.createTextVNode()),w.modelValue?(n.openBlock(),n.createBlock(n.unref(Lr),{key:6,name:"close",onClick:n.withModifiers(E,["stop"])})):n.createCommentVNode("",!0),L[8]||(L[8]=n.createTextVNode()),n.createVNode(on,{class:"pl-file-input__contour"})],34),L[9]||(L[9]=n.createTextVNode()),h.value?(n.openBlock(),n.createElementBlock("div",G1,n.toDisplayString(f.value),1)):w.helper?(n.openBlock(),n.createElementBlock("div",j1,n.toDisplayString(w.helper),1)):n.createCommentVNode("",!0)],2),L[10]||(L[10]=n.createTextVNode()),n.createVNode(n.unref(qu),{modelValue:r.fileDialogOpen,"onUpdate:modelValue":L[0]||(L[0]=R=>r.fileDialogOpen=R),extensions:w.extensions,title:w.fileDialogTitle,"onImport:files":D},null,8,["modelValue","extensions","title"])],64))}}),U1={class:"pl-notification-alert__wrapper d-flex"},Z1={class:"pl-notification-alert__content flex-grow-1"},$1={key:0,class:"pl-notification-alert__close"},W1={key:0,class:"pl-notification-alert__actions d-flex"},dp=n.defineComponent({__name:"PlNotificationAlert",props:n.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,r=n.useModel(t,"modelValue");function o(){e.closable&&(r.value=!1)}return(i,s)=>r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([i.type,"pl-notification-alert d-flex flex-column gap-16"]),style:n.normalizeStyle({width:`${i.width}`})},[n.createElementVNode("div",U1,[n.createElementVNode("div",Z1,[n.renderSlot(i.$slots,"default")]),s[0]||(s[0]=n.createTextVNode()),i.closable?(n.openBlock(),n.createElementBlock("div",$1,[n.createVNode(n.unref(us),{icon:"close",onClick:o})])):n.createCommentVNode("",!0)]),s[1]||(s[1]=n.createTextVNode()),i.$slots.actions?(n.openBlock(),n.createElementBlock("div",W1,[n.renderSlot(i.$slots,"actions")])):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)}}),up=n.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const r=e,o=n.ref(!1),i=n.computed(()=>o.value?"mask-clipboard-copied":"mask-clipboard");function s(){o.value=!0,setTimeout(()=>o.value=!1,700),r("copy")}return(d,u)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([i.value,"mask-24"]),onClick:s},null,2))}}),H1=n.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return n.provide(e.contextKey,n.computed(()=>e.context)),(r,o)=>n.renderSlot(r.$slots,"default")}});function mt(t,e,r){return e>t?e:t>r?r:t}const Ns=t=>n.computed(()=>{const e=[100],{min:r,max:o,step:i}=t.value;let s=r;for(;s<o;){s+=i;const d=(1-(mt(s,r,o)-r)/(o-r))*100;e.push(d)}return e}),q1={class:"ui-slider__wrapper"},K1={class:"ui-slider__label-section"},Y1={key:0,class:"text-s"},J1={key:1,class:"ui-slider__value-static text-s"},Q1={class:"ui-slider__base"},X1={class:"ui-slider__container"},ek={class:"ui-slider__container ui-slider__container-thumb"},tk={class:"ui-slider__input-wrapper d-flex"},rk=["value"],nk={key:0,class:"ui-slider__error"},ok=n.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const r=n.useSlots(),o=e,i=t,s=n.reactive({deltaValue:0}),d=n.computed(()=>i.max-i.min),u=n.computed(()=>mt((i.modelValue??0)+s.deltaValue,i.min,i.max)),p=n.ref(i.modelValue),h=n.computed(()=>{const G=i.modelValue;return Number.isFinite(G)?G<i.min?`Min value: ${i.min}`:G>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),f=n.computed(()=>i),y=Ns(f),S=n.computed(()=>(u.value-i.min)/d.value),k=n.computed(()=>({right:Math.ceil((1-S.value)*100)+"%"})),D=n.computed(()=>({right:`calc(${Math.ceil((1-S.value)*100)}%) `})),E=n.ref(),A=n.ref();n.watch(()=>i.modelValue,G=>{p.value=G});function w(G){const K=mt(G,i.min,i.max);return Math.round((K+Number.EPSILON)*(1/i.step))/(1/i.step)}nn(A,G=>{var K;ot((K=n.unref(E))==null?void 0:K.getBoundingClientRect(),U=>{const{dx:P}=G;s.deltaValue=P/U.width*d.value,p.value=w(mt((i.modelValue??0)+s.deltaValue,i.min,i.max)),G.stop&&(o("update:modelValue",w(u.value)),s.deltaValue=0)})});function L(G){o("update:modelValue",w(G))}function R(G){L(+G.target.value)}function H(G){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const K=G.code==="ArrowUp"||G.code==="ArrowRight"?i.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?i.step*-1:0;L(i.modelValue+K)}return(G,K)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[n.createElementVNode("div",{class:n.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[n.createElementVNode("div",q1,[n.createElementVNode("div",K1,[G.label?(n.openBlock(),n.createElementBlock("label",Y1,[n.createElementVNode("span",null,n.toDisplayString(G.label),1),K[1]||(K[1]=n.createTextVNode()),n.unref(r).tooltip?(n.openBlock(),n.createBlock(n.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:n.withCtx(()=>[n.renderSlot(G.$slots,"tooltip")]),_:3})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),K[2]||(K[2]=n.createTextVNode()),i.mode==="text"?(n.openBlock(),n.createElementBlock("div",J1,n.toDisplayString(p.value)+n.toDisplayString(G.measure),1)):n.createCommentVNode("",!0)]),K[6]||(K[6]=n.createTextVNode()),n.createElementVNode("div",Q1,[n.createElementVNode("div",X1,[n.createElementVNode("div",{ref_key:"barRef",ref:E,class:"ui-slider__bar"},[n.createElementVNode("div",{class:"ui-slider__progress",style:n.normalizeStyle(k.value)},null,4)],512)]),K[5]||(K[5]=n.createTextVNode()),n.createElementVNode("div",ek,[i.breakpoints?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(y),(U,P)=>(n.openBlock(),n.createElementBlock("div",{key:P,style:n.normalizeStyle({right:`${U}%`}),class:"ui-slider__thumb-step"},null,4))),128)):n.createCommentVNode("",!0),K[4]||(K[4]=n.createTextVNode()),n.createElementVNode("div",{ref_key:"thumbRef",ref:A,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:n.normalizeStyle(D.value),onKeydown:H},K[3]||(K[3]=[n.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),K[7]||(K[7]=n.createTextVNode()),n.createElementVNode("div",tk,[i.mode==="input"?(n.openBlock(),n.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:K[0]||(K[0]=U=>R(U))},null,40,rk)):n.createCommentVNode("",!0)])],2),K[8]||(K[8]=n.createTextVNode()),h.value?(n.openBlock(),n.createElementBlock("div",nk,n.toDisplayString(h.value),1)):n.createCommentVNode("",!0)],2))}});function ak(t,e=null,r=null){function o(u){const{scrollTop:p,scrollHeight:h,clientHeight:f}=u;if(!(h>f)||!e)return null;const y=h-p-f,S=p>e?e:0,k=y>e?f-e-S:f;return`linear-gradient(
|
|
66
66
|
to bottom,
|
|
67
67
|
transparent,
|
|
68
68
|
black ${S}px,
|
|
@@ -100,4 +100,4 @@ __p += '`),Ve&&(q+=`' +
|
|
|
100
100
|
function print() { __p += __j.call(arguments, '') }
|
|
101
101
|
`:`;
|
|
102
102
|
`)+q+`return __p
|
|
103
|
-
}`;var Me=rf(function(){return Oe(b,se+"return "+q).apply(r,_)});if(Me.source=q,$c(Me))throw Me;return Me}function VV(a){return Ge(a).toLowerCase()}function LV(a){return Ge(a).toUpperCase()}function IV(a,l,c){if(a=Ge(a),a&&(c||l===r))return ug(a);if(!a||!(l=Ut(l)))return a;var g=yr(a),m=yr(l),b=pg(g,m),_=gg(g,m)+1;return Cn(g,b,_).join("")}function FV(a,l,c){if(a=Ge(a),a&&(c||l===r))return a.slice(0,fg(a)+1);if(!a||!(l=Ut(l)))return a;var g=yr(a),m=gg(g,yr(l))+1;return Cn(g,0,m).join("")}function RV(a,l,c){if(a=Ge(a),a&&(c||l===r))return a.replace($s,"");if(!a||!(l=Ut(l)))return a;var g=yr(a),m=pg(g,yr(l));return Cn(g,m).join("")}function OV(a,l){var c=F,g=Y;if(Je(l)){var m="separator"in l?l.separator:m;c="length"in l?Ee(l.length):c,g="omission"in l?Ut(l.omission):g}a=Ge(a);var b=a.length;if(bo(a)){var _=yr(a);b=_.length}if(c>=b)return a;var T=c-wo(g);if(T<1)return g;var M=_?Cn(_,0,T).join(""):a.slice(0,T);if(m===r)return M+g;if(_&&(T+=M.length-T),Wc(m)){if(a.slice(T).search(m)){var Z,$=M;for(m.global||(m=sc(m.source,Ge(Dp.exec(m))+"g")),m.lastIndex=0;Z=m.exec($);)var q=Z.index;M=M.slice(0,q===r?T:q)}}else if(a.indexOf(Ut(m),T)!=T){var te=M.lastIndexOf(m);te>-1&&(M=M.slice(0,te))}return M+g}function zV(a){return a=Ge(a),a&&JE.test(a)?a.replace(Mp,fA):a}var GV=Eo(function(a,l,c){return a+(c?" ":"")+l.toUpperCase()}),Kc=nh("toUpperCase");function tf(a,l,c){return a=Ge(a),l=c?r:l,l===r?dA(a)?yA(a):tA(a):a.match(l)||[]}var rf=Be(function(a,l){try{return Gt(a,r,l)}catch(c){return $c(c)?c:new Ce(c)}}),jV=Ur(function(a,l){return Kt(l,function(c){c=Mr(c),Gr(a,c,Uc(a[c],a))}),a});function UV(a){var l=a==null?0:a.length,c=pe();return a=l?qe(a,function(g){if(typeof g[1]!="function")throw new Yt(d);return[c(g[0]),g[1]]}):[],Be(function(g){for(var m=-1;++m<l;){var b=a[m];if(Gt(b[0],this,g))return Gt(b[1],this,g)}})}function ZV(a){return fM(Qt(a,y))}function Yc(a){return function(){return a}}function $V(a,l){return a==null||a!==a?l:a}var WV=ah(),HV=ah(!0);function Pt(a){return a}function Jc(a){return Lg(typeof a=="function"?a:Qt(a,y))}function qV(a){return Fg(Qt(a,y))}function KV(a,l){return Rg(a,Qt(l,y))}var YV=Be(function(a,l){return function(c){return Ua(c,a,l)}}),JV=Be(function(a,l){return function(c){return Ua(a,c,l)}});function Qc(a,l,c){var g=ut(l),m=tl(l,g);c==null&&!(Je(l)&&(m.length||!g.length))&&(c=l,l=a,a=this,m=tl(l,ut(l)));var b=!(Je(c)&&"chain"in c)||!!c.chain,_=$r(a);return Kt(m,function(T){var M=l[T];a[T]=M,_&&(a.prototype[T]=function(){var Z=this.__chain__;if(b||Z){var $=a(this.__wrapped__),q=$.__actions__=At(this.__actions__);return q.push({func:M,args:arguments,thisArg:a}),$.__chain__=Z,$}return M.apply(a,mn([this.value()],arguments))})}),a}function QV(){return pt._===this&&(pt._=kA),this}function Xc(){}function XV(a){return a=Ee(a),Be(function(l){return Og(l,a)})}var e2=Mc(qe),t2=Mc(ig),r2=Mc(tc);function nf(a){return Fc(a)?rc(Mr(a)):PM(a)}function n2(a){return function(l){return a==null?r:$n(a,l)}}var o2=lh(),a2=lh(!0);function ed(){return[]}function td(){return!1}function i2(){return{}}function l2(){return""}function s2(){return!0}function c2(a,l){if(a=Ee(a),a<1||a>_e)return[];var c=Nt,g=yt(a,Nt);l=pe(l),a-=Nt;for(var m=ac(g,l);++c<a;)l(c);return m}function d2(a){return ke(a)?qe(a,Mr):Zt(a)?[a]:At(_h(Ge(a)))}function u2(a){var l=++CA;return Ge(a)+l}var p2=ll(function(a,l){return a+l},0),g2=Bc("ceil"),h2=ll(function(a,l){return a/l},1),f2=Bc("floor");function m2(a){return a&&a.length?el(a,Pt,mc):r}function v2(a,l){return a&&a.length?el(a,pe(l,2),mc):r}function y2(a){return cg(a,Pt)}function b2(a,l){return cg(a,pe(l,2))}function w2(a){return a&&a.length?el(a,Pt,wc):r}function x2(a,l){return a&&a.length?el(a,pe(l,2),wc):r}var C2=ll(function(a,l){return a*l},1),_2=Bc("round"),k2=ll(function(a,l){return a-l},0);function S2(a){return a&&a.length?oc(a,Pt):0}function T2(a,l){return a&&a.length?oc(a,pe(l,2)):0}return v.after=qP,v.ary=Vh,v.assign=LD,v.assignIn=qh,v.assignInWith=wl,v.assignWith=ID,v.at=FD,v.before=Lh,v.bind=Uc,v.bindAll=jV,v.bindKey=Ih,v.castArray=iD,v.chain=Bh,v.chunk=fB,v.compact=mB,v.concat=vB,v.cond=UV,v.conforms=ZV,v.constant=Yc,v.countBy=SP,v.create=RD,v.curry=Fh,v.curryRight=Rh,v.debounce=Oh,v.defaults=OD,v.defaultsDeep=zD,v.defer=KP,v.delay=YP,v.difference=yB,v.differenceBy=bB,v.differenceWith=wB,v.drop=xB,v.dropRight=CB,v.dropRightWhile=_B,v.dropWhile=kB,v.fill=SB,v.filter=EP,v.flatMap=MP,v.flatMapDeep=BP,v.flatMapDepth=PP,v.flatten=Eh,v.flattenDeep=TB,v.flattenDepth=EB,v.flip=JP,v.flow=WV,v.flowRight=HV,v.fromPairs=NB,v.functions=HD,v.functionsIn=qD,v.groupBy=DP,v.initial=MB,v.intersection=BB,v.intersectionBy=PB,v.intersectionWith=DB,v.invert=YD,v.invertBy=JD,v.invokeMap=LP,v.iteratee=Jc,v.keyBy=IP,v.keys=ut,v.keysIn=Bt,v.map=hl,v.mapKeys=XD,v.mapValues=eV,v.matches=qV,v.matchesProperty=KV,v.memoize=ml,v.merge=tV,v.mergeWith=Kh,v.method=YV,v.methodOf=JV,v.mixin=Qc,v.negate=vl,v.nthArg=XV,v.omit=rV,v.omitBy=nV,v.once=QP,v.orderBy=FP,v.over=e2,v.overArgs=XP,v.overEvery=t2,v.overSome=r2,v.partial=Zc,v.partialRight=zh,v.partition=RP,v.pick=oV,v.pickBy=Yh,v.property=nf,v.propertyOf=n2,v.pull=FB,v.pullAll=Ah,v.pullAllBy=RB,v.pullAllWith=OB,v.pullAt=zB,v.range=o2,v.rangeRight=a2,v.rearg=eD,v.reject=GP,v.remove=GB,v.rest=tD,v.reverse=Gc,v.sampleSize=UP,v.set=iV,v.setWith=lV,v.shuffle=ZP,v.slice=jB,v.sortBy=HP,v.sortedUniq=KB,v.sortedUniqBy=YB,v.split=MV,v.spread=rD,v.tail=JB,v.take=QB,v.takeRight=XB,v.takeRightWhile=eP,v.takeWhile=tP,v.tap=mP,v.throttle=nD,v.thru=gl,v.toArray=$h,v.toPairs=Jh,v.toPairsIn=Qh,v.toPath=d2,v.toPlainObject=Hh,v.transform=sV,v.unary=oD,v.union=rP,v.unionBy=nP,v.unionWith=oP,v.uniq=aP,v.uniqBy=iP,v.uniqWith=lP,v.unset=cV,v.unzip=jc,v.unzipWith=Mh,v.update=dV,v.updateWith=uV,v.values=Mo,v.valuesIn=pV,v.without=sP,v.words=tf,v.wrap=aD,v.xor=cP,v.xorBy=dP,v.xorWith=uP,v.zip=pP,v.zipObject=gP,v.zipObjectDeep=hP,v.zipWith=fP,v.entries=Jh,v.entriesIn=Qh,v.extend=qh,v.extendWith=wl,Qc(v,v),v.add=p2,v.attempt=rf,v.camelCase=mV,v.capitalize=Xh,v.ceil=g2,v.clamp=gV,v.clone=lD,v.cloneDeep=cD,v.cloneDeepWith=dD,v.cloneWith=sD,v.conformsTo=uD,v.deburr=ef,v.defaultTo=$V,v.divide=h2,v.endsWith=vV,v.eq=wr,v.escape=yV,v.escapeRegExp=bV,v.every=TP,v.find=NP,v.findIndex=Sh,v.findKey=GD,v.findLast=AP,v.findLastIndex=Th,v.findLastKey=jD,v.floor=f2,v.forEach=Ph,v.forEachRight=Dh,v.forIn=UD,v.forInRight=ZD,v.forOwn=$D,v.forOwnRight=WD,v.get=Hc,v.gt=pD,v.gte=gD,v.has=KD,v.hasIn=qc,v.head=Nh,v.identity=Pt,v.includes=VP,v.indexOf=AB,v.inRange=hV,v.invoke=QD,v.isArguments=qn,v.isArray=ke,v.isArrayBuffer=hD,v.isArrayLike=Mt,v.isArrayLikeObject=tt,v.isBoolean=fD,v.isBuffer=_n,v.isDate=mD,v.isElement=vD,v.isEmpty=yD,v.isEqual=bD,v.isEqualWith=wD,v.isError=$c,v.isFinite=xD,v.isFunction=$r,v.isInteger=Gh,v.isLength=yl,v.isMap=jh,v.isMatch=CD,v.isMatchWith=_D,v.isNaN=kD,v.isNative=SD,v.isNil=ED,v.isNull=TD,v.isNumber=Uh,v.isObject=Je,v.isObjectLike=Xe,v.isPlainObject=Ka,v.isRegExp=Wc,v.isSafeInteger=ND,v.isSet=Zh,v.isString=bl,v.isSymbol=Zt,v.isTypedArray=Ao,v.isUndefined=AD,v.isWeakMap=MD,v.isWeakSet=BD,v.join=VB,v.kebabCase=wV,v.last=er,v.lastIndexOf=LB,v.lowerCase=xV,v.lowerFirst=CV,v.lt=PD,v.lte=DD,v.max=m2,v.maxBy=v2,v.mean=y2,v.meanBy=b2,v.min=w2,v.minBy=x2,v.stubArray=ed,v.stubFalse=td,v.stubObject=i2,v.stubString=l2,v.stubTrue=s2,v.multiply=C2,v.nth=IB,v.noConflict=QV,v.noop=Xc,v.now=fl,v.pad=_V,v.padEnd=kV,v.padStart=SV,v.parseInt=TV,v.random=fV,v.reduce=OP,v.reduceRight=zP,v.repeat=EV,v.replace=NV,v.result=aV,v.round=_2,v.runInContext=N,v.sample=jP,v.size=$P,v.snakeCase=AV,v.some=WP,v.sortedIndex=UB,v.sortedIndexBy=ZB,v.sortedIndexOf=$B,v.sortedLastIndex=WB,v.sortedLastIndexBy=HB,v.sortedLastIndexOf=qB,v.startCase=BV,v.startsWith=PV,v.subtract=k2,v.sum=S2,v.sumBy=T2,v.template=DV,v.times=c2,v.toFinite=Wr,v.toInteger=Ee,v.toLength=Wh,v.toLower=VV,v.toNumber=tr,v.toSafeInteger=VD,v.toString=Ge,v.toUpper=LV,v.trim=IV,v.trimEnd=FV,v.trimStart=RV,v.truncate=OV,v.unescape=zV,v.uniqueId=u2,v.upperCase=GV,v.upperFirst=Kc,v.each=Ph,v.eachRight=Dh,v.first=Nh,Qc(v,function(){var a={};return Nr(v,function(l,c){je.call(v.prototype,c)||(a[c]=l)}),a}(),{chain:!1}),v.VERSION=o,Kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){v[a].placeholder=v}),Kt(["drop","take"],function(a,l){De.prototype[a]=function(c){c=c===r?1:lt(Ee(c),0);var g=this.__filtered__&&!l?new De(this):this.clone();return g.__filtered__?g.__takeCount__=yt(c,g.__takeCount__):g.__views__.push({size:yt(c,Nt),type:a+(g.__dir__<0?"Right":"")}),g},De.prototype[a+"Right"]=function(c){return this.reverse()[a](c).reverse()}}),Kt(["filter","map","takeWhile"],function(a,l){var c=l+1,g=c==B||c==X;De.prototype[a]=function(m){var b=this.clone();return b.__iteratees__.push({iteratee:pe(m,3),type:c}),b.__filtered__=b.__filtered__||g,b}}),Kt(["head","last"],function(a,l){var c="take"+(l?"Right":"");De.prototype[a]=function(){return this[c](1).value()[0]}}),Kt(["initial","tail"],function(a,l){var c="drop"+(l?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[c](1)}}),De.prototype.compact=function(){return this.filter(Pt)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=Be(function(a,l){return typeof a=="function"?new De(this):this.map(function(c){return Ua(c,a,l)})}),De.prototype.reject=function(a){return this.filter(vl(pe(a)))},De.prototype.slice=function(a,l){a=Ee(a);var c=this;return c.__filtered__&&(a>0||l<0)?new De(c):(a<0?c=c.takeRight(-a):a&&(c=c.drop(a)),l!==r&&(l=Ee(l),c=l<0?c.dropRight(-l):c.take(l-a)),c)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(Nt)},Nr(De.prototype,function(a,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),g=/^(?:head|last)$/.test(l),m=v[g?"take"+(l=="last"?"Right":""):l],b=g||/^find/.test(l);m&&(v.prototype[l]=function(){var _=this.__wrapped__,T=g?[1]:arguments,M=_ instanceof De,Z=T[0],$=M||ke(_),q=function(Pe){var Ve=m.apply(v,mn([Pe],T));return g&&te?Ve[0]:Ve};$&&c&&typeof Z=="function"&&Z.length!=1&&(M=$=!1);var te=this.__chain__,se=!!this.__actions__.length,he=b&&!te,Me=M&&!se;if(!b&&$){_=Me?_:new De(this);var fe=a.apply(_,T);return fe.__actions__.push({func:gl,args:[q],thisArg:r}),new Jt(fe,te)}return he&&Me?a.apply(this,T):(fe=this.thru(q),he?g?fe.value()[0]:fe.value():fe)})}),Kt(["pop","push","shift","sort","splice","unshift"],function(a){var l=Oi[a],c=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",g=/^(?:pop|shift)$/.test(a);v.prototype[a]=function(){var m=arguments;if(g&&!this.__chain__){var b=this.value();return l.apply(ke(b)?b:[],m)}return this[c](function(_){return l.apply(ke(_)?_:[],m)})}}),Nr(De.prototype,function(a,l){var c=v[l];if(c){var g=c.name+"";je.call(ko,g)||(ko[g]=[]),ko[g].push({name:l,func:c})}}),ko[il(r,w).name]=[{name:"wrapper",func:r}],De.prototype.clone=zA,De.prototype.reverse=GA,De.prototype.value=jA,v.prototype.at=vP,v.prototype.chain=yP,v.prototype.commit=bP,v.prototype.next=wP,v.prototype.plant=CP,v.prototype.reverse=_P,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=kP,v.prototype.first=v.prototype.head,Ia&&(v.prototype[Ia]=xP),v},xo=bA();zn?((zn.exports=xo)._=xo,Js._=xo):pt._=xo}).call(Bo)}(Si,Si.exports);var Qe=Si.exports;const dE={class:"grid-overlay-container"},hp=n.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",dE,[e.params.notReady?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[r[0]||(r[0]=n.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),r[1]||(r[1]=n.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[r[2]||(r[2]=n.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),r[3]||(r[3]=n.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),uE={},pE={class:"grid-overlay-container"};function gE(t,e){return n.openBlock(),n.createElementBlock("div",pE,e[0]||(e[0]=[n.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),n.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const fp=As(uE,[["render",gE]]);async function hE(t,e){throw Error("not implemented")}function fE(t){return t.axesSpec.filter(e=>{var r;return((r=e.annotations)==null?void 0:r["pl7.app/axisNature"])==="heterogeneous"})}function mE(t,e){const r=[];for(const o of e)if(t[o].type==="column"){const i=fE(t[o].spec);for(const s of i){if(s.type!=="String"){console.warn("heterogeneous axis with string type expected, got",s,"skipping");continue}const d=Nd(s),u=t.findIndex(p=>Qe.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",o,d,t),Error("axis not found");r.push({columnIdx:o,axisIdx:u})}}return r}const mp=(t,e)=>(t+e).toString();function vE(t,e,r,o,i,s){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const d=t[0];let u=-1,p=-1;for(let y=0;y<s.length;++y)s[y]===d.axisIdx&&(u=y),s[y]===d.columnIdx&&(p=y);const h=(()=>{const S=o[u].data.filter(k=>k!==null);return Array.from(new Set(S))})();h.sort(),p>u?(r.splice(p,1),r.splice(u,1)):(r.splice(u,1),r.splice(p,1));const f=yE(i,o,u,p,h,e.rows);for(let y=0;y<h.length;++y){const S=h[y],k=S+"@"+y;r.push({colId:k,field:mp(o.length,y),headerName:S,valueFormatter:vp})}return{rowModelType:"clientSide",columnDefs:r,rowData:f}}function yE(t,e,r,o,i,s){const d=new Map;let u=0;for(let h=0;h<s;h++){const f={};for(let E=0;E<e.length;++E){if(E===r||E===o)continue;const A=t[E].toString();f[A]=e[E].data[h]}let y;const S=Po(Object.values(f))??"";d.has(S)?y=d.get(S):(d.set(S,f),y=f,y.id=u.toString(),u++);const k=i.indexOf(e[r].data[h]);if(k===-1)throw Error("index not found");const D=mp(e.length,k);y[D]=e[o].data[h]}return Array.from(d.values())}function bE(t){return Po({type:t.type,id:t.id})}function wE(t){return JSON.parse(t)}const vp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function xE(t,e,r){var i,s,d;const o=bE(e);return{colId:o,field:t.toString(),headerName:((s=(i=e.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:s.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(r==null?void 0:r.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:vp,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function yp(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function bp(t){const e=[];return li(t,r=>(e.push(r),r)),e}async function CE(t,e,r){return r.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Qe.uniqWith(r.map(i=>Ol(i.spec.axesSpec).map(Qe.cloneDeep)).flat(),Qe.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function _E(t,e,r){const o=bp(r),s=(await CE(t,e,o)).filter(d=>!Qe.find(o,u=>d.columnId===u.columnId));return s.length===0?r:{type:"outer",primary:r,secondary:s.map(d=>({type:"column",column:d}))}}async function kE(t,e,r,o){const i=r.filter(f=>f.type!=="Bytes"),s=bp(o),d=i.map(f=>[]),u=i.map(f=>null);for(let f=0;f<s.length;++f){const y=Ol(s[f].spec.axesSpec);for(let S=0;S<y.length;++S){const k=Qe.findIndex(i,D=>Qe.isEqual(D,y[S]));k===-1||u[k]||(y.length===1&&s[f].spec.name==="pl7.app/label"?(d[k]=[[f,S]],u[k]=s[f].columnId):d[k].push([f,S]))}}for(let f=i.length-1;f>=0;--f)d[f].length||(u.splice(f,1),d.splice(f,1),i.splice(f,1));const p=100,h=i.map(f=>new Set);e:for(let f=i.length-1;f>=0;--f){for(const[y,S]of d[f]){const k=await t.getUniqueValues(e,{columnId:s[y].columnId,...!u[f]&&{axis:Qe.cloneDeep(i[f])},filters:[],limit:p});if(k.overflow){u.splice(f,1),d.splice(f,1),i.splice(f,1);continue e}const D=k.values.type;for(const E of k.values.data)if(!(Ed(E,D)||E===null)&&(h[f].add(yp(E,D)),h[f].size===p)){u.splice(f,1),d.splice(f,1),i.splice(f,1);continue e}}if(!h[f].size){u.splice(f,1),d.splice(f,1),i.splice(f,1);continue e}}return i.map((f,y)=>{const S=[...h[y]].map(D=>({value:D,text:D.toString()})),k=S[0].value;return{axis:Qe.cloneDeep(f),...u[y]&&{column:u[y]},options:S,defaultValue:k}})}function SE(t,e,r){const o=e.length,i=[];for(let s=0;s<e[0].data.length;++s){const d={};for(let u=0;u<o;++u){const p=t[u].toString(),h=e[u].data[s],f=e[u].type;Am(e[u].absent,s)?d[p]=void 0:Ed(h,f)||h===null?d[p]=null:d[p]=yp(h,f)}d.id=(r++).toString(),i.push(d)}return i}const TE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function EE(t,e,r,o){const i=await t.getSpec(e),s=[...i.keys()].filter(k=>!Qe.find(r,D=>Qe.isEqual(D.axis,i[k].id)||Qe.isEqual(D.column,i[k].id))),d=Qe.cloneDeep(s),u=mE(i,s);for(let k=s.length-1;k>=0;--k){const D=s[k];if(!TE(i[D]))continue;const E=Ol(i[D].spec.axesSpec)[0],A=Qe.findIndex(s,w=>Qe.isEqual(i[w].id,E));if(A!==-1){s[A]=D;for(const w of u)w.axisIdx===D&&(w.axisIdx=A);s.splice(k,1),d.splice(k,1)}}const p=await t.getShape(e),h=p.rows,f=d.map(k=>xE(k,i[k],o));if(u.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",u.length," transposition will not be applied."),u.length===1)return vE(u,p,f,await t.getData(e,s),d,s);let y;return{rowModelType:"serverSide",columnDefs:f,serverSideDatasource:{getRows:async k=>{try{if(h==0){k.success({rowData:[],rowCount:h}),k.api.showNoRowsOverlay(),k.api.setGridOption("loading",!1);return}if(y&&!Qe.isEqual(y.request.sortModel,k.request.sortModel)){y=void 0,k.fail(),k.api.setGridOption("loading",!0);return}y=k;let D=0,E=[];if(h>0&&k.request.startRow!==void 0&&k.request.endRow!==void 0&&(D=Math.min(h,k.request.endRow)-k.request.startRow,D>0)){const A=await t.getData(e,s,{offset:k.request.startRow,length:D});E=SE(d,A,k.request.startRow)}k.success({rowData:E,rowCount:h}),k.api.autoSizeAllColumns(),k.api.setGridOption("loading",!1)}catch{k.fail(),k.api.setGridOption("loading",!0)}}}}}const NE={class:"ap-ag-data-table-container"},AE={key:0,class:"ap-ag-data-table-sheets"},ME=As(n.defineComponent({__name:"PlAgDataTable",props:n.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(t){C.ModuleRegistry.registerModules([Ja.ClientSideRowModelModule,dd.ClipboardModule,cd.ServerSideRowModelModule,ud.RangeSelectionModule,Ul,Yd]);const e=n.useModel(t,"modelValue"),r=t,{settings:o}=n.toRefs(r);n.watch(()=>o.value,async(w,L)=>{if(w.sourceType!=="pframe"||!w.pFrame||!w.join||L&&L.sourceType==="pframe"&&Qe.isEqual(w.pFrame,L.pFrame)&&Qe.isEqual(w.join,L.join))return;const R=window.platforma;if(!R)throw Error("platforma not set");const H=R.pFrameDriver;if(!H)throw Error("platforma.pFrameDriver not set");const G=await _E(H,w.pFrame,w.join),K=e.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=G,e.value=K});const i=wp(()=>o.value.sourceType,async w=>{var R;const L=o.value.sourceType;switch(L){case"pframe":{const H=window.platforma;if(!H)throw Error("platforma not set");const G=H.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");if(!o.value.pFrame)return[];const K=o.value.pFrame,U=(R=e.value.pTableParams)==null?void 0:R.join;return U?await kE(G,K,o.value.sheetAxes,U):[]}case"ptable":return o.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${L}`)}});function s(w){if(!(o.value.sourceType!=="ptable"&&o.value.sourceType!=="pframe"))return(w==null?void 0:w.sortModel.map(L=>({column:wE(L.colId),ascending:L.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const d=n.computed({get:()=>{const w=e.value;return{columnOrder:w.gridState.columnOrder,sort:w.gridState.sort,columnVisibility:w.gridState.columnVisibility}},set:w=>{const L=e.value,R=y.value.rowModelType==="clientSide"?void 0:s(w.sort);L.gridState.columnOrder=w.columnOrder,L.gridState.sort=w.sort,L.gridState.columnVisibility=w.columnVisibility,(o.value.sourceType==="ptable"||o.value.sourceType==="pframe")&&(L.pTableParams||(L.pTableParams={sorting:[],filters:[]}),L.pTableParams.sorting=R),e.value=L}}),u=w=>Po(w);function p(w){var L;if(!(o.value.sourceType!=="ptable"&&o.value.sourceType!=="pframe"))return((L=i.value)==null?void 0:L.map(R=>({type:"bySingleColumn",column:R.column?{type:"column",id:R.column}:{type:"axis",id:R.axis},predicate:{operator:"Equal",reference:w[u(R.axis)]}})))??[]}const h=n.computed({get:()=>e.value.gridState.sheets??{},set:w=>{const L=p(w),R=e.value;R.gridState.sheets=w,(o.value.sourceType==="ptable"||o.value.sourceType==="pframe")&&(R.pTableParams||(R.pTableParams={sorting:[],filters:[]}),R.pTableParams.filters=L),e.value=R}});n.watch(()=>[o.value,i.value],(w,L)=>{const[R,H]=w;if(!H)return;if(L){const[K,U]=L;if((R.sourceType==="ptable"||R.sourceType==="pframe")&&R.sourceType===(K==null?void 0:K.sourceType)&&Qe.isEqual(H,U))return}if(R.sourceType!=="ptable"&&R.sourceType!=="pframe"){h.value={};return}const G=h.value;for(const K of H){const U=u(K.axis);G[U]||(G[U]=K.defaultValue??K.options[0].value)}h.value=G},{immediate:!0});const f=n.shallowRef(),y=n.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:d.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:w=>{w.api.autoSizeAllColumns()},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:w=>w.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:hp,noRowsOverlayComponent:fp,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),S=w=>{const L=w.api;f.value=new Proxy(L,{get(R,H,G){switch(H){case"setGridOption":return(K,U)=>{const P=y.value;P[K]=U,y.value=P,L.updateGridOptions(P)};case"updateGridOptions":return K=>{y.value={...y.value,...K},L.updateGridOptions(K)};default:return Reflect.get(R,H,G)}}})},k=w=>{d.value={columnOrder:w.state.columnOrder,sort:w.state.sort,columnVisibility:w.state.columnVisibility??(w.state.columnOrder?{hiddenColIds:[]}:void 0)},y.value.initialState=d.value},D=()=>{const w=f.value.getState();d.value={columnOrder:w.columnOrder,sort:w.sort,columnVisibility:w.columnVisibility??(w.columnOrder?{hiddenColIds:[]}:void 0)},y.value.initialState=d.value,f.value=void 0},E=n.ref(0);n.watch(()=>[f.value,d.value],(w,L)=>{if(Qe.isEqual(w,L))return;const[R,H]=w;if(!R)return;const G=R.getState(),K={columnOrder:G.columnOrder,sort:G.sort,columnVisibility:G.columnVisibility??(G.columnOrder?{hiddenColIds:[]}:void 0)};Qe.isEqual(H,K)||(y.value.initialState=H,++E.value)}),n.watch(()=>y.value,(w,L)=>{L&&w.rowModelType!=L.rowModelType&&++E.value});const A=(w,L)=>{var H;const R=h.value;R[w]!==L&&(R[w]=L,h.value=R,(H=f.value)==null||H.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return n.watch(()=>[f.value,o.value,i.value],async(w,L)=>{var P,W;if(Qe.isEqual(w,L))return;const[R,H,G]=w;if(!R)return;const K=window.platforma;if(!K)throw Error("platforma not set");const U=H.sourceType;switch(U){case"pframe":case"ptable":{const F=K.pFrameDriver;if(!F)throw Error("platforma.pFrameDriver not set");const Y=H.pTable;if(!Y||!G)return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ue=(W=(P=d.value)==null?void 0:P.columnVisibility)==null?void 0:W.hiddenColIds,j=await EE(F,Y,G,ue);return R.updateGridOptions({loading:j.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...j})}case"xsv":{const F=K.blobDriver;if(!F)throw Error("platforma.blobDriver not set");const Y=H.xsvFile;if(!(Y!=null&&Y.ok)||!Y.value)return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ue=await hE(F,Y.value);return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ue})}default:throw Error(`unsupported source type: ${U}`)}}),(w,L)=>(n.openBlock(),n.createElementBlock("div",NE,[n.createVNode(n.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:n.withCtx(()=>[n.unref(i).value&&n.unref(i).value.length>0?(n.openBlock(),n.createElementBlock("div",AE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i).value,(R,H)=>(n.openBlock(),n.createBlock(n.unref(Wu),{key:H,"model-value":h.value[u(R.axis)],options:R.options,"onUpdate:modelValue":G=>A(u(R.axis),G)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):n.createCommentVNode("",!0)]),_:1}),(n.openBlock(),n.createBlock(n.unref(hf.AgGridVue),{key:E.value,theme:n.unref(uu),class:"ap-ag-data-table-grid","grid-options":y.value,onGridReady:S,onStateUpdated:k,onGridPreDestroyed:D},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-15f8c97a"]]),BE={key:1,class:"alert-error"},PE={key:2},DE=n.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,r=n.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=n.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),i=n.computed(()=>r.value===void 0&&o.value===void 0);return(s,d)=>(n.openBlock(),n.createElementBlock("div",null,[r.value!==void 0?n.renderSlot(s.$slots,"default",n.normalizeProps(n.mergeProps({key:0},{value:r.value}))):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("div",BE,n.toDisplayString(o.value),1)):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createElementBlock("div",PE,"Unresolved")):n.createCommentVNode("",!0)]))}}),VE={style:{height:"100%"}},LE=n.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,r=n.computed(()=>e.params.extensions),o=n.computed(()=>e.params.value);function i(d){e.params.setValue(d)}const s=n.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(d,u)=>(n.openBlock(),n.createElementBlock("div",VE,[n.createVNode(n.unref(cp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${r.value?r.value[0]:""}`,extensions:r.value,"model-value":o.value,progress:s.value,"onUpdate:modelValue":i},null,8,["placeholder","extensions","model-value","progress"])]))}}),Ti=new Map;function IE(t,e){const r=n.getCurrentScope()??n.effectScope(),o=r.run(()=>(n.onScopeDispose(()=>{Ti.delete(t)}),n.reactive(e())));return o[Symbol.dispose]=()=>{r.stop()},o}function FE(t){const e=Symbol();return()=>(Ti.has(e)||Ti.set(e,IE(e,t)),Ti.get(e))}function RE(t){return n.computed(()=>{try{return gd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function wp(t,e,r){const o=n.ref(0),i=n.reactive({loading:n.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),s=vf(e);return n.watch(t,async d=>{i.error=void 0,o.value++,s(d).then(u=>{u.ok&&(i.value=u.value)}).catch(u=>{i.value=void 0,i.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},r??{})),i}const co=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xp=new Set,Ms=typeof process=="object"&&process?process:{},Cp=(t,e,r,o)=>{typeof Ms.emitWarning=="function"?Ms.emitWarning(t,e,r,o):console.error(`[${r}] ${e}: ${t}`)};let Ei=globalThis.AbortController,_p=globalThis.AbortSignal;if(typeof Ei>"u"){_p=class{constructor(){ze(this,"onabort");ze(this,"_onabort",[]);ze(this,"reason");ze(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},Ei=class{constructor(){ze(this,"signal",new _p);e()}abort(o){var i,s;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const d of this.signal._onabort)d(o);(s=(i=this.signal).onabort)==null||s.call(i,o)}}};let t=((Sp=Ms.env)==null?void 0:Sp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Cp("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const OE=t=>!xp.has(t),gn=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),kp=t=>gn(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ni:null:null;class Ni extends Array{constructor(e){super(e),this.fill(0)}}const Ln=class Ln{constructor(e,r){ze(this,"heap");ze(this,"length");if(!x(Ln,uo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=kp(e);if(!r)return[];ge(Ln,uo,!0);const o=new Ln(e,r);return ge(Ln,uo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};uo=new WeakMap,Re(Ln,uo,!1);let Bs=Ln;const Vs=class Vs{constructor(e){Re(this,ee);Re(this,sr);Re(this,It);Re(this,cr);Re(this,dr);Re(this,po);Re(this,go);ze(this,"ttl");ze(this,"ttlResolution");ze(this,"ttlAutopurge");ze(this,"updateAgeOnGet");ze(this,"updateAgeOnHas");ze(this,"allowStale");ze(this,"noDisposeOnSet");ze(this,"noUpdateTTL");ze(this,"maxEntrySize");ze(this,"sizeCalculation");ze(this,"noDeleteOnFetchRejection");ze(this,"noDeleteOnStaleGet");ze(this,"allowStaleOnFetchAbort");ze(this,"allowStaleOnFetchRejection");ze(this,"ignoreFetchAbort");Re(this,at);Re(this,ur);Re(this,nt);Re(this,$e);Re(this,xe);Re(this,Ct);Re(this,Ft);Re(this,vt);Re(this,ct);Re(this,pr);Re(this,dt);Re(this,gr);Re(this,hr);Re(this,Rt);Re(this,fr);Re(this,hn);Re(this,_t);Re(this,In,()=>{});Re(this,Fr,()=>{});Re(this,ka,()=>{});Re(this,Ot,()=>!1);Re(this,Fn,e=>{});Re(this,ho,(e,r,o)=>{});Re(this,Sa,(e,r,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});ze(this,Tp,"LRUCache");const{max:r=0,ttl:o,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:h,disposeAfter:f,noDisposeOnSet:y,noUpdateTTL:S,maxSize:k=0,maxEntrySize:D=0,sizeCalculation:E,fetchMethod:A,memoMethod:w,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:G,ignoreFetchAbort:K}=e;if(r!==0&&!gn(r))throw new TypeError("max option must be a nonnegative integer");const U=r?kp(r):Array;if(!U)throw new Error("invalid max value: "+r);if(ge(this,sr,r),ge(this,It,k),this.maxEntrySize=D||x(this,It),this.sizeCalculation=E,this.sizeCalculation){if(!x(this,It)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(ge(this,go,w),A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(ge(this,po,A),ge(this,hn,!!A),ge(this,nt,new Map),ge(this,$e,new Array(r).fill(void 0)),ge(this,xe,new Array(r).fill(void 0)),ge(this,Ct,new U(r)),ge(this,Ft,new U(r)),ge(this,vt,0),ge(this,ct,0),ge(this,pr,Bs.create(r)),ge(this,at,0),ge(this,ur,0),typeof h=="function"&&ge(this,cr,h),typeof f=="function"?(ge(this,dr,f),ge(this,dt,[])):(ge(this,dr,void 0),ge(this,dt,void 0)),ge(this,fr,!!x(this,cr)),ge(this,_t,!!x(this,dr)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!G,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(x(this,It)!==0&&!gn(x(this,It)))throw new TypeError("maxSize must be a positive integer if specified");if(!gn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,ee,sf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=gn(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=o||0,this.ttl){if(!gn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,ee,ad).call(this)}if(x(this,sr)===0&&this.ttl===0&&x(this,It)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!x(this,sr)&&!x(this,It)){const P="LRU_CACHE_UNBOUNDED";OE(P)&&(xp.add(P),Cp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,Vs))}}static unsafeExposeInternals(e){return{starts:x(e,hr),ttls:x(e,Rt),sizes:x(e,gr),keyMap:x(e,nt),keyList:x(e,$e),valList:x(e,xe),next:x(e,Ct),prev:x(e,Ft),get head(){return x(e,vt)},get tail(){return x(e,ct)},free:x(e,pr),isBackgroundFetch:r=>{var o;return le(o=e,ee,He).call(o,r)},backgroundFetch:(r,o,i,s)=>{var d;return le(d=e,ee,_l).call(d,r,o,i,s)},moveToTail:r=>{var o;return le(o=e,ee,Ya).call(o,r)},indexes:r=>{var o;return le(o=e,ee,kn).call(o,r)},rindexes:r=>{var o;return le(o=e,ee,Sn).call(o,r)},isStale:r=>{var o;return x(o=e,Ot).call(o,r)}}}get max(){return x(this,sr)}get maxSize(){return x(this,It)}get calculatedSize(){return x(this,ur)}get size(){return x(this,at)}get fetchMethod(){return x(this,po)}get memoMethod(){return x(this,go)}get dispose(){return x(this,cr)}get disposeAfter(){return x(this,dr)}getRemainingTTL(e){return x(this,nt).has(e)?1/0:0}*entries(){for(const e of le(this,ee,kn).call(this))x(this,xe)[e]!==void 0&&x(this,$e)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield[x(this,$e)[e],x(this,xe)[e]])}*rentries(){for(const e of le(this,ee,Sn).call(this))x(this,xe)[e]!==void 0&&x(this,$e)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield[x(this,$e)[e],x(this,xe)[e]])}*keys(){for(const e of le(this,ee,kn).call(this)){const r=x(this,$e)[e];r!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield r)}}*rkeys(){for(const e of le(this,ee,Sn).call(this)){const r=x(this,$e)[e];r!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield r)}}*values(){for(const e of le(this,ee,kn).call(this))x(this,xe)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield x(this,xe)[e])}*rvalues(){for(const e of le(this,ee,Sn).call(this))x(this,xe)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield x(this,xe)[e])}[(Ep=Symbol.iterator,Tp=Symbol.toStringTag,Ep)](){return this.entries()}find(e,r={}){for(const o of le(this,ee,kn).call(this)){const i=x(this,xe)[o],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,x(this,$e)[o],this))return this.get(x(this,$e)[o],r)}}forEach(e,r=this){for(const o of le(this,ee,kn).call(this)){const i=x(this,xe)[o],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,x(this,$e)[o],this)}}rforEach(e,r=this){for(const o of le(this,ee,Sn).call(this)){const i=x(this,xe)[o],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,x(this,$e)[o],this)}}purgeStale(){let e=!1;for(const r of le(this,ee,Sn).call(this,{allowStale:!0}))x(this,Ot).call(this,r)&&(le(this,ee,Tn).call(this,x(this,$e)[r],"expire"),e=!0);return e}info(e){const r=x(this,nt).get(e);if(r===void 0)return;const o=x(this,xe)[r],i=le(this,ee,He).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const s={value:i};if(x(this,Rt)&&x(this,hr)){const d=x(this,Rt)[r],u=x(this,hr)[r];if(d&&u){const p=d-(co.now()-u);s.ttl=p,s.start=Date.now()}}return x(this,gr)&&(s.size=x(this,gr)[r]),s}dump(){const e=[];for(const r of le(this,ee,kn).call(this,{allowStale:!0})){const o=x(this,$e)[r],i=x(this,xe)[r],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;if(s===void 0||o===void 0)continue;const d={value:s};if(x(this,Rt)&&x(this,hr)){d.ttl=x(this,Rt)[r];const u=co.now()-x(this,hr)[r];d.start=Math.floor(Date.now()-u)}x(this,gr)&&(d.size=x(this,gr)[r]),e.unshift([o,d])}return e}load(e){this.clear();for(const[r,o]of e){if(o.start){const i=Date.now()-o.start;o.start=co.now()-i}this.set(r,o.value,o)}}set(e,r,o={}){var S,k,D,E,A;if(r===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:s,noDisposeOnSet:d=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const f=x(this,Sa).call(this,e,r,o.size||0,u);if(this.maxEntrySize&&f>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),le(this,ee,Tn).call(this,e,"set"),this;let y=x(this,at)===0?void 0:x(this,nt).get(e);if(y===void 0)y=x(this,at)===0?x(this,ct):x(this,pr).length!==0?x(this,pr).pop():x(this,at)===x(this,sr)?le(this,ee,Cl).call(this,!1):x(this,at),x(this,$e)[y]=e,x(this,xe)[y]=r,x(this,nt).set(e,y),x(this,Ct)[x(this,ct)]=y,x(this,Ft)[y]=x(this,ct),ge(this,ct,y),xl(this,at)._++,x(this,ho).call(this,y,f,p),p&&(p.set="add"),h=!1;else{le(this,ee,Ya).call(this,y);const w=x(this,xe)[y];if(r!==w){if(x(this,hn)&&le(this,ee,He).call(this,w)){w.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:L}=w;L!==void 0&&!d&&(x(this,fr)&&((S=x(this,cr))==null||S.call(this,L,e,"set")),x(this,_t)&&((k=x(this,dt))==null||k.push([L,e,"set"])))}else d||(x(this,fr)&&((D=x(this,cr))==null||D.call(this,w,e,"set")),x(this,_t)&&((E=x(this,dt))==null||E.push([w,e,"set"])));if(x(this,Fn).call(this,y),x(this,ho).call(this,y,f,p),x(this,xe)[y]=r,p){p.set="replace";const L=w&&le(this,ee,He).call(this,w)?w.__staleWhileFetching:w;L!==void 0&&(p.oldValue=L)}}else p&&(p.set="update")}if(i!==0&&!x(this,Rt)&&le(this,ee,ad).call(this),x(this,Rt)&&(h||x(this,ka).call(this,y,i,s),p&&x(this,Fr).call(this,p,y)),!d&&x(this,_t)&&x(this,dt)){const w=x(this,dt);let L;for(;L=w==null?void 0:w.shift();)(A=x(this,dr))==null||A.call(this,...L)}return this}pop(){var e;try{for(;x(this,at);){const r=x(this,xe)[x(this,vt)];if(le(this,ee,Cl).call(this,!0),le(this,ee,He).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(x(this,_t)&&x(this,dt)){const r=x(this,dt);let o;for(;o=r==null?void 0:r.shift();)(e=x(this,dr))==null||e.call(this,...o)}}}has(e,r={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=r,s=x(this,nt).get(e);if(s!==void 0){const d=x(this,xe)[s];if(le(this,ee,He).call(this,d)&&d.__staleWhileFetching===void 0)return!1;if(x(this,Ot).call(this,s))i&&(i.has="stale",x(this,Fr).call(this,i,s));else return o&&x(this,In).call(this,s),i&&(i.has="hit",x(this,Fr).call(this,i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){const{allowStale:o=this.allowStale}=r,i=x(this,nt).get(e);if(i===void 0||!o&&x(this,Ot).call(this,i))return;const s=x(this,xe)[i];return le(this,ee,He).call(this,s)?s.__staleWhileFetching:s}async fetch(e,r={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:d=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:k=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,context:E,forceRefresh:A=!1,status:w,signal:L}=r;if(!x(this,hn))return w&&(w.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});const R={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:D,ignoreFetchAbort:k,status:w,signal:L};let H=x(this,nt).get(e);if(H===void 0){w&&(w.fetch="miss");const G=le(this,ee,_l).call(this,e,H,R,E);return G.__returned=G}else{const G=x(this,xe)[H];if(le(this,ee,He).call(this,G)){const F=o&&G.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",F&&(w.returnedStale=!0)),F?G.__staleWhileFetching:G.__returned=G}const K=x(this,Ot).call(this,H);if(!A&&!K)return w&&(w.fetch="hit"),le(this,ee,Ya).call(this,H),i&&x(this,In).call(this,H),w&&x(this,Fr).call(this,w,H),G;const U=le(this,ee,_l).call(this,e,H,R,E),W=U.__staleWhileFetching!==void 0&&o;return w&&(w.fetch=K?"stale":"refresh",W&&K&&(w.returnedStale=!0)),W?U.__staleWhileFetching:U.__returned=U}}async forceFetch(e,r={}){const o=await this.fetch(e,r);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,r={}){const o=x(this,go);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:s,...d}=r,u=this.get(e,d);if(!s&&u!==void 0)return u;const p=o(e,u,{options:d,context:i});return this.set(e,p,d),p}get(e,r={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:d}=r,u=x(this,nt).get(e);if(u!==void 0){const p=x(this,xe)[u],h=le(this,ee,He).call(this,p);return d&&x(this,Fr).call(this,d,u),x(this,Ot).call(this,u)?(d&&(d.get="stale"),h?(d&&o&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),o?p.__staleWhileFetching:void 0):(s||le(this,ee,Tn).call(this,e,"expire"),d&&o&&(d.returnedStale=!0),o?p:void 0)):(d&&(d.get="hit"),h?p.__staleWhileFetching:(le(this,ee,Ya).call(this,u),i&&x(this,In).call(this,u),p))}else d&&(d.get="miss")}delete(e){return le(this,ee,Tn).call(this,e,"delete")}clear(){return le(this,ee,sd).call(this,"delete")}};sr=new WeakMap,It=new WeakMap,cr=new WeakMap,dr=new WeakMap,po=new WeakMap,go=new WeakMap,at=new WeakMap,ur=new WeakMap,nt=new WeakMap,$e=new WeakMap,xe=new WeakMap,Ct=new WeakMap,Ft=new WeakMap,vt=new WeakMap,ct=new WeakMap,pr=new WeakMap,dt=new WeakMap,gr=new WeakMap,hr=new WeakMap,Rt=new WeakMap,fr=new WeakMap,hn=new WeakMap,_t=new WeakMap,ee=new WeakSet,ad=function(){const e=new Ni(x(this,sr)),r=new Ni(x(this,sr));ge(this,Rt,e),ge(this,hr,r),ge(this,ka,(s,d,u=co.now())=>{if(r[s]=d!==0?u:0,e[s]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{x(this,Ot).call(this,s)&&le(this,ee,Tn).call(this,x(this,$e)[s],"expire")},d+1);p.unref&&p.unref()}}),ge(this,In,s=>{r[s]=e[s]!==0?co.now():0}),ge(this,Fr,(s,d)=>{if(e[d]){const u=e[d],p=r[d];if(!u||!p)return;s.ttl=u,s.start=p,s.now=o||i();const h=s.now-p;s.remainingTTL=u-h}});let o=0;const i=()=>{const s=co.now();if(this.ttlResolution>0){o=s;const d=setTimeout(()=>o=0,this.ttlResolution);d.unref&&d.unref()}return s};this.getRemainingTTL=s=>{const d=x(this,nt).get(s);if(d===void 0)return 0;const u=e[d],p=r[d];if(!u||!p)return 1/0;const h=(o||i())-p;return u-h},ge(this,Ot,s=>{const d=r[s],u=e[s];return!!u&&!!d&&(o||i())-d>u})},In=new WeakMap,Fr=new WeakMap,ka=new WeakMap,Ot=new WeakMap,sf=function(){const e=new Ni(x(this,sr));ge(this,ur,0),ge(this,gr,e),ge(this,Fn,r=>{ge(this,ur,x(this,ur)-e[r]),e[r]=0}),ge(this,Sa,(r,o,i,s)=>{if(le(this,ee,He).call(this,o))return 0;if(!gn(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(o,r),!gn(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ge(this,ho,(r,o,i)=>{if(e[r]=o,x(this,It)){const s=x(this,It)-e[r];for(;x(this,ur)>s;)le(this,ee,Cl).call(this,!0)}ge(this,ur,x(this,ur)+e[r]),i&&(i.entrySize=o,i.totalCalculatedSize=x(this,ur))})},Fn=new WeakMap,ho=new WeakMap,Sa=new WeakMap,kn=function*({allowStale:e=this.allowStale}={}){if(x(this,at))for(let r=x(this,ct);!(!le(this,ee,id).call(this,r)||((e||!x(this,Ot).call(this,r))&&(yield r),r===x(this,vt)));)r=x(this,Ft)[r]},Sn=function*({allowStale:e=this.allowStale}={}){if(x(this,at))for(let r=x(this,vt);!(!le(this,ee,id).call(this,r)||((e||!x(this,Ot).call(this,r))&&(yield r),r===x(this,ct)));)r=x(this,Ct)[r]},id=function(e){return e!==void 0&&x(this,nt).get(x(this,$e)[e])===e},Cl=function(e){var s,d;const r=x(this,vt),o=x(this,$e)[r],i=x(this,xe)[r];return x(this,hn)&&le(this,ee,He).call(this,i)?i.__abortController.abort(new Error("evicted")):(x(this,fr)||x(this,_t))&&(x(this,fr)&&((s=x(this,cr))==null||s.call(this,i,o,"evict")),x(this,_t)&&((d=x(this,dt))==null||d.push([i,o,"evict"]))),x(this,Fn).call(this,r),e&&(x(this,$e)[r]=void 0,x(this,xe)[r]=void 0,x(this,pr).push(r)),x(this,at)===1?(ge(this,vt,ge(this,ct,0)),x(this,pr).length=0):ge(this,vt,x(this,Ct)[r]),x(this,nt).delete(o),xl(this,at)._--,r},_l=function(e,r,o,i){const s=r===void 0?void 0:x(this,xe)[r];if(le(this,ee,He).call(this,s))return s;const d=new Ei,{signal:u}=o;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:o,context:i},h=(E,A=!1)=>{const{aborted:w}=d.signal,L=o.ignoreFetchAbort&&E!==void 0;if(o.status&&(w&&!A?(o.status.fetchAborted=!0,o.status.fetchError=d.signal.reason,L&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),w&&!L&&!A)return y(d.signal.reason);const R=k;return x(this,xe)[r]===k&&(E===void 0?R.__staleWhileFetching?x(this,xe)[r]=R.__staleWhileFetching:le(this,ee,Tn).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,E,p.options))),E},f=E=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=E),y(E)),y=E=>{const{aborted:A}=d.signal,w=A&&o.allowStaleOnFetchAbort,L=w||o.allowStaleOnFetchRejection,R=L||o.noDeleteOnFetchRejection,H=k;if(x(this,xe)[r]===k&&(!R||H.__staleWhileFetching===void 0?le(this,ee,Tn).call(this,e,"fetch"):w||(x(this,xe)[r]=H.__staleWhileFetching)),L)return o.status&&H.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),H.__staleWhileFetching;if(H.__returned===H)throw E},S=(E,A)=>{var L;const w=(L=x(this,po))==null?void 0:L.call(this,e,s,p);w&&w instanceof Promise&&w.then(R=>E(R===void 0?void 0:R),A),d.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(E(void 0),o.allowStaleOnFetchAbort&&(E=R=>h(R,!0)))})};o.status&&(o.status.fetchDispatched=!0);const k=new Promise(S).then(h,f),D=Object.assign(k,{__abortController:d,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,D,{...p.options,status:void 0}),r=x(this,nt).get(e)):x(this,xe)[r]=D,D},He=function(e){if(!x(this,hn))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ei},ld=function(e,r){x(this,Ft)[r]=e,x(this,Ct)[e]=r},Ya=function(e){e!==x(this,ct)&&(e===x(this,vt)?ge(this,vt,x(this,Ct)[e]):le(this,ee,ld).call(this,x(this,Ft)[e],x(this,Ct)[e]),le(this,ee,ld).call(this,x(this,ct),e),ge(this,ct,e))},Tn=function(e,r){var i,s,d,u;let o=!1;if(x(this,at)!==0){const p=x(this,nt).get(e);if(p!==void 0)if(o=!0,x(this,at)===1)le(this,ee,sd).call(this,r);else{x(this,Fn).call(this,p);const h=x(this,xe)[p];if(le(this,ee,He).call(this,h)?h.__abortController.abort(new Error("deleted")):(x(this,fr)||x(this,_t))&&(x(this,fr)&&((i=x(this,cr))==null||i.call(this,h,e,r)),x(this,_t)&&((s=x(this,dt))==null||s.push([h,e,r]))),x(this,nt).delete(e),x(this,$e)[p]=void 0,x(this,xe)[p]=void 0,p===x(this,ct))ge(this,ct,x(this,Ft)[p]);else if(p===x(this,vt))ge(this,vt,x(this,Ct)[p]);else{const f=x(this,Ft)[p];x(this,Ct)[f]=x(this,Ct)[p];const y=x(this,Ct)[p];x(this,Ft)[y]=x(this,Ft)[p]}xl(this,at)._--,x(this,pr).push(p)}}if(x(this,_t)&&((d=x(this,dt))!=null&&d.length)){const p=x(this,dt);let h;for(;h=p==null?void 0:p.shift();)(u=x(this,dr))==null||u.call(this,...h)}return o},sd=function(e){var r,o,i;for(const s of le(this,ee,Sn).call(this,{allowStale:!0})){const d=x(this,xe)[s];if(le(this,ee,He).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=x(this,$e)[s];x(this,fr)&&((r=x(this,cr))==null||r.call(this,d,u,e)),x(this,_t)&&((o=x(this,dt))==null||o.push([d,u,e]))}}if(x(this,nt).clear(),x(this,xe).fill(void 0),x(this,$e).fill(void 0),x(this,Rt)&&x(this,hr)&&(x(this,Rt).fill(0),x(this,hr).fill(0)),x(this,gr)&&x(this,gr).fill(0),ge(this,vt,0),ge(this,ct,0),x(this,pr).length=0,ge(this,ur,0),ge(this,at,0),x(this,_t)&&x(this,dt)){const s=x(this,dt);let d;for(;d=s==null?void 0:s.shift();)(i=x(this,dr))==null||i.call(this,...d)}};let Ps=Vs;const zE={cacheSize:15e6};class GE{constructor(e){ze(this,"_str");ze(this,"_rawJson");ze(this,"_zodSchema");ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Rn=class Rn{constructor(e){ze(this,"fileDataCache");ze(this,"fileDataRefs",new Map);const r={...zE,...e??{}};this.fileDataCache=new Ps({maxSize:r.cacheSize,fetchMethod:async o=>new GE(await Bm().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}getDataRef(e){const r=this.fileDataRefs.get(e);if(r!==void 0)return r;const o=n.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),o}getContentBytes(e){if(e===void 0)return;const r=this.getDataRef(e);return n.computed(()=>{var o;return(o=r.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const r=this.getDataRef(e);return n.computed(()=>{var o;return(o=r==null?void 0:r.value)==null?void 0:o.str})}getContentJson(e,r){if(e===void 0)return;const o=this.getDataRef(e);return n.computed(()=>{var i,s;return r===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(s=o==null?void 0:o.value)==null?void 0:s.validatedJson(r)})}static getContentBytes(e){return Rn.globalInstance.getContentBytes(e)}static getContentString(e){return Rn.globalInstance.getContentString(e)}static getContentJson(e,r){return Rn.globalInstance.getContentJson(e,r)}};ze(Rn,"globalInstance",new Rn);let Ds=Rn;V.AgGridTheme=uu,V.BlockLayout=cE,V.ContextProvider=H1,V.DataTable=Mw,V.DemoData=KT,V.DropdownListItem=aa,V.LongText=vs,V.MultiError=Tl,V.PlAgCellFile=LE,V.PlAgDataTable=ME,V.PlAgOverlayLoading=hp,V.PlAgOverlayNoRows=fp,V.PlAlert=l0,V.PlBlockPage=Hw,V.PlBtnAccent=p0,V.PlBtnDanger=h0,V.PlBtnGhost=us,V.PlBtnGroup=I0,V.PlBtnLink=y0,V.PlBtnPrimary=cs,V.PlBtnSecondary=ds,V.PlCheckbox=IC,V.PlCheckboxGroup=zC,V.PlChip=bs,V.PlContainer=Kw,V.PlCopyData=up,V.PlDialogModal=xs,V.PlDropdown=ys,V.PlDropdownLegacy=lC,V.PlDropdownLine=Wu,V.PlDropdownMulti=VC,V.PlDropdownRef=Ix,V.PlFileDialog=qu,V.PlFileInput=cp,V.PlGrid=t0,V.PlIcon16=hi,V.PlIcon24=Gu,V.PlLogView=f_,V.PlMaskIcon16=ta,V.PlMaskIcon24=Lr,V.PlNotificationAlert=dp,V.PlNumberField=bC,V.PlProgressBar=pC,V.PlRow=Jw,V.PlSlideModal=e_,V.PlSpacer=Vu,V.PlTextArea=gx,V.PlTextField=ju,V.PlToggleSwitch=n_,V.PlTooltip=Vt,V.ReactiveFileContent=Ds,V.Scrollable=Rk,V.Slider=ok,V.SliderRange=Vk,V.SliderRangeTriple=Ck,V.ThemeSwitcher=zw,V.UnresolvedError=Sl,V.ValueOrErrorsComponent=DE,V.activateAgGrid=du,V.animate=Nu,V.animateInfinite=Lw,V.call=_u,V.computedResult=RE,V.createModel=Pl,V.debounce=Au,V.defineApp=ab,V.defineStore=FE,V.delay=ku,V.detectOutside=hx,V.ensureError=Al,V.eventListener=fs,V.formatZodError=Bl,V.getElementScrollPosition=Zu,V.identity=Nl,V.isDefined=Cf,V.isElementVisible=Uu,V.isJsonEqual=El,V.isZodError=Ml,V.listToOptions=Iw,V.makeEaseInOut=Vw,V.makeEaseOut=Eu,V.maskIcons16=HT,V.maskIcons24=qT,V.normalizeListOptions=Bn,V.notEmpty=os,V.randomInt=Tu,V.randomString=Dw,V.requestTick=as,V.scrollIntoView=oa,V.showContextMenu=ts,V.throttle=Mu,V.timeout=Su,V.unwrapOptionalResult=xf,V.unwrapValueOrErrors=pd,V.useClickOutside=gi,V.useDraggable=uk,V.useEventListener=et,V.useFormState=ck,V.useHover=xu,V.useInterval=sk,V.useLabelNotch=Vr,V.useLocalStorage=Bu,V.useMouse=wu,V.useMouseCapture=nn,V.usePosition=ra,V.useQuery=dk,V.useResizeObserver=pp,V.useScroll=ak,V.useSdkPlugin=Jl,V.useSortable=lk,V.useTheme=Du,V.useWatchFetch=wp,V.wrapOptionalResult=gd,V.wrapValueOrErrors=wf,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
|
103
|
+
}`;var Me=rf(function(){return Oe(b,se+"return "+q).apply(r,_)});if(Me.source=q,$c(Me))throw Me;return Me}function VV(a){return Ge(a).toLowerCase()}function LV(a){return Ge(a).toUpperCase()}function IV(a,l,c){if(a=Ge(a),a&&(c||l===r))return ug(a);if(!a||!(l=Ut(l)))return a;var g=yr(a),m=yr(l),b=pg(g,m),_=gg(g,m)+1;return Cn(g,b,_).join("")}function FV(a,l,c){if(a=Ge(a),a&&(c||l===r))return a.slice(0,fg(a)+1);if(!a||!(l=Ut(l)))return a;var g=yr(a),m=gg(g,yr(l))+1;return Cn(g,0,m).join("")}function RV(a,l,c){if(a=Ge(a),a&&(c||l===r))return a.replace($s,"");if(!a||!(l=Ut(l)))return a;var g=yr(a),m=pg(g,yr(l));return Cn(g,m).join("")}function OV(a,l){var c=F,g=Y;if(Je(l)){var m="separator"in l?l.separator:m;c="length"in l?Ee(l.length):c,g="omission"in l?Ut(l.omission):g}a=Ge(a);var b=a.length;if(bo(a)){var _=yr(a);b=_.length}if(c>=b)return a;var T=c-wo(g);if(T<1)return g;var M=_?Cn(_,0,T).join(""):a.slice(0,T);if(m===r)return M+g;if(_&&(T+=M.length-T),Wc(m)){if(a.slice(T).search(m)){var Z,$=M;for(m.global||(m=sc(m.source,Ge(Dp.exec(m))+"g")),m.lastIndex=0;Z=m.exec($);)var q=Z.index;M=M.slice(0,q===r?T:q)}}else if(a.indexOf(Ut(m),T)!=T){var te=M.lastIndexOf(m);te>-1&&(M=M.slice(0,te))}return M+g}function zV(a){return a=Ge(a),a&&JE.test(a)?a.replace(Mp,fA):a}var GV=Eo(function(a,l,c){return a+(c?" ":"")+l.toUpperCase()}),Kc=nh("toUpperCase");function tf(a,l,c){return a=Ge(a),l=c?r:l,l===r?dA(a)?yA(a):tA(a):a.match(l)||[]}var rf=Be(function(a,l){try{return Gt(a,r,l)}catch(c){return $c(c)?c:new Ce(c)}}),jV=Ur(function(a,l){return Kt(l,function(c){c=Mr(c),Gr(a,c,Uc(a[c],a))}),a});function UV(a){var l=a==null?0:a.length,c=pe();return a=l?qe(a,function(g){if(typeof g[1]!="function")throw new Yt(d);return[c(g[0]),g[1]]}):[],Be(function(g){for(var m=-1;++m<l;){var b=a[m];if(Gt(b[0],this,g))return Gt(b[1],this,g)}})}function ZV(a){return fM(Qt(a,y))}function Yc(a){return function(){return a}}function $V(a,l){return a==null||a!==a?l:a}var WV=ah(),HV=ah(!0);function Pt(a){return a}function Jc(a){return Lg(typeof a=="function"?a:Qt(a,y))}function qV(a){return Fg(Qt(a,y))}function KV(a,l){return Rg(a,Qt(l,y))}var YV=Be(function(a,l){return function(c){return Ua(c,a,l)}}),JV=Be(function(a,l){return function(c){return Ua(a,c,l)}});function Qc(a,l,c){var g=ut(l),m=tl(l,g);c==null&&!(Je(l)&&(m.length||!g.length))&&(c=l,l=a,a=this,m=tl(l,ut(l)));var b=!(Je(c)&&"chain"in c)||!!c.chain,_=$r(a);return Kt(m,function(T){var M=l[T];a[T]=M,_&&(a.prototype[T]=function(){var Z=this.__chain__;if(b||Z){var $=a(this.__wrapped__),q=$.__actions__=At(this.__actions__);return q.push({func:M,args:arguments,thisArg:a}),$.__chain__=Z,$}return M.apply(a,mn([this.value()],arguments))})}),a}function QV(){return pt._===this&&(pt._=kA),this}function Xc(){}function XV(a){return a=Ee(a),Be(function(l){return Og(l,a)})}var e2=Mc(qe),t2=Mc(ig),r2=Mc(tc);function nf(a){return Fc(a)?rc(Mr(a)):PM(a)}function n2(a){return function(l){return a==null?r:$n(a,l)}}var o2=lh(),a2=lh(!0);function ed(){return[]}function td(){return!1}function i2(){return{}}function l2(){return""}function s2(){return!0}function c2(a,l){if(a=Ee(a),a<1||a>_e)return[];var c=Nt,g=yt(a,Nt);l=pe(l),a-=Nt;for(var m=ac(g,l);++c<a;)l(c);return m}function d2(a){return ke(a)?qe(a,Mr):Zt(a)?[a]:At(_h(Ge(a)))}function u2(a){var l=++CA;return Ge(a)+l}var p2=ll(function(a,l){return a+l},0),g2=Bc("ceil"),h2=ll(function(a,l){return a/l},1),f2=Bc("floor");function m2(a){return a&&a.length?el(a,Pt,mc):r}function v2(a,l){return a&&a.length?el(a,pe(l,2),mc):r}function y2(a){return cg(a,Pt)}function b2(a,l){return cg(a,pe(l,2))}function w2(a){return a&&a.length?el(a,Pt,wc):r}function x2(a,l){return a&&a.length?el(a,pe(l,2),wc):r}var C2=ll(function(a,l){return a*l},1),_2=Bc("round"),k2=ll(function(a,l){return a-l},0);function S2(a){return a&&a.length?oc(a,Pt):0}function T2(a,l){return a&&a.length?oc(a,pe(l,2)):0}return v.after=qP,v.ary=Vh,v.assign=LD,v.assignIn=qh,v.assignInWith=wl,v.assignWith=ID,v.at=FD,v.before=Lh,v.bind=Uc,v.bindAll=jV,v.bindKey=Ih,v.castArray=iD,v.chain=Bh,v.chunk=fB,v.compact=mB,v.concat=vB,v.cond=UV,v.conforms=ZV,v.constant=Yc,v.countBy=SP,v.create=RD,v.curry=Fh,v.curryRight=Rh,v.debounce=Oh,v.defaults=OD,v.defaultsDeep=zD,v.defer=KP,v.delay=YP,v.difference=yB,v.differenceBy=bB,v.differenceWith=wB,v.drop=xB,v.dropRight=CB,v.dropRightWhile=_B,v.dropWhile=kB,v.fill=SB,v.filter=EP,v.flatMap=MP,v.flatMapDeep=BP,v.flatMapDepth=PP,v.flatten=Eh,v.flattenDeep=TB,v.flattenDepth=EB,v.flip=JP,v.flow=WV,v.flowRight=HV,v.fromPairs=NB,v.functions=HD,v.functionsIn=qD,v.groupBy=DP,v.initial=MB,v.intersection=BB,v.intersectionBy=PB,v.intersectionWith=DB,v.invert=YD,v.invertBy=JD,v.invokeMap=LP,v.iteratee=Jc,v.keyBy=IP,v.keys=ut,v.keysIn=Bt,v.map=hl,v.mapKeys=XD,v.mapValues=eV,v.matches=qV,v.matchesProperty=KV,v.memoize=ml,v.merge=tV,v.mergeWith=Kh,v.method=YV,v.methodOf=JV,v.mixin=Qc,v.negate=vl,v.nthArg=XV,v.omit=rV,v.omitBy=nV,v.once=QP,v.orderBy=FP,v.over=e2,v.overArgs=XP,v.overEvery=t2,v.overSome=r2,v.partial=Zc,v.partialRight=zh,v.partition=RP,v.pick=oV,v.pickBy=Yh,v.property=nf,v.propertyOf=n2,v.pull=FB,v.pullAll=Ah,v.pullAllBy=RB,v.pullAllWith=OB,v.pullAt=zB,v.range=o2,v.rangeRight=a2,v.rearg=eD,v.reject=GP,v.remove=GB,v.rest=tD,v.reverse=Gc,v.sampleSize=UP,v.set=iV,v.setWith=lV,v.shuffle=ZP,v.slice=jB,v.sortBy=HP,v.sortedUniq=KB,v.sortedUniqBy=YB,v.split=MV,v.spread=rD,v.tail=JB,v.take=QB,v.takeRight=XB,v.takeRightWhile=eP,v.takeWhile=tP,v.tap=mP,v.throttle=nD,v.thru=gl,v.toArray=$h,v.toPairs=Jh,v.toPairsIn=Qh,v.toPath=d2,v.toPlainObject=Hh,v.transform=sV,v.unary=oD,v.union=rP,v.unionBy=nP,v.unionWith=oP,v.uniq=aP,v.uniqBy=iP,v.uniqWith=lP,v.unset=cV,v.unzip=jc,v.unzipWith=Mh,v.update=dV,v.updateWith=uV,v.values=Mo,v.valuesIn=pV,v.without=sP,v.words=tf,v.wrap=aD,v.xor=cP,v.xorBy=dP,v.xorWith=uP,v.zip=pP,v.zipObject=gP,v.zipObjectDeep=hP,v.zipWith=fP,v.entries=Jh,v.entriesIn=Qh,v.extend=qh,v.extendWith=wl,Qc(v,v),v.add=p2,v.attempt=rf,v.camelCase=mV,v.capitalize=Xh,v.ceil=g2,v.clamp=gV,v.clone=lD,v.cloneDeep=cD,v.cloneDeepWith=dD,v.cloneWith=sD,v.conformsTo=uD,v.deburr=ef,v.defaultTo=$V,v.divide=h2,v.endsWith=vV,v.eq=wr,v.escape=yV,v.escapeRegExp=bV,v.every=TP,v.find=NP,v.findIndex=Sh,v.findKey=GD,v.findLast=AP,v.findLastIndex=Th,v.findLastKey=jD,v.floor=f2,v.forEach=Ph,v.forEachRight=Dh,v.forIn=UD,v.forInRight=ZD,v.forOwn=$D,v.forOwnRight=WD,v.get=Hc,v.gt=pD,v.gte=gD,v.has=KD,v.hasIn=qc,v.head=Nh,v.identity=Pt,v.includes=VP,v.indexOf=AB,v.inRange=hV,v.invoke=QD,v.isArguments=qn,v.isArray=ke,v.isArrayBuffer=hD,v.isArrayLike=Mt,v.isArrayLikeObject=tt,v.isBoolean=fD,v.isBuffer=_n,v.isDate=mD,v.isElement=vD,v.isEmpty=yD,v.isEqual=bD,v.isEqualWith=wD,v.isError=$c,v.isFinite=xD,v.isFunction=$r,v.isInteger=Gh,v.isLength=yl,v.isMap=jh,v.isMatch=CD,v.isMatchWith=_D,v.isNaN=kD,v.isNative=SD,v.isNil=ED,v.isNull=TD,v.isNumber=Uh,v.isObject=Je,v.isObjectLike=Xe,v.isPlainObject=Ka,v.isRegExp=Wc,v.isSafeInteger=ND,v.isSet=Zh,v.isString=bl,v.isSymbol=Zt,v.isTypedArray=Ao,v.isUndefined=AD,v.isWeakMap=MD,v.isWeakSet=BD,v.join=VB,v.kebabCase=wV,v.last=er,v.lastIndexOf=LB,v.lowerCase=xV,v.lowerFirst=CV,v.lt=PD,v.lte=DD,v.max=m2,v.maxBy=v2,v.mean=y2,v.meanBy=b2,v.min=w2,v.minBy=x2,v.stubArray=ed,v.stubFalse=td,v.stubObject=i2,v.stubString=l2,v.stubTrue=s2,v.multiply=C2,v.nth=IB,v.noConflict=QV,v.noop=Xc,v.now=fl,v.pad=_V,v.padEnd=kV,v.padStart=SV,v.parseInt=TV,v.random=fV,v.reduce=OP,v.reduceRight=zP,v.repeat=EV,v.replace=NV,v.result=aV,v.round=_2,v.runInContext=N,v.sample=jP,v.size=$P,v.snakeCase=AV,v.some=WP,v.sortedIndex=UB,v.sortedIndexBy=ZB,v.sortedIndexOf=$B,v.sortedLastIndex=WB,v.sortedLastIndexBy=HB,v.sortedLastIndexOf=qB,v.startCase=BV,v.startsWith=PV,v.subtract=k2,v.sum=S2,v.sumBy=T2,v.template=DV,v.times=c2,v.toFinite=Wr,v.toInteger=Ee,v.toLength=Wh,v.toLower=VV,v.toNumber=tr,v.toSafeInteger=VD,v.toString=Ge,v.toUpper=LV,v.trim=IV,v.trimEnd=FV,v.trimStart=RV,v.truncate=OV,v.unescape=zV,v.uniqueId=u2,v.upperCase=GV,v.upperFirst=Kc,v.each=Ph,v.eachRight=Dh,v.first=Nh,Qc(v,function(){var a={};return Nr(v,function(l,c){je.call(v.prototype,c)||(a[c]=l)}),a}(),{chain:!1}),v.VERSION=o,Kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){v[a].placeholder=v}),Kt(["drop","take"],function(a,l){De.prototype[a]=function(c){c=c===r?1:lt(Ee(c),0);var g=this.__filtered__&&!l?new De(this):this.clone();return g.__filtered__?g.__takeCount__=yt(c,g.__takeCount__):g.__views__.push({size:yt(c,Nt),type:a+(g.__dir__<0?"Right":"")}),g},De.prototype[a+"Right"]=function(c){return this.reverse()[a](c).reverse()}}),Kt(["filter","map","takeWhile"],function(a,l){var c=l+1,g=c==B||c==X;De.prototype[a]=function(m){var b=this.clone();return b.__iteratees__.push({iteratee:pe(m,3),type:c}),b.__filtered__=b.__filtered__||g,b}}),Kt(["head","last"],function(a,l){var c="take"+(l?"Right":"");De.prototype[a]=function(){return this[c](1).value()[0]}}),Kt(["initial","tail"],function(a,l){var c="drop"+(l?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[c](1)}}),De.prototype.compact=function(){return this.filter(Pt)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=Be(function(a,l){return typeof a=="function"?new De(this):this.map(function(c){return Ua(c,a,l)})}),De.prototype.reject=function(a){return this.filter(vl(pe(a)))},De.prototype.slice=function(a,l){a=Ee(a);var c=this;return c.__filtered__&&(a>0||l<0)?new De(c):(a<0?c=c.takeRight(-a):a&&(c=c.drop(a)),l!==r&&(l=Ee(l),c=l<0?c.dropRight(-l):c.take(l-a)),c)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(Nt)},Nr(De.prototype,function(a,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),g=/^(?:head|last)$/.test(l),m=v[g?"take"+(l=="last"?"Right":""):l],b=g||/^find/.test(l);m&&(v.prototype[l]=function(){var _=this.__wrapped__,T=g?[1]:arguments,M=_ instanceof De,Z=T[0],$=M||ke(_),q=function(Pe){var Ve=m.apply(v,mn([Pe],T));return g&&te?Ve[0]:Ve};$&&c&&typeof Z=="function"&&Z.length!=1&&(M=$=!1);var te=this.__chain__,se=!!this.__actions__.length,he=b&&!te,Me=M&&!se;if(!b&&$){_=Me?_:new De(this);var fe=a.apply(_,T);return fe.__actions__.push({func:gl,args:[q],thisArg:r}),new Jt(fe,te)}return he&&Me?a.apply(this,T):(fe=this.thru(q),he?g?fe.value()[0]:fe.value():fe)})}),Kt(["pop","push","shift","sort","splice","unshift"],function(a){var l=Oi[a],c=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",g=/^(?:pop|shift)$/.test(a);v.prototype[a]=function(){var m=arguments;if(g&&!this.__chain__){var b=this.value();return l.apply(ke(b)?b:[],m)}return this[c](function(_){return l.apply(ke(_)?_:[],m)})}}),Nr(De.prototype,function(a,l){var c=v[l];if(c){var g=c.name+"";je.call(ko,g)||(ko[g]=[]),ko[g].push({name:l,func:c})}}),ko[il(r,w).name]=[{name:"wrapper",func:r}],De.prototype.clone=zA,De.prototype.reverse=GA,De.prototype.value=jA,v.prototype.at=vP,v.prototype.chain=yP,v.prototype.commit=bP,v.prototype.next=wP,v.prototype.plant=CP,v.prototype.reverse=_P,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=kP,v.prototype.first=v.prototype.head,Ia&&(v.prototype[Ia]=xP),v},xo=bA();zn?((zn.exports=xo)._=xo,Js._=xo):pt._=xo}).call(Bo)}(Si,Si.exports);var Qe=Si.exports;const dE={class:"grid-overlay-container"},hp=n.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",dE,[e.params.notReady?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[r[0]||(r[0]=n.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),r[1]||(r[1]=n.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[r[2]||(r[2]=n.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),r[3]||(r[3]=n.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),uE={},pE={class:"grid-overlay-container"};function gE(t,e){return n.openBlock(),n.createElementBlock("div",pE,e[0]||(e[0]=[n.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),n.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const fp=As(uE,[["render",gE]]);async function hE(t,e){throw Error("not implemented")}function fE(t){return t.axesSpec.filter(e=>{var r;return((r=e.annotations)==null?void 0:r["pl7.app/axisNature"])==="heterogeneous"})}function mE(t,e){const r=[];for(const o of e)if(t[o].type==="column"){const i=fE(t[o].spec);for(const s of i){if(s.type!=="String"){console.warn("heterogeneous axis with string type expected, got",s,"skipping");continue}const d=Nd(s),u=t.findIndex(p=>Qe.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",o,d,t),Error("axis not found");r.push({columnIdx:o,axisIdx:u})}}return r}const mp=(t,e)=>(t+e).toString();function vE(t,e,r,o,i,s){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const d=t[0];let u=-1,p=-1;for(let y=0;y<s.length;++y)s[y]===d.axisIdx&&(u=y),s[y]===d.columnIdx&&(p=y);const h=(()=>{const S=o[u].data.filter(k=>k!==null);return Array.from(new Set(S))})();h.sort(),p>u?(r.splice(p,1),r.splice(u,1)):(r.splice(u,1),r.splice(p,1));const f=yE(i,o,u,p,h,e.rows);for(let y=0;y<h.length;++y){const S=h[y],k=S+"@"+y;r.push({colId:k,field:mp(o.length,y),headerName:S,valueFormatter:vp})}return{rowModelType:"clientSide",columnDefs:r,rowData:f}}function yE(t,e,r,o,i,s){const d=new Map;let u=0;for(let h=0;h<s;h++){const f={};for(let E=0;E<e.length;++E){if(E===r||E===o)continue;const A=t[E].toString();f[A]=e[E].data[h]}let y;const S=Po(Object.values(f))??"";d.has(S)?y=d.get(S):(d.set(S,f),y=f,y.id=u.toString(),u++);const k=i.indexOf(e[r].data[h]);if(k===-1)throw Error("index not found");const D=mp(e.length,k);y[D]=e[o].data[h]}return Array.from(d.values())}function bE(t){return Po({type:t.type,id:t.id})}function wE(t){return JSON.parse(t)}const vp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function xE(t,e,r){var i,s,d;const o=bE(e);return{colId:o,field:t.toString(),headerName:((s=(i=e.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:s.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(r==null?void 0:r.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:vp,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function yp(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function bp(t){const e=[];return li(t,r=>(e.push(r),r)),e}async function CE(t,e,r){return r.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Qe.uniqWith(r.map(i=>Ol(i.spec.axesSpec).map(Qe.cloneDeep)).flat(),Qe.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function _E(t,e,r){const o=bp(r),s=(await CE(t,e,o)).filter(d=>!Qe.find(o,u=>d.columnId===u.columnId));return s.length===0?r:{type:"outer",primary:r,secondary:s.map(d=>({type:"column",column:d}))}}async function kE(t,e,r,o){const i=r.filter(f=>f.type!=="Bytes"),s=bp(o),d=i.map(f=>[]),u=i.map(f=>null);for(let f=0;f<s.length;++f){const y=Ol(s[f].spec.axesSpec);for(let S=0;S<y.length;++S){const k=Qe.findIndex(i,D=>Qe.isEqual(D,y[S]));k===-1||u[k]||(y.length===1&&s[f].spec.name==="pl7.app/label"?(d[k]=[[f,S]],u[k]=s[f].columnId):d[k].push([f,S]))}}for(let f=i.length-1;f>=0;--f)d[f].length||(u.splice(f,1),d.splice(f,1),i.splice(f,1));const p=100,h=i.map(f=>new Set);e:for(let f=i.length-1;f>=0;--f){for(const[y,S]of d[f]){const k=await t.getUniqueValues(e,{columnId:s[y].columnId,...!u[f]&&{axis:Qe.cloneDeep(i[f])},filters:[],limit:p});if(k.overflow){u.splice(f,1),d.splice(f,1),i.splice(f,1);continue e}const D=k.values.type;for(const E of k.values.data)if(!(Ed(E,D)||E===null)&&(h[f].add(yp(E,D)),h[f].size===p)){u.splice(f,1),d.splice(f,1),i.splice(f,1);continue e}}if(!h[f].size){u.splice(f,1),d.splice(f,1),i.splice(f,1);continue e}}return i.map((f,y)=>{const S=[...h[y]].map(D=>({value:D,text:D.toString()})),k=S[0].value;return{axis:Qe.cloneDeep(f),...u[y]&&{column:u[y]},options:S,defaultValue:k}})}function SE(t,e,r){const o=e.length,i=[];for(let s=0;s<e[0].data.length;++s){const d={};for(let u=0;u<o;++u){const p=t[u].toString(),h=e[u].data[s],f=e[u].type;Am(e[u].absent,s)?d[p]=void 0:Ed(h,f)||h===null?d[p]=null:d[p]=yp(h,f)}d.id=(r++).toString(),i.push(d)}return i}const TE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function EE(t,e,r,o){const i=await t.getSpec(e),s=[...i.keys()].filter(k=>!Qe.find(r,D=>Qe.isEqual(D.axis,i[k].id)||Qe.isEqual(D.column,i[k].id))),d=Qe.cloneDeep(s),u=mE(i,s);for(let k=s.length-1;k>=0;--k){const D=s[k];if(!TE(i[D]))continue;const E=Ol(i[D].spec.axesSpec)[0],A=Qe.findIndex(s,w=>Qe.isEqual(i[w].id,E));if(A!==-1){s[A]=D;for(const w of u)w.axisIdx===D&&(w.axisIdx=A);s.splice(k,1),d.splice(k,1)}}const p=await t.getShape(e),h=p.rows,f=d.map(k=>xE(k,i[k],o));if(u.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",u.length," transposition will not be applied."),u.length===1)return vE(u,p,f,await t.getData(e,s),d,s);let y;return{rowModelType:"serverSide",columnDefs:f,serverSideDatasource:{getRows:async k=>{try{if(h==0){k.success({rowData:[],rowCount:h}),k.api.showNoRowsOverlay(),k.api.setGridOption("loading",!1);return}if(y&&!Qe.isEqual(y.request.sortModel,k.request.sortModel)){y=void 0,k.fail(),k.api.setGridOption("loading",!0);return}y=k;let D=0,E=[];if(h>0&&k.request.startRow!==void 0&&k.request.endRow!==void 0&&(D=Math.min(h,k.request.endRow)-k.request.startRow,D>0)){const A=await t.getData(e,s,{offset:k.request.startRow,length:D});E=SE(d,A,k.request.startRow)}k.success({rowData:E,rowCount:h}),k.api.autoSizeAllColumns(),k.api.setGridOption("loading",!1)}catch{k.fail(),k.api.setGridOption("loading",!0)}}}}}const NE={class:"ap-ag-data-table-container"},AE={key:0,class:"ap-ag-data-table-sheets"},ME=As(n.defineComponent({__name:"PlAgDataTable",props:n.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(t){C.ModuleRegistry.registerModules([Ja.ClientSideRowModelModule,dd.ClipboardModule,cd.ServerSideRowModelModule,ud.RangeSelectionModule,Ul,Yd]);const e=n.useModel(t,"modelValue"),r=t,{settings:o}=n.toRefs(r);n.watch(()=>o.value,async(w,L)=>{if(w.sourceType!=="pframe"||!w.pFrame||!w.join||L&&L.sourceType==="pframe"&&Qe.isEqual(w.pFrame,L.pFrame)&&Qe.isEqual(w.join,L.join))return;const R=window.platforma;if(!R)throw Error("platforma not set");const H=R.pFrameDriver;if(!H)throw Error("platforma.pFrameDriver not set");const G=await _E(H,w.pFrame,w.join),K=e.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=G,e.value=K});const i=wp(()=>o.value.sourceType,async w=>{var R;const L=o.value.sourceType;switch(L){case"pframe":{const H=window.platforma;if(!H)throw Error("platforma not set");const G=H.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");if(!o.value.pFrame)return[];const K=o.value.pFrame,U=(R=e.value.pTableParams)==null?void 0:R.join;return U?await kE(G,K,o.value.sheetAxes,U):[]}case"ptable":return o.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${L}`)}});function s(w){if(!(o.value.sourceType!=="ptable"&&o.value.sourceType!=="pframe"))return(w==null?void 0:w.sortModel.map(L=>({column:wE(L.colId),ascending:L.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const d=n.computed({get:()=>{const w=e.value;return{columnOrder:w.gridState.columnOrder,sort:w.gridState.sort,columnVisibility:w.gridState.columnVisibility}},set:w=>{const L=e.value,R=y.value.rowModelType==="clientSide"?void 0:s(w.sort);L.gridState.columnOrder=w.columnOrder,L.gridState.sort=w.sort,L.gridState.columnVisibility=w.columnVisibility,(o.value.sourceType==="ptable"||o.value.sourceType==="pframe")&&(L.pTableParams||(L.pTableParams={sorting:[],filters:[]}),L.pTableParams.sorting=R),e.value=L}}),u=w=>Po(w);function p(w){var L;if(!(o.value.sourceType!=="ptable"&&o.value.sourceType!=="pframe"))return((L=i.value)==null?void 0:L.map(R=>({type:"bySingleColumn",column:R.column?{type:"column",id:R.column}:{type:"axis",id:R.axis},predicate:{operator:"Equal",reference:w[u(R.axis)]}})))??[]}const h=n.computed({get:()=>e.value.gridState.sheets??{},set:w=>{const L=p(w),R=e.value;R.gridState.sheets=w,(o.value.sourceType==="ptable"||o.value.sourceType==="pframe")&&(R.pTableParams||(R.pTableParams={sorting:[],filters:[]}),R.pTableParams.filters=L),e.value=R}});n.watch(()=>[o.value,i.value],(w,L)=>{const[R,H]=w;if(!H)return;if(L){const[K,U]=L;if((R.sourceType==="ptable"||R.sourceType==="pframe")&&R.sourceType===(K==null?void 0:K.sourceType)&&Qe.isEqual(H,U))return}if(R.sourceType!=="ptable"&&R.sourceType!=="pframe"){h.value={};return}const G=h.value;for(const K of H){const U=u(K.axis);G[U]||(G[U]=K.defaultValue??K.options[0].value)}h.value=G},{immediate:!0});const f=n.shallowRef(),y=n.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:d.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:w=>{w.api.autoSizeAllColumns()},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:w=>w.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:hp,noRowsOverlayComponent:fp,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),S=w=>{const L=w.api;f.value=new Proxy(L,{get(R,H,G){switch(H){case"setGridOption":return(K,U)=>{const P=y.value;P[K]=U,y.value=P,L.updateGridOptions(P)};case"updateGridOptions":return K=>{y.value={...y.value,...K},L.updateGridOptions(K)};default:return Reflect.get(R,H,G)}}})},k=w=>{d.value={columnOrder:w.state.columnOrder,sort:w.state.sort,columnVisibility:w.state.columnVisibility??(w.state.columnOrder?{hiddenColIds:[]}:void 0)},y.value.initialState=d.value},D=()=>{const w=f.value.getState();d.value={columnOrder:w.columnOrder,sort:w.sort,columnVisibility:w.columnVisibility??(w.columnOrder?{hiddenColIds:[]}:void 0)},y.value.initialState=d.value,f.value=void 0},E=n.ref(0);n.watch(()=>[f.value,d.value],(w,L)=>{if(Qe.isEqual(w,L))return;const[R,H]=w;if(!R)return;const G=R.getState(),K={columnOrder:G.columnOrder,sort:G.sort,columnVisibility:G.columnVisibility??(G.columnOrder?{hiddenColIds:[]}:void 0)};Qe.isEqual(H,K)||(y.value.initialState=H,++E.value)}),n.watch(()=>y.value,(w,L)=>{L&&w.rowModelType!=L.rowModelType&&++E.value});const A=(w,L)=>{var H;const R=h.value;R[w]!==L&&(R[w]=L,h.value=R,(H=f.value)==null||H.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return n.watch(()=>[f.value,o.value,i.value],async(w,L)=>{var P,W;if(Qe.isEqual(w,L))return;const[R,H,G]=w;if(!R)return;const K=window.platforma;if(!K)throw Error("platforma not set");const U=H.sourceType;switch(U){case"pframe":case"ptable":{const F=K.pFrameDriver;if(!F)throw Error("platforma.pFrameDriver not set");const Y=H.pTable;if(!Y||!G)return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ue=(W=(P=d.value)==null?void 0:P.columnVisibility)==null?void 0:W.hiddenColIds,j=await EE(F,Y,G,ue);return R.updateGridOptions({loading:j.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...j})}case"xsv":{const F=K.blobDriver;if(!F)throw Error("platforma.blobDriver not set");const Y=H.xsvFile;if(!(Y!=null&&Y.ok)||!Y.value)return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ue=await hE(F,Y.value);return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ue})}default:throw Error(`unsupported source type: ${U}`)}}),(w,L)=>(n.openBlock(),n.createElementBlock("div",NE,[n.createVNode(n.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:n.withCtx(()=>[n.unref(i).value&&n.unref(i).value.length>0?(n.openBlock(),n.createElementBlock("div",AE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i).value,(R,H)=>(n.openBlock(),n.createBlock(n.unref(Wu),{key:H,"model-value":h.value[u(R.axis)],options:R.options,"onUpdate:modelValue":G=>A(u(R.axis),G)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):n.createCommentVNode("",!0)]),_:1}),(n.openBlock(),n.createBlock(n.unref(hf.AgGridVue),{key:E.value,theme:n.unref(uu),class:"ap-ag-data-table-grid","grid-options":y.value,onGridReady:S,onStateUpdated:k,onGridPreDestroyed:D},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-93a0f82c"]]),BE={key:1,class:"alert-error"},PE={key:2},DE=n.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,r=n.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=n.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),i=n.computed(()=>r.value===void 0&&o.value===void 0);return(s,d)=>(n.openBlock(),n.createElementBlock("div",null,[r.value!==void 0?n.renderSlot(s.$slots,"default",n.normalizeProps(n.mergeProps({key:0},{value:r.value}))):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("div",BE,n.toDisplayString(o.value),1)):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createElementBlock("div",PE,"Unresolved")):n.createCommentVNode("",!0)]))}}),VE={style:{height:"100%"}},LE=n.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,r=n.computed(()=>e.params.extensions),o=n.computed(()=>e.params.value);function i(d){e.params.setValue(d)}const s=n.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(d,u)=>(n.openBlock(),n.createElementBlock("div",VE,[n.createVNode(n.unref(cp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${r.value?r.value[0]:""}`,extensions:r.value,"model-value":o.value,progress:s.value,"onUpdate:modelValue":i},null,8,["placeholder","extensions","model-value","progress"])]))}}),Ti=new Map;function IE(t,e){const r=n.getCurrentScope()??n.effectScope(),o=r.run(()=>(n.onScopeDispose(()=>{Ti.delete(t)}),n.reactive(e())));return o[Symbol.dispose]=()=>{r.stop()},o}function FE(t){const e=Symbol();return()=>(Ti.has(e)||Ti.set(e,IE(e,t)),Ti.get(e))}function RE(t){return n.computed(()=>{try{return gd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function wp(t,e,r){const o=n.ref(0),i=n.reactive({loading:n.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),s=vf(e);return n.watch(t,async d=>{i.error=void 0,o.value++,s(d).then(u=>{u.ok&&(i.value=u.value)}).catch(u=>{i.value=void 0,i.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},r??{})),i}const co=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xp=new Set,Ms=typeof process=="object"&&process?process:{},Cp=(t,e,r,o)=>{typeof Ms.emitWarning=="function"?Ms.emitWarning(t,e,r,o):console.error(`[${r}] ${e}: ${t}`)};let Ei=globalThis.AbortController,_p=globalThis.AbortSignal;if(typeof Ei>"u"){_p=class{constructor(){ze(this,"onabort");ze(this,"_onabort",[]);ze(this,"reason");ze(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},Ei=class{constructor(){ze(this,"signal",new _p);e()}abort(o){var i,s;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const d of this.signal._onabort)d(o);(s=(i=this.signal).onabort)==null||s.call(i,o)}}};let t=((Sp=Ms.env)==null?void 0:Sp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Cp("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const OE=t=>!xp.has(t),gn=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),kp=t=>gn(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ni:null:null;class Ni extends Array{constructor(e){super(e),this.fill(0)}}const Ln=class Ln{constructor(e,r){ze(this,"heap");ze(this,"length");if(!x(Ln,uo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=kp(e);if(!r)return[];ge(Ln,uo,!0);const o=new Ln(e,r);return ge(Ln,uo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};uo=new WeakMap,Re(Ln,uo,!1);let Bs=Ln;const Vs=class Vs{constructor(e){Re(this,ee);Re(this,sr);Re(this,It);Re(this,cr);Re(this,dr);Re(this,po);Re(this,go);ze(this,"ttl");ze(this,"ttlResolution");ze(this,"ttlAutopurge");ze(this,"updateAgeOnGet");ze(this,"updateAgeOnHas");ze(this,"allowStale");ze(this,"noDisposeOnSet");ze(this,"noUpdateTTL");ze(this,"maxEntrySize");ze(this,"sizeCalculation");ze(this,"noDeleteOnFetchRejection");ze(this,"noDeleteOnStaleGet");ze(this,"allowStaleOnFetchAbort");ze(this,"allowStaleOnFetchRejection");ze(this,"ignoreFetchAbort");Re(this,at);Re(this,ur);Re(this,nt);Re(this,$e);Re(this,xe);Re(this,Ct);Re(this,Ft);Re(this,vt);Re(this,ct);Re(this,pr);Re(this,dt);Re(this,gr);Re(this,hr);Re(this,Rt);Re(this,fr);Re(this,hn);Re(this,_t);Re(this,In,()=>{});Re(this,Fr,()=>{});Re(this,ka,()=>{});Re(this,Ot,()=>!1);Re(this,Fn,e=>{});Re(this,ho,(e,r,o)=>{});Re(this,Sa,(e,r,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});ze(this,Tp,"LRUCache");const{max:r=0,ttl:o,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:h,disposeAfter:f,noDisposeOnSet:y,noUpdateTTL:S,maxSize:k=0,maxEntrySize:D=0,sizeCalculation:E,fetchMethod:A,memoMethod:w,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:G,ignoreFetchAbort:K}=e;if(r!==0&&!gn(r))throw new TypeError("max option must be a nonnegative integer");const U=r?kp(r):Array;if(!U)throw new Error("invalid max value: "+r);if(ge(this,sr,r),ge(this,It,k),this.maxEntrySize=D||x(this,It),this.sizeCalculation=E,this.sizeCalculation){if(!x(this,It)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(ge(this,go,w),A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(ge(this,po,A),ge(this,hn,!!A),ge(this,nt,new Map),ge(this,$e,new Array(r).fill(void 0)),ge(this,xe,new Array(r).fill(void 0)),ge(this,Ct,new U(r)),ge(this,Ft,new U(r)),ge(this,vt,0),ge(this,ct,0),ge(this,pr,Bs.create(r)),ge(this,at,0),ge(this,ur,0),typeof h=="function"&&ge(this,cr,h),typeof f=="function"?(ge(this,dr,f),ge(this,dt,[])):(ge(this,dr,void 0),ge(this,dt,void 0)),ge(this,fr,!!x(this,cr)),ge(this,_t,!!x(this,dr)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!G,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(x(this,It)!==0&&!gn(x(this,It)))throw new TypeError("maxSize must be a positive integer if specified");if(!gn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,ee,sf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=gn(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=o||0,this.ttl){if(!gn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,ee,ad).call(this)}if(x(this,sr)===0&&this.ttl===0&&x(this,It)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!x(this,sr)&&!x(this,It)){const P="LRU_CACHE_UNBOUNDED";OE(P)&&(xp.add(P),Cp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,Vs))}}static unsafeExposeInternals(e){return{starts:x(e,hr),ttls:x(e,Rt),sizes:x(e,gr),keyMap:x(e,nt),keyList:x(e,$e),valList:x(e,xe),next:x(e,Ct),prev:x(e,Ft),get head(){return x(e,vt)},get tail(){return x(e,ct)},free:x(e,pr),isBackgroundFetch:r=>{var o;return le(o=e,ee,He).call(o,r)},backgroundFetch:(r,o,i,s)=>{var d;return le(d=e,ee,_l).call(d,r,o,i,s)},moveToTail:r=>{var o;return le(o=e,ee,Ya).call(o,r)},indexes:r=>{var o;return le(o=e,ee,kn).call(o,r)},rindexes:r=>{var o;return le(o=e,ee,Sn).call(o,r)},isStale:r=>{var o;return x(o=e,Ot).call(o,r)}}}get max(){return x(this,sr)}get maxSize(){return x(this,It)}get calculatedSize(){return x(this,ur)}get size(){return x(this,at)}get fetchMethod(){return x(this,po)}get memoMethod(){return x(this,go)}get dispose(){return x(this,cr)}get disposeAfter(){return x(this,dr)}getRemainingTTL(e){return x(this,nt).has(e)?1/0:0}*entries(){for(const e of le(this,ee,kn).call(this))x(this,xe)[e]!==void 0&&x(this,$e)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield[x(this,$e)[e],x(this,xe)[e]])}*rentries(){for(const e of le(this,ee,Sn).call(this))x(this,xe)[e]!==void 0&&x(this,$e)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield[x(this,$e)[e],x(this,xe)[e]])}*keys(){for(const e of le(this,ee,kn).call(this)){const r=x(this,$e)[e];r!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield r)}}*rkeys(){for(const e of le(this,ee,Sn).call(this)){const r=x(this,$e)[e];r!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield r)}}*values(){for(const e of le(this,ee,kn).call(this))x(this,xe)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield x(this,xe)[e])}*rvalues(){for(const e of le(this,ee,Sn).call(this))x(this,xe)[e]!==void 0&&!le(this,ee,He).call(this,x(this,xe)[e])&&(yield x(this,xe)[e])}[(Ep=Symbol.iterator,Tp=Symbol.toStringTag,Ep)](){return this.entries()}find(e,r={}){for(const o of le(this,ee,kn).call(this)){const i=x(this,xe)[o],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,x(this,$e)[o],this))return this.get(x(this,$e)[o],r)}}forEach(e,r=this){for(const o of le(this,ee,kn).call(this)){const i=x(this,xe)[o],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,x(this,$e)[o],this)}}rforEach(e,r=this){for(const o of le(this,ee,Sn).call(this)){const i=x(this,xe)[o],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,x(this,$e)[o],this)}}purgeStale(){let e=!1;for(const r of le(this,ee,Sn).call(this,{allowStale:!0}))x(this,Ot).call(this,r)&&(le(this,ee,Tn).call(this,x(this,$e)[r],"expire"),e=!0);return e}info(e){const r=x(this,nt).get(e);if(r===void 0)return;const o=x(this,xe)[r],i=le(this,ee,He).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const s={value:i};if(x(this,Rt)&&x(this,hr)){const d=x(this,Rt)[r],u=x(this,hr)[r];if(d&&u){const p=d-(co.now()-u);s.ttl=p,s.start=Date.now()}}return x(this,gr)&&(s.size=x(this,gr)[r]),s}dump(){const e=[];for(const r of le(this,ee,kn).call(this,{allowStale:!0})){const o=x(this,$e)[r],i=x(this,xe)[r],s=le(this,ee,He).call(this,i)?i.__staleWhileFetching:i;if(s===void 0||o===void 0)continue;const d={value:s};if(x(this,Rt)&&x(this,hr)){d.ttl=x(this,Rt)[r];const u=co.now()-x(this,hr)[r];d.start=Math.floor(Date.now()-u)}x(this,gr)&&(d.size=x(this,gr)[r]),e.unshift([o,d])}return e}load(e){this.clear();for(const[r,o]of e){if(o.start){const i=Date.now()-o.start;o.start=co.now()-i}this.set(r,o.value,o)}}set(e,r,o={}){var S,k,D,E,A;if(r===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:s,noDisposeOnSet:d=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const f=x(this,Sa).call(this,e,r,o.size||0,u);if(this.maxEntrySize&&f>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),le(this,ee,Tn).call(this,e,"set"),this;let y=x(this,at)===0?void 0:x(this,nt).get(e);if(y===void 0)y=x(this,at)===0?x(this,ct):x(this,pr).length!==0?x(this,pr).pop():x(this,at)===x(this,sr)?le(this,ee,Cl).call(this,!1):x(this,at),x(this,$e)[y]=e,x(this,xe)[y]=r,x(this,nt).set(e,y),x(this,Ct)[x(this,ct)]=y,x(this,Ft)[y]=x(this,ct),ge(this,ct,y),xl(this,at)._++,x(this,ho).call(this,y,f,p),p&&(p.set="add"),h=!1;else{le(this,ee,Ya).call(this,y);const w=x(this,xe)[y];if(r!==w){if(x(this,hn)&&le(this,ee,He).call(this,w)){w.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:L}=w;L!==void 0&&!d&&(x(this,fr)&&((S=x(this,cr))==null||S.call(this,L,e,"set")),x(this,_t)&&((k=x(this,dt))==null||k.push([L,e,"set"])))}else d||(x(this,fr)&&((D=x(this,cr))==null||D.call(this,w,e,"set")),x(this,_t)&&((E=x(this,dt))==null||E.push([w,e,"set"])));if(x(this,Fn).call(this,y),x(this,ho).call(this,y,f,p),x(this,xe)[y]=r,p){p.set="replace";const L=w&&le(this,ee,He).call(this,w)?w.__staleWhileFetching:w;L!==void 0&&(p.oldValue=L)}}else p&&(p.set="update")}if(i!==0&&!x(this,Rt)&&le(this,ee,ad).call(this),x(this,Rt)&&(h||x(this,ka).call(this,y,i,s),p&&x(this,Fr).call(this,p,y)),!d&&x(this,_t)&&x(this,dt)){const w=x(this,dt);let L;for(;L=w==null?void 0:w.shift();)(A=x(this,dr))==null||A.call(this,...L)}return this}pop(){var e;try{for(;x(this,at);){const r=x(this,xe)[x(this,vt)];if(le(this,ee,Cl).call(this,!0),le(this,ee,He).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(x(this,_t)&&x(this,dt)){const r=x(this,dt);let o;for(;o=r==null?void 0:r.shift();)(e=x(this,dr))==null||e.call(this,...o)}}}has(e,r={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=r,s=x(this,nt).get(e);if(s!==void 0){const d=x(this,xe)[s];if(le(this,ee,He).call(this,d)&&d.__staleWhileFetching===void 0)return!1;if(x(this,Ot).call(this,s))i&&(i.has="stale",x(this,Fr).call(this,i,s));else return o&&x(this,In).call(this,s),i&&(i.has="hit",x(this,Fr).call(this,i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){const{allowStale:o=this.allowStale}=r,i=x(this,nt).get(e);if(i===void 0||!o&&x(this,Ot).call(this,i))return;const s=x(this,xe)[i];return le(this,ee,He).call(this,s)?s.__staleWhileFetching:s}async fetch(e,r={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:d=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:k=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,context:E,forceRefresh:A=!1,status:w,signal:L}=r;if(!x(this,hn))return w&&(w.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});const R={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:D,ignoreFetchAbort:k,status:w,signal:L};let H=x(this,nt).get(e);if(H===void 0){w&&(w.fetch="miss");const G=le(this,ee,_l).call(this,e,H,R,E);return G.__returned=G}else{const G=x(this,xe)[H];if(le(this,ee,He).call(this,G)){const F=o&&G.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",F&&(w.returnedStale=!0)),F?G.__staleWhileFetching:G.__returned=G}const K=x(this,Ot).call(this,H);if(!A&&!K)return w&&(w.fetch="hit"),le(this,ee,Ya).call(this,H),i&&x(this,In).call(this,H),w&&x(this,Fr).call(this,w,H),G;const U=le(this,ee,_l).call(this,e,H,R,E),W=U.__staleWhileFetching!==void 0&&o;return w&&(w.fetch=K?"stale":"refresh",W&&K&&(w.returnedStale=!0)),W?U.__staleWhileFetching:U.__returned=U}}async forceFetch(e,r={}){const o=await this.fetch(e,r);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,r={}){const o=x(this,go);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:s,...d}=r,u=this.get(e,d);if(!s&&u!==void 0)return u;const p=o(e,u,{options:d,context:i});return this.set(e,p,d),p}get(e,r={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:d}=r,u=x(this,nt).get(e);if(u!==void 0){const p=x(this,xe)[u],h=le(this,ee,He).call(this,p);return d&&x(this,Fr).call(this,d,u),x(this,Ot).call(this,u)?(d&&(d.get="stale"),h?(d&&o&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),o?p.__staleWhileFetching:void 0):(s||le(this,ee,Tn).call(this,e,"expire"),d&&o&&(d.returnedStale=!0),o?p:void 0)):(d&&(d.get="hit"),h?p.__staleWhileFetching:(le(this,ee,Ya).call(this,u),i&&x(this,In).call(this,u),p))}else d&&(d.get="miss")}delete(e){return le(this,ee,Tn).call(this,e,"delete")}clear(){return le(this,ee,sd).call(this,"delete")}};sr=new WeakMap,It=new WeakMap,cr=new WeakMap,dr=new WeakMap,po=new WeakMap,go=new WeakMap,at=new WeakMap,ur=new WeakMap,nt=new WeakMap,$e=new WeakMap,xe=new WeakMap,Ct=new WeakMap,Ft=new WeakMap,vt=new WeakMap,ct=new WeakMap,pr=new WeakMap,dt=new WeakMap,gr=new WeakMap,hr=new WeakMap,Rt=new WeakMap,fr=new WeakMap,hn=new WeakMap,_t=new WeakMap,ee=new WeakSet,ad=function(){const e=new Ni(x(this,sr)),r=new Ni(x(this,sr));ge(this,Rt,e),ge(this,hr,r),ge(this,ka,(s,d,u=co.now())=>{if(r[s]=d!==0?u:0,e[s]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{x(this,Ot).call(this,s)&&le(this,ee,Tn).call(this,x(this,$e)[s],"expire")},d+1);p.unref&&p.unref()}}),ge(this,In,s=>{r[s]=e[s]!==0?co.now():0}),ge(this,Fr,(s,d)=>{if(e[d]){const u=e[d],p=r[d];if(!u||!p)return;s.ttl=u,s.start=p,s.now=o||i();const h=s.now-p;s.remainingTTL=u-h}});let o=0;const i=()=>{const s=co.now();if(this.ttlResolution>0){o=s;const d=setTimeout(()=>o=0,this.ttlResolution);d.unref&&d.unref()}return s};this.getRemainingTTL=s=>{const d=x(this,nt).get(s);if(d===void 0)return 0;const u=e[d],p=r[d];if(!u||!p)return 1/0;const h=(o||i())-p;return u-h},ge(this,Ot,s=>{const d=r[s],u=e[s];return!!u&&!!d&&(o||i())-d>u})},In=new WeakMap,Fr=new WeakMap,ka=new WeakMap,Ot=new WeakMap,sf=function(){const e=new Ni(x(this,sr));ge(this,ur,0),ge(this,gr,e),ge(this,Fn,r=>{ge(this,ur,x(this,ur)-e[r]),e[r]=0}),ge(this,Sa,(r,o,i,s)=>{if(le(this,ee,He).call(this,o))return 0;if(!gn(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(o,r),!gn(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ge(this,ho,(r,o,i)=>{if(e[r]=o,x(this,It)){const s=x(this,It)-e[r];for(;x(this,ur)>s;)le(this,ee,Cl).call(this,!0)}ge(this,ur,x(this,ur)+e[r]),i&&(i.entrySize=o,i.totalCalculatedSize=x(this,ur))})},Fn=new WeakMap,ho=new WeakMap,Sa=new WeakMap,kn=function*({allowStale:e=this.allowStale}={}){if(x(this,at))for(let r=x(this,ct);!(!le(this,ee,id).call(this,r)||((e||!x(this,Ot).call(this,r))&&(yield r),r===x(this,vt)));)r=x(this,Ft)[r]},Sn=function*({allowStale:e=this.allowStale}={}){if(x(this,at))for(let r=x(this,vt);!(!le(this,ee,id).call(this,r)||((e||!x(this,Ot).call(this,r))&&(yield r),r===x(this,ct)));)r=x(this,Ct)[r]},id=function(e){return e!==void 0&&x(this,nt).get(x(this,$e)[e])===e},Cl=function(e){var s,d;const r=x(this,vt),o=x(this,$e)[r],i=x(this,xe)[r];return x(this,hn)&&le(this,ee,He).call(this,i)?i.__abortController.abort(new Error("evicted")):(x(this,fr)||x(this,_t))&&(x(this,fr)&&((s=x(this,cr))==null||s.call(this,i,o,"evict")),x(this,_t)&&((d=x(this,dt))==null||d.push([i,o,"evict"]))),x(this,Fn).call(this,r),e&&(x(this,$e)[r]=void 0,x(this,xe)[r]=void 0,x(this,pr).push(r)),x(this,at)===1?(ge(this,vt,ge(this,ct,0)),x(this,pr).length=0):ge(this,vt,x(this,Ct)[r]),x(this,nt).delete(o),xl(this,at)._--,r},_l=function(e,r,o,i){const s=r===void 0?void 0:x(this,xe)[r];if(le(this,ee,He).call(this,s))return s;const d=new Ei,{signal:u}=o;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:o,context:i},h=(E,A=!1)=>{const{aborted:w}=d.signal,L=o.ignoreFetchAbort&&E!==void 0;if(o.status&&(w&&!A?(o.status.fetchAborted=!0,o.status.fetchError=d.signal.reason,L&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),w&&!L&&!A)return y(d.signal.reason);const R=k;return x(this,xe)[r]===k&&(E===void 0?R.__staleWhileFetching?x(this,xe)[r]=R.__staleWhileFetching:le(this,ee,Tn).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,E,p.options))),E},f=E=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=E),y(E)),y=E=>{const{aborted:A}=d.signal,w=A&&o.allowStaleOnFetchAbort,L=w||o.allowStaleOnFetchRejection,R=L||o.noDeleteOnFetchRejection,H=k;if(x(this,xe)[r]===k&&(!R||H.__staleWhileFetching===void 0?le(this,ee,Tn).call(this,e,"fetch"):w||(x(this,xe)[r]=H.__staleWhileFetching)),L)return o.status&&H.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),H.__staleWhileFetching;if(H.__returned===H)throw E},S=(E,A)=>{var L;const w=(L=x(this,po))==null?void 0:L.call(this,e,s,p);w&&w instanceof Promise&&w.then(R=>E(R===void 0?void 0:R),A),d.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(E(void 0),o.allowStaleOnFetchAbort&&(E=R=>h(R,!0)))})};o.status&&(o.status.fetchDispatched=!0);const k=new Promise(S).then(h,f),D=Object.assign(k,{__abortController:d,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,D,{...p.options,status:void 0}),r=x(this,nt).get(e)):x(this,xe)[r]=D,D},He=function(e){if(!x(this,hn))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ei},ld=function(e,r){x(this,Ft)[r]=e,x(this,Ct)[e]=r},Ya=function(e){e!==x(this,ct)&&(e===x(this,vt)?ge(this,vt,x(this,Ct)[e]):le(this,ee,ld).call(this,x(this,Ft)[e],x(this,Ct)[e]),le(this,ee,ld).call(this,x(this,ct),e),ge(this,ct,e))},Tn=function(e,r){var i,s,d,u;let o=!1;if(x(this,at)!==0){const p=x(this,nt).get(e);if(p!==void 0)if(o=!0,x(this,at)===1)le(this,ee,sd).call(this,r);else{x(this,Fn).call(this,p);const h=x(this,xe)[p];if(le(this,ee,He).call(this,h)?h.__abortController.abort(new Error("deleted")):(x(this,fr)||x(this,_t))&&(x(this,fr)&&((i=x(this,cr))==null||i.call(this,h,e,r)),x(this,_t)&&((s=x(this,dt))==null||s.push([h,e,r]))),x(this,nt).delete(e),x(this,$e)[p]=void 0,x(this,xe)[p]=void 0,p===x(this,ct))ge(this,ct,x(this,Ft)[p]);else if(p===x(this,vt))ge(this,vt,x(this,Ct)[p]);else{const f=x(this,Ft)[p];x(this,Ct)[f]=x(this,Ct)[p];const y=x(this,Ct)[p];x(this,Ft)[y]=x(this,Ft)[p]}xl(this,at)._--,x(this,pr).push(p)}}if(x(this,_t)&&((d=x(this,dt))!=null&&d.length)){const p=x(this,dt);let h;for(;h=p==null?void 0:p.shift();)(u=x(this,dr))==null||u.call(this,...h)}return o},sd=function(e){var r,o,i;for(const s of le(this,ee,Sn).call(this,{allowStale:!0})){const d=x(this,xe)[s];if(le(this,ee,He).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=x(this,$e)[s];x(this,fr)&&((r=x(this,cr))==null||r.call(this,d,u,e)),x(this,_t)&&((o=x(this,dt))==null||o.push([d,u,e]))}}if(x(this,nt).clear(),x(this,xe).fill(void 0),x(this,$e).fill(void 0),x(this,Rt)&&x(this,hr)&&(x(this,Rt).fill(0),x(this,hr).fill(0)),x(this,gr)&&x(this,gr).fill(0),ge(this,vt,0),ge(this,ct,0),x(this,pr).length=0,ge(this,ur,0),ge(this,at,0),x(this,_t)&&x(this,dt)){const s=x(this,dt);let d;for(;d=s==null?void 0:s.shift();)(i=x(this,dr))==null||i.call(this,...d)}};let Ps=Vs;const zE={cacheSize:15e6};class GE{constructor(e){ze(this,"_str");ze(this,"_rawJson");ze(this,"_zodSchema");ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Rn=class Rn{constructor(e){ze(this,"fileDataCache");ze(this,"fileDataRefs",new Map);const r={...zE,...e??{}};this.fileDataCache=new Ps({maxSize:r.cacheSize,fetchMethod:async o=>new GE(await Bm().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}getDataRef(e){const r=this.fileDataRefs.get(e);if(r!==void 0)return r;const o=n.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),o}getContentBytes(e){if(e===void 0)return;const r=this.getDataRef(e);return n.computed(()=>{var o;return(o=r.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const r=this.getDataRef(e);return n.computed(()=>{var o;return(o=r==null?void 0:r.value)==null?void 0:o.str})}getContentJson(e,r){if(e===void 0)return;const o=this.getDataRef(e);return n.computed(()=>{var i,s;return r===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(s=o==null?void 0:o.value)==null?void 0:s.validatedJson(r)})}static getContentBytes(e){return Rn.globalInstance.getContentBytes(e)}static getContentString(e){return Rn.globalInstance.getContentString(e)}static getContentJson(e,r){return Rn.globalInstance.getContentJson(e,r)}};ze(Rn,"globalInstance",new Rn);let Ds=Rn;V.AgGridTheme=uu,V.BlockLayout=cE,V.ContextProvider=H1,V.DataTable=Mw,V.DemoData=KT,V.DropdownListItem=aa,V.LongText=vs,V.MultiError=Tl,V.PlAgCellFile=LE,V.PlAgDataTable=ME,V.PlAgOverlayLoading=hp,V.PlAgOverlayNoRows=fp,V.PlAlert=l0,V.PlBlockPage=Hw,V.PlBtnAccent=p0,V.PlBtnDanger=h0,V.PlBtnGhost=us,V.PlBtnGroup=I0,V.PlBtnLink=y0,V.PlBtnPrimary=cs,V.PlBtnSecondary=ds,V.PlCheckbox=IC,V.PlCheckboxGroup=zC,V.PlChip=bs,V.PlContainer=Kw,V.PlCopyData=up,V.PlDialogModal=xs,V.PlDropdown=ys,V.PlDropdownLegacy=lC,V.PlDropdownLine=Wu,V.PlDropdownMulti=VC,V.PlDropdownRef=Ix,V.PlFileDialog=qu,V.PlFileInput=cp,V.PlGrid=t0,V.PlIcon16=hi,V.PlIcon24=Gu,V.PlLogView=f_,V.PlMaskIcon16=ta,V.PlMaskIcon24=Lr,V.PlNotificationAlert=dp,V.PlNumberField=bC,V.PlProgressBar=pC,V.PlRow=Jw,V.PlSlideModal=e_,V.PlSpacer=Vu,V.PlTextArea=gx,V.PlTextField=ju,V.PlToggleSwitch=n_,V.PlTooltip=Vt,V.ReactiveFileContent=Ds,V.Scrollable=Rk,V.Slider=ok,V.SliderRange=Vk,V.SliderRangeTriple=Ck,V.ThemeSwitcher=zw,V.UnresolvedError=Sl,V.ValueOrErrorsComponent=DE,V.activateAgGrid=du,V.animate=Nu,V.animateInfinite=Lw,V.call=_u,V.computedResult=RE,V.createModel=Pl,V.debounce=Au,V.defineApp=ab,V.defineStore=FE,V.delay=ku,V.detectOutside=hx,V.ensureError=Al,V.eventListener=fs,V.formatZodError=Bl,V.getElementScrollPosition=Zu,V.identity=Nl,V.isDefined=Cf,V.isElementVisible=Uu,V.isJsonEqual=El,V.isZodError=Ml,V.listToOptions=Iw,V.makeEaseInOut=Vw,V.makeEaseOut=Eu,V.maskIcons16=HT,V.maskIcons24=qT,V.normalizeListOptions=Bn,V.notEmpty=os,V.randomInt=Tu,V.randomString=Dw,V.requestTick=as,V.scrollIntoView=oa,V.showContextMenu=ts,V.throttle=Mu,V.timeout=Su,V.unwrapOptionalResult=xf,V.unwrapValueOrErrors=pd,V.useClickOutside=gi,V.useDraggable=uk,V.useEventListener=et,V.useFormState=ck,V.useHover=xu,V.useInterval=sk,V.useLabelNotch=Vr,V.useLocalStorage=Bu,V.useMouse=wu,V.useMouseCapture=nn,V.usePosition=ra,V.useQuery=dk,V.useResizeObserver=pp,V.useScroll=ak,V.useSdkPlugin=Jl,V.useSortable=lk,V.useTheme=Du,V.useWatchFetch=wp,V.wrapOptionalResult=gd,V.wrapValueOrErrors=wf,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|