@jsg-developer/vue-pack 0.0.7 → 0.0.9-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/THIRD_PARTY_LICENSES.json +2 -2
  2. package/dist/chunks/{ArrayObject-CGzlqVE4.cjs.js → ArrayObject-BA88O7bP.cjs.js} +1 -1
  3. package/dist/chunks/ArrayObject-DYnfWxW-.es.js +4 -0
  4. package/dist/chunks/ColorPicker-CqrPcGbi.es.js +4 -0
  5. package/dist/chunks/{ColorPicker-B-7lnPz_.cjs.js → ColorPicker-W_cn5ezl.cjs.js} +1 -1
  6. package/dist/chunks/ComboboxComponent-BU-VQz2u.es.js +4 -0
  7. package/dist/chunks/{ComboboxComponent-6WfHYEwL.cjs.js → ComboboxComponent-Dwlhjcru.cjs.js} +1 -1
  8. package/dist/chunks/{CurrencyInput-Dzho-dGX.cjs.js → CurrencyInput-CNQzGqgu.cjs.js} +1 -1
  9. package/dist/chunks/CurrencyInput-DVlgxmiu.es.js +4 -0
  10. package/dist/chunks/DateInput-B1EpMWa0.es.js +4 -0
  11. package/dist/chunks/{DateInput-G26GgCwa.cjs.js → DateInput-DMFCzQCr.cjs.js} +1 -1
  12. package/dist/chunks/{DateTimeInput-BDjAaSxl.cjs.js → DateTimeInput-8w4T-EZX.cjs.js} +1 -1
  13. package/dist/chunks/{DateTimeInput-DYcjPrwh.es.js → DateTimeInput-CC70bKnU.es.js} +1 -1
  14. package/dist/chunks/{DateTimeInput.vue_vue_type_script_setup_true_lang-DLvsYOFE.es.js → DateTimeInput.vue_vue_type_script_setup_true_lang-BLJgRk91.es.js} +1 -1
  15. package/dist/chunks/{DateTimeInput.vue_vue_type_script_setup_true_lang-CEMOLDbR.cjs.js → DateTimeInput.vue_vue_type_script_setup_true_lang-DmmVjDPV.cjs.js} +1 -1
  16. package/dist/chunks/EmailInput-B0F3AHeq.es.js +4 -0
  17. package/dist/chunks/{EmailInput-mVz5VWCr.cjs.js → EmailInput-EU4MR4Jw.cjs.js} +1 -1
  18. package/dist/chunks/{FileArrayInput-sF9cSGx6.cjs.js → FileArrayInput-CR-seczb.cjs.js} +1 -1
  19. package/dist/chunks/{FileArrayInput-C5drCF6p.es.js → FileArrayInput-DljGrRxA.es.js} +2 -2
  20. package/dist/chunks/{FileArrayInput.vue_vue_type_script_setup_true_lang-BC-fFxew.es.js → FileArrayInput.vue_vue_type_script_setup_true_lang-C7UCpQqG.es.js} +1 -1
  21. package/dist/chunks/{FileArrayInput.vue_vue_type_script_setup_true_lang-C1s1YDCy.cjs.js → FileArrayInput.vue_vue_type_script_setup_true_lang-DtC-rygi.cjs.js} +1 -1
  22. package/dist/chunks/{FileInput-skfda07B.cjs.js → FileInput-A1qH_OLh.cjs.js} +1 -1
  23. package/dist/chunks/FileInput-CC5a2_o2.es.js +4 -0
  24. package/dist/chunks/{GroupRenderer-BvBpL8Bq.cjs.js → GroupRenderer-BL1UiQs5.cjs.js} +1 -1
  25. package/dist/chunks/GroupRenderer-Cj7o8pSh.es.js +4 -0
  26. package/dist/chunks/{ImageArrayInput-Cn1-cDwf.cjs.js → ImageArrayInput-B3f9I0U1.cjs.js} +1 -1
  27. package/dist/chunks/{ImageArrayInput-CbJzqdrg.es.js → ImageArrayInput-Bl0af1_X.es.js} +2 -2
  28. package/dist/chunks/ImageArrayInput.vue_vue_type_script_setup_true_lang-NqHOY8OF.es.js +421 -0
  29. package/dist/chunks/ImageArrayInput.vue_vue_type_script_setup_true_lang-d88H9xj4.cjs.js +2 -0
  30. package/dist/chunks/ImageInput-DL8tNIdV.es.js +4 -0
  31. package/dist/chunks/{ImageInput-BtNhmF5M.cjs.js → ImageInput-KmSPSWhK.cjs.js} +1 -1
  32. package/dist/chunks/NumberInput-BOjP2XCy.es.js +4 -0
  33. package/dist/chunks/{NumberInput-BMznnD_p.cjs.js → NumberInput-C47NQmuA.cjs.js} +1 -1
  34. package/dist/chunks/ObjectInput-DLkhG2Ha.es.js +4 -0
  35. package/dist/chunks/{ObjectInput-BEGBttyq.cjs.js → ObjectInput-e0FX9gIv.cjs.js} +1 -1
  36. package/dist/chunks/{PasswordInput-DVnZLrab.cjs.js → PasswordInput-CgeIq4tr.cjs.js} +1 -1
  37. package/dist/chunks/PasswordInput-CkF4phav.es.js +4 -0
  38. package/dist/chunks/{RateInput-hNeff8s7.cjs.js → RateInput-C7irYBQy.cjs.js} +1 -1
  39. package/dist/chunks/RateInput-DYD5aMQX.es.js +4 -0
  40. package/dist/chunks/TabelData-DV56gH8Y.cjs.js +1 -0
  41. package/dist/chunks/{TabelData-Dz9sLYJR.es.js → TabelData-jJvzQD8f.es.js} +8 -7
  42. package/dist/chunks/TagInput-B6F5GleV.es.js +4 -0
  43. package/dist/chunks/{TagInput-D7Jt9ghP.cjs.js → TagInput-DC9jPCR9.cjs.js} +1 -1
  44. package/dist/chunks/{TelInput-DPwx7ozA.cjs.js → TelInput-BTioT0Aa.cjs.js} +1 -1
  45. package/dist/chunks/TelInput-BwtzcLzw.es.js +4 -0
  46. package/dist/chunks/TextAreaInput-B-dcc-ch.es.js +4 -0
  47. package/dist/chunks/{TextAreaInput-Bm1U-giD.cjs.js → TextAreaInput-BXlGB91c.cjs.js} +1 -1
  48. package/dist/chunks/{TextAreaQuill-PSKHjt67.es.js → TextAreaQuill-CJyF1I1R.es.js} +241 -204
  49. package/dist/chunks/TextAreaQuill-DKgdqbEG.cjs.js +1 -0
  50. package/dist/chunks/TextInput-BwgTx7Xt.es.js +4 -0
  51. package/dist/chunks/{TextInput-BePpVfyt.cjs.js → TextInput-CC8TbO0N.cjs.js} +1 -1
  52. package/dist/chunks/{TimeInput-Bz62wZi1.cjs.js → TimeInput-BvUbIEtA.cjs.js} +1 -1
  53. package/dist/chunks/TimeInput-DsiHBSIo.es.js +4 -0
  54. package/dist/chunks/{ToggleInput-Dp4Lv_6z.cjs.js → ToggleInput-DfAKsRdZ.cjs.js} +1 -1
  55. package/dist/chunks/ToggleInput-mQ_mnG4E.es.js +4 -0
  56. package/dist/chunks/{UrlInput-ClHoXv2k.cjs.js → UrlInput-C8bIoQBb.cjs.js} +1 -1
  57. package/dist/chunks/UrlInput-o1uJulwN.es.js +4 -0
  58. package/dist/chunks/{resize-DjoINfaT.es.js → resize-2N3sqejU.es.js} +2440 -2375
  59. package/dist/chunks/resize-DsxsWx52.cjs.js +12 -0
  60. package/dist/init.cjs.js +1 -1
  61. package/dist/init.es.js +1 -1
  62. package/dist/jsgd-vue-pack.cjs.js +1 -1
  63. package/dist/jsgd-vue-pack.es.js +104 -109
  64. package/dist/style.css +1 -1
  65. package/dist/types/components/Form/composables/useFormModal.d.ts +1 -9
  66. package/dist/types/components/UI/Inputs/ImageInput.vue.d.ts +3 -1
  67. package/dist/types/configs/types/field.types.d.ts +15 -28
  68. package/dist/types/configs/types/index.d.ts +1 -0
  69. package/dist/types/configs/types/props.types.d.ts +28 -6
  70. package/dist/types/configs/types/seo.types.d.ts +37 -0
  71. package/dist/types/untils/index.d.ts +1 -0
  72. package/dist/types/untils/seo.d.ts +4 -0
  73. package/dist/vue.cjs.js +1 -1
  74. package/dist/vue.es.js +6 -6
  75. package/package.json +2 -2
  76. package/dist/chunks/ArrayObject-CC-LVTui.es.js +0 -4
  77. package/dist/chunks/ColorPicker-DWajlDz5.es.js +0 -4
  78. package/dist/chunks/ComboboxComponent-RENQ1FXI.es.js +0 -4
  79. package/dist/chunks/CurrencyInput-CmGrI2Vy.es.js +0 -4
  80. package/dist/chunks/DateInput-J06kg5C-.es.js +0 -4
  81. package/dist/chunks/EmailInput-Did4kNYA.es.js +0 -4
  82. package/dist/chunks/FileInput-DEk9Pscj.es.js +0 -4
  83. package/dist/chunks/GroupRenderer-D_3hmVS4.es.js +0 -4
  84. package/dist/chunks/ImageArrayInput.vue_vue_type_script_setup_true_lang-BHfmeojG.cjs.js +0 -2
  85. package/dist/chunks/ImageArrayInput.vue_vue_type_script_setup_true_lang-EJntCDiU.es.js +0 -322
  86. package/dist/chunks/ImageInput-hwY64_P3.es.js +0 -4
  87. package/dist/chunks/NumberInput-0l-TANaP.es.js +0 -4
  88. package/dist/chunks/ObjectInput-DA7Hfck0.es.js +0 -4
  89. package/dist/chunks/PasswordInput-DxSoZlRM.es.js +0 -4
  90. package/dist/chunks/RateInput-LQcqAf2f.es.js +0 -4
  91. package/dist/chunks/TabelData-Ct-CexJm.cjs.js +0 -1
  92. package/dist/chunks/TagInput-Cc7wwjcX.es.js +0 -4
  93. package/dist/chunks/TelInput-DDqFalm6.es.js +0 -4
  94. package/dist/chunks/TextAreaInput-LkFerA8R.es.js +0 -4
  95. package/dist/chunks/TextAreaQuill-BUmElXSq.cjs.js +0 -1
  96. package/dist/chunks/TextInput-oBJKDYmM.es.js +0 -4
  97. package/dist/chunks/TimeInput-DrXYIRmu.es.js +0 -4
  98. package/dist/chunks/ToggleInput-7phZ6wcS.es.js +0 -4
  99. package/dist/chunks/UrlInput-YQFu4Cb3.es.js +0 -4
  100. package/dist/chunks/resize-B3p3dEqX.cjs.js +0 -12
@@ -47,7 +47,7 @@
47
47
  "path": "/home/jsgdev/Code/jsgd-vue-pack/node_modules/@jridgewell/sourcemap-codec",
48
48
  "licenseFile": "/home/jsgdev/Code/jsgd-vue-pack/node_modules/@jridgewell/sourcemap-codec/LICENSE"
49
49
  },
50
- "@jsg-developer/vue-pack@0.0.6": {
50
+ "@jsg-developer/vue-pack@0.0.9": {
51
51
  "licenses": "MIT",
52
52
  "path": ".",
53
53
  "licenseFile": "LICENSE"
@@ -237,7 +237,7 @@
237
237
  "path": "/home/jsgdev/Code/jsgd-vue-pack/node_modules/quill-delta",
238
238
  "licenseFile": "/home/jsgdev/Code/jsgd-vue-pack/node_modules/quill-delta/LICENSE"
239
239
  },
240
- "quill-resize-module@2.0.8": {
240
+ "quill-resize-module@2.1.0-beta.0": {
241
241
  "licenses": "MIT",
242
242
  "repository": "https://github.com/mudoo/quill-resize-module",
243
243
  "publisher": "mudoo",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$2;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$2;
@@ -0,0 +1,4 @@
1
+ import { b as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { c as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$3;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$3;
@@ -0,0 +1,4 @@
1
+ import { d as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$4;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$4;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$5;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$5;
@@ -0,0 +1,4 @@
1
+ import { e } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ e as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { g as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$7;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$7;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DateTimeInput.vue_vue_type_script_setup_true_lang-CEMOLDbR.cjs.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DateTimeInput.vue_vue_type_script_setup_true_lang-DmmVjDPV.cjs.js");exports.default=e._sfc_main;
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./DateTimeInput.vue_vue_type_script_setup_true_lang-DLvsYOFE.es.js";
1
+ import { _ as f } from "./DateTimeInput.vue_vue_type_script_setup_true_lang-BLJgRk91.es.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as _, inject as C, ref as v, computed as x, watch as N, createElementBlock as p, openBlock as u, createElementVNode as m, createCommentVNode as S, normalizeClass as T, createTextVNode as w, createBlock as B, toDisplayString as k, unref as F, withCtx as z, Fragment as L, renderList as O } from "vue";
2
- import { U as E, z as H, a9 as b, a as U } from "./resize-DjoINfaT.es.js";
2
+ import { U as E, z as H, aa as b, a as U } from "./resize-2N3sqejU.es.js";
3
3
  import "dompurify";
4
4
  import "lodash.isequal";
5
5
  import "zod";
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("vue"),g=require("./resize-B3p3dEqX.cjs.js");require("dompurify");require("lodash.isequal");require("zod");const T={class:"jsgd-w-full jsgd-relative jsgd-mb-4"},D=["for"],y={class:"jsgd-relative"},w=["id","value","disabled","min","max","placeholder"],V={key:0,class:"jsgd-text-sm jsgd-text-red-500 jsgd-mt-2 jsgd-animate-[fadeIn_300ms_ease-out] dark:jsgd-text-red-400"},M=e.defineComponent({__name:"DateTimeInput",props:{id:{type:String,default:()=>g.setUID()},label:{type:String,required:!0},placeholder:String,modelValue:{type:String,default:""},error:[String,Array],disabled:Boolean,validate:Object,lang:String,outputFormat:{type:String,default:"local-offset"}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:b}){const t=n,k=e.inject("TableComponents",{labels:e.ref(g.defaultTextLabelsMap[t.lang??"en"])}).labels,j=b;function f(s){if(!s)return"";if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(s))return s;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(s))return s.substring(0,16);try{const a=new Date(s);if(isNaN(a.getTime()))return"";const r=a.getFullYear(),d=(a.getMonth()+1).toString().padStart(2,"0"),i=a.getDate().toString().padStart(2,"0"),o=a.getHours().toString().padStart(2,"0"),l=a.getMinutes().toString().padStart(2,"0");return`${r}-${d}-${i}T${o}:${l}`}catch{return""}}const x=e.computed(()=>f(t.modelValue)),p=e.computed(()=>{if(t.validate){const s=t.validate,a=[];return s.minDateTime&&a.push(g.getMessage("dateTimeMin",{min:s.minDateTime},t.lang??"en")),s.maxDateTime&&a.push(g.getMessage("dateTimeMax",{max:s.maxDateTime},t.lang??"en")),a.join(`
1
+ "use strict";const e=require("vue"),g=require("./resize-DsxsWx52.cjs.js");require("dompurify");require("lodash.isequal");require("zod");const T={class:"jsgd-w-full jsgd-relative jsgd-mb-4"},D=["for"],y={class:"jsgd-relative"},w=["id","value","disabled","min","max","placeholder"],V={key:0,class:"jsgd-text-sm jsgd-text-red-500 jsgd-mt-2 jsgd-animate-[fadeIn_300ms_ease-out] dark:jsgd-text-red-400"},M=e.defineComponent({__name:"DateTimeInput",props:{id:{type:String,default:()=>g.setUID()},label:{type:String,required:!0},placeholder:String,modelValue:{type:String,default:""},error:[String,Array],disabled:Boolean,validate:Object,lang:String,outputFormat:{type:String,default:"local-offset"}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:b}){const t=n,k=e.inject("TableComponents",{labels:e.ref(g.defaultTextLabelsMap[t.lang??"en"])}).labels,j=b;function f(s){if(!s)return"";if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(s))return s;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(s))return s.substring(0,16);try{const a=new Date(s);if(isNaN(a.getTime()))return"";const r=a.getFullYear(),d=(a.getMonth()+1).toString().padStart(2,"0"),i=a.getDate().toString().padStart(2,"0"),o=a.getHours().toString().padStart(2,"0"),l=a.getMinutes().toString().padStart(2,"0");return`${r}-${d}-${i}T${o}:${l}`}catch{return""}}const x=e.computed(()=>f(t.modelValue)),p=e.computed(()=>{if(t.validate){const s=t.validate,a=[];return s.minDateTime&&a.push(g.getMessage("dateTimeMin",{min:s.minDateTime},t.lang??"en")),s.maxDateTime&&a.push(g.getMessage("dateTimeMax",{max:s.maxDateTime},t.lang??"en")),a.join(`
2
2
  `)}return""}),c=e.ref([]);e.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:s,disabled:a,validate:r})=>{if(a){c.value=[];return}const d=[],i=f(s);if(r){const{minDateTime:o,maxDateTime:l}=r;if(i){const u=o?f(o):void 0,m=l?f(l):void 0;u&&i<u&&d.push(g.getMessage("dateTimeMin",{min:String(u)},t.lang??"en")),m&&i>m&&d.push(g.getMessage("dateTimeMax",{max:String(m)},t.lang??"en"))}}c.value=d,d.length?j("push:error",d,t.id):j("remove:error",t.id)},{deep:!0,immediate:!0});const v=e.computed(()=>t.placeholder??k?.value?.placeholder?.datetime??"");function h(s){if(t.disabled)return;const r=s.target.value;if(!r){j("update:modelValue","",t.id);return}const d=`${r}:00`,i=new Date(d);let o="";if(t.outputFormat==="utc")o=i.toISOString();else{const l=i.getTimezoneOffset(),u=Math.abs(l/60),m=Math.abs(l%60),S=`${l>0?"-":"+"}${String(u).padStart(2,"0")}:${String(m).padStart(2,"0")}`;o=`${d}${S}`}j("update:modelValue",o,t.id)}return(s,a)=>(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("label",{for:n.id,class:e.normalizeClass(["jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-text-sm jsgd-font-medium jsgd-mb-2 jsgd-text-slate-900 jsgd-transition-colors jsgd-duration-200 dark:jsgd-text-slate-100",{"jsgd-text-red-500 dark:jsgd-text-red-400":c.value.length||n.error}])},[e.createTextVNode(e.toDisplayString(n.label)+" ",1),p.value?(e.openBlock(),e.createBlock(e.unref(g._sfc_main$1),{key:0,text:p.value,as:"strong"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):e.createCommentVNode("",!0)],10,D),e.createElementVNode("div",y,[a[1]||(a[1]=e.createElementVNode("div",{class:"jsgd-absolute jsgd-right-3 jsgd-top-1/2 -jsgd-translate-y-1/2 jsgd-pointer-events-none jsgd-text-slate-500 dark:jsgd-text-slate-400"},[e.createElementVNode("span",{class:"jsgd-i-mdi-calendar-clock jsgd-w-5 jsgd-h-5"})],-1)),e.createElementVNode("input",{id:n.id,type:"datetime-local",value:x.value,disabled:n.disabled,min:t.validate?.minDateTime,max:t.validate?.maxDateTime,onInput:h,placeholder:v.value,class:e.normalizeClass(["jsgd-w-full jsgd-py-3 jsgd-px-4 jsgd-text-base jsgd-text-slate-900 jsgd-bg-white jsgd-border-1 jsgd-border-solid jsgd-border-slate-300 jsgd-rounded-lg jsgd-transition-all jsgd-duration-200 jsgd-box-border jsgd-appearance-none focus:jsgd-outline-none focus:jsgd-border-blue-500 focus:jsgd-ring-4 focus:jsgd-ring-blue-500/20 disabled:jsgd-bg-slate-100 disabled:jsgd-text-slate-500 disabled:jsgd-cursor-not-allowed dark:jsgd-bg-slate-800 dark:jsgd-text-slate-100 dark:jsgd-border-slate-600 dark:focus:jsgd-border-blue-400 dark:focus:jsgd-ring-blue-400/25 dark:disabled:jsgd-bg-slate-700 [color-scheme:light_dark] [&::-webkit-calendar-picker-indicator]:jsgd-opacity-0 [&::-webkit-calendar-picker-indicator]:jsgd-cursor-pointer [&::-webkit-calendar-picker-indicator]:jsgd-absolute [&::-webkit-calendar-picker-indicator]:jsgd-right-3 [&::-webkit-calendar-picker-indicator]:jsgd-top-1/2 [&::-webkit-calendar-picker-indicator]:-jsgd-translate-y-1/2 [&::-webkit-calendar-picker-indicator]:jsgd-w-6 [&::-webkit-calendar-picker-indicator]:jsgd-h-6",{"jsgd-border-red-400 focus:jsgd-ring-red-500/20 dark:jsgd-border-red-400 dark:focus:jsgd-ring-red-400/25":c.value.length||n.error}])},null,42,w)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(r,d)=>(e.openBlock(),e.createElementBlock("p",{key:d,class:"jsgd-text-sm jsgd-text-red-500 jsgd-mt-2 jsgd-animate-[fadeIn_300ms_ease-out] dark:jsgd-text-red-400"},e.toDisplayString(r),1))),128)),typeof t.error=="string"&&c.value.length===0?(e.openBlock(),e.createElementBlock("p",V,e.toDisplayString(n.error),1)):e.createCommentVNode("",!0)]))}});exports._sfc_main=M;
@@ -0,0 +1,4 @@
1
+ import { h as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$8;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$8;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FileArrayInput.vue_vue_type_script_setup_true_lang-C1s1YDCy.cjs.js");require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FileArrayInput.vue_vue_type_script_setup_true_lang-DtC-rygi.cjs.js");require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main;
@@ -1,5 +1,5 @@
1
- import { _ as m } from "./FileArrayInput.vue_vue_type_script_setup_true_lang-BC-fFxew.es.js";
2
- import "./resize-DjoINfaT.es.js";
1
+ import { _ as m } from "./FileArrayInput.vue_vue_type_script_setup_true_lang-C7UCpQqG.es.js";
2
+ import "./resize-2N3sqejU.es.js";
3
3
  export {
4
4
  m as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as D, inject as C, ref as y, computed as k, watch as R, createElementBlock as n, openBlock as r, createElementVNode as a, normalizeClass as w, createTextVNode as $, createBlock as K, createCommentVNode as F, toDisplayString as c, unref as _, withCtx as N, Fragment as L, renderList as A, normalizeStyle as P } from "vue";
2
- import { U as W, z as q, a9 as o, a as G } from "./resize-DjoINfaT.es.js";
2
+ import { U as W, z as q, aa as o, a as G } from "./resize-2N3sqejU.es.js";
3
3
  import "dompurify";
4
4
  import "lodash.isequal";
5
5
  import "zod";
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("vue"),r=require("./resize-B3p3dEqX.cjs.js");require("dompurify");require("lodash.isequal");require("zod");const E={class:"jsgd-w-full jsgd-mb-4"},B=["for"],S={key:0,class:"jsgd-flex jsgd-flex-col jsgd-gap-3 jsgd-mb-6"},z={class:"jsgd-flex jsgd-items-center jsgd-gap-3 jsgd-min-w-0"},C={class:"jsgd-flex jsgd-flex-col jsgd-overflow-hidden"},N={class:"jsgd-font-medium jsgd-text-slate-900 jsgd-truncate dark:jsgd-text-slate-100"},T={class:"jsgd-text-xs jsgd-text-slate-500 dark:jsgd-text-slate-400"},M=["onClick"],L={key:1,class:"jsgd-text-center jsgd-py-8 jsgd-px-4 jsgd-text-slate-400 jsgd-italic dark:jsgd-text-slate-500"},$={class:"jsgd-text-center jsgd-mt-4"},D=["id","disabled"],A=["for"],I=["disabled"],U={class:"jsgd-mt-2 jsgd-flex jsgd-flex-col jsgd-gap-1"},q=e.defineComponent({__name:"FileArrayInput",props:{id:{default:r.setUID},label:{},modelValue:{default:()=>[]},disabled:{type:Boolean},validate:{},lang:{},error:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:y}){const s=n,i=y,h=e.inject("TableComponents",{labels:e.ref(r.defaultTextLabelsMap[s.lang??"en"])}).labels,c=e.inject("TableComponents")?.ShowAlert,j=e.ref([]),g=e.ref([]),u=e.computed(()=>g.value.length>0?g.value:typeof s.error=="string"?[s.error]:Array.isArray(s.error)?s.error:[]),m=e.computed(()=>s.disabled?!0:s.validate?.maxFiles!==void 0?!!(s.modelValue&&s.modelValue.length>=s.validate.maxFiles):!1),x=e.computed(()=>{if(!s.validate)return"";const t=s.validate,l=[];return t.maxFiles&&l.push(r.getMessage("fileMaxFiles",{max:t.maxFiles},s.lang??"en")),t.allowedTypes&&l.push(r.getMessage("fileType",{},s.lang??"en")+` (${t.allowedTypes.join(", ")})`),t.maxSize&&l.push(r.getMessage("fileMaxSize",{max:t.maxSize},s.lang??"en")),l.join(`
1
+ "use strict";const e=require("vue"),r=require("./resize-DsxsWx52.cjs.js");require("dompurify");require("lodash.isequal");require("zod");const E={class:"jsgd-w-full jsgd-mb-4"},B=["for"],S={key:0,class:"jsgd-flex jsgd-flex-col jsgd-gap-3 jsgd-mb-6"},z={class:"jsgd-flex jsgd-items-center jsgd-gap-3 jsgd-min-w-0"},C={class:"jsgd-flex jsgd-flex-col jsgd-overflow-hidden"},N={class:"jsgd-font-medium jsgd-text-slate-900 jsgd-truncate dark:jsgd-text-slate-100"},T={class:"jsgd-text-xs jsgd-text-slate-500 dark:jsgd-text-slate-400"},M=["onClick"],L={key:1,class:"jsgd-text-center jsgd-py-8 jsgd-px-4 jsgd-text-slate-400 jsgd-italic dark:jsgd-text-slate-500"},$={class:"jsgd-text-center jsgd-mt-4"},D=["id","disabled"],A=["for"],I=["disabled"],U={class:"jsgd-mt-2 jsgd-flex jsgd-flex-col jsgd-gap-1"},q=e.defineComponent({__name:"FileArrayInput",props:{id:{default:r.setUID},label:{},modelValue:{default:()=>[]},disabled:{type:Boolean},validate:{},lang:{},error:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:y}){const s=n,i=y,h=e.inject("TableComponents",{labels:e.ref(r.defaultTextLabelsMap[s.lang??"en"])}).labels,c=e.inject("TableComponents")?.ShowAlert,j=e.ref([]),g=e.ref([]),u=e.computed(()=>g.value.length>0?g.value:typeof s.error=="string"?[s.error]:Array.isArray(s.error)?s.error:[]),m=e.computed(()=>s.disabled?!0:s.validate?.maxFiles!==void 0?!!(s.modelValue&&s.modelValue.length>=s.validate.maxFiles):!1),x=e.computed(()=>{if(!s.validate)return"";const t=s.validate,l=[];return t.maxFiles&&l.push(r.getMessage("fileMaxFiles",{max:t.maxFiles},s.lang??"en")),t.allowedTypes&&l.push(r.getMessage("fileType",{},s.lang??"en")+` (${t.allowedTypes.join(", ")})`),t.maxSize&&l.push(r.getMessage("fileMaxSize",{max:t.maxSize},s.lang??"en")),l.join(`
2
2
  `)});e.watch(()=>s.modelValue,t=>{if(!t||t.length===0){j.value=[],b();return}j.value=t.map(l=>l instanceof File?{name:l.name,size:`${(l.size/1024).toFixed(2)} KB`}:{name:l,size:"N/A"}),b()},{immediate:!0,deep:!0});function w(){if(s.disabled)return;if(m.value){c?.("error",r.getMessage("fileMaxFiles",{max:s.validate.maxFiles},s.lang??"en"));return}const t=prompt(h.value.placeholder?.url??"Please enter the file URL");if(t)if(t.startsWith("http://")||t.startsWith("https://")){const l=s.modelValue||[];i("update:modelValue",[...l,t])}else c?.("error","Invalid URL",["Please enter a valid URL starting with http:// or https://"])}function V(t){if(s.disabled)return;const l=t.target,a=l.files;if(!a||a.length===0)return;const d=s.modelValue||[],o=s.validate?.maxFiles;if(o&&d.length+a.length>o){c?.("error",r.getMessage("fileMaxFiles",{max:o},s.lang??"en")),l.value="";return}const p=[],v=s.validate?.allowedTypes?.map(f=>f.toLowerCase())??[];for(const f of Array.from(a)){const k=f.name.split(".").pop()?.toLowerCase();if(v.length>0&&(!k||!v.includes(k))){c?.("error","Invalid file type",[r.getMessage("fileType",{},s.lang??"en")+` (${s.validate?.allowedTypes?.join(", ")})`]);continue}p.push(f)}i("update:modelValue",[...d,...p]),l.value=""}function F(t){if(s.disabled)return;const l=[...s.modelValue||[]];l.splice(t,1),i("update:modelValue",l)}function b(){if(!s.validate||!s.modelValue||s.modelValue.length===0){g.value=[],i("remove:error",s.id);return}const t=[];s.validate.maxFiles&&s.modelValue.length>s.validate.maxFiles&&t.push(r.getMessage("fileMaxFiles",{max:s.validate.maxFiles},s.lang??"en")),s.modelValue.forEach((l,a)=>{if(l instanceof File){const d=_(l,a+1);t.push(...d)}}),g.value=[...new Set(t)],g.value.length>0?i("push:error",g.value,s.id):i("remove:error",s.id)}function _(t,l){const a=[],d=s.validate;if(d.allowedTypes){const o=t.name.split(".").pop()?.toLowerCase();(!o||!d.allowedTypes.map(p=>p.toLowerCase()).includes(o))&&a.push(`File #${l} (${t.name}): `+r.getMessage("fileType",{},s.lang??"en")+` (${d.allowedTypes.join(", ")})`)}return d.maxSize&&t.size/1024>d.maxSize&&a.push(`File #${l} (${t.name}): `+r.getMessage("fileMaxSize",{max:d.maxSize},s.lang??"en")),a}return(t,l)=>(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("label",{for:n.id,class:e.normalizeClass(["jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-text-sm jsgd-font-medium jsgd-mb-2 jsgd-text-slate-900 jsgd-transition-colors jsgd-duration-200 dark:jsgd-text-slate-100",{"jsgd-text-red-500 dark:jsgd-text-red-400":u.value.length!==0}])},[e.createTextVNode(e.toDisplayString(n.label)+" ",1),x.value?(e.openBlock(),e.createBlock(e.unref(r._sfc_main$1),{key:0,text:x.value,as:"strong"},{default:e.withCtx(()=>[...l[0]||(l[0]=[e.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):e.createCommentVNode("",!0)],10,B),e.createElementVNode("div",{class:e.normalizeClass(["jsgd-bg-white jsgd-border-2 jsgd-border-dashed jsgd-border-slate-300 jsgd-rounded-xl jsgd-p-6 jsgd-transition-colors jsgd-duration-200 hover:jsgd-bg-slate-50 hover:jsgd-border-blue-500 dark:jsgd-bg-slate-800 dark:jsgd-border-slate-600 dark:hover:jsgd-bg-slate-700 dark:hover:jsgd-border-blue-400",{"jsgd-border-red-300 dark:jsgd-border-red-800":u.value.length!==0}])},[j.value.length>0?(e.openBlock(),e.createElementBlock("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(a,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"jsgd-group jsgd-flex jsgd-items-center jsgd-justify-between jsgd-p-3 jsgd-bg-slate-50 jsgd-border jsgd-border-slate-200 jsgd-rounded-lg jsgd-shadow-sm jsgd-transition-all jsgd-duration-200 jsgd-animate-[slideInFade_500ms_ease-out_backwards] hover:-jsgd-translate-y-0.5 hover:jsgd-shadow-md dark:jsgd-bg-slate-700 dark:jsgd-border-slate-600 dark:hover:jsgd-bg-slate-600",style:e.normalizeStyle({animationDelay:`${d*60}ms`})},[e.createElementVNode("div",z,[l[1]||(l[1]=e.createElementVNode("span",{class:"jsgd-text-2xl jsgd-text-slate-500 jsgd-shrink-0 dark:jsgd-text-slate-400"},"📄",-1)),e.createElementVNode("div",C,[e.createElementVNode("span",N,e.toDisplayString(a.name),1),e.createElementVNode("span",T,e.toDisplayString(a.size),1)])]),n.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,onClick:o=>F(d),class:"jsgd-w-6 jsgd-h-6 jsgd-flex jsgd-items-center jsgd-justify-center jsgd-pb-[5px] jsgd-shrink-0 jsgd-ml-4 jsgd-text-xl jsgd-font-bold jsgd-text-white jsgd-bg-red-500 jsgd-rounded-full jsgd-border-none jsgd-cursor-pointer jsgd-opacity-0 jsgd-scale-50 jsgd-transition-all jsgd-duration-200 hover:jsgd-bg-red-600 hover:jsgd-scale-110 hover:jsgd-rotate-90 group-hover:jsgd-opacity-100 group-hover:jsgd-scale-100","aria-label":"Remove file"}," × ",8,M))],4))),128))])):(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("p",null,e.toDisplayString(e.unref(h)?.message?.noItemSelected),1)])),e.createElementVNode("div",$,[e.createElementVNode("input",{id:n.id,type:"file",multiple:"",onChange:V,class:"jsgd-hidden",disabled:m.value},null,40,D),e.createElementVNode("label",{for:n.id,class:e.normalizeClass(["jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-px-5 jsgd-py-2.5 jsgd-font-medium jsgd-border-none jsgd-rounded-lg jsgd-text-white jsgd-bg-blue-500 jsgd-cursor-pointer jsgd-transition-all jsgd-duration-200 hover:jsgd-bg-blue-600 hover:jsgd-scale-105 hover:jsgd-shadow-lg disabled:jsgd-bg-slate-100 disabled:jsgd-text-slate-500 disabled:jsgd-cursor-not-allowed dark:jsgd-bg-blue-600 dark:hover:jsgd-bg-blue-500 dark:disabled:jsgd-bg-slate-700 dark:disabled:jsgd-text-slate-400 before:jsgd-content-['+'] before:jsgd-text-lg before:jsgd-leading-none",{"jsgd-opacity-60 jsgd-cursor-not-allowed":m.value}])},e.toDisplayString(e.unref(h)?.btn?.upload??"Upload"),11,A),e.createElementVNode("button",{type:"button",onClick:w,disabled:m.value,class:"jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-px-5 jsgd-py-2.5 jsgd-font-medium jsgd-border-none jsgd-rounded-lg jsgd-text-white jsgd-bg-slate-600 jsgd-cursor-pointer jsgd-transition-all jsgd-duration-200 hover:jsgd-bg-slate-700 hover:jsgd-scale-105 hover:jsgd-shadow-lg disabled:jsgd-opacity-60 disabled:jsgd-cursor-not-allowed dark:jsgd-bg-slate-500 dark:hover:jsgd-bg-slate-400"}," URL ",8,I)])],2),e.createElementVNode("div",U,[u.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u.value,(a,d)=>(e.openBlock(),e.createElementBlock("p",{key:d,class:"jsgd-text-sm jsgd-text-red-500 jsgd-animate-[fadeIn_300ms_ease-out] dark:jsgd-text-red-400"},e.toDisplayString(a),1))),128)):e.createCommentVNode("",!0)])]))}});exports._sfc_main=q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$9;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$9;
@@ -0,0 +1,4 @@
1
+ import { i as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main$10;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main$10;
@@ -0,0 +1,4 @@
1
+ import { j as f } from "./resize-2N3sqejU.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ImageArrayInput.vue_vue_type_script_setup_true_lang-BHfmeojG.cjs.js");require("./resize-B3p3dEqX.cjs.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ImageArrayInput.vue_vue_type_script_setup_true_lang-d88H9xj4.cjs.js");require("./resize-DsxsWx52.cjs.js");exports.default=e._sfc_main;
@@ -1,5 +1,5 @@
1
- import { _ as m } from "./ImageArrayInput.vue_vue_type_script_setup_true_lang-EJntCDiU.es.js";
2
- import "./resize-DjoINfaT.es.js";
1
+ import { _ as m } from "./ImageArrayInput.vue_vue_type_script_setup_true_lang-NqHOY8OF.es.js";
2
+ import "./resize-2N3sqejU.es.js";
3
3
  export {
4
4
  m as default
5
5
  };
@@ -0,0 +1,421 @@
1
+ import { defineComponent as ge, inject as N, ref as I, computed as E, watch as me, createElementBlock as j, openBlock as h, createElementVNode as g, createCommentVNode as H, normalizeClass as A, createTextVNode as X, createBlock as ce, toDisplayString as P, unref as M, withCtx as ue, Fragment as Y, renderList as G, normalizeStyle as he } from "vue";
2
+ import { U as je, z as pe, aa as c, S as J, a as fe } from "./resize-2N3sqejU.es.js";
3
+ import "dompurify";
4
+ import "lodash.isequal";
5
+ import "zod";
6
+ const be = { class: "jsgd-w-full jsgd-mb-4" }, we = ["for"], xe = {
7
+ key: 0,
8
+ class: "jsgd-mb-4 jsgd-p-4 jsgd-bg-blue-50 jsgd-border jsgd-border-blue-200 jsgd-rounded-lg dark:jsgd-bg-blue-900/20 dark:jsgd-border-blue-800"
9
+ }, ve = { class: "jsgd-flex jsgd-items-center jsgd-gap-4" }, ke = { class: "jsgd-shrink-0 jsgd-w-16 jsgd-h-16 jsgd-bg-white jsgd-rounded jsgd-border jsgd-border-slate-300 jsgd-flex jsgd-items-center jsgd-justify-center jsgd-overflow-hidden dark:jsgd-bg-slate-700 dark:jsgd-border-slate-600" }, ye = ["src"], Fe = {
10
+ key: 1,
11
+ class: "jsgd-text-xs jsgd-text-slate-400"
12
+ }, We = { class: "jsgd-flex jsgd-flex-col jsgd-gap-2" }, Ue = { class: "jsgd-flex jsgd-gap-2" }, _e = {
13
+ key: 0,
14
+ class: "jsgd-grid jsgd-grid-cols-2 jsgd-gap-4 jsgd-mb-6 min-[480px]:jsgd-grid-cols-3 md:jsgd-grid-cols-4 lg:jsgd-grid-cols-5"
15
+ }, Ie = ["src", "alt"], Re = ["onClick"], Le = {
16
+ key: 1,
17
+ class: "jsgd-text-center jsgd-py-8 jsgd-px-4 jsgd-text-slate-400 dark:jsgd-text-slate-500"
18
+ }, Se = { class: "jsgd-text-center jsgd-mt-4" }, Ce = ["id", "disabled"], He = ["for"], Pe = ["disabled"], Ve = { class: "jsgd-mt-2 jsgd-flex jsgd-flex-col jsgd-gap-1" }, Be = /* @__PURE__ */ ge({
19
+ __name: "ImageArrayInput",
20
+ props: {
21
+ id: { default: je },
22
+ label: {},
23
+ modelValue: { default: () => [] },
24
+ previewAlt: {},
25
+ disabled: { type: Boolean },
26
+ error: {},
27
+ previewImages: {},
28
+ validate: {},
29
+ watermark: {},
30
+ lang: {}
31
+ },
32
+ emits: ["update:modelValue", "push:error", "remove:error"],
33
+ setup(x, { emit: Q }) {
34
+ const t = x, b = Q, V = N("TableComponents", {
35
+ labels: I(pe[t.lang ?? "en"])
36
+ }).labels, F = N("TableComponents")?.ShowAlert, R = I([]), W = I([]), p = I(null), L = I(""), S = E(() => W.value.length > 0 ? W.value : typeof t.error == "string" ? [t.error] : Array.isArray(t.error) ? t.error : []), C = E(() => t.disabled ? !0 : !!(t.validate?.maxFiles && t.modelValue && t.modelValue.length >= t.validate.maxFiles)), B = E(() => {
37
+ if (!t.validate) return "";
38
+ const s = t.validate, a = [];
39
+ if (s.maxFiles && a.push(c("imageMaxFiles", { max: s.maxFiles }, t.lang ?? "en")), s.allowedTypes && a.push(c("imageType", {}, t.lang ?? "en") + ` (${s.allowedTypes.join(", ")})`), s.maxSize && a.push(c("imageMaxSize", { max: s.maxSize }, t.lang ?? "en")), s.pixel) {
40
+ const e = s.pixel;
41
+ ("minWidth" in e || "maxWidth" in e || "minHeight" in e || "maxHeight" in e) && (e.minWidth && a.push(c("imageMinWidth", { min: e.minWidth }, t.lang ?? "en")), e.minHeight && a.push(c("imageMinHeight", { min: e.minHeight }, t.lang ?? "en")), e.maxWidth && a.push(c("imageMaxWidth", { max: e.maxWidth }, t.lang ?? "en")), e.maxHeight && a.push(c("imageMaxHeight", { max: e.maxHeight }, t.lang ?? "en"))), ("width" in e || "height" in e) && a.push(
42
+ c(
43
+ "imagePixel",
44
+ { width: e.width ?? "any", height: e.height ?? "any" },
45
+ t.lang ?? "en"
46
+ )
47
+ );
48
+ }
49
+ return s.ratio && a.push(
50
+ c("imageRatio", { w: s.ratio.Width, h: s.ratio.Height }, t.lang ?? "en")
51
+ ), a.join(`
52
+ `);
53
+ });
54
+ me(
55
+ () => t.modelValue,
56
+ async (s) => {
57
+ if (!s || s.length === 0) {
58
+ R.value = t.previewImages || [], K();
59
+ return;
60
+ }
61
+ const a = s.map((e) => new Promise((d) => {
62
+ if (typeof e == "string")
63
+ d(e);
64
+ else if (e instanceof File) {
65
+ const r = new FileReader();
66
+ r.onload = (l) => d(l.target?.result), r.onerror = () => d(""), r.readAsDataURL(e);
67
+ } else
68
+ d("");
69
+ }));
70
+ R.value = await Promise.all(a), K();
71
+ },
72
+ { immediate: !0, deep: !0 }
73
+ );
74
+ function Z() {
75
+ const s = prompt("Enter Watermark Image URL (https://...):");
76
+ s && (s.startsWith("http://") || s.startsWith("https://") ? (p.value = s, L.value = s) : F?.("error", "Invalid URL", ["URL must start with http:// or https://"]));
77
+ }
78
+ function ee(s) {
79
+ const a = s.target, e = a.files?.[0];
80
+ e && (p.value = e, L.value = URL.createObjectURL(e)), a.value = "";
81
+ }
82
+ function D(s, a = !1) {
83
+ return new Promise((e, d) => {
84
+ const r = new Image();
85
+ a && (r.crossOrigin = "anonymous"), r.onload = () => e(r), r.onerror = (l) => {
86
+ console.error("Failed to load image:", s, l), d(new Error(`Failed to load image: ${s}`));
87
+ }, r.src = s;
88
+ });
89
+ }
90
+ async function O(s) {
91
+ if (!t.watermark)
92
+ return s;
93
+ let a = "";
94
+ if (t.watermark.url === "upload") {
95
+ if (!p.value)
96
+ return console.warn('Watermark config is "upload" but no watermark image set. Skipping watermark.'), s;
97
+ if (p.value instanceof File)
98
+ a = URL.createObjectURL(p.value);
99
+ else if (typeof p.value == "string")
100
+ a = p.value;
101
+ else
102
+ return console.warn("Unsupported watermark source type. Skipping watermark."), s;
103
+ } else
104
+ a = t.watermark.url;
105
+ const e = t.watermark, d = URL.createObjectURL(s);
106
+ try {
107
+ const [r, l] = await Promise.all([
108
+ D(d, !1),
109
+ D(a, !0)
110
+ ]), o = document.createElement("canvas");
111
+ o.width = r.width, o.height = r.height;
112
+ const n = o.getContext("2d");
113
+ if (!n) return s;
114
+ n.drawImage(r, 0, 0);
115
+ let i = l.width, m = l.height;
116
+ if (typeof e.size == "number")
117
+ i = e.size, m = e.size;
118
+ else if (e.size) {
119
+ const u = e.size;
120
+ i = u.width, m = u.height;
121
+ }
122
+ let v = 0, k = 0, w = 0, U = 0;
123
+ if (e.margin !== void 0)
124
+ if (typeof e.margin == "number")
125
+ v = k = w = U = e.margin;
126
+ else {
127
+ const u = e.margin;
128
+ v = u.top ?? 0, k = u.right ?? 0, w = u.bottom ?? 0, U = u.left ?? 0;
129
+ }
130
+ let f = 0, y = 0;
131
+ const z = o.width, $ = o.height, _ = e.position ?? "bottom-right";
132
+ if (typeof _ == "string")
133
+ if (_ === "full")
134
+ f = 0, y = 0, i = z, m = $;
135
+ else
136
+ switch (_) {
137
+ case "top-left":
138
+ f = U, y = v;
139
+ break;
140
+ case "top-right":
141
+ f = z - i - k, y = v;
142
+ break;
143
+ case "bottom-left":
144
+ f = U, y = $ - m - w;
145
+ break;
146
+ case "bottom-right":
147
+ f = z - i - k, y = $ - m - w;
148
+ break;
149
+ }
150
+ else if (typeof _ == "object") {
151
+ const u = _;
152
+ f = u.x, y = u.y;
153
+ }
154
+ n.save();
155
+ let T = 1;
156
+ e.opacity !== void 0 ? T = e.opacity : e.transparant !== void 0 && (T = e.transparant / 100), n.globalAlpha = T;
157
+ const de = f + i / 2, le = y + m / 2;
158
+ return n.translate(de, le), e.rotate && n.rotate(e.rotate * Math.PI / 180), n.drawImage(l, -i / 2, -m / 2, i, m), n.restore(), new Promise((u, oe) => {
159
+ o.toBlob((q) => {
160
+ if (q) {
161
+ const ne = new File([q], s.name, { type: s.type });
162
+ u(ne);
163
+ } else
164
+ oe(new Error("Canvas toBlob failed"));
165
+ }, s.type);
166
+ });
167
+ } catch (r) {
168
+ return console.error(`Watermark application failed for ${s.name}:`, r), F?.("error", `Watermark Error (${s.name})`, [
169
+ "Failed to apply watermark. Using original image."
170
+ ]), s;
171
+ } finally {
172
+ URL.revokeObjectURL(d), t.watermark.url === "upload" && p.value instanceof File && URL.revokeObjectURL(a);
173
+ }
174
+ }
175
+ async function te() {
176
+ if (t.disabled) return;
177
+ if (C.value) {
178
+ F?.(
179
+ "error",
180
+ c("imageMaxFiles", { max: t.validate.maxFiles }, t.lang ?? "en")
181
+ );
182
+ return;
183
+ }
184
+ const s = prompt(V.value.placeholder?.url ?? "Please enter the image URL");
185
+ if (s) {
186
+ if (!s.startsWith("http://") && !s.startsWith("https://")) {
187
+ F?.("error", "Invalid URL", [
188
+ "Please enter a valid URL starting with http:// or https://"
189
+ ]);
190
+ return;
191
+ }
192
+ const a = t.modelValue || [];
193
+ if (!t.watermark || !p) {
194
+ b("update:modelValue", [...a, s]);
195
+ return;
196
+ }
197
+ try {
198
+ const e = await fetch(s, { mode: "cors" });
199
+ if (!e.ok) throw new Error("Failed to fetch image");
200
+ const d = await e.blob(), r = s.split("/").pop()?.split("?")[0] || `image-${Date.now()}.png`, l = new File([d], r, { type: d.type || "image/png" }), o = await O(l);
201
+ b("update:modelValue", [...a, o]);
202
+ } catch (e) {
203
+ console.error("URL Watermark Error:", e), confirm(
204
+ "Could not apply watermark due to security (CORS). Add original image instead?"
205
+ ) && b("update:modelValue", [...a, s]);
206
+ }
207
+ }
208
+ }
209
+ async function se(s) {
210
+ if (t.disabled) return;
211
+ const a = s.target, e = a.files;
212
+ if (!e || e.length === 0) return;
213
+ const d = t.modelValue || [], r = t.validate?.maxFiles;
214
+ if (r && d.length + e.length > r) {
215
+ F?.("error", c("imageMaxFiles", { max: r }, t.lang ?? "en")), a.value = "";
216
+ return;
217
+ }
218
+ const l = [], o = t.validate?.allowedTypes?.map((i) => i.toLowerCase()) ?? [];
219
+ for (const i of Array.from(e)) {
220
+ const m = i.name.split(".").pop()?.toLowerCase();
221
+ if (o.length > 0 && (!m || !o.includes(m))) {
222
+ F?.("error", "Invalid file type", [
223
+ c("imageType", {}, t.lang ?? "en") + ` (${t.validate?.allowedTypes?.join(", ")})`
224
+ ]);
225
+ continue;
226
+ }
227
+ l.push(i);
228
+ }
229
+ let n = [];
230
+ if (t.watermark && p.value && l.length > 0)
231
+ try {
232
+ const i = l.map((m) => O(m));
233
+ n = await Promise.all(i);
234
+ } catch (i) {
235
+ console.error("Batch watermarking process failed:", i), a.value = "";
236
+ return;
237
+ }
238
+ else
239
+ n = l;
240
+ n.length > 0 && b("update:modelValue", [...d, ...n]), a.value = "";
241
+ }
242
+ function ae(s) {
243
+ if (t.disabled) return;
244
+ const a = [...t.modelValue || []];
245
+ a.splice(s, 1), b("update:modelValue", a);
246
+ }
247
+ async function K() {
248
+ if (!t.validate || !t.modelValue || t.modelValue.length === 0) {
249
+ W.value = [], b("remove:error", t.id);
250
+ return;
251
+ }
252
+ const s = [];
253
+ t.validate.maxFiles && t.modelValue.length > t.validate.maxFiles && s.push(c("imageMaxFiles", { max: t.validate.maxFiles }, t.lang ?? "en"));
254
+ const a = t.modelValue.map(
255
+ (d, r) => re(d, r + 1)
256
+ );
257
+ (await Promise.all(a)).forEach((d) => s.push(...d)), W.value = [...new Set(s)], W.value.length > 0 ? b("push:error", W.value, t.id) : b("remove:error", t.id);
258
+ }
259
+ async function re(s, a) {
260
+ const e = [];
261
+ if (!(s instanceof File))
262
+ return [];
263
+ const d = s, r = t.validate;
264
+ if (r.allowedTypes) {
265
+ const l = d.name.split(".").pop()?.toLowerCase();
266
+ (!l || !r.allowedTypes.map((o) => o.toLowerCase()).includes(l)) && e.push(
267
+ `File ${a}: ` + c("imageType", {}, t.lang ?? "en") + ` (${r.allowedTypes.join(", ")})`
268
+ );
269
+ }
270
+ if (r.maxSize && d.size / 1024 > r.maxSize && e.push(
271
+ `File ${a}: ` + c("imageMaxSize", { max: r.maxSize }, t.lang ?? "en")
272
+ ), r.pixel || r.ratio) {
273
+ const l = await ie(d), o = l.width, n = l.height;
274
+ if (r.pixel) {
275
+ const i = r.pixel;
276
+ ("minWidth" in i && i.minWidth && o < i.minWidth || "minHeight" in i && i.minHeight && n < i.minHeight || "maxWidth" in i && i.maxWidth && o > i.maxWidth || "maxHeight" in i && i.maxHeight && n > i.maxHeight) && e.push(`File ${a}: Invalid dimensions.`), ("width" in i && i.width && o !== i.width || "height" in i && i.height && n !== i.height) && e.push(
277
+ `File ${a}: ` + c(
278
+ "imagePixel",
279
+ { width: i.width ?? o, height: i.height ?? n },
280
+ t.lang ?? "en"
281
+ )
282
+ );
283
+ }
284
+ if (r.ratio) {
285
+ const i = r.ratio.Width, m = r.ratio.Height, v = J(o, n), k = J(i, m);
286
+ let w = v.w === k.w && v.h === k.h;
287
+ if (!w) {
288
+ const U = o / n, f = i / m;
289
+ w = Math.abs(U - f) <= 0.01;
290
+ }
291
+ w || e.push(
292
+ `File ${a}: ` + c(
293
+ "imageRatio",
294
+ { w: String(i), h: String(m) },
295
+ t.lang ?? "en"
296
+ )
297
+ );
298
+ }
299
+ }
300
+ return e;
301
+ }
302
+ function ie(s) {
303
+ return new Promise((a) => {
304
+ const e = new FileReader();
305
+ e.onload = (d) => {
306
+ const r = new Image();
307
+ r.onload = () => a({ width: r.width, height: r.height }), r.onerror = () => a({ width: 0, height: 0 }), r.src = d.target?.result;
308
+ }, e.onerror = () => a({ width: 0, height: 0 }), e.readAsDataURL(s);
309
+ });
310
+ }
311
+ return (s, a) => (h(), j("div", be, [
312
+ g("label", {
313
+ for: x.id,
314
+ class: A(["jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-text-sm jsgd-font-medium jsgd-mb-2 jsgd-text-slate-900 jsgd-transition-colors jsgd-duration-200 dark:jsgd-text-slate-100", { "jsgd-text-red-500 dark:jsgd-text-red-400": S.value.length !== 0 }])
315
+ }, [
316
+ X(P(x.label) + " ", 1),
317
+ B.value ? (h(), ce(M(fe), {
318
+ key: 0,
319
+ text: B.value,
320
+ as: "strong"
321
+ }, {
322
+ default: ue(() => [...a[0] || (a[0] = [
323
+ X(" ❓", -1)
324
+ ])]),
325
+ _: 1
326
+ }, 8, ["text"])) : H("", !0)
327
+ ], 10, we),
328
+ t.watermark?.url === "upload" ? (h(), j("div", xe, [
329
+ a[3] || (a[3] = g("p", { class: "jsgd-text-xs jsgd-font-bold jsgd-uppercase jsgd-text-blue-600 jsgd-mb-2 dark:jsgd-text-blue-400" }, " Configuration: Watermark Image ", -1)),
330
+ g("div", ve, [
331
+ g("div", ke, [
332
+ L.value ? (h(), j("img", {
333
+ key: 0,
334
+ src: L.value,
335
+ alt: "Watermark Preview",
336
+ class: "jsgd-w-full jsgd-h-full jsgd-object-contain"
337
+ }, null, 8, ye)) : (h(), j("span", Fe, "None"))
338
+ ]),
339
+ g("div", We, [
340
+ g("div", Ue, [
341
+ g("input", {
342
+ type: "file",
343
+ accept: "image/*",
344
+ onChange: ee,
345
+ class: "jsgd-hidden",
346
+ id: "watermark-upload-input"
347
+ }, null, 32),
348
+ a[1] || (a[1] = g("label", {
349
+ for: "watermark-upload-input",
350
+ class: "jsgd-px-3 jsgd-py-1.5 jsgd-text-xs jsgd-font-medium jsgd-text-white jsgd-bg-slate-600 jsgd-rounded hover:jsgd-bg-slate-700 jsgd-cursor-pointer jsgd-transition-colors"
351
+ }, " Select Image ", -1)),
352
+ g("button", {
353
+ type: "button",
354
+ onClick: Z,
355
+ class: "jsgd-px-3 jsgd-py-1.5 jsgd-text-xs jsgd-font-medium jsgd-text-white jsgd-bg-slate-600 jsgd-rounded hover:jsgd-bg-slate-700 jsgd-cursor-pointer jsgd-transition-colors"
356
+ }, " Use URL ")
357
+ ]),
358
+ a[2] || (a[2] = g("p", { class: "jsgd-text-[10px] jsgd-text-slate-500 dark:jsgd-text-slate-400" }, " Set this watermark before uploading your main images. ", -1))
359
+ ])
360
+ ])
361
+ ])) : H("", !0),
362
+ g("div", {
363
+ class: A(["jsgd-bg-slate-50 jsgd-border-2 jsgd-border-dashed jsgd-border-slate-300 jsgd-rounded-xl jsgd-p-6 jsgd-transition-colors jsgd-duration-200 hover:jsgd-bg-slate-100 hover:jsgd-border-blue-500 dark:jsgd-bg-slate-800 dark:jsgd-border-slate-600 dark:hover:jsgd-bg-slate-700 dark:hover:jsgd-border-blue-400", { "jsgd-border-red-300 dark:jsgd-border-red-800": S.value.length !== 0 }])
364
+ }, [
365
+ R.value.length > 0 ? (h(), j("div", _e, [
366
+ (h(!0), j(Y, null, G(R.value, (e, d) => (h(), j("div", {
367
+ key: d,
368
+ class: "jsgd-relative jsgd-rounded-lg jsgd-overflow-hidden jsgd-shadow-sm jsgd-transition-all jsgd-duration-200 jsgd-group hover:jsgd-scale-105 hover:jsgd-shadow-lg jsgd-animate-[popIn_0.4s_ease-out_backwards]",
369
+ style: he({ animationDelay: `${d * 50}ms` })
370
+ }, [
371
+ g("img", {
372
+ src: e,
373
+ alt: `${x.previewAlt} ${d + 1}`,
374
+ class: "jsgd-block jsgd-w-full jsgd-aspect-square jsgd-object-cover jsgd-bg-white dark:jsgd-bg-transparent"
375
+ }, null, 8, Ie),
376
+ x.disabled ? H("", !0) : (h(), j("button", {
377
+ key: 0,
378
+ onClick: (r) => ae(d),
379
+ class: "jsgd-absolute jsgd-top-2 jsgd-right-2 jsgd-w-7 jsgd-h-7 jsgd-pb-[5px] jsgd-flex jsgd-items-center jsgd-justify-center jsgd-text-xl jsgd-font-bold jsgd-leading-none jsgd-text-white jsgd-bg-red-500/80 jsgd-backdrop-blur-sm jsgd-rounded-full jsgd-border-2 jsgd-border-white jsgd-cursor-pointer jsgd-opacity-0 jsgd-scale-50 jsgd-transition-all jsgd-duration-200 hover:jsgd-bg-red-600 hover:jsgd-scale-110 hover:jsgd-rotate-90 group-hover:jsgd-opacity-100 group-hover:jsgd-scale-100",
380
+ "aria-label": "Remove image"
381
+ }, " × ", 8, Re))
382
+ ], 4))), 128))
383
+ ])) : (h(), j("div", Le, [
384
+ g("p", null, P(M(V)?.message?.noItemSelected), 1)
385
+ ])),
386
+ g("div", Se, [
387
+ g("input", {
388
+ id: x.id,
389
+ type: "file",
390
+ accept: "image/*",
391
+ multiple: "",
392
+ onChange: se,
393
+ class: "jsgd-hidden",
394
+ disabled: C.value
395
+ }, null, 40, Ce),
396
+ g("label", {
397
+ for: x.id,
398
+ class: A(["jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-px-5 jsgd-py-2.5 jsgd-font-medium jsgd-border-none jsgd-rounded-lg jsgd-text-white jsgd-bg-blue-500 jsgd-cursor-pointer jsgd-transition-all jsgd-duration-200 hover:jsgd-bg-blue-600 hover:jsgd-scale-105 hover:jsgd-shadow-lg disabled:jsgd-bg-slate-100 disabled:jsgd-text-slate-500 disabled:jsgd-cursor-not-allowed dark:jsgd-bg-blue-600 dark:hover:jsgd-bg-blue-500 dark:disabled:jsgd-bg-slate-700 dark:disabled:jsgd-text-slate-400 before:jsgd-content-['+'] before:jsgd-text-lg before:jsgd-leading-none", {
399
+ "jsgd-opacity-60 jsgd-cursor-not-allowed": C.value
400
+ }])
401
+ }, P(M(V)?.btn?.upload ?? "Upload"), 11, He),
402
+ g("button", {
403
+ type: "button",
404
+ onClick: te,
405
+ disabled: C.value,
406
+ class: "jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-px-5 jsgd-py-2.5 jsgd-ml-2 jsgd-font-medium jsgd-border-none jsgd-rounded-lg jsgd-text-white jsgd-bg-slate-600 jsgd-cursor-pointer jsgd-transition-all jsgd-duration-200 hover:jsgd-bg-slate-700 hover:jsgd-scale-105 hover:jsgd-shadow-lg disabled:jsgd-opacity-60 disabled:jsgd-cursor-not-allowed dark:jsgd-bg-slate-500 dark:hover:jsgd-bg-slate-400"
407
+ }, " URL ", 8, Pe)
408
+ ])
409
+ ], 2),
410
+ g("div", Ve, [
411
+ S.value.length > 0 ? (h(!0), j(Y, { key: 0 }, G(S.value, (e, d) => (h(), j("p", {
412
+ key: d,
413
+ class: "jsgd-text-sm jsgd-text-red-500 jsgd-animate-[fadeIn_300ms_ease-out] dark:jsgd-text-red-400"
414
+ }, P(e), 1))), 128)) : H("", !0)
415
+ ])
416
+ ]));
417
+ }
418
+ });
419
+ export {
420
+ Be as _
421
+ };