2024-10-02

This commit is contained in:
gcch 2024-10-02 16:01:46 +02:00
commit 11960f633a
51 changed files with 102 additions and 91 deletions

View file

@ -3,7 +3,8 @@ parameters:
paths:
- web/app/themes/haiku-atelier-2024
scanDirectories:
- web/wp
- vendor
- web/app/plugins
- web/wp
typeAliases:
InformationsProduitShop: 'array{id: int, nom: string, prix: string, photo_repos: string, photo_survol: string, url: string}'

View file

@ -33,7 +33,7 @@ export default defineConfig({
input: await SRC_TYPESCRIPT_PATHS,
output: {
assetFileNames: "[name][extname]",
chunkFileNames: "[name].js",
chunkFileNames: "[name].[hash].js",
compact: true,
entryFileNames: "[name].js",
validate: true,

View file

@ -1,22 +1,22 @@
{
"_Either.js": {
"file": "Either.js",
"_Either.DDEPhGsy.js": {
"file": "Either.DDEPhGsy.js",
"name": "Either"
},
"_chunk-7BKSRZNG.js": {
"file": "chunk-7BKSRZNG.js",
"_chunk-7BKSRZNG.F4GWJRq9.js": {
"file": "chunk-7BKSRZNG.F4GWJRq9.js",
"name": "chunk-7BKSRZNG"
},
"_exports.js": {
"file": "exports.js",
"_exports.dP04ITJc.js": {
"file": "exports.dP04ITJc.js",
"name": "exports"
},
"_index.js": {
"file": "index.js",
"_index.C9ScFdVV.js": {
"file": "index.C9ScFdVV.js",
"name": "index"
},
"_index2.js": {
"file": "index2.js",
"_index.Dxgx1GXj.js": {
"file": "index.Dxgx1GXj.js",
"name": "index"
},
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts": {
@ -43,9 +43,9 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/gaffe.ts",
"isEntry": true,
"imports": [
"_chunk-7BKSRZNG.js",
"_chunk-7BKSRZNG.F4GWJRq9.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"_exports.js"
"_exports.dP04ITJc.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/api.ts": {
@ -55,7 +55,7 @@
"isEntry": true,
"imports": [
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"_Either.js"
"_Either.DDEPhGsy.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts": {
@ -64,10 +64,10 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"isEntry": true,
"imports": [
"_chunk-7BKSRZNG.js",
"_chunk-7BKSRZNG.F4GWJRq9.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_Either.js",
"_exports.js"
"_Either.DDEPhGsy.js",
"_exports.dP04ITJc.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts": {
@ -76,7 +76,7 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"isEntry": true,
"imports": [
"_exports.js"
"_exports.dP04ITJc.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/gardes.ts": {
@ -92,7 +92,7 @@
"isEntry": true,
"imports": [
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"_Either.js"
"_Either.DDEPhGsy.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/messages.ts": {
@ -101,11 +101,11 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/messages.ts",
"isEntry": true,
"imports": [
"_index.js",
"_index.C9ScFdVV.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts",
"_Either.js",
"_exports.js",
"_Either.DDEPhGsy.js",
"_exports.dP04ITJc.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts"
]
},
@ -124,7 +124,7 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart-add-item.ts",
"isEntry": true,
"imports": [
"_index.js"
"_index.C9ScFdVV.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart-remove-item.ts": {
@ -133,7 +133,7 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart-remove-item.ts",
"isEntry": true,
"imports": [
"_index.js"
"_index.C9ScFdVV.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart.ts": {
@ -142,7 +142,7 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart.ts",
"isEntry": true,
"imports": [
"_index.js"
"_index.C9ScFdVV.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/erreurs.ts": {
@ -151,7 +151,7 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/erreurs.ts",
"isEntry": true,
"imports": [
"_index.js"
"_index.C9ScFdVV.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts": {
@ -160,7 +160,7 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts",
"isEntry": true,
"imports": [
"_index.js",
"_index.C9ScFdVV.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts"
]
},
@ -171,10 +171,10 @@
"isEntry": true,
"imports": [
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"_chunk-7BKSRZNG.js",
"_chunk-7BKSRZNG.F4GWJRq9.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.js",
"_Either.js"
"_exports.dP04ITJc.js",
"_Either.DDEPhGsy.js"
]
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-bouton-panier.ts": {
@ -183,16 +183,16 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/scripts-bouton-panier.ts",
"isEntry": true,
"imports": [
"_chunk-7BKSRZNG.js",
"_chunk-7BKSRZNG.F4GWJRq9.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.js",
"_Either.js",
"_index.js",
"_exports.dP04ITJc.js",
"_Either.DDEPhGsy.js",
"_index.C9ScFdVV.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts"
]
},
@ -202,9 +202,9 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier.ts",
"isEntry": true,
"imports": [
"_index2.js",
"_chunk-7BKSRZNG.js",
"_index.js",
"_index.Dxgx1GXj.js",
"_chunk-7BKSRZNG.F4GWJRq9.js",
"_index.C9ScFdVV.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts",
@ -217,8 +217,8 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"_Either.js",
"_exports.js",
"_Either.DDEPhGsy.js",
"_exports.dP04ITJc.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts"
]
},
@ -228,9 +228,9 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-produit.ts",
"isEntry": true,
"imports": [
"_index2.js",
"_chunk-7BKSRZNG.js",
"_index.js",
"_index.Dxgx1GXj.js",
"_chunk-7BKSRZNG.F4GWJRq9.js",
"_index.C9ScFdVV.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts",
@ -241,8 +241,8 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"_Either.js",
"_exports.js"
"_Either.DDEPhGsy.js",
"_exports.dP04ITJc.js"
]
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,3 @@
import{d as R}from"./api2.js";import{r as F}from"./Either.js";const H="application/json",S="Content-Type",y=Symbol(),w=Symbol();function C(t={}){var e;return(e=Object.entries(t).find(([o])=>o.toLowerCase()===S.toLowerCase()))===null||e===void 0?void 0:e[1]}function P(t){return/^application\/.*json.*/.test(t)}const u=function(t,e,o=!1){return Object.entries(e).reduce((c,[i,l])=>{const f=t[i];return Array.isArray(f)&&Array.isArray(l)?c[i]=o?[...f,...l]:l:typeof f=="object"&&typeof l=="object"?c[i]=u(f,l,o):c[i]=l,c},{...t})},g={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,o=!1,...c){const i=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!i)throw new Error(t+" is not defined");return o&&i?new i(...c):i}};function L(t,e=!1){g.options=e?t:u(g.options,t)}function N(t,e=!1){g.polyfills=e?t:u(g.polyfills,t)}function I(t){g.errorType=t}const J=t=>e=>t.reduceRight((o,c)=>c(o),e)||e;class x extends Error{}const U=t=>{const e=Object.create(null);t=t._addons.reduce((r,s)=>s.beforeRequest&&s.beforeRequest(r,t._options,e)||r,t);const{_url:o,_options:c,_config:i,_catchers:l,_resolvers:f,_middlewares:m,_addons:E}=t,d=new Map(l),D=u(i.options,c);let j=o;const v=J(m)((r,s)=>(j=r,i.polyfill("fetch")(r,s)))(o,D),b=new Error,A=v.catch(r=>{throw{[y]:r}}).then(r=>{var s;if(!r.ok){const n=new x;if(n.cause=b,n.stack=n.stack+`
import{d as R}from"./api2.js";import{r as F}from"./Either.DDEPhGsy.js";const H="application/json",S="Content-Type",y=Symbol(),w=Symbol();function C(t={}){var e;return(e=Object.entries(t).find(([o])=>o.toLowerCase()===S.toLowerCase()))===null||e===void 0?void 0:e[1]}function P(t){return/^application\/.*json.*/.test(t)}const u=function(t,e,o=!1){return Object.entries(e).reduce((c,[i,l])=>{const f=t[i];return Array.isArray(f)&&Array.isArray(l)?c[i]=o?[...f,...l]:l:typeof f=="object"&&typeof l=="object"?c[i]=u(f,l,o):c[i]=l,c},{...t})},g={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,o=!1,...c){const i=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!i)throw new Error(t+" is not defined");return o&&i?new i(...c):i}};function L(t,e=!1){g.options=e?t:u(g.options,t)}function N(t,e=!1){g.polyfills=e?t:u(g.polyfills,t)}function I(t){g.errorType=t}const J=t=>e=>t.reduceRight((o,c)=>c(o),e)||e;class x extends Error{}const U=t=>{const e=Object.create(null);t=t._addons.reduce((r,s)=>s.beforeRequest&&s.beforeRequest(r,t._options,e)||r,t);const{_url:o,_options:c,_config:i,_catchers:l,_resolvers:f,_middlewares:m,_addons:E}=t,d=new Map(l),D=u(i.options,c);let j=o;const v=J(m)((r,s)=>(j=r,i.polyfill("fetch")(r,s)))(o,D),b=new Error,A=v.catch(r=>{throw{[y]:r}}).then(r=>{var s;if(!r.ok){const n=new x;if(n.cause=b,n.stack=n.stack+`
CAUSE: `+b.stack,n.response=r,n.status=r.status,n.url=j,r.type==="opaque")throw n;const a=i.errorType==="json"||((s=r.headers.get("Content-Type"))===null||s===void 0?void 0:s.split(";")[0])==="application/json";return(i.errorType?a?r.text():r[i.errorType]():Promise.resolve(r.body)).then(h=>{throw n.message=typeof h=="string"?h:r.statusText,h&&(a&&typeof h=="string"?(n.text=h,n.json=JSON.parse(h)):n[i.errorType]=h),n})}return r}),O=r=>r.catch(s=>{const n=Object.prototype.hasOwnProperty.call(s,y),a=n?s[y]:s,T=a?.status&&d.get(a.status)||d.get(a?.name)||n&&d.has(y)&&d.get(y);if(T)return T(a,t);const h=d.get(w);if(h)return h(a,t);throw a}),_=r=>s=>O(r?A.then(n=>n&&n[r]()).then(n=>s?s(n):n):A.then(n=>s?s(n):n)),M={_wretchReq:t,_fetchReq:v,_sharedState:e,res:_(null),json:_("json"),blob:_("blob"),formData:_("formData"),arrayBuffer:_("arrayBuffer"),text:_("text"),error(r,s){return d.set(r,s),this},badRequest(r){return this.error(400,r)},unauthorized(r){return this.error(401,r)},forbidden(r){return this.error(403,r)},notFound(r){return this.error(404,r)},timeout(r){return this.error(408,r)},internalError(r){return this.error(500,r)},fetchError(r){return this.error(y,r)}},q=E.reduce((r,s)=>({...r,...typeof s.resolver=="function"?s.resolver(r):s.resolver}),M);return f.reduce((r,s)=>s(r,t),q)},k={_url:"",_options:{},_config:g,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:u(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const o=this._url.split("?");return{...this,_url:o.length>1?o[0]+t+"?"+o[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:u(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:u(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[S]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const o=new Map(this._catchers);return o.set(t,e),{...this,_catchers:o}},catcherFallback(t){return this.catcher(w,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",o=null){let c=this.url(e).options({method:t});const i=C(c._options.headers),l=this._config.polyfill("FormData",!1),f=typeof o=="object"&&!(l&&o instanceof l)&&(!c._options.headers||!i||P(i));return c=o?f?c.json(o,i):c.body(o):c,U(c._deferred.reduce((m,E)=>E(m,m._url,m._options),c))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const o=C(this._options.headers);return this.content(e||P(o)&&o||H).body(JSON.stringify(t))}};function p(t="",e={}){return{...k,_url:t,_options:e}}p.default=p;p.options=L;p.errorType=I;p.polyfills=N;p.WretchError=x;fetch(R,{credentials:"same-origin",headers:{"Content-Type":"application/json"},method:"GET",mode:"same-origin",signal:AbortSignal.timeout(5e3)}).then(F);p(R).content("application/json").options({credentials:"same-origin",mode:"same-origin",signal:AbortSignal.timeout(5e3)}).get().json().catch();
//# sourceMappingURL=api.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{o as s,a as t,p as o,n as a,b as m,s as r}from"./index.js";const n=s({attribute:r(),value:r()}),i=s({id:t(a()),quantity:t(a()),variation:t(m(n))}),p=e=>o(i,e);export{p};
import{o as s,a as t,p as o,n as a,b as m,s as r}from"./index.C9ScFdVV.js";const n=s({attribute:r(),value:r()}),i=s({id:t(a()),quantity:t(a()),variation:t(m(n))}),p=e=>o(i,e);export{p};
//# sourceMappingURL=cart-add-item.js.map

View file

@ -1 +1 @@
{"version":3,"file":"cart-add-item.js","sources":["../../src/scripts/lib/schemas/cart-add-item.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport type { WCStoreCartAddItemArgs } from \"../types/api/cart-add-item\";\n\nexport const WCStoreCartAddItemArgsItemsSchema = v.object({\n /** Variation attribute name. */\n attribute: v.string(),\n /** Variation attribute value. */\n value: v.string(),\n});\n\nexport const WCStoreCartAddItemArgsSchema = v.object({\n /** The basket item product or variation ID. */\n id: v.optional(v.number()),\n /** Quantity of this item to add to the basket. */\n quantity: v.optional(v.number()),\n /** Chosen attributes (for variations). */\n variation: v.optional(v.array(WCStoreCartAddItemArgsItemsSchema)),\n});\n\nexport const parseWCStoreCartAddItemArgs: (args: unknown) => WCStoreCartAddItemArgs = (args) =>\n v.parse(WCStoreCartAddItemArgsSchema, args);\n"],"names":["WCStoreCartAddItemArgsItemsSchema","v.object","v.string","WCStoreCartAddItemArgsSchema","v.optional","v.number","v.array","parseWCStoreCartAddItemArgs","args","v.parse"],"mappings":"kEAIa,MAAAA,EAAoCC,EAAS,CAExD,UAAWC,EAAS,EAEpB,MAAOA,EAAS,CAClB,CAAC,EAEYC,EAA+BF,EAAS,CAEnD,GAAIG,EAAWC,GAAU,EAEzB,SAAUD,EAAWC,GAAU,EAE/B,UAAWD,EAAWE,EAAQN,CAAiC,CAAC,CAClE,CAAC,EAEYO,EAA0EC,GACrFC,EAAQN,EAA8BK,CAAI"}
{"version":3,"file":"cart-add-item.js","sources":["../../src/scripts/lib/schemas/cart-add-item.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport type { WCStoreCartAddItemArgs } from \"../types/api/cart-add-item\";\n\nexport const WCStoreCartAddItemArgsItemsSchema = v.object({\n /** Variation attribute name. */\n attribute: v.string(),\n /** Variation attribute value. */\n value: v.string(),\n});\n\nexport const WCStoreCartAddItemArgsSchema = v.object({\n /** The basket item product or variation ID. */\n id: v.optional(v.number()),\n /** Quantity of this item to add to the basket. */\n quantity: v.optional(v.number()),\n /** Chosen attributes (for variations). */\n variation: v.optional(v.array(WCStoreCartAddItemArgsItemsSchema)),\n});\n\nexport const parseWCStoreCartAddItemArgs: (args: unknown) => WCStoreCartAddItemArgs = (args) =>\n v.parse(WCStoreCartAddItemArgsSchema, args);\n"],"names":["WCStoreCartAddItemArgsItemsSchema","v.object","v.string","WCStoreCartAddItemArgsSchema","v.optional","v.number","v.array","parseWCStoreCartAddItemArgs","args","v.parse"],"mappings":"2EAIa,MAAAA,EAAoCC,EAAS,CAExD,UAAWC,EAAS,EAEpB,MAAOA,EAAS,CAClB,CAAC,EAEYC,EAA+BF,EAAS,CAEnD,GAAIG,EAAWC,GAAU,EAEzB,SAAUD,EAAWC,GAAU,EAE/B,UAAWD,EAAWE,EAAQN,CAAiC,CAAC,CAClE,CAAC,EAEYO,EAA0EC,GACrFC,EAAQN,EAA8BK,CAAI"}

View file

@ -1,2 +1,2 @@
import{o as e,s as o}from"./index.js";const r=e({key:o()});export{r as W};
import{o as e,s as o}from"./index.C9ScFdVV.js";const r=e({key:o()});export{r as W};
//# sourceMappingURL=cart-remove-item.js.map

View file

@ -1 +1 @@
{"version":3,"file":"cart-remove-item.js","sources":["../../src/scripts/lib/schemas/cart-remove-item.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport type { WCStoreCartRemoveItemArgs } from \"../types/api/cart-remove-item\";\n\nexport const WCStoreCartRemoveItemArgsSchema = v.object({\n /** Unique identifier (key) for the basket item. */\n key: v.string(),\n});\n\nexport const parseWCStoreCartRemoveItemArgs = (args: WCStoreCartRemoveItemArgs): WCStoreCartRemoveItemArgs =>\n v.parse(WCStoreCartRemoveItemArgsSchema, args);\n"],"names":["WCStoreCartRemoveItemArgsSchema","v.object","v.string"],"mappings":"sCAIa,MAAAA,EAAkCC,EAAS,CAEtD,IAAKC,EAAS,CAChB,CAAC"}
{"version":3,"file":"cart-remove-item.js","sources":["../../src/scripts/lib/schemas/cart-remove-item.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport type { WCStoreCartRemoveItemArgs } from \"../types/api/cart-remove-item\";\n\nexport const WCStoreCartRemoveItemArgsSchema = v.object({\n /** Unique identifier (key) for the basket item. */\n key: v.string(),\n});\n\nexport const parseWCStoreCartRemoveItemArgs = (args: WCStoreCartRemoveItemArgs): WCStoreCartRemoveItemArgs =>\n v.parse(WCStoreCartRemoveItemArgsSchema, args);\n"],"names":["WCStoreCartRemoveItemArgsSchema","v.object","v.string"],"mappings":"+CAIa,MAAAA,EAAkCC,EAAS,CAEtD,IAAKC,EAAS,CAChB,CAAC"}

View file

@ -1,2 +1,2 @@
import{o as a,s as e,u as i,n,c as s,b as t,d as r,i as o}from"./index.js";a({name:e(),package_id:i([n(),e()])});const m=a({billing_address:s(),coupons:s(),cross_sells:s(),errors:s(),extensions:s(),fees:s(),has_calculated_shipping:s(),items:t(s()),items_count:r(n(),o()),items_weight:s(),needs_payment:s(),needs_shipping:s(),payment_methods:s(),payment_requirements:s(),shipping_address:s(),shipping_rates:s(),totals:s()});export{m as W};
import{o as a,s as e,u as i,n,c as s,b as t,d as r,i as o}from"./index.C9ScFdVV.js";a({name:e(),package_id:i([n(),e()])});const m=a({billing_address:s(),coupons:s(),cross_sells:s(),errors:s(),extensions:s(),fees:s(),has_calculated_shipping:s(),items:t(s()),items_count:r(n(),o()),items_weight:s(),needs_payment:s(),needs_shipping:s(),payment_methods:s(),payment_requirements:s(),shipping_address:s(),shipping_rates:s(),totals:s()});export{m as W};
//# sourceMappingURL=cart.js.map

View file

@ -1 +1 @@
{"version":3,"file":"cart.js","sources":["../../src/scripts/lib/schemas/cart.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nconst WCStoreCartItemTotalsSchema = v.object({\n currency_code: v.string(),\n currency_decimal_separator: v.string(),\n currency_minor_unit: v.number(),\n currency_prefix: v.string(),\n currency_suffix: v.string(),\n currency_symbol: v.string(),\n currency_thousand_separator: v.string(),\n total_discount: v.string(),\n total_discount_tax: v.string(),\n});\n\nconst WCStoreCartItemShippingRateSchema = v.object({\n name: v.string(),\n package_id: v.union([v.number(), v.string()]),\n});\n\nconst WCStoreCartItemSchema = v.object({\n code: v.string(),\n discount_type: v.string(),\n shipping_rates: v.array(WCStoreCartItemShippingRateSchema),\n totals: v.array(WCStoreCartItemTotalsSchema),\n});\n\nexport const WCStoreCartSchema = v.object({\n billing_address: v.unknown(),\n coupons: v.unknown(),\n cross_sells: v.unknown(),\n errors: v.unknown(),\n extensions: v.unknown(),\n fees: v.unknown(),\n has_calculated_shipping: v.unknown(),\n items: v.array(v.unknown()),\n items_count: v.pipe(v.number(), v.integer()),\n items_weight: v.unknown(),\n needs_payment: v.unknown(),\n needs_shipping: v.unknown(),\n payment_methods: v.unknown(),\n payment_requirements: v.unknown(),\n shipping_address: v.unknown(),\n shipping_rates: v.unknown(),\n totals: v.unknown(),\n});\n"],"names":["v.object","v.string","v.union","v.number","WCStoreCartSchema","v.unknown","v.array","v.pipe","v.integer"],"mappings":"AAc0CA,OAAAA,KAAAA,EAAAA,KAAAA,EAAAA,KAAAA,EAAAA,EAAAA,KAAAA,EAAAA,KAAAA,EAAAA,KAAAA,EAAAA,KAAAA,MAAAA,aAAAA,EAAS,CACjD,KAAMC,EAAS,EACf,WAAYC,EAAQ,CAACC,IAAYF,EAAU,CAAA,CAAC,CAC9C,CAAC,EASY,MAAAG,EAAoBJ,EAAS,CACxC,gBAAiBK,EAAU,EAC3B,QAASA,EAAU,EACnB,YAAaA,EAAU,EACvB,OAAQA,EAAU,EAClB,WAAYA,EAAU,EACtB,KAAMA,EAAU,EAChB,wBAAyBA,EAAU,EACnC,MAAOC,EAAQD,GAAW,EAC1B,YAAaE,EAAOJ,EAAY,EAAAK,GAAW,EAC3C,aAAcH,EAAU,EACxB,cAAeA,EAAU,EACzB,eAAgBA,EAAU,EAC1B,gBAAiBA,EAAU,EAC3B,qBAAsBA,EAAU,EAChC,iBAAkBA,EAAU,EAC5B,eAAgBA,EAAU,EAC1B,OAAQA,EAAU,CACpB,CAAC"}
{"version":3,"file":"cart.js","sources":["../../src/scripts/lib/schemas/cart.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nconst WCStoreCartItemTotalsSchema = v.object({\n currency_code: v.string(),\n currency_decimal_separator: v.string(),\n currency_minor_unit: v.number(),\n currency_prefix: v.string(),\n currency_suffix: v.string(),\n currency_symbol: v.string(),\n currency_thousand_separator: v.string(),\n total_discount: v.string(),\n total_discount_tax: v.string(),\n});\n\nconst WCStoreCartItemShippingRateSchema = v.object({\n name: v.string(),\n package_id: v.union([v.number(), v.string()]),\n});\n\nconst WCStoreCartItemSchema = v.object({\n code: v.string(),\n discount_type: v.string(),\n shipping_rates: v.array(WCStoreCartItemShippingRateSchema),\n totals: v.array(WCStoreCartItemTotalsSchema),\n});\n\nexport const WCStoreCartSchema = v.object({\n billing_address: v.unknown(),\n coupons: v.unknown(),\n cross_sells: v.unknown(),\n errors: v.unknown(),\n extensions: v.unknown(),\n fees: v.unknown(),\n has_calculated_shipping: v.unknown(),\n items: v.array(v.unknown()),\n items_count: v.pipe(v.number(), v.integer()),\n items_weight: v.unknown(),\n needs_payment: v.unknown(),\n needs_shipping: v.unknown(),\n payment_methods: v.unknown(),\n payment_requirements: v.unknown(),\n shipping_address: v.unknown(),\n shipping_rates: v.unknown(),\n totals: v.unknown(),\n});\n"],"names":["v.object","v.string","v.union","v.number","WCStoreCartSchema","v.unknown","v.array","v.pipe","v.integer"],"mappings":"AAc0CA,OAAAA,KAAAA,EAAAA,KAAAA,EAAAA,KAAAA,EAAAA,EAAAA,KAAAA,EAAAA,KAAAA,EAAAA,KAAAA,EAAAA,KAAAA,MAAAA,sBAAAA,EAAS,CACjD,KAAMC,EAAS,EACf,WAAYC,EAAQ,CAACC,IAAYF,EAAU,CAAA,CAAC,CAC9C,CAAC,EASY,MAAAG,EAAoBJ,EAAS,CACxC,gBAAiBK,EAAU,EAC3B,QAASA,EAAU,EACnB,YAAaA,EAAU,EACvB,OAAQA,EAAU,EAClB,WAAYA,EAAU,EACtB,KAAMA,EAAU,EAChB,wBAAyBA,EAAU,EACnC,MAAOC,EAAQD,GAAW,EAC1B,YAAaE,EAAOJ,EAAY,EAAAK,GAAW,EAC3C,aAAcH,EAAU,EACxB,cAAeA,EAAU,EACzB,eAAgBA,EAAU,EAC1B,gBAAiBA,EAAU,EAC3B,qBAAsBA,EAAU,EAChC,iBAAkBA,EAAU,EAC5B,eAAgBA,EAAU,EAC1B,OAAQA,EAAU,CACpB,CAAC"}

View file

@ -1,2 +1,2 @@
var g={done:!1,hasNext:!1};function y(i,...n){let t=i,l=n.map(r=>"lazy"in r?x(r):void 0),e=0;for(;e<n.length;){if(l[e]===void 0||!p(t)){let f=n[e];t=f(t),e+=1;continue}let r=[];for(let f=e;f<n.length;f++){let s=l[f];if(s===void 0||(r.push(s),s.isSingle))break}let o=[];for(let f of t)if(a(f,o,r))break;let{isSingle:u}=r.at(-1);t=u?o[0]:o,e+=r.length}return t}function a(i,n,t){if(t.length===0)return n.push(i),!1;let l=i,e=g,r=!1;for(let[o,u]of t.entries()){let{index:f,items:s}=u;if(s.push(l),e=u(l,f,s),u.index+=1,e.hasNext){if(e.hasMany??!1){for(let h of e.next)if(a(h,n,t.slice(o+1)))return!0;return r}l=e.next}if(!e.hasNext)break;e.done&&(r=!0)}return e.hasNext&&n.push(l),r}function x(i){let{lazy:n,lazyArgs:t}=i,l=n(...t);return Object.assign(l,{isSingle:n.single??!1,index:0,items:[]})}function p(i){return typeof i=="string"||typeof i=="object"&&i!==null&&Symbol.iterator in i}export{y as x};
//# sourceMappingURL=chunk-7BKSRZNG.js.map
//# sourceMappingURL=chunk-7BKSRZNG.F4GWJRq9.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"chunk-7BKSRZNG.F4GWJRq9.js","sources":["../../../../../../node_modules/.pnpm/remeda@2.14.0/node_modules/remeda/dist/chunk-ANXBDSUI.js","../../../../../../node_modules/.pnpm/remeda@2.14.0/node_modules/remeda/dist/chunk-7BKSRZNG.js"],"sourcesContent":["var e={done:!0,hasNext:!1},s={done:!1,hasNext:!1},a=()=>e,o=t=>({hasNext:!0,next:t,done:!1});export{s as a,a as b,o as c};\n","import{a as s}from\"./chunk-ANXBDSUI.js\";function x(t,...o){let n=t,u=o.map(e=>\"lazy\"in e?f(e):void 0),p=0;for(;p<o.length;){if(u[p]===void 0||!B(n)){let i=o[p];n=i(n),p+=1;continue}let r=[];for(let i=p;i<o.length;i++){let l=u[i];if(l===void 0||(r.push(l),l.isSingle))break}let a=[];for(let i of n)if(A(i,a,r))break;let{isSingle:y}=r.at(-1);n=y?a[0]:a,p+=r.length}return n}function A(t,o,n){if(n.length===0)return o.push(t),!1;let u=t,p=s,e=!1;for(let[r,a]of n.entries()){let{index:y,items:i}=a;if(i.push(u),p=a(u,y,i),a.index+=1,p.hasNext){if(p.hasMany??!1){for(let l of p.next)if(A(l,o,n.slice(r+1)))return!0;return e}u=p.next}if(!p.hasNext)break;p.done&&(e=!0)}return p.hasNext&&o.push(u),e}function f(t){let{lazy:o,lazyArgs:n}=t,u=o(...n);return Object.assign(u,{isSingle:o.single??!1,index:0,items:[]})}function B(t){return typeof t==\"string\"||typeof t==\"object\"&&t!==null&&Symbol.iterator in t}export{x as a};\n"],"names":["s","x","t","o","n","u","e","f","p","B","i","l","a","A","y","r"],"mappings":"AAAG,IAAwBA,EAAE,CAAC,KAAK,GAAG,QAAQ,EAAE,ECAR,SAASC,EAAEC,KAAKC,EAAE,CAAC,IAAIC,EAAEF,EAAEG,EAAEF,EAAE,IAAIG,GAAG,SAASA,EAAEC,EAAED,CAAC,EAAE,MAAM,EAAEE,EAAE,EAAE,KAAKA,EAAEL,EAAE,QAAQ,CAAC,GAAGE,EAAEG,CAAC,IAAI,QAAQ,CAACC,EAAEL,CAAC,EAAE,CAAC,IAAIM,EAAEP,EAAEK,CAAC,EAAEJ,EAAEM,EAAEN,CAAC,EAAEI,GAAG,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAA,EAAG,QAAQE,EAAEF,EAAEE,EAAEP,EAAE,OAAOO,IAAI,CAAC,IAAIC,EAAEN,EAAEK,CAAC,EAAE,GAAGC,IAAI,SAAS,EAAE,KAAKA,CAAC,EAAEA,EAAE,UAAU,KAAK,CAAC,IAAIC,EAAE,GAAG,QAAQF,KAAKN,EAAE,GAAGS,EAAEH,EAAEE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,SAASE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAEV,EAAEU,EAAEF,EAAE,CAAC,EAAEA,EAAEJ,GAAG,EAAE,MAAM,CAAC,OAAOJ,CAAC,CAAC,SAASS,EAAEX,EAAEC,EAAEC,EAAE,CAAC,GAAGA,EAAE,SAAS,EAAE,OAAOD,EAAE,KAAKD,CAAC,EAAE,GAAG,IAAIG,EAAEH,EAAEM,EAAER,EAAEM,EAAE,GAAG,OAAO,CAACS,EAAEH,CAAC,IAAIR,EAAE,QAAS,EAAC,CAAC,GAAG,CAAC,MAAMU,EAAE,MAAMJ,CAAC,EAAEE,EAAE,GAAGF,EAAE,KAAKL,CAAC,EAAEG,EAAEI,EAAEP,EAAES,EAAEJ,CAAC,EAAEE,EAAE,OAAO,EAAEJ,EAAE,QAAQ,CAAC,GAAGA,EAAE,SAAS,GAAG,CAAC,QAAQG,KAAKH,EAAE,KAAK,GAAGK,EAAEF,EAAER,EAAEC,EAAE,MAAMW,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAOT,CAAC,CAACD,EAAEG,EAAE,IAAI,CAAC,GAAG,CAACA,EAAE,QAAQ,MAAMA,EAAE,OAAOF,EAAE,GAAG,CAAC,OAAOE,EAAE,SAASL,EAAE,KAAKE,CAAC,EAAEC,CAAC,CAAC,SAASC,EAAEL,EAAE,CAAC,GAAG,CAAC,KAAKC,EAAE,SAASC,CAAC,EAAEF,EAAEG,EAAEF,EAAE,GAAGC,CAAC,EAAE,OAAO,OAAO,OAAOC,EAAE,CAAC,SAASF,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAE,CAAA,CAAC,CAAC,CAAC,SAASM,EAAEP,EAAE,CAAC,OAAO,OAAOA,GAAG,UAAU,OAAOA,GAAG,UAAUA,IAAI,MAAM,OAAO,YAAYA,CAAC","x_google_ignoreList":[0,1]}

View file

@ -1 +0,0 @@
{"version":3,"file":"chunk-7BKSRZNG.js","sources":["../../../../../../node_modules/.pnpm/remeda@2.14.0/node_modules/remeda/dist/chunk-ANXBDSUI.js","../../../../../../node_modules/.pnpm/remeda@2.14.0/node_modules/remeda/dist/chunk-7BKSRZNG.js"],"sourcesContent":["var e={done:!0,hasNext:!1},s={done:!1,hasNext:!1},a=()=>e,o=t=>({hasNext:!0,next:t,done:!1});export{s as a,a as b,o as c};\n","import{a as s}from\"./chunk-ANXBDSUI.js\";function x(t,...o){let n=t,u=o.map(e=>\"lazy\"in e?f(e):void 0),p=0;for(;p<o.length;){if(u[p]===void 0||!B(n)){let i=o[p];n=i(n),p+=1;continue}let r=[];for(let i=p;i<o.length;i++){let l=u[i];if(l===void 0||(r.push(l),l.isSingle))break}let a=[];for(let i of n)if(A(i,a,r))break;let{isSingle:y}=r.at(-1);n=y?a[0]:a,p+=r.length}return n}function A(t,o,n){if(n.length===0)return o.push(t),!1;let u=t,p=s,e=!1;for(let[r,a]of n.entries()){let{index:y,items:i}=a;if(i.push(u),p=a(u,y,i),a.index+=1,p.hasNext){if(p.hasMany??!1){for(let l of p.next)if(A(l,o,n.slice(r+1)))return!0;return e}u=p.next}if(!p.hasNext)break;p.done&&(e=!0)}return p.hasNext&&o.push(u),e}function f(t){let{lazy:o,lazyArgs:n}=t,u=o(...n);return Object.assign(u,{isSingle:o.single??!1,index:0,items:[]})}function B(t){return typeof t==\"string\"||typeof t==\"object\"&&t!==null&&Symbol.iterator in t}export{x as a};\n"],"names":["s","x","t","o","n","u","e","f","p","B","i","l","a","A","y","r"],"mappings":"AAAG,IAAwBA,EAAE,CAAC,KAAK,GAAG,QAAQ,EAAE,ECAR,SAASC,EAAEC,KAAKC,EAAE,CAAC,IAAIC,EAAEF,EAAEG,EAAEF,EAAE,IAAIG,GAAG,SAASA,EAAEC,EAAED,CAAC,EAAE,MAAM,EAAEE,EAAE,EAAE,KAAKA,EAAEL,EAAE,QAAQ,CAAC,GAAGE,EAAEG,CAAC,IAAI,QAAQ,CAACC,EAAEL,CAAC,EAAE,CAAC,IAAIM,EAAEP,EAAEK,CAAC,EAAEJ,EAAEM,EAAEN,CAAC,EAAEI,GAAG,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAA,EAAG,QAAQE,EAAEF,EAAEE,EAAEP,EAAE,OAAOO,IAAI,CAAC,IAAIC,EAAEN,EAAEK,CAAC,EAAE,GAAGC,IAAI,SAAS,EAAE,KAAKA,CAAC,EAAEA,EAAE,UAAU,KAAK,CAAC,IAAIC,EAAE,GAAG,QAAQF,KAAKN,EAAE,GAAGS,EAAEH,EAAEE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,SAASE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAEV,EAAEU,EAAEF,EAAE,CAAC,EAAEA,EAAEJ,GAAG,EAAE,MAAM,CAAC,OAAOJ,CAAC,CAAC,SAASS,EAAEX,EAAEC,EAAEC,EAAE,CAAC,GAAGA,EAAE,SAAS,EAAE,OAAOD,EAAE,KAAKD,CAAC,EAAE,GAAG,IAAIG,EAAEH,EAAEM,EAAER,EAAEM,EAAE,GAAG,OAAO,CAACS,EAAEH,CAAC,IAAIR,EAAE,QAAS,EAAC,CAAC,GAAG,CAAC,MAAMU,EAAE,MAAMJ,CAAC,EAAEE,EAAE,GAAGF,EAAE,KAAKL,CAAC,EAAEG,EAAEI,EAAEP,EAAES,EAAEJ,CAAC,EAAEE,EAAE,OAAO,EAAEJ,EAAE,QAAQ,CAAC,GAAGA,EAAE,SAAS,GAAG,CAAC,QAAQG,KAAKH,EAAE,KAAK,GAAGK,EAAEF,EAAER,EAAEC,EAAE,MAAMW,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAOT,CAAC,CAACD,EAAEG,EAAE,IAAI,CAAC,GAAG,CAACA,EAAE,QAAQ,MAAMA,EAAE,OAAOF,EAAE,GAAG,CAAC,OAAOE,EAAE,SAASL,EAAE,KAAKE,CAAC,EAAEC,CAAC,CAAC,SAASC,EAAEL,EAAE,CAAC,GAAG,CAAC,KAAKC,EAAE,SAASC,CAAC,EAAEF,EAAEG,EAAEF,EAAE,GAAGC,CAAC,EAAE,OAAO,OAAO,OAAOC,EAAE,CAAC,SAASF,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAE,CAAA,CAAC,CAAC,CAAC,SAASM,EAAEP,EAAE,CAAC,OAAO,OAAOA,GAAG,UAAU,OAAOA,GAAG,UAAUA,IAAI,MAAM,OAAO,YAAYA,CAAC","x_google_ignoreList":[0,1]}

View file

@ -1,2 +1,2 @@
import{x as m}from"./chunk-7BKSRZNG.js";import{e as n,f as a,g as c,h as o}from"./erreurs.js";import{E as s,r as E,l as i}from"./Either.js";import"./exports.js";function p(e){return e!==null}function l(e){return e===void 0?!0:typeof e=="string"||Array.isArray(e)?e.length===0:Object.keys(e).length===0}const f=e=>e,L=e=>r=>s.encase(()=>e.querySelector(r)).mapLeft(t=>n(c(r))).chain(t=>p(t)?E(t):i(n(o(r)))),R=e=>r=>s.encase(()=>m(e.querySelectorAll(r),Array.from)).mapLeft(t=>n(c(r))).chain(t=>l(t)?i(n(o(r))):E(t)),S=e=>e.caseOf({Left:a,Right:f}),g=e=>e.caseOf({Left:a,Right:f});export{g as a,L as b,R as c,S as r};
import{x as m}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{e as n,f as a,g as c,h as o}from"./erreurs.js";import{E as s,r as E,l as i}from"./Either.DDEPhGsy.js";import"./exports.dP04ITJc.js";function p(e){return e!==null}function l(e){return e===void 0?!0:typeof e=="string"||Array.isArray(e)?e.length===0:Object.keys(e).length===0}const f=e=>e,L=e=>r=>s.encase(()=>e.querySelector(r)).mapLeft(t=>n(c(r))).chain(t=>p(t)?E(t):i(n(o(r)))),R=e=>r=>s.encase(()=>m(e.querySelectorAll(r),Array.from)).mapLeft(t=>n(c(r))).chain(t=>l(t)?i(n(o(r))):E(t)),S=e=>e.caseOf({Left:a,Right:f}),g=e=>e.caseOf({Left:a,Right:f});export{g as a,L as b,R as c,S as r};
//# sourceMappingURL=dom2.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{$ as o}from"./exports.js";const u=r=>`Le selecteur "${r}" est invalide`,d=r=>`La requête "${r}" n'a retourné aucun Élément.`,i=r=>new SyntaxError(r);class s extends Error{constructor(e="400 BadRequestError"){super(e),this.name="BadRequestError"}}class t extends Error{constructor(e="401 UnauthorizedError"){super(e),this.name="UnauthorizedError"}}class n extends Error{constructor(e="404 NotFoundError"){super(e),this.name="NotFoundError"}}class E extends Error{constructor(e="500 ServerError"){super(e),this.name="ServerError"}}class a extends Error{constructor(e){super(JSON.stringify(e)),this.name="UnknownError"}}class l extends Error{constructor(e){super(JSON.stringify(e)),this.name="DOMElementAbsentError"}}const h=r=>new a(r),m=r=>{throw r},w=r=>{throw new s(`(${r.code}) ${r.message}`)},p=r=>{throw new t(`(${r.code}) ${r.message}`)},v=r=>{throw new n(`(${r.code}) ${r.message}`)},R=r=>{throw new E(r)},S=r=>(console.error(r),o(r)),x=r=>{throw o(r),r};export{l as D,h as E,w as a,p as b,v as c,m as d,i as e,x as f,u as g,d as h,R as l,S as r};
import{$ as o}from"./exports.dP04ITJc.js";const u=r=>`Le selecteur "${r}" est invalide`,d=r=>`La requête "${r}" n'a retourné aucun Élément.`,i=r=>new SyntaxError(r);class s extends Error{constructor(e="400 BadRequestError"){super(e),this.name="BadRequestError"}}class t extends Error{constructor(e="401 UnauthorizedError"){super(e),this.name="UnauthorizedError"}}class n extends Error{constructor(e="404 NotFoundError"){super(e),this.name="NotFoundError"}}class E extends Error{constructor(e="500 ServerError"){super(e),this.name="ServerError"}}class a extends Error{constructor(e){super(JSON.stringify(e)),this.name="UnknownError"}}class l extends Error{constructor(e){super(JSON.stringify(e)),this.name="DOMElementAbsentError"}}const h=r=>new a(r),m=r=>{throw r},w=r=>{throw new s(`(${r.code}) ${r.message}`)},p=r=>{throw new t(`(${r.code}) ${r.message}`)},v=r=>{throw new n(`(${r.code}) ${r.message}`)},R=r=>{throw new E(r)},S=r=>(console.error(r),o(r)),x=r=>{throw o(r),r};export{l as D,h as E,w as a,p as b,v as c,m as d,i as e,x as f,u as g,d as h,R as l,S as r};
//# sourceMappingURL=erreurs.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{e as t,o as s,n as r,s as o}from"./index.js";const e=s({code:o(),data:s({status:r()}),message:o()}),c=s({body:e,status:r()}),n=a=>t(c,a);export{n as i};
import{e as t,o as s,n as r,s as o}from"./index.C9ScFdVV.js";const e=s({code:o(),data:s({status:r()}),message:o()}),c=s({body:e,status:r()}),n=a=>t(c,a);export{n as i};
//# sourceMappingURL=erreurs2.js.map

View file

@ -1 +1 @@
{"version":3,"file":"erreurs2.js","sources":["../../src/scripts/lib/schemas/erreurs.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport type { WCError } from \"../types/api/erreurs\";\n\nexport const WCErrorBodySchema = v.object({\n code: v.string(),\n data: v.object({\n status: v.number(),\n }),\n message: v.string(),\n});\n\nexport const WCErrorSchema = v.object({\n body: WCErrorBodySchema,\n status: v.number(),\n});\n\nexport const isWCError = (donnees: unknown): donnees is WCError => v.is(WCErrorSchema, donnees);\n"],"names":["WCErrorBodySchema","v.object","v.string","v.number","WCErrorSchema","isWCError","donnees","v.is"],"mappings":"oDAIa,MAAAA,EAAoBC,EAAS,CACxC,KAAMC,EAAS,EACf,KAAMD,EAAS,CACb,OAAQE,EAAS,CAAA,CAClB,EACD,QAASD,EAAS,CACpB,CAAC,EAEYE,EAAgBH,EAAS,CACpC,KAAMD,EACN,OAAQG,EAAS,CACnB,CAAC,EAEYE,EAAaC,GAAyCC,EAAKH,EAAeE,CAAO"}
{"version":3,"file":"erreurs2.js","sources":["../../src/scripts/lib/schemas/erreurs.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nimport type { WCError } from \"../types/api/erreurs\";\n\nexport const WCErrorBodySchema = v.object({\n code: v.string(),\n data: v.object({\n status: v.number(),\n }),\n message: v.string(),\n});\n\nexport const WCErrorSchema = v.object({\n body: WCErrorBodySchema,\n status: v.number(),\n});\n\nexport const isWCError = (donnees: unknown): donnees is WCError => v.is(WCErrorSchema, donnees);\n"],"names":["WCErrorBodySchema","v.object","v.string","v.number","WCErrorSchema","isWCError","donnees","v.is"],"mappings":"6DAIa,MAAAA,EAAoBC,EAAS,CACxC,KAAMC,EAAS,EACf,KAAMD,EAAS,CACb,OAAQE,EAAS,CAAA,CAClB,EACD,QAASD,EAAS,CACpB,CAAC,EAEYE,EAAgBH,EAAS,CACpC,KAAMD,EACN,OAAQG,EAAS,CACnB,CAAC,EAEYE,EAAaC,GAAyCC,EAAKH,EAAeE,CAAO"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
import{x as _t}from"./chunk-7BKSRZNG.js";import{E as me,a as ge}from"./api2.js";import{i as J,t as yt,c as Ge,D as ae,l as f,g as Et,G as h,C as vt,f as O,o as _e,a as C,b as We,d as V,r as Ye,S as Ke,e as k,h as ce,n as St,j as Xe,k as g,u as bt,m as B,p as ye,q as ue,s as Ee,v as kt,w as It,x as ze,y as Tt,z as Z,A as Je,B as ve,E as y,F as wt,H as Se,I as q,J as Ve,K as be,L as Rt,M as ke,N as le,O as Nt,P as Ct,Q as P,R as Ot,U as $,T as $t,V as Pt,W as Ie,X as Dt,Y as G,Z as Ft,_ as xt}from"./exports.js";function Ht(t,e,n=250,r,s,o,i){if(!o.exception||!o.exception.values||!i||!J(i.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=Lt(Q(t,e,s,i.originalException,r,o.exception.values,a,0),n))}function Q(t,e,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(J(r[s],Error)){Te(i,a);const u=t(e,r[s]),d=c.length;we(u,s,d,a),c=Q(t,e,n,r[s],s,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(J(u,Error)){Te(i,a);const l=t(e,u),m=c.length;we(l,`errors[${d}]`,m,a),c=Q(t,e,n,u,s,[l,...c],l,m)}}),c}function Te(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function we(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Lt(t,e){return t.map(n=>(n.value&&(n.value=yt(n.value,e)),n))}function Ze(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Mt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ut(t){return t==="http"||t==="https"}function W(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function jt(t){const e=Mt.exec(t);if(!e){Ge(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",o="",i="",a=""]=e.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Qe({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Qe(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Bt(t){if(!ae)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(f.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Ut(r)?e&&isNaN(parseInt(e,10))?(f.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(f.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(f.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function At(t){const e=typeof t=="string"?jt(t):Qe(t);if(!(!e||!Bt(e)))return e}class b extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}const A={},Re={};function w(t,e){A[t]=A[t]||[],A[t].push(e)}function R(t,e){Re[t]||(e(),Re[t]=!0)}function S(t,e){const n=t&&A[t];if(n)for(const r of n)try{r(e)}catch(s){ae&&f.error(`Error while triggering instrumentation handler.
import{x as _t}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{E as me,a as ge}from"./api2.js";import{i as J,t as yt,c as Ge,D as ae,l as f,g as Et,G as h,C as vt,f as O,o as _e,a as C,b as We,d as V,r as Ye,S as Ke,e as k,h as ce,n as St,j as Xe,k as g,u as bt,m as B,p as ye,q as ue,s as Ee,v as kt,w as It,x as ze,y as Tt,z as Z,A as Je,B as ve,E as y,F as wt,H as Se,I as q,J as Ve,K as be,L as Rt,M as ke,N as le,O as Nt,P as Ct,Q as P,R as Ot,U as $,T as $t,V as Pt,W as Ie,X as Dt,Y as G,Z as Ft,_ as xt}from"./exports.dP04ITJc.js";function Ht(t,e,n=250,r,s,o,i){if(!o.exception||!o.exception.values||!i||!J(i.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=Lt(Q(t,e,s,i.originalException,r,o.exception.values,a,0),n))}function Q(t,e,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(J(r[s],Error)){Te(i,a);const u=t(e,r[s]),d=c.length;we(u,s,d,a),c=Q(t,e,n,r[s],s,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(J(u,Error)){Te(i,a);const l=t(e,u),m=c.length;we(l,`errors[${d}]`,m,a),c=Q(t,e,n,u,s,[l,...c],l,m)}}),c}function Te(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function we(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Lt(t,e){return t.map(n=>(n.value&&(n.value=yt(n.value,e)),n))}function Ze(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Mt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ut(t){return t==="http"||t==="https"}function W(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function jt(t){const e=Mt.exec(t);if(!e){Ge(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",o="",i="",a=""]=e.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Qe({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Qe(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Bt(t){if(!ae)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(f.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Ut(r)?e&&isNaN(parseInt(e,10))?(f.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(f.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(f.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function At(t){const e=typeof t=="string"?jt(t):Qe(t);if(!(!e||!Bt(e)))return e}class b extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}const A={},Re={};function w(t,e){A[t]=A[t]||[],A[t].push(e)}function R(t,e){Re[t]||(e(),Re[t]=!0)}function S(t,e){const n=t&&A[t];if(n)for(const r of n)try{r(e)}catch(s){ae&&f.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${Et(r)}
Error:`,s)}}function qt(t){const e="console";w(e,t),R(e,Gt)}function Gt(){"console"in h&&vt.forEach(function(t){t in h.console&&O(h.console,t,function(e){return _e[t]=e,function(...n){S("console",{args:n,level:t});const s=_e[t];s&&s.apply(h.console,n)}})})}const ee=h;function Wt(){if(!("fetch"in ee))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Ne(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function et(){if(typeof EdgeRuntime=="string")return!0;if(!Wt())return!1;if(Ne(ee.fetch))return!0;let t=!1;const e=ee.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Ne(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){ae&&f.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function tt(t,e){const n="fetch";w(n,t),R(n,()=>Yt(void 0,e))}function Yt(t,e=!1){e&&!et()||O(h,"fetch",function(n){return function(...r){const{method:s,url:o}=Kt(r),i={args:r,fetchData:{method:s,url:o},startTimestamp:C()*1e3};S("fetch",{...i});const a=new Error().stack;return n.apply(h,r).then(async c=>(S("fetch",{...i,endTimestamp:C()*1e3,response:c}),c),c=>{throw S("fetch",{...i,endTimestamp:C()*1e3,error:c}),We(c)&&c.stack===void 0&&(c.stack=a,V(c,"framesToPop",1)),c})}})}function te(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Ce(t){return typeof t=="string"?t:t?te(t,"url")?t.url:t.toString?t.toString():"":""}function Kt(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:Ce(n),method:te(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:Ce(e),method:te(e,"method")?String(e.method).toUpperCase():"GET"}}let H=null;function Xt(t){const e="error";w(e,t),R(e,zt)}function zt(){H=h.onerror,h.onerror=function(t,e,n,r,s){return S("error",{column:r,error:s,line:n,msg:t,url:e}),H&&!H.__SENTRY_LOADER__?H.apply(this,arguments):!1},h.onerror.__SENTRY_INSTRUMENTED__=!0}let L=null;function Jt(t){const e="unhandledrejection";w(e,t),R(e,Vt)}function Vt(){L=h.onunhandledrejection,h.onunhandledrejection=function(t){return S("unhandledrejection",t),L&&!L.__SENTRY_LOADER__?L.apply(this,arguments):!0},h.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Zt(){return"npm"}function Qt(t){const e=[];function n(){return t===void 0||e.length<t}function r(i){return e.splice(e.indexOf(i),1)[0]||Promise.resolve(void 0)}function s(i){if(!n())return Ye(new b("Not adding Promise because buffer limit was reached."));const a=i();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function o(i){return new Ke((a,c)=>{let u=e.length;if(!u)return a(!0);const d=setTimeout(()=>{i&&i>0&&a(!1)},i);e.forEach(l=>{k(l).then(()=>{--u||(clearTimeout(d),a(!0))},c)})})}return{$:e,add:s,drain:o}}function X(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const en=["fatal","error","warning","log","info","debug"];function tn(t){return t==="warn"?"warning":en.includes(t)?t:"log"}function D(t,e=[]){return[t,e]}function nn(t,e){const[n,r]=t;return[n,[...r,e]]}function Oe(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function ne(t){return h.__SENTRY__&&h.__SENTRY__.encodePolyfill?h.__SENTRY__.encodePolyfill(t):new TextEncoder().encode(t)}function rn(t){const[e,n]=t;let r=JSON.stringify(e);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[ne(r),o]:r.push(typeof o=="string"?ne(o):o)}for(const o of n){const[i,a]=o;if(s(`

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{d as g,c as M}from"./api2.js";import{E as h,r as o,l as f,M as p,n as u,j as c}from"./Either.js";var l;const y={liftEither(i){if(i.isRight())return Promise.resolve(i.extract());throw i.extract()},fromPromise(i){return i.then(y.liftEither)},throwE(i){throw i}};class m{constructor(t){this.runPromise=t,this[l]="EitherAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this.then=(r,e)=>this.run().then(r,e)}leftOrDefault(t){return this.run().then(r=>r.leftOrDefault(t))}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return n(async t=>{const r=await this;if(r.isRight()){const e=await r.extract();return t.liftEither(e)}return t.liftEither(r)})}ap(t){return n(async r=>{const e=await t;if(e.isRight()){const a=await this.run();return a.isRight()?e.extract()(a.extract()):r.liftEither(a)}return r.liftEither(e)})}alt(t){return n(async r=>{const e=await this.run();if(e.isRight())return e.extract();{const a=await t;return r.liftEither(a)}})}extend(t){return n(async r=>{const e=await this.run();if(e.isRight()){const a=n.liftEither(e);return r.liftEither(o(t(a)))}return r.liftEither(e)})}async run(){try{return o(await this.runPromise(y))}catch(t){return f(t)}}bimap(t,r){return n(async e=>{const a=await this.run();try{return await e.liftEither(a.bimap(t,r))}catch(P){throw await P}})}map(t){return n(r=>this.runPromise(r).then(t))}mapLeft(t){return n(async r=>{try{return await this.runPromise(r)}catch(e){throw await t(e)}})}chain(t){return n(async r=>{const e=await this.runPromise(r);return r.fromPromise(t(e))})}chainLeft(t){return n(async r=>{try{return await this.runPromise(r)}catch(e){return r.fromPromise(t(e))}})}toMaybeAsync(){return s(async({liftMaybe:t})=>{const r=await this.run();return t(r.toMaybe())})}swap(){return n(async t=>{const r=await this.run();return r.isRight()&&t.throwE(r.extract()),t.liftEither(o(r.extract()))})}ifLeft(t){return n(async r=>{const e=await this.run();return e.ifLeft(t),r.liftEither(e)})}ifRight(t){return n(async r=>{const e=await this.run();return e.ifRight(t),r.liftEither(e)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return n(({fromPromise:r})=>r(this.run().finally(t)))}}l=Symbol.toStringTag;const n=Object.assign(i=>new m(i),{fromPromise:i=>n(({fromPromise:t})=>t(i())),liftEither:i=>n(({liftEither:t})=>t(i)),lefts:i=>Promise.all(i.map(t=>t.run())).then(h.lefts),rights:i=>Promise.all(i.map(t=>t.run())).then(h.rights),sequence:i=>n(async t=>{let r=[];for await(const e of i){if(e.isLeft())return t.liftEither(e);r.push(e.extract())}return t.liftEither(o(r))}),all:i=>n.fromPromise(async()=>Promise.all(i).then(h.sequence))});m.prototype.constructor=n;var w;const E={liftMaybe(i){if(i.isJust())return Promise.resolve(i.extract());throw u},fromPromise(i){return i.then(E.liftMaybe)}};class b{constructor(t){this.runPromise=t,this[w]="MaybeAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/filter"]=this.filter,this["fantasy-land/alt"]=this.alt}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return s(async t=>{const r=await this.run();if(r.isJust()){const e=await r.extract();return t.liftMaybe(e)}return t.liftMaybe(u)})}ap(t){return s(async r=>{const e=await t;if(e.isJust()){const a=await this.run();return a.isJust()?e.extract()(a.extract()):r.liftMaybe(u)}return r.liftMaybe(u)})}alt(t){return s(async r=>{const e=await this.run();if(e.isJust())return e.extract();{const a=await t;return r.liftMaybe(a)}})}extend(t){return s(async r=>{const e=await this.run();if(e.isJust()){const a=s.liftMaybe(e);return r.liftMaybe(c(t(a)))}return r.liftMaybe(u)})}filter(t){return s(async r=>{const e=await this.run();return r.liftMaybe(e.filter(t))})}async run(){try{return c(await this.runPromise(E))}catch{return u}}map(t){return s(r=>this.runPromise(r).then(t))}chain(t){return s(async r=>{const e=await this.runPromise(r);return r.fromPromise(t(e))})}toEitherAsync(t){return n(async({liftEither:r})=>{const e=await this.run();return r(e.toEither(t))})}ifJust(t){return s(async r=>{const e=await this.run();return e.ifJust(t),r.liftMaybe(e)})}ifNothing(t){return s(async r=>{const e=await this.run();return e.ifNothing(t),r.liftMaybe(e)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return s(({fromPromise:r})=>r(this.run().finally(t)))}then(t,r){return this.run().then(t,r)}}w=Symbol.toStringTag;const s=Object.assign(i=>new b(i),{catMaybes:i=>Promise.all(i).then(p.catMaybes),fromPromise:i=>s(({fromPromise:t})=>t(i())),liftMaybe:i=>s(({liftMaybe:t})=>t(i))});b.prototype.constructor=s;const d=_etats,x=()=>fetch(g,{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[M]:d.nonce},method:"GET",mode:"same-origin",signal:AbortSignal.timeout(5e3)}).then(o).catch(f);n.fromPromise(x).map(i=>i.json()).ifLeft(i=>{console.error(i)});
import{d as g,c as M}from"./api2.js";import{E as h,r as o,l as f,M as p,n as u,j as c}from"./Either.DDEPhGsy.js";var l;const y={liftEither(i){if(i.isRight())return Promise.resolve(i.extract());throw i.extract()},fromPromise(i){return i.then(y.liftEither)},throwE(i){throw i}};class m{constructor(t){this.runPromise=t,this[l]="EitherAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this.then=(r,e)=>this.run().then(r,e)}leftOrDefault(t){return this.run().then(r=>r.leftOrDefault(t))}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return n(async t=>{const r=await this;if(r.isRight()){const e=await r.extract();return t.liftEither(e)}return t.liftEither(r)})}ap(t){return n(async r=>{const e=await t;if(e.isRight()){const a=await this.run();return a.isRight()?e.extract()(a.extract()):r.liftEither(a)}return r.liftEither(e)})}alt(t){return n(async r=>{const e=await this.run();if(e.isRight())return e.extract();{const a=await t;return r.liftEither(a)}})}extend(t){return n(async r=>{const e=await this.run();if(e.isRight()){const a=n.liftEither(e);return r.liftEither(o(t(a)))}return r.liftEither(e)})}async run(){try{return o(await this.runPromise(y))}catch(t){return f(t)}}bimap(t,r){return n(async e=>{const a=await this.run();try{return await e.liftEither(a.bimap(t,r))}catch(P){throw await P}})}map(t){return n(r=>this.runPromise(r).then(t))}mapLeft(t){return n(async r=>{try{return await this.runPromise(r)}catch(e){throw await t(e)}})}chain(t){return n(async r=>{const e=await this.runPromise(r);return r.fromPromise(t(e))})}chainLeft(t){return n(async r=>{try{return await this.runPromise(r)}catch(e){return r.fromPromise(t(e))}})}toMaybeAsync(){return s(async({liftMaybe:t})=>{const r=await this.run();return t(r.toMaybe())})}swap(){return n(async t=>{const r=await this.run();return r.isRight()&&t.throwE(r.extract()),t.liftEither(o(r.extract()))})}ifLeft(t){return n(async r=>{const e=await this.run();return e.ifLeft(t),r.liftEither(e)})}ifRight(t){return n(async r=>{const e=await this.run();return e.ifRight(t),r.liftEither(e)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return n(({fromPromise:r})=>r(this.run().finally(t)))}}l=Symbol.toStringTag;const n=Object.assign(i=>new m(i),{fromPromise:i=>n(({fromPromise:t})=>t(i())),liftEither:i=>n(({liftEither:t})=>t(i)),lefts:i=>Promise.all(i.map(t=>t.run())).then(h.lefts),rights:i=>Promise.all(i.map(t=>t.run())).then(h.rights),sequence:i=>n(async t=>{let r=[];for await(const e of i){if(e.isLeft())return t.liftEither(e);r.push(e.extract())}return t.liftEither(o(r))}),all:i=>n.fromPromise(async()=>Promise.all(i).then(h.sequence))});m.prototype.constructor=n;var w;const E={liftMaybe(i){if(i.isJust())return Promise.resolve(i.extract());throw u},fromPromise(i){return i.then(E.liftMaybe)}};class b{constructor(t){this.runPromise=t,this[w]="MaybeAsync",this["fantasy-land/chain"]=this.chain,this["fantasy-land/filter"]=this.filter,this["fantasy-land/alt"]=this.alt}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return s(async t=>{const r=await this.run();if(r.isJust()){const e=await r.extract();return t.liftMaybe(e)}return t.liftMaybe(u)})}ap(t){return s(async r=>{const e=await t;if(e.isJust()){const a=await this.run();return a.isJust()?e.extract()(a.extract()):r.liftMaybe(u)}return r.liftMaybe(u)})}alt(t){return s(async r=>{const e=await this.run();if(e.isJust())return e.extract();{const a=await t;return r.liftMaybe(a)}})}extend(t){return s(async r=>{const e=await this.run();if(e.isJust()){const a=s.liftMaybe(e);return r.liftMaybe(c(t(a)))}return r.liftMaybe(u)})}filter(t){return s(async r=>{const e=await this.run();return r.liftMaybe(e.filter(t))})}async run(){try{return c(await this.runPromise(E))}catch{return u}}map(t){return s(r=>this.runPromise(r).then(t))}chain(t){return s(async r=>{const e=await this.runPromise(r);return r.fromPromise(t(e))})}toEitherAsync(t){return n(async({liftEither:r})=>{const e=await this.run();return r(e.toEither(t))})}ifJust(t){return s(async r=>{const e=await this.run();return e.ifJust(t),r.liftMaybe(e)})}ifNothing(t){return s(async r=>{const e=await this.run();return e.ifNothing(t),r.liftMaybe(e)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return s(({fromPromise:r})=>r(this.run().finally(t)))}then(t,r){return this.run().then(t,r)}}w=Symbol.toStringTag;const s=Object.assign(i=>new b(i),{catMaybes:i=>Promise.all(i).then(p.catMaybes),fromPromise:i=>s(({fromPromise:t})=>t(i())),liftMaybe:i=>s(({liftMaybe:t})=>t(i))});b.prototype.constructor=s;const d=_etats,x=()=>fetch(g,{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[M]:d.nonce},method:"GET",mode:"same-origin",signal:AbortSignal.timeout(5e3)}).then(o).catch(f);n.fromPromise(x).map(i=>i.json()).ifLeft(i=>{console.error(i)});
//# sourceMappingURL=gestion-panier.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{p as a}from"./index.js";import{r as o}from"./erreurs.js";import{M as i}from"./messages2.js";import{E as s}from"./Either.js";import"./exports.js";import"./messages3.js";const E=r=>s.of(a(i,r.data)).ifLeft(e=>{o(e)});export{E as v};
import{p as a}from"./index.C9ScFdVV.js";import{r as o}from"./erreurs.js";import{M as i}from"./messages2.js";import{E as s}from"./Either.DDEPhGsy.js";import"./exports.dP04ITJc.js";import"./messages3.js";const E=r=>s.of(a(i,r.data)).ifLeft(e=>{o(e)});export{E as v};
//# sourceMappingURL=messages.js.map

View file

@ -1 +1 @@
{"version":3,"file":"messages.js","sources":["../../src/scripts/lib/messages.ts"],"sourcesContent":["import { Either } from \"purify-ts\";\nimport { parse, type ValiError } from \"valibot\";\n\nimport type { MiseAJourPanierMessage } from \"./types/messages\";\n\nimport { reporteErreur } from \"./erreurs.ts\";\nimport { MiseAJourPanierMessageSchema } from \"./schemas/messages.ts\";\n\nexport const valideMessageMajPanier = (\n evenementMessage: MessageEvent<unknown>,\n): Either<ValiError<typeof MiseAJourPanierMessageSchema>, MiseAJourPanierMessage> =>\n Either\n .of<ValiError<typeof MiseAJourPanierMessageSchema>, MiseAJourPanierMessage>(\n parse(MiseAJourPanierMessageSchema, evenementMessage.data),\n )\n .ifLeft(erreur => {\n reporteErreur(erreur);\n });\n"],"names":["parse","reporteErreur","MiseAJourPanierMessageSchema","Either","valideMessageMajPanier","evenementMessage","erreur"],"mappings":"AAQa,OAAA,KAAAA,MAAA,aAAA,OAAA,KAAAC,MAAA,eAAA,OAAA,KAAAC,MAAA,iBAAA,OAAA,KAAAC,MAAA,cAAA,MAAA,eAAA,MAAA,iBAAA,MAAAC,EACXC,GAEAF,EACG,GACCH,EAAME,EAA8BG,EAAiB,IAAI,CAC3D,EACC,OAAiBC,GAAA,CAChBL,EAAcK,CAAM,CACtB,CAAC"}
{"version":3,"file":"messages.js","sources":["../../src/scripts/lib/messages.ts"],"sourcesContent":["import { Either } from \"purify-ts\";\nimport { parse, type ValiError } from \"valibot\";\n\nimport type { MiseAJourPanierMessage } from \"./types/messages\";\n\nimport { reporteErreur } from \"./erreurs.ts\";\nimport { MiseAJourPanierMessageSchema } from \"./schemas/messages.ts\";\n\nexport const valideMessageMajPanier = (\n evenementMessage: MessageEvent<unknown>,\n): Either<ValiError<typeof MiseAJourPanierMessageSchema>, MiseAJourPanierMessage> =>\n Either\n .of<ValiError<typeof MiseAJourPanierMessageSchema>, MiseAJourPanierMessage>(\n parse(MiseAJourPanierMessageSchema, evenementMessage.data),\n )\n .ifLeft(erreur => {\n reporteErreur(erreur);\n });\n"],"names":["parse","reporteErreur","MiseAJourPanierMessageSchema","Either","valideMessageMajPanier","evenementMessage","erreur"],"mappings":"AAQa,OAAA,KAAAA,MAAA,sBAAA,OAAA,KAAAC,MAAA,eAAA,OAAA,KAAAC,MAAA,iBAAA,OAAA,KAAAC,MAAA,uBAAA,MAAA,wBAAA,MAAA,iBAAA,MAAAC,EACXC,GAEAF,EACG,GACCH,EAAME,EAA8BG,EAAiB,IAAI,CAC3D,EACC,OAAiBC,GAAA,CAChBL,EAAcK,CAAM,CACtB,CAAC"}

View file

@ -1,2 +1,2 @@
import{f as s,o as a,n as o,d as r,v as n,s as i}from"./index.js";import{T as e}from"./messages3.js";s(e);const p=a({donnees:o(),type:r(i(),n(e.MiseAJourPanier))});export{p as M};
import{f as s,o as a,n as o,d as r,v as n,s as i}from"./index.C9ScFdVV.js";import{T as e}from"./messages3.js";s(e);const p=a({donnees:o(),type:r(i(),n(e.MiseAJourPanier))});export{p as M};
//# sourceMappingURL=messages2.js.map

View file

@ -1 +1 @@
{"version":3,"file":"messages2.js","sources":["../../src/scripts/lib/schemas/messages.ts"],"sourcesContent":["/**\n * Schémas des Messages passés avec BroadcastChannel.\n */\n\nimport * as v from \"valibot\";\n\nimport { TYPES_MESSAGES } from \"../../constantes/messages.ts\";\n\nexport const TypesMessagesSchema = v.enum(TYPES_MESSAGES);\n\nexport const MiseAJourPanierMessageSchema = v.object({\n donnees: v.number(),\n type: v.pipe(v.string(), v.value(TYPES_MESSAGES.MiseAJourPanier)),\n});\n"],"names":["v.enum","TYPES_MESSAGES","MiseAJourPanierMessageSchema","v.object","v.number","v.pipe","v.string","v.value"],"mappings":"qGAQmCA,EAAOC,CAAc,EAE3C,MAAAC,EAA+BC,EAAS,CACnD,QAASC,EAAS,EAClB,KAAMC,EAAOC,EAAE,EAAUC,EAAQN,EAAe,eAAe,CAAC,CAClE,CAAC"}
{"version":3,"file":"messages2.js","sources":["../../src/scripts/lib/schemas/messages.ts"],"sourcesContent":["/**\n * Schémas des Messages passés avec BroadcastChannel.\n */\n\nimport * as v from \"valibot\";\n\nimport { TYPES_MESSAGES } from \"../../constantes/messages.ts\";\n\nexport const TypesMessagesSchema = v.enum(TYPES_MESSAGES);\n\nexport const MiseAJourPanierMessageSchema = v.object({\n donnees: v.number(),\n type: v.pipe(v.string(), v.value(TYPES_MESSAGES.MiseAJourPanier)),\n});\n"],"names":["v.enum","TYPES_MESSAGES","MiseAJourPanierMessageSchema","v.object","v.number","v.pipe","v.string","v.value"],"mappings":"8GAQmCA,EAAOC,CAAc,EAE3C,MAAAC,EAA+BC,EAAS,CACnD,QAASC,EAAS,EAClB,KAAMC,EAAOC,EAAE,EAAUC,EAAQN,EAAe,eAAe,CAAC,CAClE,CAAC"}

View file

@ -1,2 +1,2 @@
import{x as n}from"./chunk-7BKSRZNG.js";import{S as i,A as m}from"./dom.js";import{N as a}from"./messages3.js";import{r as s}from"./dom2.js";import{v as N}from"./messages.js";import{r as p}from"./utils.js";import"./erreurs.js";import"./exports.js";import"./Either.js";import"./index.js";import"./messages2.js";const E=()=>{const t=n(p(i),s),r=new BroadcastChannel(a);r.onmessage=o=>{N(o).ifRight(e=>{t.textContent=`cart (${String(e.donnees)})`,t.setAttribute(m,String(e.donnees>0))})}};document.addEventListener("DOMContentLoaded",()=>{E()});
import{x as n}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{S as i,A as m}from"./dom.js";import{N as a}from"./messages3.js";import{r as s}from"./dom2.js";import{v as N}from"./messages.js";import{r as p}from"./utils.js";import"./erreurs.js";import"./exports.dP04ITJc.js";import"./Either.DDEPhGsy.js";import"./index.C9ScFdVV.js";import"./messages2.js";const E=()=>{const t=n(p(i),s),r=new BroadcastChannel(a);r.onmessage=o=>{N(o).ifRight(e=>{t.textContent=`cart (${String(e.donnees)})`,t.setAttribute(m,String(e.donnees>0))})}};document.addEventListener("DOMContentLoaded",()=>{E()});
//# sourceMappingURL=scripts-bouton-panier.js.map

View file

@ -1 +1 @@
{"version":3,"file":"scripts-bouton-panier.js","sources":["../../src/scripts/scripts-bouton-panier.ts"],"sourcesContent":["/**\n * Scripts pour la mise à jour trans-fenêtres/trans-onglets du Bouton du Panier.\n */\n\nimport { pipe } from \"remeda\";\n\nimport type { MiseAJourPanierMessage } from \"./lib/types/messages\";\n\nimport { ATTRIBUT_CONTIENT_ARTICLES, SELECTEUR_BOUTON_PANIER } from \"./constantes/dom.ts\";\nimport { NOM_CANAL_BOUTON_PANIER } from \"./constantes/messages.ts\";\nimport { recupereElementOuLeve } from \"./lib/dom.ts\";\nimport { valideMessageMajPanier } from \"./lib/messages.ts\";\nimport { recupereElementDocumentEither } from \"./lib/utils.ts\";\n\nconst initialiseBoutonPanier = (): void => {\n /** Le « Bouton » vers le Panier dont le texte est un indicateur du nombre de Produits dedans. */\n const BOUTON_PANIER: HTMLAnchorElement = pipe(\n recupereElementDocumentEither<HTMLAnchorElement>(SELECTEUR_BOUTON_PANIER),\n recupereElementOuLeve,\n );\n const CANAL_BOUTON_PANIER: BroadcastChannel = new BroadcastChannel(NOM_CANAL_BOUTON_PANIER);\n\n CANAL_BOUTON_PANIER.onmessage = (evenementMessage: MessageEvent<unknown>): void => {\n valideMessageMajPanier(evenementMessage)\n // Met à jour le Bouton du Panier\n .ifRight((message: MiseAJourPanierMessage) => {\n BOUTON_PANIER.textContent = `cart (${String(message.donnees)})`;\n BOUTON_PANIER.setAttribute(ATTRIBUT_CONTIENT_ARTICLES, String(message.donnees > 0));\n });\n };\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n initialiseBoutonPanier();\n});\n"],"names":["initialiseBoutonPanier","BOUTON_PANIER","pipe","recupereElementDocumentEither","SELECTEUR_BOUTON_PANIER","recupereElementOuLeve","CANAL_BOUTON_PANIER","NOM_CANAL_BOUTON_PANIER","evenementMessage","valideMessageMajPanier","message","ATTRIBUT_CONTIENT_ARTICLES"],"mappings":"sTAcA,MAAMA,EAAyB,IAAY,CAEzC,MAAMC,EAAmCC,EACvCC,EAAiDC,CAAuB,EACxEC,CAAA,EAEIC,EAAwC,IAAI,iBAAiBC,CAAuB,EAEtED,EAAA,UAAaE,GAAkD,CACjFC,EAAuBD,CAAgB,EAEpC,QAASE,GAAoC,CAC5CT,EAAc,YAAc,SAAS,OAAOS,EAAQ,OAAO,CAAC,IAC5DT,EAAc,aAAaU,EAA4B,OAAOD,EAAQ,QAAU,CAAC,CAAC,CAAA,CACnF,CAAA,CAEP,EAEA,SAAS,iBAAiB,mBAAoB,IAAM,CAC3BV,GACzB,CAAC"}
{"version":3,"file":"scripts-bouton-panier.js","sources":["../../src/scripts/scripts-bouton-panier.ts"],"sourcesContent":["/**\n * Scripts pour la mise à jour trans-fenêtres/trans-onglets du Bouton du Panier.\n */\n\nimport { pipe } from \"remeda\";\n\nimport type { MiseAJourPanierMessage } from \"./lib/types/messages\";\n\nimport { ATTRIBUT_CONTIENT_ARTICLES, SELECTEUR_BOUTON_PANIER } from \"./constantes/dom.ts\";\nimport { NOM_CANAL_BOUTON_PANIER } from \"./constantes/messages.ts\";\nimport { recupereElementOuLeve } from \"./lib/dom.ts\";\nimport { valideMessageMajPanier } from \"./lib/messages.ts\";\nimport { recupereElementDocumentEither } from \"./lib/utils.ts\";\n\nconst initialiseBoutonPanier = (): void => {\n /** Le « Bouton » vers le Panier dont le texte est un indicateur du nombre de Produits dedans. */\n const BOUTON_PANIER: HTMLAnchorElement = pipe(\n recupereElementDocumentEither<HTMLAnchorElement>(SELECTEUR_BOUTON_PANIER),\n recupereElementOuLeve,\n );\n const CANAL_BOUTON_PANIER: BroadcastChannel = new BroadcastChannel(NOM_CANAL_BOUTON_PANIER);\n\n CANAL_BOUTON_PANIER.onmessage = (evenementMessage: MessageEvent<unknown>): void => {\n valideMessageMajPanier(evenementMessage)\n // Met à jour le Bouton du Panier\n .ifRight((message: MiseAJourPanierMessage) => {\n BOUTON_PANIER.textContent = `cart (${String(message.donnees)})`;\n BOUTON_PANIER.setAttribute(ATTRIBUT_CONTIENT_ARTICLES, String(message.donnees > 0));\n });\n };\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n initialiseBoutonPanier();\n});\n"],"names":["initialiseBoutonPanier","BOUTON_PANIER","pipe","recupereElementDocumentEither","SELECTEUR_BOUTON_PANIER","recupereElementOuLeve","CANAL_BOUTON_PANIER","NOM_CANAL_BOUTON_PANIER","evenementMessage","valideMessageMajPanier","message","ATTRIBUT_CONTIENT_ARTICLES"],"mappings":"0VAcA,MAAMA,EAAyB,IAAY,CAEzC,MAAMC,EAAmCC,EACvCC,EAAiDC,CAAuB,EACxEC,CAAA,EAEIC,EAAwC,IAAI,iBAAiBC,CAAuB,EAEtED,EAAA,UAAaE,GAAkD,CACjFC,EAAuBD,CAAgB,EAEpC,QAASE,GAAoC,CAC5CT,EAAc,YAAc,SAAS,OAAOS,EAAQ,OAAO,CAAC,IAC5DT,EAAc,aAAaU,EAA4B,OAAOD,EAAQ,QAAU,CAAC,CAAC,CAAA,CACnF,CAAA,CAEP,EAEA,SAAS,iBAAiB,mBAAoB,IAAM,CAC3BV,GACzB,CAAC"}

View file

@ -1,2 +1,2 @@
import{r as _,p as R,z as u,N as E}from"./index2.js";import{x as t}from"./chunk-7BKSRZNG.js";import{p as m}from"./index.js";import{R as l}from"./api2.js";import{a as T,b as C,c as f,d as I,A as S}from"./dom.js";import{N,T as P}from"./messages3.js";import{a as d,r as O,b as h}from"./dom2.js";import{r as c,D as L,l as v,a as U,b as g,c as B,E as b,d as M}from"./erreurs.js";import{e as w,a as y}from"./gardes.js";import{v as D}from"./messages.js";import{p as W}from"./reseau.js";import{W as k}from"./cart-remove-item.js";import{W as j}from"./cart.js";import{i}from"./erreurs2.js";import{a as x,r as z}from"./utils.js";import{M as G,E as J}from"./Either.js";import"./exports.js";import"./messages2.js";const X=_etats,q=t(x(T),d),F=t(z(C),O),Y=()=>{q.forEach(r=>{const o=G.fromNullable(r.getAttribute(f));h(r)(I).ifLeft(()=>t(new L(`L'entrée « ${o.orDefault("CLE_PANIER_INEXISTANTE")} » n'a pas de Bouton de suppression.`),c)).ifRight(s=>{s.addEventListener("click",()=>{const p=o.ifNothing(()=>{r.remove()}).orDefault("CLE_PANIER_INEXISTANTE");s.textContent="C= C= C= C= C=┌(;・ω・)┘",J.encase(()=>m(k,{key:p})).map(A=>{W({corps:JSON.stringify(A),nonce:X.nonce,route:l}).then(async e=>{w(e)&&v("500 Server Error"),t(await e.json(),n=>u(n).with({body:E.select(),status:400},i,U).with({body:E.select(),status:401},i,g).with({body:E.select(),status:404},i,B).with(E._,a=>m(j,a)).otherwise(a=>t(a,b,M)),R("items_count"),_(n=>{new BroadcastChannel(N).postMessage({donnees:n,type:P.MiseAJourPanier}),r.remove()}))}).catch(e=>{y(e)?(c(e),console.error(e)):console.error("e n'est pas une Erreur ?!",e)})})})})})},$=()=>{const r=new BroadcastChannel(N);r.onmessage=o=>{D(o).ifRight(s=>{F.setAttribute(S,String(s.donnees!==0))})}};document.addEventListener("DOMContentLoaded",()=>{Y(),$()});
import{r as _,p as R,z as u,N as E}from"./index.Dxgx1GXj.js";import{x as t}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{p as m}from"./index.C9ScFdVV.js";import{R as l}from"./api2.js";import{a as T,b as C,c as f,d as I,A as S}from"./dom.js";import{N,T as P}from"./messages3.js";import{a as d,r as O,b as h}from"./dom2.js";import{r as c,D as L,l as v,a as U,b as g,c as B,E as b,d as M}from"./erreurs.js";import{e as w,a as y}from"./gardes.js";import{v as D}from"./messages.js";import{p as W}from"./reseau.js";import{W as k}from"./cart-remove-item.js";import{W as j}from"./cart.js";import{i}from"./erreurs2.js";import{a as x,r as z}from"./utils.js";import{M as G,E as J}from"./Either.DDEPhGsy.js";import"./exports.dP04ITJc.js";import"./messages2.js";const X=_etats,q=t(x(T),d),F=t(z(C),O),Y=()=>{q.forEach(r=>{const o=G.fromNullable(r.getAttribute(f));h(r)(I).ifLeft(()=>t(new L(`L'entrée « ${o.orDefault("CLE_PANIER_INEXISTANTE")} » n'a pas de Bouton de suppression.`),c)).ifRight(s=>{s.addEventListener("click",()=>{const p=o.ifNothing(()=>{r.remove()}).orDefault("CLE_PANIER_INEXISTANTE");s.textContent="C= C= C= C= C=┌(;・ω・)┘",J.encase(()=>m(k,{key:p})).map(A=>{W({corps:JSON.stringify(A),nonce:X.nonce,route:l}).then(async e=>{w(e)&&v("500 Server Error"),t(await e.json(),n=>u(n).with({body:E.select(),status:400},i,U).with({body:E.select(),status:401},i,g).with({body:E.select(),status:404},i,B).with(E._,a=>m(j,a)).otherwise(a=>t(a,b,M)),R("items_count"),_(n=>{new BroadcastChannel(N).postMessage({donnees:n,type:P.MiseAJourPanier}),r.remove()}))}).catch(e=>{y(e)?(c(e),console.error(e)):console.error("e n'est pas une Erreur ?!",e)})})})})})},$=()=>{const r=new BroadcastChannel(N);r.onmessage=o=>{D(o).ifRight(s=>{F.setAttribute(S,String(s.donnees!==0))})}};document.addEventListener("DOMContentLoaded",()=>{Y(),$()});
//# sourceMappingURL=scripts-page-panier.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{r as A,p as C,z as O,N as n}from"./index2.js";import{x as o}from"./chunk-7BKSRZNG.js";import{p as f}from"./index.js";import{b as I,c as L}from"./api2.js";import{S as U,e as R,f as g,g as h,h as v,i as u,j as T,k as p}from"./dom.js";import{N as b,T as P}from"./messages3.js";import{r as m,a as l}from"./dom2.js";import{l as w,a as y,b as B,c as D,E as M,d as J,r as j}from"./erreurs.js";import{b as x,e as W,a as G}from"./gardes.js";import{p as k}from"./cart-add-item.js";import{W as q}from"./cart.js";import{i as c}from"./erreurs2.js";import{r as d,a as N}from"./utils.js";import{M as z,E as H}from"./Either.js";import"./exports.js";const V=_etats,F=a=>{a.forEach(e=>{e[0].setAttribute(u,"false"),e[1].setAttribute(T,"true")})};o(d(U),m);const s=o(d(R),m),i=o(d(g),m),Q=o(N(h),l),Y=o(N(v),l),K=()=>{const a=new Map;Q.forEach((e,t)=>{const r=e.getAttribute("id"),E=Y[t];if(!r)throw new Error("Le lien ne dispose pas d'ID !");if(!E)throw new Error("Le lien ne dispose pas de section correspondante !");a.set(r,[e,E]),e.addEventListener("click",_=>{_.preventDefault();const S=e.getAttribute(u)==="true";F(o(a.values(),Array.from)),!S&&(e.setAttribute(u,"true"),E.removeAttribute(T))})}),i.addEventListener("change",e=>{o(e.target,z.fromNullable,t=>t.filter(x),t=>t.map(r=>r.validity.valid),t=>t.ifJust(r=>s.toggleAttribute(p,!r)))}),s.addEventListener("click",e=>X())},X=()=>{s.textContent="Adding...",H.encase(()=>k({id:Number(i.value),quantity:1})).map(a=>{fetch(I,{body:JSON.stringify(a),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[L]:V.nonce},method:"POST",mode:"same-origin",signal:AbortSignal.timeout(5e3)}).then(async e=>{W(e)&&w("500 Server Error"),o(await e.json(),t=>O(t).with({body:n.select(),status:400},c,y).with({body:n.select(),status:401},c,B).with({body:n.select(),status:404},c,D).with(n._,r=>f(q,r)).otherwise(r=>o(r,M,J)),A(t=>console.debug("Panier",t)),C("items_count"),A(t=>{s.textContent="Added to cart!",new BroadcastChannel(b).postMessage({donnees:t,type:P.MiseAJourPanier}),setTimeout(()=>{i.value=i.options.item(0)?.value??"--",s.toggleAttribute(p,!0),s.textContent="Add to cart"},3e3)}))}).catch(e=>{G(e)?(j(e),console.error(e)):console.error("e n'est pas une Erreur ?!",e),s.textContent="Add to cart"})})};document.addEventListener("DOMContentLoaded",()=>{K()});
import{r as A,p as C,z as O,N as n}from"./index.Dxgx1GXj.js";import{x as o}from"./chunk-7BKSRZNG.F4GWJRq9.js";import{p as f}from"./index.C9ScFdVV.js";import{b as I,c as L}from"./api2.js";import{S as U,e as R,f as g,g as h,h as v,i as u,j as T,k as p}from"./dom.js";import{N as b,T as P}from"./messages3.js";import{r as m,a as l}from"./dom2.js";import{l as w,a as y,b as B,c as D,E as M,d as J,r as j}from"./erreurs.js";import{b as x,e as W,a as G}from"./gardes.js";import{p as k}from"./cart-add-item.js";import{W as q}from"./cart.js";import{i as c}from"./erreurs2.js";import{r as d,a as N}from"./utils.js";import{M as z,E as H}from"./Either.DDEPhGsy.js";import"./exports.dP04ITJc.js";const V=_etats,F=a=>{a.forEach(e=>{e[0].setAttribute(u,"false"),e[1].setAttribute(T,"true")})};o(d(U),m);const s=o(d(R),m),i=o(d(g),m),Q=o(N(h),l),Y=o(N(v),l),K=()=>{const a=new Map;Q.forEach((e,t)=>{const r=e.getAttribute("id"),E=Y[t];if(!r)throw new Error("Le lien ne dispose pas d'ID !");if(!E)throw new Error("Le lien ne dispose pas de section correspondante !");a.set(r,[e,E]),e.addEventListener("click",_=>{_.preventDefault();const S=e.getAttribute(u)==="true";F(o(a.values(),Array.from)),!S&&(e.setAttribute(u,"true"),E.removeAttribute(T))})}),i.addEventListener("change",e=>{o(e.target,z.fromNullable,t=>t.filter(x),t=>t.map(r=>r.validity.valid),t=>t.ifJust(r=>s.toggleAttribute(p,!r)))}),s.addEventListener("click",e=>X())},X=()=>{s.textContent="Adding...",H.encase(()=>k({id:Number(i.value),quantity:1})).map(a=>{fetch(I,{body:JSON.stringify(a),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[L]:V.nonce},method:"POST",mode:"same-origin",signal:AbortSignal.timeout(5e3)}).then(async e=>{W(e)&&w("500 Server Error"),o(await e.json(),t=>O(t).with({body:n.select(),status:400},c,y).with({body:n.select(),status:401},c,B).with({body:n.select(),status:404},c,D).with(n._,r=>f(q,r)).otherwise(r=>o(r,M,J)),A(t=>console.debug("Panier",t)),C("items_count"),A(t=>{s.textContent="Added to cart!",new BroadcastChannel(b).postMessage({donnees:t,type:P.MiseAJourPanier}),setTimeout(()=>{i.value=i.options.item(0)?.value??"--",s.toggleAttribute(p,!0),s.textContent="Add to cart"},3e3)}))}).catch(e=>{G(e)?(j(e),console.error(e)):console.error("e n'est pas une Erreur ?!",e),s.textContent="Add to cart"})})};document.addEventListener("DOMContentLoaded",()=>{K()});
//# sourceMappingURL=scripts-page-produit.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{c as e,b as r}from"./dom2.js";import"./chunk-7BKSRZNG.js";import"./erreurs.js";import"./exports.js";import"./Either.js";const p=e(document),u=r(document);export{p as a,u as r};
import{c as e,b as r}from"./dom2.js";import"./chunk-7BKSRZNG.F4GWJRq9.js";import"./erreurs.js";import"./exports.dP04ITJc.js";import"./Either.DDEPhGsy.js";const p=e(document),u=r(document);export{p as a,u as r};
//# sourceMappingURL=utils.js.map

View file

@ -1 +1 @@
{"version":3,"file":"utils.js","sources":["../../src/scripts/lib/utils.ts"],"sourcesContent":["import type { Either } from \"purify-ts\";\n\nimport { recupereElementAvecSelecteur, recupereElementsAvecSelecteur } from \"./dom.ts\";\n\nexport const recupereElementsDocumentEither: <E extends Element = Element>(\n selecteur: string,\n) => Either<SyntaxError, Array<E>> = recupereElementsAvecSelecteur(document);\n\nexport const recupereElementDocumentEither: <E extends Element = Element>(selecteur: string) => Either<SyntaxError, E> =\n recupereElementAvecSelecteur(document);\n"],"names":["recupereElementsAvecSelecteur","recupereElementAvecSelecteur","recupereElementsDocumentEither","recupereElementDocumentEither"],"mappings":"AAIa,OAAA,KAAAA,EAAA,KAAAC,MAAA,YAAA,MAAA,sBAAA,MAAA,eAAA,MAAA,eAAA,MAAA,cAAA,MAAAC,EAEwBF,EAA8B,QAAQ,EAE9DG,EACXF,EAA6B,QAAQ"}
{"version":3,"file":"utils.js","sources":["../../src/scripts/lib/utils.ts"],"sourcesContent":["import type { Either } from \"purify-ts\";\n\nimport { recupereElementAvecSelecteur, recupereElementsAvecSelecteur } from \"./dom.ts\";\n\nexport const recupereElementsDocumentEither: <E extends Element = Element>(\n selecteur: string,\n) => Either<SyntaxError, Array<E>> = recupereElementsAvecSelecteur(document);\n\nexport const recupereElementDocumentEither: <E extends Element = Element>(selecteur: string) => Either<SyntaxError, E> =\n recupereElementAvecSelecteur(document);\n"],"names":["recupereElementsAvecSelecteur","recupereElementAvecSelecteur","recupereElementsDocumentEither","recupereElementDocumentEither"],"mappings":"AAIa,OAAA,KAAAA,EAAA,KAAAC,MAAA,YAAA,MAAA,+BAAA,MAAA,eAAA,MAAA,wBAAA,MAAA,uBAAA,MAAAC,EAEwBF,EAA8B,QAAQ,EAE9DG,EACXF,EAA6B,QAAQ"}

View file

@ -93,7 +93,15 @@ function woocommerce_photoswipe(): void {
remove_theme_support("wc-product-gallery-slider");
}
/**
* Désactive l'Attribution des Commandes WooCommerce.
*/
function desactive_attribution_commande_woocommerce() {
update_option("woocommerce_feature_order_attribution_enabled", "");
}
add_action("add_meta_boxes", "desactive_champs_admin_images_produit_woocommerce", 40);
add_action("after_setup_theme", "desactive_images_produit_woocommerce");
add_action("enqueue_block_assets", "desactive_blocs_gutenberg_woocommerce");
add_action("wp_enqueue_scripts", "dequeue_woocommerce_styles_scripts");
add_action("init", "desactive_attribution_commande_woocommerce");

View file

@ -61,8 +61,8 @@ function recupere_informations_produit_page_produit($donnees_produit): mixed {
fn($id) => wc_get_product_category_list($id),
fn($categorie) => strtolower($categorie),
),
/* Slug de la Collection */
"collection" => get_the_terms($donnees_produit->get_id(), "collection")[0]->slug,
// Slug de la Collection - Peut ne pas avoir été défini
"collection" => get_the_terms($donnees_produit->get_id(), "collection")[0]?->slug ?? "",
/* Détails (Description) du Produit */
"details" => wpautop($donnees_produit->get_description()),
/* Identifiant du Produit */
@ -76,8 +76,8 @@ function recupere_informations_produit_page_produit($donnees_produit): mixed {
$array = get_post_meta($post_id = $donnees_produit->get_id(), $key = "_photos_colonne_gauche|||0|value"),
),
"photos_colonne_droite" => array_map(
$callback = "genere_balise_img",
$array = carbon_get_the_post_meta("photos_colonne_droite"),
callback: "genere_balise_img",
array: carbon_get_the_post_meta("photos_colonne_droite"),
),
"photo_repos" => wp_get_attachment_image(
get_post_meta($post_id = $donnees_produit->get_id(), $key = "_photos_colonne_gauche|||0|value")[0],

View file

@ -28,6 +28,8 @@
{# Boîte des information du Produit #}
{% include "parts/pages/produit/informations-produit.twig" %}
{# Produits similaires, généralement ceux de la même Collection #}
{# Produits de la même Collection (Produits similaires) #}
{% if produit.collection != "" %}
{% include "parts/pages/produit/produits-similaires.twig" %}
{% endif %}
{% endblock contenu %}