{"version":3,"names":["want","URLSearchParams","window","location","search","get","document","cookie","test","documentElement","classList","add","e"],"sources":["theme-315-inline-common-head_tag.js"],"sourcesContent":["\n  // NOTE: this does not run inline. Under a content security policy\n  // Discourse lifts an inline theme script out of head_tag into a file\n  // of its own and loads it deferred, so it runs after the document is\n  // parsed. In a browser that is fine. In the app it would mean the\n  // site's header painting and then vanishing on every page open, so\n  // the app adds the same class itself at document start and this\n  // script finds it already there (ForumPageClass in the Flutter app).\n  //\n  // This is still what makes a browser correct, and it is the only\n  // thing that does -- a reader who opens the same page outside the app\n  // has no user script.\n  //\n  // The app writes a `vc_app` cookie on this origin before it loads any\n  // page (AppMarkerCookie in the Flutter app). Nothing else sets it, so a\n  // browser never takes this branch.\n  //\n  // `?vc_app=1` sets the cookie by hand and `?vc_app=0` clears it. That is\n  // how to see what the app sees without installing it, and — more\n  // importantly — how to get the site's navigation back if this component\n  // ever hides it when it should not.\n  (function () {\n    try {\n      var want = new URLSearchParams(window.location.search).get(\"vc_app\");\n      if (want === \"1\") {\n        document.cookie = \"vc_app=preview;path=/;max-age=31536000;samesite=lax\";\n      } else if (want === \"0\") {\n        document.cookie = \"vc_app=;path=/;max-age=0;samesite=lax\";\n      }\n      if (/(?:^|;\\s*)vc_app=[^;\\s]/.test(document.cookie)) {\n        document.documentElement.classList.add(\"vc-in-app\");\n      }\n    } catch (e) {\n      // A browser that refuses cookies simply never gets the class, and\n      // sees the site exactly as it always did.\n    }\n  })();\n"],"mappings":"AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,YAAY;EACX,IAAI;IACF,IAAIA,IAAI,GAAG,IAAIC,eAAe,CAACC,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC,CAACC,GAAG,CAAC,QAAQ,CAAC;IACpE,IAAIL,IAAI,KAAK,GAAG,EAAE;MAChBM,QAAQ,CAACC,MAAM,GAAG,qDAAqD;IACzE,CAAC,MAAM,IAAIP,IAAI,KAAK,GAAG,EAAE;MACvBM,QAAQ,CAACC,MAAM,GAAG,uCAAuC;IAC3D;IACA,IAAI,yBAAyB,CAACC,IAAI,CAACF,QAAQ,CAACC,MAAM,CAAC,EAAE;MACnDD,QAAQ,CAACG,eAAe,CAACC,SAAS,CAACC,GAAG,CAAC,WAAW,CAAC;IACrD;EACF,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV;IACA;EAAA;AAEJ,CAAC,EAAE,CAAC","ignoreList":[]}