1/*! 2 * toli-consent-loader.js 3 * PPåæã²ã¼ãï¼C360Aï¼MC Personalizationï¼èµ·åãã¼ãã¼ 4 * æ¹å¼: ãã¿ã¼ã³3ï¼Webãµã¤ãå´ã§åæå¾ã«SDKãèªã¿è¾¼ãï¼ï¼Aæ¡ã»èªç¤¾å®è£ 5 * è¨è¨æ¸: docs/pp-consent/consent-implementation-design.md 6 * ä¾å: /js/vendor/cookieconsent-3.1.0.umd.jsï¼å èªã¿å¿ é ã»èªç¤¾é ä¿¡ï¼ 7 * 8 * åä½åå: 9 * - åæå㯠C360A ãã¼ã³ã³ãä¸åãã¼ãããªãï¼Personalization許諾㯠10 * SDKå´ã§ããã©ã«ãONã®ããããã¼ãï¼éä¿¡éå§ãã²ã¼ãã¯ãããå¯ä¸ã®ç ¦ï¼ 11 * - æ¢åæãªã head è§£ææç¹ã§å³æãã¼ãï¼æ©æèµ·åï¼ 12 * - åååæã¯ ä¿åâ1åãªãã¼ãï¼ãã®å ´ææ ¼ã¯ ZeroFlicker éä¿è¨¼ã®ãã䏿¡ç¨ï¼ 13 * - æ¤å㯠OptOutéç¥(æ«å®)âSFç³»cookieåé¤âãªãã¼ãã§éçãã©ã¼ã«ããã¯å¾©å 14 */ 15(function (w, d) { 16 'use strict'; 17 18 /* ===== è¨å® ===== */ 19 // æ¬çªãã¼ã³ã³IDï¼2026-10-01 å ¬éã»æ±ãªæ§çµç±ã§ãã³ãã¼æ¯çµ¦ï¼ãæ¤è¨¼ç°å¢ ai-prv-toli 㯠preview-sync ã®æ³¨å ¥ã¹ã¯ãªããã§æ¤è¨¼ç¨IDã«æ¸ãæ»ã 20 var BEACON_SRC = 'https://cdn.c360a.salesforce.com/beacon/c360a/1a237dc6-b37c-4232-8ed1-c7b231835dc9/scripts/c360a.min.js'; 21 var COOKIE_NAME = 'toli_cc'; // first-party cookie å䏿£æ¬ 22 var REVISION = 2; // åææè¨ã»å¯¾è±¡ãå¤ããã +1ï¼ååæãä¿ãï¼ 23 var EXPIRES_DAYS = 182; 24 var CATEGORY = 'personalization'; 25 var POLICY_PAGE = '/info/privacy1.html'; 26 var COOKIE_POLICY = 'https://www.toli.co.jp/info/privacy2.html'; // ããã¼æ¬æãCookieããªã·ã¼ããªã³ã¯å 27 28 /* ===== C360Aèµ·åï¼1åã ãã»äºéèµ·å鲿¢ï¼ ===== */ 29 function loadBeacon() { 30 if (w.__toliC360aRequested) { return; } 31 w.__toliC360aRequested = true; 32 var s = d.createElement('script'); 33 s.src = BEACON_SRC; 34 s.async = false; // headæ©æã®æ¢åææã«èªã¿è¾¼ã¿é åºãç¶æãã 35 s.onerror = function () { 36 // ãã¼ã失ææã¯éçãã©ã¼ã«ããã¯ã®ã¾ã¾ï¼ãªãã©ã¤ã¯æ¬¡å訪åæï¼ 37 w.__toliC360aRequested = false; 38 }; 39 var ref = d.currentScript || d.getElementsByTagName('script')[0]; 40 ref.parentNode.insertBefore(s, ref); 41 } 42 43 /* ===== æ¢åæã®æ©æå¤å®ï¼CookieConsentåæåãå¾ ãã cookie ãç´æ¥èªãï¼ ===== */ 44 function hasStoredConsent() { 45 try { 46 var m = d.cookie.match(new RegExp('(?:^|; )' + COOKIE_NAME + '=([^;]*)')); 47 if (!m) { return false; } 48 var v = JSON.parse(decodeURIComponent(m[1])); 49 if (!v || v.revision !== REVISION) { return false; } 50 return !!(v.categories && v.categories.indexOf(CATEGORY) !== -1); 51 } catch (e) { 52 return false; // ç ´æcookieã¯æªåææ±ãâããã¼å表示ã«ä»»ãã 53 } 54 } 55 56 if (hasStoredConsent()) { loadBeacon(); } 57 58 /* ===== æ¤åå¦çï¼OptOutéç¥ã¯ best-effortã»SDK 㯠getSalesforceInteractions() ã§åå¾ï¼ ===== */ 59 function withdraw() { 60 try { 61 var SI = (typeof w.getSalesforceInteractions === 'function') ? w.getSalesforceInteractions() : w.SalesforceInteractions; 62 if (SI && typeof SI.updateConsents === 'function' && SI.ConsentStatus) { 63 SI.updateConsents([{ purpose: 'Personalization', status: SI.ConsentStatus.OptOut }]); 64 } 65 } catch (e) { /* OptOutéç¥ã¯ best-effort */ } 66 // SFç³»cookieã®åé¤ï¼æ£å¼ãªå ¨cookieä¸è¦§ã¯ãã³ãã¼ç¢ºèªCã®åçã§æ´æ°ï¼ 67 var names = d.cookie.split(';'); 68 var host = w.location.hostname; 69 var domains = ['', host, '.' + host, '.' + host.split('.').slice(-2).join('.')]; 70 for (var i = 0; i < names.length; i++) { 71 var name = names[i].split('=')[0].replace(/^\s+/, ''); 72 if (/^(_evga_|evergage|_sfid_)/.test(name)) { 73 for (var j = 0; j < domains.length; j++) { 74 d.cookie = name + '=; Max-Age=0; path=/' + (domains[j] ? '; domain=' + domains[j] : ''); 75 } 76 } 77 } 78 w.location.reload(); // ãªãã¼ãã§éçãã©ã¼ã«ããã¯ã¸å¾©å 79 } 80 81 /* åãªã¼ãã³å°ç·ã¯ããã¿ã¼ã®ãCookieã®è¨å®ããªã³ã¯ï¼data-cc="show-preferencesModal"ï¼ãæ ã 82 ï¼æ§ã»å·¦ä¸å¸¸é§ããã©ã¤ãã·ã¼è¨å®ããã«ã¯ 2026-08-26 ã¯ã©ã¤ã¢ã³ãæç¤ºã§åé¤ï¼ */ 83 84 /* ===== ããã¼ã® X ãã¿ã³ï¼éããï¼åæããªãï¼ ===== 85 UI/UX ãã¼ã çç³(2026-08-26): å³ä¸è§ã»ãããé å40px(SP44px)ã»SVG 1.5px strokeã» 86 aria-label ã¯å¯ä½ç¨ï¼æå¦ä¿åï¼ã¾ã§ä¼ãããåæããã«éãããã 87 bar ã¬ã¤ã¢ã¦ãã§ã¯æ¬ä½çµè¾¼ã® closeIcon ãåºãªã
87ããç¬èªæ¿å ¥ã 88 åä½ã¯æ¬ä½ X ã¨åã acceptCategory([])ï¼å¿ é ã®ã¿æ¿èªï¼=æå¦ã¨ãã¦ä¿åï¼ã */ 89 function rejectAndHide() { 90 if (w.CookieConsent) { 91 w.CookieConsent.acceptCategory([]); 92 w.CookieConsent.hide(); 93 } 94 } 95 96 function reorderButtons(modal) { 97 var g = modal && modal.querySelector('.cm__btn-group'); 98 if (!g) { return; } 99 var show = g.querySelector('[data-role="show"]'); 100 var all = g.querySelector('[data-role="all"]'); 101 if (show && all && show.nextElementSibling !== all) { g.insertBefore(show, all); } 102 } 103 104 function addCloseX(modal) { 105 if (!modal || modal.querySelector('.toli-cc-close')) { return; } 106 var b = d.createElement('button'); 107 b.type = 'button'; 108 b.className = 'toli-cc-close'; 109 b.setAttribute('aria-label', 'åæããã«éãã'); 110 b.innerHTML = '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">' + 111 '<path d="M2 2 L14 14 M14 2 L2 14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>'; 112 b.addEventListener('click', rejectAndHide); 113 modal.appendChild(b); // DOMæ«å°¾ï¼Tabé ã¯ æ¬æãªã³ã¯â詳細è¨å®âåæããâX 114 } 115 116 // Esc ã¯ããã¼è¡¨ç¤ºä¸ã®ã¿ X ã¨å®å ¨åä¸åä½ï¼è¨å®ã¢ã¼ãã«è¡¨ç¤ºä¸ã¯ãã¡ãã® Esc ã«è²ãï¼ 117 function onEscKey(e) { 118 if (e.keyCode !== 27) { return; } 119 var root = d.documentElement; 120 if (root.classList.contains('show--consent') && !root.classList.contains('show--preferences')) { 121 rejectAndHide(); 122 } 123 } 124 125 /* ===== CookieConsent v3 åæå ===== */ 126 function init() { 127 if (!w.CookieConsent) { return; } 128 w.CookieConsent.run({ 129 cookie: { name: COOKIE_NAME, expiresAfterDays: EXPIRES_DAYS, sameSite: 'Lax' }, 130 revision: REVISION, 131 disablePageInteraction: false, // éç¥åå¯ã: é²è¦§ã¯å¦¨ããªã 132 guiOptions: { 133 consentModal: { layout: 'bar inline', position: 'bottom center', equalWeightButtons: false, flipButtons: false }, 134 preferencesModal: { layout: 'box', equalWeightButtons: true } 135 }, 136 categories: { 137 necessary: { readOnly: true, enabled: true }, 138 personalization: {} 139 }, 140 onModalReady: function (p) { 141 if (p && p.modalName === 'consentModal') { reorderButtons(p.modal); addCloseX(p.modal); } 142 }, 143 onFirstConsent: function (p) { 144 // åååæ: ä¿åâ1åãªãã¼ãï¼ãªãã¼ãå¾ã¯æ©æå¤å®ã峿ãã¼ãï¼ãæå¦æã¯ä½ãããªã 145 if (p && p.cookie && p.cookie.categories.indexOf(CATEGORY) !== -1) { 146 w.location.reload(); 147 } 148 }, 149 onChange: function (p) { 150 var accepted = p.cookie.categories.indexOf(CATEGORY) !== -1; 151 if (accepted && !w.__toliC360aRequested) { w.location.reload(); return; } 152 if (!accepted && w.__toliC360aRequested) { withdraw(); } 153 }, 154 language: { 155 default: 'ja', 156 translations: { 157 ja: { 158 consentModal: { 159 title: 'Cookieã®ä½¿ç¨ã«ã¤ãã¦', 160 description: 'å½ãµã¤ãã§ã¯ãã客æ§ã«ããå¿«é©ã«ãå©ç¨ããã ããããCookieã使ç¨ãã¦ãã¾ããCookieã¯ããµã¤ãã®å©ç¨ç¶æ³ã®åæããµã¼ãã¹ã®æ¹åãããã³ã客æ§ã«é©ããæ å ±æä¾ã®ããã«å©ç¨ããã¾ãã<br>Cookieã®å©ç¨ã«åæããã ããå ´åã¯ãåæããããã¯ãªãã¯ãã¦ãã ããã詳細ã¯ã<a href="' + COOKIE_POLICY + '">Cookieããªã·ã¼</a>ããã確èªãã ããããªããCookieã®è¨å®ã¯ãã¤ã§ã夿´ã§ãã¾ãã', 161 acceptAllBtn: 'åæãã', 162 showPreferencesBtn: '詳細è¨å®' 163 }, 164 preferencesModal: { 165 title: 'Cookieã®è©³ç´°è¨å®', 166 acceptAllBtn: 'ãã¹ã¦åæãã', 167 acceptNecessaryBtn: 'ãã¹ã¦æå¦ãã', 168 savePreferencesBtn: 'è¨å®ãä¿åãã', 169 closeIconLabel: 'éãã', 170 sections: [ 171 { 172 title: 'Cookieã®å©ç¨ã«ã¤ãã¦', 173 description: 'å½ãµã¤ãã§ã®Cookieã®å©ç¨ç®çãã«ãã´ãªãã¨ã«é¸æã§ãã¾ããè¨å®ã¯ãã¤ã§ããã®ç»é¢ãã夿´ã§ãã¾ãã' 174 }, 175 { 176 title: 'å¿ é Cookie', 177 description: 'ãµã¤ãã®åºæ¬æ©è½ã®æä¾ã«å¿ è¦ãªãã®ã§ãç¡å¹ã«ã§ãã¾ããã', 178 linkedCategory: 'necessary' 179 }, 180 { 181 title: 'ãã¼ã½ãã©ã¤ãºï¼ãããã表示ï¼', 182 description: 'é²è¦§ç¶æ³ã«å¿ããããããã³ã³ãã³ãã®è¡¨ç¤ºã®ã
182ããå¤é¨ãµã¼ãã¹ï¼Salesforceï¼ã«é²è¦§æ å ±ãéä¿¡ããã¾ããç¡å¹ã®å ´åã¯æ¨æºã®ã³ã³ãã³ãã表示ããã¾ãã', 183 linkedCategory: 'personalization' 184 }, 185 { 186 title: 'ãã©ã¤ãã·ã¼ããªã·ã¼', 187 description: 'Cookieã®åãæ±ããå«ãå人æ å ±ä¿è·ã®è©³ç´°ã«ã¤ãã¦ã¯ã<a href="' + POLICY_PAGE + '">ãã©ã¤ãã·ã¼ããªã·ã¼</a>ãã覧ãã ããã' 188 } 189 ] 190 } 191 } 192 } 193 } 194 }); 195 196 d.addEventListener('keydown', onEscKey, true); 197 } 198 199 /* ===== ããã¿ã¼çããå¼ã¶å ¬éAPIï¼ããã©ã¤ãã·ã¼è¨å®ã常è¨ãªã³ã¯ç¨ï¼ ===== */ 200 w.toliConsent = { 201 showPreferences: function () { if (w.CookieConsent) { w.CookieConsent.showPreferences(); } }, 202 showBanner: function () { if (w.CookieConsent) { w.CookieConsent.show(true); } } 203 }; 204 205 if (d.readyState === 'loading') { 206 d.addEventListener('DOMContentLoaded', init); 207 } else { 208 init(); 209 } 210})(window, document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.