@buoy-gg/shared-ui 7.0.77 → 7.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/commonjs/JsModal.js +1 -1
  2. package/lib/commonjs/dataViewer/SplitDiffViewer.js +1 -1
  3. package/lib/commonjs/dataViewer/ThemedSplitView.js +1 -1
  4. package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +1 -1
  5. package/lib/commonjs/history/components/HistoryList.js +1 -1
  6. package/lib/commonjs/license/FreeAccountPrompt.js +1 -1
  7. package/lib/commonjs/settings/components/BubbleSettingsSection.js +1 -1
  8. package/lib/commonjs/ui/components/ChipStrip.js +1 -1
  9. package/lib/commonjs/ui/components/DataInspector.js +1 -1
  10. package/lib/commonjs/ui/components/DetailView.js +1 -1
  11. package/lib/commonjs/ui/components/DynamicFilterView.js +1 -1
  12. package/lib/commonjs/ui/components/EntityFilterView.js +1 -1
  13. package/lib/commonjs/ui/components/EventHistoryViewer/EventHistoryViewer.js +1 -1
  14. package/lib/commonjs/ui/components/EventHistoryViewer/EventPickerModal.js +1 -1
  15. package/lib/module/JsModal.js +1 -1
  16. package/lib/module/dataViewer/SplitDiffViewer.js +1 -1
  17. package/lib/module/dataViewer/ThemedSplitView.js +1 -1
  18. package/lib/module/dataViewer/VirtualizedDataExplorer.js +1 -1
  19. package/lib/module/history/components/HistoryList.js +1 -1
  20. package/lib/module/license/FreeAccountPrompt.js +1 -1
  21. package/lib/module/settings/components/BubbleSettingsSection.js +1 -1
  22. package/lib/module/ui/components/ChipStrip.js +1 -1
  23. package/lib/module/ui/components/DataInspector.js +1 -1
  24. package/lib/module/ui/components/DetailView.js +1 -1
  25. package/lib/module/ui/components/DynamicFilterView.js +1 -1
  26. package/lib/module/ui/components/EntityFilterView.js +1 -1
  27. package/lib/module/ui/components/EventHistoryViewer/EventHistoryViewer.js +1 -1
  28. package/lib/module/ui/components/EventHistoryViewer/EventPickerModal.js +1 -1
  29. package/lib/typescript/commonjs/JsModal.d.ts +7 -0
  30. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  31. package/lib/typescript/module/JsModal.d.ts +7 -0
  32. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  33. package/lib/web/chunks/chunk-BMITMQVB.mjs +3 -3
  34. package/lib/web/chunks/chunk-GTRVOJUH.mjs +1 -1
  35. package/lib/web/chunks/chunk-HE5ONCAL.mjs +6 -0
  36. package/lib/web/chunks/chunk-OQB3GW44.mjs +1 -0
  37. package/lib/web/dataViewer.mjs +2 -2
  38. package/lib/web/history.mjs +1 -1
  39. package/lib/web/index.mjs +2 -2
  40. package/lib/web/ui.mjs +1 -1
  41. package/package.json +5 -5
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.JsModal=void 0;var _licenseModule=require("./license/licenseModule.js");var _AccountSetup=require("./license/AccountSetup");var _react=require("react");var _reactNative=require("react-native");var _absoluteFill=require("./utils/absoluteFill.js");var _useSafeAreaInsets=require("./hooks/useSafeAreaInsets");var _index=require("./ui/gameUI/index.js");var _index2=require("./ui/components/index.js");var _ToolBackground=require("./ui/backgrounds/ToolBackground.js");var _nightTheme=require("./ui/night/nightTheme.js");var _persistentStorage=require("./utils/persistentStorage");var _modalStorage=require("./utils/modalStorage.js");var _devToolsStorageKeys=require("./storage/devToolsStorageKeys.js");var _index3=require("./context/index.js");var _jsxRuntime=require("react/jsx-runtime");const INSTANT_MODAL_ENTRANCE=true;const SCREEN=_reactNative.Dimensions.get("window");const MIN_HEIGHT=100;const DEFAULT_HEIGHT=400;const FLOATING_WIDTH=SCREEN.width;const FLOATING_HEIGHT=500;const FLOATING_MIN_WIDTH=SCREEN.width*.25;const FLOATING_MIN_HEIGHT=80;const WINDOW_CONTROLS_BAND=20;const DragIndicator=(0,_react.memo)(function s({isResizing:n,mode:x,hasCustomContent:B=false,variant:m="default"}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dragIndicatorContainer,B&&styles.dragIndicatorContainerCustom],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dragIndicator,x==="floating"&&styles.floatingDragIndicator,n&&styles.dragIndicatorActive,m==="night"&&styles.nightDragIndicator]}),n&&x==="bottomSheet"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.resizeGripContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine})]})]})});const CornerHandle=(0,_react.memo)(function s({position:n,isActive:x}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.cornerHandle],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.handler,x&&styles.handlerActive]})})});const ModalHeader=(0,_react.memo)(function s({header:n,onClose:x,onToggleMode:B,onMinimize:m,isResizing:W,mode:Y,panHandlers:p,variant:a="default"}){const b=(0,_react.useRef)(0);const N=(0,_react.useRef)(0);const V=(0,_react.useRef)(null);const w=(0,_react.useCallback)(()=>{const D=Date.now();const J=D-b.current;if(J>500){N.current=0}N.current++;b.current=D;if(V.current){clearTimeout(V.current)}V.current=setTimeout(()=>{if(N.current===2){B()}else if(N.current>=3){if(m){m()}}N.current=0},300)},[B,m]);(0,_react.useEffect)(()=>{return()=>{if(V.current){clearTimeout(V.current)}}},[]);const T=p?p:{};const $=!!p;if(n?.customContent){const D=(0,_react.isValidElement)(n.customContent)&&typeof n.customContent.type==="function"&&n.customContent.type.name==="CyberpunkModalHeader";if(D){return(0,_react.cloneElement)(n.customContent,{onToggleMode:B,onClose:x,mode:Y,panHandlers:T,showToggleButton:n?.showToggleButton!==false,hideCloseButton:n?.hideCloseButton})}let J=n.customContent;if((0,_react.isValidElement)(n.customContent)&&m){J=(0,_react.cloneElement)(n.customContent,{onMinimize:m})}const g=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:W,mode:Y,hasCustomContent:true,variant:a}),J]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,a==="night"&&styles.nightHeader],...T,children:$?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:w,children:g}):g})}const O=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:W,mode:Y,variant:a}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerContent,children:[n?.title&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:n.title}),n?.subtitle&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerSubtitle,children:n.subtitle})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.headerHintText,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hintText,children:"Double tap: Toggle \u2022 Triple tap: Close"})})]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,Y==="floating"&&styles.floatingModeHeader,a==="night"&&styles.nightHeader],...T,children:$?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:w,children:O}):O})});const JsModalComponent=({visible:s,onClose:n,children:x,header:B,styles:m={},minHeight:W=MIN_HEIGHT,maxHeight:Y,initialHeight:p=DEFAULT_HEIGHT,animatedHeight:a,benchMotion:b,initialMode:N="bottomSheet",onModeChange:V,persistenceKey:w,enablePersistence:T=true,initialFloatingPosition:$,footer:O,footerHeight:D=0,onBack:J,onMinimize:g,minimizeRequest:ie=0,minimizeTargetPosition:fe,initialModalState:l,zIndex:ae,disableScrollWrapper:Ce=false,background:le=true,variant:C="night"})=>{const j=(0,_useSafeAreaInsets.useSafeAreaInsets)();const[ye,Re]=(0,_react.useState)(!T);const[r,ge]=(0,_react.useState)(N);const[X,I]=(0,_react.useState)(false);const[de,Q]=(0,_react.useState)(false);const[Be,me]=(0,_react.useState)(p);const[k,K]=(0,_react.useState)({width:FLOATING_WIDTH,height:FLOATING_HEIGHT,top:(SCREEN.height-FLOATING_HEIGHT)/2,left:0});const[ue]=(0,_react.useState)({width:SCREEN.width,height:SCREEN.height});const[Ee,ce]=(0,_react.useState)(false);const[Me,xe]=(0,_react.useState)(false);const _e=(0,_index3.useHintsDisabled)();const u=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const f=(0,_react.useRef)(new _reactNative.Animated.Value(SCREEN.height)).current;const Ve=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const v=(0,_react.useRef)(new _reactNative.Animated.Value(p)).current;const A=(0,_react.useRef)(p);(0,_react.useEffect)(()=>{if(!T||!w||!ye)return;const e=setTimeout(()=>{_modalStorage.ModalStorage.save(w,{mode:r,panelHeight:A.current,dimensions:k,isVisible:s})},500);return()=>clearTimeout(e)},[r,Be,k,s,w,T,ye]);const Te=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(a&&!Te.current){Te.current=true;A.current=p;a.setValue(p)}},[a,p]);(0,_react.useEffect)(()=>{h.current=k},[k]);const d=(0,_react.useRef)(new _reactNative.Animated.ValueXY({x:$?.x??0,y:$?.y??(SCREEN.height-FLOATING_HEIGHT)/2})).current;const F=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const P=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_WIDTH)).current;const G=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_HEIGHT)).current;const h=(0,_react.useRef)(k);const Se=(0,_react.useRef)(k);const We=(0,_react.useRef)(0);const Ne=(0,_react.useRef)(0);const Oe=(0,_react.useRef)(0);const Fe=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{let e=true;const o=async()=>{try{const t=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();const H=await _persistentStorage.persistentStorage.getItem(t);if(e){ce(H!=="true");xe(true)}}catch(t){if(e){ce(true);xe(true)}}};o();return()=>{e=false}},[]);const Pe=(0,_react.useCallback)(async()=>{try{const e=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();await _persistentStorage.persistentStorage.setItem(e,"true");ce(false)}catch(e){ce(false)}},[]);const je=(0,_react.useRef)(V);je.current=V;(0,_react.useEffect)(()=>{if(!T||!w){Re(true);return}let e=true;const o=async()=>{const t=await _modalStorage.ModalStorage.load(w);if(e&&t){if(t.mode){ge(t.mode);je.current?.(t.mode)}if(t.panelHeight){me(t.panelHeight);A.current=t.panelHeight;v.setValue(t.panelHeight);a?.setValue(t.panelHeight)}if(t.dimensions){K(t.dimensions);d.setValue({x:t.dimensions.left,y:t.dimensions.top});P.setValue(t.dimensions.width);G.setValue(t.dimensions.height)}}if(e)Re(true)};o();return()=>{e=false}},[w,T,v,G,P,d]);(0,_react.useEffect)(()=>{return()=>{u.stopAnimation();f.stopAnimation();F.stopAnimation();Ve.stopAnimation();v.stopAnimation();d.stopAnimation();P.stopAnimation();G.stopAnimation();u.setValue(0);f.setValue(SCREEN.height);F.setValue(0);Ve.setValue(0);v.setValue(p);A.current=p}},[]);const Ie=u.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"});const pe=Y||SCREEN.height-j.top;const q=(0,_react.useCallback)(()=>{Q(false);I(false);const e=r==="bottomSheet"?"floating":"bottomSheet";ge(e);V?.(e)},[r,V]);(0,_react.useEffect)(()=>{Q(false);I(false)},[r]);const E=(0,_react.useCallback)(()=>{if(!g)return;const e={mode:r,panelHeight:A.current,floatingPosition:{x:h.current.left,y:h.current.top},floatingDimensions:{width:h.current.width,height:h.current.height}};if(T&&w)void _modalStorage.ModalStorage.saveMinimized(w,e);const o=fe?.x??SCREEN.width-50;const t=fe?.y??SCREEN.height-150;if(r==="bottomSheet"){_reactNative.Animated.parallel([_reactNative.Animated.timing(u,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(f,{toValue:SCREEN.height,duration:300,useNativeDriver:true})]).start(()=>{g(e)})}else{_reactNative.Animated.parallel([_reactNative.Animated.timing(F,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(u,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(d,{toValue:{x:o,y:t},duration:300,useNativeDriver:true})]).start(()=>{g(e)})}},[r,g,fe,T,w,u,f,F,d]);const ve=(0,_react.useRef)(ie);(0,_react.useEffect)(()=>{if(ve.current===ie)return;ve.current=ie;E()},[ie,E]);(0,_react.useEffect)(()=>{if(!l)return;if(l.mode){ge(l.mode);V?.(l.mode)}if(l.panelHeight){me(l.panelHeight);A.current=l.panelHeight;v.setValue(l.panelHeight)}if(l.floatingDimensions&&l.floatingPosition){const e={width:l.floatingDimensions.width,height:l.floatingDimensions.height,top:l.floatingPosition.y,left:l.floatingPosition.x};K(e);d.setValue({x:l.floatingPosition.x,y:l.floatingPosition.y});P.setValue(l.floatingDimensions.width);G.setValue(l.floatingDimensions.height)}},[l]);const Ae=e=>{if(e){if(r==="bottomSheet"){f.setValue(0)}else{F.setValue(1);d.setValue({x:h.current.left,y:h.current.top})}u.setValue(1)}else{if(r==="bottomSheet"){f.setValue(SCREEN.height)}u.setValue(0)}};const De=(0,_react.useRef)(null);if(INSTANT_MODAL_ENTRANCE&&De.current!==s){De.current=s;Ae(s)}(0,_react.useEffect)(()=>{let e=null;let o=null;if(INSTANT_MODAL_ENTRANCE){Ae(s);return}if(s){f.setValue(SCREEN.height);u.setValue(0);if(r==="bottomSheet"){e=_reactNative.Animated.parallel([_reactNative.Animated.spring(f,{toValue:0,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(u,{toValue:1,duration:200,useNativeDriver:true})]);e.start()}else{F.setValue(1);d.setValue({x:h.current.left,y:h.current.top});e=_reactNative.Animated.timing(u,{toValue:1,duration:200,useNativeDriver:true});e.start()}}else{if(r==="bottomSheet"){o=_reactNative.Animated.parallel([_reactNative.Animated.spring(f,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(u,{toValue:0,duration:200,useNativeDriver:true})]);o.start()}else{o=_reactNative.Animated.timing(u,{toValue:0,duration:200,useNativeDriver:true});o.start()}}return()=>{if(e){e.stop()}if(o){o.stop()}}},[s,r,u,f,F,d,a]);const ke=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{if(!__DEV__||!b||!s)return void 0;let e=null;let o=null;let t=true;const H=Date.now();let y=false;const M=L=>{y=L;if(b==="resize"||b==="float-resize"){I(L)}else if(b==="float-drag"){Q(L)}};if(b==="mode-cycle"){o=setInterval(()=>q(),2200)}else{const L=W;const he=pe;const ne=()=>{if(!t)return;const Z=(Date.now()-H)/1e3;const i=Z%2.5;if(i<2&&!y)M(true);else if(i>=2&&y)M(false);if(y){const R=(Math.sin(Z*2.2)+1)/2;if(b==="resize"){const c=L+R*(he-L);v.setValue(c);A.current=c;if(a){a.setValue(c)}}else if(b==="float-drag"){const c=(Math.sin(Z*1.7)+1)/2;d.setValue({x:10+R*Math.max(SCREEN.width-FLOATING_WIDTH-20,0),y:70+c*260})}else if(b==="float-resize"){const c=FLOATING_WIDTH+R*Math.max(SCREEN.width-FLOATING_WIDTH-40,0);const S=FLOATING_HEIGHT+R*240;P.setValue(c);G.setValue(S);h.current={...h.current,width:c,height:S}}}e=requestAnimationFrame(ne)};e=requestAnimationFrame(ne)}return()=>{t=false;if(e!=null)cancelAnimationFrame(e);if(o!=null)clearInterval(o);I(false);Q(false)}},[b,s]);const Ge=(0,_react.useMemo)(()=>_reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>r==="bottomSheet",onMoveShouldSetPanResponder:(e,o)=>r==="bottomSheet"&&Math.abs(o.dy)>3,onPanResponderTerminationRequest:()=>false,onPanResponderGrant:e=>{I(true);ke.current=e.nativeEvent.locationY||0;v.stopAnimation(o=>{A.current=o});a?.stopAnimation();f.stopAnimation()},onPanResponderMove:e=>{const o=e.nativeEvent.pageY-ke.current;let t=SCREEN.height-o;t=Math.max(W,Math.min(t,pe));v.setValue(t);A.current=t;if(a){a.setValue(t)}},onPanResponderRelease:(e,o)=>{I(false);const t=A.current;const H=o.vy>.8&&o.dy>50||o.dy>150&&t<=W;if(H){_reactNative.Animated.parallel([_reactNative.Animated.timing(u,{toValue:0,duration:200,useNativeDriver:true}),_reactNative.Animated.spring(f,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true})]).start(()=>n());return}me(t);if(a)a.setValue(t)},onPanResponderTerminate:()=>{I(false)}}),[r,W,pe,v,a,f,u,n]);const ee=(0,_react.useCallback)(e=>{let o=false;return _reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>r==="floating",onMoveShouldSetPanResponder:()=>r==="floating",onPanResponderGrant:()=>{o=false;const t=h.current;d.stopAnimation(({x:H,y})=>{d.setValue({x:H,y})});I(true);Se.current={...t};Oe.current=t.height;Fe.current=t.width;We.current=t.left;Ne.current=t.top},onPanResponderMove:(t,H)=>{const{dx:y,dy:M}=H;if(Math.abs(y)<.5&&Math.abs(M)<.5)return;o=true;const L=Math.max(0,j.left||0);const he=ue.width-Math.max(0,j.right||0);const ne=Math.max(0,j.top||0);const Z=ue.height-Math.max(0,j.bottom||0);const i=Se.current;const R=i.left+i.width;const c=i.top+i.height;let S=i.left;let _=i.top;let re=R;let se=c;switch(e){case"topLeft":{const U=Math.max(L,Math.min(i.left+y,R-FLOATING_MIN_WIDTH));const z=Math.max(ne,Math.min(i.top+M,c-FLOATING_MIN_HEIGHT));S=U;_=z;re=R;se=c;break}case"topRight":{const U=Math.min(he,Math.max(R+y,i.left+FLOATING_MIN_WIDTH));const z=Math.max(ne,Math.min(i.top+M,c-FLOATING_MIN_HEIGHT));S=i.left;_=z;re=U;se=c;break}case"bottomLeft":{const U=Math.max(L,Math.min(i.left+y,R-FLOATING_MIN_WIDTH));const z=Math.min(Z,Math.max(c+M,i.top+FLOATING_MIN_HEIGHT));S=U;_=i.top;re=R;se=z;break}case"bottomRight":{const U=Math.min(he,Math.max(R+y,i.left+FLOATING_MIN_WIDTH));const z=Math.min(Z,Math.max(c+M,i.top+FLOATING_MIN_HEIGHT));S=i.left;_=i.top;re=U;se=z;break}}const be=Math.max(FLOATING_MIN_WIDTH,re-S);const we=Math.max(FLOATING_MIN_HEIGHT,se-_);K({width:be,height:we,left:S,top:_});P.setValue(be);G.setValue(we);d.setValue({x:S,y:_});h.current={width:be,height:we,left:S,top:_}},onPanResponderRelease:()=>{I(false);o=false;K(h.current)},onPanResponderTerminate:()=>{I(false);o=false}})},[r,ue,j.left,j.right,j.top,j.bottom,d,P,G,n,J]);const He=(0,_react.useMemo)(()=>{return{topLeft:ee("topLeft"),topRight:ee("topRight"),bottomLeft:ee("bottomLeft"),bottomRight:ee("bottomRight")}},[ee]);const qe=(0,_react.useCallback)(()=>{Q(true)},[]);const Ue=(0,_react.useCallback)(e=>{Q(false);const o=h.current;const t={...o,left:e.x,top:e.y};K(t)},[]);const Le=(0,_react.useRef)(0);const te=(0,_react.useRef)(0);const oe=(0,_react.useRef)(null);const ze=(0,_react.useCallback)(()=>{const e=Date.now();const o=e-Le.current;if(o>500){te.current=0}te.current++;Le.current=e;if(oe.current){clearTimeout(oe.current)}oe.current=setTimeout(()=>{if(te.current===2){q()}else if(te.current>=3){if(g){E()}}te.current=0},300)},[q,g,E]);(0,_react.useEffect)(()=>{return()=>{if(oe.current){clearTimeout(oe.current)}}},[]);if(r==="floating"){return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{nativeID:"jsmodal-root",pointerEvents:s?"auto":"none",accessibilityElementsHidden:!s,importantForAccessibility:s?"auto":"no-hide-descendants",style:[styles.floatingModal,{width:k.width,height:k.height,opacity:Ie,transform:[{translateX:d.x},{translateY:d.y}],...ae!==void 0&&{zIndex:ae}},C==="night"&&styles.nightFloatingModal,(de||X)&&styles.floatingModalDragging,m.container,!s&&styles.parkedOffscreen],children:[le&&C==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropFloating,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(_index2.DraggableHeader,{position:d,onDragStart:qe,onDragEnd:Ue,onTap:ze,containerBounds:ue,elementSize:k,minPosition:{x:0,y:j.top},style:styles.floatingHeader,enabled:r==="floating"&&!X,children:(0,_jsxRuntime.jsx)(ModalHeader,{header:B,onClose:n,onToggleMode:q,onMinimize:g?E:void 0,isResizing:de||X,mode:r,variant:C})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:n,onMinimize:g?E:void 0,onToggleMode:q,mode:r,variant:C})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,C==="night"&&styles.nightContent,m.content],children:[le&&C!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,Ce?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:D},children:x}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:D},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:x}),O?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:O}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{...He.bottomLeft.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,left:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomLeft",isActive:de||X})}),(0,_jsxRuntime.jsx)(_reactNative.View,{...He.bottomRight.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,right:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomRight",isActive:de||X})})]})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[s?styles.fullScreenContainer:styles.parkedFullScreen,s&&ae!==void 0&&{zIndex:ae}],pointerEvents:s?"box-none":"none",accessibilityElementsHidden:!s,importantForAccessibility:s?"auto":"no-hide-descendants",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{nativeID:"jsmodal-root",style:[styles.bottomSheetWrapper,{opacity:Ie,transform:[{translateY:f}]}],children:(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.bottomSheet,C==="night"&&styles.nightBottomSheet,m.container,{height:a||v}],children:[le&&C==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropSheet,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(ModalHeader,{header:B,onClose:n,onToggleMode:q,onMinimize:g?E:void 0,isResizing:X,mode:r,panHandlers:Ge.panHandlers,variant:C}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:n,onMinimize:g?E:void 0,onToggleMode:q,mode:r,variant:C})}),Me&&Ee&&r==="bottomSheet"&&!_e&&(0,_jsxRuntime.jsx)(_index2.ModalHintBanner,{onAcknowledge:Pe}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,C==="night"&&styles.nightContent,m.content],children:[le&&C!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,Ce?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:D},children:x}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:D},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:x}),O?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:O}):null]})]})})})};const styles=_reactNative.StyleSheet.create({fullScreenContainer:{..._absoluteFill.absoluteFill,zIndex:1e3},bottomSheetWrapper:{position:"absolute",bottom:0,left:0,right:0},bottomSheet:{backgroundColor:_index.buoyColors.card,borderTopLeftRadius:6,borderTopRightRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:-4},shadowOpacity:.2,shadowRadius:12,elevation:20},parkedOffscreen:{left:-9999,top:-9999,opacity:0},parkedFullScreen:{position:"absolute",left:-9999,top:-9999,width:SCREEN.width,height:SCREEN.height,opacity:0},floatingModal:{position:"absolute",backgroundColor:_index.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:20,elevation:24,zIndex:1e3,width:FLOATING_WIDTH,height:FLOATING_HEIGHT},floatingModalDragging:{borderColor:_index.buoyColors.primary,borderWidth:2,shadowColor:_index.buoyColors.primary+"99",shadowOpacity:.8,shadowRadius:12},header:{borderTopLeftRadius:6,borderTopRightRadius:6,backgroundColor:_index.buoyColors.card,minHeight:56,borderWidth:1,borderColor:_index.buoyColors.border,borderBottomWidth:1,borderBottomColor:_index.buoyColors.border},nightBottomSheet:{backgroundColor:_nightTheme.night.color.bg,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:-4},shadowOpacity:.22,shadowRadius:10},nightFloatingModal:{backgroundColor:_nightTheme.night.color.bg,borderRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.22,shadowRadius:14},nightHeader:{backgroundColor:"transparent",borderWidth:0,borderBottomWidth:0,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet},nightContent:{backgroundColor:"transparent"},nightBackdropSheet:{..._absoluteFill.absoluteFill,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightBackdropFloating:{..._absoluteFill.absoluteFill,borderRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightDragIndicator:{width:36,height:5,borderRadius:2.5,backgroundColor:_nightTheme.night.color.placeholder,shadowOpacity:0,elevation:0},floatingHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},windowControlsContainer:{position:"absolute",top:4,right:4,zIndex:10},floatingModeHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},headerInner:{flex:1,justifyContent:"center"},dragIndicatorContainer:{alignItems:"center",paddingVertical:8,backgroundColor:"transparent"},dragIndicatorContainerCustom:{minHeight:WINDOW_CONTROLS_BAND,justifyContent:"center",paddingVertical:0,backgroundColor:"transparent"},dragIndicator:{width:40,height:3,backgroundColor:_index.buoyColors.primary,borderRadius:2,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:4},floatingDragIndicator:{width:50,height:5,backgroundColor:_index.buoyColors.textMuted},dragIndicatorActive:{backgroundColor:_index.buoyColors.primary,width:40},resizeGripContainer:{position:"absolute",flexDirection:"row",gap:2,marginTop:12},resizeGripLine:{width:12,height:1,backgroundColor:_index.gameUIColors.success,opacity:.6},headerContent:{paddingHorizontal:16,alignItems:"center"},headerControls:{position:"absolute",top:8,right:16,flexDirection:"row",alignItems:"center"},headerTitle:{fontSize:16,fontWeight:"600",color:_index.gameUIColors.primary},headerSubtitle:{fontSize:12,color:_index.gameUIColors.secondary,paddingTop:4},headerHintText:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},hintText:{fontSize:10,color:_index.gameUIColors.muted,fontStyle:"italic"},controlButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",marginLeft:8},toggleButton:{backgroundColor:_index.gameUIColors.info+"1A",borderWidth:1,borderColor:_index.gameUIColors.info+"33"},closeButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",backgroundColor:_index.gameUIColors.error+"1A",borderWidth:1,borderColor:_index.gameUIColors.error+"33",marginLeft:8},iconLine:{position:"absolute",top:7.25,left:2,width:12,height:1.5,backgroundColor:_index.gameUIColors.error},content:{flex:1,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16,overflow:"hidden"},cornerHandle:{position:"absolute",zIndex:1},cornerHandleWrapper:{position:"absolute",width:30,height:30,zIndex:1e3},handler:{width:20,height:20,backgroundColor:"transparent",borderRadius:10,borderWidth:0,borderColor:"transparent"},handlerActive:{backgroundColor:_index.gameUIColors.success+"1A",borderColor:_index.gameUIColors.success,borderWidth:2,shadowColor:_index.gameUIColors.success+"99",shadowOffset:{width:0,height:0},shadowOpacity:1,shadowRadius:8}});const footerStyles=_reactNative.StyleSheet.create({footerContainer:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16}});const JsModal=exports.JsModal=(0,_react.memo)(s=>{const n=(0,_licenseModule.getUseAccountAccess)()();if(n.status!=="admitted")return s.visible?(0,_jsxRuntime.jsx)(_AccountSetup.AccountSetup,{}):null;return(0,_jsxRuntime.jsx)(JsModalComponent,{...s})});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.JsModal=void 0;var _licenseModule=require("./license/licenseModule.js");var _AccountSetup=require("./license/AccountSetup");var _react=require("react");var _reactNative=require("react-native");var _absoluteFill=require("./utils/absoluteFill.js");var _useSafeAreaInsets=require("./hooks/useSafeAreaInsets");var _index=require("./ui/gameUI/index.js");var _index2=require("./ui/components/index.js");var _ToolBackground=require("./ui/backgrounds/ToolBackground.js");var _nightTheme=require("./ui/night/nightTheme.js");var _persistentStorage=require("./utils/persistentStorage");var _modalStorage=require("./utils/modalStorage.js");var _devToolsStorageKeys=require("./storage/devToolsStorageKeys.js");var _index3=require("./context/index.js");var _jsxRuntime=require("react/jsx-runtime");const INSTANT_MODAL_ENTRANCE=true;const SCREEN=_reactNative.Dimensions.get("window");const MIN_HEIGHT=100;const DEFAULT_HEIGHT=400;const FLOATING_WIDTH=SCREEN.width;const FLOATING_HEIGHT=500;const FLOATING_MIN_WIDTH=SCREEN.width*.25;const FLOATING_MIN_HEIGHT=80;const WINDOW_CONTROLS_BAND=20;const DragIndicator=(0,_react.memo)(function n({isResizing:r,mode:T,hasCustomContent:M=false,variant:p="default"}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dragIndicatorContainer,M&&styles.dragIndicatorContainerCustom],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dragIndicator,T==="floating"&&styles.floatingDragIndicator,r&&styles.dragIndicatorActive,p==="night"&&styles.nightDragIndicator]}),r&&T==="bottomSheet"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.resizeGripContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine})]})]})});const CornerHandle=(0,_react.memo)(function n({position:r,isActive:T}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.cornerHandle],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.handler,T&&styles.handlerActive]})})});const ModalHeader=(0,_react.memo)(function n({header:r,onClose:T,onToggleMode:M,onMinimize:p,isResizing:_,mode:Y,panHandlers:b,variant:l="default"}){const w=(0,_react.useRef)(0);const N=(0,_react.useRef)(0);const S=(0,_react.useRef)(null);const y=(0,_react.useCallback)(()=>{const E=Date.now();const J=E-w.current;if(J>500){N.current=0}N.current++;w.current=E;if(S.current){clearTimeout(S.current)}S.current=setTimeout(()=>{if(N.current===2){M()}else if(N.current>=3){if(p){p()}}N.current=0},300)},[M,p]);(0,_react.useEffect)(()=>{return()=>{if(S.current){clearTimeout(S.current)}}},[]);const j=b?b:{};const $=!!b;if(r?.customContent){const E=(0,_react.isValidElement)(r.customContent)&&typeof r.customContent.type==="function"&&r.customContent.type.name==="CyberpunkModalHeader";if(E){return(0,_react.cloneElement)(r.customContent,{onToggleMode:M,onClose:T,mode:Y,panHandlers:j,showToggleButton:r?.showToggleButton!==false,hideCloseButton:r?.hideCloseButton})}let J=r.customContent;if((0,_react.isValidElement)(r.customContent)&&p){J=(0,_react.cloneElement)(r.customContent,{onMinimize:p})}const m=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:_,mode:Y,hasCustomContent:true,variant:l}),J]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,l==="night"&&styles.nightHeader],...j,children:$?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:y,children:m}):m})}const O=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:_,mode:Y,variant:l}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerContent,children:[r?.title&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:r.title}),r?.subtitle&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerSubtitle,children:r.subtitle})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.headerHintText,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hintText,children:"Double tap: Toggle \u2022 Triple tap: Close"})})]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,Y==="floating"&&styles.floatingModeHeader,l==="night"&&styles.nightHeader],...j,children:$?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:y,children:O}):O})});const JsModalComponent=({visible:n,onClose:r,children:T,header:M,styles:p={},minHeight:_=MIN_HEIGHT,maxHeight:Y,initialHeight:b=DEFAULT_HEIGHT,animatedHeight:l,benchMotion:w,initialMode:N="bottomSheet",onModeChange:S,persistenceKey:y,enablePersistence:j=true,initialFloatingPosition:$,footer:O,footerHeight:E=0,onBack:J,onMinimize:m,minimizeRequest:ie=0,minimizeTargetPosition:ge,initialModalState:d,zIndex:le,disableScrollWrapper:Re=false,background:de=true,variant:C="night",avoidKeyboard:xe=true})=>{const R=(0,_useSafeAreaInsets.useSafeAreaInsets)();const me=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(n)me.current=true;else if(me.current)_reactNative.Keyboard.dismiss()},[n]);(0,_react.useEffect)(()=>()=>{if(me.current)_reactNative.Keyboard.dismiss()},[]);const[Ve,Te]=(0,_react.useState)(!j);const[s,pe]=(0,_react.useState)(N);const[X,D]=(0,_react.useState)(false);const[ue,K]=(0,_react.useState)(false);const[We,be]=(0,_react.useState)(b);const[L,ee]=(0,_react.useState)({width:FLOATING_WIDTH,height:FLOATING_HEIGHT,top:(SCREEN.height-FLOATING_HEIGHT)/2,left:0});const[ce]=(0,_react.useState)({width:SCREEN.width,height:SCREEN.height});const[_e,he]=(0,_react.useState)(false);const[Ne,Se]=(0,_react.useState)(false);const Oe=(0,_index3.useHintsDisabled)();const c=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const f=(0,_react.useRef)(new _reactNative.Animated.Value(SCREEN.height)).current;const je=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const H=(0,_react.useRef)(new _reactNative.Animated.Value(b)).current;const I=(0,_react.useRef)(b);const Q=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;(0,_react.useEffect)(()=>{const e=_reactNative.Platform.OS==="ios"&&n&&s==="bottomSheet"&&xe;if(!e){Q.setValue(0);return}const o=(a,x)=>{_reactNative.Animated.timing(Q,{toValue:a,duration:x?.duration||250,easing:_reactNative.Easing.bezier(.17,.59,.4,.77),useNativeDriver:true}).start()};const t=a=>{const x=Math.max(0,SCREEN.height-a.endCoordinates.screenY);const k=Math.max(0,SCREEN.height-R.top-I.current);o(Math.min(x,k),a)};const A=[_reactNative.Keyboard.addListener("keyboardWillShow",t),_reactNative.Keyboard.addListener("keyboardWillChangeFrame",t),_reactNative.Keyboard.addListener("keyboardWillHide",a=>o(0,a))];return()=>{A.forEach(a=>a.remove());Q.setValue(0)}},[n,s,xe,R.top,Q]);const Fe=(0,_react.useMemo)(()=>_reactNative.Animated.subtract(f,Q),[f,Q]);(0,_react.useEffect)(()=>{if(!j||!y||!Ve)return;const e=setTimeout(()=>{_modalStorage.ModalStorage.save(y,{mode:s,panelHeight:I.current,dimensions:L,isVisible:n})},500);return()=>clearTimeout(e)},[s,We,L,n,y,j,Ve]);const Ie=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(l&&!Ie.current){Ie.current=true;I.current=b;l.setValue(b)}},[l,b]);(0,_react.useEffect)(()=>{g.current=L},[L]);const u=(0,_react.useRef)(new _reactNative.Animated.ValueXY({x:$?.x??0,y:$?.y??(SCREEN.height-FLOATING_HEIGHT)/2})).current;const F=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const P=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_WIDTH)).current;const G=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_HEIGHT)).current;const g=(0,_react.useRef)(L);const Ae=(0,_react.useRef)(L);const Pe=(0,_react.useRef)(0);const Ge=(0,_react.useRef)(0);const qe=(0,_react.useRef)(0);const ze=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{let e=true;const o=async()=>{try{const t=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();const A=await _persistentStorage.persistentStorage.getItem(t);if(e){he(A!=="true");Se(true)}}catch(t){if(e){he(true);Se(true)}}};o();return()=>{e=false}},[]);const Ue=(0,_react.useCallback)(async()=>{try{const e=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();await _persistentStorage.persistentStorage.setItem(e,"true");he(false)}catch(e){he(false)}},[]);const ke=(0,_react.useRef)(S);ke.current=S;(0,_react.useEffect)(()=>{if(!j||!y){Te(true);return}let e=true;const o=async()=>{const t=await _modalStorage.ModalStorage.load(y);if(e&&t){if(t.mode){pe(t.mode);ke.current?.(t.mode)}if(t.panelHeight){be(t.panelHeight);I.current=t.panelHeight;H.setValue(t.panelHeight);l?.setValue(t.panelHeight)}if(t.dimensions){ee(t.dimensions);u.setValue({x:t.dimensions.left,y:t.dimensions.top});P.setValue(t.dimensions.width);G.setValue(t.dimensions.height)}}if(e)Te(true)};o();return()=>{e=false}},[y,j,H,G,P,u]);(0,_react.useEffect)(()=>{return()=>{c.stopAnimation();f.stopAnimation();F.stopAnimation();je.stopAnimation();H.stopAnimation();u.stopAnimation();P.stopAnimation();G.stopAnimation();c.setValue(0);f.setValue(SCREEN.height);F.setValue(0);je.setValue(0);H.setValue(b);I.current=b}},[]);const ve=c.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"});const we=Y||SCREEN.height-R.top;const q=(0,_react.useCallback)(()=>{K(false);D(false);const e=s==="bottomSheet"?"floating":"bottomSheet";pe(e);S?.(e)},[s,S]);(0,_react.useEffect)(()=>{K(false);D(false)},[s]);const B=(0,_react.useCallback)(()=>{if(!m)return;const e={mode:s,panelHeight:I.current,floatingPosition:{x:g.current.left,y:g.current.top},floatingDimensions:{width:g.current.width,height:g.current.height}};if(j&&y)void _modalStorage.ModalStorage.saveMinimized(y,e);const o=ge?.x??SCREEN.width-50;const t=ge?.y??SCREEN.height-150;if(s==="bottomSheet"){_reactNative.Animated.parallel([_reactNative.Animated.timing(c,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(f,{toValue:SCREEN.height,duration:300,useNativeDriver:true})]).start(()=>{m(e)})}else{_reactNative.Animated.parallel([_reactNative.Animated.timing(F,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(c,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(u,{toValue:{x:o,y:t},duration:300,useNativeDriver:true})]).start(()=>{m(e)})}},[s,m,ge,j,y,c,f,F,u]);const De=(0,_react.useRef)(ie);(0,_react.useEffect)(()=>{if(De.current===ie)return;De.current=ie;B()},[ie,B]);(0,_react.useEffect)(()=>{if(!d)return;if(d.mode){pe(d.mode);S?.(d.mode)}if(d.panelHeight){be(d.panelHeight);I.current=d.panelHeight;H.setValue(d.panelHeight)}if(d.floatingDimensions&&d.floatingPosition){const e={width:d.floatingDimensions.width,height:d.floatingDimensions.height,top:d.floatingPosition.y,left:d.floatingPosition.x};ee(e);u.setValue({x:d.floatingPosition.x,y:d.floatingPosition.y});P.setValue(d.floatingDimensions.width);G.setValue(d.floatingDimensions.height)}},[d]);const He=e=>{if(e){if(s==="bottomSheet"){f.setValue(0)}else{F.setValue(1);u.setValue({x:g.current.left,y:g.current.top})}c.setValue(1)}else{if(s==="bottomSheet"){f.setValue(SCREEN.height)}c.setValue(0)}};const Ee=(0,_react.useRef)(null);if(INSTANT_MODAL_ENTRANCE&&Ee.current!==n){Ee.current=n;He(n)}(0,_react.useEffect)(()=>{let e=null;let o=null;if(INSTANT_MODAL_ENTRANCE){He(n);return}if(n){f.setValue(SCREEN.height);c.setValue(0);if(s==="bottomSheet"){e=_reactNative.Animated.parallel([_reactNative.Animated.spring(f,{toValue:0,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(c,{toValue:1,duration:200,useNativeDriver:true})]);e.start()}else{F.setValue(1);u.setValue({x:g.current.left,y:g.current.top});e=_reactNative.Animated.timing(c,{toValue:1,duration:200,useNativeDriver:true});e.start()}}else{if(s==="bottomSheet"){o=_reactNative.Animated.parallel([_reactNative.Animated.spring(f,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(c,{toValue:0,duration:200,useNativeDriver:true})]);o.start()}else{o=_reactNative.Animated.timing(c,{toValue:0,duration:200,useNativeDriver:true});o.start()}}return()=>{if(e){e.stop()}if(o){o.stop()}}},[n,s,c,f,F,u,l]);const Le=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{if(!__DEV__||!w||!n)return void 0;let e=null;let o=null;let t=true;const A=Date.now();let a=false;const x=k=>{a=k;if(w==="resize"||w==="float-resize"){D(k)}else if(w==="float-drag"){K(k)}};if(w==="mode-cycle"){o=setInterval(()=>q(),2200)}else{const k=_;const fe=we;const re=()=>{if(!t)return;const Z=(Date.now()-A)/1e3;const i=Z%2.5;if(i<2&&!a)x(true);else if(i>=2&&a)x(false);if(a){const V=(Math.sin(Z*2.2)+1)/2;if(w==="resize"){const h=k+V*(fe-k);H.setValue(h);I.current=h;if(l){l.setValue(h)}}else if(w==="float-drag"){const h=(Math.sin(Z*1.7)+1)/2;u.setValue({x:10+V*Math.max(SCREEN.width-FLOATING_WIDTH-20,0),y:70+h*260})}else if(w==="float-resize"){const h=FLOATING_WIDTH+V*Math.max(SCREEN.width-FLOATING_WIDTH-40,0);const v=FLOATING_HEIGHT+V*240;P.setValue(h);G.setValue(v);g.current={...g.current,width:h,height:v}}}e=requestAnimationFrame(re)};e=requestAnimationFrame(re)}return()=>{t=false;if(e!=null)cancelAnimationFrame(e);if(o!=null)clearInterval(o);D(false);K(false)}},[w,n]);const Ye=(0,_react.useMemo)(()=>_reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>s==="bottomSheet",onMoveShouldSetPanResponder:(e,o)=>s==="bottomSheet"&&Math.abs(o.dy)>3,onPanResponderTerminationRequest:()=>false,onPanResponderGrant:e=>{D(true);Le.current=e.nativeEvent.locationY||0;H.stopAnimation(o=>{I.current=o});l?.stopAnimation();f.stopAnimation()},onPanResponderMove:e=>{const o=e.nativeEvent.pageY-Le.current;let t=SCREEN.height-o;t=Math.max(_,Math.min(t,we));H.setValue(t);I.current=t;if(l){l.setValue(t)}},onPanResponderRelease:(e,o)=>{D(false);const t=I.current;const A=o.vy>.8&&o.dy>50||o.dy>150&&t<=_;if(A){_reactNative.Animated.parallel([_reactNative.Animated.timing(c,{toValue:0,duration:200,useNativeDriver:true}),_reactNative.Animated.spring(f,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true})]).start(()=>r());return}be(t);if(l)l.setValue(t)},onPanResponderTerminate:()=>{D(false)}}),[s,_,we,H,l,f,c,r]);const te=(0,_react.useCallback)(e=>{let o=false;return _reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>s==="floating",onMoveShouldSetPanResponder:()=>s==="floating",onPanResponderGrant:()=>{o=false;const t=g.current;u.stopAnimation(({x:A,y:a})=>{u.setValue({x:A,y:a})});D(true);Ae.current={...t};qe.current=t.height;ze.current=t.width;Pe.current=t.left;Ge.current=t.top},onPanResponderMove:(t,A)=>{const{dx:a,dy:x}=A;if(Math.abs(a)<.5&&Math.abs(x)<.5)return;o=true;const k=Math.max(0,R.left||0);const fe=ce.width-Math.max(0,R.right||0);const re=Math.max(0,R.top||0);const Z=ce.height-Math.max(0,R.bottom||0);const i=Ae.current;const V=i.left+i.width;const h=i.top+i.height;let v=i.left;let W=i.top;let se=V;let ae=h;switch(e){case"topLeft":{const z=Math.max(k,Math.min(i.left+a,V-FLOATING_MIN_WIDTH));const U=Math.max(re,Math.min(i.top+x,h-FLOATING_MIN_HEIGHT));v=z;W=U;se=V;ae=h;break}case"topRight":{const z=Math.min(fe,Math.max(V+a,i.left+FLOATING_MIN_WIDTH));const U=Math.max(re,Math.min(i.top+x,h-FLOATING_MIN_HEIGHT));v=i.left;W=U;se=z;ae=h;break}case"bottomLeft":{const z=Math.max(k,Math.min(i.left+a,V-FLOATING_MIN_WIDTH));const U=Math.min(Z,Math.max(h+x,i.top+FLOATING_MIN_HEIGHT));v=z;W=i.top;se=V;ae=U;break}case"bottomRight":{const z=Math.min(fe,Math.max(V+a,i.left+FLOATING_MIN_WIDTH));const U=Math.min(Z,Math.max(h+x,i.top+FLOATING_MIN_HEIGHT));v=i.left;W=i.top;se=z;ae=U;break}}const ye=Math.max(FLOATING_MIN_WIDTH,se-v);const Ce=Math.max(FLOATING_MIN_HEIGHT,ae-W);ee({width:ye,height:Ce,left:v,top:W});P.setValue(ye);G.setValue(Ce);u.setValue({x:v,y:W});g.current={width:ye,height:Ce,left:v,top:W}},onPanResponderRelease:()=>{D(false);o=false;ee(g.current)},onPanResponderTerminate:()=>{D(false);o=false}})},[s,ce,R.left,R.right,R.top,R.bottom,u,P,G,r,J]);const Me=(0,_react.useMemo)(()=>{return{topLeft:te("topLeft"),topRight:te("topRight"),bottomLeft:te("bottomLeft"),bottomRight:te("bottomRight")}},[te]);const Je=(0,_react.useCallback)(()=>{K(true)},[]);const Xe=(0,_react.useCallback)(e=>{K(false);const o=g.current;const t={...o,left:e.x,top:e.y};ee(t)},[]);const Be=(0,_react.useRef)(0);const oe=(0,_react.useRef)(0);const ne=(0,_react.useRef)(null);const Ke=(0,_react.useCallback)(()=>{const e=Date.now();const o=e-Be.current;if(o>500){oe.current=0}oe.current++;Be.current=e;if(ne.current){clearTimeout(ne.current)}ne.current=setTimeout(()=>{if(oe.current===2){q()}else if(oe.current>=3){if(m){B()}}oe.current=0},300)},[q,m,B]);(0,_react.useEffect)(()=>{return()=>{if(ne.current){clearTimeout(ne.current)}}},[]);if(s==="floating"){return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{nativeID:"jsmodal-root",pointerEvents:n?"auto":"none",accessibilityElementsHidden:!n,importantForAccessibility:n?"auto":"no-hide-descendants",style:[styles.floatingModal,{width:L.width,height:L.height,opacity:ve,transform:[{translateX:u.x},{translateY:u.y}],...le!==void 0&&{zIndex:le}},C==="night"&&styles.nightFloatingModal,(ue||X)&&styles.floatingModalDragging,p.container,!n&&styles.parkedOffscreen],children:[de&&C==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropFloating,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(_index2.DraggableHeader,{position:u,onDragStart:Je,onDragEnd:Xe,onTap:Ke,containerBounds:ce,elementSize:L,minPosition:{x:0,y:R.top},style:styles.floatingHeader,enabled:s==="floating"&&!X,children:(0,_jsxRuntime.jsx)(ModalHeader,{header:M,onClose:r,onToggleMode:q,onMinimize:m?B:void 0,isResizing:ue||X,mode:s,variant:C})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:r,onMinimize:m?B:void 0,onToggleMode:q,mode:s,variant:C})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,C==="night"&&styles.nightContent,p.content],children:[de&&C!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,Re?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:E},children:T}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:E},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:T}),O?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:O}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{...Me.bottomLeft.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,left:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomLeft",isActive:ue||X})}),(0,_jsxRuntime.jsx)(_reactNative.View,{...Me.bottomRight.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,right:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomRight",isActive:ue||X})})]})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[n?styles.fullScreenContainer:styles.parkedFullScreen,n&&le!==void 0&&{zIndex:le}],pointerEvents:n?"box-none":"none",accessibilityElementsHidden:!n,importantForAccessibility:n?"auto":"no-hide-descendants",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{nativeID:"jsmodal-root",style:[styles.bottomSheetWrapper,{opacity:ve,transform:[{translateY:Fe}]}],children:(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.bottomSheet,C==="night"&&styles.nightBottomSheet,p.container,{height:l||H}],children:[de&&C==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropSheet,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(ModalHeader,{header:M,onClose:r,onToggleMode:q,onMinimize:m?B:void 0,isResizing:X,mode:s,panHandlers:Ye.panHandlers,variant:C}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:r,onMinimize:m?B:void 0,onToggleMode:q,mode:s,variant:C})}),Ne&&_e&&s==="bottomSheet"&&!Oe&&(0,_jsxRuntime.jsx)(_index2.ModalHintBanner,{onAcknowledge:Ue}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,C==="night"&&styles.nightContent,p.content],children:[de&&C!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,Re?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:E},children:T}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:E},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:T}),O?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:O}):null]})]})})})};const styles=_reactNative.StyleSheet.create({fullScreenContainer:{..._absoluteFill.absoluteFill,zIndex:1e3},bottomSheetWrapper:{position:"absolute",bottom:0,left:0,right:0},bottomSheet:{backgroundColor:_index.buoyColors.card,borderTopLeftRadius:6,borderTopRightRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:-4},shadowOpacity:.2,shadowRadius:12,elevation:20},parkedOffscreen:{left:-9999,top:-9999,opacity:0},parkedFullScreen:{position:"absolute",left:-9999,top:-9999,width:SCREEN.width,height:SCREEN.height,opacity:0},floatingModal:{position:"absolute",backgroundColor:_index.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:20,elevation:24,zIndex:1e3,width:FLOATING_WIDTH,height:FLOATING_HEIGHT},floatingModalDragging:{borderColor:_index.buoyColors.primary,borderWidth:2,shadowColor:_index.buoyColors.primary+"99",shadowOpacity:.8,shadowRadius:12},header:{borderTopLeftRadius:6,borderTopRightRadius:6,backgroundColor:_index.buoyColors.card,minHeight:56,borderWidth:1,borderColor:_index.buoyColors.border,borderBottomWidth:1,borderBottomColor:_index.buoyColors.border},nightBottomSheet:{backgroundColor:_nightTheme.night.color.bg,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:-4},shadowOpacity:.22,shadowRadius:10},nightFloatingModal:{backgroundColor:_nightTheme.night.color.bg,borderRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.22,shadowRadius:14},nightHeader:{backgroundColor:"transparent",borderWidth:0,borderBottomWidth:0,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet},nightContent:{backgroundColor:"transparent"},nightBackdropSheet:{..._absoluteFill.absoluteFill,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightBackdropFloating:{..._absoluteFill.absoluteFill,borderRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightDragIndicator:{width:36,height:5,borderRadius:2.5,backgroundColor:_nightTheme.night.color.placeholder,shadowOpacity:0,elevation:0},floatingHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},windowControlsContainer:{position:"absolute",top:4,right:4,zIndex:10},floatingModeHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},headerInner:{flex:1,justifyContent:"center"},dragIndicatorContainer:{alignItems:"center",paddingVertical:8,backgroundColor:"transparent"},dragIndicatorContainerCustom:{minHeight:WINDOW_CONTROLS_BAND,justifyContent:"center",paddingVertical:0,backgroundColor:"transparent"},dragIndicator:{width:40,height:3,backgroundColor:_index.buoyColors.primary,borderRadius:2,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:4},floatingDragIndicator:{width:50,height:5,backgroundColor:_index.buoyColors.textMuted},dragIndicatorActive:{backgroundColor:_index.buoyColors.primary,width:40},resizeGripContainer:{position:"absolute",flexDirection:"row",gap:2,marginTop:12},resizeGripLine:{width:12,height:1,backgroundColor:_index.gameUIColors.success,opacity:.6},headerContent:{paddingHorizontal:16,alignItems:"center"},headerControls:{position:"absolute",top:8,right:16,flexDirection:"row",alignItems:"center"},headerTitle:{fontSize:16,fontWeight:"600",color:_index.gameUIColors.primary},headerSubtitle:{fontSize:12,color:_index.gameUIColors.secondary,paddingTop:4},headerHintText:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},hintText:{fontSize:10,color:_index.gameUIColors.muted,fontStyle:"italic"},controlButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",marginLeft:8},toggleButton:{backgroundColor:_index.gameUIColors.info+"1A",borderWidth:1,borderColor:_index.gameUIColors.info+"33"},closeButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",backgroundColor:_index.gameUIColors.error+"1A",borderWidth:1,borderColor:_index.gameUIColors.error+"33",marginLeft:8},iconLine:{position:"absolute",top:7.25,left:2,width:12,height:1.5,backgroundColor:_index.gameUIColors.error},content:{flex:1,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16,overflow:"hidden"},cornerHandle:{position:"absolute",zIndex:1},cornerHandleWrapper:{position:"absolute",width:30,height:30,zIndex:1e3},handler:{width:20,height:20,backgroundColor:"transparent",borderRadius:10,borderWidth:0,borderColor:"transparent"},handlerActive:{backgroundColor:_index.gameUIColors.success+"1A",borderColor:_index.gameUIColors.success,borderWidth:2,shadowColor:_index.gameUIColors.success+"99",shadowOffset:{width:0,height:0},shadowOpacity:1,shadowRadius:8}});const footerStyles=_reactNative.StyleSheet.create({footerContainer:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16}});const JsModal=exports.JsModal=(0,_react.memo)(n=>{const r=(0,_licenseModule.getUseAccountAccess)()();if(r.status!=="admitted")return n.visible?(0,_jsxRuntime.jsx)(_AccountSetup.AccountSetup,{}):null;return(0,_jsxRuntime.jsx)(JsModalComponent,{...n})});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SplitDiffViewer=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _lineDiff=require("./lineDiff.js");var _DiffSummary=require("./DiffSummary.js");var _diffThemes=require("./diffThemes.js");var _fonts=require("../ui/fonts.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(n,y){if("function"==typeof WeakMap)var x=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(i,D){if(!D&&i&&i.__esModule)return i;var c,u,f={__proto__:null,default:i};if(null===i||"object"!=typeof i&&"function"!=typeof i)return f;if(c=D?r:x){if(c.has(i))return c.get(i);c.set(i,f)}for(const a in i)"default"!==a&&{}.hasOwnProperty.call(i,a)&&((u=(c=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,a))&&(u.get||u.set)?c(f,a,u):f[a]=i[a]);return f})(n,y)}const SplitDiffViewer=exports.SplitDiffViewer=(0,_react.memo)(function n({oldValue:y,newValue:x,theme:r=_diffThemes.devToolsDefaultTheme,options:i={},showThemeName:D=false,height:c=400}){const{hideLineNumbers:u=false,disableWordDiff:f=false,showDiffOnly:a=false,compareMethod:T="words",contextLines:h=3}=i;const b={compareMethod:T,disableWordDiff:f,showDiffOnly:a,contextLines:h};const g=(0,_react.useMemo)(()=>(0,_lineDiff.computeLineDiff)(y,x,b),[y,x,T,f,a,h]);const e=(0,_react.useMemo)(()=>createDynamicStyles(r,c),[r,c]);const w=t=>{return t.map((o,s)=>{let l="transparent";if(o.type===_lineDiff.DiffType.ADDED){l=r.addedWordHighlight}else if(o.type===_lineDiff.DiffType.REMOVED){l=r.removedWordHighlight}return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[e.wordDiff,{backgroundColor:l}],children:o.value},s)})};const j=(t,o=false)=>{if(o){return{background:r.modifiedBackground,text:r.modifiedText,markerBg:r.markerModifiedBackground}}switch(t){case _lineDiff.DiffType.ADDED:return{background:r.addedBackground,text:r.addedText,markerBg:r.markerAddedBackground};case _lineDiff.DiffType.REMOVED:return{background:r.removedBackground,text:r.removedText,markerBg:r.markerRemovedBackground};case _lineDiff.DiffType.DEFAULT:return{background:r.unchangedBackground,text:r.unchangedText,markerBg:"transparent"};default:return{background:r.unchangedBackground,text:r.unchangedText,markerBg:"transparent"}}};const m=(t,o,s,l,p=false)=>{if(p){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[!u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.gutter,e.emptyGutter],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.lineNumber,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.marker,e.emptyMarker],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.markerText,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.contentCell,e.emptyContent],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.content,children:" "})})]})}const d=j(s);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[!u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.gutter,{backgroundColor:r.lineNumberBackground}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.lineNumber,children:t||" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.marker,{backgroundColor:d.markerBg}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[e.markerText,{color:r.markerText}],children:l})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.contentCell,{backgroundColor:d.background}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[e.content,{color:d.text}],children:Array.isArray(o)?w(o):o||" "})})]})};const C=(t,o)=>{if(!a||t===0)return false;const s=o[t-1];const l=o[t];const p=l.leftLineNumber&&s.leftLineNumber&&l.leftLineNumber-s.leftLineNumber>1;const d=l.rightLineNumber&&s.rightLineNumber&&l.rightLineNumber-s.rightLineNumber>1;return p||d};const S=(t,o,s)=>{const l=t.type===_lineDiff.DiffType.REMOVED;const p=t.type===_lineDiff.DiffType.ADDED;const d=t.type===_lineDiff.DiffType.MODIFIED;const k=t.type===_lineDiff.DiffType.DEFAULT;return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[C(o,s)&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.separator,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.separatorText,children:"\u2022 \u2022 \u2022"})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:e.row,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.leftSide,children:l||d||k?m(t.leftLineNumber,t.leftContent,d?_lineDiff.DiffType.REMOVED:t.type,l||d?"-":" "):m(void 0,void 0,_lineDiff.DiffType.DEFAULT," ",true)}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.centerDivider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.rightSide,children:p||d||k?m(t.rightLineNumber,t.rightContent,d?_lineDiff.DiffType.ADDED:t.type,p||d?"+":" "):m(void 0,void 0,_lineDiff.DiffType.DEFAULT," ",true)})]})]},o)};const V=g.filter(t=>t.type===_lineDiff.DiffType.ADDED).length;const v=g.filter(t=>t.type===_lineDiff.DiffType.REMOVED).length;const B=g.filter(t=>t.type===_lineDiff.DiffType.MODIFIED).length;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[e.container,r.glowColor&&{shadowColor:r.glowColor,shadowOffset:{width:0,height:0},shadowOpacity:r.neonIntensity&&r.neonIntensity>.7?.5:r.neonIntensity&&r.neonIntensity>.3?.3:.1,shadowRadius:r.neonIntensity&&r.neonIntensity>.7?10:r.neonIntensity&&r.neonIntensity>.3?5:2}],children:[D&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:e.themeBadge,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.themeName,children:r.name}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.themeDescription,children:r.description})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:e.header,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.headerLeft,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.headerTitle,children:"PREV"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.divider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.headerRight,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.headerTitle,children:"CUR"})})]}),(0,_jsxRuntime.jsx)(_DiffSummary.DiffSummary,{added:V,removed:v,modified:B,theme:r}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:e.scrollView,showsVerticalScrollIndicator:false,contentContainerStyle:e.scrollContent,children:g.length===0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.emptyState,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.emptyText,children:a?"No differences found":"No content to display"})}):g.map((t,o)=>S(t,o,g))})]})});function createDynamicStyles(n,y){return _reactNative.StyleSheet.create({container:{height:y,backgroundColor:n.background,borderRadius:8,overflow:"hidden",borderWidth:1,borderColor:n.borderColor},themeBadge:{backgroundColor:n.panelBackground,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:n.borderColor},themeName:{fontSize:12,fontWeight:"700",color:n.accentColor||n.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5},themeDescription:{fontSize:10,color:n.unchangedText,fontFamily:_fonts.monoFont,marginTop:2,opacity:.8},header:{flexDirection:"row",backgroundColor:n.headerBackground,borderBottomWidth:1,borderBottomColor:n.borderColor},headerLeft:{flex:1,paddingVertical:8,paddingHorizontal:12},headerRight:{flex:1,paddingVertical:8,paddingHorizontal:12},headerTitle:{fontSize:10,fontWeight:"700",color:n.accentColor||n.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5,textTransform:"uppercase"},divider:{width:1,backgroundColor:n.dividerColor},scrollView:{flex:1},scrollContent:{paddingBottom:10},row:{flexDirection:"row",minHeight:20},leftSide:{flex:1,flexDirection:"row"},rightSide:{flex:1,flexDirection:"row"},centerDivider:{width:1,backgroundColor:n.dividerColor},gutter:{width:35,paddingHorizontal:4,justifyContent:"center",alignItems:"flex-end",backgroundColor:n.lineNumberBackground,borderRightWidth:1,borderRightColor:n.lineNumberBorder},emptyGutter:{backgroundColor:n.contextBackground},lineNumber:{fontSize:9,fontFamily:_fonts.monoFont,color:n.lineNumberText},marker:{width:20,justifyContent:"center",alignItems:"center"},emptyMarker:{backgroundColor:n.contextBackground},markerText:{fontSize:10,fontFamily:_fonts.monoFont,fontWeight:"600"},contentCell:{flex:1,paddingHorizontal:8,paddingVertical:2},emptyContent:{backgroundColor:n.contextBackground},content:{fontSize:10,fontFamily:_fonts.monoFont,lineHeight:16},wordDiff:{fontSize:10,fontFamily:_fonts.monoFont},separator:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:n.separatorBackground},separatorText:{fontSize:8,color:n.separatorText,fontFamily:_fonts.monoFont,letterSpacing:2},emptyState:{padding:40,alignItems:"center",justifyContent:"center"},emptyText:{fontSize:11,color:n.emptyStateText,fontStyle:"italic",fontFamily:_fonts.monoFont}})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SplitDiffViewer=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _lineDiff=require("./lineDiff.js");var _DiffSummary=require("./DiffSummary.js");var _diffThemes=require("./diffThemes.js");var _fonts=require("../ui/fonts.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(n,y){if("function"==typeof WeakMap)var x=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(i,D){if(!D&&i&&i.__esModule)return i;var c,u,f={__proto__:null,default:i};if(null===i||"object"!=typeof i&&"function"!=typeof i)return f;if(c=D?r:x){if(c.has(i))return c.get(i);c.set(i,f)}for(const a in i)"default"!==a&&{}.hasOwnProperty.call(i,a)&&((u=(c=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,a))&&(u.get||u.set)?c(f,a,u):f[a]=i[a]);return f})(n,y)}const SplitDiffViewer=exports.SplitDiffViewer=(0,_react.memo)(function n({oldValue:y,newValue:x,theme:r=_diffThemes.devToolsDefaultTheme,options:i={},showThemeName:D=false,height:c=400}){const{hideLineNumbers:u=false,disableWordDiff:f=false,showDiffOnly:a=false,compareMethod:h="words",contextLines:T=3}=i;const b={compareMethod:h,disableWordDiff:f,showDiffOnly:a,contextLines:T};const g=(0,_react.useMemo)(()=>(0,_lineDiff.computeLineDiff)(y,x,b),[y,x,h,f,a,T]);const e=(0,_react.useMemo)(()=>createDynamicStyles(r,c),[r,c]);const w=t=>{return t.map((o,s)=>{let l="transparent";if(o.type===_lineDiff.DiffType.ADDED){l=r.addedWordHighlight}else if(o.type===_lineDiff.DiffType.REMOVED){l=r.removedWordHighlight}return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[e.wordDiff,{backgroundColor:l}],children:o.value},s)})};const j=(t,o=false)=>{if(o){return{background:r.modifiedBackground,text:r.modifiedText,markerBg:r.markerModifiedBackground}}switch(t){case _lineDiff.DiffType.ADDED:return{background:r.addedBackground,text:r.addedText,markerBg:r.markerAddedBackground};case _lineDiff.DiffType.REMOVED:return{background:r.removedBackground,text:r.removedText,markerBg:r.markerRemovedBackground};case _lineDiff.DiffType.DEFAULT:return{background:r.unchangedBackground,text:r.unchangedText,markerBg:"transparent"};default:return{background:r.unchangedBackground,text:r.unchangedText,markerBg:"transparent"}}};const m=(t,o,s,l,p=false)=>{if(p){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[!u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.gutter,e.emptyGutter],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.lineNumber,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.marker,e.emptyMarker],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.markerText,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.contentCell,e.emptyContent],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.content,children:" "})})]})}const d=j(s);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[!u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.gutter,{backgroundColor:r.lineNumberBackground}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.lineNumber,children:t||" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.marker,{backgroundColor:d.markerBg}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[e.markerText,{color:r.markerText}],children:l})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[e.contentCell,{backgroundColor:d.background}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[e.content,{color:d.text}],children:Array.isArray(o)?w(o):o||" "})})]})};const C=(t,o)=>{if(!a||t===0)return false;const s=o[t-1];const l=o[t];const p=l.leftLineNumber&&s.leftLineNumber&&l.leftLineNumber-s.leftLineNumber>1;const d=l.rightLineNumber&&s.rightLineNumber&&l.rightLineNumber-s.rightLineNumber>1;return p||d};const S=(t,o,s)=>{const l=t.type===_lineDiff.DiffType.REMOVED;const p=t.type===_lineDiff.DiffType.ADDED;const d=t.type===_lineDiff.DiffType.MODIFIED;const k=t.type===_lineDiff.DiffType.DEFAULT;return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[C(o,s)&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.separator,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.separatorText,children:"\u2022 \u2022 \u2022"})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:e.row,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.leftSide,children:l||d||k?m(t.leftLineNumber,t.leftContent,d?_lineDiff.DiffType.REMOVED:t.type,l||d?"-":" "):m(void 0,void 0,_lineDiff.DiffType.DEFAULT," ",true)}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.centerDivider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.rightSide,children:p||d||k?m(t.rightLineNumber,t.rightContent,d?_lineDiff.DiffType.ADDED:t.type,p||d?"+":" "):m(void 0,void 0,_lineDiff.DiffType.DEFAULT," ",true)})]})]},o)};const V=g.filter(t=>t.type===_lineDiff.DiffType.ADDED).length;const v=g.filter(t=>t.type===_lineDiff.DiffType.REMOVED).length;const B=g.filter(t=>t.type===_lineDiff.DiffType.MODIFIED).length;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[e.container,r.glowColor&&{shadowColor:r.glowColor,shadowOffset:{width:0,height:0},shadowOpacity:r.neonIntensity&&r.neonIntensity>.7?.5:r.neonIntensity&&r.neonIntensity>.3?.3:.1,shadowRadius:r.neonIntensity&&r.neonIntensity>.7?10:r.neonIntensity&&r.neonIntensity>.3?5:2}],children:[D&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:e.themeBadge,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.themeName,children:r.name}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.themeDescription,children:r.description})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:e.header,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.headerLeft,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.headerTitle,children:"PREV"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.divider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.headerRight,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.headerTitle,children:"CUR"})})]}),(0,_jsxRuntime.jsx)(_DiffSummary.DiffSummary,{added:V,removed:v,modified:B,theme:r}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:e.scrollView,showsVerticalScrollIndicator:false,contentContainerStyle:e.scrollContent,children:g.length===0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:e.emptyState,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:e.emptyText,children:a?"No differences found":"No content to display"})}):g.map((t,o)=>S(t,o,g))})]})});function createDynamicStyles(n,y){return _reactNative.StyleSheet.create({container:{height:y,backgroundColor:n.background,borderRadius:8,overflow:"hidden",borderWidth:1,borderColor:n.borderColor},themeBadge:{backgroundColor:n.panelBackground,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:n.borderColor},themeName:{fontSize:12,fontWeight:"700",color:n.accentColor||n.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5},themeDescription:{fontSize:10,color:n.unchangedText,fontFamily:_fonts.monoFont,marginTop:2,opacity:.8},header:{flexDirection:"row",backgroundColor:n.headerBackground,borderBottomWidth:1,borderBottomColor:n.borderColor},headerLeft:{flex:1,paddingVertical:8,paddingHorizontal:12},headerRight:{flex:1,paddingVertical:8,paddingHorizontal:12},headerTitle:{fontSize:10,fontWeight:"700",color:n.accentColor||n.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5,textTransform:"uppercase"},divider:{width:1,backgroundColor:n.dividerColor},scrollView:{flex:1},scrollContent:{paddingBottom:10},row:{flexDirection:"row",minHeight:20},leftSide:{flex:1,flexDirection:"row"},rightSide:{flex:1,flexDirection:"row"},centerDivider:{width:1,backgroundColor:n.dividerColor},gutter:{width:35,paddingHorizontal:4,justifyContent:"center",alignItems:"flex-end",backgroundColor:n.lineNumberBackground,borderRightWidth:1,borderRightColor:n.lineNumberBorder},emptyGutter:{backgroundColor:n.contextBackground},lineNumber:{fontSize:9,fontFamily:_fonts.monoFont,color:n.lineNumberText},marker:{width:20,justifyContent:"center",alignItems:"center"},emptyMarker:{backgroundColor:n.contextBackground},markerText:{fontSize:10,fontFamily:_fonts.monoFont,fontWeight:"600"},contentCell:{flex:1,paddingHorizontal:8,paddingVertical:2},emptyContent:{backgroundColor:n.contextBackground},content:{fontSize:10,fontFamily:_fonts.monoFont,lineHeight:16},wordDiff:{fontSize:10,fontFamily:_fonts.monoFont},separator:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:n.separatorBackground},separatorText:{fontSize:8,color:n.separatorText,fontFamily:_fonts.monoFont,letterSpacing:2},emptyState:{padding:40,alignItems:"center",justifyContent:"center"},emptyText:{fontSize:11,color:n.emptyStateText,fontStyle:"italic",fontFamily:_fonts.monoFont}})}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ThemedSplitView=ThemedSplitView;var _react=require("react");var _reactNative=require("react-native");var _lineDiff=require("./lineDiff.js");var _DiffSummary=require("./DiffSummary.js");var _TimestampDeltaBar=require("./TimestampDeltaBar.js");var _timestampDiff=require("./timestampDiff.js");var _JsonStringNotice=require("./JsonStringNotice.js");var _jsonStringValue=require("./jsonStringValue.js");var _fonts=require("../ui/fonts.js");var _jsxRuntime=require("react/jsx-runtime");const DEFAULT_OPTIONS={hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3,lineOffset:0};function ThemedSplitView({oldValue:e,newValue:r,theme:o,options:d=DEFAULT_OPTIONS,showThemeName:a=false,scrollEnabled:l=true}){const t=(0,_react.useMemo)(()=>createDynamicStyles(o,l),[o,l]);const n=(0,_react.useMemo)(()=>({compareMethod:d.compareMethod,disableWordDiff:d.disableWordDiff,showDiffOnly:d.showDiffOnly,contextLines:d.contextLines}),[d.compareMethod,d.disableWordDiff,d.showDiffOnly,d.contextLines]);const i=(0,_react.useMemo)(()=>(0,_jsonStringValue.decodeJsonStringPair)(e,r),[e,r]);const c=(0,_react.useMemo)(()=>(0,_lineDiff.computeLineDiff)(i.left,i.right,n),[i,n]);const f=(0,_react.useMemo)(()=>{let s=0;let g=0;let u=0;for(const m of c){if(m.type===_lineDiff.DiffType.ADDED)s++;else if(m.type===_lineDiff.DiffType.REMOVED)g++;else if(m.type===_lineDiff.DiffType.MODIFIED)u++}return{added:s,removed:g,modified:u}},[c]);const x=(0,_react.useMemo)(()=>(0,_timestampDiff.describeTimestampDeltas)(i.left,i.right),[i]);const[y,h]=(0,_react.useState)(()=>new Set);const D=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(!D.current){D.current=true;return}h(new Set)},[e,r]);const T=(0,_react.useMemo)(()=>buildSplitItems(c,y),[c,y]);const k=(0,_react.useCallback)(s=>{h(g=>{const u=new Set(g);if(u.has(s))u.delete(s);else u.add(s);return u})},[]);const b=(0,_react.useCallback)(s=>s.kind==="row"?`r:${s.diffIndex}`:`f:${s.foldId}`,[]);const p=(0,_react.useCallback)(s=>{if(s.kind==="fold"){return(0,_jsxRuntime.jsx)(FoldHeader,{foldId:s.foldId,count:s.count,expanded:s.expanded,theme:o,styles:t,onToggle:k})}return(0,_jsxRuntime.jsx)(DiffRow,{diff:s.diff,showSeparator:false,theme:o,options:d,styles:t})},[o,d,t,k]);const j=(0,_react.useCallback)(({item:s})=>p(s),[p]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[t.container,o.glowColor&&{shadowColor:o.glowColor,shadowOffset:{width:0,height:0},shadowOpacity:o.neonIntensity&&o.neonIntensity>.7?.5:o.neonIntensity&&o.neonIntensity>.3?.3:.1,shadowRadius:o.neonIntensity&&o.neonIntensity>.7?10:o.neonIntensity&&o.neonIntensity>.3?5:2}],children:[a&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:t.themeBadge,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.themeName,children:o.name}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.themeDescription,children:o.description})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:t.header,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.headerLeft,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.headerTitle,children:"PREV"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.divider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.headerRight,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.headerTitle,children:"CUR"})})]}),(0,_jsxRuntime.jsx)(_DiffSummary.DiffSummary,{added:f.added,removed:f.removed,modified:f.modified,theme:o}),(0,_jsxRuntime.jsx)(_JsonStringNotice.JsonStringNotice,{visible:i.decoded,theme:o}),(0,_jsxRuntime.jsx)(_TimestampDeltaBar.TimestampDeltaBar,{deltas:x,theme:o}),c.length===0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.emptyState,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.emptyText,children:d.showDiffOnly?"No differences found":"No content to display"})}):l?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{style:t.scrollView,contentContainerStyle:t.scrollContent,data:T,renderItem:j,keyExtractor:b,showsVerticalScrollIndicator:false,initialNumToRender:20,maxToRenderPerBatch:20,windowSize:7,removeClippedSubviews:true}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.scrollContent,children:T.map(s=>(0,_jsxRuntime.jsx)(_react.Fragment,{children:p(s)},b(s)))})]})}const CONTEXT_LINES=3;const MIN_FOLD_SIZE=4;function buildSplitItems(e,r){const o=e.length;if(o===0)return[];const d=new Array(o).fill(false);for(let n=0;n<o;n++){if(e[n].type!==_lineDiff.DiffType.DEFAULT){const i=Math.max(0,n-CONTEXT_LINES);const c=Math.min(o-1,n+CONTEXT_LINES);for(let f=i;f<=c;f++)d[f]=true}}const a=[];let l=0;let t=0;while(t<o){if(d[t]){a.push({kind:"row",diff:e[t],diffIndex:t});t++;continue}let n=t;while(n<o&&!d[n])n++;const i=n-t;if(i<MIN_FOLD_SIZE){for(let c=t;c<n;c++){a.push({kind:"row",diff:e[c],diffIndex:c})}}else{const c=l++;const f=r.has(c);a.push({kind:"fold",foldId:c,count:i,expanded:f});if(f){for(let x=t;x<n;x++){a.push({kind:"row",diff:e[x],diffIndex:x})}}}t=n}return a}const FoldHeader=(0,_react.memo)(function e({foldId:r,count:o,expanded:d,theme:a,styles:l,onToggle:t}){return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[l.foldHeader,{backgroundColor:a.separatorBackground}],onPress:()=>t(r),activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[l.foldHeaderText,{color:a.separatorText}],children:d?`\u25BC ${o} unchanged line${o===1?"":"s"} \u2014 tap to hide`:`\u25B6 ${o} unchanged line${o===1?"":"s"} \u2014 tap to expand`})})});const DiffRow=(0,_react.memo)(function e({diff:r,showSeparator:o,theme:d,options:a,styles:l}){const t=r.type===_lineDiff.DiffType.REMOVED;const n=r.type===_lineDiff.DiffType.ADDED;const i=r.type===_lineDiff.DiffType.MODIFIED;const c=r.type===_lineDiff.DiffType.DEFAULT;return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[o&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.separator,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:l.separatorText,children:"\u2022 \u2022 \u2022"})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:l.row,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.leftSide,children:t||i||c?(0,_jsxRuntime.jsx)(LineSide,{lineNumber:r.leftLineNumber,content:r.leftContent,type:i?_lineDiff.DiffType.REMOVED:r.type,marker:t||i?"-":" ",theme:d,options:a,styles:l}):(0,_jsxRuntime.jsx)(EmptyLineSide,{options:a,styles:l})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.centerDivider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.rightSide,children:n||i||c?(0,_jsxRuntime.jsx)(LineSide,{lineNumber:r.rightLineNumber,content:r.rightContent,type:i?_lineDiff.DiffType.ADDED:r.type,marker:n||i?"+":" ",theme:d,options:a,styles:l}):(0,_jsxRuntime.jsx)(EmptyLineSide,{options:a,styles:l})})]})]})});function LineSide({lineNumber:e,content:r,type:o,marker:d,theme:a,options:l,styles:t}){const n=getDiffColors(o,a);return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[!l.hideLineNumbers&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[t.gutter,{backgroundColor:a.lineNumberBackground}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.lineNumber,children:e||" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[t.marker,{backgroundColor:n.markerBg}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[t.markerText,{color:a.markerText}],children:d})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[t.contentCell,{backgroundColor:n.background}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[t.content,{color:n.text}],children:Array.isArray(r)?r.map((i,c)=>{let f="transparent";if(i.type===_lineDiff.DiffType.ADDED){f=a.addedWordHighlight}else if(i.type===_lineDiff.DiffType.REMOVED){f=a.removedWordHighlight}return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[t.wordDiff,{backgroundColor:f}],children:i.value},c)}):r||" "})})]})}function EmptyLineSide({options:e,styles:r}){return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[!e.hideLineNumbers&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[r.gutter,r.emptyGutter],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:r.lineNumber,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[r.marker,r.emptyMarker],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:r.markerText,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[r.contentCell,r.emptyContent],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:r.content,children:" "})})]})}function getDiffColors(e,r){switch(e){case _lineDiff.DiffType.ADDED:return{background:r.addedBackground,text:r.addedText,markerBg:r.markerAddedBackground};case _lineDiff.DiffType.REMOVED:return{background:r.removedBackground,text:r.removedText,markerBg:r.markerRemovedBackground};case _lineDiff.DiffType.DEFAULT:default:return{background:r.unchangedBackground,text:r.unchangedText,markerBg:"transparent"}}}function createDynamicStyles(e,r){return _reactNative.StyleSheet.create({container:{...r?{height:400}:null,backgroundColor:e.background,borderRadius:8,overflow:"hidden",borderWidth:1,borderColor:e.borderColor},themeBadge:{backgroundColor:e.panelBackground,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:e.borderColor},themeName:{fontSize:12,fontWeight:"700",color:e.accentColor||e.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5},themeDescription:{fontSize:10,color:e.unchangedText,fontFamily:_fonts.monoFont,marginTop:2,opacity:.8},header:{flexDirection:"row",backgroundColor:e.headerBackground,borderBottomWidth:1,borderBottomColor:e.borderColor},headerLeft:{flex:1,paddingVertical:8,paddingHorizontal:12},headerRight:{flex:1,paddingVertical:8,paddingHorizontal:12},headerTitle:{fontSize:10,fontWeight:"700",color:e.accentColor||e.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5,textTransform:"uppercase"},divider:{width:1,backgroundColor:e.dividerColor},scrollView:{flex:1},scrollContent:{paddingBottom:10},row:{flexDirection:"row",minHeight:20},leftSide:{flex:1,flexDirection:"row"},rightSide:{flex:1,flexDirection:"row"},centerDivider:{width:1,backgroundColor:e.dividerColor},gutter:{width:35,paddingHorizontal:4,justifyContent:"center",alignItems:"flex-end",backgroundColor:e.lineNumberBackground,borderRightWidth:1,borderRightColor:e.lineNumberBorder},emptyGutter:{backgroundColor:e.contextBackground},lineNumber:{fontSize:9,fontFamily:_fonts.monoFont,color:e.lineNumberText},marker:{width:20,justifyContent:"center",alignItems:"center"},emptyMarker:{backgroundColor:e.contextBackground},markerText:{fontSize:10,fontFamily:_fonts.monoFont,fontWeight:"600"},contentCell:{flex:1,paddingHorizontal:8,paddingVertical:2},emptyContent:{backgroundColor:e.contextBackground},content:{fontSize:10,fontFamily:_fonts.monoFont,lineHeight:16},wordDiff:{fontSize:10,fontFamily:_fonts.monoFont},summaryBar:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:16,paddingVertical:6,backgroundColor:e.summaryBackground,borderTopWidth:1,borderTopColor:e.borderColor},summaryItem:{flexDirection:"row",alignItems:"center"},summaryText:{fontSize:10,fontFamily:_fonts.monoFont,fontWeight:"700"},separator:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:e.separatorBackground},separatorText:{fontSize:8,color:e.separatorText,fontFamily:_fonts.monoFont,letterSpacing:2},foldHeader:{paddingVertical:6,paddingHorizontal:12,alignItems:"center",justifyContent:"center",borderTopWidth:1,borderBottomWidth:1,borderColor:e.borderColor},foldHeaderText:{fontSize:10,fontFamily:_fonts.monoFont,letterSpacing:.5},emptyState:{padding:40,alignItems:"center",justifyContent:"center"},emptyText:{fontSize:11,color:e.emptyStateText,fontStyle:"italic",fontFamily:_fonts.monoFont}})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ThemedSplitView=ThemedSplitView;var _react=require("react");var _reactNative=require("react-native");var _lineDiff=require("./lineDiff.js");var _DiffSummary=require("./DiffSummary.js");var _TimestampDeltaBar=require("./TimestampDeltaBar.js");var _timestampDiff=require("./timestampDiff.js");var _JsonStringNotice=require("./JsonStringNotice.js");var _jsonStringValue=require("./jsonStringValue.js");var _fonts=require("../ui/fonts.js");var _jsxRuntime=require("react/jsx-runtime");const DEFAULT_OPTIONS={hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3,lineOffset:0};function ThemedSplitView({oldValue:e,newValue:r,theme:o,options:d=DEFAULT_OPTIONS,showThemeName:a=false,scrollEnabled:l=true}){const t=(0,_react.useMemo)(()=>createDynamicStyles(o,l),[o,l]);const n=(0,_react.useMemo)(()=>({compareMethod:d.compareMethod,disableWordDiff:d.disableWordDiff,showDiffOnly:d.showDiffOnly,contextLines:d.contextLines}),[d.compareMethod,d.disableWordDiff,d.showDiffOnly,d.contextLines]);const i=(0,_react.useMemo)(()=>(0,_jsonStringValue.decodeJsonStringPair)(e,r),[e,r]);const c=(0,_react.useMemo)(()=>(0,_lineDiff.computeLineDiff)(i.left,i.right,n),[i,n]);const f=(0,_react.useMemo)(()=>{let s=0;let g=0;let u=0;for(const y of c){if(y.type===_lineDiff.DiffType.ADDED)s++;else if(y.type===_lineDiff.DiffType.REMOVED)g++;else if(y.type===_lineDiff.DiffType.MODIFIED)u++}return{added:s,removed:g,modified:u}},[c]);const x=(0,_react.useMemo)(()=>(0,_timestampDiff.describeTimestampDeltas)(i.left,i.right),[i]);const[m,h]=(0,_react.useState)(()=>new Set);const D=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(!D.current){D.current=true;return}h(new Set)},[e,r]);const T=(0,_react.useMemo)(()=>buildSplitItems(c,m),[c,m]);const k=(0,_react.useCallback)(s=>{h(g=>{const u=new Set(g);if(u.has(s))u.delete(s);else u.add(s);return u})},[]);const b=(0,_react.useCallback)(s=>s.kind==="row"?`r:${s.diffIndex}`:`f:${s.foldId}`,[]);const p=(0,_react.useCallback)(s=>{if(s.kind==="fold"){return(0,_jsxRuntime.jsx)(FoldHeader,{foldId:s.foldId,count:s.count,expanded:s.expanded,theme:o,styles:t,onToggle:k})}return(0,_jsxRuntime.jsx)(DiffRow,{diff:s.diff,showSeparator:false,theme:o,options:d,styles:t})},[o,d,t,k]);const j=(0,_react.useCallback)(({item:s})=>p(s),[p]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[t.container,o.glowColor&&{shadowColor:o.glowColor,shadowOffset:{width:0,height:0},shadowOpacity:o.neonIntensity&&o.neonIntensity>.7?.5:o.neonIntensity&&o.neonIntensity>.3?.3:.1,shadowRadius:o.neonIntensity&&o.neonIntensity>.7?10:o.neonIntensity&&o.neonIntensity>.3?5:2}],children:[a&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:t.themeBadge,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.themeName,children:o.name}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.themeDescription,children:o.description})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:t.header,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.headerLeft,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.headerTitle,children:"PREV"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.divider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.headerRight,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.headerTitle,children:"CUR"})})]}),(0,_jsxRuntime.jsx)(_DiffSummary.DiffSummary,{added:f.added,removed:f.removed,modified:f.modified,theme:o}),(0,_jsxRuntime.jsx)(_JsonStringNotice.JsonStringNotice,{visible:i.decoded,theme:o}),(0,_jsxRuntime.jsx)(_TimestampDeltaBar.TimestampDeltaBar,{deltas:x,theme:o}),c.length===0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.emptyState,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.emptyText,children:d.showDiffOnly?"No differences found":"No content to display"})}):l?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",style:t.scrollView,contentContainerStyle:t.scrollContent,data:T,renderItem:j,keyExtractor:b,showsVerticalScrollIndicator:false,initialNumToRender:20,maxToRenderPerBatch:20,windowSize:7,removeClippedSubviews:true}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:t.scrollContent,children:T.map(s=>(0,_jsxRuntime.jsx)(_react.Fragment,{children:p(s)},b(s)))})]})}const CONTEXT_LINES=3;const MIN_FOLD_SIZE=4;function buildSplitItems(e,r){const o=e.length;if(o===0)return[];const d=new Array(o).fill(false);for(let n=0;n<o;n++){if(e[n].type!==_lineDiff.DiffType.DEFAULT){const i=Math.max(0,n-CONTEXT_LINES);const c=Math.min(o-1,n+CONTEXT_LINES);for(let f=i;f<=c;f++)d[f]=true}}const a=[];let l=0;let t=0;while(t<o){if(d[t]){a.push({kind:"row",diff:e[t],diffIndex:t});t++;continue}let n=t;while(n<o&&!d[n])n++;const i=n-t;if(i<MIN_FOLD_SIZE){for(let c=t;c<n;c++){a.push({kind:"row",diff:e[c],diffIndex:c})}}else{const c=l++;const f=r.has(c);a.push({kind:"fold",foldId:c,count:i,expanded:f});if(f){for(let x=t;x<n;x++){a.push({kind:"row",diff:e[x],diffIndex:x})}}}t=n}return a}const FoldHeader=(0,_react.memo)(function e({foldId:r,count:o,expanded:d,theme:a,styles:l,onToggle:t}){return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[l.foldHeader,{backgroundColor:a.separatorBackground}],onPress:()=>t(r),activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[l.foldHeaderText,{color:a.separatorText}],children:d?`\u25BC ${o} unchanged line${o===1?"":"s"} \u2014 tap to hide`:`\u25B6 ${o} unchanged line${o===1?"":"s"} \u2014 tap to expand`})})});const DiffRow=(0,_react.memo)(function e({diff:r,showSeparator:o,theme:d,options:a,styles:l}){const t=r.type===_lineDiff.DiffType.REMOVED;const n=r.type===_lineDiff.DiffType.ADDED;const i=r.type===_lineDiff.DiffType.MODIFIED;const c=r.type===_lineDiff.DiffType.DEFAULT;return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[o&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.separator,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:l.separatorText,children:"\u2022 \u2022 \u2022"})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:l.row,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.leftSide,children:t||i||c?(0,_jsxRuntime.jsx)(LineSide,{lineNumber:r.leftLineNumber,content:r.leftContent,type:i?_lineDiff.DiffType.REMOVED:r.type,marker:t||i?"-":" ",theme:d,options:a,styles:l}):(0,_jsxRuntime.jsx)(EmptyLineSide,{options:a,styles:l})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.centerDivider}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:l.rightSide,children:n||i||c?(0,_jsxRuntime.jsx)(LineSide,{lineNumber:r.rightLineNumber,content:r.rightContent,type:i?_lineDiff.DiffType.ADDED:r.type,marker:n||i?"+":" ",theme:d,options:a,styles:l}):(0,_jsxRuntime.jsx)(EmptyLineSide,{options:a,styles:l})})]})]})});function LineSide({lineNumber:e,content:r,type:o,marker:d,theme:a,options:l,styles:t}){const n=getDiffColors(o,a);return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[!l.hideLineNumbers&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[t.gutter,{backgroundColor:a.lineNumberBackground}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:t.lineNumber,children:e||" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[t.marker,{backgroundColor:n.markerBg}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[t.markerText,{color:a.markerText}],children:d})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[t.contentCell,{backgroundColor:n.background}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[t.content,{color:n.text}],children:Array.isArray(r)?r.map((i,c)=>{let f="transparent";if(i.type===_lineDiff.DiffType.ADDED){f=a.addedWordHighlight}else if(i.type===_lineDiff.DiffType.REMOVED){f=a.removedWordHighlight}return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[t.wordDiff,{backgroundColor:f}],children:i.value},c)}):r||" "})})]})}function EmptyLineSide({options:e,styles:r}){return(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[!e.hideLineNumbers&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[r.gutter,r.emptyGutter],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:r.lineNumber,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[r.marker,r.emptyMarker],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:r.markerText,children:" "})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[r.contentCell,r.emptyContent],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:r.content,children:" "})})]})}function getDiffColors(e,r){switch(e){case _lineDiff.DiffType.ADDED:return{background:r.addedBackground,text:r.addedText,markerBg:r.markerAddedBackground};case _lineDiff.DiffType.REMOVED:return{background:r.removedBackground,text:r.removedText,markerBg:r.markerRemovedBackground};case _lineDiff.DiffType.DEFAULT:default:return{background:r.unchangedBackground,text:r.unchangedText,markerBg:"transparent"}}}function createDynamicStyles(e,r){return _reactNative.StyleSheet.create({container:{...r?{height:400}:null,backgroundColor:e.background,borderRadius:8,overflow:"hidden",borderWidth:1,borderColor:e.borderColor},themeBadge:{backgroundColor:e.panelBackground,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:e.borderColor},themeName:{fontSize:12,fontWeight:"700",color:e.accentColor||e.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5},themeDescription:{fontSize:10,color:e.unchangedText,fontFamily:_fonts.monoFont,marginTop:2,opacity:.8},header:{flexDirection:"row",backgroundColor:e.headerBackground,borderBottomWidth:1,borderBottomColor:e.borderColor},headerLeft:{flex:1,paddingVertical:8,paddingHorizontal:12},headerRight:{flex:1,paddingVertical:8,paddingHorizontal:12},headerTitle:{fontSize:10,fontWeight:"700",color:e.accentColor||e.unchangedText,fontFamily:_fonts.monoFont,letterSpacing:.5,textTransform:"uppercase"},divider:{width:1,backgroundColor:e.dividerColor},scrollView:{flex:1},scrollContent:{paddingBottom:10},row:{flexDirection:"row",minHeight:20},leftSide:{flex:1,flexDirection:"row"},rightSide:{flex:1,flexDirection:"row"},centerDivider:{width:1,backgroundColor:e.dividerColor},gutter:{width:35,paddingHorizontal:4,justifyContent:"center",alignItems:"flex-end",backgroundColor:e.lineNumberBackground,borderRightWidth:1,borderRightColor:e.lineNumberBorder},emptyGutter:{backgroundColor:e.contextBackground},lineNumber:{fontSize:9,fontFamily:_fonts.monoFont,color:e.lineNumberText},marker:{width:20,justifyContent:"center",alignItems:"center"},emptyMarker:{backgroundColor:e.contextBackground},markerText:{fontSize:10,fontFamily:_fonts.monoFont,fontWeight:"600"},contentCell:{flex:1,paddingHorizontal:8,paddingVertical:2},emptyContent:{backgroundColor:e.contextBackground},content:{fontSize:10,fontFamily:_fonts.monoFont,lineHeight:16},wordDiff:{fontSize:10,fontFamily:_fonts.monoFont},summaryBar:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:16,paddingVertical:6,backgroundColor:e.summaryBackground,borderTopWidth:1,borderTopColor:e.borderColor},summaryItem:{flexDirection:"row",alignItems:"center"},summaryText:{fontSize:10,fontFamily:_fonts.monoFont,fontWeight:"700"},separator:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:e.separatorBackground},separatorText:{fontSize:8,color:e.separatorText,fontFamily:_fonts.monoFont,letterSpacing:2},foldHeader:{paddingVertical:6,paddingHorizontal:12,alignItems:"center",justifyContent:"center",borderTopWidth:1,borderBottomWidth:1,borderColor:e.borderColor},foldHeaderText:{fontSize:10,fontFamily:_fonts.monoFont,letterSpacing:.5},emptyState:{padding:40,alignItems:"center",justifyContent:"center"},emptyText:{fontSize:11,color:e.emptyStateText,fontStyle:"italic",fontFamily:_fonts.monoFont}})}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.VirtualizedDataExplorer=void 0;var _react=require("react");var _reactNative=require("react-native");var _displayValue=require("../utils/displayValue.js");var _index=require("../ui/gameUI/index.js");var _nightTheme=require("../ui/night/nightTheme.js");var _CopyButton=require("../ui/components/CopyButton.js");var _index2=require("../icons/index.js");var _IndentGuidesOverlay=require("./IndentGuidesOverlay.js");var _fonts=require("../ui/fonts.js");var _jsxRuntime=require("react/jsx-runtime");const HIT_SLOP_10={top:10,bottom:10,left:10,right:10};const ITEM_HEIGHT=24;const LONG_ITEM_HEIGHT=24;const CHUNK_SIZE=50;const MAX_DEPTH_LIMIT=15;const MAX_ITEMS_PER_LEVEL=500;const LONG_KEY_THRESHOLD=30;const DOUBLE_TAP_MS=300;const INDENT_WIDTH=16;const INDENT_STYLES=Array.from({length:MAX_DEPTH_LIMIT+1},(e,o)=>_reactNative.StyleSheet.create({container:{marginLeft:o*INDENT_WIDTH}}).container);const TYPE_COLOR_CACHE=new Map([["string",_index.gameUIColors.dataTypes.string],["number",_index.gameUIColors.dataTypes.number],["bigint",_index.gameUIColors.optional],["boolean",_index.gameUIColors.dataTypes.boolean],["null",_index.gameUIColors.dataTypes.null],["undefined",_index.gameUIColors.dataTypes.undefined],["function",_index.gameUIColors.dataTypes.function],["symbol",_index.gameUIColors.critical],["date",_index.gameUIColors.critical],["error",_index.gameUIColors.error],["array",_index.gameUIColors.dataTypes.array],["object",_index.gameUIColors.dataTypes.object],["map",_index.gameUIColors.info],["set",_index.gameUIColors.success],["circular",_index.gameUIColors.warning]]);const STABLE_STYLES=_reactNative.StyleSheet.create({container:{backgroundColor:_nightTheme.night.color.bg,borderRadius:8,borderWidth:1,borderColor:_nightTheme.night.color.border},header:{flexDirection:"column",paddingHorizontal:16,paddingVertical:12},headerRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},title:{color:_index.gameUIColors.primary,fontSize:14,fontWeight:"500"},description:{color:_index.gameUIColors.secondary,fontSize:12,marginTop:2},typeLegend:{flexDirection:"row",flexWrap:"wrap",gap:6,marginTop:8,paddingTop:8,borderTopWidth:1,borderTopColor:_index.gameUIColors.primary+"14"},typeBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},typeColor:{width:8,height:8,borderRadius:4,marginRight:4},typeName:{fontSize:10,fontWeight:"500",color:_index.gameUIColors.secondary},itemContainer:{minHeight:ITEM_HEIGHT,backgroundColor:"transparent",position:"relative",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:0,paddingRight:16,paddingVertical:2,minHeight:24},itemTouchablePressed:{backgroundColor:_index.gameUIColors.primary+"0A"},itemSelected:{backgroundColor:_index.gameUIColors.primary+"14"},expanderContainer:{width:16,alignItems:"center",justifyContent:"center",marginTop:4},expanderIcon:{width:12,height:12},labelContainer:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelContainerVertical:{flex:1,flexDirection:"column",paddingLeft:2,paddingVertical:2},labelContainerVerticalRow:{flexDirection:"row",alignItems:"center",marginBottom:2},labelText:{color:_index.gameUIColors.primary,fontSize:12,fontWeight:"500",fontFamily:_fonts.monoFont,marginRight:8,flexShrink:1},labelTextTruncated:{color:_index.gameUIColors.primary,fontSize:12,fontWeight:"500",fontFamily:_fonts.monoFont,flexShrink:1},valueText:{fontSize:12,fontFamily:_fonts.monoFont,flex:1,color:_index.gameUIColors.primaryLight},loadingContainer:{padding:16,alignItems:"center"},loadingText:{color:_index.gameUIColors.secondary,fontSize:12},noDataContainer:{padding:16,alignItems:"center"},noDataText:{color:_index.gameUIColors.secondary,fontSize:12},listContent:{paddingBottom:8},headerTouchable:{flex:1,flexDirection:"row",alignItems:"center"},expanderMargin:{marginLeft:8}});function selectionOf(e){return{path:e.path.slice(1),value:e.value,label:e.key}}function countNodesUpTo(e,o,i=0){if(i>=o)return i;let f=i+1;if(Array.isArray(e)){for(const b of e){if(f>=o)return f;f=countNodesUpTo(b,o,f)}}else if(e!==null&&typeof e==="object"){for(const b of Object.values(e)){if(f>=o)return f;f=countNodesUpTo(b,o,f)}}return f}const getValueType=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(e instanceof Date)return"date";if(e instanceof Error)return"error";if(e instanceof Map)return"map";if(e instanceof Set)return"set";if(e instanceof RegExp)return"regexp";if(typeof e==="function")return"function";if(typeof e==="symbol")return"symbol";if(typeof e==="bigint")return"bigint";if(typeof e==="object")return"object";return typeof e};const getValueCount=(e,o)=>{if(e===null)return 0;switch(o){case"array":return Array.isArray(e)?e.length:0;case"object":return typeof e==="object"&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof RegExp)&&!(e instanceof Map)&&!(e instanceof Set)?Object.keys(e).length:0;case"map":return e instanceof Map?e.size:0;case"set":return e instanceof Set?e.size:0;default:return 0}};const formatValue=(e,o)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(o){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:return(0,_displayValue.displayValue)(e)}};const getTypeColor=e=>{return TYPE_COLOR_CACHE.get(e)||_index.gameUIColors.dataTypes.array};const ExpanderComponent=({expanded:e,onPress:o})=>{return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools data explorer expander",style:STABLE_STYLES.expanderContainer,onPress:o,hitSlop:HIT_SLOP_10,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.expanderIcon,children:(0,_jsxRuntime.jsx)(_index2.ChevronRight,{size:12,color:_index.gameUIColors.secondary,strokeWidth:2,style:{transform:[{rotate:e?"90deg":"0deg"}]}})})})};ExpanderComponent.displayName="Expander";const Expander=(0,_react.memo)(ExpanderComponent);const TypeLegendComponent=({visibleTypes:e})=>{const o=Array.from(new Set(e)).slice(0,8);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.typeLegend,children:o.map(i=>{const f=getTypeColor(i);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[STABLE_STYLES.typeBadge,{backgroundColor:`${f}10`,borderColor:`${f}30`}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[STABLE_STYLES.typeColor,{backgroundColor:f}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.typeName,children:i})]},i)})})};TypeLegendComponent.displayName="TypeLegend";const TypeLegend=(0,_react.memo)(TypeLegendComponent);const useDataFlattening=(e,o=10,i=false)=>{const[f,b]=(0,_react.useState)([]);const V=(0,_react.useRef)(new Map);const B=(0,_react.useCallback)(()=>{const t=new Set(["root"]);if(i&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((p,s)=>{t.add(`root.${s}`)})}else{Object.keys(e).forEach(p=>{t.add(`root.${p}`)})}}return t},[i,e]);const[E,D]=(0,_react.useState)(()=>B());const[_,R]=(0,_react.useState)(false);const C=(0,_react.useRef)(new WeakSet);const I=(0,_react.useRef)(false);const k=(0,_react.useRef)(0);const P=(0,_react.useRef)(0);const a=(0,_react.useRef)(void 0);const m=(0,_react.useCallback)((t,p,s,u="root",n=0,T,g=[],h=0,S=1,x=[])=>{if(n>Math.min(o,MAX_DEPTH_LIMIT))return[];const c=[...g,u];const l=c.join(".");const y=getValueType(t);const U=["object","array","map","set"].includes(y)&&t!==null;const W=U?getValueCount(t,y):0;const M=Math.min(W,MAX_ITEMS_PER_LEVEL);if(t&&typeof t==="object"){if(s.has(t)){return[{id:l,key:u,value:"[Circular Reference]",valueType:"circular",depth:n,isExpandable:false,isExpanded:false,parentId:T,hasChildren:false,childCount:0,path:c,type:"circular",isLastChild:h===S-1,parentHasMoreSiblings:[...x],siblingIndex:h,totalSiblings:S}]}s.add(t)}const r={id:l,key:u,value:t,valueType:y,depth:n,isExpandable:U,isExpanded:p.has(l),parentId:T,hasChildren:M>0,childCount:M,path:c,type:U?"expandable":y,isLastChild:h===S-1,parentHasMoreSiblings:[...x],siblingIndex:h,totalSiblings:S};const d=[r];if(U&&p.has(l)&&n<Math.min(o,MAX_DEPTH_LIMIT)){try{let j=[];switch(y){case"array":j=Array.isArray(t)?t.map((w,A)=>[A.toString(),w]):[];break;case"object":j=typeof t==="object"&&t!==null&&!(t instanceof Date)&&!(t instanceof Error)&&!(t instanceof RegExp)&&!(t instanceof Map)&&!(t instanceof Set)?Object.entries(t):[];break;case"map":j=t instanceof Map?Array.from(t.entries()).map(([w,A])=>[String(w),A]):[];break;case"set":j=t instanceof Set?Array.from(t.values()).map((w,A)=>[A.toString(),w]):[];break}const $=j.slice(0,M);const v=$.length;const q=[...x];if(n>0){q[n-1]=!r.isLastChild}for(let w=0;w<$.length;w+=CHUNK_SIZE){const A=$.slice(w,w+CHUNK_SIZE);let F=w;for(const[K,G]of A){d.push(...m(G,p,s,K,n+1,l,c,F,v,q));F++}if(w>0&&w%(CHUNK_SIZE*2)===0){break}}}catch(j){console.error("[Buoy]",j)}}return d},[o]);(0,_react.useEffect)(()=>{if(a.current&&(a.current.type==="expand"||a.current.type==="collapse")){if(_){R(false);I.current=false}a.current=void 0;return}if(I.current){return}let t;const p=++k.current;const s=()=>k.current===p;I.current=true;R(true);const u=async()=>{t=setTimeout(()=>{if(I.current&&s()){R(false);I.current=false}},5e3);await new Promise(n=>setTimeout(()=>n(),10));if(!s()){return}try{C.current=new WeakSet;P.current=Date.now();const n=m(e,E,C.current,"root",0,void 0,[],0,1,[]);const T=new Map;n.forEach((g,h)=>{T.set(g.id,{item:g,index:h})});V.current=T;if(t)clearTimeout(t);if(s()){b(n);R(false);I.current=false}}catch(n){console.error("[Buoy]",n);if(t)clearTimeout(t);if(s()){b([]);V.current=new Map;R(false);I.current=false}}};u();return()=>{I.current=false;if(t)clearTimeout(t)}},[e,E,m,o]);const O=(0,_react.useCallback)((t,p)=>{R(false);I.current=false;b(s=>{const u=V.current.get(t);if(!u){return s}const{item:n,index:T}=u;if(p&&n.isExpandable&&n.hasChildren){const g=[...s];const h=new WeakSet;if(n.value&&typeof n.value==="object"){h.add(n.value)}const S=[];try{let l=[];const y=n.valueType;switch(y){case"array":l=Array.isArray(n.value)?n.value.map((r,d)=>[d.toString(),r]):[];break;case"object":l=typeof n.value==="object"&&n.value!==null&&!(n.value instanceof Date)&&!(n.value instanceof Error)&&!(n.value instanceof RegExp)&&!(n.value instanceof Map)&&!(n.value instanceof Set)?Object.entries(n.value):[];break;case"map":l=n.value instanceof Map?Array.from(n.value.entries()).map(([r,d])=>[String(r),d]):[];break;case"set":l=n.value instanceof Set?Array.from(n.value.values()).map((r,d)=>[d.toString(),r]):[];break}const U=l.length;const W=n.parentHasMoreSiblings||[];const M=[...W];if(n.depth>0){M[n.depth-1]=!n.isLastChild}l.forEach(([r,d],j)=>{const $=m(d,new Set,h,r,n.depth+1,t,n.path,j,U,M);S.push(...$)})}catch(l){console.error("[Buoy]",l)}const x=S;if(x.length>0){}g[T]={...n,isExpanded:true};g.splice(T+1,0,...x);const c=new Map;g.forEach((l,y)=>{c.set(l.id,{item:l,index:y})});V.current=c;return g}else if(!p){const g=new Set;const h=(c,l)=>{s.forEach(y=>{if(y.parentId===c||y.id.startsWith(c+".")&&y.depth>l){g.add(y.id);if(y.hasChildren){h(y.id,y.depth)}}})};h(t,n.depth);const S=s.map(c=>{if(c.id===t){return{...c,isExpanded:false}}return c}).filter(c=>!g.has(c.id));const x=new Map;S.forEach((c,l)=>{x.set(c.id,{item:c,index:l})});V.current=x;return S}return s})},[m]);const z=(0,_react.useCallback)(t=>{D(p=>{const s=new Set(p);const u=!s.has(t);if(u){s.add(t)}else{s.delete(t)}a.current={type:u?"expand":"collapse",itemId:t};O(t,u);return s})},[O]);const L=countNodesUpTo(e,CHUNK_SIZE,0)<CHUNK_SIZE;const H=(0,_react.useMemo)(()=>{if(!L)return null;return m(e,E,new WeakSet,"root",0,void 0,[],0,1,[])},[L,e,E,m]);const N=(0,_react.useCallback)(t=>{if(t.length===0)return;D(p=>{if(t.every(u=>p.has(u)))return p;const s=new Set(p);for(const u of t)s.add(u);return s})},[]);return{flatData:H??f,isProcessing:H?false:_,toggleExpanded:z,revealPath:N}};const VirtualizedItemComponent=({item:e,onToggleExpanded:o,index:i,onSelect:f,isSelected:b,selectable:V,onRequestInlineEdit:B,isInlineEditing:E,inlineEditor:D,testIDPrefix:_})=>{const[R,C]=(0,_react.useState)(false);const[I,k]=(0,_react.useState)(false);const P=V===true;const a=(0,_react.useRef)(0);const m=e.path.slice(1);const O=INDENT_STYLES[Math.min(e.depth,MAX_DEPTH_LIMIT)]||INDENT_STYLES[0];const z=getTypeColor(e.valueType);const L=false;const H=()=>{if(P){const s=Date.now();const u=s-a.current<DOUBLE_TAP_MS;a.current=s;if(u&&!e.isExpandable&&B){B(e);return}f(e);return}if(e.isExpandable){o(e.id)}f(e)};const N=()=>{if(e.isExpandable){o(e.id)}f(e)};const t=()=>{};const p=e.key;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[STABLE_STYLES.itemContainer,O],children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools data explorer item",testID:`${_}-${e.id}`,accessibilityLabel:`${e.key}: ${e.valueType}`,style:[STABLE_STYLES.itemTouchable,R&&STABLE_STYLES.itemTouchablePressed,P&&b&&STABLE_STYLES.itemSelected,L&&{minHeight:LONG_ITEM_HEIGHT,paddingVertical:2}],onPress:H,onPressIn:()=>C(true),onPressOut:()=>C(false),activeOpacity:e.isExpandable||P?.7:1,disabled:!e.isExpandable&&!P,children:[e.isExpandable?(0,_jsxRuntime.jsx)(Expander,{expanded:e.isExpanded,onPress:N}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.expanderContainer}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.labelContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:STABLE_STYLES.labelText,numberOfLines:1,children:[e.key,":"]}),E&&D?D:e.isExpandable?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[STABLE_STYLES.valueText,{color:_index.gameUIColors.secondary}],numberOfLines:1,children:[e.valueType," (",e.childCount," ",e.childCount===1?"item":"items",")"]}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[STABLE_STYLES.valueText,{color:z}],numberOfLines:1,children:formatValue(e.value,e.valueType)})]})]}),e.value!==void 0?(0,_jsxRuntime.jsx)(_CopyButton.CopyButton,{value:e.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})};VirtualizedItemComponent.displayName="VirtualizedItem";const VirtualizedItem=(0,_react.memo)(VirtualizedItemComponent);const VirtualizedDataExplorer=({title:e,description:o,data:i,maxDepth:f=10,rawMode:b=false,initialExpanded:V=false,disableCopy:B=false,onSelectionChange:E,onRequestInlineEdit:D,inlineEditPath:_,renderInlineEditor:R,selectPath:C,testIDPrefix:I="buoy-tree-row"})=>{const[k,P]=(0,_react.useState)(b);const{flatData:a,isProcessing:m,toggleExpanded:O,revealPath:z}=useDataFlattening(i,f,V);const L=(0,_react.useRef)(null);const[H,N]=(0,_react.useState)({start:0,end:Math.min(a.length-1,Math.max(0,Math.ceil(400/ITEM_HEIGHT)-1))});const t=(0,_react.useRef)({itemVisiblePercentThreshold:1});const p=(0,_react.useRef)(({viewableItems:r})=>{const d=r.map(j=>j.index).filter(j=>typeof j==="number");if(d.length){N({start:Math.min(...d),end:Math.max(...d)})}}).current;(0,_react.useEffect)(()=>{N({start:0,end:Math.min(a.length-1,Math.max(0,Math.ceil(400/ITEM_HEIGHT)-1))})},[a.length]);const s=(0,_react.useMemo)(()=>{const r=new Set;for(const d of a){r.add(d.valueType);if(r.size>=8)break}return Array.from(r)},[a]);const u=()=>{P(!k)};const[n,T]=(0,_react.useState)(null);const g=(0,_react.useMemo)(()=>n==null?void 0:a.find(r=>r.id===n),[a,n]);const h=g?.depth;(0,_react.useEffect)(()=>{if(!E)return;E(g?selectionOf(g):null)},[g,E]);const S=(0,_react.useCallback)(r=>{T(d=>d===r.id?null:r.id)},[]);const x=C===void 0?void 0:C===null?"\0null":C.join(".");const c=(0,_react.useRef)(x);(0,_react.useEffect)(()=>{if(x===c.current)return;c.current=x;if(x===void 0)return;if(C==null){T(null);return}const r=["root"];for(const d of C.slice(0,-1)){r.push(`${r[r.length-1]}.${d}`)}z(r);T(["root",...C].join("."))},[x,C,z]);const l=(0,_react.useCallback)(r=>{T(r.id);D?.(selectionOf(r))},[D]);const y=({item:r,index:d})=>(0,_jsxRuntime.jsx)(VirtualizedItem,{item:r,index:d,onToggleExpanded:O,onSelect:S,isSelected:g?.id===r.id,selectable:E!=null,onRequestInlineEdit:l,isInlineEditing:_!=null&&_.join(".")===r.path.slice(1).join("."),inlineEditor:R?R(selectionOf(r)):null,testIDPrefix:I});const U=ITEM_HEIGHT;const W=r=>r.id;const M=i!==null&&i!==void 0&&(typeof i==="string"?i.length>0:typeof i==="number"||typeof i==="boolean"?true:Array.isArray(i)?i.length>0:typeof i==="object"?Object.keys(i).length>0:false);if(b){if(!M){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,justifyContent:"center",alignItems:"center",padding:20},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.noDataText,children:"No data available"})})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{minHeight:m?40:a.length*ITEM_HEIGHT},children:m?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:STABLE_STYLES.loadingText,children:["Processing data... (raw mode, isProcessing=",String(m),")"]})}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{position:"relative",height:a.length*ITEM_HEIGHT},children:[(0,_jsxRuntime.jsx)(_IndentGuidesOverlay.IndentGuidesOverlay,{items:a,visibleRange:{start:0,end:Math.max(0,a.length-1)},itemHeight:ITEM_HEIGHT,indentWidth:INDENT_WIDTH,activeDepth:h}),(0,_jsxRuntime.jsx)(_reactNative.FlatList,{ref:L,"sentry-label":"ignore devtools data explorer list",data:a,renderItem:y,keyExtractor:W,showsVerticalScrollIndicator:true,contentContainerStyle:STABLE_STYLES.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})]})})}if(!M){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.container,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.header,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.headerRow,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{flex:1},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.title,children:e}),o&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.description,children:o})]})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.noDataContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.noDataText,children:"No data available"})})]})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.header,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.headerRow,children:(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools data explorer header toggle",onPress:u,hitSlop:HIT_SLOP_10,style:STABLE_STYLES.headerTouchable,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{flex:1},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.title,children:e}),o&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.description,children:o})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.expanderMargin,children:(0,_jsxRuntime.jsx)(Expander,{expanded:k,onPress:u})})]})}),k&&s.length>0&&!b&&(0,_jsxRuntime.jsx)(TypeLegend,{visibleTypes:s})]}),k&&(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:m?(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.loadingContainer,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:STABLE_STYLES.loadingText,children:["Processing data... (isProcessing=",String(m),")"]})}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{height:a.length*ITEM_HEIGHT,position:"relative"},children:[(0,_jsxRuntime.jsx)(_IndentGuidesOverlay.IndentGuidesOverlay,{items:a,visibleRange:H,itemHeight:ITEM_HEIGHT,indentWidth:INDENT_WIDTH,activeDepth:h}),(0,_jsxRuntime.jsx)(_reactNative.FlatList,{ref:L,"sentry-label":"ignore devtools data explorer collapsed list",data:a,renderItem:y,keyExtractor:W,showsVerticalScrollIndicator:true,contentContainerStyle:STABLE_STYLES.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,onViewableItemsChanged:p,viewabilityConfig:t.current})]})})]})};exports.VirtualizedDataExplorer=VirtualizedDataExplorer;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.VirtualizedDataExplorer=void 0;var _react=require("react");var _reactNative=require("react-native");var _displayValue=require("../utils/displayValue.js");var _index=require("../ui/gameUI/index.js");var _nightTheme=require("../ui/night/nightTheme.js");var _CopyButton=require("../ui/components/CopyButton.js");var _index2=require("../icons/index.js");var _IndentGuidesOverlay=require("./IndentGuidesOverlay.js");var _fonts=require("../ui/fonts.js");var _jsxRuntime=require("react/jsx-runtime");const HIT_SLOP_10={top:10,bottom:10,left:10,right:10};const ITEM_HEIGHT=24;const LONG_ITEM_HEIGHT=24;const CHUNK_SIZE=50;const MAX_DEPTH_LIMIT=15;const MAX_ITEMS_PER_LEVEL=500;const LONG_KEY_THRESHOLD=30;const DOUBLE_TAP_MS=300;const INDENT_WIDTH=16;const INDENT_STYLES=Array.from({length:MAX_DEPTH_LIMIT+1},(e,o)=>_reactNative.StyleSheet.create({container:{marginLeft:o*INDENT_WIDTH}}).container);const TYPE_COLOR_CACHE=new Map([["string",_index.gameUIColors.dataTypes.string],["number",_index.gameUIColors.dataTypes.number],["bigint",_index.gameUIColors.optional],["boolean",_index.gameUIColors.dataTypes.boolean],["null",_index.gameUIColors.dataTypes.null],["undefined",_index.gameUIColors.dataTypes.undefined],["function",_index.gameUIColors.dataTypes.function],["symbol",_index.gameUIColors.critical],["date",_index.gameUIColors.critical],["error",_index.gameUIColors.error],["array",_index.gameUIColors.dataTypes.array],["object",_index.gameUIColors.dataTypes.object],["map",_index.gameUIColors.info],["set",_index.gameUIColors.success],["circular",_index.gameUIColors.warning]]);const STABLE_STYLES=_reactNative.StyleSheet.create({container:{backgroundColor:_nightTheme.night.color.bg,borderRadius:8,borderWidth:1,borderColor:_nightTheme.night.color.border},header:{flexDirection:"column",paddingHorizontal:16,paddingVertical:12},headerRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},title:{color:_index.gameUIColors.primary,fontSize:14,fontWeight:"500"},description:{color:_index.gameUIColors.secondary,fontSize:12,marginTop:2},typeLegend:{flexDirection:"row",flexWrap:"wrap",gap:6,marginTop:8,paddingTop:8,borderTopWidth:1,borderTopColor:_index.gameUIColors.primary+"14"},typeBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},typeColor:{width:8,height:8,borderRadius:4,marginRight:4},typeName:{fontSize:10,fontWeight:"500",color:_index.gameUIColors.secondary},itemContainer:{minHeight:ITEM_HEIGHT,backgroundColor:"transparent",position:"relative",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:0,paddingRight:16,paddingVertical:2,minHeight:24},itemTouchablePressed:{backgroundColor:_index.gameUIColors.primary+"0A"},itemSelected:{backgroundColor:_index.gameUIColors.primary+"14"},expanderContainer:{width:16,alignItems:"center",justifyContent:"center",marginTop:4},expanderIcon:{width:12,height:12},labelContainer:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelContainerVertical:{flex:1,flexDirection:"column",paddingLeft:2,paddingVertical:2},labelContainerVerticalRow:{flexDirection:"row",alignItems:"center",marginBottom:2},labelText:{color:_index.gameUIColors.primary,fontSize:12,fontWeight:"500",fontFamily:_fonts.monoFont,marginRight:8,flexShrink:1},labelTextTruncated:{color:_index.gameUIColors.primary,fontSize:12,fontWeight:"500",fontFamily:_fonts.monoFont,flexShrink:1},valueText:{fontSize:12,fontFamily:_fonts.monoFont,flex:1,color:_index.gameUIColors.primaryLight},loadingContainer:{padding:16,alignItems:"center"},loadingText:{color:_index.gameUIColors.secondary,fontSize:12},noDataContainer:{padding:16,alignItems:"center"},noDataText:{color:_index.gameUIColors.secondary,fontSize:12},listContent:{paddingBottom:8},headerTouchable:{flex:1,flexDirection:"row",alignItems:"center"},expanderMargin:{marginLeft:8}});function selectionOf(e){return{path:e.path.slice(1),value:e.value,label:e.key}}function countNodesUpTo(e,o,i=0){if(i>=o)return i;let f=i+1;if(Array.isArray(e)){for(const b of e){if(f>=o)return f;f=countNodesUpTo(b,o,f)}}else if(e!==null&&typeof e==="object"){for(const b of Object.values(e)){if(f>=o)return f;f=countNodesUpTo(b,o,f)}}return f}const getValueType=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(e instanceof Date)return"date";if(e instanceof Error)return"error";if(e instanceof Map)return"map";if(e instanceof Set)return"set";if(e instanceof RegExp)return"regexp";if(typeof e==="function")return"function";if(typeof e==="symbol")return"symbol";if(typeof e==="bigint")return"bigint";if(typeof e==="object")return"object";return typeof e};const getValueCount=(e,o)=>{if(e===null)return 0;switch(o){case"array":return Array.isArray(e)?e.length:0;case"object":return typeof e==="object"&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof RegExp)&&!(e instanceof Map)&&!(e instanceof Set)?Object.keys(e).length:0;case"map":return e instanceof Map?e.size:0;case"set":return e instanceof Set?e.size:0;default:return 0}};const formatValue=(e,o)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(o){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:return(0,_displayValue.displayValue)(e)}};const getTypeColor=e=>{return TYPE_COLOR_CACHE.get(e)||_index.gameUIColors.dataTypes.array};const ExpanderComponent=({expanded:e,onPress:o})=>{return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools data explorer expander",style:STABLE_STYLES.expanderContainer,onPress:o,hitSlop:HIT_SLOP_10,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.expanderIcon,children:(0,_jsxRuntime.jsx)(_index2.ChevronRight,{size:12,color:_index.gameUIColors.secondary,strokeWidth:2,style:{transform:[{rotate:e?"90deg":"0deg"}]}})})})};ExpanderComponent.displayName="Expander";const Expander=(0,_react.memo)(ExpanderComponent);const TypeLegendComponent=({visibleTypes:e})=>{const o=Array.from(new Set(e)).slice(0,8);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.typeLegend,children:o.map(i=>{const f=getTypeColor(i);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[STABLE_STYLES.typeBadge,{backgroundColor:`${f}10`,borderColor:`${f}30`}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[STABLE_STYLES.typeColor,{backgroundColor:f}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.typeName,children:i})]},i)})})};TypeLegendComponent.displayName="TypeLegend";const TypeLegend=(0,_react.memo)(TypeLegendComponent);const useDataFlattening=(e,o=10,i=false)=>{const[f,b]=(0,_react.useState)([]);const V=(0,_react.useRef)(new Map);const B=(0,_react.useCallback)(()=>{const t=new Set(["root"]);if(i&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((p,s)=>{t.add(`root.${s}`)})}else{Object.keys(e).forEach(p=>{t.add(`root.${p}`)})}}return t},[i,e]);const[E,D]=(0,_react.useState)(()=>B());const[_,R]=(0,_react.useState)(false);const C=(0,_react.useRef)(new WeakSet);const S=(0,_react.useRef)(false);const k=(0,_react.useRef)(0);const P=(0,_react.useRef)(0);const a=(0,_react.useRef)(void 0);const m=(0,_react.useCallback)((t,p,s,u="root",n=0,T,g=[],h=0,I=1,x=[])=>{if(n>Math.min(o,MAX_DEPTH_LIMIT))return[];const c=[...g,u];const l=c.join(".");const y=getValueType(t);const U=["object","array","map","set"].includes(y)&&t!==null;const W=U?getValueCount(t,y):0;const M=Math.min(W,MAX_ITEMS_PER_LEVEL);if(t&&typeof t==="object"){if(s.has(t)){return[{id:l,key:u,value:"[Circular Reference]",valueType:"circular",depth:n,isExpandable:false,isExpanded:false,parentId:T,hasChildren:false,childCount:0,path:c,type:"circular",isLastChild:h===I-1,parentHasMoreSiblings:[...x],siblingIndex:h,totalSiblings:I}]}s.add(t)}const r={id:l,key:u,value:t,valueType:y,depth:n,isExpandable:U,isExpanded:p.has(l),parentId:T,hasChildren:M>0,childCount:M,path:c,type:U?"expandable":y,isLastChild:h===I-1,parentHasMoreSiblings:[...x],siblingIndex:h,totalSiblings:I};const d=[r];if(U&&p.has(l)&&n<Math.min(o,MAX_DEPTH_LIMIT)){try{let j=[];switch(y){case"array":j=Array.isArray(t)?t.map((w,A)=>[A.toString(),w]):[];break;case"object":j=typeof t==="object"&&t!==null&&!(t instanceof Date)&&!(t instanceof Error)&&!(t instanceof RegExp)&&!(t instanceof Map)&&!(t instanceof Set)?Object.entries(t):[];break;case"map":j=t instanceof Map?Array.from(t.entries()).map(([w,A])=>[String(w),A]):[];break;case"set":j=t instanceof Set?Array.from(t.values()).map((w,A)=>[A.toString(),w]):[];break}const $=j.slice(0,M);const v=$.length;const q=[...x];if(n>0){q[n-1]=!r.isLastChild}for(let w=0;w<$.length;w+=CHUNK_SIZE){const A=$.slice(w,w+CHUNK_SIZE);let F=w;for(const[K,G]of A){d.push(...m(G,p,s,K,n+1,l,c,F,v,q));F++}if(w>0&&w%(CHUNK_SIZE*2)===0){break}}}catch(j){console.error("[Buoy]",j)}}return d},[o]);(0,_react.useEffect)(()=>{if(a.current&&(a.current.type==="expand"||a.current.type==="collapse")){if(_){R(false);S.current=false}a.current=void 0;return}if(S.current){return}let t;const p=++k.current;const s=()=>k.current===p;S.current=true;R(true);const u=async()=>{t=setTimeout(()=>{if(S.current&&s()){R(false);S.current=false}},5e3);await new Promise(n=>setTimeout(()=>n(),10));if(!s()){return}try{C.current=new WeakSet;P.current=Date.now();const n=m(e,E,C.current,"root",0,void 0,[],0,1,[]);const T=new Map;n.forEach((g,h)=>{T.set(g.id,{item:g,index:h})});V.current=T;if(t)clearTimeout(t);if(s()){b(n);R(false);S.current=false}}catch(n){console.error("[Buoy]",n);if(t)clearTimeout(t);if(s()){b([]);V.current=new Map;R(false);S.current=false}}};u();return()=>{S.current=false;if(t)clearTimeout(t)}},[e,E,m,o]);const O=(0,_react.useCallback)((t,p)=>{R(false);S.current=false;b(s=>{const u=V.current.get(t);if(!u){return s}const{item:n,index:T}=u;if(p&&n.isExpandable&&n.hasChildren){const g=[...s];const h=new WeakSet;if(n.value&&typeof n.value==="object"){h.add(n.value)}const I=[];try{let l=[];const y=n.valueType;switch(y){case"array":l=Array.isArray(n.value)?n.value.map((r,d)=>[d.toString(),r]):[];break;case"object":l=typeof n.value==="object"&&n.value!==null&&!(n.value instanceof Date)&&!(n.value instanceof Error)&&!(n.value instanceof RegExp)&&!(n.value instanceof Map)&&!(n.value instanceof Set)?Object.entries(n.value):[];break;case"map":l=n.value instanceof Map?Array.from(n.value.entries()).map(([r,d])=>[String(r),d]):[];break;case"set":l=n.value instanceof Set?Array.from(n.value.values()).map((r,d)=>[d.toString(),r]):[];break}const U=l.length;const W=n.parentHasMoreSiblings||[];const M=[...W];if(n.depth>0){M[n.depth-1]=!n.isLastChild}l.forEach(([r,d],j)=>{const $=m(d,new Set,h,r,n.depth+1,t,n.path,j,U,M);I.push(...$)})}catch(l){console.error("[Buoy]",l)}const x=I;if(x.length>0){}g[T]={...n,isExpanded:true};g.splice(T+1,0,...x);const c=new Map;g.forEach((l,y)=>{c.set(l.id,{item:l,index:y})});V.current=c;return g}else if(!p){const g=new Set;const h=(c,l)=>{s.forEach(y=>{if(y.parentId===c||y.id.startsWith(c+".")&&y.depth>l){g.add(y.id);if(y.hasChildren){h(y.id,y.depth)}}})};h(t,n.depth);const I=s.map(c=>{if(c.id===t){return{...c,isExpanded:false}}return c}).filter(c=>!g.has(c.id));const x=new Map;I.forEach((c,l)=>{x.set(c.id,{item:c,index:l})});V.current=x;return I}return s})},[m]);const z=(0,_react.useCallback)(t=>{D(p=>{const s=new Set(p);const u=!s.has(t);if(u){s.add(t)}else{s.delete(t)}a.current={type:u?"expand":"collapse",itemId:t};O(t,u);return s})},[O]);const L=countNodesUpTo(e,CHUNK_SIZE,0)<CHUNK_SIZE;const H=(0,_react.useMemo)(()=>{if(!L)return null;return m(e,E,new WeakSet,"root",0,void 0,[],0,1,[])},[L,e,E,m]);const N=(0,_react.useCallback)(t=>{if(t.length===0)return;D(p=>{if(t.every(u=>p.has(u)))return p;const s=new Set(p);for(const u of t)s.add(u);return s})},[]);return{flatData:H??f,isProcessing:H?false:_,toggleExpanded:z,revealPath:N}};const VirtualizedItemComponent=({item:e,onToggleExpanded:o,index:i,onSelect:f,isSelected:b,selectable:V,onRequestInlineEdit:B,isInlineEditing:E,inlineEditor:D,testIDPrefix:_})=>{const[R,C]=(0,_react.useState)(false);const[S,k]=(0,_react.useState)(false);const P=V===true;const a=(0,_react.useRef)(0);const m=e.path.slice(1);const O=INDENT_STYLES[Math.min(e.depth,MAX_DEPTH_LIMIT)]||INDENT_STYLES[0];const z=getTypeColor(e.valueType);const L=false;const H=()=>{if(P){const s=Date.now();const u=s-a.current<DOUBLE_TAP_MS;a.current=s;if(u&&!e.isExpandable&&B){B(e);return}f(e);return}if(e.isExpandable){o(e.id)}f(e)};const N=()=>{if(e.isExpandable){o(e.id)}f(e)};const t=()=>{};const p=e.key;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[STABLE_STYLES.itemContainer,O],children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools data explorer item",testID:`${_}-${e.id}`,accessibilityLabel:`${e.key}: ${e.valueType}`,style:[STABLE_STYLES.itemTouchable,R&&STABLE_STYLES.itemTouchablePressed,P&&b&&STABLE_STYLES.itemSelected,L&&{minHeight:LONG_ITEM_HEIGHT,paddingVertical:2}],onPress:H,onPressIn:()=>C(true),onPressOut:()=>C(false),activeOpacity:e.isExpandable||P?.7:1,disabled:!e.isExpandable&&!P,children:[e.isExpandable?(0,_jsxRuntime.jsx)(Expander,{expanded:e.isExpanded,onPress:N}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.expanderContainer}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.labelContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:STABLE_STYLES.labelText,numberOfLines:1,children:[e.key,":"]}),E&&D?D:e.isExpandable?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[STABLE_STYLES.valueText,{color:_index.gameUIColors.secondary}],numberOfLines:1,children:[e.valueType," (",e.childCount," ",e.childCount===1?"item":"items",")"]}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[STABLE_STYLES.valueText,{color:z}],numberOfLines:1,children:formatValue(e.value,e.valueType)})]})]}),e.value!==void 0?(0,_jsxRuntime.jsx)(_CopyButton.CopyButton,{value:e.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})};VirtualizedItemComponent.displayName="VirtualizedItem";const VirtualizedItem=(0,_react.memo)(VirtualizedItemComponent);const VirtualizedDataExplorer=({title:e,description:o,data:i,maxDepth:f=10,rawMode:b=false,initialExpanded:V=false,disableCopy:B=false,onSelectionChange:E,onRequestInlineEdit:D,inlineEditPath:_,renderInlineEditor:R,selectPath:C,testIDPrefix:S="buoy-tree-row"})=>{const[k,P]=(0,_react.useState)(b);const{flatData:a,isProcessing:m,toggleExpanded:O,revealPath:z}=useDataFlattening(i,f,V);const L=(0,_react.useRef)(null);const[H,N]=(0,_react.useState)({start:0,end:Math.min(a.length-1,Math.max(0,Math.ceil(400/ITEM_HEIGHT)-1))});const t=(0,_react.useRef)({itemVisiblePercentThreshold:1});const p=(0,_react.useRef)(({viewableItems:r})=>{const d=r.map(j=>j.index).filter(j=>typeof j==="number");if(d.length){N({start:Math.min(...d),end:Math.max(...d)})}}).current;(0,_react.useEffect)(()=>{N({start:0,end:Math.min(a.length-1,Math.max(0,Math.ceil(400/ITEM_HEIGHT)-1))})},[a.length]);const s=(0,_react.useMemo)(()=>{const r=new Set;for(const d of a){r.add(d.valueType);if(r.size>=8)break}return Array.from(r)},[a]);const u=()=>{P(!k)};const[n,T]=(0,_react.useState)(null);const g=(0,_react.useMemo)(()=>n==null?void 0:a.find(r=>r.id===n),[a,n]);const h=g?.depth;(0,_react.useEffect)(()=>{if(!E)return;E(g?selectionOf(g):null)},[g,E]);const I=(0,_react.useCallback)(r=>{T(d=>d===r.id?null:r.id)},[]);const x=C===void 0?void 0:C===null?"\0null":C.join(".");const c=(0,_react.useRef)(x);(0,_react.useEffect)(()=>{if(x===c.current)return;c.current=x;if(x===void 0)return;if(C==null){T(null);return}const r=["root"];for(const d of C.slice(0,-1)){r.push(`${r[r.length-1]}.${d}`)}z(r);T(["root",...C].join("."))},[x,C,z]);const l=(0,_react.useCallback)(r=>{T(r.id);D?.(selectionOf(r))},[D]);const y=({item:r,index:d})=>(0,_jsxRuntime.jsx)(VirtualizedItem,{item:r,index:d,onToggleExpanded:O,onSelect:I,isSelected:g?.id===r.id,selectable:E!=null,onRequestInlineEdit:l,isInlineEditing:_!=null&&_.join(".")===r.path.slice(1).join("."),inlineEditor:R?R(selectionOf(r)):null,testIDPrefix:S});const U=ITEM_HEIGHT;const W=r=>r.id;const M=i!==null&&i!==void 0&&(typeof i==="string"?i.length>0:typeof i==="number"||typeof i==="boolean"?true:Array.isArray(i)?i.length>0:typeof i==="object"?Object.keys(i).length>0:false);if(b){if(!M){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,justifyContent:"center",alignItems:"center",padding:20},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.noDataText,children:"No data available"})})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{minHeight:m?40:a.length*ITEM_HEIGHT},children:m?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:STABLE_STYLES.loadingText,children:["Processing data... (raw mode, isProcessing=",String(m),")"]})}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{position:"relative",height:a.length*ITEM_HEIGHT},children:[(0,_jsxRuntime.jsx)(_IndentGuidesOverlay.IndentGuidesOverlay,{items:a,visibleRange:{start:0,end:Math.max(0,a.length-1)},itemHeight:ITEM_HEIGHT,indentWidth:INDENT_WIDTH,activeDepth:h}),(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",ref:L,"sentry-label":"ignore devtools data explorer list",data:a,renderItem:y,keyExtractor:W,showsVerticalScrollIndicator:true,contentContainerStyle:STABLE_STYLES.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})]})})}if(!M){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.container,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.header,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.headerRow,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{flex:1},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.title,children:e}),o&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.description,children:o})]})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.noDataContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.noDataText,children:"No data available"})})]})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:STABLE_STYLES.header,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.headerRow,children:(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools data explorer header toggle",onPress:u,hitSlop:HIT_SLOP_10,style:STABLE_STYLES.headerTouchable,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{flex:1},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.title,children:e}),o&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:STABLE_STYLES.description,children:o})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.expanderMargin,children:(0,_jsxRuntime.jsx)(Expander,{expanded:k,onPress:u})})]})}),k&&s.length>0&&!b&&(0,_jsxRuntime.jsx)(TypeLegend,{visibleTypes:s})]}),k&&(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:m?(0,_jsxRuntime.jsx)(_reactNative.View,{style:STABLE_STYLES.loadingContainer,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:STABLE_STYLES.loadingText,children:["Processing data... (isProcessing=",String(m),")"]})}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{height:a.length*ITEM_HEIGHT,position:"relative"},children:[(0,_jsxRuntime.jsx)(_IndentGuidesOverlay.IndentGuidesOverlay,{items:a,visibleRange:H,itemHeight:ITEM_HEIGHT,indentWidth:INDENT_WIDTH,activeDepth:h}),(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",ref:L,"sentry-label":"ignore devtools data explorer collapsed list",data:a,renderItem:y,keyExtractor:W,showsVerticalScrollIndicator:true,contentContainerStyle:STABLE_STYLES.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,onViewableItemsChanged:p,viewabilityConfig:t.current})]})})]})};exports.VirtualizedDataExplorer=VirtualizedDataExplorer;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.HistoryList=HistoryList;exports.StandaloneHistoryList=StandaloneHistoryList;var _react=require("react");var _reactNative=require("react-native");var _gameUIColors=require("../../ui/gameUI/constants/gameUIColors.js");var _HistoryEntryRow=require("./HistoryEntryRow.js");var _HistoryProvider=require("../HistoryProvider.js");var _jsxRuntime=require("react/jsx-runtime");function HistoryList({filter:u,selectedEntryId:r,onSelectEntry:o,showSource:n=true,emptyMessage:s="No history entries yet",ListHeaderComponent:a,ListFooterComponent:y}){const p=(0,_HistoryProvider.useAllHistoryEntries)(u);const i=(0,_HistoryProvider.useHistoryAdapters)();const c=(0,_react.useMemo)(()=>{const e=new Map;i.forEach(l=>e.set(l.id,l));return e},[i]);const d=(0,_react.useCallback)(e=>`${e.source}-${e.id}`,[]);const m=(0,_react.useCallback)(({item:e})=>{const l=c.get(e.source);return(0,_jsxRuntime.jsx)(_HistoryEntryRow.HistoryEntryRow,{entry:e,adapter:l,isSelected:r===e.id,onPress:o,showSource:n})},[c,r,o,n]);const t=(0,_react.useMemo)(()=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:s}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptySubtext,children:"Actions will appear here as they happen"})]}),[s]);return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{data:p,keyExtractor:d,renderItem:m,ListEmptyComponent:t,ListHeaderComponent:a,ListFooterComponent:y,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:false,removeClippedSubviews:true,maxToRenderPerBatch:15,windowSize:10,initialNumToRender:15,getItemLayout:void 0})}function StandaloneHistoryList({entries:u,adapters:r=[],selectedEntryId:o,onSelectEntry:n,showSource:s=true,emptyMessage:a="No history entries yet",ListHeaderComponent:y,ListFooterComponent:p}){const i=(0,_react.useMemo)(()=>{const t=new Map;r.forEach(e=>t.set(e.id,e));return t},[r]);const c=(0,_react.useCallback)(t=>`${t.source}-${t.id}`,[]);const d=(0,_react.useCallback)(({item:t})=>{const e=i.get(t.source);return(0,_jsxRuntime.jsx)(_HistoryEntryRow.HistoryEntryRow,{entry:t,adapter:e,isSelected:o===t.id,onPress:n,showSource:s})},[i,o,n,s]);const m=(0,_react.useMemo)(()=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:a}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptySubtext,children:"Actions will appear here as they happen"})]}),[a]);return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{data:u,keyExtractor:c,renderItem:d,ListEmptyComponent:m,ListHeaderComponent:y,ListFooterComponent:p,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:false,removeClippedSubviews:true,maxToRenderPerBatch:15,windowSize:10,initialNumToRender:15})}const styles=_reactNative.StyleSheet.create({listContent:{flexGrow:1,paddingVertical:4},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:60,paddingHorizontal:20},emptyText:{fontSize:16,fontWeight:"600",color:_gameUIColors.buoyColors.text,marginBottom:8},emptySubtext:{fontSize:13,color:_gameUIColors.buoyColors.textMuted,textAlign:"center"}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.HistoryList=HistoryList;exports.StandaloneHistoryList=StandaloneHistoryList;var _react=require("react");var _reactNative=require("react-native");var _gameUIColors=require("../../ui/gameUI/constants/gameUIColors.js");var _HistoryEntryRow=require("./HistoryEntryRow.js");var _HistoryProvider=require("../HistoryProvider.js");var _jsxRuntime=require("react/jsx-runtime");function HistoryList({filter:d,selectedEntryId:r,onSelectEntry:o,showSource:s=true,emptyMessage:n="No history entries yet",ListHeaderComponent:a,ListFooterComponent:u}){const y=(0,_HistoryProvider.useAllHistoryEntries)(d);const i=(0,_HistoryProvider.useHistoryAdapters)();const l=(0,_react.useMemo)(()=>{const e=new Map;i.forEach(c=>e.set(c.id,c));return e},[i]);const p=(0,_react.useCallback)(e=>`${e.source}-${e.id}`,[]);const m=(0,_react.useCallback)(({item:e})=>{const c=l.get(e.source);return(0,_jsxRuntime.jsx)(_HistoryEntryRow.HistoryEntryRow,{entry:e,adapter:c,isSelected:r===e.id,onPress:o,showSource:s})},[l,r,o,s]);const t=(0,_react.useMemo)(()=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:n}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptySubtext,children:"Actions will appear here as they happen"})]}),[n]);return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",data:y,keyExtractor:p,renderItem:m,ListEmptyComponent:t,ListHeaderComponent:a,ListFooterComponent:u,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:false,removeClippedSubviews:true,maxToRenderPerBatch:15,windowSize:10,initialNumToRender:15,getItemLayout:void 0})}function StandaloneHistoryList({entries:d,adapters:r=[],selectedEntryId:o,onSelectEntry:s,showSource:n=true,emptyMessage:a="No history entries yet",ListHeaderComponent:u,ListFooterComponent:y}){const i=(0,_react.useMemo)(()=>{const t=new Map;r.forEach(e=>t.set(e.id,e));return t},[r]);const l=(0,_react.useCallback)(t=>`${t.source}-${t.id}`,[]);const p=(0,_react.useCallback)(({item:t})=>{const e=i.get(t.source);return(0,_jsxRuntime.jsx)(_HistoryEntryRow.HistoryEntryRow,{entry:t,adapter:e,isSelected:o===t.id,onPress:s,showSource:n})},[i,o,s,n]);const m=(0,_react.useMemo)(()=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:a}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptySubtext,children:"Actions will appear here as they happen"})]}),[a]);return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",data:d,keyExtractor:l,renderItem:p,ListEmptyComponent:m,ListHeaderComponent:u,ListFooterComponent:y,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:false,removeClippedSubviews:true,maxToRenderPerBatch:15,windowSize:10,initialNumToRender:15})}const styles=_reactNative.StyleSheet.create({listContent:{flexGrow:1,paddingVertical:4},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:60,paddingHorizontal:20},emptyText:{fontSize:16,fontWeight:"600",color:_gameUIColors.buoyColors.text,marginBottom:8},emptySubtext:{fontSize:13,color:_gameUIColors.buoyColors.textMuted,textAlign:"center"}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FreeAccountPrompt=FreeAccountPrompt;Object.defineProperty(exports,"LOGIN_COMMAND",{enumerable:true,get:function(){return _AccountSetupContent.LOGIN_COMMAND}});var _reactNative=require("react-native");var _AccountSetupContent=require("./AccountSetupContent.js");var _jsxRuntime=require("react/jsx-runtime");function FreeAccountPrompt({visible:t,onClose:e}){if(!t)return null;return(0,_jsxRuntime.jsx)(_reactNative.Modal,{visible:true,transparent:true,animationType:"fade",onRequestClose:e,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,accessibilityViewIsModal:true,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:_reactNative.StyleSheet.absoluteFill,onPress:e,accessible:false}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.frame,bounces:false,children:(0,_jsxRuntime.jsx)(_AccountSetupContent.AccountSetupCard,{onClose:e})})]})})}const styles=_reactNative.StyleSheet.create({overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},frame:{width:"100%",maxWidth:368,maxHeight:"90%",flexGrow:0,borderRadius:20}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FreeAccountPrompt=FreeAccountPrompt;Object.defineProperty(exports,"LOGIN_COMMAND",{enumerable:true,get:function(){return _AccountSetupContent.LOGIN_COMMAND}});var _reactNative=require("react-native");var _AccountSetupContent=require("./AccountSetupContent.js");var _jsxRuntime=require("react/jsx-runtime");function FreeAccountPrompt({visible:t,onClose:e}){if(!t)return null;return(0,_jsxRuntime.jsx)(_reactNative.Modal,{visible:true,transparent:true,animationType:"fade",onRequestClose:e,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,accessibilityViewIsModal:true,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:_reactNative.StyleSheet.absoluteFill,onPress:e,accessible:false}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.frame,bounces:false,children:(0,_jsxRuntime.jsx)(_AccountSetupContent.AccountSetupCard,{onClose:e})})]})})}const styles=_reactNative.StyleSheet.create({overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},frame:{width:"100%",maxWidth:368,maxHeight:"90%",flexGrow:0,borderRadius:20}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BubbleSettingsDetail=BubbleSettingsDetail;exports.BubbleSettingsSection=BubbleSettingsSection;exports.getBubbleVisibilitySettings=getBubbleVisibilitySettings;var _reactNative=require("react-native");var _index=require("../../icons/index.js");var _react=require("react");var _CyberpunkSectionButton=require("../../ui/console/CyberpunkSectionButton.js");var _devToolsStorageKeys=require("../../storage/devToolsStorageKeys.js");var _persistentStorage=require("../../utils/persistentStorage");var _macOSDesignSystemColors=require("../../ui/gameUI/constants/macOSDesignSystemColors.js");var _gameUIColors=require("../../ui/gameUI/constants/gameUIColors.js");var _jsxRuntime=require("react/jsx-runtime");const STORAGE_KEY=_devToolsStorageKeys.devToolsStorageKeys.bubble.settings();const USER_PREFERENCES_KEY=_devToolsStorageKeys.devToolsStorageKeys.bubble.userPreferences();const DEFAULT_SETTINGS={showEnvironment:true,showQueryButton:true,showWifiToggle:true,showEnvButton:false,showSentryButton:false,showStorageButton:false};function BubbleSettingsSection({onPress:t}){const[o,n]=(0,_react.useState)(DEFAULT_SETTINGS);(0,_react.useEffect)(()=>{s()},[]);const s=async()=>{try{const r=await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);if(r){n(JSON.parse(r))}}catch(r){console.error("[Buoy]","Failed to load bubble settings:",r)}};const a=()=>{return Object.values(o).filter(Boolean).length};return(0,_jsxRuntime.jsx)(_CyberpunkSectionButton.CyberpunkSectionButton,{id:"bubble-settings",title:"SETTINGS",subtitle:`${a()}/6 visible`,icon:_index.Settings,iconColor:"#10B981",iconBackgroundColor:"rgba(16, 185, 129, 0.1)",onPress:t||(()=>{}),index:5})}function BubbleSettingsDetail({onSettingsChange:t}){const[o,n]=(0,_react.useState)(DEFAULT_SETTINGS);const[s,a]=(0,_react.useState)(true);(0,_react.useEffect)(()=>{r()},[]);const r=async()=>{try{const e=await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);if(e){n(JSON.parse(e))}}catch(e){console.error("[Buoy]","Failed to load bubble settings:",e)}finally{a(false)}};const c=async e=>{try{await _persistentStorage.persistentStorage.setItem(STORAGE_KEY,JSON.stringify(e));n(e);t?.(e)}catch(l){console.error("[Buoy]","Failed to save bubble settings:",l)}};const d=async e=>{const l={...o,[e]:!o[e]};try{const i=await _persistentStorage.persistentStorage.getItem(USER_PREFERENCES_KEY);const u=i?JSON.parse(i):{};const b=e.replace("show","hasSet");const y={...u,[b]:true};await _persistentStorage.persistentStorage.setItem(USER_PREFERENCES_KEY,JSON.stringify(y))}catch(i){console.error("[Buoy]","Failed to save user preference marker:",i)}c(l)};if(s){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.detailContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.loadingText,children:"Loading settings..."})})}const g=[{key:"showEnvironment",label:"Environment Indicator",description:"Shows current environment (dev, staging, prod)",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#10B981"}]})},{key:"showQueryButton",label:"React Query Button",description:"Opens React Query dev tools",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#F59E0B"}]})},{key:"showWifiToggle",label:"WiFi",description:"Toggle WiFi for testing offline scenarios",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#8B5CF6"}]})},{key:"showEnvButton",label:"Environment Variables",description:"View and check environment variables",icon:(0,_jsxRuntime.jsx)(_index.Settings,{size:16,color:"#10B981"})},{key:"showSentryButton",label:"Sentry Events",description:"View captured Sentry events and errors",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#a855f7"}]})},{key:"showStorageButton",label:"Storage Browser",description:"Browse and inspect AsyncStorage data",icon:(0,_jsxRuntime.jsx)(_index.Database,{size:16,color:"#3B82F6"})}];return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.detailContainer,children:(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{showsVerticalScrollIndicator:false,contentContainerStyle:styles.scrollContent,"sentry-label":"ignore bubble settings scroll",children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:"Developer Tools Settings"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerDescription,children:"Configure bubble button visibility"})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionDivider,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:"Bubble Button Visibility"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.settingsList,children:g.map(e=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingItem,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.settingIconContainer,children:e.icon}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingDescription,children:e.description})]}),(0,_jsxRuntime.jsx)(_reactNative.Switch,{"sentry-label":"ignore bubble settings section",value:o[e.key],onValueChange:()=>d(e.key),trackColor:{false:"#4B5563",true:"#10B981"},thumbColor:o[e.key]?"#fff":_gameUIColors.buoyColors.textSecondary})]},e.key))}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.footer,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.noteContainer,children:[(0,_jsxRuntime.jsx)(_index.EyeOff,{size:16,color:_gameUIColors.buoyColors.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noteText,children:"User status indicator is always visible and cannot be disabled"})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.restartNote,children:"Changes are saved automatically and will persist across app restarts"})]})]})})}async function getBubbleVisibilitySettings(){try{const t=await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);if(t){return JSON.parse(t)}}catch(t){console.error("[Buoy]","Failed to load bubble settings:",t)}return DEFAULT_SETTINGS}const styles=_reactNative.StyleSheet.create({scrollContent:{flexGrow:1},sectionCard:{backgroundColor:_gameUIColors.buoyColors.input,borderRadius:8,padding:16,flexDirection:"row",alignItems:"center",marginBottom:12},iconContainer:{width:36,height:36,borderRadius:8,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",marginRight:12},textContainer:{flex:1},title:{color:_gameUIColors.buoyColors.text,fontSize:14,fontWeight:"600",marginBottom:2},subtitle:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12},chevron:{color:_macOSDesignSystemColors.macOSColors.text.icon,fontSize:20},detailContainer:{flex:1,backgroundColor:_gameUIColors.buoyColors.card},loadingText:{color:_gameUIColors.buoyColors.textSecondary,fontSize:14,textAlign:"center",marginTop:20},header:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.2)"},headerTitle:{color:_gameUIColors.buoyColors.text,fontSize:16,fontWeight:"600",marginBottom:4},headerDescription:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12},settingsList:{padding:16},settingItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.1)"},settingIconContainer:{width:32,height:32,justifyContent:"center",alignItems:"center",marginRight:12},settingContent:{flex:1,marginRight:12},settingLabel:{color:_gameUIColors.buoyColors.text,fontSize:14,fontWeight:"500",marginBottom:2},settingDescription:{color:_macOSDesignSystemColors.macOSColors.text.icon,fontSize:11},indicator:{width:8,height:8,borderRadius:4},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.2)"},noteContainer:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},noteText:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12,flex:1},restartNote:{color:_macOSDesignSystemColors.macOSColors.text.icon,fontSize:11,fontStyle:"italic"},sectionDivider:{paddingHorizontal:16,paddingVertical:8,marginTop:8,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.12)"},sectionTitle:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase"}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BubbleSettingsDetail=BubbleSettingsDetail;exports.BubbleSettingsSection=BubbleSettingsSection;exports.getBubbleVisibilitySettings=getBubbleVisibilitySettings;var _reactNative=require("react-native");var _index=require("../../icons/index.js");var _react=require("react");var _CyberpunkSectionButton=require("../../ui/console/CyberpunkSectionButton.js");var _devToolsStorageKeys=require("../../storage/devToolsStorageKeys.js");var _persistentStorage=require("../../utils/persistentStorage");var _macOSDesignSystemColors=require("../../ui/gameUI/constants/macOSDesignSystemColors.js");var _gameUIColors=require("../../ui/gameUI/constants/gameUIColors.js");var _jsxRuntime=require("react/jsx-runtime");const STORAGE_KEY=_devToolsStorageKeys.devToolsStorageKeys.bubble.settings();const USER_PREFERENCES_KEY=_devToolsStorageKeys.devToolsStorageKeys.bubble.userPreferences();const DEFAULT_SETTINGS={showEnvironment:true,showQueryButton:true,showWifiToggle:true,showEnvButton:false,showSentryButton:false,showStorageButton:false};function BubbleSettingsSection({onPress:t}){const[o,n]=(0,_react.useState)(DEFAULT_SETTINGS);(0,_react.useEffect)(()=>{i()},[]);const i=async()=>{try{const r=await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);if(r){n(JSON.parse(r))}}catch(r){console.error("[Buoy]","Failed to load bubble settings:",r)}};const a=()=>{return Object.values(o).filter(Boolean).length};return(0,_jsxRuntime.jsx)(_CyberpunkSectionButton.CyberpunkSectionButton,{id:"bubble-settings",title:"SETTINGS",subtitle:`${a()}/6 visible`,icon:_index.Settings,iconColor:"#10B981",iconBackgroundColor:"rgba(16, 185, 129, 0.1)",onPress:t||(()=>{}),index:5})}function BubbleSettingsDetail({onSettingsChange:t}){const[o,n]=(0,_react.useState)(DEFAULT_SETTINGS);const[i,a]=(0,_react.useState)(true);(0,_react.useEffect)(()=>{r()},[]);const r=async()=>{try{const e=await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);if(e){n(JSON.parse(e))}}catch(e){console.error("[Buoy]","Failed to load bubble settings:",e)}finally{a(false)}};const c=async e=>{try{await _persistentStorage.persistentStorage.setItem(STORAGE_KEY,JSON.stringify(e));n(e);t?.(e)}catch(l){console.error("[Buoy]","Failed to save bubble settings:",l)}};const d=async e=>{const l={...o,[e]:!o[e]};try{const s=await _persistentStorage.persistentStorage.getItem(USER_PREFERENCES_KEY);const u=s?JSON.parse(s):{};const b=e.replace("show","hasSet");const y={...u,[b]:true};await _persistentStorage.persistentStorage.setItem(USER_PREFERENCES_KEY,JSON.stringify(y))}catch(s){console.error("[Buoy]","Failed to save user preference marker:",s)}c(l)};if(i){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.detailContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.loadingText,children:"Loading settings..."})})}const g=[{key:"showEnvironment",label:"Environment Indicator",description:"Shows current environment (dev, staging, prod)",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#10B981"}]})},{key:"showQueryButton",label:"React Query Button",description:"Opens React Query dev tools",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#F59E0B"}]})},{key:"showWifiToggle",label:"WiFi",description:"Toggle WiFi for testing offline scenarios",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#8B5CF6"}]})},{key:"showEnvButton",label:"Environment Variables",description:"View and check environment variables",icon:(0,_jsxRuntime.jsx)(_index.Settings,{size:16,color:"#10B981"})},{key:"showSentryButton",label:"Sentry Events",description:"View captured Sentry events and errors",icon:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.indicator,{backgroundColor:"#a855f7"}]})},{key:"showStorageButton",label:"Storage Browser",description:"Browse and inspect AsyncStorage data",icon:(0,_jsxRuntime.jsx)(_index.Database,{size:16,color:"#3B82F6"})}];return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.detailContainer,children:(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,contentContainerStyle:styles.scrollContent,"sentry-label":"ignore bubble settings scroll",children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:"Developer Tools Settings"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerDescription,children:"Configure bubble button visibility"})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionDivider,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:"Bubble Button Visibility"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.settingsList,children:g.map(e=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingItem,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.settingIconContainer,children:e.icon}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingDescription,children:e.description})]}),(0,_jsxRuntime.jsx)(_reactNative.Switch,{"sentry-label":"ignore bubble settings section",value:o[e.key],onValueChange:()=>d(e.key),trackColor:{false:"#4B5563",true:"#10B981"},thumbColor:o[e.key]?"#fff":_gameUIColors.buoyColors.textSecondary})]},e.key))}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.footer,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.noteContainer,children:[(0,_jsxRuntime.jsx)(_index.EyeOff,{size:16,color:_gameUIColors.buoyColors.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noteText,children:"User status indicator is always visible and cannot be disabled"})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.restartNote,children:"Changes are saved automatically and will persist across app restarts"})]})]})})}async function getBubbleVisibilitySettings(){try{const t=await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);if(t){return JSON.parse(t)}}catch(t){console.error("[Buoy]","Failed to load bubble settings:",t)}return DEFAULT_SETTINGS}const styles=_reactNative.StyleSheet.create({scrollContent:{flexGrow:1},sectionCard:{backgroundColor:_gameUIColors.buoyColors.input,borderRadius:8,padding:16,flexDirection:"row",alignItems:"center",marginBottom:12},iconContainer:{width:36,height:36,borderRadius:8,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",marginRight:12},textContainer:{flex:1},title:{color:_gameUIColors.buoyColors.text,fontSize:14,fontWeight:"600",marginBottom:2},subtitle:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12},chevron:{color:_macOSDesignSystemColors.macOSColors.text.icon,fontSize:20},detailContainer:{flex:1,backgroundColor:_gameUIColors.buoyColors.card},loadingText:{color:_gameUIColors.buoyColors.textSecondary,fontSize:14,textAlign:"center",marginTop:20},header:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.2)"},headerTitle:{color:_gameUIColors.buoyColors.text,fontSize:16,fontWeight:"600",marginBottom:4},headerDescription:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12},settingsList:{padding:16},settingItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.1)"},settingIconContainer:{width:32,height:32,justifyContent:"center",alignItems:"center",marginRight:12},settingContent:{flex:1,marginRight:12},settingLabel:{color:_gameUIColors.buoyColors.text,fontSize:14,fontWeight:"500",marginBottom:2},settingDescription:{color:_macOSDesignSystemColors.macOSColors.text.icon,fontSize:11},indicator:{width:8,height:8,borderRadius:4},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.2)"},noteContainer:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},noteText:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12,flex:1},restartNote:{color:_macOSDesignSystemColors.macOSColors.text.icon,fontSize:11,fontStyle:"italic"},sectionDivider:{paddingHorizontal:16,paddingVertical:8,marginTop:8,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.12)"},sectionTitle:{color:_gameUIColors.buoyColors.textSecondary,fontSize:12,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase"}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ChipStrip=ChipStrip;exports.useChipTap=useChipTap;var _react=require("react");var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");const TAP_SLOP_PX=5;const SCROLL_SETTLE_MS=300;function useChipTap(){const[t,r]=(0,_react.useState)(false);const n=(0,_react.useRef)(0);const o=(0,_react.useRef)(0);const l=(0,_react.useCallback)(e=>{n.current=e.nativeEvent.pageX;o.current=e.nativeEvent.pageY},[]);const c=(0,_react.useCallback)(e=>{if(!e)return true;const i=Math.abs(e.nativeEvent.pageX-n.current);const u=Math.abs(e.nativeEvent.pageY-o.current);return!(i>TAP_SLOP_PX||u>TAP_SLOP_PX||t)},[t]);const a=(0,_react.useCallback)(()=>{setTimeout(()=>r(false),SCROLL_SETTLE_MS)},[]);const s=(0,_react.useCallback)(()=>r(true),[]);return{scrollProps:{onScrollBeginDrag:s,onScrollEndDrag:a,onMomentumScrollBegin:s,onMomentumScrollEnd:a},onTouchStart:l,isTap:c}}function ChipStrip({children:t,scrollProps:r,sentryLabel:n,style:o,contentStyle:l}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.container,o],children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{"sentry-label":n,horizontal:true,showsHorizontalScrollIndicator:false,style:styles.scrollView,contentContainerStyle:[styles.scrollContent,l],...r,children:t})})}const styles=_reactNative.StyleSheet.create({container:{flex:1,minWidth:0},scrollView:{flex:1},scrollContent:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:4,paddingVertical:4,flexGrow:1}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ChipStrip=ChipStrip;exports.useChipTap=useChipTap;var _react=require("react");var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");const TAP_SLOP_PX=5;const SCROLL_SETTLE_MS=300;function useChipTap(){const[t,r]=(0,_react.useState)(false);const n=(0,_react.useRef)(0);const o=(0,_react.useRef)(0);const a=(0,_react.useCallback)(e=>{n.current=e.nativeEvent.pageX;o.current=e.nativeEvent.pageY},[]);const c=(0,_react.useCallback)(e=>{if(!e)return true;const i=Math.abs(e.nativeEvent.pageX-n.current);const u=Math.abs(e.nativeEvent.pageY-o.current);return!(i>TAP_SLOP_PX||u>TAP_SLOP_PX||t)},[t]);const l=(0,_react.useCallback)(()=>{setTimeout(()=>r(false),SCROLL_SETTLE_MS)},[]);const s=(0,_react.useCallback)(()=>r(true),[]);return{scrollProps:{onScrollBeginDrag:s,onScrollEndDrag:l,onMomentumScrollBegin:s,onMomentumScrollEnd:l},onTouchStart:a,isTap:c}}function ChipStrip({children:t,scrollProps:r,sentryLabel:n,style:o,contentStyle:a}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.container,o],children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled","sentry-label":n,horizontal:true,showsHorizontalScrollIndicator:false,style:styles.scrollView,contentContainerStyle:[styles.scrollContent,a],...r,children:t})})}const styles=_reactNative.StyleSheet.create({container:{flex:1,minWidth:0},scrollView:{flex:1},scrollContent:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:4,paddingVertical:4,flexGrow:1}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DataInspector=DataInspector;var _react=require("react");var _reactNative=require("react-native");var _index=require("../../icons/index.js");var _index2=require("../gameUI/index.js");var _CopyButton=require("./CopyButton.js");var _fonts=require("../fonts.js");var _jsxRuntime=require("react/jsx-runtime");function DataInspector({data:i,mode:e="view",syntax:t="json",theme:n="dark",collapsible:o=true,searchable:s=true,onEdit:j,style:p,title:d}){const[l,C]=(0,_react.useState)("");const[r,c]=(0,_react.useState)(false);const[f,u]=(0,_react.useState)("");const g=()=>{if(t==="json"){try{return JSON.stringify(i,null,2)}catch{return String(i)}}return String(i)};const m=a=>{if(!l)return a;const I=a.split(new RegExp(`(${l})`,"gi"));return I.map((x,b)=>{if(x.toLowerCase()===l.toLowerCase()){return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.highlight,children:x},b)}return x})};const y=()=>{if(!r){u(g());c(true)}else{try{const a=t==="json"?JSON.parse(f):f;j?.(a);c(false)}catch(a){console.error("[Buoy]","Failed to parse edited data",a)}}};const w=()=>{c(false);u("")};const h=g();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.container,p],children:[(d||s||e==="edit")&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[d&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:d}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.controls,children:[s&&!r&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.searchContainer,children:[(0,_jsxRuntime.jsx)(_index.Search,{size:12,color:_index2.gameUIColors.secondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.searchInput,placeholder:"Search...",placeholderTextColor:_index2.gameUIColors.tertiary,value:l,onChangeText:C})]}),e==="edit"&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.editButton,onPress:r?y:()=>y(),children:r?(0,_jsxRuntime.jsx)(_index.Check,{size:14,color:_index2.gameUIColors.success}):(0,_jsxRuntime.jsx)(_index.Edit3,{size:14,color:_index2.gameUIColors.primary})}),r&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.cancelButton,onPress:w,children:(0,_jsxRuntime.jsx)(_index.X,{size:14,color:_index2.gameUIColors.error})}),!r&&(0,_jsxRuntime.jsx)(_CopyButton.CopyButton,{value:h,size:12})]})]}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.scrollView,horizontal:true,showsHorizontalScrollIndicator:false,children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{showsVerticalScrollIndicator:false,children:r?(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.editor,value:f,onChangeText:u,multiline:true,autoCapitalize:"none",autoCorrect:false}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.codeText,children:l?m(h):h})})})]})}DataInspector.Json=function i({data:e,searchable:t,style:n}){return(0,_jsxRuntime.jsx)(DataInspector,{data:e,syntax:"json",mode:"view",searchable:t,style:n})};DataInspector.Editable=function i({data:e,onSave:t,style:n}){return(0,_jsxRuntime.jsx)(DataInspector,{data:e,mode:"edit",onEdit:t,style:n})};DataInspector.Diff=function i({oldData:e,newData:t,style:n}){const[o,s]=(0,_react.useState)("diff");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:n,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffControls,children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.diffButton,o==="old"&&styles.diffButtonActive],onPress:()=>s("old"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffButtonText,children:"Old"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.diffButton,o==="new"&&styles.diffButtonActive],onPress:()=>s("new"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffButtonText,children:"New"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.diffButton,o==="diff"&&styles.diffButtonActive],onPress:()=>s("diff"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffButtonText,children:"Diff"})})]}),o==="old"&&(0,_jsxRuntime.jsx)(DataInspector,{data:e,searchable:false}),o==="new"&&(0,_jsxRuntime.jsx)(DataInspector,{data:t,searchable:false}),o==="diff"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffPane,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffPaneTitle,children:"Old"}),(0,_jsxRuntime.jsx)(DataInspector,{data:e,searchable:false})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffPane,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffPaneTitle,children:"New"}),(0,_jsxRuntime.jsx)(DataInspector,{data:t,searchable:false})]})]})]})};const styles=_reactNative.StyleSheet.create({container:{backgroundColor:_index2.gameUIColors.background,borderRadius:8,overflow:"hidden"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:8,borderBottomWidth:1,borderBottomColor:_index2.gameUIColors.border+"20"},title:{fontSize:12,fontWeight:"600",color:_index2.gameUIColors.text},controls:{flexDirection:"row",gap:8},searchContainer:{flexDirection:"row",alignItems:"center",backgroundColor:_index2.gameUIColors.panel,borderRadius:4,paddingHorizontal:8,gap:4},searchInput:{fontSize:11,color:_index2.gameUIColors.text,minWidth:100,paddingVertical:4},editButton:{padding:4,borderRadius:4,backgroundColor:_index2.gameUIColors.primary+"20"},cancelButton:{padding:4,borderRadius:4,backgroundColor:_index2.gameUIColors.error+"20"},scrollView:{maxHeight:300},codeText:{fontFamily:_fonts.monoFont,fontSize:11,color:_index2.gameUIColors.text,padding:12,lineHeight:16},editor:{fontFamily:_fonts.monoFont,fontSize:11,color:_index2.gameUIColors.text,padding:12,lineHeight:16,minHeight:200},highlight:{backgroundColor:_index2.gameUIColors.warning+"40",color:_index2.gameUIColors.text},diffControls:{flexDirection:"row",gap:8,padding:8},diffButton:{paddingHorizontal:12,paddingVertical:4,borderRadius:4,backgroundColor:_index2.gameUIColors.panel},diffButtonActive:{backgroundColor:_index2.gameUIColors.primary},diffButtonText:{fontSize:11,color:_index2.gameUIColors.text,fontWeight:"500"},diffContainer:{flexDirection:"row",gap:8},diffPane:{flex:1},diffPaneTitle:{fontSize:10,fontWeight:"600",color:_index2.gameUIColors.secondary,padding:8,textTransform:"uppercase"}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DataInspector=DataInspector;var _react=require("react");var _reactNative=require("react-native");var _index=require("../../icons/index.js");var _index2=require("../gameUI/index.js");var _CopyButton=require("./CopyButton.js");var _fonts=require("../fonts.js");var _jsxRuntime=require("react/jsx-runtime");function DataInspector({data:i,mode:e="view",syntax:t="json",theme:s="dark",collapsible:o=true,searchable:n=true,onEdit:j,style:p,title:d}){const[l,C]=(0,_react.useState)("");const[r,c]=(0,_react.useState)(false);const[f,u]=(0,_react.useState)("");const g=()=>{if(t==="json"){try{return JSON.stringify(i,null,2)}catch{return String(i)}}return String(i)};const m=a=>{if(!l)return a;const I=a.split(new RegExp(`(${l})`,"gi"));return I.map((x,b)=>{if(x.toLowerCase()===l.toLowerCase()){return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.highlight,children:x},b)}return x})};const y=()=>{if(!r){u(g());c(true)}else{try{const a=t==="json"?JSON.parse(f):f;j?.(a);c(false)}catch(a){console.error("[Buoy]","Failed to parse edited data",a)}}};const w=()=>{c(false);u("")};const h=g();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.container,p],children:[(d||n||e==="edit")&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[d&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:d}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.controls,children:[n&&!r&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.searchContainer,children:[(0,_jsxRuntime.jsx)(_index.Search,{size:12,color:_index2.gameUIColors.secondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.searchInput,placeholder:"Search...",placeholderTextColor:_index2.gameUIColors.tertiary,value:l,onChangeText:C})]}),e==="edit"&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.editButton,onPress:r?y:()=>y(),children:r?(0,_jsxRuntime.jsx)(_index.Check,{size:14,color:_index2.gameUIColors.success}):(0,_jsxRuntime.jsx)(_index.Edit3,{size:14,color:_index2.gameUIColors.primary})}),r&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.cancelButton,onPress:w,children:(0,_jsxRuntime.jsx)(_index.X,{size:14,color:_index2.gameUIColors.error})}),!r&&(0,_jsxRuntime.jsx)(_CopyButton.CopyButton,{value:h,size:12})]})]}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.scrollView,horizontal:true,showsHorizontalScrollIndicator:false,children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,children:r?(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.editor,value:f,onChangeText:u,multiline:true,autoCapitalize:"none",autoCorrect:false}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.codeText,children:l?m(h):h})})})]})}DataInspector.Json=function i({data:e,searchable:t,style:s}){return(0,_jsxRuntime.jsx)(DataInspector,{data:e,syntax:"json",mode:"view",searchable:t,style:s})};DataInspector.Editable=function i({data:e,onSave:t,style:s}){return(0,_jsxRuntime.jsx)(DataInspector,{data:e,mode:"edit",onEdit:t,style:s})};DataInspector.Diff=function i({oldData:e,newData:t,style:s}){const[o,n]=(0,_react.useState)("diff");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:s,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffControls,children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.diffButton,o==="old"&&styles.diffButtonActive],onPress:()=>n("old"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffButtonText,children:"Old"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.diffButton,o==="new"&&styles.diffButtonActive],onPress:()=>n("new"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffButtonText,children:"New"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.diffButton,o==="diff"&&styles.diffButtonActive],onPress:()=>n("diff"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffButtonText,children:"Diff"})})]}),o==="old"&&(0,_jsxRuntime.jsx)(DataInspector,{data:e,searchable:false}),o==="new"&&(0,_jsxRuntime.jsx)(DataInspector,{data:t,searchable:false}),o==="diff"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffPane,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffPaneTitle,children:"Old"}),(0,_jsxRuntime.jsx)(DataInspector,{data:e,searchable:false})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffPane,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffPaneTitle,children:"New"}),(0,_jsxRuntime.jsx)(DataInspector,{data:t,searchable:false})]})]})]})};const styles=_reactNative.StyleSheet.create({container:{backgroundColor:_index2.gameUIColors.background,borderRadius:8,overflow:"hidden"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:8,borderBottomWidth:1,borderBottomColor:_index2.gameUIColors.border+"20"},title:{fontSize:12,fontWeight:"600",color:_index2.gameUIColors.text},controls:{flexDirection:"row",gap:8},searchContainer:{flexDirection:"row",alignItems:"center",backgroundColor:_index2.gameUIColors.panel,borderRadius:4,paddingHorizontal:8,gap:4},searchInput:{fontSize:11,color:_index2.gameUIColors.text,minWidth:100,paddingVertical:4},editButton:{padding:4,borderRadius:4,backgroundColor:_index2.gameUIColors.primary+"20"},cancelButton:{padding:4,borderRadius:4,backgroundColor:_index2.gameUIColors.error+"20"},scrollView:{maxHeight:300},codeText:{fontFamily:_fonts.monoFont,fontSize:11,color:_index2.gameUIColors.text,padding:12,lineHeight:16},editor:{fontFamily:_fonts.monoFont,fontSize:11,color:_index2.gameUIColors.text,padding:12,lineHeight:16,minHeight:200},highlight:{backgroundColor:_index2.gameUIColors.warning+"40",color:_index2.gameUIColors.text},diffControls:{flexDirection:"row",gap:8,padding:8},diffButton:{paddingHorizontal:12,paddingVertical:4,borderRadius:4,backgroundColor:_index2.gameUIColors.panel},diffButtonActive:{backgroundColor:_index2.gameUIColors.primary},diffButtonText:{fontSize:11,color:_index2.gameUIColors.text,fontWeight:"500"},diffContainer:{flexDirection:"row",gap:8},diffPane:{flex:1},diffPaneTitle:{fontSize:10,fontWeight:"600",color:_index2.gameUIColors.secondary,padding:8,textTransform:"uppercase"}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DetailView=DetailView;var _react=require("react");var _reactNative=require("react-native");var _index=require("../gameUI/index.js");var _ModalHeader=require("./ModalHeader.js");var _CopyButton=require("./CopyButton.js");var _fonts=require("../fonts.js");var _jsxRuntime=require("react/jsx-runtime");function DetailView({children:n,style:t}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.container,t],children:n})}DetailView.Header=function n({title:t,subtitle:e,onClose:o,onBack:i,actions:r}){return(0,_jsxRuntime.jsxs)(_ModalHeader.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_ModalHeader.ModalHeader.Navigation,{onBack:i,onClose:o}),(0,_jsxRuntime.jsx)(_ModalHeader.ModalHeader.Content,{title:t,subtitle:e}),r&&(0,_jsxRuntime.jsx)(_ModalHeader.ModalHeader.Actions,{children:r})]})};DetailView.Section=function n({title:t,icon:e,children:o,defaultOpen:i=true,collapsible:r=true,style:l,badge:s}){const[a,c]=(0,_react.useState)(i);if(!r){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.section,l],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[e&&(0,_jsxRuntime.jsx)(e,{size:14,color:_index.gameUIColors.primary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:t}),s!==void 0&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionBadgeText,children:s})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionContent,children:o})]})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.section,l],children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.sectionHeaderTouchable,onPress:()=>c(!a),children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[e&&(0,_jsxRuntime.jsx)(e,{size:14,color:_index.gameUIColors.primary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:t}),s!==void 0&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionBadgeText,children:s})})]})}),a&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionContent,children:o})]})};DetailView.Row=function n({label:t,value:e,copyable:o=false,style:i,labelStyle:r,valueStyle:l}){const s=typeof e==="string"||typeof e==="number"?String(e):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.row,i],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.rowLabel,r],children:t}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowValueContainer,children:[typeof e==="string"||typeof e==="number"?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.rowValue,l],numberOfLines:1,children:e}):e,o&&s&&(0,_jsxRuntime.jsx)(_CopyButton.CopyButton,{value:s,size:12})]})]})};DetailView.DataSection=function n({title:t,data:e,icon:o,defaultOpen:i=false,style:r}){return(0,_jsxRuntime.jsx)(DetailView.Section,{title:t,icon:o,defaultOpen:i,style:r,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContainer,children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataText,children:JSON.stringify(e,null,2)})})})})};DetailView.StatusBar=function n({status:t,message:e,style:o}){const i={success:_index.gameUIColors.success,error:_index.gameUIColors.error,warning:_index.gameUIColors.warning,pending:_index.gameUIColors.warning,info:_index.gameUIColors.primary};const r=i[t];return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.statusBar,{backgroundColor:r+"20",borderColor:r+"40"},o],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusDot,{backgroundColor:r}]}),e&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusMessage,{color:r}],children:e})]})};DetailView.Timeline=function n({items:t,style:e}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timeline,e],children:t.map((o,i)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineItem,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineDot}),i<t.length-1&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineLine}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineLabel,children:o.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineValue,children:o.value})]})]},i))})};DetailView.Content=function n({children:t,scrollable:e=true,style:o}){if(e){return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:[styles.content,o],children:t})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.content,o],children:t})};const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:_index.gameUIColors.background},content:{flex:1,padding:16},section:{marginBottom:16,backgroundColor:_index.gameUIColors.panel,borderRadius:8,overflow:"hidden"},sectionHeader:{flexDirection:"row",alignItems:"center",padding:12,gap:8},sectionHeaderTouchable:{},sectionTitle:{flex:1,fontSize:14,fontWeight:"600",color:_index.gameUIColors.text},sectionBadge:{backgroundColor:_index.gameUIColors.primary+"20",paddingHorizontal:8,paddingVertical:2,borderRadius:4},sectionBadgeText:{fontSize:11,fontWeight:"600",color:_index.gameUIColors.primary},sectionContent:{padding:12,paddingTop:0},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:_index.gameUIColors.border+"20"},rowLabel:{flex:1,fontSize:13,color:_index.gameUIColors.secondary},rowValueContainer:{flexDirection:"row",alignItems:"center",flex:2,gap:8},rowValue:{flex:1,fontSize:13,color:_index.gameUIColors.text,textAlign:"right"},dataContainer:{backgroundColor:_index.gameUIColors.background,borderRadius:6,padding:12},dataText:{fontSize:12,fontFamily:_fonts.monoFont,color:_index.gameUIColors.text},statusBar:{flexDirection:"row",alignItems:"center",padding:12,borderWidth:1,borderRadius:8,gap:8,marginVertical:8},statusDot:{width:8,height:8,borderRadius:4},statusMessage:{fontSize:13,fontWeight:"500"},timeline:{paddingVertical:8},timelineItem:{flexDirection:"row",position:"relative"},timelineDot:{width:8,height:8,borderRadius:4,backgroundColor:_index.gameUIColors.primary,marginTop:4,marginRight:12},timelineLine:{position:"absolute",left:3.5,top:12,bottom:-4,width:1,backgroundColor:_index.gameUIColors.border+"40"},timelineContent:{flex:1,marginBottom:12},timelineLabel:{fontSize:12,color:_index.gameUIColors.secondary,marginBottom:2},timelineValue:{fontSize:13,color:_index.gameUIColors.text}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DetailView=DetailView;var _react=require("react");var _reactNative=require("react-native");var _index=require("../gameUI/index.js");var _ModalHeader=require("./ModalHeader.js");var _CopyButton=require("./CopyButton.js");var _fonts=require("../fonts.js");var _jsxRuntime=require("react/jsx-runtime");function DetailView({children:n,style:t}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.container,t],children:n})}DetailView.Header=function n({title:t,subtitle:e,onClose:o,onBack:i,actions:r}){return(0,_jsxRuntime.jsxs)(_ModalHeader.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_ModalHeader.ModalHeader.Navigation,{onBack:i,onClose:o}),(0,_jsxRuntime.jsx)(_ModalHeader.ModalHeader.Content,{title:t,subtitle:e}),r&&(0,_jsxRuntime.jsx)(_ModalHeader.ModalHeader.Actions,{children:r})]})};DetailView.Section=function n({title:t,icon:e,children:o,defaultOpen:i=true,collapsible:r=true,style:l,badge:s}){const[a,c]=(0,_react.useState)(i);if(!r){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.section,l],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[e&&(0,_jsxRuntime.jsx)(e,{size:14,color:_index.gameUIColors.primary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:t}),s!==void 0&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionBadgeText,children:s})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionContent,children:o})]})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.section,l],children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.sectionHeaderTouchable,onPress:()=>c(!a),children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[e&&(0,_jsxRuntime.jsx)(e,{size:14,color:_index.gameUIColors.primary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:t}),s!==void 0&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionBadgeText,children:s})})]})}),a&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionContent,children:o})]})};DetailView.Row=function n({label:t,value:e,copyable:o=false,style:i,labelStyle:r,valueStyle:l}){const s=typeof e==="string"||typeof e==="number"?String(e):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.row,i],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.rowLabel,r],children:t}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowValueContainer,children:[typeof e==="string"||typeof e==="number"?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.rowValue,l],numberOfLines:1,children:e}):e,o&&s&&(0,_jsxRuntime.jsx)(_CopyButton.CopyButton,{value:s,size:12})]})]})};DetailView.DataSection=function n({title:t,data:e,icon:o,defaultOpen:i=false,style:r}){return(0,_jsxRuntime.jsx)(DetailView.Section,{title:t,icon:o,defaultOpen:i,style:r,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContainer,children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataText,children:JSON.stringify(e,null,2)})})})})};DetailView.StatusBar=function n({status:t,message:e,style:o}){const i={success:_index.gameUIColors.success,error:_index.gameUIColors.error,warning:_index.gameUIColors.warning,pending:_index.gameUIColors.warning,info:_index.gameUIColors.primary};const r=i[t];return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.statusBar,{backgroundColor:r+"20",borderColor:r+"40"},o],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusDot,{backgroundColor:r}]}),e&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusMessage,{color:r}],children:e})]})};DetailView.Timeline=function n({items:t,style:e}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timeline,e],children:t.map((o,i)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineItem,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineDot}),i<t.length-1&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineLine}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineLabel,children:o.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineValue,children:o.value})]})]},i))})};DetailView.Content=function n({children:t,scrollable:e=true,style:o}){if(e){return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:[styles.content,o],children:t})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.content,o],children:t})};const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:_index.gameUIColors.background},content:{flex:1,padding:16},section:{marginBottom:16,backgroundColor:_index.gameUIColors.panel,borderRadius:8,overflow:"hidden"},sectionHeader:{flexDirection:"row",alignItems:"center",padding:12,gap:8},sectionHeaderTouchable:{},sectionTitle:{flex:1,fontSize:14,fontWeight:"600",color:_index.gameUIColors.text},sectionBadge:{backgroundColor:_index.gameUIColors.primary+"20",paddingHorizontal:8,paddingVertical:2,borderRadius:4},sectionBadgeText:{fontSize:11,fontWeight:"600",color:_index.gameUIColors.primary},sectionContent:{padding:12,paddingTop:0},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:_index.gameUIColors.border+"20"},rowLabel:{flex:1,fontSize:13,color:_index.gameUIColors.secondary},rowValueContainer:{flexDirection:"row",alignItems:"center",flex:2,gap:8},rowValue:{flex:1,fontSize:13,color:_index.gameUIColors.text,textAlign:"right"},dataContainer:{backgroundColor:_index.gameUIColors.background,borderRadius:6,padding:12},dataText:{fontSize:12,fontFamily:_fonts.monoFont,color:_index.gameUIColors.text},statusBar:{flexDirection:"row",alignItems:"center",padding:12,borderWidth:1,borderRadius:8,gap:8,marginVertical:8},statusDot:{width:8,height:8,borderRadius:4},statusMessage:{fontSize:13,fontWeight:"500"},timeline:{paddingVertical:8},timelineItem:{flexDirection:"row",position:"relative"},timelineDot:{width:8,height:8,borderRadius:4,backgroundColor:_index.gameUIColors.primary,marginTop:4,marginRight:12},timelineLine:{position:"absolute",left:3.5,top:12,bottom:-4,width:1,backgroundColor:_index.gameUIColors.border+"40"},timelineContent:{flex:1,marginBottom:12},timelineLabel:{fontSize:12,color:_index.gameUIColors.secondary,marginBottom:2},timelineValue:{fontSize:13,color:_index.gameUIColors.text}});