https://wutheringwaves.gg/wp-content/plugins/dotgg-game/common/js/async/1177.fbb1c75b681e63f2b10e.js
1"use strict";(self.webpackChunkallyourbasedotgg=self.webpackChunkallyourbasedotgg||[]).push([[1177],{37762(e,t,i){var l=i(15073);i(58468);const r=i(63679).I4.a` 2 cursor: pointer; 3 width: ${e=>e.$width??"auto"}; 4 min-width: 100px; 5 padding: 0 15px; 6 display: flex; 7 align-items: center; 8 align-content: center; 9 justify-content: center; 10 gap: 5px; 11 border-radius: 6px; 12 height: 32px; 13 font-size: 0.85em; 14 background-color: ${e=>e.$hollow?"transparent":"var(--theme-palette-color-1)"}; 15 font-weight: bold; 16 color: ${e=>e.$hollow?"var(--dotgg-accent-text-2, var(--theme-palette-color-2))":"var(--dotgg-on-accent, var(--theme-palette-color-8))"}; 17 border: ${e=>e.$hollow?"1px solid var(--theme-palette-color-2)":"none"}; 18 user-select: none; 19 white-space: nowrap; 20 flex-shrink: 0; 21 &:hover { 22 filter: brightness(1.2); 23 color: ${e=>e.$hollow?"var(--dotgg-accent-text-2, var(--theme-palette-color-2))":"var(--dotgg-on-accent, var(--theme-palette-color-8))"}; 24 } 25`;i.d(t,["V",0,({$title:e="My Decks",$url:t="/decks/?my=1"})=>void 0!==window.DotGGUser&&void 0!==window.DotGGUserToken?(0,l.Y)(r,{href:t,"data-native":!0,children:e}):null,"d",0,r])},51177(e,t,i){i.r(t),i.d(t,{Builder:()=>C});var l=i(15073),r=i(58468),s=i(63679),n=i(37762),o=i(85311),a=i(55622),d=i(51900),c=i(50086),u=i(48221),h=i(70994),m=i(81616),p=i(32013),g=i(12434),v=i(68764),b=i(4738),f=i(55612),k=i(80414);const w=e=>"Small"===e?.size?1:"Medium"===e?.size?2:3,x=()=>(0,l.Y)("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.Y)("path",{d:"M14 17.25V11.25C14 10.4216 13.3284 9.75 12.5 9.75H6.5C5.67157 9.75 5 10.4216 5 11.25V17.25M5.75 0.75V3.75C5.75 4.57843 6.42157 5.25 7.25 5.25H10.25C11.0784 5.25 11.75 4.57843 11.75 3.75V0.75M3.5 0.75H12.5601C12.998 0.75 13.414 0.941344 13.699 1.27381L17.3889 5.5787C17.6219 5.85056 17.75 6.19628 17.75 6.55435C17.75 9.4311 17.75 15 17.75 15C17.75 16.2426 16.7426 17.25 15.5 17.25H3.5C2.25736 17.25 1.25 16.2426 1.25 15V3C1.25 1.75736 2.25736 0.75 3.5 0.75Z",stroke:"var(--theme-palette-color-7)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),y=({slug:e})=>{const t=`${g.Ay.BASE_URL}builds/${e}`;return(0,l.Y)(A,{children:(0,l.FD)(B,{children:[(0,l.Y)(c.L,{shareTitleLable:"Share Your Build",stringToCopy:t}),(0,l.Y)(Y,{onClick:()=>{(0,u.AH)(t,"Link copied")},children:t})]})})},C=()=>{const{BuildSlug:e}=(0,h.g)(),[t,i]=(0,r.J0)(!1),[s,c]=(0,r.J0)(null),[u,C]=(0,r.J0)(0),[Y,A]=(0,r.J0)({savebuild:{hero:null,items:[],skills:[]},slug:e??"",humanname:"",description:"",youtube:"",public:"0",title_image:""}),B={heroes:(0,m.U_)("heroes"),items:(0,m.U_)("items"),skills:(0,m.U_)("skills")},S=(0,r.li)(!0),J=(0,r.Jt)(e=>{A(t=>({...t,savebuild:e.structure,slug:e.slug,humanname:e.humanname,description:e.description})),C(e.structure.items.reduce((e,t)=>{const i=B.items?.find(e=>e.slug===t);return i?e+w(i):e},0))});(0,r.vJ)(()=>{e&&(0,v.l)(e).then(e=>J(e)).catch(e=>{console.error("Error fetching build:",e)})},[e]);const T=(e,t)=>{const l=B[t]?.find(t=>t.id.toString()===e);if(l){switch(t){case"heroes":A(e=>({...e,savebuild:{...e.savebuild,hero:l.slug,items:[],skills:[]}}));break;case"items":const e=w(l);if(u+e>10)return;A(e=>({...e,savebuild:{...e.savebuild,items:[...e.savebuild.items,l.slug]}})),C(t=>t+e);break;case"skills":if(Y.savebuild.skills.includes(l.slug))return;A(e=>({...e,savebuild:{...e.savebuild,skills:[...e.savebuild.skills,l.slug]}}))}i(!1)}},z=async()=>{(async function(e){const t=`/cgfw/savebazaarbuild?game=${g.Ay.TheGame}`;return await f.A.post(t,e,{url:`https://api.dotgg.gg${t}`,headers:(0,b.z5)()})})(Y).then(e=>{e.slug!==Y.slug&&(window.location.href=`/planner/${e.slug}`)}).catch(e=>{console.error("Error saving build:",e)})},D=JSON.stringify(Y.savebuild),L=(0,r.Jt)(()=>{e&&z()});return r.Ay.useEffect(()=>{if(S.current)return void(S.current=!1);const e=setTimeout(()=>{L()},1e3);return()=>clearTimeout(e)},[D]),(0,l.FD)(l.FK,{children:[(0,l.FD)($,{children:[(0,l.Y)(p.p,{onChange:e=>{A(t=>({...t,humanname:e.currentTarget.value}))},placeholder:"Build name",value:Y.humanname}),e&&(0,l.Y)(y,{slug:e}),(0,l.FD)(n.d,{$width:"200px",onClick:z,children:[(0,l.Y)(x,{}),"Save Build"]})]}),(0,l.Y)(k.Z,{BuildSlug:e??"",currentBuild:Y,handleShift:(e,t)=>{A(i=>{const l=i.savebuild.items.indexOf(e);if(-1===l)return i;const r=l+t;if(r<0||r>=i.savebuild.items.length)return i;const s=[...i.savebuild.items];return[s[l],s[r]]=[s[r],s[l]],{...i,savebuild:{...i.savebuild,items:s}}})},handleRemove:(e,t)=>
25{if("items"===t){const t=B.items?.find(t=>t.slug===e);if(!t)return;const i=w(t);A(t=>({...t,savebuild:{...t.savebuild,items:t.savebuild.items.filter(t=>t!==e)}})),C(e=>e-i)}else"skills"===t&&A(t=>({...t,savebuild:{...t.savebuild,skills:t.savebuild.skills.filter(t=>t!==e)}}))},handleElementClick:T,handlePickerClick:e=>{if(("items"===e||"skills"===e)&&!Y.savebuild.hero)return c((0,l.Y)("div",{children:"Please select a hero before picking items."})),void i(!0);c((0,l.Y)(o.q,{elementType:e,showfilter:!0,embed:!0,cardClickFunction:t=>{T(t,e)},filterOverride:"items"===e||"skills"===e?`heroes=${Y.savebuild.hero}`:""})),i(!0)}}),(0,l.Y)(d.qp,{header:"Add Card",show:t,onClose:e=>{switch(e){case"close":case"cancel":i(!1)}},promptbuttons:[],children:(0,l.Y)(a.o,{width:"100%",height:"100%",children:s})})]})},$=s.Ay.div` 26 padding: 10px; 27 gap: 10px; 28 display: flex; 29 border-radius: 6px; 30 background-color: var(--theme-palette-color-8); 31 margin-bottom: 16px; 32 justify-content: space-between; 33`,Y=s.Ay.div` 34 @media only screen and (max-width: 1140px) { 35 font-size: 0.8em; 36 display: flex; 37 align-items: center; 38 width: 100%; 39 } 40`,A=s.Ay.div` 41 display: flex; 42 flex-direction: column; 43 @media only screen and (max-width: 1140px) { 44 width: 100%; 45 } 46`,B=s.Ay.div` 47 display: flex; 48 align-items: center; 49 gap: 5px; 50 position: relative; 51 color: var(--dotgg-accent-text, var(--theme-palette-color-1)) !important; 52 background-color: var(--theme-palette-color-7) !important; 53 border-radius: 5px !important; 54 border: 0 !important; 55 font-size: 0.9em !important; 56 padding-left: 10px !important; 57 padding-right: 10px !important; 58 height: 30px; 59`}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.