Files
2026-04-11 09:21:22 +02:00

2 lines
12 KiB
JavaScript

import{r as n,j as e}from"./index-CEeZxcxj.js";const H="_container_166qm_3",U="_panel_166qm_21",Y="_imageFrame_166qm_38",K="_sceneImage_166qm_63",O="_sceneFallback_166qm_70",P="_sceneFallbackGlow_166qm_102",V="_sceneFallbackHud_166qm_113",$="_sceneFallbackBadge_166qm_122",G="_sceneFallbackSignal_166qm_123",W="_sceneFallbackCopy_166qm_138",J="_sceneFallbackKicker_166qm_146",z="_sceneFallbackTitle_166qm_155",Q="_sceneFallbackDetail_166qm_164",X="_sceneFallbackBars_166qm_171",Z="_dialogueBox_166qm_196",ee="_dialogueHeader_166qm_217",ae="_title_166qm_224",se="_loopBadge_166qm_235",te="_description_166qm_253",ne="_actionButton_166qm_261",ce="_choices_166qm_296",oe="_choiceButton_166qm_303",ie="_choiceKey_166qm_337",le="_choiceContent_166qm_366",re="_choiceTitle_166qm_373",de="_choiceDesc_166qm_380",me="_rejection_166qm_387",he="_rejectionBadge_166qm_395",pe="_quote_166qm_416",ge="_explanation_166qm_426",ue="_insightButton_166qm_435",xe="_insight_166qm_435",_e="_insightTitle_166qm_465",je="_paradoxDiagram_166qm_474",be="_paradoxNode_166qm_486",Ne="_paradoxArrow_166qm_495",ke="_insightText_166qm_513",ye="_completeButton_166qm_530",Be="_successBox_166qm_566",ve="_successTitle_166qm_570",Ce="_stats_166qm_581",qe="_scoreDisplay_166qm_587",Te="_scoreLabel_166qm_597",Fe="_scoreValue_166qm_605",a={container:H,panel:U,imageFrame:Y,sceneImage:K,sceneFallback:O,sceneFallbackGlow:P,sceneFallbackHud:V,sceneFallbackBadge:$,sceneFallbackSignal:G,sceneFallbackCopy:W,sceneFallbackKicker:J,sceneFallbackTitle:z,sceneFallbackDetail:Q,sceneFallbackBars:X,dialogueBox:Z,dialogueHeader:ee,title:ae,loopBadge:se,description:te,actionButton:ne,choices:ce,choiceButton:oe,choiceKey:ie,choiceContent:le,choiceTitle:re,choiceDesc:de,rejection:me,rejectionBadge:he,quote:pe,explanation:ge,insightButton:ue,insight:xe,insightTitle:_e,paradoxDiagram:je,paradoxNode:be,paradoxArrow:Ne,insightText:ke,completeButton:ye,successBox:Be,successTitle:ve,stats:Ce,scoreDisplay:qe,scoreLabel:Te,scoreValue:Fe},f="/glitch/migration-paradox",fe=2,Ae=1,u={presenting:{badge:"Migration Briefing",title:"Stakeholders Await Your Plan",copy:"Frame the migration as progress without triggering fear.",detail:"You need a strategy that creates momentum before the paradox closes in.",tone:"primary"},"rejection-value":{badge:"Stakeholder Response",title:"Too Much Change",copy:"Your pitch sounded valuable, but it also sounded dangerous.",detail:"They want new capability only if nothing important feels different.",tone:"danger"},"rejection-same":{badge:"Stakeholder Response",title:"Too Little Value",copy:"Your pitch sounded safe, but it also sounded pointless.",detail:"They want risk contained, but they still expect the migration to matter.",tone:"danger"},awareness:{badge:"Pattern Detected",title:"Expose The Contradiction",copy:"Show how value and continuity need different phases, not one impossible promise.",detail:"Explore, preserve, and then innovate.",tone:"accent"},complete:{badge:"Challenge Complete",title:"Paradox Resolved",copy:"You reframed the migration into a sequence stakeholders can accept.",detail:"Value and stability can coexist when delivery is phased.",tone:"success"}};function we(c){if(typeof c!="string")return f;const o=c.trim();return o?o.replace(/\/+$/,""):f}function b(c,o){return`${c}/${o}`}function A(c,o){const s=c==="A"?fe:Ae,i=Math.floor(Math.random()*s)+1;return b(o,`rejection${c}_${i}.png`)}function x({src:c,alt:o,fallback:s,onImageError:i}){return e.jsx("div",{className:a.imageFrame,children:c?e.jsx("img",{src:c,alt:o,className:a.sceneImage,onError:()=>i(c)}):e.jsxs("div",{className:a.sceneFallback,"data-tone":s.tone,role:"img","aria-label":o,children:[e.jsx("div",{className:a.sceneFallbackGlow}),e.jsxs("div",{className:a.sceneFallbackHud,children:[e.jsx("span",{className:a.sceneFallbackBadge,children:s.badge}),e.jsx("span",{className:a.sceneFallbackSignal,children:"GLITCH SIM"})]}),e.jsxs("div",{className:a.sceneFallbackCopy,children:[e.jsx("p",{className:a.sceneFallbackKicker,children:s.copy}),e.jsx("h3",{className:a.sceneFallbackTitle,children:s.title}),e.jsx("p",{className:a.sceneFallbackDetail,children:s.detail})]}),e.jsxs("div",{className:a.sceneFallbackBars,"aria-hidden":"true",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})]})})}function Se({config:c,onComplete:o,onProgress:s,theme:i,className:w}){const _=c?.params??{},[m,h]=n.useState("intro"),[l,v]=n.useState({loopCount:0,valueAttempts:0,sameAttempts:0}),[N,E]=n.useState(!1),[C,q]=n.useState(""),[T,S]=n.useState({}),r=n.useMemo(()=>we(_.assetBaseUrl??_.imageBaseUrl),[_.assetBaseUrl,_.imageBaseUrl]),j=n.useMemo(()=>({presenting:b(r,"presenting.png"),insight:b(r,"insight.png"),complete:b(r,"complete.png")}),[r]),I={"--gc-primary":i?.primary||"#6366f1","--gc-accent":i?.accent||"#22d3ee","--gc-bg":i?.bg||"#0a0a0f","--gc-bg-secondary":i?.bgSecondary||"#12121a","--gc-text":i?.text||"#e8e8ec","--gc-text-muted":i?.textMuted||"#9999a8","--gc-border":i?.border||"#2a2a3a"},d=l.valueAttempts+l.sameAttempts,k=d>=4,p=n.useCallback(t=>T[t]?void 0:t,[T]),g=n.useCallback(t=>{S(B=>B[t]?B:{...B,[t]:!0})},[]),D=n.useCallback(()=>{h("choice"),s?.(10)},[s]),M=n.useCallback(()=>{q(A("A",r)),v(t=>({...t,valueAttempts:t.valueAttempts+1,loopCount:t.loopCount+(t.sameAttempts>t.valueAttempts?.5:0)})),h("rejection-value"),s?.(Math.min(30+d*10,80))},[r,d,s]),L=n.useCallback(()=>{q(A("B",r)),v(t=>({...t,sameAttempts:t.sameAttempts+1,loopCount:t.loopCount+(t.valueAttempts>t.sameAttempts?.5:0)})),h("rejection-same"),s?.(Math.min(30+d*10,80))},[r,d,s]),F=n.useCallback(()=>{h("choice")},[]),y=n.useCallback(()=>{E(!0),h("awareness"),s?.(90)},[s]),R=n.useCallback(()=>{h("complete"),s?.(100),o({success:!0,score:100,data:{loopsBeforeInsight:Math.floor(l.loopCount),totalAttempts:d,valueAttempts:l.valueAttempts,sameAttempts:l.sameAttempts},rewards:{paradoxes:[{id:"migration-paradox",name:"The Migration Paradox",description:"Stakeholders simultaneously demand that a migration adds value AND changes nothing.",rarity:"uncommon"}]}})},[o,s,l,d]);return e.jsxs("div",{className:`${a.container} ${w||""}`,style:I,children:[m==="intro"&&e.jsxs("div",{className:a.panel,children:[e.jsx(x,{src:p(j.presenting),alt:"Presenting to stakeholders",fallback:u.presenting,onImageError:g}),e.jsxs("div",{className:a.dialogueBox,children:[e.jsx("h2",{className:a.title,children:"The Migration Paradox"}),e.jsx("p",{className:a.description,children:"You've been tasked with migrating the core system. Your stakeholders are waiting for your strategy."}),e.jsx("button",{className:a.actionButton,onClick:D,children:"▶ Present Your Strategy"})]})]}),m==="choice"&&e.jsxs("div",{className:a.panel,children:[e.jsx(x,{src:p(j.presenting),alt:"Presenting options",fallback:u.presenting,onImageError:g}),e.jsxs("div",{className:a.dialogueBox,children:[e.jsxs("div",{className:a.dialogueHeader,children:[e.jsx("h2",{className:a.title,children:"Choose Your Approach"}),l.loopCount>0&&e.jsxs("span",{className:a.loopBadge,children:["LOOP ",Math.floor(l.loopCount)+1]})]}),e.jsx("p",{className:a.description,children:"How will you pitch the migration project?"}),e.jsxs("div",{className:a.choices,children:[e.jsxs("button",{className:a.choiceButton,onClick:M,children:[e.jsx("span",{className:a.choiceKey,children:"A"}),e.jsxs("span",{className:a.choiceContent,children:[e.jsx("span",{className:a.choiceTitle,children:"Emphasize Change"}),e.jsx("span",{className:a.choiceDesc,children:'"The new system will add value and enable new capabilities"'})]})]}),e.jsxs("button",{className:a.choiceButton,onClick:L,children:[e.jsx("span",{className:a.choiceKey,children:"B"}),e.jsxs("span",{className:a.choiceContent,children:[e.jsx("span",{className:a.choiceTitle,children:"Emphasize No Change"}),e.jsx("span",{className:a.choiceDesc,children:'"Everything will work exactly the same as before"'})]})]})]}),k&&!N&&e.jsx("button",{className:a.insightButton,onClick:y,children:"✦ Wait... I see the pattern"})]})]}),m==="rejection-value"&&e.jsxs("div",{className:a.panel,children:[e.jsx(x,{src:p(C),alt:"Stakeholder rejection",fallback:u["rejection-value"],onImageError:g}),e.jsxs("div",{className:a.dialogueBox,children:[e.jsxs("div",{className:a.rejection,children:[e.jsx("span",{className:a.rejectionBadge,children:"✗ REJECTED"}),e.jsx("p",{className:a.quote,children:'"Are you insane? This will break everything!"'}),e.jsx("p",{className:a.explanation,children:`"If you want to change the core system, you need to make absolutely sure that everything works exactly the same. We can't risk any disruption."`})]}),e.jsx("button",{className:a.actionButton,onClick:F,children:"▶ Try a Different Approach"}),k&&!N&&e.jsx("button",{className:a.insightButton,onClick:y,children:"✦ Wait... I see the pattern"})]})]}),m==="rejection-same"&&e.jsxs("div",{className:a.panel,children:[e.jsx(x,{src:p(C),alt:"Stakeholder rejection",fallback:u["rejection-same"],onImageError:g}),e.jsxs("div",{className:a.dialogueBox,children:[e.jsxs("div",{className:a.rejection,children:[e.jsx("span",{className:a.rejectionBadge,children:"✗ REJECTED"}),e.jsx("p",{className:a.quote,children:'"This is insane. Why would we do this?"'}),e.jsx("p",{className:a.explanation,children:`"If everything is going to stay exactly the same, why would we spend all this time and money replacing the core system? What's the point?"`})]}),e.jsx("button",{className:a.actionButton,onClick:F,children:"▶ Try a Different Approach"}),k&&!N&&e.jsx("button",{className:a.insightButton,onClick:y,children:"✦ Wait... I see the pattern"})]})]}),m==="awareness"&&e.jsxs("div",{className:a.panel,children:[e.jsx(x,{src:p(j.insight),alt:"Insight moment",fallback:u.awareness,onImageError:g}),e.jsxs("div",{className:a.dialogueBox,children:[e.jsxs("div",{className:a.insight,children:[e.jsx("h2",{className:a.insightTitle,children:"★ The Paradox Revealed ★"}),e.jsxs("p",{className:a.insightText,children:["You've discovered the ",e.jsx("strong",{children:"Migration Paradox"}),": stakeholders demand that you change things - to give value. But also that nothing changes, to contain risk."]}),e.jsxs("p",{className:a.insightText,children:["The solution is ",e.jsx("strong",{children:"phased delivery"}),". First, prove business case. Then prove you can preserve existing functionality. Then introduce new capabilities."]}),e.jsxs("div",{className:a.paradoxDiagram,children:[e.jsx("div",{className:a.paradoxNode,children:'"Explore"'}),e.jsx("div",{className:a.paradoxArrow,children:"→"}),e.jsx("div",{className:a.paradoxNode,children:'"Preserve"'}),e.jsx("div",{className:a.paradoxArrow,children:"→"}),e.jsx("div",{className:a.paradoxNode,children:'"Innovate"'}),e.jsx("div",{className:a.paradoxArrow,children:"→"})]})]}),e.jsx("button",{className:a.completeButton,onClick:R,children:"▶ Complete Challenge"})]})]}),m==="complete"&&e.jsxs("div",{className:a.panel,children:[e.jsx(x,{src:p(j.complete),alt:"Challenge complete",fallback:u.complete,onImageError:g}),e.jsx("div",{className:a.dialogueBox,children:e.jsxs("div",{className:a.successBox,children:[e.jsx("h2",{className:a.successTitle,children:"★ CHALLENGE COMPLETE ★"}),e.jsxs("p",{className:a.stats,children:["You experienced ",Math.floor(l.loopCount)," loop(s) before seeing the pattern."]}),e.jsxs("div",{className:a.scoreDisplay,children:[e.jsx("span",{className:a.scoreLabel,children:"SCORE"}),e.jsx("span",{className:a.scoreValue,children:"100"})]})]})})]})]})}const Ie={name:"migration-paradox",displayName:"The Migration Paradox",version:"1.0.0",paramSchema:{assetBaseUrl:{type:"string",label:"Asset Base URL",description:"Shared CDN or public folder containing presenting.png, insight.png, complete.png, rejectionA_1.png, rejectionA_2.png, and rejectionB_1.png.",default:"/glitch/migration-paradox"}},defaultParams:{assetBaseUrl:"/glitch/migration-paradox"}};export{Se as default,Ie as metadata};