1 line
104 KiB
Plaintext
1 line
104 KiB
Plaintext
/*! For license information please see sdk.js.LICENSE.txt */!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("liff",[],t):"object"==typeof exports?exports.liff=t():e.liff=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://static.line-scdn.net/liff/edge/2/",n(n.s=9)}([function(e,t,n){"use strict";t.a=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}},function(e,t,n){"use strict";t.a=function(e){return new this((function(t,n){if(!e||void 0===e.length)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(t){i(e,t)}),(function(n){r[e]={status:"rejected",reason:n},0==--o&&t(r)}))}r[e]={status:"fulfilled",value:n},0==--o&&t(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(1),i=setTimeout;function a(e){return Boolean(e&&void 0!==e.length)}function s(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function c(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void f(t.promise,o)}l(t.promise,r)}else(1===e._state?l:f)(t.promise,e._value)}))):e._deferreds.push(t)}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof u)return e._state=3,e._value=t,void h(e);if("function"==typeof n)return void p((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,h(e)}catch(i){f(e,i)}var r,o}function f(e,t){e._state=2,e._value=t,h(e)}function h(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)c(e,e._deferreds[t]);e._deferreds=null}function d(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function p(e,t){var n=!1;try{e((function(e){n||(n=!0,l(t,e))}),(function(e){n||(n=!0,f(t,e))}))}catch(r){if(n)return;n=!0,f(t,r)}}u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){var n=new this.constructor(s);return c(this,new d(e,t,n)),n},u.prototype.finally=r.a,u.all=function(e){return new u((function(t,n){if(!a(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(t){i(e,t)}),n)}r[e]=a,0==--o&&t(r)}catch(u){n(u)}}for(var s=0;s<r.length;s++)i(s,r[s])}))},u.allSettled=o.a,u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u((function(t){t(e)}))},u.reject=function(e){return new u((function(t,n){n(e)}))},u.race=function(e){return new u((function(t,n){if(!a(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)u.resolve(e[r]).then(t,n)}))},u._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){i(e,0)},u._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console},t.a=u}).call(this,n(6).setImmediate)},function(e,t,n){var r,o,i;o=[],void 0===(i="function"==typeof(r=function(){var e=function e(t){function n(e,t){return e>>>t|e<<32-t}for(var r,o,i=Math.pow,a=i(2,32),s="",u=[],c=8*t.length,l=e.h=e.h||[],f=e.k=e.k||[],h=f.length,d={},p=2;h<64;p++)if(!d[p]){for(r=0;r<313;r+=p)d[r]=p;l[h]=i(p,.5)*a|0,f[h++]=i(p,1/3)*a|0}for(t+="";t.length%64-56;)t+="\0";for(r=0;r<t.length;r++){if((o=t.charCodeAt(r))>>8)return;u[r>>2]|=o<<(3-r)%4*8}for(u[u.length]=c/a|0,u[u.length]=c,o=0;o<u.length;){var v=u.slice(o,o+=16),b=l;for(l=l.slice(0,8),r=0;r<64;r++){var y=v[r-15],w=v[r-2],m=l[0],g=l[4],I=l[7]+(n(g,6)^n(g,11)^n(g,25))+(g&l[5]^~g&l[6])+f[r]+(v[r]=r<16?v[r]:v[r-16]+(n(y,7)^n(y,18)^y>>>3)+v[r-7]+(n(w,17)^n(w,19)^w>>>10)|0);(l=[I+((n(m,2)^n(m,13)^n(m,22))+(m&l[1]^m&l[2]^l[1]&l[2]))|0].concat(l))[4]=l[4]+I|0}for(r=0;r<8;r++)l[r]=l[r]+b[r]|0}for(r=0;r<8;r++)for(o=3;o+1;o--){var T=l[r]>>8*o&255;s+=(T<16?0:"")+T.toString(16)}return s};return e.code='var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math.pow,g=f(2,32),h="length",i="",j=[],k=8*b[h],l=a.h=a.h||[],m=a.k=a.k||[],n=m[h],o={},p=2;64>n;p++)if(!o[p]){for(d=0;313>d;d+=p)o[d]=p;l[n]=f(p,.5)*g|0,m[n++]=f(p,1/3)*g|0}for(b+="\\x80";b[h]%64-56;)b+="\\x00";for(d=0;d<b[h];d++){if(e=b.charCodeAt(d),e>>8)return;j[d>>2]|=e<<(3-d)%4*8}for(j[j[h]]=k/g|0,j[j[h]]=k,e=0;e<j[h];){var q=j.slice(e,e+=16),r=l;for(l=l.slice(0,8),d=0;64>d;d++){var s=q[d-15],t=q[d-2],u=l[0],v=l[4],w=l[7]+(c(v,6)^c(v,11)^c(v,25))+(v&l[5]^~v&l[6])+m[d]+(q[d]=16>d?q[d]:q[d-16]+(c(s,7)^c(s,18)^s>>>3)+q[d-7]+(c(t,17)^c(t,19)^t>>>10)|0),x=(c(u,2)^c(u,13)^c(u,22))+(u&l[1]^u&l[2]^l[1]&l[2]);l=[w+x|0].concat(l),l[4]=l[4]+w|0}for(d=0;8>d;d++)l[d]=l[d]+r[d]|0}for(d=0;8>d;d++)for(e=3;e+1;e--){var y=l[d]>>8*e&255;i+=(16>y?0:"")+y.toString(16)}return i};',e})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){"use strict";(function(e){var t=n(3),r=n(0),o=n(1),i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}();"function"!=typeof i.Promise?i.Promise=t.a:i.Promise.prototype.finally?i.Promise.allSettled||(i.Promise.allSettled=o.a):i.Promise.prototype.finally=r.a}).call(this,n(2))},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(7),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},h.clearImmediate=d}function d(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(2),n(8))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t),n.d(t,"liff",(function(){return Xr}));var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r&&r,o="URLSearchParams"in r,i="Symbol"in r&&"iterator"in Symbol,a="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in r,u="ArrayBuffer"in r;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function v(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function b(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=b(t);return t.readAsArrayBuffer(e),n}function w(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=w(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=w(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=v(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(y)}),this.text=function(){var e,t,n,r=v(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=b(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(T)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=f(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},p.prototype.delete=function(e){delete this.map[f(e)]},p.prototype.get=function(e){return e=f(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(f(e))},p.prototype.set=function(e,t){this.map[f(e)]=h(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),d(e)},i&&(p.prototype[Symbol.iterator]=p.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function I(e,t){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,o=(t=t||{}).body;if(e instanceof I){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function T(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function E(e,t){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})},m.call(I.prototype),m.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];E.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})};var _=r.DOMException;try{new _}catch($r){(_=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),_.prototype.constructor=_}function O(e,t){return new Promise((function(n,o){var i=new I(e,t);if(i.signal&&i.signal.aborted)return o(new _("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;setTimeout((function(){n(new E(o,r))}),0)},s.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.onabort=function(){setTimeout((function(){o(new _("Aborted","AbortError"))}),0)},s.open(i.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&(a?s.responseType="blob":u&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof p?i.headers.forEach((function(e,t){s.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){s.setRequestHeader(e,h(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",c)}),s.send(void 0===i._bodyInit?null:i._bodyInit)}))}O.polyfill=!0,r.fetch||(r.fetch=O,r.Headers=p,r.Request=I,r.Response=E);n(5);var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function P(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function C(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function x(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;Object.create;function A(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function F(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(A(arguments[t]));return e}var j,L;Object.create;(L=j||(j={}))[L.DEBUG=1]="DEBUG",L[L.INFO=2]="INFO",L[L.WARN=3]="WARN",L[L.ERROR=4]="ERROR";var N=new(function(){function e(e){void 0===e&&(e=j.INFO),this.logLevel=e,this._debug=console.debug,this._info=console.info,this._warn=console.warn,this._error=console.error}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=j.DEBUG&&(e.unshift("[DEBUG]"),this._debug.apply(this,F(e)))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=j.INFO&&(e.unshift("[INFO]"),this._info.apply(this,F(e)))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=j.WARN&&(e.unshift("[WARN]"),this._warn.apply(this,F(e)))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=j.ERROR&&(e.unshift("[ERROR]"),this._error.apply(this,F(e)))},e}())(Number("3")),U=function(e,t){return(U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};Object.create;function R(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var B="INVALID_ARGUMENT",M="INIT_FAILED",W="INVALID_CONFIG",G="INVALID_ID_TOKEN",H="EXCEPTION_IN_SUBWINDOW",V={ACCESS_TOKEN:"accessToken",ID_TOKEN:"IDToken",DECODED_ID_TOKEN:"decodedIDToken",FEATURE_TOKEN:"featureToken",LOGIN_TMP:"loginTmp",CONFIG:"config",CONTEXT:"context",EXPIRES:"expires",RAW_CONTEXT:"rawContext",CLIENT_ID:"clientId",IS_SUBSEQUENT_LIFF_APP:"isSubsequentLiffApp",MST_CHALLENGE:"mstChallenge",MSIT:"msit",MST:"mst",MST_VERIFIER:"mstVerifier",APP_DATA:"appData",AUTOLOGIN_ATTEMPT:"autologinAttempt"},K="isInClient",J=["context_token","feature_token","access_token","id_token","client_id","mst_verifier","mst_challenge","msit"],q=["liff.ref.source","liff.ref.medium","liff.ref.campaign","liff.ref.term","liff.ref.content"],z="cancel",Z="submit",X=["profile","chat_message.write","openid","email"];function $(e){return window.atob(e.replace(/-/g,"+").replace(/_/g,"/"))}var Q={decode:$,encode:function(e){return window.btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decodeUnicode:function(e){var t=$(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("");return decodeURIComponent(t)}};function Y(e,t){if(e===t)return 0;for(var n=e.split("."),r=t.split("."),o=Math.max(n.length,r.length),i=0;i<o;i++){n[i]||(n[i]="0"),r[i]||(r[i]="0");var a=parseInt(n[i])-parseInt(r[i]);if(0!==a)return a>0?1:-1}return 0}function ee(e){var t=e.replace("#","").match(/.{2}/g)||[];if(4!==t.length)return N.warn("convertArgbToRgba: Received invalid ARGB color"),"";var n=function(e){var t=te(e);return Math.round(t/255*100)/100}(t[0]);return"rgba("+te(t[1])+", "+te(t[2])+", "+te(t[3])+", "+n+")"}function te(e){return parseInt(e,16)}function ne(e){var t=e.replace("#","").match(/.{2}/g)||[];return 3!==t.length?(N.warn("convertArgbToRgba: Received invalid hex color"),""):te(t[0])+", "+te(t[1])+", "+te(t[2])}function re(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}var oe=function(e){var t=new RegExp("(?:(?:^|.*;\\s*)"+e+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(t,"$1")},ie=function(e,t,n){var r=e+"="+t;if(n)for(var o in n)r+="; "+o+(n[o]?"="+n[o]:"");N.debug("set cookie",r),document.cookie=r},ae=function(e,t){var n=e+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(t)for(var r in t)n+="; "+r+"="+t[r];document.cookie=n},se=new Set(["400","401","403","404","429","500"]),ue=function(e){function t(t,n){var r=e.call(this,n)||this;return r.code=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}U(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);function ce(e,t){return new ue(e,t||"")}function le(e){var t=e.match(/([^-]+)-[^-]+/);return t&&t[1]}var fe=new(function(){function e(){this.map={}}return e.prototype.clear=function(){this.map={}},e.prototype.getItem=function(e){var t=this.map[e];return void 0===t?null:t},e.prototype.setItem=function(e,t){this.map[e]=t},e.prototype.removeItem=function(e){delete this.map[e]},e.prototype.key=function(e){var t=Object.keys(this.map)[e];return void 0===t?null:t},Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.map).length},enumerable:!1,configurable:!0}),e}()),he=function(e){return e.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(e){return e.length>0})).reduce((function(e,t){var n=D(t.split("=").map(decodeURIComponent),2),r=n[0],o=n[1],i=e[r];return Array.isArray(i)?i.push(o):Object.prototype.hasOwnProperty.call(e,r)?e[r]=[i,o]:e[r]=o,e}),{})},de=function(e){return Object.keys(e).map((function(t){var n=e[t],r=function(e){return void 0!==e?encodeURIComponent(t)+"="+encodeURIComponent(e):encodeURIComponent(t)};return Array.isArray(n)?n.map((function(e){return r(e)})).join("&"):r(n)})).join("&")},pe="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function ve(e){for(var t="",n=0;n<e;n++)t+=pe[Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967296*pe.length)];return t}function be(e){var t=new URL(e),n=t.hash.slice(1).split("&").filter((function(e){return!J.some((function(t){return e.includes(t+"=")}))})).join("&");return t.hash=n,t.toString()}function ye(e){var t,n,r=new URL(e);return r.toString().replace(new RegExp(String.raw(we||(t=["^",""],n=["^",""],Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,we=t),r.origin)),"")}var we;function me(e,t){if(!e)throw new Error("addParamsToUrl: invalid URL");var n=new URL(e);return Object.entries(t).forEach((function(e){var t=D(e,2),r=t[0],o=t[1];n.searchParams.set(r,o)})),n.toString()}function ge(e){var t=e.match(Ie());return t&&t[1]}function Ie(){return new RegExp("^https://liff.line.me/(\\d+-\\w+)")}function Te(e){return void 0===e&&(e=window.navigator.userAgent),/ipad/.test(e.toLowerCase())}var Ee,Se=new Promise((function(e){Ee=e})),_e=null;function Oe(){return null===_e&&(void 0===e&&(e=window.navigator.userAgent),_e=/Line\/\d+\.\d+\.\d+ LIFF/.test(e)||function(e){return void 0===e&&(e=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(e)}()&&/[#|&]access_token=/.test(location.hash)||"1"===sessionStorage.getItem("LIFF_STORE:"+K),sessionStorage.setItem("LIFF_STORE:"+K,_e?"1":"0")),!!_e;var e}var ke,Pe={};function Ce(){return Pe}function xe(e){return function(e,t){if(!t)throw ce(W,"liffId is necessary for liff.init()");var n=(Oe()?sessionStorage:localStorage).getItem("LIFF_STORE:"+t+":"+e);try{return null===n?null:JSON.parse(n)}catch(r){return null}}(e,Ce().liffId)}function Ae(e,t){var n=Ce().liffId;if(!n)throw ce(W,"liffId is necessary for liff.init()");(Oe()?sessionStorage:localStorage).setItem("LIFF_STORE:"+n+":"+e,JSON.stringify(t))}function Fe(){return xe(V.CONTEXT)}function je(e){Ae(V.CONTEXT,e)}function Le(e){Ae(V.APP_DATA,e)}function Ne(){return xe(V.MST)}function Ue(){return xe(V.MST_CHALLENGE)}function Re(e){Ae(V.CLIENT_ID,e)}function De(){return xe(V.FEATURE_TOKEN)}function Be(e){Ae(V.FEATURE_TOKEN,e)}function Me(){return xe(V.ID_TOKEN)}function We(e){Ae(V.ID_TOKEN,e)}function Ge(){return xe(V.ACCESS_TOKEN)}function He(e){Ae(V.ACCESS_TOKEN,e)}function Ve(e){var t=Ce().liffId;if(!t)throw ce(W,"liffId is necessary for liff.init()");(Oe()?sessionStorage:localStorage).removeItem("LIFF_STORE:"+t+":"+e)}function Ke(){return xe(V.LOGIN_TMP)}function Je(){Ve(V.LOGIN_TMP)}function qe(){return xe(V.DECODED_ID_TOKEN)}function ze(e){Ae(V.DECODED_ID_TOKEN,e)}function Ze(){var e;Object.keys(V).forEach((function(e){Ve(V[e])})),e=Ce(),ae("LIFF_STORE:"+V.EXPIRES+":"+e.liffId,{path:"/"})}function Xe(){return!!Ge()}function $e(){if(!ke){var e=window.navigator.userAgent.toLowerCase();ke=/iphone|ipad|ipod/.test(e)?"ios":/android/.test(e)?"android":"web"}return ke}function Qe(){var e=navigator.userAgent.match(/Line\/\d+(\.\d+)*/i);return e?e[0].slice(5):null}function Ye(){return function(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(e){switch(e.label){case 0:return[3,2];case 1:return[2,e.sent().default];case 2:return[2,new Promise((function(e,t){var n,r=document.createElement("script"),o="ios"===$e()?(n=Qe())&&Y(n,"9.19.0")<0?"https://static.line-scdn.net/liff/edge/2/ios-918-extensions.js":"https://static.line-scdn.net/liff/edge/2/ios-extensions.js":"https://static.line-scdn.net/liff/edge/2/non-ios-extensions.js";r.onload=function(){var n=window.liffClientExtension;n?e(n):t(ce(M,"Unable to load client features. (Extension is empty)"))},r.onerror=function(){t(ce(M,"Unable to load client features."))},r.src=o,r.type="text/javascript",document.body.appendChild(r)}))]}}))}))}()}function et(){Ze()}var tt=function(){function e(){}return e.prototype.invoke=function(){return void 0===e&&(e=window.navigator.userAgent),/LIFF\/SubWindow/.test(e);var e},e}(),nt=function(){function e(e){this.storage=e}return Object.defineProperty(e,"IN_SUB_WINDOW_KEY",{get:function(){return"inSubWindow"},enumerable:!1,configurable:!0}),e.prototype.invoke=function(){return!!this.getInSubWindow()||!!new URLSearchParams(window.location.search).has("liff.subwindow")&&(this.setInSubWindow(!0),!0)},e.prototype.getInSubWindow=function(){var t=this.storage.getItem("LIFF_STORE:"+this.getLiffId()+":"+e.IN_SUB_WINDOW_KEY);return null!==t&&JSON.parse(t)},e.prototype.setInSubWindow=function(t){this.storage.setItem("LIFF_STORE:"+this.getLiffId()+":"+e.IN_SUB_WINDOW_KEY,String(t))},e.prototype.getLiffId=function(){var e=Ce().liffId;if(!e)throw ce(W,"liffId is necessary for liff.init()");return e},e}(),rt=new(function(){function e(){Oe()?this.impl=new tt:this.impl=new nt(window.sessionStorage)}return Object.defineProperty(e.prototype,"name",{get:function(){return"isSubWindow"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return this.impl.invoke.bind(this.impl)},e}()),ot=rt.install(),it=["subwindowOpen","shareTargetPicker","multipleLiffTransition","scanCode","scanCodeV2","getAdvertisingId","addToHomeScreen","bluetoothLeFunction","skipChannelVerificationScreen"];function at(e){var t,n=Fe();return null===(t=null==n?void 0:n.availability)||void 0===t?void 0:t[e]}function st(e,t){var n=Qe();return!!n&&!(t&&Y(n,t)>0)&&Y(n,e)>=0}function ut(e){var t=at(e);if(!t)return!1;var n=t.permission,r=t.minVer,o=t.unsupportedFromVer;return!!n&&!!Oe()&&st(r,o)}var ct={shareTargetPicker:function(){if(!Xe())return!1;var e=at("shareTargetPicker");if(!e)return!1;var t=e.permission,n=e.minVer;if(!t)return!1;if(Oe()){var r=Qe();return null!==r&&Y(r,n)>=0}return!0},multipleLiffTransition:function(){var e=at("multipleLiffTransition");if(!e)return!1;var t=e.permission;return Oe()&&t},subwindowOpen:function(){var e=at("subwindowOpen");return!(!e||!e.permission)&&(!Oe()||st(e.minVer,e.unsupportedFromVer))},scanCode:function(){return ut("scanCode")},scanCodeV2:function(){var e=at("scanCodeV2");return!(!e||!e.permission)&&(!Oe()||st(e.minVer))},getAdvertisingId:function(){return ut("getAdvertisingId")},addToHomeScreen:function(){return ut("addToHomeScreen")},bluetoothLeFunction:function(){return ut("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return ut("skipChannelVerificationScreen")}};function lt(e){if(!it.includes(e))throw ce(B,"Unexpected API name.");var t=ct[e];return!t||t()}function ft(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function ht(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function dt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var pt=function(){return(pt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function vt(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function bt(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;Object.create;function yt(e){return vt(this,void 0,void 0,(function(){var t,n,r;return bt(this,(function(o){switch(o.label){case 0:if(!e.ok)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e.json()];case 2:return[2,o.sent()];case 3:return o.sent(),[2,e];case 4:return t=String(e.status),n=se.has(t)?t:"UNKNOWN",[4,e.json().catch((function(){throw ce(n,e.statusText)}))];case 5:throw ce((r=o.sent()).error||n,r.error_description||r.message)}}))}))}function wt(e){var t=function(e){if(e)return e;var t=Ge();if(!t)throw ce("UNAUTHORIZED","Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+t}}(e&&e.headers);return pt(pt({},e),{headers:t})}function mt(e,t){var n;try{n=wt(t)}catch(r){return Promise.reject(r)}return fetch(e,n).then(yt)}function gt(e,t){var n;try{n=wt(t)}catch(r){return Promise.reject(r)}return fetch(e,n)}function It(e){var t=e.subdomain;return"https://"+(void 0===t?"api":t)+".line.me/"+e.pathname}var Tt={token:It({pathname:"oauth2/v2.1/token"}),certs:It({pathname:"oauth2/v2.1/certs"}),"openid-configuration":It({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:It({subdomain:"access",pathname:"liff/v1/authorize"}),profile:It({pathname:"v2/profile"}),message:It({pathname:"message/v3/share"}),messageOTT:It({pathname:"message/v3/multisend?type=ott"}),friendship:It({pathname:"friendship/v1/status"}),shareTargetPicker:It({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:It({pathname:"liff/v2/apps"}),shareTargetPickerResult:It({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:It({pathname:"liff/v2/apps"}),subWindowGetMSIT:It({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:It({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:It({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:It({pathname:"liff/v2/sub/result"}),subWindowGetAppData:It({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return It({pathname:"liff/v2/sub/"+e+"/origin"})},accessTokenVerify:It({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:It({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:It({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function Et(e){return Tt[e]}function St(e){return mt(Et("accessTokenVerify")+"?access_token="+encodeURIComponent(e),{headers:{"Content-Type":"application/json",Accept:"application/json"}})}var _t=function(){return(_t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;!function(){if("function"!=typeof window.CustomEvent){function e(e,t){var n=t||{},r=n.bubbles,o=void 0!==r&&r,i=n.cancelable,a=void 0!==i&&i,s=n.detail,u=void 0===s?void 0:s,c=document.createEvent("CustomEvent");return c.initCustomEvent(e,o,a,u),c}e.prototype=Event.prototype,window.CustomEvent=e}}();var Ot={},kt=!1;function Pt(e,t){kt||(kt=!0,window.addEventListener("liffEvent",(function(e){e&&e.detail&&e.detail.type&&Ot[e.detail.type]&&Ot[e.detail.type].forEach((function(t){return t(e)}))}))),Ot[e]?Ot[e].push(t):Ot[e]=[t]}function Ct(e,t){var n=Ot[e];if(n&&Array.isArray(n)){var r=n.indexOf(t);r>=0&&n.splice(r,1)}}function xt(e,t,n){void 0===t&&(t={}),void 0===n&&(n="");var r=De();if(!r)throw ce("FORBIDDEN","Invalid featureToken for client features");if(!window._liff||!window._liff.postMessage)throw ce(B,"postMessage is not available from client");N.debug("[js postMessage to client]",e,n,t),window._liff.postMessage(e,r,n,JSON.stringify(t))}function At(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={once:!0}),De()?(n=_t({callbackId:ve(12),once:!0},n),new Promise((function(r,o){var i=function(t){if(t&&t.detail){var a=t.detail.callbackId===n.callbackId,s="string"!=typeof t.detail.callbackId;(a||s)&&(n.once&&Ct(e,i),N.debug("[callback detail]",t.detail),t.detail.error?o(t.detail.error):t.detail.data?r(t.detail.data):o(t.detail))}o()};Pt(e,i),xt(e,t,n.callbackId)}))):Promise.reject(ce("FORBIDDEN","Invalid featureToken for client features"))}function Ft(){var e=Qe();null!==e&&("ios"===$e()&&Y(e,"9.19")>=0||"android"===$e()&&Y(e,"11.6.0")>=0)?location.href="liff://close":window._liff&&window._liff.postMessage?null!==e&&Y(e,"10.15.0")>=0?"ios"===$e()?window._liff.postMessage("closeWindow",""):window._liff.postMessage("closeWindow","","",""):At("closeWindow"):window.close()}function jt(e){return mt(Et("subWindowGetOrigin")(e))}var Lt={};function Nt(e,t){e&&Lt[e]&&Lt[e].forEach((function(e){e(t)}))}var Ut,Rt,Dt,Bt,Mt=function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(this.getKeyPrefix()+":"+e)},e.prototype.setItem=function(e,t){this.storage.setItem(this.getKeyPrefix()+":"+e,t)},e.prototype.removeItem=function(e){this.storage.removeItem(this.getKeyPrefix()+":"+e)},e.prototype.clear=function(){this.storage.clear()},e.prototype.getKeyPrefix=function(){return"LIFF_STORE:"+this.getLiffId()},e.prototype.getLiffId=function(){var e=Ce().liffId;if(!e)throw ce(W,"liffId is necessary for liff.init()");return e},e}(),Wt=new Mt(fe);function Gt(){var e=Wt.getItem("subWindowStatusUpdated");return null!==e&&JSON.parse(e)}function Ht(e){Wt.setItem("subWindowStatusUpdated",String(e))}function Vt(e){Ut=e}function Kt(){return Ut}function Jt(){return Dt}function qt(){return Bt}var zt=new Mt(window.sessionStorage);function Zt(){return zt.getItem("mainWindowOrigin")}function Xt(e,t){return void 0===t&&(t={}),ft(this,void 0,void 0,(function(){var n,r,o,i,a,s,u;return ht(this,(function(c){switch(c.label){case 0:if(n=Ce().liffId,r=Zt(),!window.opener||!r||!n)throw ce(H);o=!1,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,jt(n)];case 2:return i=c.sent(),o=i.subwindowCommonModule,[3,4];case 3:throw a=c.sent(),N.debug(a),ce(H);case 4:return s=JSON.stringify(t),u=o?r:location.origin,[2,new Promise((function(t){window.addEventListener("message",(function n(r){(function(e){return!(!e.data||"string"!=typeof e.data.type||![Z,z].includes(e.data.type))})(r)&&(window.removeEventListener("message",n),t({status:e,result:s}))})),window.opener.postMessage({status:e,result:s},u)}))]}}))}))}function $t(e){var t,n=qt();if(e.origin===n){var r=e.data;if(r){var o,i=r.status,a=r.result;try{o=JSON.parse(a||"{}")}catch(s){o={}}switch(i){case"healthCheck":window.clearInterval(Jt());break;case z:case Z:Ht(!0),window.clearInterval(Jt()),window.removeEventListener("message",$t),Nt(i,o),null===(t=Kt())||void 0===t||t.postMessage({type:i},qt());break;default:N.debug("unexpected message")}}}}function Qt(){window.clearInterval(Rt),window.clearInterval(Jt()),window.removeEventListener("message",$t)}function Yt(e){var t=ge(e.url);if(!t)return Promise.reject(ce(B,"params.url must be liff url"));!function(){Qt(),Ht(!1);var e=Kt();e&&(e.close(),Vt(null))}();var n,r=e.url,o=e.appData,i=new URL(r);i.searchParams.append("liff.subwindow","true"),i.hostname=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(dt(arguments[t]));return e}([(n=dt(i.hostname.split(".")))[0]+"-ext"],n.slice(1)).join(".");var a=i.toString();return Vt("ios"!==$e()||Te()?window.open("","liffsubwindow","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):window.open()),jt(t).then((function(e){var t,n=e.origin,r=e.subwindowCommonModule,i=Kt();if(!i)throw ce("CREATE_SUBWINDOW_FAILED");r?(function(e){Bt=e}(n),window.addEventListener("message",$t),i.location.href=a,t=function(e,t){var n=Kt(),r={type:"healthCheck"};return t&&(r.message=JSON.stringify(t)),window.setInterval((function(){null==n||n.postMessage(r,e)}),100)}(n,o),Dt=t,function(e){Rt=e}(window.setInterval((function(){var e=Kt();e&&e.closed&&(Qt(),Vt(null),!1===Gt()&&(Ht(!0),Nt("close",{})))}),100))):i.close()}))}function en(e){return ft(this,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,l,f;return ht(this,(function(h){switch(h.label){case 0:t=e.msit,n=e.mstChallenge,r=e.onSuccess,o=e.onError,i=e.reconnectCount,a=void 0===i?0:i,h.label=1;case 1:return h.trys.push([1,3,,6]),[4,gt(Et("subWindowSubscribe"),{method:"POST",body:JSON.stringify({msit:t,mstChallenge:n})})];case 2:return s=h.sent(),[3,6];case 3:return h.sent(),[4,tn()];case 4:return h.sent(),[4,rn(en,{msit:t,mstChallenge:n,onSuccess:r,onError:o,reconnectCount:a+=1})];case 5:return h.sent(),[2];case 6:return s.status>=500?[4,tn()]:[3,9];case 7:return h.sent(),[4,rn(en,{msit:t,mstChallenge:n,onSuccess:r,onError:o,reconnectCount:a+=1})];case 8:return h.sent(),[3,20];case 9:return s.status>=400&&500>s.status?[4,nn(s)]:[3,11];case 10:return(c=h.sent())?(u=c.errorDetail,o(ce(B,u))):o(ce("UNKNOWN","Some error happened in the server")),[3,20];case 11:return 200!==s.status?[3,19]:[4,nn(s)];case 12:return(c=h.sent())?[3,13]:(o(ce("UNKNOWN","Some error happened in the server")),[3,18]);case 13:switch(l=c.status,f=c.result,l){case"error":return[3,14];case"close":case z:case Z:return[3,16]}return[3,17];case 14:return[4,rn(en,{msit:t,mstChallenge:n,onSuccess:r,onError:o,reconnectCount:a})];case 15:return h.sent(),[3,18];case 16:return r(l,f),[3,18];case 17:o(ce("UNKNOWN","Some error happened in the server")),h.label=18;case 18:return[3,20];case 19:o(ce("UNKNOWN","Some error happened in the server")),h.label=20;case 20:return[2]}}))}))}function tn(){return new Promise((function(e){return setTimeout(e,1e3)}))}function nn(e){return ft(this,void 0,void 0,(function(){return ht(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.json()];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}}))}))}function rn(e,t){return ft(this,void 0,void 0,(function(){return ht(this,(function(n){switch(n.label){case 0:return t.reconnectCount>=10?(t.onError(ce("UNKNOWN","Failed to connect")),[3,3]):[3,1];case 1:return[4,e(t)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}function on(e){var t={};return Object.keys(e).forEach((function(n){"closeButtonColor"===n?"white"===e[n]?t[n]="#ffffff":t[n]="#000000":t[n]=e[n]})),t}var an={height:"full",closeButtonPosition:"right",closeButtonColor:"black",closeButtonLabel:""};function sn(){if(!ot())throw ce("UNAUTHORIZED","this api can be only called in child window")}function un(e){if(!e.mst||!e.status)return Promise.reject(ce(B,"no proper argument"));var t=JSON.stringify(e);return mt(Et("subWindowPost"),{method:"POST",body:t})}function cn(e){var t=e.msit,n=e.mstVerifier;return t&&n?mt(Et("subWindowGetMSTByMSIT"),{method:"POST",body:JSON.stringify({msit:t,mstVerifier:n})}):Promise.reject(ce(B,"no proper argument"))}function ln(e){var t=e.mst;return t?mt(Et("subWindowGetAppData"),{method:"POST",body:JSON.stringify({mst:t})}):Promise.reject(ce(B,"no proper argument"))}var fn={on:function(e,t){Lt[e]||(Lt[e]=[]),Lt[e].push(t)},off:function(e,t){if(Lt[e]){var n=Lt[e].indexOf(t);n>=0&&Lt[e].splice(n,1)}},open:function(e){if(!lt("subwindowOpen"))throw ce("FORBIDDEN","No permission for liff.subWindow.open()");return function(){if(ot())throw ce("UNAUTHORIZED","this api can be only called in parent window")}(),Oe()?function(e){var t=e.appData,n=e.native,r=Ce().liffId,o=Ue(),i=ge(e.url);if(!r)return Promise.reject(ce("UNAUTHORIZED","liffId is invalid"));if(!o)return Promise.reject(ce("UNAUTHORIZED","mst_challenge is invalid"));if(!i)return Promise.reject(ce(B,"params.url must be liff url"));var a=Object.assign({},an,n);return function(e){var t=e.mainLiffId,n=e.subLiffId,r=e.mstChallenge,o=e.appData,i=e.view;return t&&r?mt(Et("subWindowGetMSIT"),{method:"POST",body:JSON.stringify({mainLiffId:t,subLiffId:n,mstChallenge:r,appData:o,view:i})}):Promise.reject(ce(B,"no proper argument"))}({mainLiffId:r,subLiffId:i,mstChallenge:o,appData:t,view:on(a)}).then((function(t){var n=t.msit;en({msit:n,mstChallenge:o,onSuccess:function(e,t){Nt(e,t)},onError:function(e){Nt("error",e)}}),function(e,t){var n=e.url,r=new URLSearchParams;r.set("msit",t),location.href="liff://subwindow?url="+encodeURIComponent(n)+"&"+r.toString()}(e,n)}))}(e):Yt(e)},cancel:function(e){return void 0===e&&(e={}),sn(),Oe()?function(e){return void 0===e&&(e={}),ft(this,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return(t=Ne())?[4,un({mst:t,status:z,result:e})]:[2,Promise.reject(ce("UNAUTHORIZED","mst is invalid"))];case 1:return n=r.sent(),Ht(!0),[2,n]}}))}))}(e):function(e){return void 0===e&&(e={}),Xt(z,e)}(e)},submit:function(e){return void 0===e&&(e={}),sn(),Oe()?function(e){return void 0===e&&(e={}),ft(this,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return(t=Ne())?[4,un({mst:t,status:Z,result:e})]:[2,Promise.reject(ce("UNAUTHORIZED","mst is invalid"))];case 1:return n=r.sent(),Ht(!0),[2,n]}}))}))}(e):function(e){return void 0===e&&(e={}),Xt(Z,e)}(e)},close:function(){return sn(),Oe()?function(){return ft(this,void 0,void 0,(function(){var e;return ht(this,(function(t){switch(t.label){case 0:return!1!==Gt()?[3,2]:(e=Ne())?[4,un({mst:e,status:"close",result:{}})]:[2,Promise.reject(ce("UNAUTHORIZED","mst is invalid"))];case 1:t.sent(),t.label=2;case 2:return Ft(),[2]}}))}))}():(Ft(),Promise.resolve())},getAppData:function(){return sn(),function(){var e,t=xe(V.APP_DATA);try{e=t?JSON.parse(t):{}}catch(n){e={}}return Promise.resolve(e)}()}};function hn(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function dn(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function pn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function vn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function bn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(vn(arguments[t]));return e}Object.create;var yn=function(){var e=this;this.type="sync",this.fns=new Set,this.on=function(t){e.fns.add(t)},this.call=function(){for(var t,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var i=pn(e.fns),a=i.next();!a.done;a=i.next()){var s=a.value;s.apply(void 0,bn(r))}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}},wn=function(){var e=this;this.type="async",this.fns=new Set,this.on=function(t){e.fns.add(t)},this.call=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return hn(e,void 0,void 0,(function(){var e,n,r,o,i,a;return dn(this,(function(s){switch(s.label){case 0:e=[];try{for(n=pn(this.fns),r=n.next();!r.done;r=n.next())o=r.value,e.push(o.apply(void 0,bn(t)))}catch(u){i={error:u}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(i)throw i.error}}return[4,Promise.all(e)];case 1:return s.sent(),[2]}}))}))}},mn={iconColor:"#111111",statusBarColor:"BLACK",titleTextColor:"#111111",titleSubtextColor:"#B7B7B7",titleButtonColor:"#111111",titleBackgroundColor:"#FFFFFF",progressBarColor:"#06C755",progressBackgroundColor:"#FFFFFF",titleButtonAreaBackgroundColor:"#1FFFFFFF",titleButtonAreaBorderColor:"#26000000",baseBackgroundColor:"#FFFFFF",baseTextColor:"#000000",lightButtonBorderColor:"rgba(0, 0, 0, 0.15)"},gn={iconColor:"#FFFFFF",statusBarColor:"WHITE",titleTextColor:"#FFFFFF",titleSubtextColor:"#949494",titleButtonColor:"#FFFFFF",titleBackgroundColor:"#111111",progressBarColor:"#06C755",progressBackgroundColor:"#111111",titleButtonAreaBackgroundColor:"#1FFFFFFF",titleButtonAreaBorderColor:"#26000000",baseBackgroundColor:"#000000",baseTextColor:"#FFFFFF",lightButtonBorderColor:"rgba(255, 255, 255, 0.5)"};function In(e){var t=Fe(),n=(null==t?void 0:t.menuColorSetting)||{adaptableColorSchemes:["light"],lightModeColor:mn,darkModeColor:gn},r=n.adaptableColorSchemes,o=n.lightModeColor,i=n.darkModeColor,a=r.includes("dark");e.matches&&a?Tn(k(k({},gn),i)):Tn(k(k({},mn),o))}function Tn(e){var t=e.iconColor,n=e.statusBarColor,r=e.titleTextColor,o=e.titleSubtextColor,i=e.titleButtonColor,a=e.titleBackgroundColor,s=e.progressBarColor,u=e.progressBackgroundColor,c=e.titleButtonAreaBackgroundColor,l=e.titleButtonAreaBorderColor,f=e.baseBackgroundColor,h=e.baseTextColor,d=e.lightButtonBorderColor;En("--liff-base-background-color",f),En("--liff-base-text-color",h),En("--liff-base-background-rgb-color",ne(f)),En("--liff-base-text-rgb-color",ne(h)),En("--liff-light-button-border-color",d),En("--liff-title-text-color",r),En("--liff-title-background-color",a),En("--liff-title-button-color",i),En("--liff-icon-color",t),En("--liff-status-bar-color",n),En("--liff-title-subtext-color",o),En("--liff-progress-bar-color",s),En("--liff-progress-background-color",u),En("--liff-title-button-area-background-color",ee(c)),En("--liff-title-button-area-border-color",ee(l))}function En(e,t){document.documentElement.style.setProperty(e,t)}function Sn(e){return P(this,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,Ye()];case 1:return t.sent().install(e),[2]}}))}))}function _n(){return P(this,void 0,void 0,(function(){return C(this,(function(e){switch(e.label){case 0:return[4,mt(Et("certs"))];case 1:return[2,e.sent()]}}))}))}function On(e,t,n){return P(this,void 0,void 0,(function(){var r;return C(this,(function(o){switch(o.label){case 0:return[4,crypto.subtle.importKey("jwk",e,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])];case 1:return r=o.sent(),[4,crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},r,n,t)];case 2:return[2,o.sent()]}}))}))}function kn(e,t){return P(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,l,f,h,d,p,v,b,y;return C(this,(function(w){switch(w.label){case 0:return n=e.split("."),r=x(n,3),o=r[0],i=r[1],a=r[2],s=JSON.parse(Q.decode(o)),u=JSON.parse(Q.decodeUnicode(i)),c=re(Q.decode(a)),l=re(o+"."+i),[4,_n()];case 1:if(f=w.sent(),!(h=f.keys.find((function(e){return e.kid===s.kid}))))return[3,6];if(delete h.alg,"ES256"!==s.alg)throw ce(G,'Invalid "alg" value in ID_TOKEN');d=void 0,w.label=2;case 2:return w.trys.push([2,4,,5]),[4,On(h,l,c)];case 3:return d=w.sent(),[3,5];case 4:throw p=w.sent(),ce(G,"Failed to use Crypto API to verify ID_TOKEN: "+p);case 5:if(d){if(v="https://access.line.me"!==u.iss,b=u.aud!==t,y=1e3*u.exp<Date.now(),v)throw ce(G,'Invalid "iss" value in ID_TOKEN');if(b)throw ce(G,'Invalid "aud" value in ID_TOKEN');if(y)throw ce(G,'Invalid "exp" value in ID_TOKEN');return[2,u]}throw ce(G,"Invalid signature in ID_TOKEN");case 6:throw ce(G,'Invalid "kid" value in ID_TOKEN');case 7:return[2]}}))}))}function Pn(e){var t=e.split(".");if(t[1])try{var n=t[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(window.atob(n))}catch(r){return null}return null}function Cn(e){var t=e.pathname,n=e.query,r="liff://"+t+(n?"?"+de(n):"");location.href=r}var xn=null;function An(){"boolean"==typeof xn&&N.warn("liff.init is not expected to be called more than once"),xn=!!Boolean(xe(V.IS_SUBSEQUENT_LIFF_APP))||!(!Oe()||he(window.location.hash).feature_token||De())&&(Ae(V.IS_SUBSEQUENT_LIFF_APP,!0),!0)}function Fn(){return Boolean(xn)}function jn(e,t){return P(this,void 0,void 0,(function(){var n;return C(this,(function(r){switch(r.label){case 0:return(n=Ne())?[2,n]:e&&t?[4,cn({msit:e,mstVerifier:t})]:[3,2];case 1:return[2,r.sent().mst];case 2:return[2,null]}}))}))}function Ln(e){return mt(Et("apps")+"/"+e+"/featureToken")}function Nn(e){return P(this,void 0,void 0,(function(){var t,n,r,o;return C(this,(function(i){switch(i.label){case 0:return t=he(window.location.hash),n=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var i=function(t){Object.keys(t).filter((function(e){return null!==t[e]&&void 0!==t[e]})).forEach((function(n){e[n]=t[n]}))};try{for(var a=R(r),s=a.next();!s.done;s=a.next()){var u=s.value;i(u)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e}({access_token:Ge(),context_token:xe(V.RAW_CONTEXT),feature_token:De(),id_token:Me(),client_id:xe(V.CLIENT_ID),mst_challenge:Ue(),mst_verifier:xe(V.MST_VERIFIER),msit:xe(V.MSIT)},t),Fn()?Xe()?[4,Ln(e)]:[3,2]:[3,3];case 1:r=i.sent().featureToken,n.feature_token||(n.feature_token=r),i.label=2;case 2:(o=le(e))&&(n.client_id=o),i.label=3;case 3:return[2,n]}}))}))}function Un(e){if(e.persisted&<("multipleLiffTransition"))if("ios"===$e())window.location.reload();else{var t=Ce().liffId,n=De();if(!t)throw ce(M,"Invalid LIFF ID.");if(!n)throw ce("FORBIDDEN","Invalid featureToken for client features");Cn({pathname:"app/"+t,query:{feature_token:n}})}}function Rn(e,t){return P(this,void 0,void 0,(function(){var n,r;return C(this,(function(o){switch(o.label){case 0:return[4,St(e)];case 1:return n=o.sent().client_id,r=le(t),[2,n===r]}}))}))}function Dn(e,t){return P(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,l,f,h,d,p;return C(this,(function(v){switch(v.label){case 0:return[4,new Promise((function(e){var t=Qe();if(!t||Y(t,"9.5.0")<0)e();else if(window._liff&&window._liff.features)e();else{N.debug("cannot find window._liff.features, listen to ready event");var n=function(){N.debug("ready event is fired"),Ct("ready",n),e()};Pt("ready",n)}}))];case 1:return v.sent(),An(),[4,Nn(t.liffId)];case 2:return n=v.sent(),r=n.access_token,o=n.context_token,i=n.feature_token,a=n.id_token,s=n.client_id,u=n.mst_verifier,c=n.mst_challenge,l=n.msit,o&&je(Pn(o)),!ot()&&i&&(function(e,t){lt("multipleLiffTransition")&&Cn({pathname:"app/"+e,query:{feature_token:t}})}(t.liffId,i),Fn()&&Be(i)),c&&function(e){Ae(V.MST_CHALLENGE,e)}(c),u&&function(e){Ae(V.MST_VERIFIER,e)}(u),s&&Re(s),l&&function(e){Ae(V.MSIT,e)}(l),window.addEventListener("pageshow",Un),Xe()?[3,7]:i&&r?[3,5]:Fn()?(f=me(location.href,{"liff.hback":"2"}),e.login({redirectUri:f}),[4,new Promise((function(){}))]):[3,4];case 3:v.sent(),v.label=4;case 4:throw e.login(),ce(M,"Failed to parse feature_token or access_token");case 5:return[4,Rn(r,t.liffId)];case 6:if(!v.sent())throw e.login(),ce(M,"Failed to verify access_token");Be(i),He(r),v.label=7;case 7:return[4,jn(l,u)];case 8:return(h=v.sent())?(function(e){Ae(V.MST,e)}(h),[4,ln({mst:h})]):[3,10];case 9:(d=v.sent().data)&&Le(JSON.stringify(d)),v.label=10;case 10:return a&&!Me()&&We(a),a&&s&&!qe()?[4,kn(a,s)]:[3,12];case 11:(p=v.sent())&&ze(p),v.label=12;case 12:return[2]}}))}))}function Bn(e){return P(this,void 0,void 0,(function(){var t,n,r,o,i,a,s;return C(this,(function(u){switch(u.label){case 0:return t=Et("apps"),n=t+"/"+e+"/contextToken",r=Ge(),o={"Content-Type":"application/json",Accept:"application/json"},r&&(o.Authorization="Bearer "+r),[4,mt(n,{headers:o})];case 1:if(i=u.sent(),!(a=i.contextToken))throw ce(M,"Can not get context from server.");if(!(s=Pn(a)))throw ce(M,"Invalid context token.");return[2,s]}}))}))}function Mn(){return P(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:if(!(e=Ce().liffId))throw ce(M,"Invalid LIFF ID.");return[4,Bn(e)];case 1:return je(t.sent()),[2]}}))}))}function Wn(e){return P(this,void 0,void 0,(function(){var t,n,r,o=this;return C(this,(function(i){switch(i.label){case 0:t=function(){return P(o,void 0,void 0,(function(){var t,n,r,o,i,a;return C(this,(function(s){switch(s.label){case 0:return[4,(u=Ce(),c=he(window.location.search),l=Ke(),f={grant_type:"authorization_code",client_id:c.liffClientId,appId:u.liffId,code:c.code,code_verifier:l.codeVerifier,redirect_uri:u.redirectUri||c.liffRedirectUri,id_token_key_type:"JWK"},h=de(f),mt(Et("token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:h}))];case 1:return t=s.sent(),n=t.access_token,r=t.id_token,o=t.expires_in,Re(e),He(n),function(e){var t=Ce();ie("LIFF_STORE:"+V.EXPIRES+":"+t.liffId,e.getTime(),{expires:e.toUTCString(),path:"/",secure:null})}(new Date(Date.now()+1e3*o)),Je(),r?(We(r),[4,kn(r,e)]):[3,3];case 2:(i=s.sent())&&ze(i),s.label=3;case 3:return(a=he(location.hash).context_token)?(je(Pn(a)),[3,6]):[3,4];case 4:return[4,Mn()];case 5:s.sent(),s.label=6;case 6:return[2]}var u,c,l,f,h}))}))},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t()];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),r=n,Je(),r;case 4:return[2]}}))}))}var Gn=new(function(){function e(){var e=this;this.getAndValidateContext=function(){var e=Fe();if(!e)throw ce(M,"Could not get Context from server.");if(!e.endpointUrl)throw ce(M,"Could not get endpointUrl from server.");if(!e.permanentLinkPattern)throw ce(M,"Could not get permanentLinkPattern from server.");return e},this.decodeState=function(t){var n=e.getAndValidateContext();t=t.replace(/\n/g,"%0D%0A");var r=!n.endpointUrl.startsWith("/?")&&n.endpointUrl.includes("/?")||!n.endpointUrl.startsWith("/#")&&n.endpointUrl.includes("/#")||n.endpointUrl.endsWith("/")||!t.startsWith("/?")&&t.includes("/?")||!t.startsWith("/#")&&t.includes("/#")||t.endsWith("/"),o=new URL(n.endpointUrl),i=o.origin,a=o.pathname,s=o.search,u=new URL(""+i+e.attachSlashAtStart(t)),c=u.pathname,l=u.search,f=u.hash,h=""+s+(s?l.replace(/\?/g,"&"):l),d=(""+a+e.attachSlashAtStart(c)).replace("//","/");return(d=e.attachSlashAtStart(""+d)).endsWith("/")&&!r&&(d=d.substring(0,d.length-1)),(""+i+d+h+f).replace(/%0D%0A/g,"\n")}}return e.prototype.attachSlashAtStart=function(e){return(e&&e.length>0&&!e.startsWith("/")?"/":"")+e},e.prototype.invoke=function(){return P(this,void 0,void 0,(function(){var e,t,n,r,o;return C(this,(function(i){switch(i.label){case 0:if(e=he(window.location.search),"string"!=typeof(t=e["liff.state"]))return[2];i.label=1;case 1:return i.trys.push([1,4,,5]),n=location.href,(r=this.decodeState(t))===n?[3,3]:(e["liff.hback"]?location.replace(me(r,{"liff.hback":e["liff.hback"]})):location.replace(r),[4,new Promise((function(){}))]);case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if((o=i.sent()).code===M)throw o;return N.debug(o),[3,5];case 5:return[2]}}))}))},e}());function Hn(e,t,n){return P(this,void 0,void 0,(function(){var r;return C(this,(function(o){switch(o.label){case 0:if(!t.liffId)throw ce(W,"liffId is necessary for liff.init()");return function(e){Pe=e}(t),!Oe()&&Xe()&&(function(){var e=Ce();return oe("LIFF_STORE:"+V.EXPIRES+":"+e.liffId)}()||et()),r=he(window.location.search),!ot()||Oe()?[3,2]:[4,new Promise((function(e){Zt()?e():window.addEventListener("message",(function t(n){var r=n.data,o=n.source,i=n.origin;if(r){var a=r.type,s=r.message;"healthCheck"===a&&(window.removeEventListener("message",t),s&&Le(s),function(e){zt.setItem("mainWindowOrigin",e)}(i),o&&o.postMessage&&o.postMessage({status:"healthCheck"},i),e())}}))}))];case 1:o.sent(),o.label=2;case 2:if(r.error&&r.liffOAuth2Error)throw s=r.error,u=r.error_description.replace(/\+/g," "),ce(M,s+": "+u);return i=r.code,a=Ke(),Boolean(i&&!Xe()&&a&&a.codeVerifier)?[4,Wn(r.liffClientId)]:[3,4];case 3:o.sent(),o.label=4;case 4:return Oe()?[4,Dn(e,t)]:[3,6];case 5:return o.sent(),[3,8];case 6:return Xe()?[3,8]:[4,Mn()];case 7:o.sent(),o.label=8;case 8:return[4,Gn.invoke()];case 9:return o.sent(),[4,n()];case 10:return o.sent(),function(e){var t=ye(be(e));window.history.replaceState(history.state,"",t)}(window.location.href),[2]}var i,a,s,u}))}))}var Vn=function(){function e(){this.hooks={before:new wn,after:new wn},this.internalHooks={beforeFinished:new wn,beforeSuccess:new wn,error:new wn}}return Object.defineProperty(e.prototype,"name",{get:function(){return"init"},enumerable:!1,configurable:!0}),e.prototype.install=function(e){var t=e.liff;return this.liff=t,this.init.bind(this)},e.prototype.init=function(e,t,n){return P(this,void 0,void 0,(function(){var r;return C(this,(function(o){switch(o.label){case 0:return[4,this.hooks.before.call()];case 1:o.sent(),i=this.liff,window&&!window.liff&&(window.liff=i),o.label=2;case 2:return o.trys.push([2,11,,13]),[4,Promise.all([Sn(this.liff),Hn(this.liff,e,this.internalHooks.beforeFinished.call)])];case 3:return o.sent(),function(){var e;En("color-scheme",((null==(e=Fe())?void 0:e.menuColorSetting)||{adaptableColorSchemes:["light"]}).adaptableColorSchemes.join(" "));var t=window.matchMedia("(prefers-color-scheme: dark)");In({matches:null==t?void 0:t.matches,media:null==t?void 0:t.media}),t.addEventListener?t.addEventListener("change",In):t.addListener&&t.addListener(In)}(),[4,this.internalHooks.beforeSuccess.call()];case 4:if(o.sent(),!e.withLoginOnExternalBrowser||Xe())return[3,8];if(!xe(V.AUTOLOGIN_ATTEMPT))return[3,5];throw ce(M,"Auto login failure");case 5:return Ae(V.AUTOLOGIN_ATTEMPT,!0),this.liff.login(),[4,new Promise((function(){}))];case 6:o.sent(),o.label=7;case 7:return[3,9];case 8:e.withLoginOnExternalBrowser&&Ae(V.AUTOLOGIN_ATTEMPT,!1),o.label=9;case 9:return[4,this.hooks.after.call()];case 10:return o.sent(),"function"==typeof t&&t(),Ee(),[3,13];case 11:return r=o.sent(),[4,this.internalHooks.error.call(r)];case 12:throw o.sent(),"function"==typeof n&&n(r),r;case 13:return[2]}var i}))}))},e}();function Kn(){return"2.19.0"}var Jn=n(4),qn=n.n(Jn),zn=function(){function e(){this.hooks={before:new yn}}return Object.defineProperty(e.prototype,"name",{get:function(){return"login"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return this.login.bind(this)},e.prototype.login=function(e){this.hooks.before.call(e);var t,n,r=ve(43),o=(t=qn()(r),n="",t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(e){n+=String.fromCharCode(parseInt(e))})),window.btoa(n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),i=Ce();if(!i||!i.liffId)throw ce(W,"You need to define `liffId` for liff.login()");var a={app_id:i.liffId,state:ve(12),response_type:"code",code_challenge_method:"S256",code_challenge:o,liff_sdk_version:"2.19.0"};e&&e.redirectUri&&(a.redirect_uri=e.redirectUri),ot()&&!Oe()&&(a.disable_auto_login="true"),function(e){Ae(V.LOGIN_TMP,e)}({codeVerifier:r});var s=Et("authorize")+"?"+de(a);N.debug("[Redirect] "+s),window.location.href=s},e}();function Zn(){return mt(Et("profile"))}Object.create;function Xn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var $n=function(e){return"object"==typeof e&&null!==e&&function(e){return"string"==typeof e||e instanceof String}(e.type)};function Qn(e){return Promise.reject(ce(B,e))}var Yn=function(e){if("403"===e.code){var t="12.0.0"===Qe(),n="ios"===$e(),r=Te();t&&(n||r)&&window.alert("LINEアプリをLINE 12.0.1以降にアップデートしてください。\nPlease update your LINE app to LINE 12.0.1 or later.")}throw e};var er=function(){return(er=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;function tr(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var nr=function(){function e(){this.modules=new Map,this.hooks={},this.internalHooks={}}return e.prototype.addModule=function(e,t){this.modules.set(e,t),t.hooks&&(this.hooks[e]=Object.entries(t.hooks).reduce((function(e,t){var n,r=tr(t,2),o=r[0],i=r[1];return er(er({},e),((n={})[o]=i.on.bind(i),n))}),{})),t.internalHooks&&(this.internalHooks[e]=Object.entries(t.internalHooks).reduce((function(e,t){var n,r=tr(t,2),o=r[0],i=r[1];return er(er({},e),((n={})[o]=i.on.bind(i),n))}),{}))},e.prototype.hasModule=function(e){return this.modules.has(e)},e}(),rr=function(){function e(e,t,n){this.driver=e,this.context=t,this.option=n}return e.prototype.install=function(){return this.factory(this.driver,this.context)},Object.defineProperty(e.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),e.prototype.factory=function(e,t){var n=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(r,o){if(!r||"function"!=typeof r.install||"string"!=typeof r.name)return N.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var i=""+n+r.name;if(e.hasModule(i))return this;var a=r.install.call(r,t,o);return this[""+i]?(N.warn("There is a duplicate plugin name. `"+i+"` plugin namespace will be override."),this[""+i]=a):void 0!==a&&(this[""+i]=a),e.addModule(i,r),this}},e}();var or=function(){return(or=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ir(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function ar(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;Object.create;function sr(){return ir(this,void 0,void 0,(function(){var e,t;return ar(this,(function(n){switch(n.label){case 0:if(!Xe())return[3,6];n.label=1;case 1:return n.trys.push([1,5,,6]),(e=qe())&&e.sub?[2,e.sub]:[3,2];case 2:return[4,Zn()];case 3:if((t=n.sent())&&t.userId)return[2,t.userId];n.label=4;case 4:return[3,6];case 5:return n.sent(),N.debug("can't retrieve Mid/Uid because of something wrong"),[3,6];case 6:return[2]}}))}))}function ur(){return ir(this,void 0,void 0,(function(){var e;return ar(this,(function(t){switch(t.label){case 0:return[4,sr()];case 1:return(e=t.sent())&&"u"===e.substring(0,1)?[2,e]:[2]}}))}))}var cr=function(){function e(){this.utsExtra={isLiffSuccessful:!1,isLoggedIn:!1,id:"",version:""},this.injected=!1}return Object.defineProperty(e,"CUSTOMPLACEID_INIT",{get:function(){return"liff.init"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CUSTOMTYPE",{get:function(){return"liffSdk"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"GENERAL_UTS_ID",{get:function(){return"liff_general"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"GENERAL_APP_NAME",{get:function(){return"LIFF General"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LiffUtsLoginStatus",{get:function(){return{isLoggedIn:1,isLiffSuccessful:2}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return"analytics"},enumerable:!1,configurable:!0}),e.prototype.install=function(e){var t=e.liff,n=e.internalHooks;this.liffCore=t,n.init.beforeFinished(this.beforeInitFinished.bind(this)),n.init.beforeSuccess(this.beforeInitSuccess.bind(this)),n.init.error(this.initError.bind(this))},e.prototype.changeRatioToUTSFormat=function(e){if(e&&Number.isFinite(e))return Math.round(100*e)},e.prototype.setExtra=function(){var t=this.utsExtra,n=t.isLiffSuccessful,r=t.isLoggedIn,o=t.id,i=t.version,a=(r?e.LiffUtsLoginStatus.isLoggedIn:0)|(n?e.LiffUtsLoginStatus.isLiffSuccessful:0);this.uts.setExtra("liff",{id:o,loginStatus:a,version:i})},e.prototype.assignUtsExtra=function(e){Object.assign(this.utsExtra,e)},e.prototype.setVersion=function(e){this.assignUtsExtra({version:e}),N.debug("[LIFFUTS][SDK version] "+e),this.setExtra()},e.prototype.setLiffId=function(e){this.assignUtsExtra({id:e}),N.debug("[LIFFUTS][LIFFID] "+e),this.setExtra()},e.prototype.setIsLoggedIn=function(e){this.assignUtsExtra({isLoggedIn:e}),N.debug("[LIFFUTS][isLoggedIn] "+e),this.setExtra()},e.prototype.sendLiffInit=function(){N.debug("[LIFFUTS][sendCustom] liff.init"),this.uts.sendCustom({type:e.CUSTOMTYPE,params:{placeId:e.CUSTOMPLACEID_INIT}})},e.prototype.setIsLiffSuccessful=function(e){this.assignUtsExtra({isLiffSuccessful:e}),N.debug("[LIFFUTS][isLiffInitSuccessful] "+e),this.setExtra()},e.prototype.prepareReferrer=function(e){var t={};Object.keys(e).forEach((function(n){if(q.includes(n)){var r=e[n];"string"==typeof r&&r&&(t[n.replace(/^liff\.ref\./,"")]=r)}})),Object.keys(t).length>0&&(this.referrer=t)},e.prototype.beforeInitFinished=function(){return ir(this,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,l,f,h,d;return ar(this,(function(p){switch(p.label){case 0:if(t=he(window.location.search),this.prepareReferrer(t),n=Fe(),!(r=null==n?void 0:n.utsTracking))return[2];if("auto"!==(o=r.mode)&&"force"!==o)return[3,6];N.debug("[LIFFUTS] "+(new Date).toUTCString()),i=Ce(),a=i.liffId,s=i.analytics,p.label=1;case 1:return p.trys.push([1,3,,4]),u=this,[4,new Promise((function(e,t){var n=window.uts,r=document.createElement("script");r.type="text/javascript",r.src="https://static.line-scdn.net/uts/edge/4.1.0/uts.js",r.onload=function(){var t=window.uts;e(t),window.uts=n},r.onerror=function(e){t(e)},document.getElementsByTagName("head")[0].appendChild(r)}))];case 2:return u.uts=p.sent(),[3,4];case 3:return c=p.sent(),N.debug("[LIFFUTS] cannot load UTS, reason: "+c),[2];case 4:return l=void 0,f=void 0,"force"===o?(l={utsId:e.GENERAL_UTS_ID,appName:e.GENERAL_APP_NAME,appEnv:"release"},f={endpoint:"https://uts-front.line-apps.com",sampleRate:this.changeRatioToUTSFormat(r.sendRatio),version:"current"}):(l=or(or({},null==s?void 0:s.context),{utsId:(null==s?void 0:s.context.utsId)||e.GENERAL_UTS_ID,appName:(null==s?void 0:s.context.appName)||e.GENERAL_APP_NAME,appEnv:(null==s?void 0:s.context.appEnv)||"release"}),f=or(or({endpoint:"https://uts-front.line-apps.com"},null==s?void 0:s.options),{sampleRate:this.changeRatioToUTSFormat(r.sendRatio),version:"current"})),this.uts.init(l,f),[4,ur()];case 5:(h=p.sent())&&(N.debug("[LIFFUTS][mid] "+h),this.uts.setMid(h)),(null==n?void 0:n.tid)&&(N.debug("[LIFFUTS][tid] "+n.tid),this.uts.setTid(n.tid)),this.referrer&&(N.debug("liff.ref.referrer",this.referrer),this.uts.setSessionParams(this.referrer)),a&&this.setLiffId(a),this.setIsLoggedIn(Xe()),this.setVersion("2.19.0"),d=be(location.href),N.debug("[LIFFUTS][url] "+d),this.uts.setUrl(d),this.liffCore.analytics=this.uts,this.injected=!0,p.label=6;case 6:return[2]}}))}))},e.prototype.beforeInitSuccess=function(){return this.injected&&(this.setIsLiffSuccessful(!0),this.sendLiffInit()),Promise.resolve()},e.prototype.initError=function(){return this.injected&&(this.setIsLiffSuccessful(!1),this.sendLiffInit()),Promise.resolve()},e}();function lr(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function fr(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;Object.create;function hr(e){return lr(this,void 0,void 0,(function(){var t;return fr(this,(function(n){switch(n.label){case 0:return[4,fetch(Et("permanentLink"),{headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",body:JSON.stringify(e)})];case 1:return(t=n.sent()).ok?[3,3]:[4,t.json()];case 2:throw ce("UNKNOWN",n.sent().message);case 3:return[4,t.json()];case 4:return[2,n.sent()]}}))}))}var dr=new(function(){function e(){var e=this;this.extraParams="",this.getAndValidateContext=function(){var e=Fe();if(!e)throw ce(M,"Could not get Context from server.");if(!e.endpointUrl)throw ce(M,"Could not get endpointUrl from server.");if(!e.permanentLinkPattern)throw ce(M,"Could not get permanentLinkPattern from server.");return e},this.createUrl=function(){var t=e.getAndValidateContext(),n=window.location,r=n.pathname,o=n.search,i=n.hash,a=n.origin,s=new URL(t.endpointUrl);if(s.origin!==a||!e.isAncestor(s.pathname,r))throw ce(W,"Current page is not under entrypoint.");var u=r.substring(s.pathname.length);u.length>0&&"/"!==u[0]&&(u="/"+u);var c=new RegExp("^"+J.join("|")),l=i.substring(1).split("&").filter((function(e){return!c.test(e)&&Boolean(e)})).join("&"),f=l===s.hash.substring(1)?"":l,h=function(e){return e.substring(1).split("&").filter((function(e){return!/liff\.state/.test(e)&&Boolean(e)}))},d=h(o),p=h(s.search);e.extraParams&&d.push(e.extraParams);for(var v=0;v<p.length;v++){var b=p[v],y=d.indexOf(b);y>-1&&d.splice(y,1)}var w=d.join("&"),m=u+(""!==w?"?"+w:"")+(f?"#"+f:"");return"https://liff.line.me/"+Ce().liffId+m},this.createUrlBy=function(t){return lr(e,void 0,void 0,(function(){var e,n;return fr(this,(function(r){switch(r.label){case 0:if(!(e=Ce().liffId))throw ce(M,"Should run after liff init.");try{n=new URL(t)}catch(L){throw ce(B,"invalid URL.")}return[4,hr({liffId:e,currentPageUrl:n.toString()})];case 1:return[2,r.sent().permanentLinkUrl]}}))}))},this.setExtraQueryParam=function(t){e.extraParams=t},this.isAncestor=function(e,t){return 0===t.indexOf(e)&&(e.endsWith("/")&&(e=e.substring(0,e.length-1)),void 0===t[e.length]||"/"===t[e.length])},this.install=function(){return{createUrl:e.createUrl,createUrlBy:e.createUrlBy,setExtraQueryParam:e.setExtraQueryParam}}}return Object.defineProperty(e.prototype,"name",{get:function(){return"permanentLink"},enumerable:!1,configurable:!0}),e}());function pr(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function vr(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;Object.create;var br,yr=function(){function e(e,t){var n=this;this.resolve=e,this.reject=t,this.onSubmit=function(e){var t=e.message;n.resolve({value:t}),n.destroy()},this.onClose=function(){n.resolve({value:null}),n.destroy()},this.onCancel=function(){n.resolve({value:null}),n.destroy()},this.onError=function(e){n.reject(e),n.destroy()},this.start()}return e.prototype.start=function(){fn.on("submit",this.onSubmit),fn.on("close",this.onClose),fn.on("cancel",this.onCancel),fn.on("error",this.onError)},e.prototype.destroy=function(){fn.off("submit",this.onSubmit),fn.off("close",this.onClose),fn.off("cancel",this.onCancel),fn.off("error",this.onError),br=void 0},e}();function wr(){return pr(this,void 0,void 0,(function(){return vr(this,(function(e){if(!lt("subwindowOpen")||!lt("scanCodeV2"))throw ce("FORBIDDEN","No permission for liff.scanCodeV2()");return br&&br.destroy(),[2,new Promise((function(e,t){br=new yr(e,t),fn.open({url:"https://liff.line.me/1656359117-jxmx5e11"}).catch((function(e){null==br||br.destroy(),t(e)}))}))]}))}))}var mr=new(function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return"scanCodeV2"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return wr},e}());function gr(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Ir(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Tr(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Er(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Sr(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Er(arguments[t]));return e}Object.create;function _r(e){return gr(this,void 0,void 0,(function(){var t,n,r,o,i,a,s;return Ir(this,(function(u){switch(u.label){case 0:return function(e){if(!X.includes(e))throw ce(B,"Unexpected permission name.");var t=Fe();return!!(null==t?void 0:t.scope.includes(e))}(e)?(t=Ge())?[4,St(t)]:[3,2]:[2,{state:"unavailable"}];case 1:n=u.sent(),r=unescape(n.scope).split(" ");try{for(o=Tr(r),i=o.next();!i.done;i=o.next())if(i.value.includes(e))return[2,{state:"granted"}]}catch(c){a={error:c}}finally{try{i&&!i.done&&(s=o.return)&&s.call(o)}finally{if(a)throw a.error}}return[2,{state:"prompt"}];case 2:throw ce("UNAUTHORIZED","LiffId is not found.")}}))}))}function Or(){var e,t,n=Fe();return!!n&&"square_chat"!==n.type&&(lt("skipChannelVerificationScreen")||!Oe()&&(null===(t=null===(e=n.availability)||void 0===e?void 0:e.skipChannelVerificationScreen)||void 0===t?void 0:t.permission))}function kr(){var e=Ce().liffId;if(e)return mt(Et("unauthorizedPermissions")+"?liffId="+e,{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+Ge()}});throw ce("UNAUTHORIZED","liffId is required")}var Pr,Cr=fn.on,xr=fn.off,Ar=fn.open,Fr=function(){function e(e,t){var n=this;this.onSubmit=function(e){var t=e.newAccessToken,r=e.ICA_ERROR;return gr(n,void 0,void 0,(function(){return Ir(this,(function(e){return t?this.resolve({newAccessToken:t}):r&&this.reject(ce("UNKNOWN",r)),this.teardown(),[2]}))}))},this.onClose=function(){return gr(n,void 0,void 0,(function(){return Ir(this,(function(e){return this.reject(ce("UNAUTHORIZED","user didn't allow the agreement")),this.teardown(),[2]}))}))},this.onCancel=function(){return gr(n,void 0,void 0,(function(){return Ir(this,(function(e){return this.reject(ce("UNAUTHORIZED","user didn't allow the agreement")),this.teardown(),[2]}))}))},this.onError=function(e){return gr(n,void 0,void 0,(function(){return Ir(this,(function(t){return this.reject(e),this.teardown(),[2]}))}))},this.resolve=e,this.reject=t,this.setup()}return e.prototype.setup=function(){Cr("submit",this.onSubmit),Cr("close",this.onClose),Cr("cancel",this.onCancel),Cr("error",this.onError)},e.prototype.teardown=function(){xr("submit",this.onSubmit),xr("close",this.onClose),xr("cancel",this.onCancel),xr("error",this.onError),Pr=void 0},e.prototype.open=function(){var e=Ce().liffId;e?Ar({url:"https://liff.line.me/1656032314-Xgrw5Pmk",appData:{liffId:e,channelId:le(e),accessToken:Ge()}}):this.reject(ce("UNAUTHORIZED","liffId is required"))},e}();function jr(){return gr(this,void 0,void 0,(function(){var e;return Ir(this,(function(t){switch(t.label){case 0:if(!Or())throw ce("FORBIDDEN","SkipChannelVerificationScreen is unavailable.");return Pr&&Pr.teardown(),[4,kr()];case 1:return e=t.sent(),(Oe()?e:e.filter((function(e){return"chat_message.write"!==e}))).length>0?[4,new Promise((function(e,t){(Pr=new Fr(e,t)).open()}))]:[3,3];case 2:return He(t.sent().newAccessToken),[3,4];case 3:throw ce("FORBIDDEN","All permissions have already been approved.");case 4:return[2]}}))}))}function Lr(e,t){var n=this;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return gr(n,void 0,void 0,(function(){var n,o,i;return Ir(this,(function(a){switch(a.label){case 0:return n=(r.length>0?r[r.length-1]:{}).ignorePermissionCheck,o=void 0!==n&&n,[4,_r(t)];case 1:if("unavailable"!==(i=a.sent().state))return[3,2];throw ce("FORBIDDEN","The permission is not in LIFF app scope.");case 2:return"prompt"!==i||!Or()||o||!Oe()&&"chat_message.write"===t?[3,4]:[4,jr()];case 3:return a.sent(),[3,5];case 4:o&&r.pop(),a.label=5;case 5:return[4,e.apply(void 0,Sr(r))];case 6:return[2,a.sent()]}}))}))}}var Nr=new(function(){function e(){this.name="permission"}return e.prototype.install=function(){return{query:_r,requestAll:jr}},e}());function Ur(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Rr(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;Object.create;Object.create;function Dr(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var Br={};function Mr(e,t){var n=Br,r=Dr(t.split("."),1)[0],o=n[t];o&&e.removeEventListener(r,o),n[t]=null}var Wr=!1,Gr=!1;function Hr(e,t,n,r){if(void 0===n&&(n={}),"object"!=typeof e||!e.postMessage)throw ce(B,"target must be window object");if("string"!=typeof t)throw ce(B,"keyname must be string");if("object"!=typeof n)throw ce(B,"incorrect body format. It should be Object or Array comprised of Object");if(!r)throw ce(B,"serverEndPointUrl isn't passed. please fill up with proper url");if("*"===r)throw new Error("serverEndPointUrl doesn't allow to set '*'");var o={name:t,body:n};e.postMessage(o,r)}function Vr(e,t,n,r){!function(e,t,n,r){Wr||(Gr=function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return e=!0,!1}});window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch(t){e=!1}return e}(),Wr=!0);var o=Dr(t.split("."),1)[0];new Promise((function(i){var a=function(o){i(o),n&&n(o),r&&r.once&&Mr(e,t)};!function(e,t){Br[e]=t}(t,a),e.addEventListener(o,a,!!Gr&&r)}))}(e,"message."+t,function(e,t,n){return function(r){N.debug("messageReceive",r),r.origin===n&&r.data.name===e&&t(r)}}(t,n,r))}var Kr=function(){function e(){this.payloadToShareTargetPicker=null,this.popupWindow=null,this.doesWaitForSubwindowResult=!1}return e.getInstance=function(){return e.instance?e.instance.reset():e.instance=new e,e.instance},e.prototype.init=function(e){return Ur(this,void 0,void 0,(function(){var t,n;return Rr(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.liffId=e.referrer.liffId,this.doesWaitForSubwindowResult=!(!e.options||!e.options.waitForSubwindowResult),this.allowPostMessageOrigin=this.initAllowPostMessageOrigin(),this.payloadToShareTargetPicker=this.buildPayloadToShareTargetPicker(e),window.AbortController&&(this.abortController=new window.AbortController),this.prepareAnotherWindow(),[4,this.initOtt()];case 1:return r.sent(),this.initListener(),this.openAnotherWindow(),this.doesWaitForSubwindowResult?[4,this.pollingShareResult()]:[3,3];case 2:return t=r.sent(),this.finalize(),[2,t];case 3:return[2];case 4:return[3,6];case 5:if(n=r.sent(),this.finalize(),"AbortError"!==n.name)throw n;return[3,6];case 6:return[2]}}))}))},e.prototype.resetAllVariables=function(){this.liffId="",this.allowPostMessageOrigin="",this.payloadToShareTargetPicker=null,this.ott="",this.popupWindow=null,this.timeoutIDForHealthCheck=null,this.abortController=null,this.internalError=null,this.doesWaitForSubwindowResult=!1},e.prototype.reset=function(){this.finalize(),this.resetAllVariables()},e.prototype.finalize=function(){var e,t;this.abortController&&this.abortController.abort(),Oe()||(e=this.timeoutIDForHealthCheck,t=this.popupWindow,Mr(window,"message.receivedHealthcheck"),e&&clearTimeout(e),t&&!t.closed&&t.close())},e.prototype.buildPayloadToShareTargetPicker=function(e){return{messages:e.messages,isMultiple:e.isMultiple,referrer:e.referrer}},e.prototype.initAllowPostMessageOrigin=function(e){return void 0===e&&(e=Et("shareTargetPicker")),function(e){var t=e.match(/^(https?:\/\/.*?)\//);return t&&t[1]||""}(e)},e.prototype.initOtt=function(){return Ur(this,void 0,void 0,(function(){var e,t,n;return Rr(this,(function(r){switch(r.label){case 0:return this.abortController&&(e=this.abortController.signal),t=Et("shareTargetPickerOtt")+"/"+this.liffId+"/ott",n=this,[4,mt(t,{method:"GET",signal:e}).then((function(e){return e.ott}))];case 1:return n.ott=r.sent(),[2]}}))}))},e.prototype.prepareAnotherWindow=function(){Oe()||("ios"!==$e()||Te()?this.popupWindow=window.open("","liffpopup","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):this.popupWindow=window.open())},e.prototype.openAnotherWindow=function(){if(Oe()&&this.payloadToShareTargetPicker)e=this.liffId,t=this.ott,n=this.payloadToShareTargetPicker,r={liffId:e,ott:t,data:JSON.stringify(n),closeModals:!1},location.href="line://picker?"+de(r);else{if(this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),!this.popupWindow)throw ce("CREATE_SUBWINDOW_FAILED");!function(e,t,n){var r={liffId:t,ott:n};e.location.href=Et("shareTargetPicker")+"?"+de(r)}(this.popupWindow,this.liffId,this.ott)}var e,t,n,r},e.prototype.initListener=function(){var e,t;Oe()||(e=this.onReceivedHealthcheck.bind(this),t=this.allowPostMessageOrigin,Vr(window,"receivedHealthcheck",e,t))},e.prototype.healthCheck=function(){return Ur(this,void 0,void 0,(function(){var e;return Rr(this,(function(t){switch(t.label){case 0:if(this.popupWindow&&!this.popupWindow.closed)return[3,7];if(!this.doesWaitForSubwindowResult)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.onCanceled()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.internalError=e,[3,4];case 4:return[3,6];case 5:this.finalize(),t.label=6;case 6:return[3,8];case 7:Hr(this.popupWindow,"healthcheck",void 0,this.allowPostMessageOrigin),this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),t.label=8;case 8:return[2]}}))}))},e.prototype.onReceivedHealthcheck=function(){if(!this.popupWindow||!this.payloadToShareTargetPicker)throw ce("CREATE_SUBWINDOW_FAILED");Hr(this.popupWindow,"ready",this.payloadToShareTargetPicker,this.allowPostMessageOrigin)},e.prototype.onCanceled=function(){return Ur(this,void 0,void 0,(function(){var e,t;return Rr(this,(function(n){switch(n.label){case 0:if(Oe()||!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(e=this.abortController.signal),t={liffId:this.liffId,ott:this.ott},[4,mt(Et("shareTargetPickerResult")+"?"+de(t),{method:"POST",signal:e,headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"result=CANCEL"})];case 1:return[2,"ok"===n.sent().status]}}))}))},e.prototype.getShareResult=function(){return Ur(this,void 0,void 0,(function(){var e,t;return Rr(this,(function(n){if(!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(e=this.abortController.signal),t={liffId:this.liffId,ott:this.ott},N.debug("fetch: getShareResult"),[2,mt(Et("shareTargetPickerResult")+"?"+de(t),{method:"GET",headers:{Accept:"application/json"},signal:e})]}))}))},e.isPollingTimeOut=function(e,t){return(t-e)/6e4>=10},e.prototype.pollingShareResult=function(){return Ur(this,void 0,void 0,(function(){var t,n;return Rr(this,(function(r){switch(r.label){case 0:t=Date.now(),r.label=1;case 1:if(e.isPollingTimeOut(t,Date.now()))return[3,4];if(this.internalError)throw this.internalError;return[4,this.getShareResult()];case 2:if((n=r.sent())&&n.result)switch(n.result){case"SUCCESS":return[2,{status:"success"}];case"CANCEL":return[2];case"FAILURE":default:throw new Error(n.resultDescription)}return[4,new Promise((function(e){setTimeout(e,500)}))];case 3:return r.sent(),[3,1];case 4:throw new Error("Timeout: not finished within 10min")}}))}))},e}(),Jr=new(function(){function e(){var e=this;this.name="shareTargetPicker",this.shareTargetPicker=function(t,n){return void 0===n&&(n={}),Ur(e,void 0,void 0,(function(){var e,r,o,i,a,s,u;return Rr(this,(function(c){switch(c.label){case 0:if(e=void 0===n.isMultiple||n.isMultiple,this.checkPermission(),!Xe())throw ce("UNAUTHORIZED","Need access_token for api call, Please login first");if(!t||!Array.isArray(t)||0===t.length)throw ce(B,"no proper argument");if(t.length>5)throw ce(B,"exceed the limit of num of messages");if(!(r=Ce().liffId))throw ce(W);window.liff&&(o=window.liff).analytics&&function(e){N.debug("[LIFFUTS][sendCustom] liff.shareTargetPicker"),e.sendCustom({type:"liffSdk",params:{placeId:"liff.shareTargetPicker"}})}(o.analytics),c.label=1;case 1:return c.trys.push([1,3,,4]),i=Kr.getInstance(),a=Qe(),s={waitForSubwindowResult:!0},Oe()&&a&&Y(a,"10.11.0")<0&&(s.waitForSubwindowResult=!1),[4,i.init({messages:t,isMultiple:e,referrer:{liffId:r,url:location.origin},options:s})];case 2:return[2,c.sent()];case 3:throw(u=c.sent())instanceof ue?u:ce(H,u.message);case 4:return[2]}}))}))},this.checkPermission=function(){if(ot())throw ce("FORBIDDEN","The operation is not allowed in the SubWindow");var e=((Fe()||{}).availability||{}).shareTargetPicker||{},t=e.permission,n=e.minVer;if(!t)throw Oe()?ce("FORBIDDEN","Need LINE App "+n+" at least or consent on shareTargetPicker usage on LINE developer site"):ce("FORBIDDEN","Need consent on shareTargetPicker usage on LINE developer site")}}return e.prototype.install=function(){return this.shareTargetPicker},e}()),qr=Object.defineProperties({},{getOS:{value:$e,enumerable:!0,writable:!0},getVersion:{value:Kn,enumerable:!0,writable:!0},getLanguage:{value:function(){return navigator.language},enumerable:!0,writable:!0},isInClient:{value:Oe,enumerable:!0,writable:!0},isLoggedIn:{value:Xe,enumerable:!0,writable:!0},logout:{value:et,enumerable:!0,writable:!0},getAccessToken:{value:Ge,enumerable:!0,writable:!0},getIDToken:{value:Me,enumerable:!0,writable:!0},getDecodedIDToken:{value:qe,enumerable:!0,writable:!0},getContext:{value:Fe,enumerable:!0,writable:!0},openWindow:{value:function(e){if(!function(e){if(!e||"object"!=typeof e)return!1;var t=e,n=t.url,r=Xn([typeof n,typeof t.external],2),o=r[0],i=r[1];return"string"===o&&""!==n&&("undefined"===i||"boolean"===i)}(e))throw ce(B,"Invalid parameters for liff.openWindow()");var t=Qe();if(Oe())if(null!==t&&"ios"===$e()&&Y(t,"9.19")>=0||!window._liff.postMessage){var n=e.url,r=e.external,o=void 0!==r&&r;window.open(function(e,t){var n,r,o,i,a,s,u,c,l,f;return-1!==(f=e).indexOf("#")&&-1!==f.indexOf("?")&&f.indexOf("#")<f.indexOf("?")||function(e){return-1===e.indexOf("?")&&-1!==e.indexOf("#")}(e)?(u=(n=Xn(e.split("#"),2))[0],c=(o=Xn((void 0===(r=n[1])?"":r).split("?"),2))[0],l=o[1]):(u=(i=Xn(e.split("?"),2))[0],l=(s=Xn((void 0===(a=i[1])?"":a).split("#"),2))[0],c=s[1]),u+"?is_liff_external_open_window="+!!t+function(e,t){return e?"&"+e.split("&").filter((function(e){return-1===e.indexOf("is_liff_external_open_window")})).join("&").concat(t?"#"+t:""):t?"#"+t:""}(l,c)}(n,o))}else At("openWindow",e);else window.open(e.url,"_blank")},enumerable:!0,writable:!0},closeWindow:{value:Ft,enumerable:!0,writable:!0},getFriendship:{value:Lr((function(){return mt(Et("friendship"))}),"profile"),enumerable:!0,writable:!0},getAId:{value:function(){return((Fe()||{}).d||{}).aId},enumerable:!0,writable:!0},getProfilePlus:{value:function(){return(Fe()||{}).profilePlus},enumerable:!0,writable:!0},getIsVideoAutoPlay:{value:function(){return((Fe()||{}).d||{}).autoplay||!1},enumerable:!0,writable:!0},getLineVersion:{value:Qe,enumerable:!0,writable:!0},isApiAvailable:{value:lt,enumerable:!0,writable:!0},getProfile:{value:Lr(Zn,"profile"),enumerable:!0,writable:!0},sendMessages:{value:Lr((function(e){if(!function(e){return Array.isArray(e)&&e.every($n)}(e))return Qn("Parameter 'messages' must be an array of { type, ... }");var t=e.length;return t<1||t>5?Qn("Number of messages should be in range 1 to 5."):mt(Et("message"),{method:"POST",body:JSON.stringify({messages:e})}).catch(Yn)}),"chat_message.write"),enumerable:!0,writable:!0},subWindow:{value:fn,enumerable:!0,writable:!0},ready:{value:Se,enumerable:!0,writable:!0},id:{get:function(){return Ce().liffId||null},enumerable:!0},_dispatchEvent:{value:function(e){var t={};try{t=JSON.parse(e)}catch(r){throw ce(B,r.message)}var n=new CustomEvent("liffEvent",{detail:t});N.debug("[client dispatchEvent to js]",{type:n.type,detail:n.detail}),window.dispatchEvent(n)},enumerable:!0,writable:!0},_call:{value:At,enumerable:!0,writable:!0},_addListener:{value:Pt,enumerable:!0,writable:!0},_removeListener:{value:Ct,enumerable:!0,writable:!0},_postMessage:{value:xt,enumerable:!0,writable:!0}}),zr=new nr,Zr=new rr(zr,new function(e,t){this._driver=e,this.liff=t,this.hooks=this._driver.hooks,this.internalHooks=this._driver.internalHooks}(zr,qr),{namespacePrefix:""}).install();[new rr(zr,new function(e,t){this._driver=e,this.liff=t,this.hooks=this._driver.hooks}(zr,qr)),new zn,new Vn,new cr,mr,dr,rt,Nr,Jr].forEach((function(e){Zr.call(qr,e)}));var Xr=qr;t.default=Xr}]).default})); |