"use strict";(self.webpackChunk_pixelpay_ui_core=self.webpackChunk_pixelpay_ui_core||[]).push([[6661],{"./src/components/x-gallery/playground.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Simple:()=>Simple,__namedExportsOrder:()=>__namedExportsOrder,default:()=>playground_stories});var builder=__webpack_require__("./src/utils/builder.ts"),helpers=__webpack_require__("./src/utils/helpers.ts");const playground_stories={title:"Components/Gallery",component:"x-gallery",parameters:{mockData:[{url:"/services/media/gallery",method:"GET",status:200,response:request=>{const page=parseInt(request.searchParams.page)??1;return{success:!0,data:{items:Array(1==page?9:10).fill("image").map(((value,index)=>({uuid:(0,helpers.OX)(value),url:`https://picsum.photos/100/100.jpg?random=${index+10*page}`,type:"image"}))),has_more:3>page,total:29}}}},{url:"/services/media/gallery",method:"POST",status:200,response:request=>{const file=request.body.get("image");return{success:!0,data:{uuid:(0,helpers.OX)("image"),url:URL.createObjectURL(file),type:"image"}}}},{url:"/services/media/gallery",method:"DELETE",status:200,response:request=>({success:!0,data:{uuid:request.searchParams.uuid??""}})},{url:"/services/media/generate",method:"GET",status:200,response:()=>({success:!0,data:{items:Array(9).fill("image").map(((value,index)=>({uuid:(0,helpers.OX)(value),url:`https://picsum.photos/100/100.jpg?random=${index+1}`,type:"image"}))),total:19}})},{url:"/services/media/generate",method:"POST",status:200,response:request=>{const body=request.body;return{success:!0,data:{uuid:(0,helpers.OX)("image"),url:`https://picsum.photos/100/100.jpg?random=${Math.floor(100*Math.random())+1}`,type:"image",prompt:body.get("prompt")}}}}]}},Simple=new builder.Ay((args=>`<div>\n    <x-button onclick="query('test').load()" color="primary">x-gallery.load(...)</x-button>\n    <x-gallery ref="test" ${(0,builder.qT)(args)}></x-gallery>\n    <img alt="Cropped Result" style="margin-top: 2rem; border: 1px solid #EEE; border-radius: 6px; box-shadow: 0 0 16px rgba(0,0,0,0.2); min-width: 150px; min-height: 150px; display: none">\n</div>\n<script>\n    document.addEventListener('DOMContentLoaded', () => {\n        const gallery = query('test');\n\n        if (gallery) {\n            gallery.addEventListener('selected', e => {\n                query('img').src = e.detail.url;\n                query('img').style.display = 'block';\n            });\n        }\n    });\n<\/script>`)).args({}).build(),__namedExportsOrder=["Simple"];Simple.parameters={...Simple.parameters,docs:{...Simple.parameters?.docs,source:{originalSource:"Template.args({}).build()",...Simple.parameters?.docs?.source}}}},"./src/utils/builder.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{oi:()=>ColorsControl,WZ:()=>CountriesControl,Sx:()=>IconsControl,aM:()=>LogosControl,Ay:()=>Template,qT:()=>toProps});const colors=["default","primary","accent","danger","warning","success","info","blue","indigo","purple","pink","red","orange","yellow","green","teal","cyan","brown","stone"];var dist=__webpack_require__("./node_modules/simply-beautiful/dist/index.js"),dist_default=__webpack_require__.n(dist),icons=__webpack_require__("./node_modules/@pixelpay/fonts/dist/icons.json"),logos=__webpack_require__("./node_modules/@pixelpay/fonts/dist/logos.json"),social=__webpack_require__("./node_modules/@pixelpay/fonts/dist/social.json"),flags=__webpack_require__("./node_modules/@pixelpay/fonts/dist/flags.json");const Icons=Object.keys(icons),Logos=Object.keys(logos),IconsControl=(Object.keys(social),{options:Icons,control:{type:"select"}}),LogosControl={options:Logos,control:{type:"select"}},ColorsControl={options:colors,control:{type:"select"}},CountriesControl={options:flags,control:{type:"select"}},toProps=(args,except=[])=>Object.keys(args).filter((key=>!except.includes(key))).map((key=>`${key.replace(/[A-Z]/g,(match=>"-"+match.toLowerCase()))}="${args[key]}"`)).join(" ");class Template{template;argsValues;argsTypes;doc;constructor(template){this.template=template,this.argsValues={},this.argsTypes={},this.doc=null}args(value){return this.argsValues=value,this}types(value){return this.argsTypes=value,this}build(overrideTemplate=null){const base=overrideTemplate||this.template,build={render:base};return build.args=this.argsValues,build.argTypes=this.argsTypes,build.parameters={storySource:{source:dist_default().html(base(build.args),{indent_size:2})}},build}}}}]);