{"version":3,"file":"horizon.V39oCP_P.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/CUV1eCz5ogbF6qiRgGK5/UDOw5JMMm73tLpO9CJeg/horizon.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useAnimation}from\"framer-motion\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function withHorizontalDrag(Component){return props=>{const{dragLimit=8e3,...rest}=props;const controls=useAnimation();const[showBackButton,setShowBackButton]=useState(false);const handleDragEnd=(event,info)=>{if(info.offset.x<=-dragLimit+100){setShowBackButton(true);}else{setShowBackButton(false);}};const handleBackToStart=()=>{controls.start({x:0});setShowBackButton(false);};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...rest,animate:controls,drag:\"x\",dragConstraints:{left:-dragLimit,right:0},dragElastic:.1,dragTransition:{power:.2,timeConstant:100},onDragEnd:handleDragEnd,style:{cursor:\"grab\"}}),showBackButton&&/*#__PURE__*/_jsx(\"button\",{onClick:handleBackToStart,style:{position:\"fixed\",right:20,bottom:20,padding:\"12px 20px\",background:\"#000\",color:\"#fff\",border:\"none\",borderRadius:8,cursor:\"pointer\"},children:\"← Kembali\"})]});};}addPropertyControls(withHorizontalDrag,{dragLimit:{type:ControlType.Number,title:\"Drag Limit\",defaultValue:1e3,min:0,max:1e4,step:100}});\nexport const __FramerMetadata__ = {\"exports\":{\"withHorizontalDrag\":{\"type\":\"reactHoc\",\"name\":\"withHorizontalDrag\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./horizon.map"],"mappings":"yOAAuM,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,YAAU,IAAI,GAAG,GAAM,EAAY,EAAS,GAAc,CAAM,CAAC,EAAe,GAAmBA,EAAS,GAAM,CAAO,GAAe,EAAM,IAAO,CAAI,EAAK,OAAO,GAAG,CAAC,EAAU,IAAK,EAAkB,GAAK,CAAO,EAAkB,GAAM,EAAU,MAAsB,CAAC,EAAS,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAkB,GAAM,EAAG,OAAoB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,EAAU,CAAC,GAAG,EAAK,QAAQ,EAAS,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAU,MAAM,EAAE,CAAC,YAAY,GAAG,eAAe,CAAC,MAAM,GAAG,aAAa,IAAI,CAAC,UAAU,EAAc,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,GAA6B,EAAK,SAAS,CAAC,QAAQ,EAAkB,MAAM,CAAC,SAAS,QAAQ,MAAM,GAAG,OAAO,GAAG,QAAQ,YAAY,WAAW,OAAO,MAAM,OAAO,OAAO,OAAO,aAAa,EAAE,OAAO,UAAU,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,CAAC,mBAAz+B,IAAwC,IAA4B,IAAoD,CAAq3B,EAAoB,EAAmB,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,IAAI,IAAI,EAAE,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC"}