schemas/libraries/valibot/download_compiled/index/minified.js
const e={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};
function t(t){return t?{lang:t?.lang??void 0,message:t?.message,abortEarly:t?.abortEarly??void 0,abortPipeEarly:t?.abortPipeEarly??void 0}:e}
function n(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function r(e,t,r,i,a){let o=a&&`input`in a?a.input:r.value,s=a?.expected??e.expects??null,c=a?.received?? n(o),l={kind:e.kind,type:e.type,input:o,expected:s,received:c,message:`Invalid ${t}: ${s?`Expected ${s} but r`:`R`}eceived ${c}`,requirement:e.requirement,path:a?.path,issues:a?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=e.kind===`schema`,d=a?.message??e.message??(e.reference,l.lang,void 0)??(u?(l.lang,void 0):null)??i.message??(l.lang,void 0);d!==void 0&&(l.message=typeof d==`function`?d(l):d),u&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}
function i(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}function a(e){return e[`~standard`]={version:1,vendor:`valibot`,validate:n=>e[`~run`]({value:n}, t())},e}var o=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};
function s(e,t){return{kind:`validation`,type:`max_length`,reference:s,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length>this.requirement&&r(this,`length`,e,t,{received:`${e.value.length}`}),e}}}
function c(e,t){return{kind:`validation`,type:`max_value`,reference:c,async:!1,expects:`<=${e instanceof Date?e.toJSON(): n(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&r(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON(): n(e.value)}),e}}}
function l(e,t){return{kind:`validation`,type:`min_length`,reference:l,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&r(this,`length`,e,t,{received:`${e.value.length}`}),e}}}
function u(e,t){return{kind:`validation`,type:`min_value`,reference:u,async:!1,expects:`>=${e instanceof Date?e.toJSON(): n(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&r(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON(): n(e.value)}),e}}}
function d(e){return{kind:`validation`,type:`url`,reference:d,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&r(this,`URL`,e,t),e}}}
function f(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}
function p(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}
function m(e,t){return a({kind:`schema`,type:`array`,reference:m,expects:`Array`,async:!1,item:e,message:t,"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else r(this,`type`,e,t);return e}})}
function h(e){return a({kind:`schema`,type:`date`,reference:h,expects:`Date`,async:!1,message:e,"~run"(e,t){return e.value instanceof Date?isNaN(e.value)?r(this,`type`,e,t,{received:`"Invalid Date"`}):e.typed=!0:r(this,`type`,e,t),e}})}
function g(e,t){return a({kind:`schema`,type:`nullable`,reference:g,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,"~run"(e,t){return e.value===null&&(this.default!==void 0&&(e.value= p(this,e,t)),e.value===null)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}})}
function _(e){return a({kind:`schema`,type:`number`,reference:_,expects:`number`,async:!1,message:e,"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:r(this,`type`,e,t),e}})}
function v(e,t){return a({kind:`schema`,type:`object`,reference:v,expects:`Object`,async:!1,entries:e,message:t,"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let i in this.entries){let a=this.entries[i];if(i in n||(a.type===`exact_optional`||a.type===`optional`||a.type===`nullish`)&&a.default!==void 0){let r=i in n?n[i]: p(a),o=a[`~run`]({value:r},t);if(o.issues){let a={type:`object`,origin:`value`,input:n,key:i,value:r};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[i]=o.value}else if(a.fallback!==void 0)e.value[i]= f(a);else if(a.type!==`exact_optional`&&a.type!==`optional`&&a.type!==`nullish`&&(r(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:n[i]}]}),t.abortEarly))break}}else r(this,`type`,e,t);return e}})}
function y(e,t){return a({kind:`schema`,type:`picklist`,reference:y,expects: i(e.map(n),`|`),async:!1,options:e,message:t,"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:r(this,`type`,e,t),e}})}
function b(e){return a({kind:`schema`,type:`string`,reference:b,expects:`string`,async:!1,message:e,"~run"(e,t){return typeof e.value==`string`?e.typed=!0:r(this,`type`,e,t),e}})}function x(e,n,r){let i=e[`~run`]({value:n}, t(r));if(i.issues)throw new o(i.issues);return i.value}
function S(...e){return a({...e[0],pipe:e,"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}})}const C= v({id: _(),created: h(),title: S( b(), l(1), s(100)),type: y([`jpg`,`png`]),size: _(),url: S( b(), d())});x( v({id: _(),created: h(),title: S( b(), l(1), s(100)),brand: S( b(), l(1), s(30)),description: S( b(), l(1), s(500)),price: S( _(), u(1), c(1e4)),discount: g( S( _(), u(1), c(100))),quantity: S( _(), u(0), c(10)),tags: m( S( b(), l(1), s(30))),images: m(C),ratings: m( v({id: _(),stars: S( _(), u(1), c(5)),title: S( b(), l(1), s(100)),text: S( b(), l(1), s(1e3)),images: m(C)}))}),{});