{"version":3,"file":"WebviewTrigger.yIPGimYA.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","navigator","_e","c","init_jsx_runtime","ce","init_npm_react_18_3_1","window","withMobileOnly","useIsMobileUA","WrappedComponent","props","isMobile","setIsMobile","mobile","ua","isIOSWebView","isAndroidWebView","parsePhocaMarketUA","match","compareVersions","pa","a","pb","b","len","i","na","nb","isAppVersionAtLeast","info","minVersion","init_MobileSupport","actions","amplitudeEvent","webviewTriggerOnClickAction","init_WebviewActions","mobileAction","name","properties","payload","입고신청하러가기버튼","Component","Cupost연결","navigateToCupost","빠른판매가이드_빠른판매하러가기버튼","빠른판매가이드_처음입고하시나요버튼","입고온보딩_입고신청하기버튼","navigateToConsignmentSellSelect","입고온보딩_건너뛰기","입고온보딩진입","init_WebviewTrigger"],"sources":["https:/framerusercontent.com/modules/LTGomejtXAv8P3wIPgSX/sZen2XRUuOsbtnOpP7m5/MobileSupport.js","https:/framerusercontent.com/modules/xYjQQGU6dSyZ7gsQD3ml/ZwNn9SwZ4tsatp8Swdwa/WebviewActions.js","https:/framerusercontent.com/modules/7IBXb0sSZvY7gvIRiDVO/gwe2QfXlkLsbHUe6FGwU/WebviewTrigger.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";/**\n * 모바일 기기에서만 WrappedComponent를 렌더링하는 HOC\n */export function withMobileOnly(WrappedComponent){return props=>{const isMobile=useIsMobileUA();// 감지 전(null) 혹은 데스크톱(false)인 경우 렌더링하지 않음\nif(isMobile!==true){return null;}// 모바일일 때만 렌더링\nreturn /*#__PURE__*/_jsx(WrappedComponent,{...props});};}/**\n * User-Agent 기반 클라이언트 감지 훅\n * - 초기: null (감지 전)\n * - 모바일: true\n * - 데스크톱 등 비모바일: false\n */export function useIsMobileUA(){const[isMobile,setIsMobile]=useState(null);useEffect(()=>{let mobile;const ua=navigator.userAgent||\"\";mobile=/Mobi|Android|iP(hone|od|ad)/i.test(ua);setIsMobile(mobile);},[]);return isMobile;}export function isIOSWebView(){return!!window?.webkit?.messageHandlers;// return /iPhone|iPad|iPod/i.test(window.navigator.userAgent)\n}export function isAndroidWebView(){return!!window?.phoca;// return /Android/i.test(window.navigator.userAgent)\n}export function parsePhocaMarketUA(ua){const userAgent=ua||navigator.userAgent||\"\";const match=userAgent.match(/PhocaMarket\\s*\\(([\\d.]+);\\s*(\\w+)\\s+([\\d.]+)\\)/);if(!match)return null;return{appVersion:match[1],platform:match[2],osVersion:match[3]};}/**\n * 시멘틱 버전 비교\n * compareVersions(\"6.1.2\", \"6.0.0\") =>  1  (a > b)\n * compareVersions(\"6.0.0\", \"6.1.2\") => -1  (a < b)\n * compareVersions(\"6.1.2\", \"6.1.2\") =>  0  (a === b)\n */export function compareVersions(a,b){const pa=a.split(\".\").map(Number);const pb=b.split(\".\").map(Number);const len=Math.max(pa.length,pb.length);for(let i=0;i<len;i++){const na=pa[i]||0;const nb=pb[i]||0;if(na>nb)return 1;if(na<nb)return-1;}return 0;}/**\n * 현재 앱 버전이 최소 버전 이상인지 확인\n * isAppVersionAtLeast(\"6.1.0\") => true (현재 6.1.2인 경우)\n */export function isAppVersionAtLeast(minVersion){const info=parsePhocaMarketUA();if(!info)return false;return compareVersions(info.appVersion,minVersion)>=0;}/**\n * iOS 인가?\n */export function isIOSApp(){return parsePhocaMarketUA()?.platform===\"iOS\";}/**\n * Android 인가?\n */export function isAndroidApp(){return parsePhocaMarketUA()?.platform===\"Android\";}\nexport const __FramerMetadata__ = {\"exports\":{\"isIOSApp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parsePhocaMarketUA\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsMobileUA\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isAppVersionAtLeast\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isAndroidApp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isIOSWebView\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMobileOnly\":{\"type\":\"reactComponent\",\"name\":\"withMobileOnly\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"compareVersions\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PhocaMarketAppInfo\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isAndroidWebView\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MobileSupport.map","import{isIOSWebView,isAndroidWebView}from\"https://framerusercontent.com/modules/LTGomejtXAv8P3wIPgSX/sZen2XRUuOsbtnOpP7m5/MobileSupport.js\";export const actions={입고신청방법선택:{android:\"navConsignRec\",ios:\"ConsignmentSellApplicationSelectMethodVC\",deeplink:\"https://app.phocamarket.com/consignment_request\"},입고신청방법선택강제:{android:\"navConsignRec\",ios:\"ConsignmentOnboarding\",deeplink:\"https://app.phocamarket.com/consignment_request\"},콜렉트북:{android:\"navCollectBook\",ios:\"CollectBookVC\",deeplink:\"https://app.phocamarket.com/collectbook\"}};export const amplitudeEvent=({name,properties={}})=>{const jsonString=JSON.stringify({event_name:name,event_value:properties});let mobileAction=`amplitude/${jsonString}`;let payload={android:mobileAction,ios:mobileAction,deeplink:\"\"};webviewTriggerOnClickAction(payload);};export const webviewTriggerOnClickAction=payload=>{if(isIOSWebView()){window?.webkit.messageHandlers.scriptHandler.postMessage(payload.ios);}else if(isAndroidWebView()){window?.phoca.getData(payload.android);}else{window?.open(payload.deeplink);}};\nexport const __FramerMetadata__ = {\"exports\":{\"webviewTriggerOnClickAction\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"WebViewEventActionPayload\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"amplitudeEvent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"actions\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"WebviewTriggerActionPayload\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{webviewTriggerOnClickAction,amplitudeEvent,actions}from\"https://framerusercontent.com/modules/xYjQQGU6dSyZ7gsQD3ml/ZwNn9SwZ4tsatp8Swdwa/WebviewActions.js\";import{withMobileOnly,parsePhocaMarketUA,isAppVersionAtLeast,isAndroidWebView}from\"https://framerusercontent.com/modules/LTGomejtXAv8P3wIPgSX/sZen2XRUuOsbtnOpP7m5/MobileSupport.js\";const MOBILE_MAX_WIDTH=809;export function 입고신청하러가기버튼(Component){const Wrapped=props=>/*#__PURE__*/_jsx(Component,{...props,onClick:()=>{amplitudeEvent({name:\"clicked_warehousing_newguide\"});webviewTriggerOnClickAction(actions.입고신청방법선택);}});return withMobileOnly(Wrapped);}export function Cupost연결(Component){const Wrapped=props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{e.preventDefault();navigateToCupost();}});return withMobileOnly(Wrapped);}export function 빠른판매가이드_빠른판매하러가기버튼(Component){const Wrapped=props=>/*#__PURE__*/_jsx(Component,{...props,onClick:()=>{amplitudeEvent({name:\"clicked_collectbook_quicksaleguide\"});webviewTriggerOnClickAction(actions.콜렉트북);}});return withMobileOnly(Wrapped);}export function 빠른판매가이드_처음입고하시나요버튼(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:()=>{amplitudeEvent({name:\"clicked_warehousing_quicksaleguide\"});}});}export function 입고온보딩_입고신청하기버튼(Component){const Wrapped=props=>/*#__PURE__*/_jsx(Component,{...props,onClick:()=>{amplitudeEvent({name:\"clicked_apply_warehousing_onboarding\"});navigateToConsignmentSellSelect();}});return withMobileOnly(Wrapped);}export function 입고온보딩_건너뛰기(Component){const Wrapped=props=>/*#__PURE__*/_jsx(Component,{...props,onClick:()=>{amplitudeEvent({name:\"clicked_skip_warehousing_onboarding\"});navigateToConsignmentSellSelect();}});return withMobileOnly(Wrapped);}export function 입고온보딩진입(Component){return props=>{useEffect(()=>{amplitudeEvent({name:\"viewed_warehousing_onboarding\"});},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// 입고 신청 선택화면 앱 버전 대응\nfunction navigateToConsignmentSellSelect(){const ua=parsePhocaMarketUA?.()??null;const isIos=ua?.platform===\"iOS\";if(isIos&&isAppVersionAtLeast(\"7.2.1\")){webviewTriggerOnClickAction(actions.입고신청방법선택강제);}else{webviewTriggerOnClickAction(actions.입고신청방법선택);}}// outBrowser 트리거 구버전 대응\nfunction navigateToCupost(){// Android-6.3.9, iOS-7.4.4 이후 활용 가능\nif(isAndroidWebView()&&!isAppVersionAtLeast(\"6.3.9\")){window.location.href=\"https://www.cupost.co.kr/mobile/qrresend/ext/qrResend.cupost\";return;}webviewTriggerOnClickAction({ios:isAppVersionAtLeast(\"7.4.4\")?\"outBrowser/https://www.cupost.co.kr/mobile/qrresend/ext/qrResend.cupost\":\"ShareTwitter/https://www.cupost.co.kr/mobile/qrresend/ext/qrResend.cupost\",android:\"outBrowser/https://www.cupost.co.kr/mobile/qrresend/ext/qrResend.cupost\",deeplink:\"\"});}\nexport const __FramerMetadata__ = {\"exports\":{\"입고신청하러가기버튼\":{\"type\":\"reactHoc\",\"name\":\"입고신청하러가기버튼\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"입고온보딩진입\":{\"type\":\"reactHoc\",\"name\":\"입고온보딩진입\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"입고온보딩_입고신청하기버튼\":{\"type\":\"reactHoc\",\"name\":\"입고온보딩_입고신청하기버튼\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Cupost연결\":{\"type\":\"reactHoc\",\"name\":\"Cupost연결\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"입고온보딩_건너뛰기\":{\"type\":\"reactHoc\",\"name\":\"입고온보딩_건너뛰기\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"빠른판매가이드_빠른판매하러가기버튼\":{\"type\":\"reactHoc\",\"name\":\"빠른판매가이드_빠른판매하러가기버튼\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"빠른판매가이드_처음입고하시나요버튼\":{\"type\":\"reactHoc\",\"name\":\"빠른판매가이드_처음입고하시나요버튼\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WebviewTrigger.map"],"mappings":"A,8IAEG,SAAgBU,EAAe,EAAiB,CAAC,MAAO,IAAuBC,EACxE,IAAI,GACM,gBAAKC,EAAiB,CAAC,GAAGC,CAAK,CAAC,EADzB,IAC6B,CAKrD,SAAgBF,GAAe,CAAC,GAAK,CAACG,EAASC,GAAaf,EAAS,IAAI,EAAsI,OAApIO,MAAc,CAAC,IAAIS,EAAaC,EAAGd,EAAU,WAAW,GAAG,EAAO,+BAA+B,KAAKc,CAAE,EAAEF,EAAYC,CAAM,CAAE,EAAE,CAAC,CAAC,EAASF,CAAS,CAAC,SAAgBI,GAAc,CAAC,MAAM,CAAC,CAACT,GAAQ,QAAQ,eAC1R,CAAC,SAAgBU,GAAkB,CAAC,MAAM,CAAC,CAACV,GAAQ,KACpD,CAAC,SAAgBW,EAAmB,EAAG,CAA6C,IAAMC,GAAlCJ,GAAId,EAAU,WAAW,GAAA,CAAyB,MAAM,gDAAgD,EAAwB,OAAlBkB,EAAwB,CAAC,WAAWA,EAAM,GAAG,SAASA,EAAM,GAAG,UAAUA,EAAM,EAAE,EAApE,IAAsE,CAKtP,SAAgBC,EAAgB,EAAE,EAAE,CAAC,IAAMC,EAAGC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,EAAQC,EAAGC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,EAAQC,EAAI,KAAK,IAAIJ,EAAG,OAAOE,EAAG,MAAM,EAAE,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