Files
boc/landvex-site/assets/CreateMission-DTYpAitx.js
T
Bernt 48ea61cdcc docs: add quixzoom-auth-core product to AAMOS
- Product documentation in docs/products/
- Updated MEMORY.md with product info
- quiXzoom Auth Core as AAMOS Identity product
2026-07-14 09:58:53 +00:00

23 lines
26 KiB
JavaScript

import{x as E,r,j as e,y as x,ag as h,ah as p,ak as f,z as j,F as ve,v as b,p as D,L as W,X as ze,I as T,D as Be,A as ye,a as Ue,u as He,o as $e,n as Ge,ai as Y,B as ge,T as Ye,q as l,aS as K,M as Ke,al as Q,C as Qe,S as Xe,aj as We,w as P}from"./index-CZD3_4lD.js";import{A as Ze}from"./index-DXB3_sFe.js";import{U as Je}from"./upload-B_ploHV0.js";import{B as es}from"./badge-D3Mn__J4.js";import{R as X,a as S}from"./radio-group-BcmHTP2Q.js";import{S as ss,a as as,b as rs,c as ts,d as is}from"./select-Dcsz1esX.js";import{A as fe}from"./arrow-left-DyClWdEf.js";import{I as ns}from"./info-DLVcQf5T.js";import{R as cs}from"./repeat-CjEas7lo.js";import{C as ls}from"./calendar-3jVgdv6R.js";import{G as os}from"./gift-C8Ri1JSk.js";import{M as ds}from"./megaphone-B7uGchyN.js";import"./index-C6sfL5Wv.js";import"./circle-CNf9xg3I.js";import"./chevron-down-DA--jGG2.js";import"./check-CCL32zXH.js";/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ms=E("BadgePercent",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const us=E("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ne=E("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xs=E("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),hs=({goodExamples:s,onGoodExamplesChange:N})=>{const v=r.useRef(null),g=t=>{if(!t)return;const u=Array.from(t).map(o=>({id:crypto.randomUUID(),file:o,previewUrl:URL.createObjectURL(o),type:"good",caption:""}));N([...s,...u])},i=t=>{const u=s.filter(o=>o.id!==t);N(u)},n=(t,u)=>{const o=s.map(M=>M.id===t?{...M,caption:u}:M);N(o)};return e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"w-5 h-5"}),"Example Images"]}),e.jsx(f,{children:"Upload images showing the photographer what good photos look like"})]}),e.jsx(j,{className:"space-y-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"w-4 h-4 text-success"}),e.jsx("span",{className:"text-sm font-medium",children:"Good examples"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",s.length,")"]})]}),e.jsxs(b,{type:"button",variant:"outline",size:"sm",onClick:()=>{var t;return(t=v.current)==null?void 0:t.click()},className:"gap-1",children:[e.jsx(Ne,{className:"w-3 h-3"}),"Add"]}),e.jsx("input",{ref:v,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:t=>g(t.target.files)})]}),e.jsx(Ze,{children:s.length>0&&e.jsx(D.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-2 gap-3",children:s.map(t=>e.jsxs(D.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"relative rounded-lg overflow-hidden border-2 border-success/30",children:[e.jsxs("div",{className:"aspect-[4/3] relative",children:[e.jsx("img",{src:t.previewUrl,alt:t.caption||"Example image",className:"w-full h-full object-cover"}),t.uploading&&e.jsx("div",{className:"absolute inset-0 bg-background/80 flex items-center justify-center",children:e.jsx(W,{className:"w-6 h-6 animate-spin text-primary"})}),e.jsx(b,{type:"button",variant:"destructive",size:"icon",className:"absolute top-1 right-1 w-6 h-6",onClick:()=>i(t.id),children:e.jsx(ze,{className:"w-3 h-3"})})]}),e.jsx("div",{className:"p-2 bg-background",children:e.jsx(T,{placeholder:"Caption...",value:t.caption,onChange:u=>n(t.id,u.target.value),className:"h-8 text-xs"})})]},t.id))})}),s.length===0&&e.jsxs("div",{onClick:()=>{var t;return(t=v.current)==null?void 0:t.click()},className:"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors hover:border-primary/50 border-success/20",children:[e.jsx(Je,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload good examples"})]})]})})]})},ps=async(s,N,v)=>{const g=[...N.map((i,n)=>({...i,orderIndex:n})),...v.map((i,n)=>({...i,orderIndex:n}))];for(const i of g)if(i.file)try{const n=await Be(i.file,`mission-examples/${s}/${i.type}`);if(!(n!=null&&n.url)){console.error("Upload failed for",i.file.name);continue}await ye("/mission-example-images",{mission_id:s,image_url:n.url,image_type:i.type,caption:i.caption||null,order_index:i.orderIndex})}catch(n){console.error("Failed to upload image:",n)}return!0},qs=()=>{var xe,he,pe,je;const{t:s}=Ue(),N=[{value:"once",label:s("createMission.frequencyOnce"),description:s("createMission.frequencyOnceDesc")},{value:"daily",label:s("createMission.frequencyDaily"),description:s("createMission.frequencyDailyDesc")},{value:"weekly",label:s("createMission.frequencyWeekly"),description:s("createMission.frequencyWeeklyDesc")},{value:"biweekly",label:s("createMission.frequencyBiweekly"),description:s("createMission.frequencyBiweeklyDesc")},{value:"monthly",label:s("createMission.frequencyMonthly"),description:s("createMission.frequencyMonthlyDesc")}],v=[{value:7,label:s("createMission.duration1week")},{value:14,label:s("createMission.duration2weeks")},{value:30,label:s("createMission.duration1month")},{value:90,label:s("createMission.duration3months")},{value:180,label:s("createMission.duration6months")},{value:365,label:s("createMission.duration1year")}],g=He(),{user:i}=$e(),{isLoading:n,isActiveOrderer:t}=Ge(),u=r.useRef(null),o=r.useRef(null),M=r.useRef(null),[k,q]=r.useState(1),[Z,J]=r.useState(!1),[z,be]=r.useState(null),[R,Me]=r.useState(""),[B,ke]=r.useState(""),[ee,we]=r.useState(""),[se,Ce]=r.useState(""),[O,Se]=r.useState(""),[F,ae]=r.useState(59.3293),[V,re]=r.useState(18.0686),[U,Te]=r.useState(500),[y,De]=r.useState(1),[w,te]=r.useState("once"),[d,Ie]=r.useState(30),[C,Pe]=r.useState(50),[H,qe]=r.useState([]),[$,Re]=r.useState([]),[m,L]=r.useState("sponsored"),[_,A]=r.useState("cash"),[ie,Oe]=r.useState(""),[ne,Fe]=r.useState(100),[ce,Ve]=r.useState(30),[le,Le]=r.useState(""),I=300,oe=40,G=y>0?C/y:C,de=G<=I;if(r.useEffect(()=>{(async()=>{try{const c=await We();c&&be(c)}catch(c){console.error("Failed to fetch mapbox token:",c)}})()},[]),r.useEffect(()=>{if(!(!z||!u.current||o.current))return Y.accessToken=z,o.current=new Y.Map({container:u.current,style:"mapbox://styles/mapbox/streets-v12",center:[V,F],zoom:12}),M.current=new Y.Marker({draggable:!0,color:"#3b82f6"}).setLngLat([V,F]).addTo(o.current),M.current.on("dragend",()=>{var c;const a=(c=M.current)==null?void 0:c.getLngLat();a&&(re(a.lng),ae(a.lat))}),o.current.on("click",a=>{var c;(c=M.current)==null||c.setLngLat(a.lngLat),re(a.lngLat.lng),ae(a.lngLat.lat)}),()=>{var a;(a=o.current)==null||a.remove(),o.current=null}},[z]),r.useEffect(()=>{!i&&!n&&g("/auth")},[i,n,g]),n)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(W,{className:"w-8 h-8 animate-spin text-primary"})});if(!t)return e.jsxs("div",{className:"min-h-screen bg-background text-foreground pb-24",children:[e.jsx("header",{className:"sticky top-0 z-10 bg-background/80 backdrop-blur-xl border-b border-border",children:e.jsxs("div",{className:"flex items-center gap-3 px-4 py-4",children:[e.jsx(b,{variant:"ghost",size:"icon",onClick:()=>g(-1),children:e.jsx(fe,{className:"w-5 h-5"})}),e.jsx("h1",{className:"text-xl font-bold",children:s("createMission.title")})]})}),e.jsx("main",{className:"p-4 space-y-6",children:e.jsxs(x,{className:"glass-card border-amber-500/30",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ns,{className:"w-5 h-5 text-amber-500"}),s("createMission.becomeOrderer")]}),e.jsx(f,{children:s("createMission.mustBeOrderer")})]}),e.jsx(j,{children:e.jsx(b,{onClick:()=>g("/orderer/register"),className:"w-full",children:s("createMission.registerAsOrderer")})})]})}),e.jsx(ge,{})]});const _e=()=>R.trim()?B.trim()?!0:(P.error(s("createMission.validationTargetRequired")),!1):(P.error(s("createMission.validationTitleRequired")),!1),Ae=()=>O.trim()?!0:(P.error(s("createMission.validationAreaRequired")),!1),me=()=>{let a=1;switch(w){case"daily":a=d;break;case"weekly":a=Math.ceil(d/7);break;case"biweekly":a=Math.ceil(d/14);break;case"monthly":a=Math.ceil(d/30);break;default:a=1}const c=C*y*a;return m==="sponsored"?Math.round(c*(1-oe/100)):c},ue=()=>{let a=1;switch(w){case"daily":a=d;break;case"weekly":a=Math.ceil(d/7);break;case"biweekly":a=Math.ceil(d/14);break;case"monthly":a=Math.ceil(d/30);break;default:a=1}return C*y*a},Ee=async()=>{if(!de){P.error(s("createMission.rewardTooHigh",{max:I}));return}J(!0);try{const a=new Date;a.setDate(a.getDate()+d);const c=await ye("/missions",{title:R.trim(),description:ee.trim()||null,instructions:se.trim()||null,target_description:B.trim(),area_name:O.trim(),latitude:F,longitude:V,radius_meters:U,required_photos:y,reward_credits:C,frequency:w,frequency_count:1,active_until:a.toISOString(),expires_at:a.toISOString(),created_by:i==null?void 0:i.id,status:"active",ad_option:m,reward:_!=="cash"?{type:_,title:ie,value_nominal:ne,valid_days:ce,redemption_instructions:le||void 0}:void 0});c&&(H.length>0||$.length>0)&&await ps(c.id,H,$),P.success(s("createMission.missionCreated")),g("/")}catch(a){console.error("Failed to create mission:",a),P.error(a.message||s("createMission.couldNotCreate"))}finally{J(!1)}};return e.jsxs("div",{className:"min-h-screen bg-background text-foreground pb-24",children:[e.jsxs("header",{className:"sticky top-0 z-10 bg-background/80 backdrop-blur-xl border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-4",children:[e.jsx(b,{variant:"ghost",size:"icon",onClick:()=>k>1?q(k-1):g(-1),children:e.jsx(fe,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold",children:s("createMission.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("createMission.stepOf",{step:k,total:4})})]})]}),e.jsx("div",{className:"h-1 bg-muted",children:e.jsx(D.div,{className:"h-full bg-primary",initial:{width:0},animate:{width:`${k/4*100}%`}})})]}),e.jsxs("main",{className:"p-4 space-y-6",children:[k===1&&e.jsxs(D.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},className:"space-y-6",children:[e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Ye,{className:"w-5 h-5"}),s("createMission.step1Title")]}),e.jsx(f,{children:s("createMission.step1Desc")})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(l,{htmlFor:"title",children:[s("createMission.missionTitle")," *"]}),e.jsx(T,{id:"title",value:R,onChange:a=>Me(a.target.value),placeholder:s("createMission.missionTitlePlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(l,{htmlFor:"targetDescription",children:[s("createMission.whatToPhoto")," *"]}),e.jsx(K,{id:"targetDescription",value:B,onChange:a=>ke(a.target.value),placeholder:s("createMission.whatToPhotoPlaceholder"),rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"instructions",children:s("createMission.instructions")}),e.jsx(K,{id:"instructions",value:se,onChange:a=>Ce(a.target.value),placeholder:s("createMission.instructionsPlaceholder"),rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"description",children:s("createMission.description")}),e.jsx(K,{id:"description",value:ee,onChange:a=>we(a.target.value),placeholder:s("createMission.descriptionPlaceholder"),rows:2})]})]})]}),e.jsx(hs,{goodExamples:H,badExamples:$,onGoodExamplesChange:qe,onBadExamplesChange:Re}),e.jsx(b,{onClick:()=>_e()&&q(2),className:"w-full",size:"lg",children:s("createMission.continue")})]}),k===2&&e.jsxs(D.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},className:"space-y-6",children:[e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-5 h-5"}),s("createMission.step2Title")]}),e.jsx(f,{children:s("createMission.step2Desc")})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(l,{htmlFor:"areaName",children:[s("createMission.areaName")," *"]}),e.jsx(T,{id:"areaName",value:O,onChange:a=>Se(a.target.value),placeholder:s("createMission.areaNamePlaceholder")})]}),e.jsx("div",{ref:u,className:"w-full h-64 rounded-lg overflow-hidden border border-border"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(l,{children:[s("createMission.radius"),": ",U," ",s("common.meters")]}),e.jsx(Q,{value:[U],onValueChange:a=>Te(a[0]),min:50,max:5e3,step:50}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("createMission.radiusHint")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.latitude")}),e.jsx("p",{className:"font-mono",children:F.toFixed(6)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.longitude")}),e.jsx("p",{className:"font-mono",children:V.toFixed(6)})]})]})]})]}),e.jsx(b,{onClick:()=>Ae()&&q(3),className:"w-full",size:"lg",children:s("createMission.continue")})]}),k===3&&e.jsxs(D.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},className:"space-y-6",children:[e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"w-5 h-5"}),s("createMission.step3Title")]}),e.jsx(f,{children:s("createMission.step3Desc")})]}),e.jsx(j,{children:e.jsx(X,{value:w,onValueChange:te,className:"space-y-2",children:N.map(a=>e.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border transition-colors cursor-pointer ${w===a.value?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>te(a.value),children:[e.jsx(S,{value:a.value,id:a.value}),e.jsxs(l,{htmlFor:a.value,className:"flex-1 cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:a.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]})]},a.value))})})]}),e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"w-5 h-5"}),s("createMission.durationTitle")]}),e.jsx(f,{children:s("createMission.durationDesc")})]}),e.jsx(j,{children:e.jsxs(ss,{value:d.toString(),onValueChange:a=>Ie(parseInt(a)),children:[e.jsx(as,{children:e.jsx(rs,{})}),e.jsx(ts,{children:v.map(a=>e.jsx(is,{value:a.value.toString(),children:a.label},a.value))})]})})]}),e.jsx(b,{onClick:()=>q(4),className:"w-full",size:"lg",children:s("createMission.continue")})]}),k===4&&e.jsxs(D.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},className:"space-y-6",children:[e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"w-5 h-5"}),s("createMission.step4Title")]}),e.jsx(f,{children:s("createMission.step4Desc")})]}),e.jsx(j,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs(l,{children:[s("createMission.photoCount"),": ",y]}),e.jsx(Q,{value:[y],onValueChange:a=>De(a[0]),min:1,max:10,step:1})]})})]}),e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(us,{className:"w-5 h-5"}),s("createMission.rewardTitle")]}),e.jsx(f,{children:s("createMission.rewardDesc")})]}),e.jsx(j,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs(l,{children:[s("createMission.reward"),": ",C," ",s("common.sek")]}),e.jsx(Q,{value:[C],onValueChange:a=>Pe(a[0]),min:20,max:y*I,step:10}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:G>I?"text-destructive font-medium":"text-muted-foreground",children:s("createMission.perPhoto",{amount:Math.round(G)})}),e.jsx("span",{className:"text-muted-foreground",children:s("createMission.maxPerPhoto",{amount:I})})]}),!de&&e.jsxs("p",{className:"text-xs text-destructive",children:["⚠️ ",s("createMission.rewardTooHigh",{max:I})]})]})})]}),e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(os,{className:"w-5 h-5"}),"Typ av belöning"]}),e.jsx(f,{children:"Välj hur operatören kompenseras för godkänt uppdrag"})]}),e.jsxs(j,{className:"space-y-3",children:[e.jsxs(X,{value:_,onValueChange:a=>A(a),children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border cursor-pointer hover:bg-muted/50",onClick:()=>A("cash"),children:[e.jsx(S,{value:"cash",id:"r-cash"}),e.jsxs("label",{htmlFor:"r-cash",className:"cursor-pointer flex-1",children:[e.jsx("div",{className:"font-medium",children:"Kontantutbetalning"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Utbetalas till operatörens plånbok i SEK"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border cursor-pointer hover:bg-muted/50",onClick:()=>A("voucher"),children:[e.jsx(S,{value:"voucher",id:"r-voucher"}),e.jsxs("label",{htmlFor:"r-voucher",className:"cursor-pointer flex-1",children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:["Värdekupong ",e.jsx(es,{className:"text-xs",children:"Nytt"})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Digital kupong att lösa in hos er — perfekt för McD, caféer, butiker"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border cursor-pointer hover:bg-muted/50",onClick:()=>A("product"),children:[e.jsx(S,{value:"product",id:"r-product"}),e.jsxs("label",{htmlFor:"r-product",className:"cursor-pointer flex-1",children:[e.jsx("div",{className:"font-medium",children:"Produktbelöning"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Specifik produkt att hämta ut, t.ex. en gratis kaffe"})]})]})]}),_==="voucher"&&e.jsxs("div",{className:"space-y-3 p-4 bg-muted/30 rounded-xl",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Kupong-titel *"}),e.jsx(T,{value:ie,onChange:a=>Oe(a.target.value),placeholder:"t.ex. Cheeseburgare + medium pommes",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Nominellt värde (krediter)"}),e.jsx(T,{type:"number",value:ne,onChange:a=>Fe(Number(a.target.value)),min:1,className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Värdet visas för operatören — QuiXzoom tar 15% provision"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Giltighetstid (dagar)"}),e.jsx(T,{type:"number",value:ce,onChange:a=>Ve(Number(a.target.value)),min:1,max:365,className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Inlösningsinstruktioner"}),e.jsx(T,{value:le,onChange:a=>Le(a.target.value),placeholder:"t.ex. Visa QR-koden i kassan",className:"mt-1"})]})]})]})]}),e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ds,{className:"w-5 h-5"}),"Advertising Sponsorship"]}),e.jsx(f,{children:"Allow brands to sponsor your mission and reduce your costs"})]}),e.jsx(j,{children:e.jsxs(X,{value:m,onValueChange:a=>L(a),className:"space-y-3",children:[e.jsxs("div",{className:`relative flex items-start space-x-3 p-4 rounded-lg border-2 transition-all cursor-pointer ${m==="sponsored"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>L("sponsored"),children:[m==="sponsored"&&e.jsx("div",{className:"absolute -top-2 right-3 px-2 py-0.5 bg-primary text-primary-foreground text-[10px] font-semibold rounded-full",children:"RECOMMENDED"}),e.jsx(S,{value:"sponsored",id:"sponsored",className:"mt-1"}),e.jsxs(l,{htmlFor:"sponsored",className:"flex-1 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"font-semibold",children:"Allow Brand Sponsorship"}),e.jsxs("span",{className:"text-xs bg-success/20 text-success px-1.5 py-0.5 rounded-full font-medium",children:["Save ",oe,"%"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Brands can display subtle ads on your mission. You pay significantly less for each photo order."})]})]}),e.jsxs("div",{className:`flex items-start space-x-3 p-4 rounded-lg border transition-colors cursor-pointer ${m==="no-ads"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>L("no-ads"),children:[e.jsx(S,{value:"no-ads",id:"no-ads",className:"mt-1"}),e.jsxs(l,{htmlFor:"no-ads",className:"flex-1 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"font-semibold",children:"No Advertising"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"(Full price)"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Keep your mission ad-free. Standard pricing applies."})]})]}),e.jsxs("div",{className:`flex items-start space-x-3 p-4 rounded-lg border transition-colors cursor-pointer ${m==="own-ads"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>L("own-ads"),children:[e.jsx(S,{value:"own-ads",id:"own-ads",className:"mt-1"}),e.jsxs(l,{htmlFor:"own-ads",className:"flex-1 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xe,{className:"w-4 h-4 text-amber-500"}),e.jsx("span",{className:"font-semibold",children:"Add Your Own Brand"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Display your own branding and messaging on the mission. Contact us for enterprise packages."})]})]})]})})]}),e.jsxs(x,{className:"glass-card border-primary/30",children:[e.jsx(h,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"w-5 h-5 text-primary"}),s("createMission.summaryTitle")]})}),e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.mission")}),e.jsx("p",{className:"font-medium",children:R||"-"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.area")}),e.jsx("p",{className:"font-medium",children:O||"-"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.frequency")}),e.jsx("p",{className:"font-medium",children:(xe=N.find(a=>a.value===w))==null?void 0:xe.label})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.duration")}),e.jsx("p",{className:"font-medium",children:(he=v.find(a=>a.value===d))==null?void 0:he.label})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.photosPerMission")}),e.jsxs("p",{className:"font-medium",children:[y," ",s("createMission.pcs")]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.rewardPerMission")}),e.jsxs("p",{className:"font-medium",children:[C," ",s("common.sek")]})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Advertising"}),e.jsxs("p",{className:"font-medium",children:[m==="sponsored"&&"✓ Brand sponsorship enabled",m==="no-ads"&&"No advertising",m==="own-ads"&&"✓ Your own branding"]})]})]}),e.jsxs("div",{className:"pt-3 border-t border-border",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-muted-foreground",children:s("createMission.estimatedTotalCost")}),e.jsxs("div",{className:"text-right",children:[m==="sponsored"&&e.jsxs("span",{className:"text-sm text-muted-foreground line-through mr-2",children:[ue()," ",s("common.sek")]}),e.jsxs("span",{className:"text-xl font-bold text-primary",children:[me()," ",s("common.sek")]})]})]}),m==="sponsored"&&e.jsxs("p",{className:"text-xs text-success mt-1",children:["💰 You save ",ue()-me()," ",s("common.sek")," with brand sponsorship"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:w==="once"?s("createMission.basedOnOnce"):s("createMission.basedOnFrequency",{frequency:(pe=N.find(a=>a.value===w))==null?void 0:pe.label.toLowerCase(),duration:(je=v.find(a=>a.value===d))==null?void 0:je.label.toLowerCase()})})]})]})]}),e.jsx(b,{onClick:Ee,className:"w-full",size:"lg",disabled:Z,children:Z?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-2 animate-spin"}),s("createMission.creating")]}):s("createMission.create")})]})]}),e.jsx(ge,{})]})};export{qs as default};
//# sourceMappingURL=CreateMission-DTYpAitx.js.map