posthog-react-native 4.74.1 → 4.74.2

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 (126) hide show
  1. package/dist/PostHogContext.js +2 -1
  2. package/dist/PostHogContext.js.map +1 -1
  3. package/dist/PostHogErrorBoundary.js +2 -1
  4. package/dist/PostHogErrorBoundary.js.map +1 -1
  5. package/dist/PostHogMaskView.js +2 -1
  6. package/dist/PostHogMaskView.js.map +1 -1
  7. package/dist/PostHogProvider.js +2 -1
  8. package/dist/PostHogProvider.js.map +1 -1
  9. package/dist/autocapture.js +2 -1
  10. package/dist/autocapture.js.map +1 -1
  11. package/dist/error-tracking/exception-context.js +2 -1
  12. package/dist/error-tracking/exception-context.js.map +1 -1
  13. package/dist/error-tracking/index.js +2 -1
  14. package/dist/error-tracking/index.js.map +1 -1
  15. package/dist/error-tracking/utils.js +2 -1
  16. package/dist/error-tracking/utils.js.map +1 -1
  17. package/dist/frameworks/wix-navigation.js +2 -1
  18. package/dist/frameworks/wix-navigation.js.map +1 -1
  19. package/dist/hooks/useFeatureFlag.js +2 -1
  20. package/dist/hooks/useFeatureFlag.js.map +1 -1
  21. package/dist/hooks/useFeatureFlagResult.js +2 -1
  22. package/dist/hooks/useFeatureFlagResult.js.map +1 -1
  23. package/dist/hooks/useFeatureFlags.js +2 -1
  24. package/dist/hooks/useFeatureFlags.js.map +1 -1
  25. package/dist/hooks/useNavigationTracker.js +2 -1
  26. package/dist/hooks/useNavigationTracker.js.map +1 -1
  27. package/dist/hooks/usePostHog.js +2 -1
  28. package/dist/hooks/usePostHog.js.map +1 -1
  29. package/dist/hooks/utils.js +2 -1
  30. package/dist/hooks/utils.js.map +1 -1
  31. package/dist/index.js +2 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/logs-defaults.js +2 -1
  34. package/dist/logs-defaults.js.map +1 -1
  35. package/dist/native-deps.js +2 -1
  36. package/dist/native-deps.js.map +1 -1
  37. package/dist/optional/OptionalAsyncStorage.js +2 -1
  38. package/dist/optional/OptionalAsyncStorage.js.map +1 -1
  39. package/dist/optional/OptionalExpoApplication.js +2 -1
  40. package/dist/optional/OptionalExpoApplication.js.map +1 -1
  41. package/dist/optional/OptionalExpoDevice.js +2 -1
  42. package/dist/optional/OptionalExpoDevice.js.map +1 -1
  43. package/dist/optional/OptionalExpoFileSystem.js +2 -1
  44. package/dist/optional/OptionalExpoFileSystem.js.map +1 -1
  45. package/dist/optional/OptionalExpoFileSystemLegacy.js +2 -1
  46. package/dist/optional/OptionalExpoFileSystemLegacy.js.map +1 -1
  47. package/dist/optional/OptionalExpoLocalization.js +2 -1
  48. package/dist/optional/OptionalExpoLocalization.js.map +1 -1
  49. package/dist/optional/OptionalExpoUpdates.js +2 -1
  50. package/dist/optional/OptionalExpoUpdates.js.map +1 -1
  51. package/dist/optional/OptionalPlugin.js +2 -1
  52. package/dist/optional/OptionalPlugin.js.map +1 -1
  53. package/dist/optional/OptionalReactNativeDeviceInfo.js +2 -1
  54. package/dist/optional/OptionalReactNativeDeviceInfo.js.map +1 -1
  55. package/dist/optional/OptionalReactNativeLocalize.js +2 -1
  56. package/dist/optional/OptionalReactNativeLocalize.js.map +1 -1
  57. package/dist/optional/OptionalReactNativeNavigation.js +2 -1
  58. package/dist/optional/OptionalReactNativeNavigation.js.map +1 -1
  59. package/dist/optional/OptionalReactNativeNavigationWix.js +2 -1
  60. package/dist/optional/OptionalReactNativeNavigationWix.js.map +1 -1
  61. package/dist/optional/OptionalReactNativeSafeArea.js +2 -1
  62. package/dist/optional/OptionalReactNativeSafeArea.js.map +1 -1
  63. package/dist/optional/OptionalReactNativeSvg.js +2 -1
  64. package/dist/optional/OptionalReactNativeSvg.js.map +1 -1
  65. package/dist/posthog-rn.js +2 -1
  66. package/dist/posthog-rn.js.map +1 -1
  67. package/dist/storage.js +2 -1
  68. package/dist/storage.js.map +1 -1
  69. package/dist/surveys/PostHogSurveyProvider.js +2 -1
  70. package/dist/surveys/PostHogSurveyProvider.js.map +1 -1
  71. package/dist/surveys/components/BottomSection.js +2 -1
  72. package/dist/surveys/components/BottomSection.js.map +1 -1
  73. package/dist/surveys/components/Cancel.js +2 -1
  74. package/dist/surveys/components/Cancel.js.map +1 -1
  75. package/dist/surveys/components/ConfirmationMessage.js +2 -1
  76. package/dist/surveys/components/ConfirmationMessage.js.map +1 -1
  77. package/dist/surveys/components/IntroMessage.js +2 -1
  78. package/dist/surveys/components/IntroMessage.js.map +1 -1
  79. package/dist/surveys/components/QuestionHeader.js +2 -1
  80. package/dist/surveys/components/QuestionHeader.js.map +1 -1
  81. package/dist/surveys/components/QuestionTypes.js +2 -1
  82. package/dist/surveys/components/QuestionTypes.js.map +1 -1
  83. package/dist/surveys/components/SurveyModal.js +2 -1
  84. package/dist/surveys/components/SurveyModal.js.map +1 -1
  85. package/dist/surveys/components/Surveys.js +2 -1
  86. package/dist/surveys/components/Surveys.js.map +1 -1
  87. package/dist/surveys/getActiveMatchingSurveys.js +2 -1
  88. package/dist/surveys/getActiveMatchingSurveys.js.map +1 -1
  89. package/dist/surveys/icons.js +2 -1
  90. package/dist/surveys/icons.js.map +1 -1
  91. package/dist/surveys/index.js +2 -1
  92. package/dist/surveys/index.js.map +1 -1
  93. package/dist/surveys/safeStyleSheet.js +2 -1
  94. package/dist/surveys/safeStyleSheet.js.map +1 -1
  95. package/dist/surveys/survey-shuffling.js +2 -1
  96. package/dist/surveys/survey-shuffling.js.map +1 -1
  97. package/dist/surveys/survey-translations.js +2 -1
  98. package/dist/surveys/survey-translations.js.map +1 -1
  99. package/dist/surveys/surveys-utils.js +2 -1
  100. package/dist/surveys/surveys-utils.js.map +1 -1
  101. package/dist/surveys/useActivatedSurveys.js +2 -1
  102. package/dist/surveys/useActivatedSurveys.js.map +1 -1
  103. package/dist/surveys/useSurveyStorage.js +2 -1
  104. package/dist/surveys/useSurveyStorage.js.map +1 -1
  105. package/dist/tooling/expoconfig.js +2 -1
  106. package/dist/tooling/expoconfig.js.map +1 -1
  107. package/dist/tooling/metroconfig.js +2 -1
  108. package/dist/tooling/metroconfig.js.map +1 -1
  109. package/dist/tooling/posthogMetroSerializer.js +2 -1
  110. package/dist/tooling/posthogMetroSerializer.js.map +1 -1
  111. package/dist/tooling/utils.js +2 -1
  112. package/dist/tooling/utils.js.map +1 -1
  113. package/dist/tooling/vendor/expo/expoconfig.js +2 -1
  114. package/dist/tooling/vendor/expo/expoconfig.js.map +1 -1
  115. package/dist/tooling/vendor/metro/countLines.js +2 -1
  116. package/dist/tooling/vendor/metro/countLines.js.map +1 -1
  117. package/dist/tooling/vendor/metro/utils.js +2 -1
  118. package/dist/tooling/vendor/metro/utils.js.map +1 -1
  119. package/dist/types.js +2 -1
  120. package/dist/types.js.map +1 -1
  121. package/dist/utils.js +2 -1
  122. package/dist/utils.js.map +1 -1
  123. package/dist/version.d.ts +1 -1
  124. package/dist/version.js +2 -1
  125. package/dist/version.js.map +1 -1
  126. package/package.json +7 -6
package/dist/storage.js CHANGED
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogRNSyncMemoryStorage=exports.PostHogRNStorage=void 0;exports.createEventsMemoryStorage=createEventsMemoryStorage;exports.createEventsStorage=createEventsStorage;exports.createLogsMemoryStorage=createLogsMemoryStorage;exports.createLogsStorage=createLogsStorage;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _core=require("@posthog/core");function _callSuper(t,o,e){return o=(0,_getPrototypeOf2["default"])(o),(0,_possibleConstructorReturn2["default"])(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2["default"])(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var EVENTS_STORAGE_FILE='.posthog-rn.json';var LOGS_STORAGE_FILE='.posthog-rn-logs.json';var POSTHOG_STORAGE_VERSION='v1';var PERSIST_DEBOUNCE_MS=100;var PostHogRNStorage=exports.PostHogRNStorage=function(){function PostHogRNStorage(storage,storageKey){var _this=this;(0,_classCallCheck2["default"])(this,PostHogRNStorage);var _a;this.memoryCache={};this._pendingPromises=new Set();this.storage=storage;this._storageKey=storageKey;var preloadResult=this.storage.getItem(this._storageKey);if((0,_core.isPromise)(preloadResult)){this.preloadPromise=preloadResult.then(function(res){_this.populateMemoryCache(res);});(_a=this.preloadPromise)===null||_a===void 0?void 0:_a["finally"](function(){_this.preloadPromise=undefined;});}else{this.populateMemoryCache(preloadResult);}}return(0,_createClass2["default"])(PostHogRNStorage,[{key:"waitForPersist",value:(function(){var _waitForPersist=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:this._drainScheduledPersist();if(!(this._pendingPromises.size>0)){_context.next=1;break;}_context.next=1;return Promise.all(this._pendingPromises);case 1:case"end":return _context.stop();}},_callee,this);}));function waitForPersist(){return _waitForPersist.apply(this,arguments);}return waitForPersist;}())},{key:"persist",value:function persist(){var _this2=this;var payload={version:POSTHOG_STORAGE_VERSION,content:this.memoryCache};var result=this.storage.setItem(this._storageKey,JSON.stringify(payload));if((0,_core.isPromise)(result)){var promise=result["catch"](function(err){console.warn('PostHog storage persist failed:',err);})["finally"](function(){_this2._pendingPromises["delete"](promise);});this._pendingPromises.add(promise);}}},{key:"schedulePersist",value:function schedulePersist(){var _this3=this;if(this._persistTimer!==undefined){return;}this._persistTimer=(0,_core.safeSetTimeout)(function(){_this3._persistTimer=undefined;try{_this3.persist();}catch(err){console.warn('PostHog storage scheduled persist threw:',err);}},PERSIST_DEBOUNCE_MS);}},{key:"_drainScheduledPersist",value:function _drainScheduledPersist(){if(this._persistTimer===undefined){return;}clearTimeout(this._persistTimer);this._persistTimer=undefined;try{this.persist();}catch(err){console.warn('PostHog storage drain persist threw:',err);}}},{key:"getItem",value:function getItem(key){return this.memoryCache[key];}},{key:"setItem",value:function setItem(key,value){this.memoryCache[key]=value;this.schedulePersist();}},{key:"removeItem",value:function removeItem(key){delete this.memoryCache[key];this.schedulePersist();}},{key:"clear",value:function clear(){for(var key in this.memoryCache){delete this.memoryCache[key];}this.schedulePersist();}},{key:"getAllKeys",value:function getAllKeys(){return Object.keys(this.memoryCache);}},{key:"populateMemoryCache",value:function populateMemoryCache(res){try{var data=res?JSON.parse(res).content:{};for(var key in data){this.memoryCache[key]=data[key];}}catch(e){console.warn("PostHog failed to load persisted data from storage. This is likely because the storage format is. We'll reset the storage.",e);}}}]);}();var PostHogRNSyncMemoryStorage=exports.PostHogRNSyncMemoryStorage=function(_PostHogRNStorage){function PostHogRNSyncMemoryStorage(storageKey){(0,_classCallCheck2["default"])(this,PostHogRNSyncMemoryStorage);var cache={};var storage={getItem:function getItem(key){return cache[key];},setItem:function setItem(key,value){cache[key]=value;}};return _callSuper(this,PostHogRNSyncMemoryStorage,[storage,storageKey]);}(0,_inherits2["default"])(PostHogRNSyncMemoryStorage,_PostHogRNStorage);return(0,_createClass2["default"])(PostHogRNSyncMemoryStorage);}(PostHogRNStorage);function createEventsStorage(customStorage){return new PostHogRNStorage(customStorage,EVENTS_STORAGE_FILE);}function createLogsStorage(customStorage){return new PostHogRNStorage(customStorage,LOGS_STORAGE_FILE);}function createEventsMemoryStorage(){return new PostHogRNSyncMemoryStorage(EVENTS_STORAGE_FILE);}function createLogsMemoryStorage(){return new PostHogRNSyncMemoryStorage(LOGS_STORAGE_FILE);}
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogRNSyncMemoryStorage=exports.PostHogRNStorage=void 0;exports.createEventsMemoryStorage=createEventsMemoryStorage;exports.createEventsStorage=createEventsStorage;exports.createLogsMemoryStorage=createLogsMemoryStorage;exports.createLogsStorage=createLogsStorage;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _core=require("@posthog/core");function _callSuper(t,o,e){return o=(0,_getPrototypeOf2["default"])(o),(0,_possibleConstructorReturn2["default"])(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2["default"])(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var EVENTS_STORAGE_FILE='.posthog-rn.json';var LOGS_STORAGE_FILE='.posthog-rn-logs.json';var POSTHOG_STORAGE_VERSION='v1';var PERSIST_DEBOUNCE_MS=100;var PostHogRNStorage=exports.PostHogRNStorage=function(){function PostHogRNStorage(storage,storageKey){var _this=this;(0,_classCallCheck2["default"])(this,PostHogRNStorage);var _a;this.memoryCache={};this._pendingPromises=new Set();this.storage=storage;this._storageKey=storageKey;var preloadResult=this.storage.getItem(this._storageKey);if((0,_core.isPromise)(preloadResult)){this.preloadPromise=preloadResult.then(function(res){_this.populateMemoryCache(res);});(_a=this.preloadPromise)===null||_a===void 0?void 0:_a["finally"](function(){_this.preloadPromise=undefined;});}else{this.populateMemoryCache(preloadResult);}}return(0,_createClass2["default"])(PostHogRNStorage,[{key:"waitForPersist",value:(function(){var _waitForPersist=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:this._drainScheduledPersist();if(!(this._pendingPromises.size>0)){_context.next=1;break;}_context.next=1;return Promise.all(this._pendingPromises);case 1:case"end":return _context.stop();}},_callee,this);}));function waitForPersist(){return _waitForPersist.apply(this,arguments);}return waitForPersist;}())},{key:"persist",value:function persist(){var _this2=this;var payload={version:POSTHOG_STORAGE_VERSION,content:this.memoryCache};var result=this.storage.setItem(this._storageKey,JSON.stringify(payload));if((0,_core.isPromise)(result)){var promise=result["catch"](function(err){console.warn('PostHog storage persist failed:',err);})["finally"](function(){_this2._pendingPromises["delete"](promise);});this._pendingPromises.add(promise);}}},{key:"schedulePersist",value:function schedulePersist(){var _this3=this;if(this._persistTimer!==undefined){return;}this._persistTimer=(0,_core.safeSetTimeout)(function(){_this3._persistTimer=undefined;try{_this3.persist();}catch(err){console.warn('PostHog storage scheduled persist threw:',err);}},PERSIST_DEBOUNCE_MS);}},{key:"_drainScheduledPersist",value:function _drainScheduledPersist(){if(this._persistTimer===undefined){return;}clearTimeout(this._persistTimer);this._persistTimer=undefined;try{this.persist();}catch(err){console.warn('PostHog storage drain persist threw:',err);}}},{key:"getItem",value:function getItem(key){return this.memoryCache[key];}},{key:"setItem",value:function setItem(key,value){this.memoryCache[key]=value;this.schedulePersist();}},{key:"removeItem",value:function removeItem(key){delete this.memoryCache[key];this.schedulePersist();}},{key:"clear",value:function clear(){for(var key in this.memoryCache){delete this.memoryCache[key];}this.schedulePersist();}},{key:"getAllKeys",value:function getAllKeys(){return Object.keys(this.memoryCache);}},{key:"populateMemoryCache",value:function populateMemoryCache(res){try{var data=res?JSON.parse(res).content:{};for(var key in data){this.memoryCache[key]=data[key];}}catch(e){console.warn("PostHog failed to load persisted data from storage. This is likely because the storage format is. We'll reset the storage.",e);}}}]);}();var PostHogRNSyncMemoryStorage=exports.PostHogRNSyncMemoryStorage=function(_PostHogRNStorage){function PostHogRNSyncMemoryStorage(storageKey){(0,_classCallCheck2["default"])(this,PostHogRNSyncMemoryStorage);var cache={};var storage={getItem:function getItem(key){return cache[key];},setItem:function setItem(key,value){cache[key]=value;}};return _callSuper(this,PostHogRNSyncMemoryStorage,[storage,storageKey]);}(0,_inherits2["default"])(PostHogRNSyncMemoryStorage,_PostHogRNStorage);return(0,_createClass2["default"])(PostHogRNSyncMemoryStorage);}(PostHogRNStorage);function createEventsStorage(customStorage){return new PostHogRNStorage(customStorage,EVENTS_STORAGE_FILE);}function createLogsStorage(customStorage){return new PostHogRNStorage(customStorage,LOGS_STORAGE_FILE);}function createEventsMemoryStorage(){return new PostHogRNSyncMemoryStorage(EVENTS_STORAGE_FILE);}function createLogsMemoryStorage(){return new PostHogRNSyncMemoryStorage(LOGS_STORAGE_FILE);}
2
+ //# sourceMappingURL=storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGzD,yEAAyE;AACzE,4EAA4E;AAC5E,wCAAwC;AACxC,MAAM,mBAAmB,GAAG,kBAAkB,CAAA;AAC9C,MAAM,iBAAiB,GAAG,uBAAuB,CAAA;AACjD,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAEpC,wEAAwE;AACxE,+EAA+E;AAC/E,0EAA0E;AAC1E,uEAAuE;AACvE,yEAAyE;AACzE,8EAA8E;AAC9E,mEAAmE;AACnE,EAAE;AACF,gFAAgF;AAChF,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,gF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AAY,UAAkB;QAC5B,MAAM,KAAK,GAAuC,EAAE,CAAA;QACpD,MAAM,OAAO,GAAG;YACd,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;YACpC,OAAO,EAAE,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE;gBACtC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;YACpB,CAAC;SACF,CAAA;QAED,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAC5B,CAAC;CACF;AAED,+EAA+E;AAC/E,2EAA2E;AAC3E,6CAA6C;AAC7C,MAAM,UAAU,mBAAmB,CAAC,aAAmC;IACrE,OAAO,IAAI,gBAAgB,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAA;AACjE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,aAAmC;IACnE,OAAO,IAAI,gBAAgB,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAA;AAC/D,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO,IAAI,0BAA0B,CAAC,mBAAmB,CAAC,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,IAAI,0BAA0B,CAAC,iBAAiB,CAAC,CAAA;AAC1D,CAAC"}
1
+ {"version":3,"file":"storage.js","names":["_core","require","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","EVENTS_STORAGE_FILE","LOGS_STORAGE_FILE","POSTHOG_STORAGE_VERSION","PERSIST_DEBOUNCE_MS","PostHogRNStorage","exports","storage","storageKey","_this","_classCallCheck2","memoryCache","_pendingPromises","Set","_storageKey","preloadResult","getItem","isPromise","preloadPromise","then","res","populateMemoryCache","_a","undefined","_createClass2","key","value","_waitForPersist","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_context","prev","next","_drainScheduledPersist","size","Promise","all","stop","waitForPersist","arguments","persist","_this2","payload","version","content","result","setItem","JSON","stringify","promise","err","console","warn","add","schedulePersist","_this3","_persistTimer","safeSetTimeout","clearTimeout","removeItem","clear","getAllKeys","Object","keys","data","parse","PostHogRNSyncMemoryStorage","_PostHogRNStorage","cache","_inherits2","createEventsStorage","customStorage","createLogsStorage","createEventsMemoryStorage","createLogsMemoryStorage"],"sources":["../src/storage.ts"],"sourcesContent":["import { isPromise, safeSetTimeout } from '@posthog/core'\nimport { PostHogCustomStorage } from './types'\n\n// Module-local: SDK-internal detail, not part of any public or reachable\n// surface. The factory functions below are the only way to obtain a storage\n// instance bound to one of these files.\nconst EVENTS_STORAGE_FILE = '.posthog-rn.json'\nconst LOGS_STORAGE_FILE = '.posthog-rn-logs.json'\nconst POSTHOG_STORAGE_VERSION = 'v1'\n\n// Window over which storage mutations coalesce into one disk write. The\n// single-blob storage shape re-serializes the full cache on every write, so an\n// unbatched burst of N captures costs O(n²) bytes; coalescing collapses a\n// same-tick burst to a single write. The mutation lands in memoryCache\n// synchronously — only the disk write is deferred — and flush / AppState\n// background / shutdown each force a synchronous write via waitForPersist, so\n// the only data-loss window is a hard crash before the next drain.\n//\n// 100ms is chosen from the write-rate curve: at high burst rates the disk-write\n// count is already floored by the events flushAt (a flush drains every 20\n// events), and 100ms is enough to reach that floor while bounding worst-case\n// loss to ~one flush batch. Larger windows don't reduce writes further (the\n// floor is flushAt, not the window) and only widen the loss window when flushes\n// aren't draining.\nconst PERSIST_DEBOUNCE_MS = 100\n\ntype PostHogStorageContents = { [key: string]: any }\n\nexport class PostHogRNStorage {\n memoryCache: PostHogStorageContents = {}\n storage: PostHogCustomStorage\n preloadPromise: Promise<void> | undefined\n private _storageKey: string\n private _pendingPromises: Set<Promise<void>> = new Set()\n // Single in-flight debounce timer. Its presence doubles as the \"a write is\n // scheduled\" flag — one source of truth. Armed on the first mutation in a\n // window and deliberately not reset by later mutations, so write latency is\n // bounded to PERSIST_DEBOUNCE_MS rather than starving under a continuous\n // stream of captures.\n private _persistTimer?: ReturnType<typeof setTimeout>\n\n // Prefer the `create*Storage` factories below over calling this directly —\n // they're the only callers that know which file to bind to.\n constructor(storage: PostHogCustomStorage, storageKey: string) {\n this.storage = storage\n this._storageKey = storageKey\n\n const preloadResult = this.storage.getItem(this._storageKey)\n\n if (isPromise(preloadResult)) {\n this.preloadPromise = preloadResult.then((res) => {\n this.populateMemoryCache(res)\n })\n\n this.preloadPromise?.finally(() => {\n this.preloadPromise = undefined\n })\n } else {\n this.populateMemoryCache(preloadResult)\n }\n }\n\n /**\n * Force any scheduled write to be initiated now and await in-flight async\n * writes. Used by durability-sensitive paths (events flush, AppState\n * background, shutdown, login/logout/opt-in/opt-out, fatal exceptions) so the\n * latest state is on its way to the backend before they continue.\n *\n * Best-effort under crash: backend writes are async, so an immediate\n * termination can interrupt them. Never throws — backend errors are logged\n * inside persist() / _drainScheduledPersist().\n */\n async waitForPersist(): Promise<void> {\n this._drainScheduledPersist()\n if (this._pendingPromises.size > 0) {\n await Promise.all(this._pendingPromises)\n }\n }\n\n persist(): void {\n const payload = {\n version: POSTHOG_STORAGE_VERSION,\n content: this.memoryCache,\n }\n\n const result = this.storage.setItem(this._storageKey, JSON.stringify(payload))\n\n // Track async persist operations so we can wait for them if needed\n if (isPromise(result)) {\n const promise = result\n .catch((err) => {\n console.warn('PostHog storage persist failed:', err)\n })\n .finally(() => {\n this._pendingPromises.delete(promise)\n })\n this._pendingPromises.add(promise)\n }\n }\n\n // Arm a single debounced persist on the first un-persisted mutation. Repeated\n // calls within the window are no-ops — the mutation is already in memoryCache\n // and the scheduled fire reads the final state.\n private schedulePersist(): void {\n if (this._persistTimer !== undefined) {\n return\n }\n this._persistTimer = safeSetTimeout(() => {\n this._persistTimer = undefined\n try {\n this.persist()\n } catch (err) {\n console.warn('PostHog storage scheduled persist threw:', err)\n }\n }, PERSIST_DEBOUNCE_MS)\n }\n\n // Force any scheduled persist to fire now (cancels the timer, persists immediately).\n private _drainScheduledPersist(): void {\n if (this._persistTimer === undefined) {\n return\n }\n clearTimeout(this._persistTimer)\n this._persistTimer = undefined\n try {\n this.persist()\n } catch (err) {\n console.warn('PostHog storage drain persist threw:', err)\n }\n }\n\n getItem(key: string): any | null | undefined {\n return this.memoryCache[key]\n }\n setItem(key: string, value: any): void {\n this.memoryCache[key] = value\n this.schedulePersist()\n }\n removeItem(key: string): void {\n delete this.memoryCache[key]\n this.schedulePersist()\n }\n clear(): void {\n for (const key in this.memoryCache) {\n delete this.memoryCache[key]\n }\n this.schedulePersist()\n }\n getAllKeys(): readonly string[] {\n return Object.keys(this.memoryCache)\n }\n\n populateMemoryCache(res: string | null): void {\n try {\n const data = res ? JSON.parse(res).content : {}\n\n for (const key in data) {\n this.memoryCache[key] = data[key]\n }\n } catch (e) {\n console.warn(\n \"PostHog failed to load persisted data from storage. This is likely because the storage format is. We'll reset the storage.\",\n e\n )\n }\n }\n}\n\nexport class PostHogRNSyncMemoryStorage extends PostHogRNStorage {\n constructor(storageKey: string) {\n const cache: { [key: string]: any | undefined } = {}\n const storage = {\n getItem: (key: string) => cache[key],\n setItem: (key: string, value: string) => {\n cache[key] = value\n },\n }\n\n super(storage, storageKey)\n }\n}\n\n// Factory functions that bind the storage instance to the correct SDK-internal\n// file. The file names never leave this module — callers (including tests)\n// reach storages only through these helpers.\nexport function createEventsStorage(customStorage: PostHogCustomStorage): PostHogRNStorage {\n return new PostHogRNStorage(customStorage, EVENTS_STORAGE_FILE)\n}\n\nexport function createLogsStorage(customStorage: PostHogCustomStorage): PostHogRNStorage {\n return new PostHogRNStorage(customStorage, LOGS_STORAGE_FILE)\n}\n\nexport function createEventsMemoryStorage(): PostHogRNStorage {\n return new PostHogRNSyncMemoryStorage(EVENTS_STORAGE_FILE)\n}\n\nexport function createLogsMemoryStorage(): PostHogRNStorage {\n return new PostHogRNSyncMemoryStorage(LOGS_STORAGE_FILE)\n}\n"],"mappings":"ujCAAA,IAAAA,KAAA,CAAAC,OAAA,kBAAyD,SAAAC,WAAAC,CAAA,CA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CAAC9C,GAAG,CAAC,GACpCwB,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAGxB,GAAW,CAAEC,KAAa,CAAI,CACtC6C,KAAK,CAAC9C,GAAG,CAAC,CAAGC,KAAK,CACpB,C,CACD,QAAAxC,UAAA,MAAAmF,0BAAA,EAEK9D,OAAO,CAAEC,UAAU,GAC3B,CAAC,GAAAgE,UAAA,aAAAH,0BAAA,CAAAC,iBAAA,WAAA9C,aAAA,aAAA6C,0BAAA,IAX6ChE,gBAAgB,EAiB1D,QAAU,CAAAoE,mBAAmBA,CAACC,aAAmC,EACrE,MAAO,IAAI,CAAArE,gBAAgB,CAACqE,aAAa,CAAEzE,mBAAmB,CAAC,CACjE,CAEM,QAAU,CAAA0E,iBAAiBA,CAACD,aAAmC,EACnE,MAAO,IAAI,CAAArE,gBAAgB,CAACqE,aAAa,CAAExE,iBAAiB,CAAC,CAC/D,CAEM,QAAU,CAAA0E,yBAAyBA,CAAA,EACvC,MAAO,IAAI,CAAAP,0BAA0B,CAACpE,mBAAmB,CAAC,CAC5D,CAEM,QAAU,CAAA4E,uBAAuBA,CAAA,EACrC,MAAO,IAAI,CAAAR,0BAA0B,CAACnE,iBAAiB,CAAC,CAC1D","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogSurveyProvider=PostHogSurveyProvider;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _Surveys=require("./components/Surveys");var _getActiveMatchingSurveys=require("./getActiveMatchingSurveys");var _useSurveyStorage2=require("./useSurveyStorage");var _useActivatedSurveys=require("./useActivatedSurveys");var _SurveyModal=require("./components/SurveyModal");var _surveysUtils=require("./surveys-utils");var _core=require("@posthog/core");var _usePostHog=require("../hooks/usePostHog");var _useFeatureFlags=require("../hooks/useFeatureFlags");var _surveyTranslations=require("./survey-translations");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/PostHogSurveyProvider.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var ActiveSurveyContext=_react["default"].createContext(undefined);var FeedbackSurveyContext=_react["default"].createContext(undefined);function PostHogSurveyProvider(props){var _a;var posthogFromHook=(0,_usePostHog.usePostHog)();var posthog=(_a=props.client)!==null&&_a!==void 0?_a:posthogFromHook;var _useSurveyStorage=(0,_useSurveyStorage2.useSurveyStorage)(),seenSurveys=_useSurveyStorage.seenSurveys,setSeenSurvey=_useSurveyStorage.setSeenSurvey,setLastSeenSurveyDate=_useSurveyStorage.setLastSeenSurveyDate;var _useState=(0,_react.useState)([]),_useState2=(0,_slicedToArray2["default"])(_useState,2),surveys=_useState2[0],setSurveys=_useState2[1];var _useState3=(0,_react.useState)(undefined),_useState4=(0,_slicedToArray2["default"])(_useState3,2),activeSurvey=_useState4[0],setActiveSurvey=_useState4[1];var shownSurveyIdRef=(0,_react.useRef)(undefined);var activatedSurveys=(0,_useActivatedSurveys.useActivatedSurveys)(posthog,surveys);var flags=(0,_useFeatureFlags.useFeatureFlags)(posthog);var _useState5=(0,_react.useState)(function(){return(0,_surveyTranslations.detectUserLanguage)(posthog);}),_useState6=(0,_slicedToArray2["default"])(_useState5,2),userLanguage=_useState6[0],setUserLanguage=_useState6[1];(0,_react.useEffect)(function(){var updateLanguage=function updateLanguage(){return setUserLanguage((0,_surveyTranslations.detectUserLanguage)(posthog));};var unsubscribe=posthog.on('personProperties',updateLanguage);updateLanguage();return unsubscribe;},[posthog]);(0,_react.useEffect)(function(){posthog.ready().then(function(){return posthog._onSurveysReady();}).then(function(){setUserLanguage((0,_surveyTranslations.detectUserLanguage)(posthog));return posthog.getSurveys();}).then(setSurveys)["catch"](function(){});},[posthog]);(0,_react.useEffect)(function(){var isShown=!!activeSurvey&&shownSurveyIdRef.current===activeSurvey.id;if(isShown){return;}var activeSurveys=(0,_getActiveMatchingSurveys.getActiveMatchingSurveys)(surveys,flags!==null&&flags!==void 0?flags:{},seenSurveys,activatedSurveys);var popoverSurveys=activeSurveys.filter(function(survey){return survey.type===_core.SurveyType.Popover;});if(activeSurvey&&popoverSurveys.some(function(survey){return survey.id===activeSurvey.id;})){return;}setActiveSurvey(popoverSurveys.length>0?popoverSurveys[0]:undefined);},[activeSurvey,flags,surveys,seenSurveys,activatedSurveys]);var translatedActiveSurvey=(0,_react.useMemo)(function(){return activeSurvey?(0,_surveyTranslations.applySurveyTranslationForUser)(activeSurvey,posthog,userLanguage):undefined;},[activeSurvey,posthog,userLanguage]);var surveyAppearance=(0,_react.useMemo)(function(){var _a,_b,_c,_d,_e;if(props.overrideAppearanceWithDefault||!translatedActiveSurvey){return _objectSpread(_objectSpread({},_surveysUtils.defaultSurveyAppearance),(_a=props.defaultSurveyAppearance)!==null&&_a!==void 0?_a:{});}return _objectSpread(_objectSpread(_objectSpread(_objectSpread({},_surveysUtils.defaultSurveyAppearance),(_b=props.defaultSurveyAppearance)!==null&&_b!==void 0?_b:{}),(_c=translatedActiveSurvey.survey.appearance)!==null&&_c!==void 0?_c:{}),((_d=translatedActiveSurvey.survey.appearance)===null||_d===void 0?void 0:_d.submitButtonColor)?{submitButtonTextColor:(_e=translatedActiveSurvey.survey.appearance.submitButtonTextColor)!==null&&_e!==void 0?_e:(0,_surveysUtils.getContrastingTextColor)(translatedActiveSurvey.survey.appearance.submitButtonColor)}:{});},[translatedActiveSurvey,props.defaultSurveyAppearance,props.overrideAppearanceWithDefault]);var activeContext=(0,_react.useMemo)(function(){if(!activeSurvey||!translatedActiveSurvey){return undefined;}return{survey:translatedActiveSurvey.survey,surveyLanguage:translatedActiveSurvey.language,onShow:function onShow(){if(shownSurveyIdRef.current===activeSurvey.id){return;}shownSurveyIdRef.current=activeSurvey.id;(0,_Surveys.sendSurveyShownEvent)(translatedActiveSurvey.survey,posthog,translatedActiveSurvey.language);setLastSeenSurveyDate(new Date());},onClose:function onClose(submitted,responses){shownSurveyIdRef.current=undefined;setSeenSurvey(activeSurvey);setActiveSurvey(undefined);if(!submitted){(0,_Surveys.dismissedSurveyEvent)(translatedActiveSurvey.survey,responses,posthog,translatedActiveSurvey.language);}}};},[activeSurvey,posthog,setLastSeenSurveyDate,setSeenSurvey,translatedActiveSurvey]);var autoPresent=props.autoPresentSurveys!==false;var isAlreadyShown=!!activeSurvey&&shownSurveyIdRef.current===activeSurvey.id;var shouldShowModal=activeContext&&activeContext.survey.type===_core.SurveyType.Popover&&(autoPresent||isAlreadyShown);return(0,_jsxRuntime.jsx)(ActiveSurveyContext.Provider,{value:activeContext,children:(0,_jsxRuntime.jsxs)(FeedbackSurveyContext.Provider,{value:{surveys:surveys,activeSurvey:activeSurvey,setActiveSurvey:setActiveSurvey},children:[props.children,shouldShowModal&&(0,_jsxRuntime.jsx)(_SurveyModal.SurveyModal,_objectSpread({appearance:surveyAppearance,androidKeyboardBehavior:props.androidKeyboardBehavior},activeContext))]})});}
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogSurveyProvider=PostHogSurveyProvider;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _Surveys=require("./components/Surveys");var _getActiveMatchingSurveys=require("./getActiveMatchingSurveys");var _useSurveyStorage2=require("./useSurveyStorage");var _useActivatedSurveys=require("./useActivatedSurveys");var _SurveyModal=require("./components/SurveyModal");var _surveysUtils=require("./surveys-utils");var _core=require("@posthog/core");var _usePostHog=require("../hooks/usePostHog");var _useFeatureFlags=require("../hooks/useFeatureFlags");var _surveyTranslations=require("./survey-translations");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/PostHogSurveyProvider.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var ActiveSurveyContext=_react["default"].createContext(undefined);var FeedbackSurveyContext=_react["default"].createContext(undefined);function PostHogSurveyProvider(props){var _a;var posthogFromHook=(0,_usePostHog.usePostHog)();var posthog=(_a=props.client)!==null&&_a!==void 0?_a:posthogFromHook;var _useSurveyStorage=(0,_useSurveyStorage2.useSurveyStorage)(),seenSurveys=_useSurveyStorage.seenSurveys,setSeenSurvey=_useSurveyStorage.setSeenSurvey,setLastSeenSurveyDate=_useSurveyStorage.setLastSeenSurveyDate;var _useState=(0,_react.useState)([]),_useState2=(0,_slicedToArray2["default"])(_useState,2),surveys=_useState2[0],setSurveys=_useState2[1];var _useState3=(0,_react.useState)(undefined),_useState4=(0,_slicedToArray2["default"])(_useState3,2),activeSurvey=_useState4[0],setActiveSurvey=_useState4[1];var shownSurveyIdRef=(0,_react.useRef)(undefined);var activatedSurveys=(0,_useActivatedSurveys.useActivatedSurveys)(posthog,surveys);var flags=(0,_useFeatureFlags.useFeatureFlags)(posthog);var _useState5=(0,_react.useState)(function(){return(0,_surveyTranslations.detectUserLanguage)(posthog);}),_useState6=(0,_slicedToArray2["default"])(_useState5,2),userLanguage=_useState6[0],setUserLanguage=_useState6[1];(0,_react.useEffect)(function(){var updateLanguage=function updateLanguage(){return setUserLanguage((0,_surveyTranslations.detectUserLanguage)(posthog));};var unsubscribe=posthog.on('personProperties',updateLanguage);updateLanguage();return unsubscribe;},[posthog]);(0,_react.useEffect)(function(){posthog.ready().then(function(){return posthog._onSurveysReady();}).then(function(){setUserLanguage((0,_surveyTranslations.detectUserLanguage)(posthog));return posthog.getSurveys();}).then(setSurveys)["catch"](function(){});},[posthog]);(0,_react.useEffect)(function(){var isShown=!!activeSurvey&&shownSurveyIdRef.current===activeSurvey.id;if(isShown){return;}var activeSurveys=(0,_getActiveMatchingSurveys.getActiveMatchingSurveys)(surveys,flags!==null&&flags!==void 0?flags:{},seenSurveys,activatedSurveys);var popoverSurveys=activeSurveys.filter(function(survey){return survey.type===_core.SurveyType.Popover;});if(activeSurvey&&popoverSurveys.some(function(survey){return survey.id===activeSurvey.id;})){return;}setActiveSurvey(popoverSurveys.length>0?popoverSurveys[0]:undefined);},[activeSurvey,flags,surveys,seenSurveys,activatedSurveys]);var translatedActiveSurvey=(0,_react.useMemo)(function(){return activeSurvey?(0,_surveyTranslations.applySurveyTranslationForUser)(activeSurvey,posthog,userLanguage):undefined;},[activeSurvey,posthog,userLanguage]);var surveyAppearance=(0,_react.useMemo)(function(){var _a,_b,_c,_d,_e;if(props.overrideAppearanceWithDefault||!translatedActiveSurvey){return _objectSpread(_objectSpread({},_surveysUtils.defaultSurveyAppearance),(_a=props.defaultSurveyAppearance)!==null&&_a!==void 0?_a:{});}return _objectSpread(_objectSpread(_objectSpread(_objectSpread({},_surveysUtils.defaultSurveyAppearance),(_b=props.defaultSurveyAppearance)!==null&&_b!==void 0?_b:{}),(_c=translatedActiveSurvey.survey.appearance)!==null&&_c!==void 0?_c:{}),((_d=translatedActiveSurvey.survey.appearance)===null||_d===void 0?void 0:_d.submitButtonColor)?{submitButtonTextColor:(_e=translatedActiveSurvey.survey.appearance.submitButtonTextColor)!==null&&_e!==void 0?_e:(0,_surveysUtils.getContrastingTextColor)(translatedActiveSurvey.survey.appearance.submitButtonColor)}:{});},[translatedActiveSurvey,props.defaultSurveyAppearance,props.overrideAppearanceWithDefault]);var activeContext=(0,_react.useMemo)(function(){if(!activeSurvey||!translatedActiveSurvey){return undefined;}return{survey:translatedActiveSurvey.survey,surveyLanguage:translatedActiveSurvey.language,onShow:function onShow(){if(shownSurveyIdRef.current===activeSurvey.id){return;}shownSurveyIdRef.current=activeSurvey.id;(0,_Surveys.sendSurveyShownEvent)(translatedActiveSurvey.survey,posthog,translatedActiveSurvey.language);setLastSeenSurveyDate(new Date());},onClose:function onClose(submitted,responses){shownSurveyIdRef.current=undefined;setSeenSurvey(activeSurvey);setActiveSurvey(undefined);if(!submitted){(0,_Surveys.dismissedSurveyEvent)(translatedActiveSurvey.survey,responses,posthog,translatedActiveSurvey.language);}}};},[activeSurvey,posthog,setLastSeenSurveyDate,setSeenSurvey,translatedActiveSurvey]);var autoPresent=props.autoPresentSurveys!==false;var isAlreadyShown=!!activeSurvey&&shownSurveyIdRef.current===activeSurvey.id;var shouldShowModal=activeContext&&activeContext.survey.type===_core.SurveyType.Popover&&(autoPresent||isAlreadyShown);return(0,_jsxRuntime.jsx)(ActiveSurveyContext.Provider,{value:activeContext,children:(0,_jsxRuntime.jsxs)(FeedbackSurveyContext.Provider,{value:{surveys:surveys,activeSurvey:activeSurvey,setActiveSurvey:setActiveSurvey},children:[props.children,shouldShowModal&&(0,_jsxRuntime.jsx)(_SurveyModal.SurveyModal,_objectSpread({appearance:surveyAppearance,androidKeyboardBehavior:props.androidKeyboardBehavior},activeContext))]})});}
2
+ //# sourceMappingURL=PostHogSurveyProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostHogSurveyProvider.js","sourceRoot":"","sources":["../../src/surveys/PostHogSurveyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE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,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAA;gBAC1G,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAA;IAEzF,kGAAkG;IAClG,gGAAgG;IAChG,kEAAkE;IAClE,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,KAAK,KAAK,CAAA;IACtD,MAAM,cAAc,GAAG,CAAC,CAAC,YAAY,IAAI,gBAAgB,CAAC,OAAO,KAAK,YAAY,CAAC,EAAE,CAAA;IACrF,MAAM,eAAe,GACnB,aAAa,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,IAAI,CAAC,WAAW,IAAI,cAAc,CAAC,CAAA;IAEtG,OAAO,CACL,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CACjD;MAAA,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC,CAChF;QAAA,CAAC,KAAK,CAAC,QAAQ,CACf;QAAA,CAAC,eAAe,IAAI,CAClB,CAAC,WAAW,CACV,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAC7B,uBAAuB,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CACvD,IAAI,aAAa,CAAC,EAClB,CACH,CACH;MAAA,EAAE,qBAAqB,CAAC,QAAQ,CAClC;IAAA,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAChC,CAAA;AACH,CAAC;AAED,uEAAuE;AACvE,yBAAyB;AACzB,4GAA4G;AAC5G,MAAM;AACN,IAAI"}
1
+ {"version":3,"file":"PostHogSurveyProvider.js","names":["_react","_interopRequireWildcard","require","_Surveys","_getActiveMatchingSurveys","_useSurveyStorage2","_useActivatedSurveys","_SurveyModal","_surveysUtils","_core","_usePostHog","_useFeatureFlags","_surveyTranslations","_jsxRuntime","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","ActiveSurveyContext","React","createContext","undefined","FeedbackSurveyContext","PostHogSurveyProvider","props","posthogFromHook","usePostHog","posthog","_a","client","_useSurveyStorage","useSurveyStorage","seenSurveys","setSeenSurvey","setLastSeenSurveyDate","_useState","useState","_useState2","_slicedToArray2","surveys","setSurveys","_useState3","_useState4","activeSurvey","setActiveSurvey","shownSurveyIdRef","useRef","activatedSurveys","useActivatedSurveys","flags","useFeatureFlags","_useState5","detectUserLanguage","_useState6","userLanguage","setUserLanguage","useEffect","updateLanguage","unsubscribe","on","ready","then","_onSurveysReady","getSurveys","isShown","current","id","activeSurveys","getActiveMatchingSurveys","popoverSurveys","survey","type","SurveyType","Popover","some","translatedActiveSurvey","useMemo","applySurveyTranslationForUser","surveyAppearance","overrideAppearanceWithDefault","defaultSurveyAppearance","_b","_c","appearance","_d","submitButtonColor","submitButtonTextColor","_e","getContrastingTextColor","activeContext","surveyLanguage","language","onShow","sendSurveyShownEvent","Date","onClose","submitted","responses","dismissedSurveyEvent","autoPresent","autoPresentSurveys","isAlreadyShown","shouldShowModal","jsx","Provider","value","children","jsxs","SurveyModal","androidKeyboardBehavior"],"sources":["../../src/surveys/PostHogSurveyProvider.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react'\n\nimport { dismissedSurveyEvent, sendSurveyShownEvent } from './components/Surveys'\n\nimport { getActiveMatchingSurveys } from './getActiveMatchingSurveys'\nimport { useSurveyStorage } from './useSurveyStorage'\nimport { useActivatedSurveys } from './useActivatedSurveys'\nimport { SurveyModal } from './components/SurveyModal'\nimport {\n defaultSurveyAppearance,\n getContrastingTextColor,\n SurveyAppearance,\n SurveyAppearanceTheme,\n} from './surveys-utils'\nimport { Survey, SurveyType, type SurveyResponses } from '@posthog/core'\nimport { usePostHog } from '../hooks/usePostHog'\nimport { useFeatureFlags } from '../hooks/useFeatureFlags'\nimport { PostHog } from '../posthog-rn'\nimport { applySurveyTranslationForUser, detectUserLanguage } from './survey-translations'\n\ntype ActiveSurveyContextType =\n | {\n survey: Survey\n surveyLanguage: string | null\n onShow: () => void\n onClose: (submitted: boolean, responses: SurveyResponses) => void\n }\n | undefined\nconst ActiveSurveyContext = React.createContext<ActiveSurveyContextType>(undefined)\n// export const useActiveSurvey = (): ActiveSurveyContextType => React.useContext(ActiveSurveyContext)\n\n// type FeedbackSurveyHook = {\n// survey: Survey\n// showSurveyModal: () => void\n// hideSurveyModal: () => void\n// }\nconst FeedbackSurveyContext = React.createContext<\n | {\n surveys: Survey[]\n activeSurvey: Survey | undefined\n setActiveSurvey: React.Dispatch<React.SetStateAction<Survey | undefined>>\n }\n | undefined\n>(undefined)\n// export const useFeedbackSurvey = (selector: string): FeedbackSurveyHook | undefined => {\n// const context = React.useContext(FeedbackSurveyContext)\n// const survey = context?.surveys.find(\n// (survey: Survey) => survey.type === SurveyType.Widget && survey.appearance?.widgetSelector === selector\n// )\n// if (!context || !survey) {\n// return undefined\n// }\n\n// return {\n// survey,\n// showSurveyModal: () => context.setActiveSurvey(survey),\n// hideSurveyModal: () => {\n// if (context.activeSurvey === survey) {\n// context.setActiveSurvey(undefined)\n// }\n// },\n// }\n// }\n\nexport type PostHogSurveyProviderProps = {\n /**\n * Whether eligible popover surveys are automatically presented. (Default: true)\n * Set to false to defer presentation — e.g. while a native-stack formSheet/modal is on top.\n * Deferral is display-only: the survey stays armed and presents once this is true again.\n * A survey already on screen is not interrupted when this becomes false.\n *\n * You own flipping this back to true (e.g. wire it to route/screen focus). While it stays\n * false the survey remains deferred and never shows — if the un-defer never happens\n * (sheet dismissed without re-focusing the provider, an unmount, an error boundary), the\n * survey stays armed indefinitely and no \"survey shown\" event fires.\n */\n autoPresentSurveys?: boolean\n\n /**\n * The default appearance for surveys when not specified in PostHog.\n *\n * Accepts the React Native-only appearance fields as well (e.g.\n * `maxFontSizeMultiplier`) — they are merged into the same theme object the\n * survey components read, and PostHog never sends them down.\n */\n defaultSurveyAppearance?: SurveyAppearance\n\n /**\n * If true, PosHog appearance will be ignored and defaultSurveyAppearance is always used.\n */\n overrideAppearanceWithDefault?: boolean\n\n /**\n * The keyboard avoiding behavior for the survey modal (KeyboardAvoidingView), applied only to Android devices.\n * - 'padding': Adds padding to avoid keyboard (recommended)\n * - 'height': Resizes the view height (default, for legacy - may cause flickering on some Android devices)\n * @default 'height'\n */\n androidKeyboardBehavior?: 'padding' | 'height'\n\n client?: PostHog\n\n children: React.ReactNode\n}\n\nexport function PostHogSurveyProvider(props: PostHogSurveyProviderProps): JSX.Element {\n const posthogFromHook = usePostHog()\n const posthog = props.client ?? posthogFromHook\n const { seenSurveys, setSeenSurvey, setLastSeenSurveyDate } = useSurveyStorage()\n const [surveys, setSurveys] = useState<Survey[]>([])\n const [activeSurvey, setActiveSurvey] = useState<Survey | undefined>(undefined)\n // Latches the id of the survey once its modal has actually painted, so deferring presentation\n // (autoPresentSurveys=false) never tears down a survey the user is already interacting with.\n const shownSurveyIdRef = useRef<string | undefined>(undefined)\n const activatedSurveys = useActivatedSurveys(posthog, surveys)\n\n const flags = useFeatureFlags(posthog)\n const [userLanguage, setUserLanguage] = useState(() => detectUserLanguage(posthog))\n\n useEffect(() => {\n const updateLanguage = () => setUserLanguage(detectUserLanguage(posthog))\n const unsubscribe = posthog.on('personProperties', updateLanguage)\n updateLanguage()\n return unsubscribe\n }, [posthog])\n\n // Load surveys once\n useEffect(() => {\n posthog\n .ready()\n .then(() => posthog._onSurveysReady())\n .then(() => {\n setUserLanguage(detectUserLanguage(posthog))\n return posthog.getSurveys()\n })\n .then(setSurveys)\n .catch(() => {})\n }, [posthog])\n\n // Whenever state changes, re-select the popover survey to show. A survey that has already\n // painted is left alone; an armed-but-deferred one is re-validated so it can't be presented\n // after it stops matching (e.g. its targeting flag flips off during a long deferral).\n useEffect(() => {\n const isShown = !!activeSurvey && shownSurveyIdRef.current === activeSurvey.id\n if (isShown) {\n return\n }\n\n const activeSurveys = getActiveMatchingSurveys(\n surveys,\n flags ?? {},\n seenSurveys,\n activatedSurveys\n // lastSeenSurveyDate\n )\n\n const popoverSurveys = activeSurveys.filter((survey: Survey) => survey.type === SurveyType.Popover)\n // TODO: sort by appearance delay, implement delay\n // const popoverSurveyQueue = sortSurveysByAppearanceDelay(popoverSurveys)\n\n if (activeSurvey && popoverSurveys.some((survey) => survey.id === activeSurvey.id)) {\n return\n }\n\n setActiveSurvey(popoverSurveys.length > 0 ? popoverSurveys[0] : undefined)\n }, [activeSurvey, flags, surveys, seenSurveys, activatedSurveys])\n\n const translatedActiveSurvey = useMemo(() => {\n return activeSurvey ? applySurveyTranslationForUser(activeSurvey, posthog, userLanguage) : undefined\n }, [activeSurvey, posthog, userLanguage])\n\n // Merge survey appearance so that components and hooks can use a consistent model\n const surveyAppearance = useMemo<SurveyAppearanceTheme>(() => {\n if (props.overrideAppearanceWithDefault || !translatedActiveSurvey) {\n return {\n ...defaultSurveyAppearance,\n ...(props.defaultSurveyAppearance ?? {}),\n }\n }\n return {\n ...defaultSurveyAppearance,\n ...(props.defaultSurveyAppearance ?? {}),\n ...(translatedActiveSurvey.survey.appearance ?? {}),\n // If submitButtonColor is set by PostHog, ensure submitButtonTextColor is also set to contrast\n ...(translatedActiveSurvey.survey.appearance?.submitButtonColor\n ? {\n submitButtonTextColor:\n translatedActiveSurvey.survey.appearance.submitButtonTextColor ??\n getContrastingTextColor(translatedActiveSurvey.survey.appearance.submitButtonColor),\n }\n : {}),\n }\n }, [translatedActiveSurvey, props.defaultSurveyAppearance, props.overrideAppearanceWithDefault])\n\n const activeContext = useMemo(() => {\n if (!activeSurvey || !translatedActiveSurvey) {\n return undefined\n }\n return {\n survey: translatedActiveSurvey.survey,\n surveyLanguage: translatedActiveSurvey.language,\n onShow: () => {\n // Updating translated copy changes this callback, but does not show a new survey.\n if (shownSurveyIdRef.current === activeSurvey.id) {\n return\n }\n shownSurveyIdRef.current = activeSurvey.id\n sendSurveyShownEvent(translatedActiveSurvey.survey, posthog, translatedActiveSurvey.language)\n setLastSeenSurveyDate(new Date())\n },\n onClose: (submitted: boolean, responses: SurveyResponses) => {\n shownSurveyIdRef.current = undefined\n setSeenSurvey(activeSurvey)\n setActiveSurvey(undefined)\n if (!submitted) {\n dismissedSurveyEvent(translatedActiveSurvey.survey, responses, posthog, translatedActiveSurvey.language)\n }\n },\n }\n }, [activeSurvey, posthog, setLastSeenSurveyDate, setSeenSurvey, translatedActiveSurvey])\n\n // Present a popover survey when autoPresentSurveys is on. Once it has painted (shownSurveyIdRef),\n // keep it mounted regardless of the gate so a mid-interaction survey is never yanked — the gate\n // defers not-yet-shown surveys, it does not interrupt a live one.\n const autoPresent = props.autoPresentSurveys !== false\n const isAlreadyShown = !!activeSurvey && shownSurveyIdRef.current === activeSurvey.id\n const shouldShowModal =\n activeContext && activeContext.survey.type === SurveyType.Popover && (autoPresent || isAlreadyShown)\n\n return (\n <ActiveSurveyContext.Provider value={activeContext}>\n <FeedbackSurveyContext.Provider value={{ surveys, activeSurvey, setActiveSurvey }}>\n {props.children}\n {shouldShowModal && (\n <SurveyModal\n appearance={surveyAppearance}\n androidKeyboardBehavior={props.androidKeyboardBehavior}\n {...activeContext}\n />\n )}\n </FeedbackSurveyContext.Provider>\n </ActiveSurveyContext.Provider>\n )\n}\n\n// function sortSurveysByAppearanceDelay(surveys: Survey[]): Survey[] {\n// return surveys.sort(\n// (a, b) => (a.appearance?.surveyPopupDelaySeconds ?? 0) - (b.appearance?.surveyPopupDelaySeconds ?? 0)\n// )\n// }\n"],"mappings":"4bAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAEA,IAAAC,QAAA,CAAAD,OAAA,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wB,WAAW,CAAG3E,KAAK,CAAC4E,kBAAkB,GAAK,KAAK,CACtD,GAAM,CAAAC,cAAc,CAAG,CAAC,CAAC1D,YAAY,EAAIE,gBAAgB,CAACoB,OAAO,GAAKtB,YAAY,CAACuB,EAAE,CACrF,GAAM,CAAAoC,eAAe,CACnBb,aAAa,EAAIA,aAAa,CAACnB,MAAM,CAACC,IAAI,GAAKC,gBAAU,CAACC,OAAO,GAAK0B,WAAW,EAAIE,cAAc,CAAC,CAEtG,MACE,GAAAvH,WAAA,CAAAyH,GAAA,EAACrF,mBAAmB,CAACsF,QAAQ,EAACC,KAAK,CAAEhB,aAAc,CAAAiB,QAAA,CACjD,GAAA5H,WAAA,CAAA6H,IAAA,EAACrF,qBAAqB,CAACkF,QAAQ,EAACC,KAAK,CAAE,CAAElE,OAAO,CAAPA,OAAO,CAAEI,YAAY,CAAZA,YAAY,CAAEC,eAAe,CAAfA,eAAe,CAAG,CAAA8D,QAAA,EAC/ElF,KAAK,CAACkF,QAAQ,CACdJ,eAAe,EACd,GAAAxH,WAAA,CAAAyH,GAAA,EAAC/H,YAAA,CAAAoI,WAAW,CAAAjG,aAAA,EACVwE,UAAU,CAAEL,gBAAiB,CAC7B+B,uBAAuB,CAAErF,KAAK,CAACqF,uBAAwB,EACnDpB,aAAa,CAAC,CAErB,EAC6B,CAClC,CAA8B,CAAC,CAEnC","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BottomSection=BottomSection;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/BottomSection.js";function BottomSection(_ref){var text=_ref.text,submitDisabled=_ref.submitDisabled,appearance=_ref.appearance,onSubmit=_ref.onSubmit,link=_ref.link,skipSubmitButton=_ref.skipSubmitButton;if(skipSubmitButton){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{});}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.bottomSection,children:(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.button,{backgroundColor:appearance.submitButtonColor},submitDisabled&&styles.buttonDisabled],disabled:submitDisabled,onPress:function onPress(){onSubmit();if(link){_reactNative.Linking.canOpenURL(link).then(function(supported){if(supported){_reactNative.Linking.openURL(link);}});}},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'button'),style:[styles.buttonText,{color:appearance.submitButtonTextColor}],children:text})})});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({bottomSection:{padding:10},button:{padding:10,borderRadius:5,alignItems:'center'},buttonText:{fontSize:16},buttonDisabled:{opacity:0.5}});
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BottomSection=BottomSection;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/BottomSection.js";function BottomSection(_ref){var text=_ref.text,submitDisabled=_ref.submitDisabled,appearance=_ref.appearance,onSubmit=_ref.onSubmit,link=_ref.link,skipSubmitButton=_ref.skipSubmitButton;if(skipSubmitButton){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{});}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.bottomSection,children:(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.button,{backgroundColor:appearance.submitButtonColor},submitDisabled&&styles.buttonDisabled],disabled:submitDisabled,onPress:function onPress(){onSubmit();if(link){_reactNative.Linking.canOpenURL(link).then(function(supported){if(supported){_reactNative.Linking.openURL(link);}});}},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'button'),style:[styles.buttonText,{color:appearance.submitButtonTextColor}],children:text})})});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({bottomSection:{padding:10},button:{padding:10,borderRadius:5,alignItems:'center'},buttonText:{fontSize:16},buttonDisabled:{opacity:0.5}});
2
+ //# sourceMappingURL=BottomSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSection.js","sourceRoot":"","sources":["../../../src/surveys/components/BottomSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,wBAAwB,EAAyB,MAAM,kBAAkB,CAAA;AAElF,MAAM,UAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,cAAc,EACd,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,gBAAgB,GAQjB;IACC,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,EAAE,GAAG,CAAA;IACd,CAAC;IAED,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAChC;MAAA,CAAC,gBAAgB,CACf,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,MAAM;YACb,EAAE,eAAe,EAAE,UAAU,CAAC,iBAAiB,EAAE;YACjD,cAAc,IAAI,MAAM,CAAC,cAAc;SACxC,CAAC,CACF,QAAQ,CAAC,CAAC,cAAc,CAAC,CACzB,OAAO,CAAC,CAAC,GAAG,EAAE;YACZ,QAAQ,EAAE,CAAA;YACV,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;oBAC1C,IAAI,SAAS,EAAE,CAAC;wBACd,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;oBACvB,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,CAAC,CAEF;QAAA,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CACtE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAExE;UAAA,CAAC,IAAI,CACP;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,gBAAgB,CACpB;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAClC,aAAa,EAAE;QACb,OAAO,EAAE,EAAE;KACZ;IACD,MAAM,EAAE;QACN,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,QAAQ;KACrB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;KACb;IACD,cAAc,EAAE;QACd,OAAO,EAAE,GAAG;KACb;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"BottomSection.js","names":["_react","_interopRequireDefault","require","_reactNative","_safeStyleSheet","_surveysUtils","_jsxRuntime","_jsxFileName","BottomSection","_ref","text","submitDisabled","appearance","onSubmit","link","skipSubmitButton","jsx","Fragment","View","style","styles","bottomSection","children","TouchableOpacity","button","backgroundColor","submitButtonColor","buttonDisabled","disabled","onPress","Linking","canOpenURL","then","supported","openURL","Text","maxFontSizeMultiplier","getMaxFontSizeMultiplier","buttonText","color","submitButtonTextColor","createSafeStyleSheet","padding","borderRadius","alignItems","fontSize","opacity"],"sources":["../../../src/surveys/components/BottomSection.tsx"],"sourcesContent":["import React from 'react'\nimport { Linking, Text, TouchableOpacity, View } from 'react-native'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport { getMaxFontSizeMultiplier, SurveyAppearanceTheme } from '../surveys-utils'\n\nexport function BottomSection({\n text,\n submitDisabled,\n appearance,\n onSubmit,\n link,\n skipSubmitButton,\n}: {\n text: string\n submitDisabled: boolean\n appearance: SurveyAppearanceTheme\n onSubmit: () => void\n link?: string | null\n skipSubmitButton?: boolean\n}): JSX.Element {\n if (skipSubmitButton) {\n return <></>\n }\n\n return (\n <View style={styles.bottomSection}>\n <TouchableOpacity\n style={[\n styles.button,\n { backgroundColor: appearance.submitButtonColor },\n submitDisabled && styles.buttonDisabled,\n ]}\n disabled={submitDisabled}\n onPress={() => {\n onSubmit()\n if (link) {\n Linking.canOpenURL(link).then((supported) => {\n if (supported) {\n Linking.openURL(link)\n }\n })\n }\n }}\n >\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'button')}\n style={[styles.buttonText, { color: appearance.submitButtonTextColor }]}\n >\n {text}\n </Text>\n </TouchableOpacity>\n </View>\n )\n}\n\nconst styles = createSafeStyleSheet({\n bottomSection: {\n padding: 10,\n },\n button: {\n padding: 10,\n borderRadius: 5,\n alignItems: 'center',\n },\n buttonText: {\n fontSize: 16,\n },\n buttonDisabled: {\n opacity: 0.5,\n },\n})\n"],"mappings":"6LAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAEA,IAAAE,eAAA,CAAAF,OAAA,sBACA,IAAAG,aAAA,CAAAH,OAAA,qBAAkF,IAAAI,WAAA,CAAAJ,OAAA,0BAAAK,YAAA,0GAE5E,QAAU,CAAAC,aAAaA,CAAAC,IAAA,CAc5B,IAbC,CAAAC,IAAI,CAAAD,IAAA,CAAJC,IAAI,CACJC,cAAc,CAAAF,IAAA,CAAdE,cAAc,CACdC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,QAAQ,CAAAJ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AAa,CAAE,CACbqB,OAAO,CAAE,E,CACV,CACDlB,MAAM,CAAE,CACNkB,OAAO,CAAE,EAAE,CACXC,YAAY,CAAE,CAAC,CACfC,UAAU,CAAE,Q,CACb,CACDN,UAAU,CAAE,CACVO,QAAQ,CAAE,E,CACX,CACDlB,cAAc,CAAE,CACdmB,OAAO,CAAE,G,EAEZ,CAAC","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Cancel=Cancel;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _icons=require("../icons");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/Cancel.js";function Cancel(_ref){var onPress=_ref.onPress,appearance=_ref.appearance;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.cancelBtnWrapper,{borderColor:appearance.borderColor}],onPress:onPress,children:(0,_jsxRuntime.jsx)(_icons.CancelSVG,{})});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({cancelBtnWrapper:{width:_surveysUtils.closeButtonSize,height:_surveysUtils.closeButtonSize,borderRadius:_surveysUtils.closeButtonSize/2,borderWidth:1,justifyContent:'center',alignItems:'center',backgroundColor:'white'}});
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Cancel=Cancel;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _icons=require("../icons");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/Cancel.js";function Cancel(_ref){var onPress=_ref.onPress,appearance=_ref.appearance;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.cancelBtnWrapper,{borderColor:appearance.borderColor}],onPress:onPress,children:(0,_jsxRuntime.jsx)(_icons.CancelSVG,{})});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({cancelBtnWrapper:{width:_surveysUtils.closeButtonSize,height:_surveysUtils.closeButtonSize,borderRadius:_surveysUtils.closeButtonSize/2,borderWidth:1,justifyContent:'center',alignItems:'center',backgroundColor:'white'}});
2
+ //# sourceMappingURL=Cancel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cancel.js","sourceRoot":"","sources":["../../../src/surveys/components/Cancel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAyB,MAAM,kBAAkB,CAAA;AAEzE,MAAM,UAAU,MAAM,CAAC,EACrB,OAAO,EACP,UAAU,GAIX;IACC,OAAO,CACL,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAC5G;MAAA,CAAC,SAAS,CAAC,AAAD,EACZ;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAClC,gBAAgB,EAAE;QAChB,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,eAAe;QACvB,YAAY,EAAE,eAAe,GAAG,CAAC;QACjC,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,OAAO;KACzB;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"Cancel.js","names":["_react","_interopRequireDefault","require","_reactNative","_icons","_safeStyleSheet","_surveysUtils","_jsxRuntime","_jsxFileName","Cancel","_ref","onPress","appearance","jsx","TouchableOpacity","style","styles","cancelBtnWrapper","borderColor","children","CancelSVG","createSafeStyleSheet","width","closeButtonSize","height","borderRadius","borderWidth","justifyContent","alignItems","backgroundColor"],"sources":["../../../src/surveys/components/Cancel.tsx"],"sourcesContent":["import React from 'react'\nimport { TouchableOpacity } from 'react-native'\nimport { CancelSVG } from '../icons'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport { closeButtonSize, SurveyAppearanceTheme } from '../surveys-utils'\n\nexport function Cancel({\n onPress,\n appearance,\n}: {\n onPress: () => void\n appearance: SurveyAppearanceTheme\n}): JSX.Element {\n return (\n <TouchableOpacity style={[styles.cancelBtnWrapper, { borderColor: appearance.borderColor }]} onPress={onPress}>\n <CancelSVG />\n </TouchableOpacity>\n )\n}\n\nconst styles = createSafeStyleSheet({\n cancelBtnWrapper: {\n width: closeButtonSize,\n height: closeButtonSize,\n borderRadius: closeButtonSize / 2,\n borderWidth: 1,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'white',\n },\n})\n"],"mappings":"+KAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBACA,IAAAE,MAAA,CAAAF,OAAA,aAEA,IAAAG,eAAA,CAAAH,OAAA,sBACA,IAAAI,aAAA,CAAAJ,OAAA,qBAAyE,IAAAK,WAAA,CAAAL,OAAA,0BAAAM,YAAA,mGAEnE,QAAU,CAAAC,MAAMA,CAAAC,IAAA,CAMrB,IALC,CAAAC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CAKV,MACE,GAAAL,WAAA,CAAAM,GAAA,EAACV,YAAA,CAAAW,gBAAgB,EAACC,KAAK,CAAE,CAACC,MAAM,CAACC,gBAAgB,CAAE,CAAEC,WAAW,CAAEN,UAAU,CAACM,WAAW,CAAE,CAAE,CAACP,OAAO,CAAEA,OAAQ,CAAAQ,QAAA,CAC5G,GAAAZ,WAAA,CAAAM,GAAA,EAACT,MAAA,CAAAgB,SAAS,IACZ,CAAkB,CAAC,CAEvB,CAEA,GAAM,CAAAJ,MAAM,CAAG,GAAAK,oCAAoB,EAAC,CAClCJ,gBAAgB,CAAE,CAChBK,KAAK,CAAEC,6BAAe,CACtBC,MAAM,CAAED,6BAAe,CACvBE,YAAY,CAAEF,6BAAe,CAAG,CAAC,CACjCG,WAAW,CAAE,CAAC,CACdC,cAAc,CAAE,QAAQ,CACxBC,UAAU,CAAE,QAAQ,CACpBC,eAAe,CAAE,O,EAEpB,CAAC","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ConfirmationMessage=ConfirmationMessage;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _BottomSection=require("./BottomSection");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/ConfirmationMessage.js";function ConfirmationMessage(_ref){var appearance=_ref.appearance,header=_ref.header,description=_ref.description,contentType=_ref.contentType,onClose=_ref.onClose,styleOverrides=_ref.styleOverrides,isModal=_ref.isModal;var textColor=(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styleOverrides,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.thankYouMessageContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'header'),style:[styles.thankYouMessageHeader,{color:textColor}],children:header}),(0,_surveysUtils.shouldRenderDescription)(description,contentType)&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'description'),style:{color:textColor,opacity:_surveysUtils.defaultDescriptionOpacity},children:description})]}),isModal&&(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:appearance.thankYouMessageCloseButtonText,submitDisabled:false,appearance:appearance,onSubmit:onClose})]});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({thankYouMessageContainer:{padding:10,paddingRight:_surveysUtils.closeButtonSize},thankYouMessageHeader:{fontSize:18,fontWeight:'bold'}});
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ConfirmationMessage=ConfirmationMessage;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _BottomSection=require("./BottomSection");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/ConfirmationMessage.js";function ConfirmationMessage(_ref){var appearance=_ref.appearance,header=_ref.header,description=_ref.description,contentType=_ref.contentType,onClose=_ref.onClose,styleOverrides=_ref.styleOverrides,isModal=_ref.isModal;var textColor=(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styleOverrides,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.thankYouMessageContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'header'),style:[styles.thankYouMessageHeader,{color:textColor}],children:header}),(0,_surveysUtils.shouldRenderDescription)(description,contentType)&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'description'),style:{color:textColor,opacity:_surveysUtils.defaultDescriptionOpacity},children:description})]}),isModal&&(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:appearance.thankYouMessageCloseButtonText,submitDisabled:false,appearance:appearance,onSubmit:onClose})]});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({thankYouMessageContainer:{padding:10,paddingRight:_surveysUtils.closeButtonSize},thankYouMessageHeader:{fontSize:18,fontWeight:'bold'}});
2
+ //# sourceMappingURL=ConfirmationMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationMessage.js","sourceRoot":"","sources":["../../../src/surveys/components/ConfirmationMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,UAAU,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,WAAW,EACX,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,GASR;IACC,MAAM,SAAS,GAAG,uBAAuB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;IAErE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAC1B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAC3C;QAAA,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CACtE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAE5D;UAAA,CAAC,MAAM,CACT;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,uBAAuB,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,CACpD,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAC3E,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAEhE;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,IAAI,CAAC,CACR,CACH;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,OAAO,IAAI,CACV,CAAC,aAAa,CACZ,IAAI,CAAC,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAChD,cAAc,CAAC,CAAC,KAAK,CAAC,CACtB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,QAAQ,CAAC,CAAC,OAAO,CAAC,EAClB,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAClC,wBAAwB,EAAE;QACxB,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,eAAe;KAC9B;IACD,qBAAqB,EAAE;QACrB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"ConfirmationMessage.js","names":["_react","_interopRequireDefault","require","_reactNative","_safeStyleSheet","_surveysUtils","_BottomSection","_jsxRuntime","_jsxFileName","ConfirmationMessage","_ref","appearance","header","description","contentType","onClose","styleOverrides","isModal","textColor","getContrastingTextColor","backgroundColor","jsxs","View","style","children","styles","thankYouMessageContainer","jsx","Text","maxFontSizeMultiplier","getMaxFontSizeMultiplier","thankYouMessageHeader","color","shouldRenderDescription","opacity","defaultDescriptionOpacity","BottomSection","text","thankYouMessageCloseButtonText","submitDisabled","onSubmit","createSafeStyleSheet","padding","paddingRight","closeButtonSize","fontSize","fontWeight"],"sources":["../../../src/surveys/components/ConfirmationMessage.tsx"],"sourcesContent":["import React from 'react'\nimport { Text, View, ViewStyle } from 'react-native'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport {\n closeButtonSize,\n defaultDescriptionOpacity,\n getContrastingTextColor,\n getMaxFontSizeMultiplier,\n shouldRenderDescription,\n SurveyAppearanceTheme,\n} from '../surveys-utils'\nimport { SurveyQuestionDescriptionContentType } from '@posthog/core'\nimport { BottomSection } from './BottomSection'\n\nexport function ConfirmationMessage({\n appearance,\n header,\n description,\n contentType,\n onClose,\n styleOverrides,\n isModal,\n}: {\n appearance: SurveyAppearanceTheme\n header: string\n description: string\n contentType?: SurveyQuestionDescriptionContentType\n onClose: () => void\n styleOverrides?: ViewStyle\n isModal: boolean\n}): JSX.Element {\n const textColor = getContrastingTextColor(appearance.backgroundColor)\n\n return (\n <View style={styleOverrides}>\n <View style={styles.thankYouMessageContainer}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'header')}\n style={[styles.thankYouMessageHeader, { color: textColor }]}\n >\n {header}\n </Text>\n {shouldRenderDescription(description, contentType) && (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'description')}\n style={{ color: textColor, opacity: defaultDescriptionOpacity }}\n >\n {description}\n </Text>\n )}\n </View>\n {isModal && (\n <BottomSection\n text={appearance.thankYouMessageCloseButtonText}\n submitDisabled={false}\n appearance={appearance}\n onSubmit={onClose}\n />\n )}\n </View>\n )\n}\n\nconst styles = createSafeStyleSheet({\n thankYouMessageContainer: {\n padding: 10,\n paddingRight: closeButtonSize,\n },\n thankYouMessageHeader: {\n fontSize: 18,\n fontWeight: 'bold',\n },\n})\n"],"mappings":"yMAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAEA,IAAAE,eAAA,CAAAF,OAAA,sBACA,IAAAG,aAAA,CAAAH,OAAA,qBASA,IAAAI,cAAA,CAAAJ,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AAW,CACR,CACP,EACG,CACN,CAACI,OAAO,EACN,GAAAV,WAAA,CAAAoB,GAAA,EAACrB,cAAA,CAAA8B,aAAa,EACZC,IAAI,CAAE1B,UAAU,CAAC2B,8BAA+B,CAChDC,cAAc,CAAE,KAAM,CACtB5B,UAAU,CAAEA,UAAW,CACvB6B,QAAQ,CAAEzB,OAAQ,EAErB,EACG,CAAC,CAEX,CAEA,GAAM,CAAAU,MAAM,CAAG,GAAAgB,oCAAoB,EAAC,CAClCf,wBAAwB,CAAE,CACxBgB,OAAO,CAAE,EAAE,CACXC,YAAY,CAAEC,6B,CACf,CACDb,qBAAqB,CAAE,CACrBc,QAAQ,CAAE,EAAE,CACZC,UAAU,CAAE,M,EAEf,CAAC","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.IntroMessage=IntroMessage;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _BottomSection=require("./BottomSection");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/IntroMessage.js";function IntroMessage(_ref){var appearance=_ref.appearance,header=_ref.header,description=_ref.description,contentType=_ref.contentType,onStart=_ref.onStart;var textColor=(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor);return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.introMessageContainer,children:[header?(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'header'),style:[styles.introMessageHeader,{color:textColor}],children:header}):null,(0,_surveysUtils.shouldRenderDescription)(description,contentType)&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'description'),style:{color:textColor,opacity:_surveysUtils.defaultDescriptionOpacity},children:description})]}),(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:appearance.introScreenButtonText||'Get started',submitDisabled:false,appearance:appearance,onSubmit:onStart})]});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({introMessageContainer:{padding:10,paddingRight:_surveysUtils.closeButtonSize},introMessageHeader:{fontSize:18,fontWeight:'bold'}});
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.IntroMessage=IntroMessage;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _BottomSection=require("./BottomSection");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/IntroMessage.js";function IntroMessage(_ref){var appearance=_ref.appearance,header=_ref.header,description=_ref.description,contentType=_ref.contentType,onStart=_ref.onStart;var textColor=(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor);return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.introMessageContainer,children:[header?(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'header'),style:[styles.introMessageHeader,{color:textColor}],children:header}):null,(0,_surveysUtils.shouldRenderDescription)(description,contentType)&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'description'),style:{color:textColor,opacity:_surveysUtils.defaultDescriptionOpacity},children:description})]}),(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:appearance.introScreenButtonText||'Get started',submitDisabled:false,appearance:appearance,onSubmit:onStart})]});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({introMessageContainer:{padding:10,paddingRight:_surveysUtils.closeButtonSize},introMessageHeader:{fontSize:18,fontWeight:'bold'}});
2
+ //# sourceMappingURL=IntroMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntroMessage.js","sourceRoot":"","sources":["../../../src/surveys/components/IntroMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,UAAU,YAAY,CAAC,EAC3B,UAAU,EACV,MAAM,EACN,WAAW,EACX,WAAW,EACX,OAAO,GAOR;IACC,MAAM,SAAS,GAAG,uBAAuB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;IAErE,OAAO,CACL,CAAC,IAAI,CACH;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,CACxC;QAAA,CAAC,MAAM,CAAC,CAAC,CAAC,CACR,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CACtE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAEzD;YAAA,CAAC,MAAM,CACT;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,uBAAuB,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,CACpD,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAC3E,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAEhE;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,IAAI,CAAC,CACR,CACH;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,aAAa,CACZ,IAAI,CAAC,CAAC,UAAU,CAAC,qBAAqB,IAAI,aAAa,CAAC,CACxD,cAAc,CAAC,CAAC,KAAK,CAAC,CACtB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,QAAQ,CAAC,CAAC,OAAO,CAAC,EAEtB;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAClC,qBAAqB,EAAE;QACrB,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,eAAe;KAC9B;IACD,kBAAkB,EAAE;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"IntroMessage.js","names":["_react","_interopRequireDefault","require","_reactNative","_safeStyleSheet","_surveysUtils","_BottomSection","_jsxRuntime","_jsxFileName","IntroMessage","_ref","appearance","header","description","contentType","onStart","textColor","getContrastingTextColor","backgroundColor","jsxs","View","children","style","styles","introMessageContainer","jsx","Text","maxFontSizeMultiplier","getMaxFontSizeMultiplier","introMessageHeader","color","shouldRenderDescription","opacity","defaultDescriptionOpacity","BottomSection","text","introScreenButtonText","submitDisabled","onSubmit","createSafeStyleSheet","padding","paddingRight","closeButtonSize","fontSize","fontWeight"],"sources":["../../../src/surveys/components/IntroMessage.tsx"],"sourcesContent":["import React from 'react'\nimport { Text, View } from 'react-native'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport {\n closeButtonSize,\n defaultDescriptionOpacity,\n getContrastingTextColor,\n getMaxFontSizeMultiplier,\n shouldRenderDescription,\n SurveyAppearanceTheme,\n} from '../surveys-utils'\nimport { SurveyQuestionDescriptionContentType } from '@posthog/core'\nimport { BottomSection } from './BottomSection'\n\nexport function IntroMessage({\n appearance,\n header,\n description,\n contentType,\n onStart,\n}: {\n appearance: SurveyAppearanceTheme\n header: string\n description: string\n contentType?: SurveyQuestionDescriptionContentType\n onStart: () => void\n}): JSX.Element {\n const textColor = getContrastingTextColor(appearance.backgroundColor)\n\n return (\n <View>\n <View style={styles.introMessageContainer}>\n {header ? (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'header')}\n style={[styles.introMessageHeader, { color: textColor }]}\n >\n {header}\n </Text>\n ) : null}\n {shouldRenderDescription(description, contentType) && (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'description')}\n style={{ color: textColor, opacity: defaultDescriptionOpacity }}\n >\n {description}\n </Text>\n )}\n </View>\n <BottomSection\n text={appearance.introScreenButtonText || 'Get started'}\n submitDisabled={false}\n appearance={appearance}\n onSubmit={onStart}\n />\n </View>\n )\n}\n\nconst styles = createSafeStyleSheet({\n introMessageContainer: {\n padding: 10,\n paddingRight: closeButtonSize,\n },\n introMessageHeader: {\n fontSize: 18,\n fontWeight: 'bold',\n },\n})\n"],"mappings":"2LAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAEA,IAAAE,eAAA,CAAAF,OAAA,sBACA,IAAAG,aAAA,CAAAH,OAAA,qBASA,IAAAI,cAAA,CAAAJ,OAAA,oBAA+C,IAAAK,WAAA,CAAAL,OAAA,0BAAAM,YAAA,yGAEzC,QAAU,CAAAC,YAAYA,CAAAC,IAAA,CAY3B,IAXC,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,WAAW,CAAAH,IAAA,CAAXG,WAAW,CACXC,WAAW,CAAAJ,IAAA,CAAXI,WAAW,CACXC,OAAO,CAAAL,IAAA,CAAPK,OAAO,CAQP,GAAM,CAAA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AE,EAAE,CACZC,UAAU,CAAE,M,EAEf,CAAC","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.QuestionHeader=QuestionHeader;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/QuestionHeader.js";function QuestionHeader(_ref){var question=_ref.question,description=_ref.description,descriptionContentType=_ref.descriptionContentType,appearance=_ref.appearance;var _a;var textColor=(_a=appearance.textColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'question'),style:[styles.question,{color:textColor}],children:question}),(0,_surveysUtils.shouldRenderDescription)(description,descriptionContentType)&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'description'),style:[styles.description,{color:textColor,opacity:_surveysUtils.defaultDescriptionOpacity}],children:description})]});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({container:{padding:10,paddingRight:_surveysUtils.closeButtonSize},question:{fontSize:18,fontWeight:'bold'},description:{fontSize:14,marginTop:5}});
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.QuestionHeader=QuestionHeader;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/QuestionHeader.js";function QuestionHeader(_ref){var question=_ref.question,description=_ref.description,descriptionContentType=_ref.descriptionContentType,appearance=_ref.appearance;var _a;var textColor=(_a=appearance.textColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'question'),style:[styles.question,{color:textColor}],children:question}),(0,_surveysUtils.shouldRenderDescription)(description,descriptionContentType)&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'description'),style:[styles.description,{color:textColor,opacity:_surveysUtils.defaultDescriptionOpacity}],children:description})]});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({container:{padding:10,paddingRight:_surveysUtils.closeButtonSize},question:{fontSize:18,fontWeight:'bold'},description:{fontSize:14,marginTop:5}});
2
+ //# sourceMappingURL=QuestionHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionHeader.js","sourceRoot":"","sources":["../../../src/surveys/components/QuestionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,kBAAkB,CAAA;AAEzB,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,WAAW,EACX,sBAAsB,EACtB,UAAU,GAMX;;IACC,+EAA+E;IAC/E,MAAM,SAAS,GAAG,MAAA,UAAU,CAAC,SAAS,mCAAI,uBAAuB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;IAE7F,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CACxE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAE/C;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,uBAAuB,CAAC,WAAW,EAAE,sBAAsB,CAAC,IAAI,CAC/D,CAAC,IAAI,CACH,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAC3E,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC,CAEtF;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAClC,SAAS,EAAE;QACT,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,eAAe;KAC9B;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,CAAC;KACb;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"QuestionHeader.js","names":["_react","_interopRequireDefault","require","_reactNative","_safeStyleSheet","_surveysUtils","_jsxRuntime","_jsxFileName","QuestionHeader","_ref","question","description","descriptionContentType","appearance","textColor","_a","getContrastingTextColor","backgroundColor","jsxs","View","style","styles","container","children","jsx","Text","maxFontSizeMultiplier","getMaxFontSizeMultiplier","color","shouldRenderDescription","opacity","defaultDescriptionOpacity","createSafeStyleSheet","padding","paddingRight","closeButtonSize","fontSize","fontWeight","marginTop"],"sources":["../../../src/surveys/components/QuestionHeader.tsx"],"sourcesContent":["import React from 'react'\nimport { Text, View } from 'react-native'\n\nimport { SurveyQuestionDescriptionContentType } from '@posthog/core'\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport {\n closeButtonSize,\n defaultDescriptionOpacity,\n getContrastingTextColor,\n getMaxFontSizeMultiplier,\n shouldRenderDescription,\n SurveyAppearanceTheme,\n} from '../surveys-utils'\n\nexport function QuestionHeader({\n question,\n description,\n descriptionContentType,\n appearance,\n}: {\n question: string\n description?: string | null\n descriptionContentType?: SurveyQuestionDescriptionContentType\n appearance: SurveyAppearanceTheme\n}): JSX.Element {\n // Use textColor override if provided, otherwise auto-calculate from background\n const textColor = appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor)\n\n return (\n <View style={styles.container}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'question')}\n style={[styles.question, { color: textColor }]}\n >\n {question}\n </Text>\n {shouldRenderDescription(description, descriptionContentType) && (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'description')}\n style={[styles.description, { color: textColor, opacity: defaultDescriptionOpacity }]}\n >\n {description}\n </Text>\n )}\n </View>\n )\n}\n\nconst styles = createSafeStyleSheet({\n container: {\n padding: 10,\n paddingRight: closeButtonSize,\n },\n question: {\n fontSize: 18,\n fontWeight: 'bold',\n },\n description: {\n fontSize: 14,\n marginTop: 5,\n },\n})\n"],"mappings":"+LAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAGA,IAAAE,eAAA,CAAAF,OAAA,sBACA,IAAAG,aAAA,CAAAH,OAAA,qBAOyB,IAAAI,WAAA,CAAAJ,OAAA,0BAAAK,YAAA,2GAEnB,QAAU,CAAAC,cAAcA,CAAAC,IAAA,CAU7B,IATC,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U,CAAE,M,CACb,CACD1B,WAAW,CAAE,CACXyB,QAAQ,CAAE,EAAE,CACZE,SAAS,CAAE,C,EAEd,CAAC","ignoreList":[]}
@@ -1 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.LinkQuestion=LinkQuestion;exports.MultipleChoiceQuestion=MultipleChoiceQuestion;exports.OpenTextQuestion=OpenTextQuestion;exports.RatingButton=RatingButton;exports.RatingQuestion=RatingQuestion;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _icons=require("../icons");var _surveysUtils=require("../surveys-utils");var _surveyShuffling=require("../survey-shuffling");var _core=require("@posthog/core");var _surveys=require("@posthog/core/surveys");var _BottomSection=require("./BottomSection");var _QuestionHeader=require("./QuestionHeader");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/QuestionTypes.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function QuestionLayout(_ref){var children=_ref.children,footer=_ref.footer;var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2["default"])(_useState,2),viewportHeight=_useState2[0],setViewportHeight=_useState2[1];var _useState3=(0,_react.useState)(0),_useState4=(0,_slicedToArray2["default"])(_useState3,2),contentHeight=_useState4[0],setContentHeight=_useState4[1];var isOverflowing=contentHeight>viewportHeight+1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:questionLayoutStyles.container,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:questionLayoutStyles.scroll,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,scrollEnabled:isOverflowing,bounces:isOverflowing,onLayout:function onLayout(e){return setViewportHeight(e.nativeEvent.layout.height);},onContentSizeChange:function onContentSizeChange(_width,height){return setContentHeight(height);},children:children}),footer]});}var questionLayoutStyles=(0,_safeStyleSheet.createSafeStyleSheet)({container:{flexShrink:1},scroll:{flexShrink:1}});function OpenTextQuestion(_ref2){var question=_ref2.question,appearance=_ref2.appearance,onSubmit=_ref2.onSubmit;var _a,_b,_c,_d;var _useState5=(0,_react.useState)(''),_useState6=(0,_slicedToArray2["default"])(_useState5,2),text=_useState6[0],setText=_useState6[1];var validationError=(0,_react.useMemo)(function(){return(0,_surveys.getValidationError)(text,question.validation,question.optional);},[text,question.validation,question.optional]);var minLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MinLength);var maxLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MaxLength);var requirementsHint=(0,_react.useMemo)(function(){return(0,_surveys.getRequirementsHint)(minLength,maxLength);},[minLength,maxLength]);var handleSubmit=function handleSubmit(){if(validationError){return;}onSubmit(text.trim());};return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!!validationError,appearance:appearance,onSubmit:handleSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.textInputContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:[styles.textInput,{backgroundColor:appearance.inputBackground,color:(_b=appearance.inputTextColor)!==null&&_b!==void 0?_b:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground),borderColor:appearance.borderColor}],multiline:true,numberOfLines:4,placeholder:appearance.placeholder,placeholderTextColor:(0,_surveysUtils.getContrastingTextColor)((_c=appearance.inputTextColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground))==='white'?'rgba(0, 0, 0, 0.5)':'rgba(255, 255, 255, 0.5)',onChangeText:setText,value:text}),requirementsHint&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'validationHint'),style:[styles.validationHint,{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}],children:requirementsHint})]})]});}function LinkQuestion(_ref3){var question=_ref3.question,appearance=_ref3.appearance,_onSubmit=_ref3.onSubmit;var _a,_b;question=question;return(0,_jsxRuntime.jsx)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_b=(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText)!==null&&_b!==void 0?_b:'Submit',submitDisabled:false,link:question.link,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit('link clicked');}}),children:(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance})});}function RatingQuestion(_ref4){var _this=this;var question=_ref4.question,appearance=_ref4.appearance,_onSubmit2=_ref4.onSubmit;var _a,_b,_c,_d;var _useState7=(0,_react.useState)(null),_useState8=(0,_slicedToArray2["default"])(_useState7,2),rating=_useState8[0],setRating=_useState8[1];question=question;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:rating===null&&!question.optional,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit2(rating);},skipSubmitButton:question.skipSubmitButton}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingOptions,children:[question.display===_core.SurveyRatingDisplay.Emoji&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.ratingOptionsEmoji,children:(_b=emojiScaleLists[question.scale])===null||_b===void 0?void 0:_b.map(function(Emoji,idx){var active=idx+1===rating;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.ratingsEmoji,onPress:function onPress(){var response=idx+1;setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}},children:(0,_jsxRuntime.jsx)(Emoji,{fill:active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor})},idx);})}),question.display===_core.SurveyRatingDisplay.Number&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.ratingOptionsNumber,{borderColor:appearance.borderColor}],children:getScaleNumbers(question.scale).map(function(number,idx){var active=rating===number;return(0,_jsxRuntime.jsx)(RatingButton,{index:idx,active:active,appearance:appearance,num:number,setActiveNumber:function setActiveNumber(response){setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}}},idx);})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_c=appearance.textColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.lowerBoundLabel}),(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.upperBoundLabel})]})]})]});}function RatingButton(_ref5){var index=_ref5.index,num=_ref5.num,active=_ref5.active,appearance=_ref5.appearance,setActiveNumber=_ref5.setActiveNumber;var _a;var backgroundColor=active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor;var textColor=active?(0,_surveysUtils.getContrastingTextColor)(backgroundColor):(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(backgroundColor);return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.ratingsNumber,index===0&&{borderLeftWidth:0},{backgroundColor:backgroundColor,borderColor:appearance.borderColor}],onPress:function onPress(){return setActiveNumber(num);},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingNumber'),style:{color:textColor},children:num})});}function MultipleChoiceQuestion(_ref6){var _this2=this;var question=_ref6.question,appearance=_ref6.appearance,_onSubmit3=_ref6.onSubmit;var _a;question=question;var isSingleChoice=question.type===_core.SurveyQuestionType.SingleChoice;var allowMultiple=question.type===_core.SurveyQuestionType.MultipleChoice;var openChoiceIndex=question.hasOpenChoice?question.choices.length-1:-1;var choices=(0,_react.useMemo)(function(){return(0,_surveyShuffling.getDisplayOrderChoices)(question);},[question]);var _useState9=(0,_react.useState)([]),_useState0=(0,_slicedToArray2["default"])(_useState9,2),selectedChoiceIndices=_useState0[0],setSelectedChoiceIndices=_useState0[1];var _useState1=(0,_react.useState)(''),_useState10=(0,_slicedToArray2["default"])(_useState1,2),openEndedInput=_useState10[0],setOpenEndedInput=_useState10[1];var shouldSkipSubmit=question.skipSubmitButton&&isSingleChoice&&!question.hasOpenChoice;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!question.optional&&(selectedChoiceIndices.length===0||selectedChoiceIndices.includes(openChoiceIndex)&&openEndedInput.length===0),appearance:appearance,onSubmit:function onSubmit(){var result=selectedChoiceIndices.map(function(index){return index===openChoiceIndex?openEndedInput:question.choices[index];});_onSubmit3(allowMultiple?result:result[0]);},skipSubmitButton:shouldSkipSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.multipleChoiceOptions,children:choices.map(function(choice,choiceIndex){var _a;var isOpenChoice=choiceIndex===openChoiceIndex;var isSelected=selectedChoiceIndices.includes(choiceIndex);var choiceTextColor=(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground);return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{style:[styles.choiceOption,{backgroundColor:appearance.inputBackground},isSelected?{borderColor:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}:{}],onPress:function onPress(){if(allowMultiple){setSelectedChoiceIndices(isSelected?selectedChoiceIndices.filter(function(index){return index!==choiceIndex;}):[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]));}else{setSelectedChoiceIndices([choiceIndex]);if(shouldSkipSubmit&&!isOpenChoice){_onSubmit3(choice);}}},children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.choiceText,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'choice'),style:{flexGrow:1,color:choiceTextColor},children:[choice,isOpenChoice?':':'']}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rightCheckArea,children:isSelected&&(0,_jsxRuntime.jsx)(_icons.CheckSVG,{})})]}),isOpenChoice&&(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:styles.openEndedInput,onChangeText:function onChangeText(userValue){setOpenEndedInput(userValue);if(!isSelected){setSelectedChoiceIndices(allowMultiple?[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]):[choiceIndex]);}}})]},choiceIndex);})})]});}var emojiScaleLists={2:[_icons.ThumbsUpEmoji,_icons.ThumbsDownEmoji],3:[_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji],5:[_icons.VeryDissatisfiedEmoji,_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji,_icons.VerySatisfiedEmoji]};var fiveScaleNumbers=[1,2,3,4,5];var sevenScaleNumbers=[1,2,3,4,5,6,7];var tenScaleNumbers=[0,1,2,3,4,5,6,7,8,9,10];function getScaleNumbers(scale){switch(scale){case 5:return fiveScaleNumbers;case 7:return sevenScaleNumbers;case 10:return tenScaleNumbers;default:return fiveScaleNumbers;}}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({textInputContainer:{padding:10},textInput:{borderColor:'#ccc',borderWidth:1,padding:10,marginVertical:10,fontSize:16,height:80,textAlignVertical:'top'},ratingSection:{marginVertical:10},ratingOptions:{flexDirection:'row',justifyContent:'space-between'},ratingOptionsEmoji:{flexDirection:'row',justifyContent:'space-around',flexWrap:'nowrap',flex:1},ratingsEmoji:{padding:4},ratingOptionsNumber:{margin:10,flexGrow:1,flexDirection:'row',justifyContent:'space-between',borderRadius:5,borderWidth:1,overflow:'hidden'},ratingsNumber:{flex:1,paddingVertical:10,alignItems:'center',borderLeftWidth:1},ratingText:{flexDirection:'row',justifyContent:'space-between',padding:10},multipleChoiceOptions:{padding:10},choiceOption:{flexDirection:'column',marginVertical:5,borderWidth:1,borderColor:'grey',borderRadius:5,padding:10},choiceText:{flexDirection:'row'},rightCheckArea:{flexGrow:0},openEndedInput:{padding:5},validationHint:{fontSize:12,opacity:0.7,marginTop:4}});
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.LinkQuestion=LinkQuestion;exports.MultipleChoiceQuestion=MultipleChoiceQuestion;exports.OpenTextQuestion=OpenTextQuestion;exports.RatingButton=RatingButton;exports.RatingQuestion=RatingQuestion;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _safeStyleSheet=require("../safeStyleSheet");var _icons=require("../icons");var _surveysUtils=require("../surveys-utils");var _surveyShuffling=require("../survey-shuffling");var _core=require("@posthog/core");var _surveys=require("@posthog/core/surveys");var _BottomSection=require("./BottomSection");var _QuestionHeader=require("./QuestionHeader");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/QuestionTypes.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function QuestionLayout(_ref){var children=_ref.children,footer=_ref.footer;var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2["default"])(_useState,2),viewportHeight=_useState2[0],setViewportHeight=_useState2[1];var _useState3=(0,_react.useState)(0),_useState4=(0,_slicedToArray2["default"])(_useState3,2),contentHeight=_useState4[0],setContentHeight=_useState4[1];var isOverflowing=contentHeight>viewportHeight+1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:questionLayoutStyles.container,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:questionLayoutStyles.scroll,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,scrollEnabled:isOverflowing,bounces:isOverflowing,onLayout:function onLayout(e){return setViewportHeight(e.nativeEvent.layout.height);},onContentSizeChange:function onContentSizeChange(_width,height){return setContentHeight(height);},children:children}),footer]});}var questionLayoutStyles=(0,_safeStyleSheet.createSafeStyleSheet)({container:{flexShrink:1},scroll:{flexShrink:1}});function OpenTextQuestion(_ref2){var question=_ref2.question,appearance=_ref2.appearance,onSubmit=_ref2.onSubmit;var _a,_b,_c,_d;var _useState5=(0,_react.useState)(''),_useState6=(0,_slicedToArray2["default"])(_useState5,2),text=_useState6[0],setText=_useState6[1];var validationError=(0,_react.useMemo)(function(){return(0,_surveys.getValidationError)(text,question.validation,question.optional);},[text,question.validation,question.optional]);var minLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MinLength);var maxLength=(0,_surveys.getLengthFromRules)(question.validation,_core.SurveyValidationType.MaxLength);var requirementsHint=(0,_react.useMemo)(function(){return(0,_surveys.getRequirementsHint)(minLength,maxLength);},[minLength,maxLength]);var handleSubmit=function handleSubmit(){if(validationError){return;}onSubmit(text.trim());};return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!!validationError,appearance:appearance,onSubmit:handleSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.textInputContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:[styles.textInput,{backgroundColor:appearance.inputBackground,color:(_b=appearance.inputTextColor)!==null&&_b!==void 0?_b:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground),borderColor:appearance.borderColor}],multiline:true,numberOfLines:4,placeholder:appearance.placeholder,placeholderTextColor:(0,_surveysUtils.getContrastingTextColor)((_c=appearance.inputTextColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground))==='white'?'rgba(0, 0, 0, 0.5)':'rgba(255, 255, 255, 0.5)',onChangeText:setText,value:text}),requirementsHint&&(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'validationHint'),style:[styles.validationHint,{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}],children:requirementsHint})]})]});}function LinkQuestion(_ref3){var question=_ref3.question,appearance=_ref3.appearance,_onSubmit=_ref3.onSubmit;var _a,_b;question=question;return(0,_jsxRuntime.jsx)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_b=(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText)!==null&&_b!==void 0?_b:'Submit',submitDisabled:false,link:question.link,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit('link clicked');}}),children:(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance})});}function RatingQuestion(_ref4){var _this=this;var question=_ref4.question,appearance=_ref4.appearance,_onSubmit2=_ref4.onSubmit;var _a,_b,_c,_d;var _useState7=(0,_react.useState)(null),_useState8=(0,_slicedToArray2["default"])(_useState7,2),rating=_useState8[0],setRating=_useState8[1];question=question;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:rating===null&&!question.optional,appearance:appearance,onSubmit:function onSubmit(){return _onSubmit2(rating);},skipSubmitButton:question.skipSubmitButton}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingOptions,children:[question.display===_core.SurveyRatingDisplay.Emoji&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.ratingOptionsEmoji,children:(_b=emojiScaleLists[question.scale])===null||_b===void 0?void 0:_b.map(function(Emoji,idx){var active=idx+1===rating;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.ratingsEmoji,onPress:function onPress(){var response=idx+1;setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}},children:(0,_jsxRuntime.jsx)(Emoji,{fill:active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor})},idx);})}),question.display===_core.SurveyRatingDisplay.Number&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.ratingOptionsNumber,{borderColor:appearance.borderColor}],children:getScaleNumbers(question.scale).map(function(number,idx){var active=rating===number;return(0,_jsxRuntime.jsx)(RatingButton,{index:idx,active:active,appearance:appearance,num:number,setActiveNumber:function setActiveNumber(response){setRating(response);if(question.skipSubmitButton){_onSubmit2(response);}}},idx);})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.ratingText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_c=appearance.textColor)!==null&&_c!==void 0?_c:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.lowerBoundLabel}),(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingLabel'),style:{color:(_d=appearance.textColor)!==null&&_d!==void 0?_d:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor),opacity:_surveysUtils.defaultRatingLabelOpacity},children:question.upperBoundLabel})]})]})]});}function RatingButton(_ref5){var index=_ref5.index,num=_ref5.num,active=_ref5.active,appearance=_ref5.appearance,setActiveNumber=_ref5.setActiveNumber;var _a;var backgroundColor=active?appearance.ratingButtonActiveColor:appearance.ratingButtonColor;var textColor=active?(0,_surveysUtils.getContrastingTextColor)(backgroundColor):(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(backgroundColor);return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.ratingsNumber,index===0&&{borderLeftWidth:0},{backgroundColor:backgroundColor,borderColor:appearance.borderColor}],onPress:function onPress(){return setActiveNumber(num);},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'ratingNumber'),style:{color:textColor},children:num})});}function MultipleChoiceQuestion(_ref6){var _this2=this;var question=_ref6.question,appearance=_ref6.appearance,_onSubmit3=_ref6.onSubmit;var _a;question=question;var isSingleChoice=question.type===_core.SurveyQuestionType.SingleChoice;var allowMultiple=question.type===_core.SurveyQuestionType.MultipleChoice;var openChoiceIndex=question.hasOpenChoice?question.choices.length-1:-1;var choices=(0,_react.useMemo)(function(){return(0,_surveyShuffling.getDisplayOrderChoices)(question);},[question]);var _useState9=(0,_react.useState)([]),_useState0=(0,_slicedToArray2["default"])(_useState9,2),selectedChoiceIndices=_useState0[0],setSelectedChoiceIndices=_useState0[1];var _useState1=(0,_react.useState)(''),_useState10=(0,_slicedToArray2["default"])(_useState1,2),openEndedInput=_useState10[0],setOpenEndedInput=_useState10[1];var shouldSkipSubmit=question.skipSubmitButton&&isSingleChoice&&!question.hasOpenChoice;return(0,_jsxRuntime.jsxs)(QuestionLayout,{footer:(0,_jsxRuntime.jsx)(_BottomSection.BottomSection,{text:(_a=question.buttonText)!==null&&_a!==void 0?_a:appearance.submitButtonText,submitDisabled:!question.optional&&(selectedChoiceIndices.length===0||selectedChoiceIndices.includes(openChoiceIndex)&&openEndedInput.length===0),appearance:appearance,onSubmit:function onSubmit(){var result=selectedChoiceIndices.map(function(index){return index===openChoiceIndex?openEndedInput:question.choices[index];});_onSubmit3(allowMultiple?result:result[0]);},skipSubmitButton:shouldSkipSubmit}),children:[(0,_jsxRuntime.jsx)(_QuestionHeader.QuestionHeader,{question:question.question,description:question.description,descriptionContentType:question.descriptionContentType,appearance:appearance}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.multipleChoiceOptions,children:choices.map(function(choice,choiceIndex){var _a;var isOpenChoice=choiceIndex===openChoiceIndex;var isSelected=selectedChoiceIndices.includes(choiceIndex);var choiceTextColor=(_a=appearance.inputTextColor)!==null&&_a!==void 0?_a:(0,_surveysUtils.getContrastingTextColor)(appearance.inputBackground);return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{style:[styles.choiceOption,{backgroundColor:appearance.inputBackground},isSelected?{borderColor:(0,_surveysUtils.getContrastingTextColor)(appearance.backgroundColor)}:{}],onPress:function onPress(){if(allowMultiple){setSelectedChoiceIndices(isSelected?selectedChoiceIndices.filter(function(index){return index!==choiceIndex;}):[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]));}else{setSelectedChoiceIndices([choiceIndex]);if(shouldSkipSubmit&&!isOpenChoice){_onSubmit3(choice);}}},children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.choiceText,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'choice'),style:{flexGrow:1,color:choiceTextColor},children:[choice,isOpenChoice?':':'']}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rightCheckArea,children:isSelected&&(0,_jsxRuntime.jsx)(_icons.CheckSVG,{})})]}),isOpenChoice&&(0,_jsxRuntime.jsx)(_reactNative.TextInput,{maxFontSizeMultiplier:(0,_surveysUtils.getMaxFontSizeMultiplier)(appearance,'input'),style:styles.openEndedInput,onChangeText:function onChangeText(userValue){setOpenEndedInput(userValue);if(!isSelected){setSelectedChoiceIndices(allowMultiple?[].concat((0,_toConsumableArray2["default"])(selectedChoiceIndices),[choiceIndex]):[choiceIndex]);}}})]},choiceIndex);})})]});}var emojiScaleLists={2:[_icons.ThumbsUpEmoji,_icons.ThumbsDownEmoji],3:[_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji],5:[_icons.VeryDissatisfiedEmoji,_icons.DissatisfiedEmoji,_icons.NeutralEmoji,_icons.SatisfiedEmoji,_icons.VerySatisfiedEmoji]};var fiveScaleNumbers=[1,2,3,4,5];var sevenScaleNumbers=[1,2,3,4,5,6,7];var tenScaleNumbers=[0,1,2,3,4,5,6,7,8,9,10];function getScaleNumbers(scale){switch(scale){case 5:return fiveScaleNumbers;case 7:return sevenScaleNumbers;case 10:return tenScaleNumbers;default:return fiveScaleNumbers;}}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({textInputContainer:{padding:10},textInput:{borderColor:'#ccc',borderWidth:1,padding:10,marginVertical:10,fontSize:16,height:80,textAlignVertical:'top'},ratingSection:{marginVertical:10},ratingOptions:{flexDirection:'row',justifyContent:'space-between'},ratingOptionsEmoji:{flexDirection:'row',justifyContent:'space-around',flexWrap:'nowrap',flex:1},ratingsEmoji:{padding:4},ratingOptionsNumber:{margin:10,flexGrow:1,flexDirection:'row',justifyContent:'space-between',borderRadius:5,borderWidth:1,overflow:'hidden'},ratingsNumber:{flex:1,paddingVertical:10,alignItems:'center',borderLeftWidth:1},ratingText:{flexDirection:'row',justifyContent:'space-between',padding:10},multipleChoiceOptions:{padding:10},choiceOption:{flexDirection:'column',marginVertical:5,borderWidth:1,borderColor:'grey',borderRadius:5,padding:10},choiceText:{flexDirection:'row'},rightCheckArea:{flexGrow:0},openEndedInput:{padding:5},validationHint:{fontSize:12,opacity:0.7,marginTop:4}});
2
+ //# sourceMappingURL=QuestionTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionTypes.js","sourceRoot":"","sources":["../../../src/surveys/components/QuestionTypes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAqB,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEhH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,GAEzB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAEL,mBAAmB,EACnB,kBAAkB,EAIlB,oBAAoB,GACrB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE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E,EAAE;QACnB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,CAAC;KACnB;IACD,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,OAAO,EAAE,EAAE;KACZ;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,EAAE;KACZ;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,QAAQ;QACvB,cAAc,EAAE,CAAC;QACjB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,EAAE;KACZ;IACD,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,CAAC;KACZ;IACD,cAAc,EAAE;QACd,OAAO,EAAE,CAAC;KACX;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,CAAC;KACb;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"QuestionTypes.js","names":["_react","_interopRequireWildcard","require","_reactNative","_safeStyleSheet","_icons","_surveysUtils","_surveyShuffling","_core","_surveys","_BottomSection","_QuestionHeader","_jsxRuntime","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","QuestionLayout","_ref","children","footer","_useState","useState","_useState2","_slicedToArray2","viewportHeight","setViewportHeight","_useState3","_useState4","contentHeight","setContentHeight","isOverflowing","jsxs","View","style","questionLayoutStyles","container","jsx","ScrollView","scroll","keyboardShouldPersistTaps","showsVerticalScrollIndicator","scrollEnabled","bounces","onLayout","nativeEvent","layout","height","onContentSizeChange","_width","createSafeStyleSheet","flexShrink","OpenTextQuestion","_ref2","question","appearance","onSubmit","_useState5","_useState6","text","setText","validationError","useMemo","getValidationError","validation","optional","minLength","getLengthFromRules","SurveyValidationType","MinLength","maxLength","MaxLength","requirementsHint","getRequirementsHint","handleSubmit","trim","BottomSection","_a","buttonText","submitButtonText","submitDisabled","QuestionHeader","description","descriptionContentType","styles","textInputContainer","TextInput","maxFontSizeMultiplier","getMaxFontSizeMultiplier","textInput","backgroundColor","inputBackground","color","_b","inputTextColor","getContrastingTextColor","borderColor","multiline","numberOfLines","placeholder","placeholderTextColor","_c","onChangeText","value","Text","validationHint","_d","textColor","LinkQuestion","_ref3","link","RatingQuestion","_ref4","_this","_useState7","_useState8","rating","setRating","skipSubmitButton","ratingSection","ratingOptions","display","SurveyRatingDisplay","Emoji","ratingOptionsEmoji","emojiScaleLists","scale","map","idx","active","TouchableOpacity","ratingsEmoji","onPress","response","fill","ratingButtonActiveColor","ratingButtonColor","Number","ratingOptionsNumber","getScaleNumbers","number","RatingButton","index","num","setActiveNumber","ratingText","opacity","defaultRatingLabelOpacity","lowerBoundLabel","upperBoundLabel","_ref5","ratingsNumber","borderLeftWidth","MultipleChoiceQuestion","_ref6","_this2","isSingleChoice","type","SurveyQuestionType","SingleChoice","allowMultiple","MultipleChoice","openChoiceIndex","hasOpenChoice","choices","length","getDisplayOrderChoices","_useState9","_useState0","selectedChoiceIndices","setSelectedChoiceIndices","_useState1","_useState10","openEndedInput","setOpenEndedInput","shouldSkipSubmit","includes","result","multipleChoiceOptions","choice","choiceIndex","isOpenChoice","isSelected","choiceTextColor","Pressable","choiceOption","filter","concat","_toConsumableArray2","choiceText","flexGrow","rightCheckArea","CheckSVG","userValue","ThumbsUpEmoji","ThumbsDownEmoji","DissatisfiedEmoji","NeutralEmoji","SatisfiedEmoji","VeryDissatisfiedEmoji","VerySatisfiedEmoji","fiveScaleNumbers","sevenScaleNumbers","tenScaleNumbers","padding","borderWidth","marginVertical","fontSize","textAlignVertical","flexDirection","justifyContent","flexWrap","flex","margin","borderRadius","overflow","paddingVertical","alignItems","marginTop"],"sources":["../../../src/surveys/components/QuestionTypes.tsx"],"sourcesContent":["import React, { ReactNode, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Pressable, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport {\n CheckSVG,\n DissatisfiedEmoji,\n NeutralEmoji,\n SatisfiedEmoji,\n ThumbsDownEmoji,\n ThumbsUpEmoji,\n VeryDissatisfiedEmoji,\n VerySatisfiedEmoji,\n} from '../icons'\nimport {\n defaultRatingLabelOpacity,\n getContrastingTextColor,\n getMaxFontSizeMultiplier,\n SurveyAppearanceTheme,\n} from '../surveys-utils'\nimport { getDisplayOrderChoices } from '../survey-shuffling'\nimport {\n SurveyQuestion,\n SurveyRatingDisplay,\n SurveyQuestionType,\n LinkSurveyQuestion,\n RatingSurveyQuestion,\n MultipleSurveyQuestion,\n SurveyValidationType,\n} from '@posthog/core'\nimport { getValidationError, getLengthFromRules, getRequirementsHint } from '@posthog/core/surveys'\nimport { BottomSection } from './BottomSection'\nimport { QuestionHeader } from './QuestionHeader'\n\ninterface QuestionCommonProps {\n question: SurveyQuestion\n appearance: SurveyAppearanceTheme\n}\n\n// Wraps question content in a scrollable region with a sticky BottomSection\n// (Submit button) at the bottom. The ScrollView has flexShrink: 1 so it\n// shrinks to fit when the parent modal is capped at its keyboard-aware\n// maxHeight, keeping Submit visible regardless of survey length. Scrolling is\n// enabled only while the content overflows the viewport, so short surveys don't\n// scroll or bounce.\nfunction QuestionLayout({ children, footer }: { children: ReactNode; footer: ReactNode }): JSX.Element {\n const [viewportHeight, setViewportHeight] = useState(0)\n const [contentHeight, setContentHeight] = useState(0)\n // 1px threshold absorbs sub-pixel layout rounding.\n const isOverflowing = contentHeight > viewportHeight + 1\n\n return (\n <View style={questionLayoutStyles.container}>\n <ScrollView\n style={questionLayoutStyles.scroll}\n keyboardShouldPersistTaps=\"handled\"\n showsVerticalScrollIndicator={false}\n scrollEnabled={isOverflowing}\n bounces={isOverflowing}\n onLayout={(e: LayoutChangeEvent) => setViewportHeight(e.nativeEvent.layout.height)}\n onContentSizeChange={(_width, height) => setContentHeight(height)}\n >\n {children}\n </ScrollView>\n {footer}\n </View>\n )\n}\n\nconst questionLayoutStyles = createSafeStyleSheet({\n container: {\n flexShrink: 1,\n },\n scroll: {\n flexShrink: 1,\n },\n})\n\nexport function OpenTextQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (text: string) => void\n}): JSX.Element {\n const [text, setText] = useState('')\n\n // Memoize validation error to avoid recalculating on every render\n const validationError = useMemo(\n () => getValidationError(text, question.validation, question.optional),\n [text, question.validation, question.optional]\n )\n\n // Build requirements hint message\n const minLength = getLengthFromRules(question.validation, SurveyValidationType.MinLength)\n const maxLength = getLengthFromRules(question.validation, SurveyValidationType.MaxLength)\n const requirementsHint = useMemo(() => getRequirementsHint(minLength, maxLength), [minLength, maxLength])\n\n const handleSubmit = () => {\n if (validationError) {\n return\n }\n onSubmit(text.trim())\n }\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={!!validationError}\n appearance={appearance}\n onSubmit={handleSubmit}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.textInputContainer}>\n <TextInput\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'input')}\n style={[\n styles.textInput,\n {\n backgroundColor: appearance.inputBackground,\n color: appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground),\n borderColor: appearance.borderColor,\n },\n ]}\n multiline\n numberOfLines={4}\n placeholder={appearance.placeholder}\n placeholderTextColor={\n getContrastingTextColor(\n appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground)\n ) === 'white'\n ? 'rgba(0, 0, 0, 0.5)'\n : 'rgba(255, 255, 255, 0.5)'\n }\n onChangeText={setText}\n value={text}\n />\n {requirementsHint && (\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'validationHint')}\n style={[\n styles.validationHint,\n { color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor) },\n ]}\n >\n {requirementsHint}\n </Text>\n )}\n </View>\n </QuestionLayout>\n )\n}\n\nexport function LinkQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (clicked: string) => void\n}): JSX.Element {\n question = question as LinkSurveyQuestion\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText ?? 'Submit'}\n submitDisabled={false}\n link={question.link}\n appearance={appearance}\n onSubmit={() => onSubmit('link clicked')}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n </QuestionLayout>\n )\n}\n\nexport function RatingQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (rating: number | null) => void\n}): JSX.Element {\n //const starting = question.scale === 10 ? 0 : 1;\n const [rating, setRating] = useState<number | null>(null)\n question = question as RatingSurveyQuestion\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={rating === null && !question.optional}\n appearance={appearance}\n onSubmit={() => onSubmit(rating)}\n skipSubmitButton={question.skipSubmitButton}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.ratingSection}>\n <View style={styles.ratingOptions}>\n {question.display === SurveyRatingDisplay.Emoji && (\n <View style={styles.ratingOptionsEmoji}>\n {emojiScaleLists[question.scale]?.map((Emoji, idx) => {\n const active = idx + 1 === rating\n return (\n <TouchableOpacity\n key={idx}\n style={styles.ratingsEmoji}\n onPress={() => {\n const response = idx + 1\n setRating(response)\n if (question.skipSubmitButton) {\n onSubmit(response)\n }\n }}\n >\n <Emoji fill={active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor} />\n </TouchableOpacity>\n )\n })}\n </View>\n )}\n {question.display === SurveyRatingDisplay.Number && (\n <View style={[styles.ratingOptionsNumber, { borderColor: appearance.borderColor }]}>\n {getScaleNumbers(question.scale).map((number, idx) => {\n const active = rating === number\n return (\n <RatingButton\n key={idx}\n index={idx}\n active={active}\n appearance={appearance}\n num={number}\n setActiveNumber={(response) => {\n setRating(response)\n if (question.skipSubmitButton) {\n onSubmit(response)\n }\n }}\n />\n )\n })}\n </View>\n )}\n </View>\n <View style={styles.ratingText}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingLabel')}\n style={{\n color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor),\n opacity: defaultRatingLabelOpacity,\n }}\n >\n {question.lowerBoundLabel}\n </Text>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingLabel')}\n style={{\n color: appearance.textColor ?? getContrastingTextColor(appearance.backgroundColor),\n opacity: defaultRatingLabelOpacity,\n }}\n >\n {question.upperBoundLabel}\n </Text>\n </View>\n </View>\n </QuestionLayout>\n )\n}\n\nexport function RatingButton({\n index,\n num,\n active,\n appearance,\n setActiveNumber,\n}: {\n index: number\n num: number\n active: boolean\n appearance: SurveyAppearanceTheme\n setActiveNumber: (num: number) => void\n}): JSX.Element {\n const backgroundColor = active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor\n // Active state always auto-calculates for contrast; inactive uses inputTextColor override if provided\n const textColor = active\n ? getContrastingTextColor(backgroundColor)\n : (appearance.inputTextColor ?? getContrastingTextColor(backgroundColor))\n\n return (\n <TouchableOpacity\n style={[\n styles.ratingsNumber,\n index === 0 && { borderLeftWidth: 0 },\n { backgroundColor, borderColor: appearance.borderColor },\n ]}\n onPress={() => setActiveNumber(num)}\n >\n <Text maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'ratingNumber')} style={{ color: textColor }}>\n {num}\n </Text>\n </TouchableOpacity>\n )\n}\n\nexport function MultipleChoiceQuestion({\n question,\n appearance,\n onSubmit,\n}: QuestionCommonProps & {\n onSubmit: (choices: string | string[] | null) => void\n}): JSX.Element {\n question = question as MultipleSurveyQuestion\n const isSingleChoice = question.type === SurveyQuestionType.SingleChoice\n const allowMultiple = question.type === SurveyQuestionType.MultipleChoice\n const openChoiceIndex = question.hasOpenChoice ? question.choices.length - 1 : -1\n const choices = useMemo(() => getDisplayOrderChoices(question as MultipleSurveyQuestion), [question])\n // Choice labels change with survey translations; keep selection tied to the original order.\n const [selectedChoiceIndices, setSelectedChoiceIndices] = useState<number[]>([])\n const [openEndedInput, setOpenEndedInput] = useState('')\n\n // Only skip submit for single-choice questions without open choice\n const shouldSkipSubmit = question.skipSubmitButton && isSingleChoice && !question.hasOpenChoice\n\n return (\n <QuestionLayout\n footer={\n <BottomSection\n text={question.buttonText ?? appearance.submitButtonText}\n submitDisabled={\n !question.optional &&\n (selectedChoiceIndices.length === 0 ||\n (selectedChoiceIndices.includes(openChoiceIndex) && openEndedInput.length === 0))\n }\n appearance={appearance}\n onSubmit={() => {\n const result = selectedChoiceIndices.map((index) =>\n index === openChoiceIndex ? openEndedInput : question.choices[index]\n )\n onSubmit(allowMultiple ? result : result[0])\n }}\n skipSubmitButton={shouldSkipSubmit}\n />\n }\n >\n <QuestionHeader\n question={question.question}\n description={question.description}\n descriptionContentType={question.descriptionContentType}\n appearance={appearance}\n />\n <View style={styles.multipleChoiceOptions}>\n {choices.map((choice: string, choiceIndex: number) => {\n const isOpenChoice = choiceIndex === openChoiceIndex\n const isSelected = selectedChoiceIndices.includes(choiceIndex)\n\n const choiceTextColor = appearance.inputTextColor ?? getContrastingTextColor(appearance.inputBackground)\n\n return (\n <Pressable\n key={choiceIndex}\n style={[\n styles.choiceOption,\n { backgroundColor: appearance.inputBackground },\n isSelected ? { borderColor: getContrastingTextColor(appearance.backgroundColor) } : {},\n ]}\n onPress={() => {\n if (allowMultiple) {\n setSelectedChoiceIndices(\n isSelected\n ? selectedChoiceIndices.filter((index) => index !== choiceIndex)\n : [...selectedChoiceIndices, choiceIndex]\n )\n } else {\n setSelectedChoiceIndices([choiceIndex])\n if (shouldSkipSubmit && !isOpenChoice) {\n onSubmit(choice)\n }\n }\n }}\n >\n <View style={styles.choiceText}>\n <Text\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'choice')}\n style={{ flexGrow: 1, color: choiceTextColor }}\n >\n {choice}\n {isOpenChoice ? ':' : ''}\n </Text>\n <View style={styles.rightCheckArea}>{isSelected && <CheckSVG />}</View>\n </View>\n {isOpenChoice && (\n <TextInput\n maxFontSizeMultiplier={getMaxFontSizeMultiplier(appearance, 'input')}\n style={styles.openEndedInput}\n onChangeText={(userValue) => {\n setOpenEndedInput(userValue)\n if (!isSelected) {\n setSelectedChoiceIndices(allowMultiple ? [...selectedChoiceIndices, choiceIndex] : [choiceIndex])\n }\n }}\n />\n )}\n </Pressable>\n )\n })}\n </View>\n </QuestionLayout>\n )\n}\n\nconst emojiScaleLists: Record<number, (typeof ThumbsUpEmoji)[]> = {\n 2: [ThumbsUpEmoji, ThumbsDownEmoji],\n 3: [DissatisfiedEmoji, NeutralEmoji, SatisfiedEmoji],\n 5: [VeryDissatisfiedEmoji, DissatisfiedEmoji, NeutralEmoji, SatisfiedEmoji, VerySatisfiedEmoji],\n}\nconst fiveScaleNumbers = [1, 2, 3, 4, 5]\nconst sevenScaleNumbers = [1, 2, 3, 4, 5, 6, 7]\nconst tenScaleNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return fiveScaleNumbers\n case 7:\n return sevenScaleNumbers\n case 10:\n return tenScaleNumbers\n default:\n return fiveScaleNumbers\n }\n}\n\nconst styles = createSafeStyleSheet({\n textInputContainer: {\n padding: 10,\n },\n textInput: {\n borderColor: '#ccc',\n borderWidth: 1,\n padding: 10,\n marginVertical: 10,\n fontSize: 16,\n // Fixed height keeps the surrounding layout stable as the user types —\n // the TextInput scrolls its own content internally\n height: 80,\n textAlignVertical: 'top',\n },\n ratingSection: {\n marginVertical: 10,\n },\n ratingOptions: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n ratingOptionsEmoji: {\n flexDirection: 'row',\n justifyContent: 'space-around',\n flexWrap: 'nowrap',\n flex: 1,\n },\n ratingsEmoji: {\n padding: 4,\n },\n ratingOptionsNumber: {\n margin: 10,\n flexGrow: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n borderRadius: 5,\n borderWidth: 1,\n overflow: 'hidden',\n },\n ratingsNumber: {\n flex: 1,\n paddingVertical: 10,\n alignItems: 'center',\n borderLeftWidth: 1,\n },\n ratingText: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n multipleChoiceOptions: {\n padding: 10,\n },\n choiceOption: {\n flexDirection: 'column',\n marginVertical: 5,\n borderWidth: 1,\n borderColor: 'grey',\n borderRadius: 5,\n padding: 10,\n },\n choiceText: {\n flexDirection: 'row',\n },\n rightCheckArea: {\n flexGrow: 0,\n },\n openEndedInput: {\n padding: 5,\n },\n validationHint: {\n fontSize: 12,\n opacity: 0.7,\n marginTop: 4,\n },\n})\n"],"mappings":"wlBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAEA,IAAAE,eAAA,CAAAF,OAAA,sBACA,IAAAG,MAAA,CAAAH,OAAA,aAUA,IAAAI,aAAA,CAAAJ,OAAA,qBAMA,IAAAK,gBAAA,CAAAL,OAAA,wBACA,IAAAM,KAAA,CAAAN,OAAA,kBASA,IAAAO,QAAA,CAAAP,OAAA,0BACA,IAAAQ,cAAA,CAAAR,OAAA,oBACA,IAAAS,eAAA,CAAAT,OAAA,qBAAiD,IAAAU,WAAA,CAAAV,OAAA,0BAAAW,YAAA,mHAAAZ,wBAAAa,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAf,uBAAA,UAAAA,wBAAAa,CAAA,CAAAC,C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