{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/PpSGzEoVzwhY8J30vkBA/2bYcD7AbbYGSOUo6Rc6j/ShowOverrides.js", "ssg:https://ga.jspm.io/npm:@motionone/utils@10.12.0/dist/index.es.js"],
  "sourcesContent": ["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// This store is being updated by the ShowCardGrid component\nexport const useStore=createStore({currentTgid:\"3023\"});// Show data for the swipesheet/popup\nexport function withShowTgid(Component){return props=>{const[store,setStore]=useStore();const tgid=store.currentTgid;return /*#__PURE__*/_jsx(Component,{...props,tgid:tgid});};}// Replace links that lead away from britishtheatre with buy-tickets\nexport function withHideShowLink(Component){return props=>{useEffect(()=>{// Find current element in the DOM\nconst currentElClassName=props.className;const currentEl=document.querySelector(`.${currentElClassName}`);// Find all links within the current element\nconst allLinksWithinCurrentEl=currentEl.querySelectorAll(\"a\");// Loop over all links\nallLinksWithinCurrentEl.forEach(a=>{// Check if link text includes the word \"book\"\nif(a.innerText.toLowerCase().includes(\"book\")){a.href=\"https://www.britishtheatre.com/buy-tickets\";}});},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// Replace links that lead away from britishtheatre with buy-tickets\nexport function withReplaceExternalLinksWithBuyTickets(Component){return props=>{useEffect(()=>{// Find current element in the DOM\nconst currentElClassName=props.className;const currentEl=document.querySelector(`.${currentElClassName}`);// Find all links within the current element\nconst allLinksWithinCurrentEl=currentEl.querySelectorAll(\"a\");// Loop over all links\nallLinksWithinCurrentEl.forEach(a=>{// If link is leading away from britishthreatre, point it to buy-tickets\nif(!a.href.includes(\"britishtheatre.com\")){a.href=\"https://www.britishtheatre.com/buy-tickets\";}});},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideShowLink\":{\"type\":\"reactHoc\",\"name\":\"withHideShowLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowTgid\":{\"type\":\"reactHoc\",\"name\":\"withShowTgid\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReplaceExternalLinksWithBuyTickets\":{\"type\":\"reactHoc\",\"name\":\"withReplaceExternalLinksWithBuyTickets\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShowOverrides.map", "function addUniqueItem(t,e){-1===t.indexOf(e)&&t.push(e)}function removeItem(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const clamp=(t,e,n)=>Math.min(Math.max(n,t),e);const t={duration:.3,delay:0,endDelay:0,repeat:0,easing:\"ease\"};const isNumber=t=>\"number\"===typeof t;const isString=t=>\"string\"===typeof t;const isEasingGenerator=t=>\"object\"===typeof t&&Boolean(t.createAnimation);const isCubicBezier=t=>Array.isArray(t)&&isNumber(t[0]);const isEasingList=t=>Array.isArray(t)&&!isNumber(t[0]);const wrap=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};function getEasingForSegment(t,e){return isEasingList(t)?t[wrap(0,t.length,e)]:t}const mix=(t,e,n)=>-n*t+n*e+t;const noop=()=>{};const noopReturn=t=>t;const progress=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function fillOffset(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const s=progress(0,e,o);t.push(mix(n,1,s))}}function defaultOffset(t){const e=[0];fillOffset(e,t-1);return e}function interpolate(t,e=defaultOffset(t.length),n=noopReturn){const o=t.length;const s=o-e.length;s>0&&fillOffset(e,s);return s=>{let r=0;for(;r<o-2;r++)if(s<e[r+1])break;let f=clamp(0,1,progress(e[r],e[r+1],s));const c=getEasingForSegment(n,r);f=c(f);return mix(t[r],t[r+1],f)}}const e={ms:t=>1e3*t,s:t=>t/1e3};\n/*\n  Convert velocity into velocity per second\n\n  @param [number]: Unit per frame\n  @param [number]: Frame duration in ms\n*/function velocityPerSecond(t,e){return e?t*(1e3/e):0}export{addUniqueItem,clamp,defaultOffset,t as defaults,fillOffset,getEasingForSegment,interpolate,isCubicBezier,isEasingGenerator,isEasingList,isNumber,isString,mix,noop,noopReturn,progress,removeItem,e as time,velocityPerSecond,wrap};\n\n//# sourceMappingURL=index.es.js.map"],
  "mappings": "uGAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,E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AE,UAAU,YAAY,EAAE,SAAS,MAAM,IAAGA,EAAE,KAAK,6CAA8C,CAAC,CAAE,EAAE,CAAC,CAAC,EAAsBJ,EAAKL,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAI,CACvJ,SAASS,EAAuCV,EAAU,CAAC,OAAOC,IAAQM,EAAU,IAAI,CAC/F,IAAMC,EAAmBP,EAAM,UAA0B,SAAS,cAAc,IAAIO,CAAkB,EAAE,EAChE,iBAAiB,GAAG,EACpC,QAAQC,GAAG,CAC/BA,EAAE,KAAK,SAAS,oBAAoB,IAAGA,EAAE,KAAK,6CAA8C,CAAC,CAAE,EAAE,CAAC,CAAC,EAAsBJ,EAAKL,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAI,CCZ/B,IAAMU,EAAM,CAACC,EAAEC,EAAE,IAAI,KAAK,IAAI,KAAK,IAAI,EAAED,CAAC,EAAEC,CAAC,EAAwhB,IAAMC,EAAS,CAACC,EAAEC,EAAE,IAAIA,EAAED,IAAI,EAAE,GAAG,EAAEA,IAAIC,EAAED",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "useStore", "createStore", "withShowTgid", "Component", "props", "store", "setStore", "tgid", "p", "withHideShowLink", "ue", "currentElClassName", "a", "withReplaceExternalLinksWithBuyTickets", "clamp", "t", "e", "progress", "t", "e"]
}
